n8n 2.29.6 → 2.30.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 +9 -8
- package/dist/active-executions.d.ts +2 -1
- package/dist/active-executions.js +2 -1
- package/dist/active-executions.js.map +1 -1
- package/dist/active-workflow-manager.js +10 -5
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/blob-storage/azure-byte-store.ee.js +2 -2
- package/dist/blob-storage/azure-byte-store.ee.js.map +1 -1
- package/dist/blob-storage/s3-byte-store.ee.js +2 -2
- package/dist/blob-storage/s3-byte-store.ee.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/chat/chat-service.js +5 -4
- package/dist/chat/chat-service.js.map +1 -1
- package/dist/chat/chat-service.types.d.ts +2 -2
- package/dist/command-registry.js +12 -4
- package/dist/command-registry.js.map +1 -1
- package/dist/commands/audit.js +3 -2
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/base-command.js +2 -1
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/execute.d.ts +2 -2
- package/dist/commands/export/credentials.d.ts +4 -4
- package/dist/commands/export/entities.d.ts +2 -2
- package/dist/commands/export/workflow.d.ts +4 -4
- package/dist/commands/import/credentials.d.ts +2 -2
- package/dist/commands/import/workflow.d.ts +2 -2
- package/dist/commands/start.js +2 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/ttwf/generate.d.ts +2 -2
- package/dist/controllers/annotation-tags.controller.ee.d.ts +1 -1
- package/dist/controllers/oauth/oauth1-credential.controller.d.ts +3 -1
- package/dist/controllers/oauth/oauth1-credential.controller.js +12 -6
- package/dist/controllers/oauth/oauth1-credential.controller.js.map +1 -1
- package/dist/controllers/oauth/oauth2-credential.controller.d.ts +3 -1
- package/dist/controllers/oauth/oauth2-credential.controller.js +12 -5
- package/dist/controllers/oauth/oauth2-credential.controller.js.map +1 -1
- package/dist/controllers/posthog.controller.d.ts +6 -0
- package/dist/controllers/posthog.controller.js +36 -8
- package/dist/controllers/posthog.controller.js.map +1 -1
- package/dist/controllers/project.controller.d.ts +2 -0
- package/dist/controllers/project.controller.js +12 -4
- package/dist/controllers/project.controller.js.map +1 -1
- package/dist/controllers/role.controller.d.ts +3 -2
- package/dist/controllers/role.controller.js +21 -7
- package/dist/controllers/role.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +3 -2
- package/dist/controllers/users.controller.js +5 -1
- package/dist/controllers/users.controller.js.map +1 -1
- package/dist/credentials/credentials.controller.d.ts +3 -1
- package/dist/credentials/credentials.controller.js +24 -18
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +1 -0
- package/dist/credentials/credentials.service.js +11 -0
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials-overwrites.d.ts +2 -0
- package/dist/credentials-overwrites.js +10 -0
- package/dist/credentials-overwrites.js.map +1 -1
- package/dist/deprecation/deprecation.service.js +35 -6
- package/dist/deprecation/deprecation.service.js.map +1 -1
- package/dist/errors/response-errors/bad-request.error.d.ts +2 -1
- package/dist/errors/response-errors/bad-request.error.js +5 -2
- package/dist/errors/response-errors/bad-request.error.js.map +1 -1
- package/dist/evaluation.ee/test-runs.controller.ee.d.ts +1 -0
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +1 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/event.service.d.ts +2 -1
- package/dist/events/event.service.js.map +1 -1
- package/dist/events/maps/instance-ai.event-map.d.ts +1 -1
- package/dist/events/maps/relay.event-map.d.ts +21 -2
- package/dist/events/maps/workflow-publication-metrics.event-map.d.ts +26 -0
- package/dist/events/maps/workflow-publication-metrics.event-map.js +3 -0
- package/dist/events/maps/workflow-publication-metrics.event-map.js.map +1 -0
- package/dist/events/relays/log-streaming.event-relay.d.ts +2 -1
- package/dist/events/relays/log-streaming.event-relay.js +16 -3
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +3 -0
- package/dist/events/relays/telemetry.event-relay.js +44 -3
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +2 -0
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/execution-lifecycle/shared/shared-hook-functions.js +2 -2
- package/dist/execution-lifecycle/shared/shared-hook-functions.js.map +1 -1
- package/dist/executions/execution-data/azure-store.ee.js +2 -1
- package/dist/executions/execution-data/azure-store.ee.js.map +1 -1
- package/dist/executions/execution-data/s3-store.ee.js +2 -1
- package/dist/executions/execution-data/s3-store.ee.js.map +1 -1
- package/dist/executions/execution.service.js +13 -2
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js +6 -6
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js.map +1 -1
- package/dist/interfaces.d.ts +2 -1
- package/dist/license/license.service.js +4 -4
- package/dist/license/license.service.js.map +1 -1
- package/dist/load-nodes-and-credentials.js +5 -4
- package/dist/load-nodes-and-credentials.js.map +1 -1
- package/dist/metrics/prometheus/active-workflow-metrics.service.js +8 -13
- package/dist/metrics/prometheus/active-workflow-metrics.service.js.map +1 -1
- package/dist/metrics/prometheus/cached-metric-query.d.ts +19 -0
- package/dist/metrics/prometheus/cached-metric-query.js +28 -0
- package/dist/metrics/prometheus/cached-metric-query.js.map +1 -0
- package/dist/metrics/prometheus/instance-ai-metrics.service.js +5 -3
- package/dist/metrics/prometheus/instance-ai-metrics.service.js.map +1 -1
- package/dist/metrics/prometheus/prometheus.service.d.ts +2 -1
- package/dist/metrics/prometheus/prometheus.service.js +5 -2
- package/dist/metrics/prometheus/prometheus.service.js.map +1 -1
- package/dist/metrics/prometheus/workflow-info-metrics.service.js +8 -13
- package/dist/metrics/prometheus/workflow-info-metrics.service.js.map +1 -1
- package/dist/metrics/prometheus/workflow-publication-metrics.service.d.ts +21 -0
- package/dist/metrics/prometheus/workflow-publication-metrics.service.js +160 -0
- package/dist/metrics/prometheus/workflow-publication-metrics.service.js.map +1 -0
- package/dist/metrics/prometheus/workflow-statistics-metrics.service.d.ts +0 -4
- package/dist/metrics/prometheus/workflow-statistics-metrics.service.js +10 -42
- package/dist/metrics/prometheus/workflow-statistics-metrics.service.js.map +1 -1
- package/dist/middlewares/body-parser.js +21 -7
- package/dist/middlewares/body-parser.js.map +1 -1
- package/dist/modules/agents/agent-config.service.js +39 -18
- package/dist/modules/agents/agent-config.service.js.map +1 -1
- package/dist/modules/agents/agent-execution-orchestrator.service.d.ts +2 -2
- package/dist/modules/agents/agent-execution-orchestrator.service.js +5 -8
- package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
- package/dist/modules/agents/agent-execution.service.d.ts +2 -2
- package/dist/modules/agents/agent-execution.service.js +11 -8
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-integration-persistence.service.d.ts +4 -1
- package/dist/modules/agents/agent-integration-persistence.service.js +4 -2
- package/dist/modules/agents/agent-integration-persistence.service.js.map +1 -1
- package/dist/modules/agents/agent-integrations.controller.js +13 -3
- package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-commands.d.ts +3 -0
- package/dist/modules/agents/agent-knowledge-commands.js +32 -9
- package/dist/modules/agents/agent-knowledge-commands.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-gate.d.ts +1 -1
- package/dist/modules/agents/agent-knowledge-gate.js +1 -3
- package/dist/modules/agents/agent-knowledge-gate.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-retrieval.d.ts +13 -6
- package/dist/modules/agents/agent-knowledge-retrieval.js +16 -14
- package/dist/modules/agents/agent-knowledge-retrieval.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-sandbox.service.d.ts +16 -11
- package/dist/modules/agents/agent-knowledge-sandbox.service.js +233 -140
- package/dist/modules/agents/agent-knowledge-sandbox.service.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-storage.d.ts +4 -15
- package/dist/modules/agents/agent-knowledge-storage.js +13 -26
- package/dist/modules/agents/agent-knowledge-storage.js.map +1 -1
- package/dist/modules/agents/agent-knowledge.controller.d.ts +1 -1
- package/dist/modules/agents/agent-knowledge.controller.js +3 -3
- package/dist/modules/agents/agent-knowledge.controller.js.map +1 -1
- package/dist/modules/agents/agent-knowledge.service.d.ts +13 -12
- package/dist/modules/agents/agent-knowledge.service.js +93 -106
- package/dist/modules/agents/agent-knowledge.service.js.map +1 -1
- package/dist/modules/agents/agent-model-catalog.service.d.ts +11 -0
- package/dist/modules/agents/agent-model-catalog.service.js +138 -0
- package/dist/modules/agents/agent-model-catalog.service.js.map +1 -0
- package/dist/modules/agents/agent-publish.service.js +6 -1
- package/dist/modules/agents/agent-publish.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-cache.service.d.ts +0 -1
- package/dist/modules/agents/agent-runtime-cache.service.js +4 -13
- package/dist/modules/agents/agent-runtime-cache.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +3 -7
- package/dist/modules/agents/agent-runtime-reconstruction.service.js +10 -26
- package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
- package/dist/modules/agents/agent-sandbox.controller.d.ts +1 -1
- package/dist/modules/agents/agent-sandbox.controller.js +4 -4
- package/dist/modules/agents/agent-sandbox.controller.js.map +1 -1
- package/dist/modules/agents/agent-task.service.d.ts +1 -4
- package/dist/modules/agents/agent-task.service.js +1 -23
- package/dist/modules/agents/agent-task.service.js.map +1 -1
- package/dist/modules/agents/agents-catalog.controller.d.ts +9 -2
- package/dist/modules/agents/agents-catalog.controller.js +25 -2
- package/dist/modules/agents/agents-catalog.controller.js.map +1 -1
- package/dist/modules/agents/agents-config.controller.d.ts +46 -30
- package/dist/modules/agents/agents.controller.js +1 -1
- package/dist/modules/agents/agents.controller.js.map +1 -1
- package/dist/modules/agents/agents.service.d.ts +1 -1
- package/dist/modules/agents/agents.service.js +8 -2
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +3 -3
- package/dist/modules/agents/builder/agents-builder-tools.service.js +32 -9
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-model-live-lookup.service.d.ts +14 -0
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js +91 -0
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js.map +1 -0
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.d.ts +0 -12
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.js +20 -40
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.js.map +1 -1
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.d.ts +1 -2
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +3 -2
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +6 -0
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js +7 -0
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -1
- package/dist/modules/agents/entities/agent-execution.entity.d.ts +2 -4
- package/dist/modules/agents/entities/agent-execution.entity.js +2 -10
- package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
- package/dist/modules/agents/execution-recorder.d.ts +0 -8
- package/dist/modules/agents/execution-recorder.js +12 -27
- package/dist/modules/agents/execution-recorder.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-suspension-cards.js +5 -5
- package/dist/modules/agents/integrations/agent-chat-suspension-cards.js.map +1 -1
- package/dist/modules/agents/integrations/chat-integration.service.d.ts +7 -6
- package/dist/modules/agents/integrations/chat-integration.service.js +51 -85
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
- package/dist/modules/agents/integrations/integration-action-executor.d.ts +116 -116
- package/dist/modules/agents/integrations/integration-helpers.js +5 -5
- package/dist/modules/agents/integrations/integration-helpers.js.map +1 -1
- package/dist/modules/agents/integrations/integration-message-context.service.js +2 -2
- package/dist/modules/agents/integrations/integration-message-context.service.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-definitions.d.ts +949 -949
- package/dist/modules/agents/integrations/integration-tool-execution.js +4 -4
- package/dist/modules/agents/integrations/integration-tool-execution.js.map +1 -1
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +1 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +9 -1
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/linear-operations.js +18 -18
- package/dist/modules/agents/integrations/platforms/linear-operations.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/linear-tool-definitions.d.ts +30 -30
- package/dist/modules/agents/integrations/platforms/slack-bridge-behavior.js +6 -6
- package/dist/modules/agents/integrations/platforms/slack-bridge-behavior.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack-operations.js +3 -3
- package/dist/modules/agents/integrations/platforms/slack-operations.js.map +1 -1
- package/dist/modules/agents/integrations/recording/channel-integration-recorder.d.ts +64 -0
- package/dist/modules/agents/integrations/recording/channel-integration-recorder.js +376 -0
- package/dist/modules/agents/integrations/recording/channel-integration-recorder.js.map +1 -0
- package/dist/modules/agents/integrations/recording/recording-adapter.d.ts +2 -0
- package/dist/modules/agents/integrations/recording/recording-adapter.js +98 -0
- package/dist/modules/agents/integrations/recording/recording-adapter.js.map +1 -0
- package/dist/modules/agents/integrations/slack-app-setup.service.js +5 -5
- package/dist/modules/agents/integrations/slack-app-setup.service.js.map +1 -1
- package/dist/modules/agents/json-config/from-json-config.js +3 -0
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
- package/dist/modules/agents/repositories/agent-checkpoint.repository.d.ts +1 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js +4 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-execution.repository.js +3 -1
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.d.ts +0 -1
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js +0 -1
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +1 -1
- package/dist/modules/agents/tools/knowledge/search-knowledge.tool.d.ts +12 -8
- package/dist/modules/agents/tools/knowledge/search-knowledge.tool.js +12 -10
- package/dist/modules/agents/tools/knowledge/search-knowledge.tool.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.d.ts +2 -6
- package/dist/modules/agents/tools/workflow-tool-factory.js +11 -24
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/utils/agent-resource-id.js +2 -2
- package/dist/modules/agents/utils/agent-resource-id.js.map +1 -1
- package/dist/modules/agents/utils/execution-to-message-mapper.d.ts +1 -1
- package/dist/modules/agents/utils/execution-to-message-mapper.js +4 -31
- package/dist/modules/agents/utils/execution-to-message-mapper.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.controller.d.ts +4 -7
- package/dist/modules/breaking-changes/breaking-changes.controller.js +8 -7
- package/dist/modules/breaking-changes/breaking-changes.controller.js.map +1 -1
- package/dist/modules/breaking-changes/rules/index.d.ts +2 -0
- package/dist/modules/breaking-changes/rules/index.js +2 -0
- package/dist/modules/breaking-changes/rules/index.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/always-output-data-multi-output.rule.d.ts +14 -0
- package/dist/modules/breaking-changes/rules/v3/always-output-data-multi-output.rule.js +82 -0
- package/dist/modules/breaking-changes/rules/v3/always-output-data-multi-output.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-each-mode.rule.d.ts +10 -0
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-each-mode.rule.js +53 -0
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-each-mode.rule.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-extractor.js +2 -1
- package/dist/modules/chat-hub/chat-hub-extractor.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.attachment.service.js +3 -3
- package/dist/modules/chat-hub/chat-hub.attachment.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.controller.js +2 -2
- package/dist/modules/chat-hub/chat-hub.controller.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.module.d.ts +1 -1
- package/dist/modules/chat-hub/chat-hub.settings.controller.d.ts +3 -3
- package/dist/modules/chat-hub/chat-hub.types.d.ts +4 -4
- package/dist/modules/community-packages/community-node-types.service.js +3 -2
- package/dist/modules/community-packages/community-node-types.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.js +2 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.service.d.ts +6 -0
- package/dist/modules/community-packages/community-packages.service.js +116 -25
- package/dist/modules/community-packages/community-packages.service.js.map +1 -1
- package/dist/modules/community-packages/installed-packages.repository.d.ts +2 -0
- package/dist/modules/community-packages/installed-packages.repository.js +9 -0
- package/dist/modules/community-packages/installed-packages.repository.js.map +1 -1
- package/dist/modules/community-packages/npm-utils.js +2 -2
- package/dist/modules/community-packages/npm-utils.js.map +1 -1
- package/dist/modules/data-table/data-table-column.repository.js +3 -2
- package/dist/modules/data-table/data-table-column.repository.js.map +1 -1
- package/dist/modules/data-table/data-table-proxy.service.d.ts +3 -0
- package/dist/modules/data-table/data-table-proxy.service.js +8 -0
- package/dist/modules/data-table/data-table-proxy.service.js.map +1 -1
- package/dist/modules/data-table/data-table-rows.repository.d.ts +3 -0
- package/dist/modules/data-table/data-table-rows.repository.js +15 -4
- package/dist/modules/data-table/data-table-rows.repository.js.map +1 -1
- package/dist/modules/data-table/data-table.controller.js +2 -1
- package/dist/modules/data-table/data-table.controller.js.map +1 -1
- package/dist/modules/data-table/data-table.module.d.ts +1 -1
- package/dist/modules/data-table/data-table.repository.js +10 -0
- package/dist/modules/data-table/data-table.repository.js.map +1 -1
- package/dist/modules/data-table/data-table.service.d.ts +3 -0
- package/dist/modules/data-table/data-table.service.js +10 -0
- package/dist/modules/data-table/data-table.service.js.map +1 -1
- package/dist/modules/data-table/multer-upload-middleware.js +4 -3
- package/dist/modules/data-table/multer-upload-middleware.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-extractor.js +2 -1
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-extractor.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/dynamic-credentials.controller.js +2 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js +5 -0
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.d.ts +2 -3
- package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.js +1 -7
- package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/shared-fields.d.ts +2 -1
- package/dist/modules/dynamic-credentials.ee/services/shared-fields.js +15 -0
- package/dist/modules/dynamic-credentials.ee/services/shared-fields.js.map +1 -1
- package/dist/modules/external-secrets.ee/errors/secrets-provider-errors.d.ts +33 -0
- package/dist/modules/external-secrets.ee/errors/secrets-provider-errors.js +58 -0
- package/dist/modules/external-secrets.ee/errors/secrets-provider-errors.js.map +1 -0
- package/dist/modules/external-secrets.ee/provider-lifecycle.service.js +4 -4
- package/dist/modules/external-secrets.ee/provider-lifecycle.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.d.ts +16 -3
- package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js +114 -23
- package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.d.ts +3 -0
- package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.js +136 -32
- package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/gcp-secrets-manager/gcp-secrets-manager.d.ts +2 -0
- package/dist/modules/external-secrets.ee/providers/gcp-secrets-manager/gcp-secrets-manager.js +134 -50
- package/dist/modules/external-secrets.ee/providers/gcp-secrets-manager/gcp-secrets-manager.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/infisical.d.ts +31 -0
- package/dist/modules/external-secrets.ee/providers/infisical.js +97 -40
- package/dist/modules/external-secrets.ee/providers/infisical.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/one-password.d.ts +2 -0
- package/dist/modules/external-secrets.ee/providers/one-password.js +97 -41
- package/dist/modules/external-secrets.ee/providers/one-password.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/vault.d.ts +3 -1
- package/dist/modules/external-secrets.ee/providers/vault.js +126 -33
- package/dist/modules/external-secrets.ee/providers/vault.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-cache.service.js +2 -1
- package/dist/modules/external-secrets.ee/secrets-cache.service.js.map +1 -1
- package/dist/modules/favorites/dto/add-favorite.dto.d.ts +1 -1
- package/dist/modules/insights/database/entities/insights-shared.d.ts +1 -1
- package/dist/modules/insights/database/repositories/insights-by-period.repository.d.ts +2 -2
- package/dist/modules/insights/insights-compaction.service.d.ts +4 -2
- package/dist/modules/insights/insights-compaction.service.js +46 -39
- package/dist/modules/insights/insights-compaction.service.js.map +1 -1
- package/dist/modules/insights/insights.service.d.ts +3 -3
- package/dist/modules/insights/insights.service.js +4 -4
- package/dist/modules/insights/insights.service.js.map +1 -1
- package/dist/modules/instance-ai/browser/browser-local-mcp-server.js +1 -1
- package/dist/modules/instance-ai/browser/browser-local-mcp-server.js.map +1 -1
- package/dist/modules/instance-ai/eval/date-anchors.d.ts +1 -0
- package/dist/modules/instance-ai/eval/date-anchors.js +24 -0
- package/dist/modules/instance-ai/eval/date-anchors.js.map +1 -0
- package/dist/modules/instance-ai/eval/eval-timings.d.ts +10 -0
- package/dist/modules/instance-ai/eval/eval-timings.js +50 -0
- package/dist/modules/instance-ai/eval/eval-timings.js.map +1 -0
- package/dist/modules/instance-ai/eval/execution.service.d.ts +1 -0
- package/dist/modules/instance-ai/eval/execution.service.js +175 -26
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/llm-completion-mock.d.ts +7 -0
- package/dist/modules/instance-ai/eval/llm-completion-mock.js +188 -0
- package/dist/modules/instance-ai/eval/llm-completion-mock.js.map +1 -0
- package/dist/modules/instance-ai/eval/llm-wire-server.js +14 -1
- package/dist/modules/instance-ai/eval/llm-wire-server.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-handler.d.ts +9 -2
- package/dist/modules/instance-ai/eval/mock-handler.js +239 -41
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-quirks.d.ts +1 -0
- package/dist/modules/instance-ai/eval/mock-quirks.js +47 -2
- package/dist/modules/instance-ai/eval/mock-quirks.js.map +1 -1
- package/dist/modules/instance-ai/eval/pin-data-generator.d.ts +7 -0
- package/dist/modules/instance-ai/eval/pin-data-generator.js +190 -8
- package/dist/modules/instance-ai/eval/pin-data-generator.js.map +1 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +2 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.js +25 -3
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.d.ts +15 -1
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.js +51 -5
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-error-reporter.service.d.ts +18 -0
- package/dist/modules/instance-ai/instance-ai-error-reporter.service.js +76 -0
- package/dist/modules/instance-ai/instance-ai-error-reporter.service.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +4 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +71 -8
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +5 -5
- package/dist/modules/instance-ai/instance-ai.controller.js +85 -55
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +24 -6
- package/dist/modules/instance-ai/instance-ai.service.js +303 -106
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.d.ts +2 -1
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.js +12 -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 +3 -1
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js +78 -11
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js.map +1 -1
- package/dist/modules/instance-ai/message-parser.js +62 -15
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-ai/node-definition-resolver.js +34 -4
- package/dist/modules/instance-ai/node-definition-resolver.js.map +1 -1
- package/dist/modules/instance-ai/observability.d.ts +2 -1
- package/dist/modules/instance-ai/observability.js +2 -1
- package/dist/modules/instance-ai/observability.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.d.ts +1 -0
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.js +4 -0
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.js.map +1 -1
- package/dist/modules/instance-ai/storage/db-iteration-log-storage.js +2 -2
- package/dist/modules/instance-ai/storage/db-iteration-log-storage.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js +4 -4
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js.map +1 -1
- package/dist/modules/instance-ai/suspended-run-restorer.service.d.ts +3 -2
- package/dist/modules/instance-ai/suspended-run-restorer.service.js +9 -8
- package/dist/modules/instance-ai/suspended-run-restorer.service.js.map +1 -1
- package/dist/modules/instance-registry/storage/redis-instance-storage.js +9 -8
- package/dist/modules/instance-registry/storage/redis-instance-storage.js.map +1 -1
- package/dist/modules/mcp/mcp-api-key.service.js +2 -2
- package/dist/modules/mcp/mcp-api-key.service.js.map +1 -1
- package/dist/modules/mcp/mcp-server-middleware.service.js +3 -3
- package/dist/modules/mcp/mcp-server-middleware.service.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +2 -1
- package/dist/modules/mcp/mcp.service.js +3 -2
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.typeguards.js +9 -9
- package/dist/modules/mcp/mcp.typeguards.js.map +1 -1
- package/dist/modules/mcp/mcp.utils.js +2 -2
- package/dist/modules/mcp/mcp.utils.js.map +1 -1
- package/dist/modules/mcp/tools/execute-workflow.tool.d.ts +8 -8
- package/dist/modules/mcp/tools/execute-workflow.tool.js +2 -1
- package/dist/modules/mcp/tools/execute-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/execution-utils.js +2 -1
- package/dist/modules/mcp/tools/execution-utils.js.map +1 -1
- package/dist/modules/mcp/tools/get-execution.tool.js +2 -1
- package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-workflow-details.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/get-workflow-details.tool.js +5 -5
- package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-workflow-history.tool.d.ts +4 -4
- package/dist/modules/mcp/tools/get-workflow-history.tool.js +2 -2
- package/dist/modules/mcp/tools/get-workflow-history.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-workflow-version.tool.js +2 -2
- package/dist/modules/mcp/tools/get-workflow-version.tool.js.map +1 -1
- package/dist/modules/mcp/tools/publish-workflow.tool.js +2 -1
- package/dist/modules/mcp/tools/publish-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/schemas.d.ts +52 -52
- package/dist/modules/mcp/tools/test-workflow.tool.js +2 -1
- package/dist/modules/mcp/tools/test-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/unpublish-workflow.tool.js +2 -1
- package/dist/modules/mcp/tools/unpublish-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/webhook-utils.d.ts +2 -3
- package/dist/modules/mcp/tools/webhook-utils.js +15 -21
- package/dist/modules/mcp/tools/webhook-utils.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/restore-workflow-version.tool.js +2 -2
- package/dist/modules/mcp/tools/workflow-builder/restore-workflow-version.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-node.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.d.ts +85 -85
- package/dist/modules/mcp-registry/mcp-registry-node-loader.js +2 -1
- package/dist/modules/mcp-registry/mcp-registry-node-loader.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-pipeline.js +14 -1
- package/dist/modules/n8n-packages/engine/import-pipeline.js.map +1 -1
- package/dist/modules/n8n-packages/entities/folder/folder.exporter.d.ts +31 -0
- package/dist/modules/n8n-packages/entities/folder/folder.exporter.js +115 -0
- package/dist/modules/n8n-packages/entities/folder/folder.exporter.js.map +1 -0
- package/dist/modules/n8n-packages/entities/folder/folder.serializer.d.ts +5 -0
- package/dist/modules/n8n-packages/entities/folder/folder.serializer.js +25 -0
- package/dist/modules/n8n-packages/entities/folder/folder.serializer.js.map +1 -0
- package/dist/modules/n8n-packages/entities/project/project.exporter.d.ts +20 -0
- package/dist/modules/n8n-packages/entities/project/project.exporter.js +59 -0
- package/dist/modules/n8n-packages/entities/project/project.exporter.js.map +1 -0
- package/dist/modules/n8n-packages/entities/project/project.serializer.d.ts +5 -0
- package/dist/modules/n8n-packages/entities/project/project.serializer.js +26 -0
- package/dist/modules/n8n-packages/entities/project/project.serializer.js.map +1 -0
- package/dist/modules/n8n-packages/entities/requirements.types.d.ts +5 -0
- package/dist/modules/n8n-packages/entities/requirements.types.js +8 -0
- package/dist/modules/n8n-packages/entities/requirements.types.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js +2 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.d.ts +3 -5
- 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/io/slug.utils.d.ts +1 -1
- package/dist/modules/n8n-packages/io/slug.utils.js +1 -2
- package/dist/modules/n8n-packages/io/slug.utils.js.map +1 -1
- package/dist/modules/n8n-packages/io/unique-filename-allocator.d.ts +3 -2
- package/dist/modules/n8n-packages/io/unique-filename-allocator.js +3 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.module.js +1 -1
- package/dist/modules/n8n-packages/n8n-packages.module.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.service.d.ts +11 -3
- package/dist/modules/n8n-packages/n8n-packages.service.js +77 -16
- package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +21 -2
- package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
- package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +88 -22
- package/dist/modules/n8n-packages/spec/manifest.schema.js +20 -12
- package/dist/modules/n8n-packages/spec/manifest.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +8 -8
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.d.ts +2 -2
- package/dist/modules/n8n-packages/spec/serialized/folder.schema.d.ts +15 -0
- package/dist/modules/n8n-packages/spec/serialized/folder.schema.js +12 -0
- package/dist/modules/n8n-packages/spec/serialized/folder.schema.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/project.schema.d.ts +33 -0
- package/dist/modules/n8n-packages/spec/serialized/project.schema.js +15 -0
- package/dist/modules/n8n-packages/spec/serialized/project.schema.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +32 -32
- package/dist/modules/oauth-jwe/oauth-jwe-key.service.js +2 -2
- package/dist/modules/oauth-jwe/oauth-jwe-key.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth-token.service.js +2 -1
- package/dist/modules/oauth-server/oauth-token.service.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-test-trigger-resource.resolver.js +2 -2
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-test-trigger-resource.resolver.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.js +32 -8
- package/dist/modules/otel/execution-level-tracer.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.types.d.ts +2 -0
- package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
- package/dist/modules/provisioning.ee/provisioning.service.ee.d.ts +1 -0
- package/dist/modules/provisioning.ee/provisioning.service.ee.js +38 -15
- package/dist/modules/provisioning.ee/provisioning.service.ee.js.map +1 -1
- package/dist/modules/quick-connect/quick-connect.config.d.ts +19 -19
- package/dist/modules/quick-connect/quick-connect.module.d.ts +8 -8
- package/dist/modules/source-control.ee/source-control-export.service.ee.js +3 -1
- package/dist/modules/source-control.ee/source-control-export.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-helper.ee.js +2 -0
- 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 +15 -10
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +6 -6
- package/dist/modules/source-control.ee/source-control.controller.ee.js +3 -3
- package/dist/modules/source-control.ee/source-control.controller.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.service.ee.d.ts +2 -2
- package/dist/modules/source-control.ee/source-control.service.ee.js +2 -2
- package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/types/exportable-credential.d.ts +2 -0
- package/dist/modules/sso-saml/saml.controller.ee.d.ts +2 -2
- package/dist/modules/token-exchange/token-exchange.schemas.d.ts +8 -8
- package/dist/modules/workflow-index/workflow-index.service.js +3 -2
- package/dist/modules/workflow-index/workflow-index.service.js.map +1 -1
- package/dist/node-types.d.ts +1 -0
- package/dist/node-types.js +17 -3
- package/dist/node-types.js.map +1 -1
- package/dist/oauth/oauth.service.d.ts +5 -0
- package/dist/oauth/oauth.service.js +45 -15
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/public-api/types.d.ts +28 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.d.ts +1 -0
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js +15 -0
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/discover/discover.service.js +11 -11
- package/dist/public-api/v1/handlers/discover/discover.service.js.map +1 -1
- package/dist/public-api/v1/handlers/evaluations/evaluations.handler.d.ts +9 -0
- package/dist/public-api/v1/handlers/evaluations/evaluations.handler.js +64 -0
- package/dist/public-api/v1/handlers/evaluations/evaluations.handler.js.map +1 -0
- package/dist/public-api/v1/handlers/evaluations/evaluations.mapper.d.ts +9 -0
- package/dist/public-api/v1/handlers/evaluations/evaluations.mapper.js +34 -0
- package/dist/public-api/v1/handlers/evaluations/evaluations.mapper.js.map +1 -0
- package/dist/public-api/v1/handlers/executions/executions.handler.js +1 -0
- 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 +5 -3
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +53 -26
- 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 +10 -0
- package/dist/public-api/v1/handlers/projects/projects.handler.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +300 -18
- package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -0
- package/dist/public-api/v1/shared/middlewares/global.middleware.js +6 -0
- package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
- package/dist/push/index.js +3 -3
- package/dist/push/index.js.map +1 -1
- package/dist/requests.d.ts +1 -0
- package/dist/response-helper.js +2 -1
- package/dist/response-helper.js.map +1 -1
- package/dist/scaling/constants.d.ts +3 -2
- package/dist/scaling/constants.js +4 -1
- package/dist/scaling/constants.js.map +1 -1
- package/dist/scaling/job-processor.js +1 -0
- package/dist/scaling/job-processor.js.map +1 -1
- package/dist/scaling/leader-election-client.d.ts +1 -1
- package/dist/scaling/leader-election-client.js +13 -12
- package/dist/scaling/leader-election-client.js.map +1 -1
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +11 -1
- package/dist/scaling/pubsub/pubsub.types.d.ts +3 -1
- package/dist/scaling/redis-lock.service.js +5 -5
- package/dist/scaling/redis-lock.service.js.map +1 -1
- package/dist/scaling/scaling.service.js +3 -2
- package/dist/scaling/scaling.service.js.map +1 -1
- package/dist/scaling/scaling.types.d.ts +1 -0
- package/dist/services/folder-finder.service.d.ts +12 -0
- package/dist/services/folder-finder.service.js +58 -0
- package/dist/services/folder-finder.service.js.map +1 -0
- package/dist/services/frontend.service.js +3 -0
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/import.service.js +2 -2
- package/dist/services/import.service.js.map +1 -1
- package/dist/services/project.service.ee.d.ts +1 -0
- package/dist/services/project.service.ee.js +21 -1
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/protected-resource.registry.js +2 -2
- package/dist/services/protected-resource.registry.js.map +1 -1
- package/dist/services/proxy-token-manager.js +2 -2
- package/dist/services/proxy-token-manager.js.map +1 -1
- package/dist/services/pruning/executions-pruning.service.js +3 -3
- package/dist/services/pruning/executions-pruning.service.js.map +1 -1
- package/dist/services/pruning/workflow-history-compaction.service.js +2 -1
- package/dist/services/pruning/workflow-history-compaction.service.js.map +1 -1
- package/dist/services/redis-client.service.js +5 -2
- package/dist/services/redis-client.service.js.map +1 -1
- package/dist/services/role.service.d.ts +3 -3
- package/dist/services/role.service.js +9 -3
- package/dist/services/role.service.js.map +1 -1
- package/dist/services/url.service.d.ts +1 -0
- package/dist/services/url.service.js +10 -5
- package/dist/services/url.service.js.map +1 -1
- package/dist/services/workflow-statistics-rollup.service.d.ts +31 -0
- package/dist/services/workflow-statistics-rollup.service.js +160 -0
- package/dist/services/workflow-statistics-rollup.service.js.map +1 -0
- package/dist/services/workflow-statistics.service.d.ts +5 -2
- package/dist/services/workflow-statistics.service.js +37 -15
- package/dist/services/workflow-statistics.service.js.map +1 -1
- package/dist/task-runners/task-managers/task-requester.d.ts +2 -1
- package/dist/task-runners/task-managers/task-requester.js +3 -3
- package/dist/task-runners/task-managers/task-requester.js.map +1 -1
- package/dist/wait-tracker.js +2 -1
- package/dist/wait-tracker.js.map +1 -1
- package/dist/webhooks/webhook-helpers.d.ts +2 -1
- package/dist/webhooks/webhook-helpers.js +5 -4
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/webhooks/webhook-last-node-response-extractor.d.ts +2 -1
- package/dist/webhooks/webhook-last-node-response-extractor.js +12 -11
- package/dist/webhooks/webhook-last-node-response-extractor.js.map +1 -1
- package/dist/webhooks/webhook-request-handler.js +2 -2
- package/dist/webhooks/webhook-request-handler.js.map +1 -1
- package/dist/webhooks/webhook-response-headers.js +2 -2
- package/dist/webhooks/webhook-response-headers.js.map +1 -1
- package/dist/webhooks/webhook.service.js +6 -5
- package/dist/webhooks/webhook.service.js.map +1 -1
- package/dist/workflow-execute-additional-data.js +6 -13
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-runner.d.ts +2 -1
- package/dist/workflow-runner.js +1 -0
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-applier.js +2 -2
- package/dist/workflows/publication/workflow-publication-applier.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-notifier.d.ts +12 -0
- package/dist/workflows/publication/workflow-publication-notifier.js +78 -0
- package/dist/workflows/publication/workflow-publication-notifier.js.map +1 -0
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.d.ts +3 -1
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.js +13 -2
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-outbox-consumer.d.ts +4 -1
- package/dist/workflows/publication/workflow-publication-outbox-consumer.js +61 -11
- package/dist/workflows/publication/workflow-publication-outbox-consumer.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-status.service.d.ts +9 -0
- package/dist/workflows/publication/workflow-publication-status.service.js +54 -0
- package/dist/workflows/publication/workflow-publication-status.service.js.map +1 -0
- package/dist/workflows/triggers/non-webhook-trigger-registrar.d.ts +1 -1
- package/dist/workflows/triggers/trigger-activation-retry.js +2 -1
- package/dist/workflows/triggers/trigger-activation-retry.js.map +1 -1
- package/dist/workflows/triggers/trigger-execution-context.factory.d.ts +2 -2
- package/dist/workflows/triggers/trigger-execution-context.factory.js +1 -1
- package/dist/workflows/triggers/trigger-execution-context.factory.js.map +1 -1
- package/dist/workflows/triggers/webhook-trigger-registrar.js +2 -1
- package/dist/workflows/triggers/webhook-trigger-registrar.js.map +1 -1
- package/dist/workflows/triggers/workflow-trigger-activator.d.ts +7 -1
- package/dist/workflows/triggers/workflow-trigger-activator.js +64 -10
- package/dist/workflows/triggers/workflow-trigger-activator.js.map +1 -1
- package/dist/workflows/workflow-execution.service.d.ts +2 -1
- package/dist/workflows/workflow-execution.service.js.map +1 -1
- package/dist/workflows/workflow-finder.service.d.ts +1 -0
- package/dist/workflows/workflow-finder.service.js +21 -0
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow-history/workflow-history.service.js +2 -1
- package/dist/workflows/workflow-history/workflow-history.service.js.map +1 -1
- package/dist/workflows/workflow-published-data.service.js +2 -2
- package/dist/workflows/workflow-published-data.service.js.map +1 -1
- package/dist/workflows/workflow-validation.service.js +3 -2
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +8 -6
- package/dist/workflows/workflow.service.js +9 -3
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +31 -28
- package/dist/workflows/workflows.controller.js +28 -4
- package/dist/workflows/workflows.controller.js.map +1 -1
- package/package.json +41 -37
- package/dist/modules/agents/builder/builder-model-lookup.service.d.ts +0 -17
- package/dist/modules/agents/builder/builder-model-lookup.service.js +0 -67
- package/dist/modules/agents/builder/builder-model-lookup.service.js.map +0 -1
- package/dist/modules/n8n-packages/n8n-packages.controller.d.ts +0 -10
- package/dist/modules/n8n-packages/n8n-packages.controller.js +0 -44
- package/dist/modules/n8n-packages/n8n-packages.controller.js.map +0 -1
|
@@ -43,6 +43,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
43
43
|
};
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
45
|
exports.InstanceAiService = void 0;
|
|
46
|
+
exports.getUserFacingErrorMessage = getUserFacingErrorMessage;
|
|
46
47
|
const api_types_1 = require("@n8n/api-types");
|
|
47
48
|
const backend_common_1 = require("@n8n/backend-common");
|
|
48
49
|
const backend_network_1 = require("@n8n/backend-network");
|
|
@@ -58,6 +59,7 @@ const nanoid_1 = require("nanoid");
|
|
|
58
59
|
const constants_1 = require("../../constants");
|
|
59
60
|
const event_service_1 = require("../../events/event.service");
|
|
60
61
|
const source_control_preferences_service_ee_1 = require("../../modules/source-control.ee/source-control-preferences.service.ee");
|
|
62
|
+
const publisher_service_1 = require("../../scaling/pubsub/publisher.service");
|
|
61
63
|
const ai_service_1 = require("../../services/ai.service");
|
|
62
64
|
const proxy_token_manager_1 = require("../../services/proxy-token-manager");
|
|
63
65
|
const url_service_1 = require("../../services/url.service");
|
|
@@ -78,6 +80,7 @@ const instance_ai_adapter_service_1 = require("./instance-ai.adapter.service");
|
|
|
78
80
|
const internal_messages_1 = require("./internal-messages");
|
|
79
81
|
const liveness_1 = require("./liveness");
|
|
80
82
|
const mcp_1 = require("./mcp");
|
|
83
|
+
const instance_ai_error_reporter_service_1 = require("./instance-ai-error-reporter.service");
|
|
81
84
|
const observability_1 = require("./observability");
|
|
82
85
|
const output_redaction_config_1 = require("./output-redaction-config");
|
|
83
86
|
const planned_task_action_runner_1 = require("./planned-task-action-runner");
|
|
@@ -141,6 +144,7 @@ function isTelemetryConfigurableAgent(agent) {
|
|
|
141
144
|
}
|
|
142
145
|
const INSTANCE_AI_CHECKPOINT_PRUNE_RETRY_MS = 30 * 1000;
|
|
143
146
|
const WORKFLOW_SETUP_ROUTING_CLAIM_TTL_MS = 15 * 60 * 1000;
|
|
147
|
+
const CONFIRMATION_EXPIRED_MESSAGE = 'This confirmation has expired. Send a new message to continue.';
|
|
144
148
|
const INSTANCE_AI_SHUTDOWN_DRAIN_TIMEOUT_MS = 5 * 1000;
|
|
145
149
|
function isTextMessagePart(part) {
|
|
146
150
|
return (typeof part === 'object' &&
|
|
@@ -150,10 +154,16 @@ function isTextMessagePart(part) {
|
|
|
150
154
|
'text' in part &&
|
|
151
155
|
typeof part.text === 'string');
|
|
152
156
|
}
|
|
157
|
+
function isSandboxEndpointNotAllowedError(error) {
|
|
158
|
+
return getErrorMessage(error).toLowerCase().includes('endpoint not allowed');
|
|
159
|
+
}
|
|
153
160
|
function getUserFacingErrorMessage(error) {
|
|
154
161
|
if (error instanceof n8n_workflow_1.UserError) {
|
|
155
162
|
return error.message;
|
|
156
163
|
}
|
|
164
|
+
if (isSandboxEndpointNotAllowedError(error)) {
|
|
165
|
+
return "I couldn't finish preparing the workspace sandbox. Please try again in a moment.";
|
|
166
|
+
}
|
|
157
167
|
if (error instanceof n8n_workflow_1.OperationalError) {
|
|
158
168
|
return 'I hit an operational error before I could finish that response. Please try again.';
|
|
159
169
|
}
|
|
@@ -178,6 +188,7 @@ function getAbortReason(signal) {
|
|
|
178
188
|
return typeof reason === 'string' ? reason : 'user_cancelled';
|
|
179
189
|
}
|
|
180
190
|
const MAX_CONCURRENT_BACKGROUND_TASKS_PER_THREAD = 5;
|
|
191
|
+
const TITLE_REFINE_HISTORY_LIMIT = 50;
|
|
181
192
|
function stringifyForContextValue(value) {
|
|
182
193
|
if (typeof value === 'string')
|
|
183
194
|
return value;
|
|
@@ -241,6 +252,8 @@ function toConfirmationData(request) {
|
|
|
241
252
|
return { approved: true, answers: request.answers };
|
|
242
253
|
case 'credentialSelection':
|
|
243
254
|
return { approved: true, credentials: request.credentials };
|
|
255
|
+
case 'credentialAutoSetup':
|
|
256
|
+
return { approved: true, autoSetup: { credentialType: request.credentialType } };
|
|
244
257
|
case 'resourceDecision':
|
|
245
258
|
return { approved: true, resourceDecision: request.resourceDecision };
|
|
246
259
|
case 'setupWorkflowApply':
|
|
@@ -263,11 +276,11 @@ function toConfirmationData(request) {
|
|
|
263
276
|
let InstanceAiService = class InstanceAiService {
|
|
264
277
|
get mcpClientManager() {
|
|
265
278
|
if (!this._mcpClientManager) {
|
|
266
|
-
this._mcpClientManager = new instance_ai_1.McpClientManager(this._ssrfProtectionConfig.enabled ? this._ssrfProtectionService : undefined);
|
|
279
|
+
this._mcpClientManager = new instance_ai_1.McpClientManager(this._ssrfProtectionConfig.enabled ? this._ssrfProtectionService : undefined, { onToolCallSettled: (event) => this.trackMcpToolCall(event) });
|
|
267
280
|
}
|
|
268
281
|
return this._mcpClientManager;
|
|
269
282
|
}
|
|
270
|
-
constructor(logger, globalConfig, instanceSettings, adapterService, eventBus, settingsService, gatewayService, browserSessionService, memoryService, agentMemory, checkpointStore, aiService, threadGrantRepo, pendingConfirmationRepo, urlService, dbSnapshotStorage, dbIterationLogStorage, sourceControlPreferencesService, telemetry, mcpRegistryService, userRepository, temporaryWorkflowService, errorReporter, ssrfProtectionConfig, ssrfProtectionService, eventService, evalCredentialAllowlists, runProbe, modelService, creditService) {
|
|
283
|
+
constructor(logger, globalConfig, instanceSettings, adapterService, eventBus, settingsService, gatewayService, browserSessionService, memoryService, agentMemory, checkpointStore, aiService, threadGrantRepo, pendingConfirmationRepo, urlService, dbSnapshotStorage, dbIterationLogStorage, sourceControlPreferencesService, telemetry, mcpRegistryService, userRepository, temporaryWorkflowService, errorReporter, ssrfProtectionConfig, ssrfProtectionService, eventService, evalCredentialAllowlists, runProbe, modelService, creditService, publisher, instanceAiErrorReporter) {
|
|
271
284
|
this.instanceSettings = instanceSettings;
|
|
272
285
|
this.adapterService = adapterService;
|
|
273
286
|
this.eventBus = eventBus;
|
|
@@ -293,10 +306,11 @@ let InstanceAiService = class InstanceAiService {
|
|
|
293
306
|
this.evalCredentialAllowlists = evalCredentialAllowlists;
|
|
294
307
|
this.modelService = modelService;
|
|
295
308
|
this.creditService = creditService;
|
|
309
|
+
this.publisher = publisher;
|
|
310
|
+
this.instanceAiErrorReporter = instanceAiErrorReporter;
|
|
296
311
|
this.runState = new instance_ai_1.RunStateRegistry();
|
|
297
312
|
this.backgroundTasks = new instance_ai_1.BackgroundTaskManager(MAX_CONCURRENT_BACKGROUND_TASKS_PER_THREAD);
|
|
298
313
|
this.memoryTaskRegistry = new instance_ai_1.MemoryTaskRegistry();
|
|
299
|
-
this.reportedErrors = new WeakSet();
|
|
300
314
|
this.domainAccessTrackersByThread = new Map();
|
|
301
315
|
this.threadPushRef = new Map();
|
|
302
316
|
this.planRequestsByThread = new Map();
|
|
@@ -497,39 +511,13 @@ let InstanceAiService = class InstanceAiService {
|
|
|
497
511
|
agent.on("error", (event) => {
|
|
498
512
|
if (event.type !== "error" || !event.source)
|
|
499
513
|
return;
|
|
500
|
-
this.
|
|
514
|
+
this.instanceAiErrorReporter.report(event.error, {
|
|
501
515
|
component: `instance-ai-${event.source}`,
|
|
502
516
|
threadId,
|
|
503
517
|
runId,
|
|
504
518
|
});
|
|
505
519
|
});
|
|
506
520
|
}
|
|
507
|
-
reportInstanceAiError(error, context) {
|
|
508
|
-
if (typeof error === 'object' && error !== null) {
|
|
509
|
-
if (this.reportedErrors.has(error))
|
|
510
|
-
return;
|
|
511
|
-
this.reportedErrors.add(error);
|
|
512
|
-
}
|
|
513
|
-
const observability = (0, observability_1.buildInstanceAiObservabilityContext)(context);
|
|
514
|
-
this.logger.error(`Instance AI error in ${context.component}`, {
|
|
515
|
-
error,
|
|
516
|
-
component: context.component,
|
|
517
|
-
...observability,
|
|
518
|
-
});
|
|
519
|
-
this.errorReporter.error(error, {
|
|
520
|
-
tags: { component: context.component, ...observability },
|
|
521
|
-
extra: observability,
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
async withSetupBoundary(component, context, fn) {
|
|
525
|
-
try {
|
|
526
|
-
return await fn();
|
|
527
|
-
}
|
|
528
|
-
catch (error) {
|
|
529
|
-
this.reportInstanceAiError(error, { component, ...context });
|
|
530
|
-
throw error;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
521
|
isRunDebugEnabled() {
|
|
534
522
|
return this.instanceAiConfig.runDebugEnabled;
|
|
535
523
|
}
|
|
@@ -677,6 +665,70 @@ let InstanceAiService = class InstanceAiService {
|
|
|
677
665
|
void this.handlePlannedTaskSettlement(user, task, 'cancelled');
|
|
678
666
|
}
|
|
679
667
|
}
|
|
668
|
+
broadcastTaskControl(payload) {
|
|
669
|
+
if (!this.instanceSettings.isMultiMain)
|
|
670
|
+
return;
|
|
671
|
+
void this.publisher
|
|
672
|
+
.publishCommand({ command: 'relay-instance-ai-task-control', payload })
|
|
673
|
+
.catch((error) => this.logger.error('Failed to relay Instance AI task-control to sibling mains', {
|
|
674
|
+
threadId: payload.threadId,
|
|
675
|
+
action: payload.action,
|
|
676
|
+
error,
|
|
677
|
+
}));
|
|
678
|
+
}
|
|
679
|
+
async applyTaskControlLocally({ threadId, taskId, action, correction, }) {
|
|
680
|
+
switch (action) {
|
|
681
|
+
case 'correct':
|
|
682
|
+
if (!taskId || correction === undefined)
|
|
683
|
+
return true;
|
|
684
|
+
return this.sendCorrectionToTask(threadId, taskId, correction) !== 'task-not-found';
|
|
685
|
+
case 'cancel-task': {
|
|
686
|
+
if (!taskId)
|
|
687
|
+
return true;
|
|
688
|
+
const isLocal = this.backgroundTasks
|
|
689
|
+
.getTaskSnapshots(threadId)
|
|
690
|
+
.some((task) => task.taskId === taskId);
|
|
691
|
+
this.cancelBackgroundTask(threadId, taskId);
|
|
692
|
+
return isLocal;
|
|
693
|
+
}
|
|
694
|
+
case 'cancel-thread':
|
|
695
|
+
this.cancelRun(threadId);
|
|
696
|
+
return false;
|
|
697
|
+
case 'clear-thread':
|
|
698
|
+
await this.clearThreadState(threadId);
|
|
699
|
+
return false;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
async routeTaskControl(payload) {
|
|
703
|
+
const foundLocally = await this.applyTaskControlLocally(payload);
|
|
704
|
+
if (!foundLocally)
|
|
705
|
+
this.broadcastTaskControl(payload);
|
|
706
|
+
}
|
|
707
|
+
async routeCorrectionToTask(threadId, taskId, correction) {
|
|
708
|
+
await this.routeTaskControl({ threadId, taskId, action: 'correct', correction });
|
|
709
|
+
}
|
|
710
|
+
async routeCancelBackgroundTask(threadId, taskId) {
|
|
711
|
+
await this.routeTaskControl({ threadId, taskId, action: 'cancel-task' });
|
|
712
|
+
}
|
|
713
|
+
async routeCancelRun(threadId) {
|
|
714
|
+
await this.routeTaskControl({ threadId, action: 'cancel-thread' });
|
|
715
|
+
}
|
|
716
|
+
async routeClearThreadState(threadId) {
|
|
717
|
+
await this.routeTaskControl({ threadId, action: 'clear-thread' });
|
|
718
|
+
}
|
|
719
|
+
async handleRelayTaskControl(payload) {
|
|
720
|
+
try {
|
|
721
|
+
await this.applyTaskControlLocally(payload);
|
|
722
|
+
}
|
|
723
|
+
catch (error) {
|
|
724
|
+
this.logger.error('Failed to apply relayed Instance AI task-control', {
|
|
725
|
+
threadId: payload.threadId,
|
|
726
|
+
taskId: payload.taskId,
|
|
727
|
+
action: payload.action,
|
|
728
|
+
error,
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
}
|
|
680
732
|
cancelAllBackgroundTasks() {
|
|
681
733
|
const cancelled = this.backgroundTasks.cancelAll();
|
|
682
734
|
for (const task of cancelled) {
|
|
@@ -880,6 +932,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
880
932
|
await this.tracing.finalizeBackgroundTaskTracing(task, 'cancelled');
|
|
881
933
|
}
|
|
882
934
|
await this.drainInFlightExecutions(INSTANCE_AI_SHUTDOWN_DRAIN_TIMEOUT_MS);
|
|
935
|
+
this.instanceAiErrorReporter.endAllRuns();
|
|
883
936
|
const threadsWithTraces = new Set(this.tracing.getTrackedThreadIds());
|
|
884
937
|
for (const threadId of threadsWithTraces) {
|
|
885
938
|
await this.tracing.finalizeRemainingMessageTraceRoots(threadId, {
|
|
@@ -956,6 +1009,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
956
1009
|
else {
|
|
957
1010
|
this.logger.debug('No stale Instance AI checkpoints to expire');
|
|
958
1011
|
}
|
|
1012
|
+
await this.hardDeleteExpiredCheckpoints(now);
|
|
959
1013
|
await this.suspendedThreads.pruneStalePendingConfirmations(now);
|
|
960
1014
|
await this.pruneExpiredThreads();
|
|
961
1015
|
this.scheduleCheckpointPrune();
|
|
@@ -967,6 +1021,23 @@ let InstanceAiService = class InstanceAiService {
|
|
|
967
1021
|
this.scheduleCheckpointPrune(INSTANCE_AI_CHECKPOINT_PRUNE_RETRY_MS);
|
|
968
1022
|
}
|
|
969
1023
|
}
|
|
1024
|
+
async hardDeleteExpiredCheckpoints(now) {
|
|
1025
|
+
const retention = this.instanceAiConfig.checkpointGcRetention;
|
|
1026
|
+
if (retention <= 0)
|
|
1027
|
+
return;
|
|
1028
|
+
try {
|
|
1029
|
+
const olderThan = new Date(now - retention);
|
|
1030
|
+
const count = await this.checkpointStore.hardDeleteExpiredOlderThan(olderThan);
|
|
1031
|
+
if (count > 0) {
|
|
1032
|
+
this.logger.info('Hard-deleted expired Instance AI checkpoint tombstones', { count });
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
catch (error) {
|
|
1036
|
+
this.logger.warn('Failed to hard-delete expired Instance AI checkpoint tombstones', {
|
|
1037
|
+
error: getErrorMessage(error),
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
970
1041
|
async pruneExpiredThreads() {
|
|
971
1042
|
try {
|
|
972
1043
|
await this.memoryService.cleanupExpiredThreads(async (threadId) => await this.clearThreadState(threadId));
|
|
@@ -1184,19 +1255,20 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1184
1255
|
context.permissions = (0, api_types_1.applyBranchReadOnlyOverrides)(context.permissions);
|
|
1185
1256
|
context.branchReadOnly = true;
|
|
1186
1257
|
}
|
|
1187
|
-
let domainTracker = this.domainAccessTrackersByThread.get(threadId);
|
|
1188
|
-
if (!domainTracker) {
|
|
1189
|
-
domainTracker = (0, instance_ai_1.createDomainAccessTracker)();
|
|
1190
|
-
this.domainAccessTrackersByThread.set(threadId, domainTracker);
|
|
1191
|
-
}
|
|
1192
|
-
context.domainAccessTracker = domainTracker;
|
|
1193
1258
|
context.runId = runId;
|
|
1194
1259
|
const sessionGrants = await this.loadThreadSessionGrants(threadId, user.id);
|
|
1195
1260
|
context.sessionApprovedToolKeys = sessionGrants;
|
|
1196
|
-
|
|
1261
|
+
const grantSessionToolApproval = async (key) => {
|
|
1197
1262
|
await this.persistThreadSessionGrant(threadId, user.id, key);
|
|
1198
1263
|
sessionGrants.add(key);
|
|
1199
1264
|
};
|
|
1265
|
+
context.grantSessionToolApproval = grantSessionToolApproval;
|
|
1266
|
+
const domainTracker = (0, instance_ai_1.createDomainAccessTracker)({
|
|
1267
|
+
grantedKeys: sessionGrants,
|
|
1268
|
+
persistGrant: grantSessionToolApproval,
|
|
1269
|
+
});
|
|
1270
|
+
this.domainAccessTrackersByThread.set(threadId, domainTracker);
|
|
1271
|
+
context.domainAccessTracker = domainTracker;
|
|
1200
1272
|
if (this.isRunDebugEnabled()) {
|
|
1201
1273
|
context.recordWorkflowCodeSnapshot = (snapshot) => {
|
|
1202
1274
|
this.runDebugBuffer.ensure(runId, threadId);
|
|
@@ -1253,7 +1325,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1253
1325
|
let workspaceRoot;
|
|
1254
1326
|
const sandboxStatus = this.settingsService.getSandboxStatus();
|
|
1255
1327
|
if (sandboxStatus.workflowBuilderAvailable) {
|
|
1256
|
-
const sandboxConfig = await this.
|
|
1328
|
+
const sandboxConfig = await this.instanceAiErrorReporter.withBoundary('instance-ai-sandbox-setup', { threadId, runId, userId: user.id, messageGroupId }, async () => await this.sandboxService.resolveSandboxConfig(user));
|
|
1257
1329
|
if (sandboxConfig.enabled) {
|
|
1258
1330
|
workspaceRoot = (0, instance_ai_1.getPromptWorkspaceRoot)(sandboxConfig.provider);
|
|
1259
1331
|
let sandboxEntryPromise;
|
|
@@ -1822,6 +1894,31 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1822
1894
|
return;
|
|
1823
1895
|
}
|
|
1824
1896
|
}
|
|
1897
|
+
async persistInterruptedUserMessage(threadId, userId, message, createdAt) {
|
|
1898
|
+
if (!message)
|
|
1899
|
+
return;
|
|
1900
|
+
try {
|
|
1901
|
+
await this.agentMemory.saveMessages({
|
|
1902
|
+
threadId,
|
|
1903
|
+
resourceId: userId,
|
|
1904
|
+
messages: [
|
|
1905
|
+
{
|
|
1906
|
+
id: (0, nanoid_1.nanoid)(),
|
|
1907
|
+
createdAt,
|
|
1908
|
+
type: 'llm',
|
|
1909
|
+
role: 'user',
|
|
1910
|
+
content: [{ type: 'text', text: message }],
|
|
1911
|
+
},
|
|
1912
|
+
],
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
catch (error) {
|
|
1916
|
+
this.logger.warn('Failed to persist user message on cancel', {
|
|
1917
|
+
threadId,
|
|
1918
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1919
|
+
});
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1825
1922
|
async executeRun(user, threadId, runId, message, abortController, attachments, handoffContext, messageGroupId, timeZone, isReplanFollowUp = false, checkpoint, resumeReason, plannedBuild) {
|
|
1826
1923
|
const fileAttachments = (attachments ?? []).filter((attachment) => attachment.type === 'file');
|
|
1827
1924
|
const workflowAttachments = (attachments ?? []).filter((attachment) => attachment.type === 'workflow');
|
|
@@ -1831,7 +1928,10 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1831
1928
|
let aiCreatedWorkflowIds;
|
|
1832
1929
|
let activeSnapshotStorage;
|
|
1833
1930
|
let messageId = '';
|
|
1931
|
+
let streamReached = false;
|
|
1932
|
+
const turnStartedAt = new Date();
|
|
1834
1933
|
try {
|
|
1934
|
+
this.instanceAiErrorReporter.beginRun(runId);
|
|
1835
1935
|
messageId = (0, nanoid_1.nanoid)();
|
|
1836
1936
|
const traceInput = {
|
|
1837
1937
|
message,
|
|
@@ -1890,6 +1990,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1890
1990
|
payload: { messageId, messageGroupId, ...(traceId ? { traceId } : {}) },
|
|
1891
1991
|
});
|
|
1892
1992
|
if (signal.aborted) {
|
|
1993
|
+
await this.persistInterruptedUserMessage(threadId, user.id, message, turnStartedAt);
|
|
1893
1994
|
this.terminalOutcome.evaluateTerminalResponse(threadId, runId, 'cancelled', {
|
|
1894
1995
|
messageGroupId,
|
|
1895
1996
|
correlationId: messageId,
|
|
@@ -1902,19 +2003,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1902
2003
|
});
|
|
1903
2004
|
return;
|
|
1904
2005
|
}
|
|
1905
|
-
const staticMcpServers = this.parseMcpServers(this.instanceAiConfig.mcpServers);
|
|
1906
|
-
const registryMcpServers = this.settingsService.isMcpAccessEnabled()
|
|
1907
|
-
? await this.withSetupBoundary('instance-ai-mcp-setup', {
|
|
1908
|
-
threadId,
|
|
1909
|
-
runId,
|
|
1910
|
-
tracing,
|
|
1911
|
-
agentId: (0, instance_ai_1.orchestratorAgentId)(runId),
|
|
1912
|
-
userId: user.id,
|
|
1913
|
-
messageGroupId,
|
|
1914
|
-
messageId,
|
|
1915
|
-
}, async () => await this.mcpRegistryService.getRegistryMcpServers(user))
|
|
1916
|
-
: [];
|
|
1917
|
-
const mcpServers = [...staticMcpServers, ...registryMcpServers];
|
|
1918
2006
|
const executionPushRef = this.threadPushRef.get(threadId);
|
|
1919
2007
|
const environment = await this.createExecutionEnvironment(user, threadId, runId, signal, messageGroupId, executionPushRef, proxyRunConfig);
|
|
1920
2008
|
activeSnapshotStorage = environment.snapshotStorage;
|
|
@@ -1968,7 +2056,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1968
2056
|
if (fileAttachments.length > 0) {
|
|
1969
2057
|
context.currentUserAttachments = fileAttachments;
|
|
1970
2058
|
}
|
|
1971
|
-
const memoryConfig = this.createAgentMemoryOptions();
|
|
1972
2059
|
if (!tracing && process.env.E2E_TESTS === 'true') {
|
|
1973
2060
|
const { createTraceReplayOnlyContext } = await Promise.resolve().then(() => __importStar(require('@n8n/instance-ai')));
|
|
1974
2061
|
tracing = createTraceReplayOnlyContext();
|
|
@@ -2097,20 +2184,9 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2097
2184
|
}
|
|
2098
2185
|
const runControl = (0, instance_ai_1.createOrchestratorRunControl)(orchestrationContext);
|
|
2099
2186
|
const stopSignal = () => runControl.getStopSignal();
|
|
2100
|
-
const agent = await (
|
|
2101
|
-
modelId,
|
|
2102
|
-
context,
|
|
2103
|
-
orchestrationContext,
|
|
2104
|
-
mcpServers,
|
|
2105
|
-
mcpManager: this.mcpClientManager,
|
|
2106
|
-
memoryConfig,
|
|
2107
|
-
memory,
|
|
2108
|
-
checkpointStore: this.checkpointStore,
|
|
2109
|
-
onMemoryTaskEvent: this.memoryTaskObserverFor(threadId),
|
|
2110
|
-
thinkingEnabled: this.instanceAiConfig.thinkingEnabled,
|
|
2111
|
-
});
|
|
2112
|
-
this.subscribeToAgentErrors(agent, threadId, runId);
|
|
2187
|
+
const agent = await this.createAgentFromEnvironment(environment, threadId, runId, user, tracing);
|
|
2113
2188
|
const streamOptions = this.buildOrchestratorAgentStreamOptions(user, threadId, runId, signal);
|
|
2189
|
+
streamReached = true;
|
|
2114
2190
|
const result = tracing
|
|
2115
2191
|
? await tracing.withActiveSpan(tracing.actorRun, async () => {
|
|
2116
2192
|
return await (0, instance_ai_1.streamAgentRun)(agent, streamInput, streamOptions, {
|
|
@@ -2137,6 +2213,11 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2137
2213
|
outputRedaction: (0, output_redaction_config_1.resolveOutputRedaction)(this.instanceAiConfig),
|
|
2138
2214
|
});
|
|
2139
2215
|
if (result.status === 'suspended') {
|
|
2216
|
+
this.emitRunMetrics(threadId, 'suspended', {
|
|
2217
|
+
modelId,
|
|
2218
|
+
workSummary: result.workSummary,
|
|
2219
|
+
usage: result.usage,
|
|
2220
|
+
});
|
|
2140
2221
|
if (result.suspension) {
|
|
2141
2222
|
this.runState.suspendRun(threadId, {
|
|
2142
2223
|
runId,
|
|
@@ -2243,7 +2324,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2243
2324
|
}
|
|
2244
2325
|
const outputText = await (result.text ?? Promise.resolve(''));
|
|
2245
2326
|
if (result.status === 'errored') {
|
|
2246
|
-
this.
|
|
2327
|
+
this.instanceAiErrorReporter.report(result.error ?? new Error('Instance AI stream errored'), {
|
|
2247
2328
|
component: 'instance-ai-stream',
|
|
2248
2329
|
threadId,
|
|
2249
2330
|
runId,
|
|
@@ -2254,11 +2335,13 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2254
2335
|
messageId,
|
|
2255
2336
|
});
|
|
2256
2337
|
}
|
|
2338
|
+
const userFacingErrorMessage = result.status === 'errored' ? getUserFacingErrorMessage(result.error) : undefined;
|
|
2257
2339
|
if (runControl.shouldEmitTerminalOutcome(result.stopReason)) {
|
|
2258
2340
|
this.terminalOutcome.evaluateTerminalResponse(threadId, runId, result.status, {
|
|
2259
2341
|
messageGroupId,
|
|
2260
2342
|
correlationId: messageId,
|
|
2261
2343
|
workSummary: result.workSummary,
|
|
2344
|
+
errorMessage: userFacingErrorMessage,
|
|
2262
2345
|
suppressCompletedFallback: checkpoint?.isCheckpointFollowUp === true ||
|
|
2263
2346
|
plannedBuild?.isPlannedBuildFollowUp === true,
|
|
2264
2347
|
});
|
|
@@ -2282,6 +2365,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2282
2365
|
archivedWorkflowIds,
|
|
2283
2366
|
workSummary: result.workSummary,
|
|
2284
2367
|
usage: result.usage,
|
|
2368
|
+
errorReason: userFacingErrorMessage,
|
|
2285
2369
|
});
|
|
2286
2370
|
await this.creditService.claimRunUsage(user, threadId, result.agentRunId || runId, result.usage?.usage ?? [], result.status);
|
|
2287
2371
|
if (result.status === 'completed') {
|
|
@@ -2299,6 +2383,9 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2299
2383
|
if (this.shouldPreserveHitlOnShutdown(runId)) {
|
|
2300
2384
|
return;
|
|
2301
2385
|
}
|
|
2386
|
+
if (!streamReached) {
|
|
2387
|
+
await this.persistInterruptedUserMessage(threadId, user.id, message, turnStartedAt);
|
|
2388
|
+
}
|
|
2302
2389
|
const runTimeout = this.liveness.consumeRunTimeout(runId);
|
|
2303
2390
|
const cancellationReason = runTimeout.timedOut
|
|
2304
2391
|
? liveness_1.INSTANCE_AI_RUN_TIMEOUT_REASON
|
|
@@ -2345,7 +2432,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2345
2432
|
error: errorMessage,
|
|
2346
2433
|
...(0, observability_1.buildInstanceAiObservabilityContext)(errCtx),
|
|
2347
2434
|
});
|
|
2348
|
-
this.
|
|
2435
|
+
this.instanceAiErrorReporter.report(error, { component: 'instance-ai-run', ...errCtx });
|
|
2349
2436
|
this.terminalOutcome.evaluateTerminalResponse(threadId, runId, 'errored', {
|
|
2350
2437
|
messageGroupId,
|
|
2351
2438
|
correlationId: messageId,
|
|
@@ -2398,6 +2485,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2398
2485
|
await this.taskProjector.syncFromWorkflowLoop(threadId, runId);
|
|
2399
2486
|
await this.maybeStartWorkflowSetupFollowUp(user, threadId);
|
|
2400
2487
|
}
|
|
2488
|
+
this.instanceAiErrorReporter.endRun(runId);
|
|
2401
2489
|
}
|
|
2402
2490
|
}
|
|
2403
2491
|
queuePendingCheckpointReentry(threadId, checkpointTaskId) {
|
|
@@ -2555,25 +2643,80 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2555
2643
|
userId: requestingUserId,
|
|
2556
2644
|
requestId,
|
|
2557
2645
|
});
|
|
2558
|
-
return
|
|
2646
|
+
return null;
|
|
2559
2647
|
}
|
|
2560
|
-
if (this.
|
|
2648
|
+
if (await this.pendingConfirmationRepo.isPastExpiry(requestId, freshUser.id, new Date())) {
|
|
2649
|
+
this.logger.debug('Rejecting expired confirmation', { requestId });
|
|
2650
|
+
throw new n8n_workflow_1.UserError(CONFIRMATION_EXPIRED_MESSAGE);
|
|
2651
|
+
}
|
|
2652
|
+
const pending = this.runState.getPendingConfirmation(requestId);
|
|
2653
|
+
if (pending &&
|
|
2654
|
+
pending.userId === freshUser.id &&
|
|
2655
|
+
this.runState.resolvePendingConfirmation(freshUser.id, requestId, data)) {
|
|
2561
2656
|
void this.suspendedThreads.dropPendingConfirmation(requestId);
|
|
2562
2657
|
this.logger.debug('Resolved pending confirmation (sub-agent HITL)', {
|
|
2563
2658
|
requestId,
|
|
2564
2659
|
approved: data.approved,
|
|
2565
2660
|
});
|
|
2566
|
-
|
|
2661
|
+
const runId = this.runState.getActiveRunId(pending.threadId);
|
|
2662
|
+
return {
|
|
2663
|
+
ok: true,
|
|
2664
|
+
...(runId ? { runId } : {}),
|
|
2665
|
+
};
|
|
2567
2666
|
}
|
|
2568
2667
|
this.logger.debug('Pending confirmation not found, trying suspended run resume', {
|
|
2569
2668
|
requestId,
|
|
2570
2669
|
approved: data.approved,
|
|
2571
2670
|
});
|
|
2572
|
-
|
|
2573
|
-
|
|
2671
|
+
const resumed = await this.resumeSuspendedRun(requestingUserId, requestId, data);
|
|
2672
|
+
if (resumed) {
|
|
2673
|
+
return resumed;
|
|
2574
2674
|
}
|
|
2575
2675
|
return await this.suspendedRunRestorer.resolveOrphanedConfirmation(requestingUserId, requestId, data);
|
|
2576
2676
|
}
|
|
2677
|
+
async buildMcpServers(user, threadId, runId, tracing, messageGroupId) {
|
|
2678
|
+
const staticMcpServers = this.parseMcpServers(this.instanceAiConfig.mcpServers);
|
|
2679
|
+
const registryMcpServers = this.settingsService.isMcpAccessEnabled()
|
|
2680
|
+
? await this.instanceAiErrorReporter.withBoundary('instance-ai-mcp-setup', {
|
|
2681
|
+
threadId,
|
|
2682
|
+
runId,
|
|
2683
|
+
tracing,
|
|
2684
|
+
agentId: (0, instance_ai_1.orchestratorAgentId)(runId),
|
|
2685
|
+
userId: user.id,
|
|
2686
|
+
messageGroupId,
|
|
2687
|
+
}, async () => await this.mcpRegistryService.getRegistryMcpServers(user))
|
|
2688
|
+
: [];
|
|
2689
|
+
return [...staticMcpServers, ...registryMcpServers];
|
|
2690
|
+
}
|
|
2691
|
+
async createAgentFromEnvironment(environment, threadId, runId, user, tracing) {
|
|
2692
|
+
if (tracing) {
|
|
2693
|
+
environment.orchestrationContext.tracing = tracing;
|
|
2694
|
+
}
|
|
2695
|
+
const mcpServers = await this.buildMcpServers(user, threadId, runId, tracing, environment.orchestrationContext.messageGroupId);
|
|
2696
|
+
const agent = await (0, instance_ai_1.createInstanceAgent)({
|
|
2697
|
+
modelId: environment.modelId,
|
|
2698
|
+
context: environment.context,
|
|
2699
|
+
orchestrationContext: environment.orchestrationContext,
|
|
2700
|
+
mcpServers,
|
|
2701
|
+
mcpManager: this.mcpClientManager,
|
|
2702
|
+
memoryConfig: this.createAgentMemoryOptions(),
|
|
2703
|
+
memory: environment.memory,
|
|
2704
|
+
checkpointStore: this.checkpointStore,
|
|
2705
|
+
onMemoryTaskEvent: this.memoryTaskObserverFor(threadId),
|
|
2706
|
+
thinkingEnabled: this.instanceAiConfig.thinkingEnabled,
|
|
2707
|
+
});
|
|
2708
|
+
this.subscribeToAgentErrors(agent, threadId, runId);
|
|
2709
|
+
return agent;
|
|
2710
|
+
}
|
|
2711
|
+
async buildFreshInstanceAgent(user, threadId, runId, abortSignal, tracing, messageGroupId, pushRef) {
|
|
2712
|
+
const environment = await this.createExecutionEnvironment(user, threadId, runId, abortSignal, messageGroupId, pushRef);
|
|
2713
|
+
const agent = await this.createAgentFromEnvironment(environment, threadId, runId, user, tracing);
|
|
2714
|
+
return {
|
|
2715
|
+
agent,
|
|
2716
|
+
modelId: environment.modelId,
|
|
2717
|
+
orchestrationContext: environment.orchestrationContext,
|
|
2718
|
+
};
|
|
2719
|
+
}
|
|
2577
2720
|
async rebuildSuspendedRunFromCheckpoint(orphan) {
|
|
2578
2721
|
const user = await this.revalidateActiveUser(orphan.userId);
|
|
2579
2722
|
if (!user)
|
|
@@ -2594,23 +2737,10 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2594
2737
|
catch (error) {
|
|
2595
2738
|
return { kind: 'env-failure', error };
|
|
2596
2739
|
}
|
|
2597
|
-
const mcpServers = this.parseMcpServers(this.instanceAiConfig.mcpServers);
|
|
2598
2740
|
const runControl = (0, instance_ai_1.createOrchestratorRunControl)(environment.orchestrationContext);
|
|
2599
2741
|
let agent;
|
|
2600
2742
|
try {
|
|
2601
|
-
agent = await (
|
|
2602
|
-
modelId: environment.modelId,
|
|
2603
|
-
context: environment.context,
|
|
2604
|
-
orchestrationContext: environment.orchestrationContext,
|
|
2605
|
-
mcpServers,
|
|
2606
|
-
mcpManager: this.mcpClientManager,
|
|
2607
|
-
memoryConfig: this.createAgentMemoryOptions(),
|
|
2608
|
-
memory: environment.memory,
|
|
2609
|
-
checkpointStore: this.checkpointStore,
|
|
2610
|
-
onMemoryTaskEvent: this.memoryTaskObserverFor(orphan.threadId),
|
|
2611
|
-
thinkingEnabled: this.instanceAiConfig.thinkingEnabled,
|
|
2612
|
-
});
|
|
2613
|
-
this.subscribeToAgentErrors(agent, orphan.threadId, orphan.runId);
|
|
2743
|
+
agent = await this.createAgentFromEnvironment(environment, orphan.threadId, orphan.runId, user, undefined);
|
|
2614
2744
|
}
|
|
2615
2745
|
catch (error) {
|
|
2616
2746
|
return { kind: 'agent-failure', error };
|
|
@@ -2656,6 +2786,21 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2656
2786
|
return null;
|
|
2657
2787
|
}
|
|
2658
2788
|
}
|
|
2789
|
+
async rebuildAgentForAutoSetupResume(user, threadId, runId, abortController, tracing, runHandoff, messageGroupId) {
|
|
2790
|
+
try {
|
|
2791
|
+
const rebuilt = await this.buildFreshInstanceAgent(user, threadId, runId, abortController.signal, tracing, messageGroupId, this.threadPushRef.get(threadId));
|
|
2792
|
+
(0, instance_ai_1.createOrchestratorRunControl)(rebuilt.orchestrationContext, runHandoff ?? {});
|
|
2793
|
+
return { agent: rebuilt.agent, modelId: rebuilt.modelId };
|
|
2794
|
+
}
|
|
2795
|
+
catch (error) {
|
|
2796
|
+
this.logger.warn('Failed to rebuild agent for credential auto-setup resume', {
|
|
2797
|
+
threadId,
|
|
2798
|
+
runId,
|
|
2799
|
+
error: getErrorMessage(error),
|
|
2800
|
+
});
|
|
2801
|
+
return undefined;
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2659
2804
|
async resumeSuspendedRun(requestingUserId, requestId, data) {
|
|
2660
2805
|
const suspended = this.runState.findSuspendedByRequestId(requestId);
|
|
2661
2806
|
if (!suspended) {
|
|
@@ -2663,11 +2808,11 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2663
2808
|
requestId,
|
|
2664
2809
|
approved: data.approved,
|
|
2665
2810
|
});
|
|
2666
|
-
return
|
|
2811
|
+
return null;
|
|
2667
2812
|
}
|
|
2668
2813
|
const { agent, runId, agentRunId, threadId, user, toolCallId, toolName, suspendPayload, abortController, tracing, modelId, messageGroupId, checkpoint, plannedBuild, runHandoff, } = suspended;
|
|
2669
2814
|
if (user.id !== requestingUserId)
|
|
2670
|
-
return
|
|
2815
|
+
return null;
|
|
2671
2816
|
const activeUser = await this.revalidateActiveUser(user.id);
|
|
2672
2817
|
if (!activeUser) {
|
|
2673
2818
|
this.logger.warn('Cancelling suspended run: user no longer authorized for AI Assistant', {
|
|
@@ -2676,7 +2821,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2676
2821
|
requestId,
|
|
2677
2822
|
});
|
|
2678
2823
|
this.cancelRun(threadId);
|
|
2679
|
-
return
|
|
2824
|
+
return null;
|
|
2680
2825
|
}
|
|
2681
2826
|
this.runState.activateSuspendedRun(threadId);
|
|
2682
2827
|
void this.suspendedThreads.dropPendingConfirmation(requestId);
|
|
@@ -2692,6 +2837,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2692
2837
|
...(data.answers ? { answers: data.answers } : {}),
|
|
2693
2838
|
...(data.resourceDecision ? { resourceDecision: data.resourceDecision } : {}),
|
|
2694
2839
|
...(data.scope ? { scope: data.scope } : {}),
|
|
2840
|
+
...(data.autoSetup ? { autoSetup: data.autoSetup } : {}),
|
|
2695
2841
|
};
|
|
2696
2842
|
const resumeTracing = await this.tracing.createOrchestratorResumeTraceContext({
|
|
2697
2843
|
baseTracing: tracing,
|
|
@@ -2720,7 +2866,19 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2720
2866
|
: {}),
|
|
2721
2867
|
},
|
|
2722
2868
|
});
|
|
2723
|
-
|
|
2869
|
+
const effectiveTracing = resumeTracing ?? tracing;
|
|
2870
|
+
let resumeAgent = agent;
|
|
2871
|
+
let resumeModelId = modelId;
|
|
2872
|
+
if (data.autoSetup) {
|
|
2873
|
+
const rebuilt = await this.rebuildAgentForAutoSetupResume(activeUser, threadId, runId, abortController, effectiveTracing, runHandoff, messageGroupId);
|
|
2874
|
+
if (!rebuilt) {
|
|
2875
|
+
this.cancelRun(threadId, 'agent_rebuild_failed');
|
|
2876
|
+
return null;
|
|
2877
|
+
}
|
|
2878
|
+
resumeAgent = rebuilt.agent;
|
|
2879
|
+
resumeModelId = rebuilt.modelId;
|
|
2880
|
+
}
|
|
2881
|
+
this.startProcessResumedStream(resumeAgent, resumeData, {
|
|
2724
2882
|
runId,
|
|
2725
2883
|
agentRunId,
|
|
2726
2884
|
threadId,
|
|
@@ -2731,18 +2889,19 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2731
2889
|
signal: abortController.signal,
|
|
2732
2890
|
abortController,
|
|
2733
2891
|
snapshotStorage: this.dbSnapshotStorage,
|
|
2734
|
-
tracing:
|
|
2735
|
-
modelId,
|
|
2892
|
+
tracing: effectiveTracing,
|
|
2893
|
+
modelId: resumeModelId,
|
|
2736
2894
|
checkpoint,
|
|
2737
2895
|
plannedBuild,
|
|
2738
2896
|
runHandoff,
|
|
2739
2897
|
});
|
|
2740
|
-
return true;
|
|
2898
|
+
return { ok: true, runId };
|
|
2741
2899
|
}
|
|
2742
2900
|
async processResumedStream(agent, resumeData, opts) {
|
|
2743
2901
|
let messageTraceFinalization;
|
|
2744
2902
|
let completedSetupWorkflowId;
|
|
2745
2903
|
try {
|
|
2904
|
+
this.instanceAiErrorReporter.beginRun(opts.runId);
|
|
2746
2905
|
if (opts.tracing?.getTelemetry && isTelemetryConfigurableAgent(agent)) {
|
|
2747
2906
|
try {
|
|
2748
2907
|
agent.telemetry(opts.tracing.getTelemetry({
|
|
@@ -2790,6 +2949,11 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2790
2949
|
outputRedaction: (0, output_redaction_config_1.resolveOutputRedaction)(this.instanceAiConfig),
|
|
2791
2950
|
});
|
|
2792
2951
|
if (result.status === 'suspended') {
|
|
2952
|
+
this.emitRunMetrics(opts.threadId, 'suspended', {
|
|
2953
|
+
modelId: opts.modelId,
|
|
2954
|
+
workSummary: result.workSummary,
|
|
2955
|
+
usage: result.usage,
|
|
2956
|
+
});
|
|
2793
2957
|
if (result.suspension) {
|
|
2794
2958
|
const resumeMessageGroupId = this.tracing.getMessageGroupId(opts.runId);
|
|
2795
2959
|
this.runState.suspendRun(opts.threadId, {
|
|
@@ -2896,7 +3060,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2896
3060
|
const outputText = await (result.text ?? Promise.resolve(''));
|
|
2897
3061
|
const messageGroupId = this.tracing.getMessageGroupId(opts.runId);
|
|
2898
3062
|
if (result.status === 'errored') {
|
|
2899
|
-
this.
|
|
3063
|
+
this.instanceAiErrorReporter.report(result.error ?? new Error('Instance AI resumed stream errored'), {
|
|
2900
3064
|
component: 'instance-ai-stream',
|
|
2901
3065
|
threadId: opts.threadId,
|
|
2902
3066
|
runId: opts.runId,
|
|
@@ -2906,10 +3070,12 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2906
3070
|
messageGroupId,
|
|
2907
3071
|
});
|
|
2908
3072
|
}
|
|
3073
|
+
const userFacingErrorMessage = result.status === 'errored' ? getUserFacingErrorMessage(result.error) : undefined;
|
|
2909
3074
|
if (runControl.shouldEmitTerminalOutcome(result.stopReason)) {
|
|
2910
3075
|
this.terminalOutcome.evaluateTerminalResponse(opts.threadId, opts.runId, result.status, {
|
|
2911
3076
|
messageGroupId,
|
|
2912
3077
|
workSummary: result.workSummary,
|
|
3078
|
+
errorMessage: userFacingErrorMessage,
|
|
2913
3079
|
suppressCompletedFallback: opts.checkpoint?.isCheckpointFollowUp === true ||
|
|
2914
3080
|
opts.plannedBuild?.isPlannedBuildFollowUp === true,
|
|
2915
3081
|
});
|
|
@@ -2929,9 +3095,11 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2929
3095
|
const archivedWorkflowIds = await this.temporaryWorkflowService.reapForRun(opts.threadId, opts.user, undefined, this.backgroundTasks.getRunningTasks(opts.threadId).length);
|
|
2930
3096
|
await this.finalizeRun(opts.threadId, opts.runId, result.status, opts.snapshotStorage, {
|
|
2931
3097
|
userId: opts.user.id,
|
|
3098
|
+
...(opts.modelId !== undefined ? { modelId: opts.modelId } : {}),
|
|
2932
3099
|
archivedWorkflowIds,
|
|
2933
3100
|
workSummary: result.workSummary,
|
|
2934
3101
|
usage: result.usage,
|
|
3102
|
+
errorReason: userFacingErrorMessage,
|
|
2935
3103
|
});
|
|
2936
3104
|
await this.creditService.claimRunUsage(opts.user, opts.threadId, result.agentRunId || opts.runId, result.usage?.usage ?? [], result.status);
|
|
2937
3105
|
if (result.status === 'completed') {
|
|
@@ -2994,7 +3162,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2994
3162
|
error: errorMessage,
|
|
2995
3163
|
...(0, observability_1.buildInstanceAiObservabilityContext)(errCtx),
|
|
2996
3164
|
});
|
|
2997
|
-
this.
|
|
3165
|
+
this.instanceAiErrorReporter.report(error, { component: 'instance-ai-run', ...errCtx });
|
|
2998
3166
|
this.terminalOutcome.evaluateTerminalResponse(opts.threadId, opts.runId, 'errored', {
|
|
2999
3167
|
messageGroupId,
|
|
3000
3168
|
errorMessage: userFacingErrorMessage,
|
|
@@ -3048,6 +3216,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3048
3216
|
await this.taskProjector.syncFromWorkflowLoop(opts.threadId, opts.runId);
|
|
3049
3217
|
await this.maybeStartWorkflowSetupFollowUp(opts.user, opts.threadId);
|
|
3050
3218
|
}
|
|
3219
|
+
this.instanceAiErrorReporter.endRun(opts.runId);
|
|
3051
3220
|
}
|
|
3052
3221
|
}
|
|
3053
3222
|
spawnBackgroundTask(runId, opts, snapshotStorage, messageGroupIdOverride) {
|
|
@@ -3105,7 +3274,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3105
3274
|
},
|
|
3106
3275
|
onFailed: async (task) => {
|
|
3107
3276
|
await this.tracing.finalizeBackgroundTaskTracing(task, 'failed');
|
|
3108
|
-
this.
|
|
3277
|
+
this.instanceAiErrorReporter.report(new Error(task.error ?? 'Instance AI background task failed'), {
|
|
3109
3278
|
component: 'instance-ai-background-task',
|
|
3110
3279
|
threadId: opts.threadId,
|
|
3111
3280
|
runId,
|
|
@@ -3317,7 +3486,11 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3317
3486
|
agentId: (0, instance_ai_1.orchestratorAgentId)(runId),
|
|
3318
3487
|
payload: {
|
|
3319
3488
|
status: effectiveStatus,
|
|
3320
|
-
...(status === 'cancelled'
|
|
3489
|
+
...(status === 'cancelled'
|
|
3490
|
+
? { reason: reason ?? 'user_cancelled' }
|
|
3491
|
+
: status === 'errored' && reason
|
|
3492
|
+
? { reason }
|
|
3493
|
+
: {}),
|
|
3321
3494
|
...(hasArchived ? { archivedWorkflowIds } : {}),
|
|
3322
3495
|
},
|
|
3323
3496
|
});
|
|
@@ -3329,7 +3502,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3329
3502
|
});
|
|
3330
3503
|
}
|
|
3331
3504
|
async finalizeRun(threadId, runId, status, snapshotStorage, options) {
|
|
3332
|
-
this.publishRunFinish(threadId, runId, status,
|
|
3505
|
+
this.publishRunFinish(threadId, runId, status, options?.errorReason, options?.archivedWorkflowIds, options?.userId);
|
|
3333
3506
|
this.emitRunMetrics(threadId, status, options);
|
|
3334
3507
|
await this.saveAgentTreeSnapshot(threadId, runId, snapshotStorage);
|
|
3335
3508
|
if (status === 'completed' && options?.userId && options?.modelId) {
|
|
@@ -3340,7 +3513,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3340
3513
|
const startedAt = this.runState.getActiveRun(threadId)?.startedAt;
|
|
3341
3514
|
this.eventService.emit('instance-ai-run-finished', {
|
|
3342
3515
|
status: status === 'errored' ? 'error' : status,
|
|
3343
|
-
durationMs: startedAt !== undefined ? Date.now() - startedAt : undefined,
|
|
3516
|
+
durationMs: status !== 'suspended' && startedAt !== undefined ? Date.now() - startedAt : undefined,
|
|
3344
3517
|
model: typeof options?.modelId === 'string' ? options.modelId : 'custom',
|
|
3345
3518
|
toolCalls: options?.workSummary?.totalToolCalls ?? 0,
|
|
3346
3519
|
toolErrors: options?.workSummary?.totalToolErrors ?? 0,
|
|
@@ -3355,13 +3528,17 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3355
3528
|
return;
|
|
3356
3529
|
if (thread.metadata?.titleRefined)
|
|
3357
3530
|
return;
|
|
3358
|
-
const history = await memory.getMessages(threadId, { limit:
|
|
3359
|
-
const userTexts =
|
|
3531
|
+
const history = await memory.getMessages(threadId, { limit: TITLE_REFINE_HISTORY_LIMIT });
|
|
3532
|
+
const userTexts = [];
|
|
3533
|
+
for (const m of history) {
|
|
3360
3534
|
if (!('role' in m) || m.role !== 'user')
|
|
3361
|
-
|
|
3362
|
-
const text = this.extractStoredMessageText(m.content);
|
|
3363
|
-
|
|
3364
|
-
|
|
3535
|
+
continue;
|
|
3536
|
+
const text = (0, internal_messages_1.cleanStoredUserMessage)(this.extractStoredMessageText(m.content));
|
|
3537
|
+
if (text && text.length > 0)
|
|
3538
|
+
userTexts.push(text);
|
|
3539
|
+
if (userTexts.length >= 5)
|
|
3540
|
+
break;
|
|
3541
|
+
}
|
|
3365
3542
|
if (userTexts.length === 0)
|
|
3366
3543
|
return;
|
|
3367
3544
|
const userText = userTexts.join('\n');
|
|
@@ -3510,8 +3687,26 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3510
3687
|
return { name: name.trim(), url: url?.trim() };
|
|
3511
3688
|
});
|
|
3512
3689
|
}
|
|
3690
|
+
trackMcpToolCall({ server, toolName, success, }) {
|
|
3691
|
+
const serverSlug = server.metadata?.serverSlug;
|
|
3692
|
+
const userId = server.metadata?.userId;
|
|
3693
|
+
if (serverSlug && userId) {
|
|
3694
|
+
this.telemetry.track('Instance AI mcp tool called', {
|
|
3695
|
+
user_id: userId,
|
|
3696
|
+
server_slug: serverSlug,
|
|
3697
|
+
tool_name: toolName,
|
|
3698
|
+
success,
|
|
3699
|
+
});
|
|
3700
|
+
}
|
|
3701
|
+
}
|
|
3513
3702
|
};
|
|
3514
3703
|
exports.InstanceAiService = InstanceAiService;
|
|
3704
|
+
__decorate([
|
|
3705
|
+
(0, decorators_1.OnPubSubEvent)('relay-instance-ai-task-control', { instanceType: 'main' }),
|
|
3706
|
+
__metadata("design:type", Function),
|
|
3707
|
+
__metadata("design:paramtypes", [Object]),
|
|
3708
|
+
__metadata("design:returntype", Promise)
|
|
3709
|
+
], InstanceAiService.prototype, "handleRelayTaskControl", null);
|
|
3515
3710
|
__decorate([
|
|
3516
3711
|
(0, decorators_1.OnLeaderTakeover)(),
|
|
3517
3712
|
__metadata("design:type", Function),
|
|
@@ -3555,6 +3750,8 @@ exports.InstanceAiService = InstanceAiService = __decorate([
|
|
|
3555
3750
|
thread_credential_allowlist_service_1.EvalThreadCredentialAllowlistService,
|
|
3556
3751
|
instance_ai_run_probe_1.InstanceAiRunProbe,
|
|
3557
3752
|
instance_ai_model_service_1.InstanceAiModelService,
|
|
3558
|
-
instance_ai_credit_service_1.InstanceAiCreditService
|
|
3753
|
+
instance_ai_credit_service_1.InstanceAiCreditService,
|
|
3754
|
+
publisher_service_1.Publisher,
|
|
3755
|
+
instance_ai_error_reporter_service_1.InstanceAiErrorReporterService])
|
|
3559
3756
|
], InstanceAiService);
|
|
3560
3757
|
//# sourceMappingURL=instance-ai.service.js.map
|