n8n 2.36.7 → 2.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/start.js +1 -2
- package/dist/commands/start.js.map +1 -1
- package/dist/constants/oauth2-triggers.d.ts +1 -1
- package/dist/constants/oauth2-triggers.js +3 -3
- package/dist/constants/workflow-reviews.d.ts +0 -3
- package/dist/constants/workflow-reviews.js +1 -10
- package/dist/constants/workflow-reviews.js.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +4 -1
- package/dist/constants.js.map +1 -1
- package/dist/controller.registry.js +11 -1
- package/dist/controller.registry.js.map +1 -1
- package/dist/controllers/binary-data.controller.d.ts +2 -5
- package/dist/controllers/binary-data.controller.js +3 -11
- package/dist/controllers/binary-data.controller.js.map +1 -1
- package/dist/controllers/e2e.controller.d.ts +2 -0
- package/dist/controllers/e2e.controller.js +7 -1
- package/dist/controllers/e2e.controller.js.map +1 -1
- package/dist/controllers/project.controller.js +3 -3
- package/dist/controllers/project.controller.js.map +1 -1
- package/dist/controllers/role.controller.d.ts +0 -1
- package/dist/controllers/role.controller.js +24 -17
- package/dist/controllers/role.controller.js.map +1 -1
- package/dist/controllers/security-settings.controller.js +1 -2
- package/dist/controllers/security-settings.controller.js.map +1 -1
- package/dist/credentials/credential-resolution-provider.interface.d.ts +1 -1
- package/dist/credentials/dynamic-credentials-proxy.d.ts +1 -1
- package/dist/credentials/dynamic-credentials-proxy.js +2 -2
- package/dist/credentials/dynamic-credentials-proxy.js.map +1 -1
- package/dist/credentials-helper.js +1 -1
- package/dist/credentials-helper.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-audit.d.ts +1 -1
- package/dist/eventbus/event-message-classes/event-message-mcp.d.ts +2 -0
- package/dist/eventbus/event-message-classes/event-message-mcp.js.map +1 -1
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +7 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/maps/poll-trigger-metrics.event-map.d.ts +3 -0
- package/dist/events/maps/relay.event-map.d.ts +42 -2
- package/dist/events/relays/log-streaming.event-relay.d.ts +4 -0
- package/dist/events/relays/log-streaming.event-relay.js +72 -1
- 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 +55 -1
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/executions/execution-data/db-store.d.ts +1 -1
- package/dist/executions/execution-data/db-store.js +3 -2
- package/dist/executions/execution-data/db-store.js.map +1 -1
- package/dist/executions/execution-data/types.d.ts +4 -2
- package/dist/executions/execution-data/types.js +4 -0
- package/dist/executions/execution-data/types.js.map +1 -1
- package/dist/executions/execution-data/unreadable-run-data.error.d.ts +5 -0
- package/dist/executions/execution-data/unreadable-run-data.error.js +11 -0
- package/dist/executions/execution-data/unreadable-run-data.error.js.map +1 -0
- package/dist/executions/execution-persistence.d.ts +3 -1
- package/dist/executions/execution-persistence.js +23 -10
- package/dist/executions/execution-persistence.js.map +1 -1
- package/dist/executions/execution.service.d.ts +4 -1
- package/dist/executions/execution.service.js +9 -7
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/executions/execution.types.d.ts +1 -7
- package/dist/executions/executions.controller.d.ts +4 -1
- package/dist/executions/executions.controller.js +8 -3
- package/dist/executions/executions.controller.js.map +1 -1
- package/dist/executions/pre-execution-checks/credentials-permission-checker.js +3 -21
- package/dist/executions/pre-execution-checks/credentials-permission-checker.js.map +1 -1
- package/dist/metrics/prometheus/poll-trigger-metrics.service.js +8 -0
- package/dist/metrics/prometheus/poll-trigger-metrics.service.js.map +1 -1
- package/dist/modules/agents/agent-config.service.js +1 -1
- package/dist/modules/agents/agent-config.service.js.map +1 -1
- package/dist/modules/agents/agent-custom-tools.service.js +2 -2
- package/dist/modules/agents/agent-custom-tools.service.js.map +1 -1
- package/dist/modules/agents/agent-execution.service.d.ts +5 -1
- package/dist/modules/agents/agent-execution.service.js +33 -5
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-integration-management.service.d.ts +1 -0
- package/dist/modules/agents/agent-integration-management.service.js +16 -4
- package/dist/modules/agents/agent-integration-management.service.js.map +1 -1
- package/dist/modules/agents/agent-publish.service.d.ts +1 -1
- package/dist/modules/agents/agent-publish.service.js +56 -20
- package/dist/modules/agents/agent-publish.service.js.map +1 -1
- package/dist/modules/agents/agent-sandbox-principal.d.ts +2 -2
- package/dist/modules/agents/agent-sandbox-principal.js +2 -2
- package/dist/modules/agents/agent-sandbox-principal.js.map +1 -1
- package/dist/modules/agents/agent-sandbox-runtime.service.js +2 -2
- package/dist/modules/agents/agent-sandbox-runtime.service.js.map +1 -1
- package/dist/modules/agents/agent-skills.service.js +3 -3
- package/dist/modules/agents/agent-skills.service.js.map +1 -1
- package/dist/modules/agents/agent-task.service.d.ts +2 -0
- package/dist/modules/agents/agent-task.service.js +45 -10
- package/dist/modules/agents/agent-task.service.js.map +1 -1
- package/dist/modules/agents/agent-threads.controller.d.ts +3 -4
- package/dist/modules/agents/agent-threads.controller.js +10 -4
- package/dist/modules/agents/agent-threads.controller.js.map +1 -1
- package/dist/modules/agents/agent-validation.service.d.ts +2 -6
- package/dist/modules/agents/agent-validation.service.js +5 -9
- package/dist/modules/agents/agent-validation.service.js.map +1 -1
- package/dist/modules/agents/agent-workflow-execution.service.d.ts +3 -2
- package/dist/modules/agents/agent-workflow-execution.service.js +31 -14
- package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
- package/dist/modules/agents/agents-config.controller.d.ts +9 -0
- package/dist/modules/agents/agents.module.js +0 -3
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.js +5 -2
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder.service.d.ts +2 -0
- package/dist/modules/agents/builder/agents-builder.service.js +18 -5
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-model-live-lookup.service.d.ts +4 -3
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js +11 -10
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-tasks.skill.js +3 -0
- package/dist/modules/agents/builder/skills/target-tasks.skill.js.map +1 -1
- package/dist/modules/agents/entities/agent-execution.entity.d.ts +2 -0
- package/dist/modules/agents/entities/agent-execution.entity.js +4 -0
- package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-task-snapshot.entity.d.ts +1 -0
- package/dist/modules/agents/entities/agent-task-snapshot.entity.js +10 -1
- package/dist/modules/agents/entities/agent-task-snapshot.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-task.entity.d.ts +1 -0
- package/dist/modules/agents/entities/agent-task.entity.js +10 -1
- package/dist/modules/agents/entities/agent-task.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent.entity.d.ts +1 -0
- package/dist/modules/agents/entities/agent.entity.js +4 -0
- package/dist/modules/agents/entities/agent.entity.js.map +1 -1
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +1 -0
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +1 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.js +22 -8
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +13 -2
- package/dist/modules/agents/integrations/agent-chat-integration.js +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-message-context.d.ts +2 -1
- package/dist/modules/agents/integrations/agent-chat-message-context.js +15 -0
- package/dist/modules/agents/integrations/agent-chat-message-context.js.map +1 -1
- package/dist/modules/agents/integrations/chat-integration.service.d.ts +14 -1
- package/dist/modules/agents/integrations/chat-integration.service.js +128 -11
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
- package/dist/modules/agents/integrations/integration-action-executor.d.ts +1 -0
- package/dist/modules/agents/integrations/integration-action-executor.js +20 -6
- package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -1
- package/dist/modules/agents/integrations/integration-message-context.service.d.ts +8 -1
- package/dist/modules/agents/integrations/integration-message-context.service.js +87 -3
- package/dist/modules/agents/integrations/integration-message-context.service.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-execution.js +7 -0
- package/dist/modules/agents/integrations/integration-tool-execution.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-types.d.ts +8 -0
- package/dist/modules/agents/integrations/leader-channel-relay.service.d.ts +25 -0
- package/dist/modules/agents/integrations/leader-channel-relay.service.js +123 -0
- package/dist/modules/agents/integrations/leader-channel-relay.service.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-bridge-behavior.js +8 -4
- package/dist/modules/agents/integrations/platforms/slack/slack-bridge-behavior.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-integration.d.ts +12 -2
- package/dist/modules/agents/integrations/platforms/slack/slack-integration.js +34 -2
- package/dist/modules/agents/integrations/platforms/slack/slack-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.d.ts +4 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js +37 -9
- package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +3 -1
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +2 -2
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
- package/dist/modules/agents/json-config/agent-config-composition.d.ts +1 -1
- package/dist/modules/agents/json-config/agent-config-composition.js +3 -10
- package/dist/modules/agents/json-config/agent-config-composition.js.map +1 -1
- package/dist/modules/agents/repositories/agent-execution-thread.repository.d.ts +5 -1
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js +89 -8
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-execution.repository.d.ts +5 -2
- package/dist/modules/agents/repositories/agent-execution.repository.js +41 -2
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-task-snapshot.repository.d.ts +1 -1
- package/dist/modules/agents/repositories/agent.repository.d.ts +6 -1
- package/dist/modules/agents/repositories/agent.repository.js +38 -0
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
- package/dist/modules/agents/sub-agents/sub-agent-cleanup.service.d.ts +1 -0
- package/dist/modules/agents/sub-agents/sub-agent-cleanup.service.js +20 -7
- package/dist/modules/agents/sub-agents/sub-agent-cleanup.service.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.d.ts +11 -0
- package/dist/modules/agents/tools/workflow-tool-factory.js +109 -40
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/utils/agent-draft.utils.d.ts +4 -0
- package/dist/modules/agents/utils/agent-draft.utils.js +9 -0
- package/dist/modules/agents/utils/agent-draft.utils.js.map +1 -1
- package/dist/modules/agents/utils/agent-memory-scope.d.ts +1 -0
- package/dist/modules/agents/utils/agent-memory-scope.js +4 -0
- package/dist/modules/agents/utils/agent-memory-scope.js.map +1 -1
- package/dist/modules/agents/utils/execution-failure-summary.d.ts +23 -0
- package/dist/modules/agents/utils/execution-failure-summary.js +54 -0
- package/dist/modules/agents/utils/execution-failure-summary.js.map +1 -0
- package/dist/modules/agents/workflow-agent-stream.d.ts +41 -0
- package/dist/modules/agents/workflow-agent-stream.js +132 -0
- package/dist/modules/agents/workflow-agent-stream.js.map +1 -0
- package/dist/modules/breaking-changes/breaking-changes.service.js +1 -1
- package/dist/modules/breaking-changes/breaking-changes.service.js.map +1 -1
- package/dist/modules/breaking-changes/rules/index.d.ts +4 -0
- package/dist/modules/breaking-changes/rules/index.js +4 -0
- package/dist/modules/breaking-changes/rules/index.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/agent-node-mode.d.ts +4 -0
- package/dist/modules/breaking-changes/rules/v3/agent-node-mode.js +26 -0
- package/dist/modules/breaking-changes/rules/v3/agent-node-mode.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/agent-node-version.rule.d.ts +10 -0
- package/dist/modules/breaking-changes/rules/v3/agent-node-version.rule.js +53 -0
- package/dist/modules/breaking-changes/rules/v3/agent-node-version.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/agent-removed-modes.rule.d.ts +10 -0
- package/dist/modules/breaking-changes/rules/v3/agent-removed-modes.rule.js +56 -0
- package/dist/modules/breaking-changes/rules/v3/agent-removed-modes.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/caller-policy-any-removed.rule.d.ts +10 -0
- package/dist/modules/breaking-changes/rules/v3/caller-policy-any-removed.rule.js +54 -0
- package/dist/modules/breaking-changes/rules/v3/caller-policy-any-removed.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/caller-policy-default-any.rule.d.ts +10 -0
- package/dist/modules/breaking-changes/rules/v3/caller-policy-default-any.rule.js +63 -0
- package/dist/modules/breaking-changes/rules/v3/caller-policy-default-any.rule.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub.models.service.js +1 -69
- package/dist/modules/chat-hub/chat-hub.models.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.js +4 -14
- package/dist/modules/community-packages/community-packages.lifecycle.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.service.d.ts +8 -6
- package/dist/modules/community-packages/community-packages.service.js +263 -177
- package/dist/modules/community-packages/community-packages.service.js.map +1 -1
- package/dist/modules/data-table/data-table-size-validator.service.js +2 -2
- package/dist/modules/data-table/data-table-size-validator.service.js.map +1 -1
- package/dist/modules/data-table/multer-upload-middleware.js +2 -2
- package/dist/modules/data-table/multer-upload-middleware.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/identifier-interface.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.d.ts +13 -2
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js +33 -3
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-introspection-identifier.d.ts +3 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-introspection-identifier.js +14 -16
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-introspection-identifier.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.d.ts +2 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.js +2 -2
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-userinfo-identifier.d.ts +12 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-userinfo-identifier.js +135 -19
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-userinfo-identifier.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-utils.d.ts +6 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-utils.js +29 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-utils.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/n8n-credential-resolver.d.ts +5 -5
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/n8n-credential-resolver.js +12 -12
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/n8n-credential-resolver.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/oauth-credential-resolver.d.ts +15 -4
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/oauth-credential-resolver.js +8 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/oauth-credential-resolver.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +3 -3
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js.map +1 -1
- package/dist/modules/engine-v2/engine-data-plane-client.d.ts +15 -0
- package/dist/modules/engine-v2/engine-data-plane-client.js +76 -0
- package/dist/modules/engine-v2/engine-data-plane-client.js.map +1 -0
- package/dist/modules/engine-v2/engine-v2.module.d.ts +5 -0
- package/dist/modules/engine-v2/engine-v2.module.js +48 -0
- package/dist/modules/engine-v2/engine-v2.module.js.map +1 -0
- package/dist/modules/engine-v2/engine-v2.runtime.d.ts +20 -0
- package/dist/modules/engine-v2/engine-v2.runtime.js +164 -0
- package/dist/modules/engine-v2/engine-v2.runtime.js.map +1 -0
- package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js +1 -1
- package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js.map +1 -1
- package/dist/modules/git-connections.ee/constants.d.ts +7 -0
- package/dist/modules/git-connections.ee/constants.js +11 -0
- package/dist/modules/git-connections.ee/constants.js.map +1 -0
- package/dist/modules/git-connections.ee/database/entities/git-connection-project.entity.d.ts +8 -0
- package/dist/modules/git-connections.ee/database/entities/git-connection-project.entity.js +36 -0
- package/dist/modules/git-connections.ee/database/entities/git-connection-project.entity.js.map +1 -0
- package/dist/modules/git-connections.ee/database/entities/git-connection.entity.d.ts +14 -0
- package/dist/modules/git-connections.ee/database/entities/git-connection.entity.js +61 -0
- package/dist/modules/git-connections.ee/database/entities/git-connection.entity.js.map +1 -0
- package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.d.ts +9 -0
- package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js +46 -0
- package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js.map +1 -0
- package/dist/modules/git-connections.ee/database/repositories/git-connection.repository.d.ts +12 -0
- package/dist/modules/git-connections.ee/database/repositories/git-connection.repository.js +37 -0
- package/dist/modules/git-connections.ee/database/repositories/git-connection.repository.js.map +1 -0
- package/dist/modules/git-connections.ee/git-connections-git.service.d.ts +33 -0
- package/dist/modules/git-connections.ee/git-connections-git.service.js +191 -0
- package/dist/modules/git-connections.ee/git-connections-git.service.js.map +1 -0
- package/dist/modules/git-connections.ee/git-connections-git.utils.d.ts +13 -0
- package/dist/modules/git-connections.ee/git-connections-git.utils.js +49 -0
- package/dist/modules/git-connections.ee/git-connections-git.utils.js.map +1 -0
- package/dist/modules/git-connections.ee/git-connections.module.d.ts +5 -0
- package/dist/modules/git-connections.ee/git-connections.module.js +32 -0
- package/dist/modules/git-connections.ee/git-connections.module.js.map +1 -0
- package/dist/modules/git-connections.ee/git-connections.service.d.ts +64 -0
- package/dist/modules/git-connections.ee/git-connections.service.js +331 -0
- package/dist/modules/git-connections.ee/git-connections.service.js.map +1 -0
- package/dist/modules/instance-ai/browser/browser-use-ws.constants.d.ts +2 -0
- package/dist/modules/instance-ai/browser/browser-use-ws.constants.js +10 -1
- package/dist/modules/instance-ai/browser/browser-use-ws.constants.js.map +1 -1
- package/dist/modules/instance-ai/browser/instance-ai-browser-session.service.d.ts +2 -0
- package/dist/modules/instance-ai/browser/instance-ai-browser-session.service.js +19 -2
- package/dist/modules/instance-ai/browser/instance-ai-browser-session.service.js.map +1 -1
- package/dist/modules/instance-ai/event-bus/durable-event-log.d.ts +2 -0
- package/dist/modules/instance-ai/event-bus/durable-event-log.js +30 -1
- package/dist/modules/instance-ai/event-bus/durable-event-log.js.map +1 -1
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.d.ts +3 -1
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.js +33 -23
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-memory.service.js +49 -7
- package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js +1 -1
- package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-verification.service.js +3 -2
- package/dist/modules/instance-ai/instance-ai-verification.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +4 -0
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +91 -32
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.js +5 -0
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +1 -1
- package/dist/modules/instance-ai/instance-ai.service.js +36 -87
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.d.ts +3 -1
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js +14 -6
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js.map +1 -1
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.d.ts +3 -2
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.js +10 -0
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.js.map +1 -1
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.d.ts +4 -2
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js +47 -4
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.d.ts +9 -1
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js +34 -2
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-run-snapshot.repository.d.ts +4 -0
- package/dist/modules/instance-ai/repositories/instance-ai-run-snapshot.repository.js +14 -0
- package/dist/modules/instance-ai/repositories/instance-ai-run-snapshot.repository.js.map +1 -1
- package/dist/modules/instance-ai/run-trace-metadata.js +2 -1
- package/dist/modules/instance-ai/run-trace-metadata.js.map +1 -1
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js +5 -0
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js.map +1 -1
- package/dist/modules/instance-ai/storage/db-snapshot-storage.d.ts +4 -1
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js +2 -5
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.d.ts +2 -0
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js +6 -2
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js.map +1 -1
- package/dist/modules/instance-ai/tracing/index.d.ts +1 -1
- package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.d.ts +9 -6
- package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.js +18 -3
- package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.js.map +1 -1
- package/dist/modules/mcp/mcp-api-key.service.js +1 -1
- package/dist/modules/mcp/mcp-api-key.service.js.map +1 -1
- package/dist/modules/mcp/mcp-server-middleware.service.js +1 -1
- package/dist/modules/mcp/mcp-server-middleware.service.js.map +1 -1
- package/dist/modules/mcp/mcp.controller.js +7 -3
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +3 -3
- package/dist/modules/mcp/mcp.service.js +7 -5
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +14 -1
- package/dist/modules/mcp/mcp.types.js.map +1 -1
- package/dist/modules/mcp/tool-schema.util.js +2 -3
- package/dist/modules/mcp/tool-schema.util.js.map +1 -1
- package/dist/modules/mcp/tools/agents/agent-reference.d.ts +1 -1
- package/dist/modules/mcp/tools/agents/agent-reference.js +2 -0
- package/dist/modules/mcp/tools/agents/agent-reference.js.map +1 -1
- package/dist/modules/mcp/tools/agents/agent-tools.service.js +1 -0
- package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -1
- package/dist/modules/mcp/tools/search-folders.tool.js +1 -1
- package/dist/modules/mcp/tools/search-folders.tool.js.map +1 -1
- package/dist/modules/mcp/tools/search-workflows.tool.d.ts +5 -2
- package/dist/modules/mcp/tools/search-workflows.tool.js +58 -7
- package/dist/modules/mcp/tools/search-workflows.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +1 -1
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/credential-validation.js +2 -21
- package/dist/modules/mcp/tools/workflow-builder/credential-validation.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +2 -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 +3 -25
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +62 -13
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-orchestrator.d.ts +13 -3
- package/dist/modules/n8n-packages/engine/import-orchestrator.js +33 -3
- package/dist/modules/n8n-packages/engine/import-orchestrator.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-result.d.ts +3 -1
- package/dist/modules/n8n-packages/engine/import-result.js +2 -0
- package/dist/modules/n8n-packages/engine/import-result.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-telemetry.d.ts +2 -2
- package/dist/modules/n8n-packages/engine/import-telemetry.js +9 -0
- package/dist/modules/n8n-packages/engine/import-telemetry.js.map +1 -1
- package/dist/modules/n8n-packages/engine/n8n-package-parser.d.ts +6 -1
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js +16 -2
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
- package/dist/modules/n8n-packages/engine/project-package-importer.d.ts +2 -2
- package/dist/modules/n8n-packages/engine/project-package-importer.js +11 -0
- package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/engine/workflow-package-importer.d.ts +2 -2
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js +2 -0
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-export-policy.d.ts +4 -0
- package/dist/modules/n8n-packages/entities/credential/credential-export-policy.js +43 -0
- package/dist/modules/n8n-packages/entities/credential/credential-export-policy.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.js +5 -2
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.d.ts +4 -2
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js +2 -1
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/data-table/data-table.exporter.js +2 -2
- package/dist/modules/n8n-packages/entities/data-table/data-table.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/folder/folder-conflict-policy.d.ts +5 -1
- package/dist/modules/n8n-packages/entities/folder/folder-conflict-policy.js +24 -0
- package/dist/modules/n8n-packages/entities/folder/folder-conflict-policy.js.map +1 -1
- package/dist/modules/n8n-packages/entities/folder/folder-removal.types.d.ts +11 -0
- package/dist/modules/n8n-packages/entities/folder/folder-removal.types.js +3 -0
- package/dist/modules/n8n-packages/entities/folder/folder-removal.types.js.map +1 -0
- package/dist/modules/n8n-packages/entities/folder/folder-remover.d.ts +14 -0
- package/dist/modules/n8n-packages/entities/folder/folder-remover.js +110 -0
- package/dist/modules/n8n-packages/entities/folder/folder-remover.js.map +1 -0
- package/dist/modules/n8n-packages/entities/folder/folder.exporter.js +4 -4
- package/dist/modules/n8n-packages/entities/folder/folder.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/project/project.exporter.js +4 -4
- package/dist/modules/n8n-packages/entities/project/project.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/tag/tag.exporter.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/tag/tag.exporter.js +3 -3
- package/dist/modules/n8n-packages/entities/tag/tag.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable.exporter.js +2 -2
- package/dist/modules/n8n-packages/entities/variable/variable.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js +16 -16
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-removal.types.d.ts +21 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-removal.types.js +3 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-removal.types.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-remover.d.ts +12 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-remover.js +109 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-remover.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +2 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +2 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/io/directory/directory-package-writer.d.ts +9 -0
- package/dist/modules/n8n-packages/io/directory/directory-package-writer.js +39 -0
- package/dist/modules/n8n-packages/io/directory/directory-package-writer.js.map +1 -0
- package/dist/modules/n8n-packages/io/package-writer.d.ts +2 -4
- package/dist/modules/n8n-packages/n8n-packages.service.d.ts +5 -1
- package/dist/modules/n8n-packages/n8n-packages.service.js +41 -16
- package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +57 -4
- package/dist/modules/n8n-packages/n8n-packages.types.js +10 -1
- package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.d.ts +8 -0
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.js +12 -1
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +28 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +7 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -1
- package/dist/modules/oauth-server/oauth-token.service.d.ts +1 -0
- package/dist/modules/oauth-server/oauth-token.service.js +12 -1
- package/dist/modules/oauth-server/oauth-token.service.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.js +0 -4
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.js +0 -4
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.js.map +1 -1
- package/dist/modules/policy-infrastructure/policy-check-failed.error.d.ts +10 -0
- package/dist/modules/policy-infrastructure/policy-check-failed.error.js +14 -0
- package/dist/modules/policy-infrastructure/policy-check-failed.error.js.map +1 -0
- package/dist/modules/policy-infrastructure/policy-decision.service.d.ts +14 -0
- package/dist/modules/policy-infrastructure/policy-decision.service.js +121 -0
- package/dist/modules/policy-infrastructure/policy-decision.service.js.map +1 -0
- package/dist/modules/policy-infrastructure/policy-infrastructure.module.d.ts +4 -0
- package/dist/modules/policy-infrastructure/policy-infrastructure.module.js +23 -0
- package/dist/modules/policy-infrastructure/policy-infrastructure.module.js.map +1 -0
- package/dist/modules/provisioning.ee/constants.d.ts +1 -0
- package/dist/modules/provisioning.ee/constants.js +3 -1
- package/dist/modules/provisioning.ee/constants.js.map +1 -1
- package/dist/modules/provisioning.ee/errors/sso-access-denied.error.d.ts +4 -0
- package/dist/modules/provisioning.ee/errors/sso-access-denied.error.js +11 -0
- package/dist/modules/provisioning.ee/errors/sso-access-denied.error.js.map +1 -0
- package/dist/modules/provisioning.ee/provisioning.service.ee.js +4 -4
- package/dist/modules/provisioning.ee/provisioning.service.ee.js.map +1 -1
- package/dist/modules/provisioning.ee/role-mapping-rule.controller.ee.d.ts +1 -3
- package/dist/modules/provisioning.ee/role-mapping-rule.controller.ee.js +16 -23
- 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 +17 -5
- package/dist/modules/provisioning.ee/role-mapping-rule.service.ee.js +31 -9
- package/dist/modules/provisioning.ee/role-mapping-rule.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-export.service.ee.js +1 -0
- 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 +7 -19
- package/dist/modules/source-control.ee/source-control-git.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-helper.ee.d.ts +3 -5
- package/dist/modules/source-control.ee/source-control-helper.ee.js +10 -40
- package/dist/modules/source-control.ee/source-control-helper.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +7 -2
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-status.service.ee.js +1 -1
- package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/types/exportable-workflow.d.ts +1 -0
- package/dist/modules/source-control.ee/types/source-control-workflow-version-id.d.ts +1 -0
- package/dist/modules/sso-oidc/oidc.controller.ee.js +23 -7
- package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -1
- package/dist/modules/sso-saml/saml.controller.ee.js +5 -0
- package/dist/modules/sso-saml/saml.controller.ee.js.map +1 -1
- package/dist/modules/type-availability-policies/policy-evaluator.d.ts +2 -0
- package/dist/modules/type-availability-policies/policy-evaluator.js +28 -0
- package/dist/modules/type-availability-policies/policy-evaluator.js.map +1 -0
- package/dist/modules/type-availability-policies/policy-rule.types.d.ts +23 -0
- package/dist/modules/type-availability-policies/policy-rule.types.js +3 -0
- package/dist/modules/type-availability-policies/policy-rule.types.js.map +1 -0
- package/dist/modules/type-availability-policies/type-availability-policies.module.d.ts +4 -0
- package/dist/modules/type-availability-policies/type-availability-policies.module.js +18 -0
- package/dist/modules/type-availability-policies/type-availability-policies.module.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-access.service.d.ts +4 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-access.service.js +25 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-access.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.d.ts +5 -2
- package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.js +14 -2
- package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-eligibility.service.js +9 -9
- package/dist/modules/workflow-reviews.ee/workflow-review-eligibility.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-feature-gate.service.js +1 -2
- package/dist/modules/workflow-reviews.ee/workflow-review-feature-gate.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.d.ts +2 -3
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js +5 -5
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.d.ts +30 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.js +256 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.d.ts +6 -6
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js +61 -52
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review.mapper.d.ts +3 -2
- package/dist/modules/workflow-reviews.ee/workflow-review.mapper.js +24 -1
- package/dist/modules/workflow-reviews.ee/workflow-review.mapper.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js +2 -5
- package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js.map +1 -1
- package/dist/policy/policy-cleared.d.ts +20 -0
- package/dist/policy/policy-cleared.js +22 -0
- package/dist/policy/policy-cleared.js.map +1 -0
- package/dist/policy/policy-enforcement-backend.d.ts +15 -0
- package/dist/policy/policy-enforcement-backend.js +3 -0
- package/dist/policy/policy-enforcement-backend.js.map +1 -0
- package/dist/policy/policy-enforcement.service.d.ts +21 -0
- package/dist/policy/policy-enforcement.service.js +87 -0
- package/dist/policy/policy-enforcement.service.js.map +1 -0
- package/dist/policy/policy-violation.error.d.ts +13 -0
- package/dist/policy/policy-violation.error.js +22 -0
- package/dist/policy/policy-violation.error.js.map +1 -0
- package/dist/posthog/index.js +1 -1
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/public-api-controller.registry.js +2 -1
- package/dist/public-api/public-api-controller.registry.js.map +1 -1
- package/dist/public-api/public-api-route-resolver.d.ts +2 -2
- package/dist/public-api/public-api-route-resolver.js.map +1 -1
- package/dist/public-api/public-api-validation-error.d.ts +2 -0
- package/dist/public-api/public-api-validation-error.js +17 -0
- package/dist/public-api/public-api-validation-error.js.map +1 -0
- package/dist/public-api/types.d.ts +2 -9
- package/dist/public-api/v1/controllers/git-connections.public.controller.d.ts +20 -0
- package/dist/public-api/v1/controllers/git-connections.public.controller.js +278 -0
- package/dist/public-api/v1/controllers/git-connections.public.controller.js.map +1 -0
- package/dist/public-api/v1/controllers/index.d.ts +1 -0
- package/dist/public-api/v1/controllers/index.js +1 -0
- package/dist/public-api/v1/controllers/index.js.map +1 -1
- package/dist/public-api/v1/controllers/role-mapping-rules.public.controller.d.ts +6 -1
- package/dist/public-api/v1/controllers/role-mapping-rules.public.controller.js +117 -11
- package/dist/public-api/v1/controllers/role-mapping-rules.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/roles.public.controller.d.ts +2 -1
- package/dist/public-api/v1/controllers/roles.public.controller.js +46 -2
- package/dist/public-api/v1/controllers/roles.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/tags.public.controller.js +1 -18
- package/dist/public-api/v1/controllers/tags.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/workflows.public.controller.d.ts +16 -3
- package/dist/public-api/v1/controllers/workflows.public.controller.js +169 -5
- package/dist/public-api/v1/controllers/workflows.public.controller.js.map +1 -1
- package/dist/public-api/v1/handlers/executions/executions.handler.js +3 -1
- package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.d.ts +1 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +2 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/projects/projects.handler.js +3 -3
- package/dist/public-api/v1/handlers/projects/projects.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +0 -6
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js +0 -72
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
- package/dist/public-api/v1/openapi-gen/decorator-routes.d.ts +32 -0
- package/dist/public-api/v1/openapi-gen/decorator-routes.js +37 -9
- package/dist/public-api/v1/openapi-gen/decorator-routes.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +5196 -1873
- package/dist/push/index.js +3 -3
- package/dist/push/index.js.map +1 -1
- package/dist/response-helper.js +1 -2
- package/dist/response-helper.js.map +1 -1
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/constants.js +2 -0
- package/dist/scaling/constants.js.map +1 -1
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +19 -0
- package/dist/scaling/pubsub/pubsub.types.d.ts +3 -1
- package/dist/scaling/pubsub/subscriber.service.d.ts +1 -0
- package/dist/scaling/pubsub/subscriber.service.js +24 -4
- package/dist/scaling/pubsub/subscriber.service.js.map +1 -1
- package/dist/scheduling/durable-job-provisioner.js +1 -1
- package/dist/scheduling/durable-job-provisioner.js.map +1 -1
- package/dist/scheduling/durable-scheduler.js +9 -0
- package/dist/scheduling/durable-scheduler.js.map +1 -1
- package/dist/scheduling/poll-trigger-node/durable-poller-chain.d.ts +2 -0
- package/dist/scheduling/poll-trigger-node/durable-poller-chain.js +9 -0
- package/dist/scheduling/poll-trigger-node/durable-poller-chain.js.map +1 -0
- package/dist/scheduling/poll-trigger-node/poll-job-provider.d.ts +1 -3
- package/dist/scheduling/poll-trigger-node/poll-job-provider.js +4 -8
- package/dist/scheduling/poll-trigger-node/poll-job-provider.js.map +1 -1
- package/dist/scheduling/poll-trigger-node/poll-trigger-job-registrar.d.ts +3 -1
- package/dist/scheduling/poll-trigger-node/poll-trigger-job-registrar.js +9 -3
- package/dist/scheduling/poll-trigger-node/poll-trigger-job-registrar.js.map +1 -1
- package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.d.ts +8 -3
- package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.js +86 -7
- package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.js.map +1 -1
- package/dist/services/engine-data-plane-proxy.service.d.ts +10 -0
- package/dist/services/engine-data-plane-proxy.service.js +33 -0
- package/dist/services/engine-data-plane-proxy.service.js.map +1 -0
- package/dist/services/engine-v2-dispatcher.service.d.ts +14 -0
- package/dist/services/engine-v2-dispatcher.service.js +93 -0
- package/dist/services/engine-v2-dispatcher.service.js.map +1 -0
- package/dist/services/folder-finder.service.d.ts +1 -0
- package/dist/services/folder-finder.service.js +9 -0
- package/dist/services/folder-finder.service.js.map +1 -1
- package/dist/services/folder.service.d.ts +5 -0
- package/dist/services/folder.service.js +7 -0
- package/dist/services/folder.service.js.map +1 -1
- package/dist/services/frontend.service.d.ts +3 -4
- package/dist/services/frontend.service.js +5 -13
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/node-resource-explorer.service.d.ts +1 -0
- package/dist/services/node-resource-explorer.service.js +72 -13
- package/dist/services/node-resource-explorer.service.js.map +1 -1
- package/dist/services/oauth-token-verifier-proxy.service.d.ts +11 -1
- package/dist/services/oauth-token-verifier-proxy.service.js +6 -0
- package/dist/services/oauth-token-verifier-proxy.service.js.map +1 -1
- package/dist/services/ownership-transfer/ownership-transfer.manifest.json +5 -0
- package/dist/services/role-authorization.d.ts +11 -2
- package/dist/services/role-authorization.js +15 -6
- package/dist/services/role-authorization.js.map +1 -1
- package/dist/services/role.service.d.ts +5 -1
- package/dist/services/role.service.js +7 -2
- package/dist/services/role.service.js.map +1 -1
- package/dist/utils/ai-service-retry.js +3 -4
- package/dist/utils/ai-service-retry.js.map +1 -1
- package/dist/webhooks/webhook-blank-file-inputs.d.ts +4 -0
- package/dist/webhooks/webhook-blank-file-inputs.js +32 -0
- package/dist/webhooks/webhook-blank-file-inputs.js.map +1 -0
- package/dist/webhooks/webhook-form-data.js +29 -15
- package/dist/webhooks/webhook-form-data.js.map +1 -1
- package/dist/webhooks/webhook-helpers.js +2 -2
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/webhooks/webhook-request-sanitizer.js +10 -4
- package/dist/webhooks/webhook-request-sanitizer.js.map +1 -1
- package/dist/workflow-execute-additional-data.d.ts +2 -2
- package/dist/workflow-execute-additional-data.js +17 -6
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.d.ts +2 -7
- package/dist/workflow-helpers.js +3 -34
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-runner.d.ts +3 -1
- package/dist/workflow-runner.js +7 -2
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/publication/heal-node-ids.d.ts +26 -0
- package/dist/workflows/publication/heal-node-ids.js +65 -0
- package/dist/workflows/publication/heal-node-ids.js.map +1 -0
- package/dist/workflows/publication/publication-result.d.ts +1 -1
- package/dist/workflows/publication/publication-status-reporter.js +8 -3
- package/dist/workflows/publication/publication-status-reporter.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-applier.d.ts +10 -1
- package/dist/workflows/publication/workflow-publication-applier.js +56 -3
- package/dist/workflows/publication/workflow-publication-applier.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-outbox-consumer.js +1 -1
- package/dist/workflows/publication/workflow-publication-outbox-consumer.js.map +1 -1
- package/dist/workflows/triggers/enabled-trigger-nodes.d.ts +2 -1
- package/dist/workflows/triggers/enabled-trigger-nodes.js +5 -1
- package/dist/workflows/triggers/enabled-trigger-nodes.js.map +1 -1
- package/dist/workflows/triggers/poll-backoff-policy.d.ts +15 -0
- package/dist/workflows/triggers/poll-backoff-policy.js +78 -0
- package/dist/workflows/triggers/poll-backoff-policy.js.map +1 -0
- package/dist/workflows/triggers/poll-backoff.service.d.ts +30 -0
- package/dist/workflows/triggers/poll-backoff.service.js +121 -0
- package/dist/workflows/triggers/poll-backoff.service.js.map +1 -0
- package/dist/workflows/triggers/poll-cursor.service.d.ts +7 -5
- package/dist/workflows/triggers/poll-cursor.service.js +14 -6
- package/dist/workflows/triggers/poll-cursor.service.js.map +1 -1
- package/dist/workflows/triggers/workflow-trigger-activator.d.ts +1 -0
- package/dist/workflows/triggers/workflow-trigger-activator.js +31 -3
- package/dist/workflows/triggers/workflow-trigger-activator.js.map +1 -1
- package/dist/workflows/workflow-creation.service.d.ts +3 -1
- package/dist/workflows/workflow-creation.service.js +9 -2
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow-finder.service.d.ts +8 -0
- package/dist/workflows/workflow-finder.service.js +20 -0
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow-mutation-hooks-proxy.service.d.ts +16 -6
- package/dist/workflows/workflow-mutation-hooks-proxy.service.js +9 -6
- package/dist/workflows/workflow-mutation-hooks-proxy.service.js.map +1 -1
- package/dist/workflows/workflow-validation.service.js +2 -5
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +15 -1
- package/dist/workflows/workflow.service.ee.d.ts +3 -1
- package/dist/workflows/workflow.service.ee.js +12 -6
- package/dist/workflows/workflow.service.ee.js.map +1 -1
- package/dist/workflows/workflow.service.js +77 -25
- package/dist/workflows/workflow.service.js.map +1 -1
- package/package.json +64 -62
- package/templates/form-shell.handlebars +92 -7
- package/templates/form-trigger-completion.handlebars +5 -3
- package/templates/form-trigger.handlebars +11 -4
- package/templates/partials/formHostNavigation.handlebars +44 -0
- package/dist/binary-data/binary-data-access.service.d.ts +0 -11
- package/dist/binary-data/binary-data-access.service.js +0 -50
- package/dist/binary-data/binary-data-access.service.js.map +0 -1
- package/dist/modules/agents/builder/agents-builder-settings.controller.d.ts +0 -10
- package/dist/modules/agents/builder/agents-builder-settings.controller.js +0 -52
- package/dist/modules/agents/builder/agents-builder-settings.controller.js.map +0 -1
- package/dist/modules/agents/builder/agents-builder-settings.service.d.ts +0 -38
- package/dist/modules/agents/builder/agents-builder-settings.service.js +0 -174
- package/dist/modules/agents/builder/agents-builder-settings.service.js.map +0 -1
- package/dist/modules/data-table/utils/size-utils.d.ts +0 -2
- package/dist/modules/data-table/utils/size-utils.js +0 -19
- package/dist/modules/data-table/utils/size-utils.js.map +0 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.d.ts +0 -18
- package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.js +0 -114
- package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.js.map +0 -1
- package/dist/workflows/triggers/durable-poller-gate.service.d.ts +0 -19
- package/dist/workflows/triggers/durable-poller-gate.service.js +0 -78
- package/dist/workflows/triggers/durable-poller-gate.service.js.map +0 -1
|
@@ -0,0 +1,331 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.GitConnectionsService = void 0;
|
|
16
|
+
const api_types_1 = require("@n8n/api-types");
|
|
17
|
+
const backend_common_1 = require("@n8n/backend-common");
|
|
18
|
+
const db_1 = require("@n8n/db");
|
|
19
|
+
const di_1 = require("@n8n/di");
|
|
20
|
+
const n8n_core_1 = require("n8n-core");
|
|
21
|
+
const promises_1 = require("node:fs/promises");
|
|
22
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
23
|
+
const bad_request_error_1 = require("../../errors/response-errors/bad-request.error");
|
|
24
|
+
const conflict_error_1 = require("../../errors/response-errors/conflict.error");
|
|
25
|
+
const forbidden_error_1 = require("../../errors/response-errors/forbidden.error");
|
|
26
|
+
const not_found_error_1 = require("../../errors/response-errors/not-found.error");
|
|
27
|
+
const n8n_packages_service_1 = require("../../modules/n8n-packages/n8n-packages.service");
|
|
28
|
+
const n8n_packages_types_1 = require("../../modules/n8n-packages/n8n-packages.types");
|
|
29
|
+
const check_access_1 = require("../../permissions.ee/check-access");
|
|
30
|
+
const git_connection_project_repository_1 = require("./database/repositories/git-connection-project.repository");
|
|
31
|
+
const git_connection_repository_1 = require("./database/repositories/git-connection.repository");
|
|
32
|
+
const git_connections_git_service_1 = require("./git-connections-git.service");
|
|
33
|
+
const EXPORT_SUBFOLDER = 'n8n-export';
|
|
34
|
+
let GitConnectionsService = class GitConnectionsService {
|
|
35
|
+
constructor(repository, gitConnectionProjectRepository, projectRepository, gitService, n8nPackagesService, cipher, instanceSettings, logger) {
|
|
36
|
+
this.repository = repository;
|
|
37
|
+
this.gitConnectionProjectRepository = gitConnectionProjectRepository;
|
|
38
|
+
this.projectRepository = projectRepository;
|
|
39
|
+
this.gitService = gitService;
|
|
40
|
+
this.n8nPackagesService = n8nPackagesService;
|
|
41
|
+
this.cipher = cipher;
|
|
42
|
+
this.instanceSettings = instanceSettings;
|
|
43
|
+
this.logger = logger;
|
|
44
|
+
this.logger = this.logger.scoped('git-connections');
|
|
45
|
+
}
|
|
46
|
+
async create(input) {
|
|
47
|
+
this.gitService.validateRepositoryUrl(input.repositoryUrl, input.connectionType);
|
|
48
|
+
if (input.branchName)
|
|
49
|
+
await this.gitService.validateBranchName(input.branchName);
|
|
50
|
+
const connection = this.repository.create({
|
|
51
|
+
name: input.name,
|
|
52
|
+
repositoryUrl: input.repositoryUrl,
|
|
53
|
+
branchName: input.branchName ?? null,
|
|
54
|
+
connectionType: input.connectionType,
|
|
55
|
+
publicKey: null,
|
|
56
|
+
encryptedPrivateKey: null,
|
|
57
|
+
encryptedUsername: null,
|
|
58
|
+
encryptedPassword: null,
|
|
59
|
+
keyGeneratorType: null,
|
|
60
|
+
baseCommit: null,
|
|
61
|
+
});
|
|
62
|
+
await this.applyNewAuthentication(connection, input);
|
|
63
|
+
return this.toPublic(await this.repository.save(connection));
|
|
64
|
+
}
|
|
65
|
+
async findOne(id) {
|
|
66
|
+
return this.toPublic(await this.getEntity(id));
|
|
67
|
+
}
|
|
68
|
+
async list(offset, limit) {
|
|
69
|
+
const result = await this.repository.getManyAndCount({ skip: offset, take: limit });
|
|
70
|
+
return { ...result, data: result.data.map((connection) => this.toSummary(connection)) };
|
|
71
|
+
}
|
|
72
|
+
async update(id, input) {
|
|
73
|
+
if (Object.keys(input).length === 0)
|
|
74
|
+
throw new bad_request_error_1.BadRequestError('At least one field is required');
|
|
75
|
+
const current = await this.getEntity(id);
|
|
76
|
+
const targetType = input.connectionType ?? current.connectionType;
|
|
77
|
+
const targetUrl = input.repositoryUrl ?? current.repositoryUrl;
|
|
78
|
+
this.gitService.validateRepositoryUrl(targetUrl, targetType);
|
|
79
|
+
if (input.branchName)
|
|
80
|
+
await this.gitService.validateBranchName(input.branchName);
|
|
81
|
+
const changesTarget = input.connectionType !== undefined ||
|
|
82
|
+
input.repositoryUrl !== undefined ||
|
|
83
|
+
input.branchName !== undefined ||
|
|
84
|
+
input.username !== undefined ||
|
|
85
|
+
input.password !== undefined ||
|
|
86
|
+
input.keyGeneratorType !== undefined;
|
|
87
|
+
const updated = this.repository.create({ ...current });
|
|
88
|
+
if (input.name !== undefined)
|
|
89
|
+
updated.name = input.name;
|
|
90
|
+
if (input.repositoryUrl !== undefined)
|
|
91
|
+
updated.repositoryUrl = input.repositoryUrl;
|
|
92
|
+
if (input.branchName !== undefined)
|
|
93
|
+
updated.branchName = input.branchName;
|
|
94
|
+
await this.applyUpdatedAuthentication(updated, current, input);
|
|
95
|
+
const saved = await this.repository.save(updated);
|
|
96
|
+
if (changesTarget)
|
|
97
|
+
await this.resetWorkingCopy(id);
|
|
98
|
+
return this.toPublic(saved);
|
|
99
|
+
}
|
|
100
|
+
async clone(id, branchName) {
|
|
101
|
+
const connection = await this.getEntity(id);
|
|
102
|
+
const effectiveBranch = branchName ?? connection.branchName;
|
|
103
|
+
if (!effectiveBranch)
|
|
104
|
+
throw new bad_request_error_1.BadRequestError('A branch name is required to clone');
|
|
105
|
+
const credentials = await this.decryptCredentials(connection);
|
|
106
|
+
await this.gitService.clone({
|
|
107
|
+
connection,
|
|
108
|
+
credentials,
|
|
109
|
+
branchName: effectiveBranch,
|
|
110
|
+
rootFolder: this.rootFolder(id),
|
|
111
|
+
});
|
|
112
|
+
connection.branchName = effectiveBranch;
|
|
113
|
+
return this.toPublic(await this.repository.save(connection));
|
|
114
|
+
}
|
|
115
|
+
async disconnect(id) {
|
|
116
|
+
const connection = await this.getEntity(id);
|
|
117
|
+
await this.resetWorkingCopy(id);
|
|
118
|
+
return this.toPublic(connection);
|
|
119
|
+
}
|
|
120
|
+
async delete(id) {
|
|
121
|
+
const connection = await this.getEntity(id);
|
|
122
|
+
await this.purge(id);
|
|
123
|
+
await this.repository.remove(connection);
|
|
124
|
+
}
|
|
125
|
+
async push(connectionId, actor) {
|
|
126
|
+
return await this.exportProjectsToRepository(connectionId, actor);
|
|
127
|
+
}
|
|
128
|
+
async exportProjectsToRepository(connectionId, actor) {
|
|
129
|
+
await this.getEntity(connectionId);
|
|
130
|
+
const projectIds = await this.gitConnectionProjectRepository.findProjectIdsByConnection(connectionId);
|
|
131
|
+
const repositoryFolder = node_path_1.default.join(this.rootFolder(connectionId), 'repository');
|
|
132
|
+
const exportFolder = node_path_1.default.join(repositoryFolder, EXPORT_SUBFOLDER);
|
|
133
|
+
this.logger.info('Exporting projects to Git connection repository', {
|
|
134
|
+
connectionId,
|
|
135
|
+
projectCount: projectIds.length,
|
|
136
|
+
});
|
|
137
|
+
await (0, promises_1.mkdir)(repositoryFolder, { recursive: true });
|
|
138
|
+
const stagingFolder = await (0, promises_1.mkdtemp)(node_path_1.default.join(repositoryFolder, `.${EXPORT_SUBFOLDER}-`));
|
|
139
|
+
try {
|
|
140
|
+
const exportResult = await this.n8nPackagesService.exportPackageToDirectory({
|
|
141
|
+
user: actor,
|
|
142
|
+
projectIds,
|
|
143
|
+
includeVariableValues: true,
|
|
144
|
+
canExportVariableValues: true,
|
|
145
|
+
includeTags: true,
|
|
146
|
+
missingWorkflowDependencyPolicy: n8n_packages_types_1.MissingWorkflowDependencyPolicy.Fail,
|
|
147
|
+
workflowVersionPolicy: n8n_packages_types_1.WorkflowVersionPolicy.Latest,
|
|
148
|
+
}, { targetDir: stagingFolder });
|
|
149
|
+
await (0, promises_1.rm)(exportFolder, { recursive: true, force: true });
|
|
150
|
+
await (0, promises_1.rename)(stagingFolder, exportFolder);
|
|
151
|
+
return {
|
|
152
|
+
connectionId,
|
|
153
|
+
counts: exportResult.counts,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
finally {
|
|
157
|
+
await (0, promises_1.rm)(stagingFolder, { recursive: true, force: true });
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async addProject({ user, connectionId, projectId, }) {
|
|
161
|
+
await this.getEntity(connectionId);
|
|
162
|
+
await this.assertProjectAccess(user, projectId);
|
|
163
|
+
await this.assertProjectCanBeAdded(projectId);
|
|
164
|
+
const link = await this.gitConnectionProjectRepository.linkProject(projectId, connectionId);
|
|
165
|
+
if (link.gitConnectionId !== connectionId) {
|
|
166
|
+
throw new conflict_error_1.ConflictError('Project is already added to another Git connection');
|
|
167
|
+
}
|
|
168
|
+
return this.toLinkPublic(link);
|
|
169
|
+
}
|
|
170
|
+
async removeProject({ user, connectionId, projectId }) {
|
|
171
|
+
await this.getEntity(connectionId);
|
|
172
|
+
await this.assertProjectAccess(user, projectId);
|
|
173
|
+
const existing = await this.gitConnectionProjectRepository.findByProjectId(projectId);
|
|
174
|
+
if (!existing)
|
|
175
|
+
return;
|
|
176
|
+
if (existing.gitConnectionId !== connectionId) {
|
|
177
|
+
throw new conflict_error_1.ConflictError('Project is added to another Git connection');
|
|
178
|
+
}
|
|
179
|
+
const removed = await this.gitConnectionProjectRepository.unlinkProject(projectId, connectionId);
|
|
180
|
+
if (removed === 0) {
|
|
181
|
+
const current = await this.gitConnectionProjectRepository.findByProjectId(projectId);
|
|
182
|
+
if (current && current.gitConnectionId !== connectionId) {
|
|
183
|
+
throw new conflict_error_1.ConflictError('Project is added to another Git connection');
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
async listProjects(id) {
|
|
188
|
+
await this.getEntity(id);
|
|
189
|
+
const projectIds = await this.gitConnectionProjectRepository.findProjectIdsByConnection(id);
|
|
190
|
+
return api_types_1.GitConnectionProjectListPublicDto.parse({ projectIds });
|
|
191
|
+
}
|
|
192
|
+
async assertProjectAccess(user, projectId) {
|
|
193
|
+
const allowed = await (0, check_access_1.userHasScopes)(user, ['project:update'], false, { projectId });
|
|
194
|
+
if (!allowed)
|
|
195
|
+
throw new forbidden_error_1.ForbiddenError('You do not have access to this project');
|
|
196
|
+
}
|
|
197
|
+
async assertProjectCanBeAdded(projectId) {
|
|
198
|
+
const project = await this.projectRepository.findOneBy({ id: projectId });
|
|
199
|
+
if (!project)
|
|
200
|
+
throw new not_found_error_1.NotFoundError('Project not found');
|
|
201
|
+
if (project.type !== 'team') {
|
|
202
|
+
throw new bad_request_error_1.BadRequestError('Only team projects can be added to a Git connection');
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
toLinkPublic(link) {
|
|
206
|
+
return api_types_1.GitConnectionProjectPublicDto.parse({
|
|
207
|
+
projectId: link.projectId,
|
|
208
|
+
gitConnectionId: link.gitConnectionId,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
async applyNewAuthentication(connection, input) {
|
|
212
|
+
if (input.connectionType === 'ssh') {
|
|
213
|
+
if (input.username !== undefined || input.password !== undefined) {
|
|
214
|
+
throw new bad_request_error_1.BadRequestError('Username and password are only valid for HTTPS connections');
|
|
215
|
+
}
|
|
216
|
+
const keyType = input.keyGeneratorType ?? 'ed25519';
|
|
217
|
+
const keyPair = await this.gitService.generateSshKeyPair(keyType);
|
|
218
|
+
connection.publicKey = keyPair.publicKey;
|
|
219
|
+
connection.encryptedPrivateKey = await this.cipher.encryptV2(keyPair.privateKey);
|
|
220
|
+
connection.keyGeneratorType = keyType;
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (input.keyGeneratorType !== undefined) {
|
|
224
|
+
throw new bad_request_error_1.BadRequestError('Key generator type is only valid for SSH connections');
|
|
225
|
+
}
|
|
226
|
+
this.validateHttpsCredentials(input.username, input.password, true);
|
|
227
|
+
connection.encryptedUsername = await this.cipher.encryptV2(input.username);
|
|
228
|
+
connection.encryptedPassword = await this.cipher.encryptV2(input.password);
|
|
229
|
+
}
|
|
230
|
+
async applyUpdatedAuthentication(updated, current, input) {
|
|
231
|
+
const targetType = input.connectionType ?? current.connectionType;
|
|
232
|
+
if (targetType === 'ssh') {
|
|
233
|
+
if (input.username !== undefined || input.password !== undefined) {
|
|
234
|
+
throw new bad_request_error_1.BadRequestError('Username and password are only valid for HTTPS connections');
|
|
235
|
+
}
|
|
236
|
+
if (current.connectionType === 'ssh') {
|
|
237
|
+
if (input.keyGeneratorType && input.keyGeneratorType !== current.keyGeneratorType) {
|
|
238
|
+
throw new bad_request_error_1.BadRequestError('SSH key type cannot be changed after creation');
|
|
239
|
+
}
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const keyType = input.keyGeneratorType ?? 'ed25519';
|
|
243
|
+
const pair = await this.gitService.generateSshKeyPair(keyType);
|
|
244
|
+
updated.connectionType = 'ssh';
|
|
245
|
+
updated.publicKey = pair.publicKey;
|
|
246
|
+
updated.encryptedPrivateKey = await this.cipher.encryptV2(pair.privateKey);
|
|
247
|
+
updated.keyGeneratorType = keyType;
|
|
248
|
+
updated.encryptedUsername = null;
|
|
249
|
+
updated.encryptedPassword = null;
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (input.keyGeneratorType !== undefined) {
|
|
253
|
+
throw new bad_request_error_1.BadRequestError('Key generator type is only valid for SSH connections');
|
|
254
|
+
}
|
|
255
|
+
const switching = current.connectionType === 'ssh';
|
|
256
|
+
this.validateHttpsCredentials(input.username, input.password, switching);
|
|
257
|
+
updated.connectionType = 'https';
|
|
258
|
+
if (input.username !== undefined && input.password !== undefined) {
|
|
259
|
+
updated.encryptedUsername = await this.cipher.encryptV2(input.username);
|
|
260
|
+
updated.encryptedPassword = await this.cipher.encryptV2(input.password);
|
|
261
|
+
}
|
|
262
|
+
updated.publicKey = null;
|
|
263
|
+
updated.encryptedPrivateKey = null;
|
|
264
|
+
updated.keyGeneratorType = null;
|
|
265
|
+
}
|
|
266
|
+
validateHttpsCredentials(username, password, required = false) {
|
|
267
|
+
if ((username === undefined) !== (password === undefined) || (required && !username)) {
|
|
268
|
+
throw new bad_request_error_1.BadRequestError('HTTPS username and password must be provided together');
|
|
269
|
+
}
|
|
270
|
+
if ([username, password].some((value) => value && /[\r\n\0]/.test(value))) {
|
|
271
|
+
throw new bad_request_error_1.BadRequestError('HTTPS credentials contain unsupported characters');
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
async decryptCredentials(connection) {
|
|
275
|
+
if (connection.connectionType === 'ssh') {
|
|
276
|
+
if (!connection.encryptedPrivateKey)
|
|
277
|
+
throw new bad_request_error_1.BadRequestError('SSH private key is missing');
|
|
278
|
+
return {
|
|
279
|
+
type: 'ssh',
|
|
280
|
+
privateKey: await this.cipher.decryptV2(connection.encryptedPrivateKey),
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
if (!connection.encryptedUsername || !connection.encryptedPassword) {
|
|
284
|
+
throw new bad_request_error_1.BadRequestError('HTTPS credentials are missing');
|
|
285
|
+
}
|
|
286
|
+
return {
|
|
287
|
+
type: 'https',
|
|
288
|
+
username: await this.cipher.decryptV2(connection.encryptedUsername),
|
|
289
|
+
password: await this.cipher.decryptV2(connection.encryptedPassword),
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
async getEntity(id) {
|
|
293
|
+
const connection = await this.repository.findOneBy({ id });
|
|
294
|
+
if (!connection)
|
|
295
|
+
throw new not_found_error_1.NotFoundError('Git connection not found');
|
|
296
|
+
return connection;
|
|
297
|
+
}
|
|
298
|
+
rootFolder(id) {
|
|
299
|
+
return node_path_1.default.join(this.instanceSettings.n8nFolder, 'git-connections', id);
|
|
300
|
+
}
|
|
301
|
+
async resetWorkingCopy(id) {
|
|
302
|
+
await this.gitService.resetWorkingCopy(this.rootFolder(id));
|
|
303
|
+
}
|
|
304
|
+
async purge(id) {
|
|
305
|
+
await this.gitService.cleanup(this.rootFolder(id));
|
|
306
|
+
}
|
|
307
|
+
toPublic(connection) {
|
|
308
|
+
return {
|
|
309
|
+
id: connection.id,
|
|
310
|
+
name: connection.name,
|
|
311
|
+
repositoryUrl: connection.repositoryUrl,
|
|
312
|
+
branchName: connection.branchName,
|
|
313
|
+
connectionType: connection.connectionType,
|
|
314
|
+
publicKey: connection.publicKey,
|
|
315
|
+
keyGeneratorType: connection.keyGeneratorType,
|
|
316
|
+
baseCommit: connection.baseCommit,
|
|
317
|
+
createdAt: connection.createdAt.toISOString(),
|
|
318
|
+
updatedAt: connection.updatedAt.toISOString(),
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
toSummary(connection) {
|
|
322
|
+
const { publicKey: _, ...summary } = this.toPublic(connection);
|
|
323
|
+
return summary;
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
exports.GitConnectionsService = GitConnectionsService;
|
|
327
|
+
exports.GitConnectionsService = GitConnectionsService = __decorate([
|
|
328
|
+
(0, di_1.Service)(),
|
|
329
|
+
__metadata("design:paramtypes", [git_connection_repository_1.GitConnectionRepository, git_connection_project_repository_1.GitConnectionProjectRepository, db_1.ProjectRepository, git_connections_git_service_1.GitConnectionsGitService, n8n_packages_service_1.N8nPackagesService, n8n_core_1.Cipher, n8n_core_1.InstanceSettings, backend_common_1.Logger])
|
|
330
|
+
], GitConnectionsService);
|
|
331
|
+
//# sourceMappingURL=git-connections.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-connections.service.js","sourceRoot":"","sources":["../../../src/modules/git-connections.ee/git-connections.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8CAOwB;AACxB,wDAA6C;AAE7C,gCAA4C;AAC5C,gCAAkC;AAClC,uCAAoD;AACpD,+CAA8D;AAC9D,0DAA6B;AAE7B,kFAA6E;AAC7E,4EAAwE;AACxE,8EAA0E;AAC1E,8EAAyE;AACzE,sFAAiF;AACjF,kFAGmD;AACnD,gEAA8D;AAI9D,iHAA2G;AAC3G,iGAA4F;AAC5F,+EAAyE;AAOzE,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAS/B,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IACjC,YACkB,UAAmC,EACnC,8BAA8D,EAC9D,iBAAoC,EACpC,UAAoC,EACpC,kBAAsC,EACtC,MAAc,EACd,gBAAkC,EAClC,MAAc;0BAPd,UAAU;8CACV,8BAA8B;iCAC9B,iBAAiB;0BACjB,UAAU;kCACV,kBAAkB;sBAClB,MAAM;gCACN,gBAAgB;sBAChB,MAAM;QAEvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAA6B;QACzC,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;QACjF,IAAI,KAAK,CAAC,UAAU;YAAE,MAAM,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAEjF,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC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AI,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;IAGO,KAAK,CAAC,KAAK,CAAC,EAAU;QAC7B,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;IACpD,CAAC;IAEO,QAAQ,CAAC,UAAyB;QACzC,OAAO;YACN,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,aAAa,EAAE,UAAU,CAAC,aAAa;YACvC,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC,cAAc,EAAE,UAAU,CAAC,cAAc;YACzC,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;YAC7C,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,WAAW,EAAE;YAC7C,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,WAAW,EAAE;SAC7C,CAAC;IACH,CAAC;IAEO,SAAS,CAAC,UAAyB;QAC1C,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC/D,OAAO,OAAO,CAAC;IAChB,CAAC;CACD,CAAA;;gCAzWY,qBAAqB;IADjC,IAAA,YAAO,GAAE;qCAGqB,mDAAuB,EACH,kEAA8B,EAC3C,sBAAiB,EACxB,sDAAwB,EAChB,yCAAkB,EAC9B,iBAAM,EACI,2BAAgB,EAC1B,uBAAM;GATpB,qBAAqB,CAyWjC"}
|
|
@@ -2,6 +2,8 @@ import type { Request } from 'express';
|
|
|
2
2
|
import type { WebSocket } from 'ws';
|
|
3
3
|
export declare const BROWSER_USE_WS_NAMESPACE = "/browser-use";
|
|
4
4
|
export declare const CDP_TOKEN_HEADER = "x-n8n-cdp-token";
|
|
5
|
+
export declare const EXTENSION_VERSION_QUERY_PARAM = "extensionVersion";
|
|
6
|
+
export declare function parseExtensionVersion(value: unknown): string | null;
|
|
5
7
|
export interface BrowserUseUpgradeRequest extends Request {
|
|
6
8
|
ws: WebSocket;
|
|
7
9
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CDP_TOKEN_HEADER = exports.BROWSER_USE_WS_NAMESPACE = void 0;
|
|
3
|
+
exports.EXTENSION_VERSION_QUERY_PARAM = exports.CDP_TOKEN_HEADER = exports.BROWSER_USE_WS_NAMESPACE = void 0;
|
|
4
|
+
exports.parseExtensionVersion = parseExtensionVersion;
|
|
4
5
|
exports.BROWSER_USE_WS_NAMESPACE = '/browser-use';
|
|
5
6
|
exports.CDP_TOKEN_HEADER = 'x-n8n-cdp-token';
|
|
7
|
+
exports.EXTENSION_VERSION_QUERY_PARAM = 'extensionVersion';
|
|
8
|
+
const EXTENSION_VERSION_PATTERN = /^\d{1,5}(\.\d{1,5}){0,3}$/;
|
|
9
|
+
function parseExtensionVersion(value) {
|
|
10
|
+
if (typeof value !== 'string' || !EXTENSION_VERSION_PATTERN.test(value)) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
6
15
|
//# sourceMappingURL=browser-use-ws.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-use-ws.constants.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/browser/browser-use-ws.constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser-use-ws.constants.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/browser/browser-use-ws.constants.ts"],"names":[],"mappings":";;;;AAGa,QAAA,wBAAwB,GAAG,cAAc,CAAC;AAE1C,QAAA,gBAAgB,GAAG,iBAAiB,CAAC;AAErC,QAAA,6BAA6B,GAAG,kBAAkB,CAAC;AAEhE,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AAG9D,+BAAsC,KAAc;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACzE,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -2,6 +2,7 @@ import type { InstanceAiBrowserCreateLinkResponse, InstanceAiBrowserStatusRespon
|
|
|
2
2
|
import { Logger } from '@n8n/backend-common';
|
|
3
3
|
import { GlobalConfig } from '@n8n/config';
|
|
4
4
|
import { UserRepository } from '@n8n/db';
|
|
5
|
+
import type { BrowserExtensionTraceContext } from '@n8n/instance-ai';
|
|
5
6
|
import { CredentialsService } from '../../../credentials/credentials.service';
|
|
6
7
|
import { Push } from '../../../push';
|
|
7
8
|
import { UrlService } from '../../../services/url.service';
|
|
@@ -24,6 +25,7 @@ export declare class InstanceAiBrowserSessionService {
|
|
|
24
25
|
disconnect(userId: string): Promise<void>;
|
|
25
26
|
findMcpServer(userId: string): BrowserLocalMcpServer | undefined;
|
|
26
27
|
isConnected(userId: string): boolean;
|
|
28
|
+
getExtensionTraceContext(userId: string): BrowserExtensionTraceContext;
|
|
27
29
|
handleExtensionUpgrade(req: BrowserUseUpgradeRequest): void;
|
|
28
30
|
handleCdpUpgrade(req: BrowserUseUpgradeRequest): void;
|
|
29
31
|
shutdown(): Promise<void>;
|
|
@@ -78,6 +78,15 @@ let InstanceAiBrowserSessionService = class InstanceAiBrowserSessionService {
|
|
|
78
78
|
isConnected(userId) {
|
|
79
79
|
return this.sessions.get(userId)?.connected ?? false;
|
|
80
80
|
}
|
|
81
|
+
getExtensionTraceContext(userId) {
|
|
82
|
+
const session = this.sessions.get(userId);
|
|
83
|
+
if (!session?.connected)
|
|
84
|
+
return { connectionState: 'disconnected' };
|
|
85
|
+
return {
|
|
86
|
+
connectionState: 'connected',
|
|
87
|
+
...(session.extensionVersion !== null ? { version: session.extensionVersion } : {}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
81
90
|
handleExtensionUpgrade(req) {
|
|
82
91
|
const session = this.sessionsBySessionId.get(req.params.sessionId);
|
|
83
92
|
const token = typeof req.query.token === 'string' ? req.query.token : null;
|
|
@@ -85,6 +94,7 @@ let InstanceAiBrowserSessionService = class InstanceAiBrowserSessionService {
|
|
|
85
94
|
req.ws.close(4003, 'Invalid auth token');
|
|
86
95
|
return;
|
|
87
96
|
}
|
|
97
|
+
session.extensionVersion = (0, browser_use_ws_constants_1.parseExtensionVersion)(req.query[browser_use_ws_constants_1.EXTENSION_VERSION_QUERY_PARAM]);
|
|
88
98
|
session.relay.attachExtension(req.ws);
|
|
89
99
|
}
|
|
90
100
|
handleCdpUpgrade(req) {
|
|
@@ -136,6 +146,7 @@ let InstanceAiBrowserSessionService = class InstanceAiBrowserSessionService {
|
|
|
136
146
|
hasConnectedOnce: false,
|
|
137
147
|
connected: false,
|
|
138
148
|
connectedAt: null,
|
|
149
|
+
extensionVersion: null,
|
|
139
150
|
connection: toolkit.connection,
|
|
140
151
|
mcpServer: new browser_local_mcp_server_1.BrowserLocalMcpServer(toolkit, toolContext, this.logger),
|
|
141
152
|
};
|
|
@@ -168,8 +179,14 @@ let InstanceAiBrowserSessionService = class InstanceAiBrowserSessionService {
|
|
|
168
179
|
name: 'browser_connect',
|
|
169
180
|
arguments: {},
|
|
170
181
|
});
|
|
171
|
-
this.telemetry.track('Instance AI Browser connected', {
|
|
172
|
-
|
|
182
|
+
this.telemetry.track('Instance AI Browser connected', {
|
|
183
|
+
user_id: userId,
|
|
184
|
+
browser_extension_version: session.extensionVersion,
|
|
185
|
+
});
|
|
186
|
+
this.logger.info('Browser Use extension connected', {
|
|
187
|
+
userId,
|
|
188
|
+
extensionVersion: session.extensionVersion,
|
|
189
|
+
});
|
|
173
190
|
this.pushState(userId);
|
|
174
191
|
}
|
|
175
192
|
handleExtensionDisconnected(userId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance-ai-browser-session.service.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/browser/instance-ai-browser-session.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,wDAA6C;AAC7C,wCAA2C;AAC3C,gCAAyC;AACzC,gCAAkC;
|
|
1
|
+
{"version":3,"file":"instance-ai-browser-session.service.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/browser/instance-ai-browser-session.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,wDAA6C;AAC7C,wCAA2C;AAC3C,gCAAyC;AACzC,gCAAkC;AASlC,+CAA+C;AAC/C,mCAAgC;AAChC,6CAA8C;AAC9C,+CAAyC;AACzC,qCAAiC;AACjC,yCAAiC;AAEjC,2EAAuE;AACvE,iCAA8B;AAC9B,wDAAoD;AACpD,2CAAwC;AAExC,yEAAmE;AACnE,yEAMoC;AAEpC,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAE3C,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAkBtE,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAO3C,YACC,MAAc,EACG,UAAsB,EACtB,IAAU,EACV,cAA8B,EAC9B,kBAAsC,EACtC,YAA0B,EAC1B,SAAoB;QALpB,eAAU,GAAV,UAAU,CAAY;QACtB,SAAI,GAAJ,IAAI,CAAM;QACV,mBAAc,GAAd,cAAc,CAAgB;QAC9B,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,cAAS,GAAT,SAAS,CAAW;QAbrB,aAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;QAE7C,wBAAmB,GAAG,IAAI,GAAG,EAA0B,CAAC;QAaxE,IAAI,CAAC,MAAM,GAAG,MAAM,C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AC;IACnC,CAAC;CACD,CAAA;;0CApRY,+BAA+B;IAD3C,IAAA,YAAO,GAAE;qCASA,uBAAM,EACe,wBAAU,EAChB,WAAI,EACM,mBAAc,EACV,wCAAkB,EACxB,qBAAY,EACf,qBAAS;GAd1B,+BAA+B,CAoR3C;AAED,SAAS,2BAA2B;IACnC,MAAM,KAAK,GAAG,IAAI,GAAG,EAA+B,CAAC;IACrD,OAAO;QACN,OAAO,CAAC,cAAsB,EAAE,KAAa,EAAE,KAAa;YAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,GAAG,EAAkB,CAAC;YACtE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACzB,KAAK,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QACnC,CAAC;QACD,SAAS,CAAC,cAAsB;YAC/B,OAAO,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAClC,CAAC;QACD,KAAK,CAAC,cAAsB;YAC3B,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAC9B,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -31,6 +31,8 @@ export declare class DurableEventLog {
|
|
|
31
31
|
constructor(logger: Logger, repo: InstanceAiEventLogRepository, metrics: DurableLogMetrics);
|
|
32
32
|
publish(threadId: string, event: InstanceAiEvent, emit: EmitFn): void;
|
|
33
33
|
private scheduleIdleFlush;
|
|
34
|
+
private settleIdleThread;
|
|
35
|
+
retainedThreadCount(): number;
|
|
34
36
|
getEventsAfter(threadId: string, afterSeq: number): Promise<StoredEvent[]>;
|
|
35
37
|
getEventsForRuns(threadId: string, runIds: string[]): Promise<InstanceAiEvent[]>;
|
|
36
38
|
getOpenSegments(threadId: string): OpenSegment[];
|
|
@@ -57,13 +57,40 @@ let DurableEventLog = class DurableEventLog {
|
|
|
57
57
|
clearTimeout(existing);
|
|
58
58
|
const timer = setTimeout(() => {
|
|
59
59
|
this.idleFlushTimers.delete(threadId);
|
|
60
|
-
void this.
|
|
60
|
+
void this.settleIdleThread(threadId).catch((error) => {
|
|
61
61
|
this.logger.error('Instance AI event log idle flush failed', { threadId, error });
|
|
62
62
|
});
|
|
63
63
|
}, this.idleFlushMs);
|
|
64
64
|
timer.unref();
|
|
65
65
|
this.idleFlushTimers.set(threadId, timer);
|
|
66
66
|
}
|
|
67
|
+
async settleIdleThread(threadId) {
|
|
68
|
+
await this.flush(threadId);
|
|
69
|
+
await this.draining.get(threadId);
|
|
70
|
+
if (this.idleFlushTimers.has(threadId))
|
|
71
|
+
return;
|
|
72
|
+
if (this.pendingByThread.has(threadId) ||
|
|
73
|
+
this.draining.has(threadId) ||
|
|
74
|
+
(this.buffers.get(threadId)?.size ?? 0) > 0) {
|
|
75
|
+
this.scheduleIdleFlush(threadId);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
this.buffers.delete(threadId);
|
|
79
|
+
this.lastSeq.delete(threadId);
|
|
80
|
+
this.emitters.delete(threadId);
|
|
81
|
+
this.lifecycles.delete(threadId);
|
|
82
|
+
}
|
|
83
|
+
retainedThreadCount() {
|
|
84
|
+
return new Set([
|
|
85
|
+
...this.pendingByThread.keys(),
|
|
86
|
+
...this.draining.keys(),
|
|
87
|
+
...this.lastSeq.keys(),
|
|
88
|
+
...this.buffers.keys(),
|
|
89
|
+
...this.emitters.keys(),
|
|
90
|
+
...this.lifecycles.keys(),
|
|
91
|
+
...this.idleFlushTimers.keys(),
|
|
92
|
+
]).size;
|
|
93
|
+
}
|
|
67
94
|
async getEventsAfter(threadId, afterSeq) {
|
|
68
95
|
return await this.repo.getAfter(threadId, afterSeq);
|
|
69
96
|
}
|
|
@@ -393,6 +420,8 @@ let DurableEventLog = class DurableEventLog {
|
|
|
393
420
|
if (text)
|
|
394
421
|
flushed.push(text);
|
|
395
422
|
}
|
|
423
|
+
if (threadBuffers.size === 0)
|
|
424
|
+
this.buffers.delete(threadId);
|
|
396
425
|
return flushed;
|
|
397
426
|
}
|
|
398
427
|
rollSegmentOnResponseChange(threadId, event) {
|