n8n 2.39.4 → 2.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-library-bundle.js +178 -11
- package/dist/auth/auth.service.d.ts +5 -0
- package/dist/auth/auth.service.js +35 -2
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/binary-data/binary-data-access.service.d.ts +1 -1
- package/dist/binary-data/binary-data-access.service.js +15 -6
- package/dist/binary-data/binary-data-access.service.js.map +1 -1
- package/dist/binary-data/database.manager.js +1 -1
- package/dist/binary-data/database.manager.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/base-command.d.ts +1 -0
- package/dist/commands/base-command.js +11 -1
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/execute-batch.js.map +1 -1
- package/dist/commands/list/workflow.js +1 -4
- package/dist/commands/list/workflow.js.map +1 -1
- package/dist/commands/publish/workflow.js +1 -5
- package/dist/commands/publish/workflow.js.map +1 -1
- package/dist/commands/start.js +1 -7
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/ttwf/generate.js +1 -4
- package/dist/commands/ttwf/generate.js.map +1 -1
- package/dist/commands/unpublish/workflow.js +1 -5
- package/dist/commands/unpublish/workflow.js.map +1 -1
- package/dist/commands/update/workflow.js +1 -5
- package/dist/commands/update/workflow.js.map +1 -1
- package/dist/controller.registry.d.ts +1 -1
- package/dist/controller.registry.js +3 -3
- package/dist/controller.registry.js.map +1 -1
- package/dist/controllers/ai-preference.controller.d.ts +17 -0
- package/dist/controllers/ai-preference.controller.js +78 -0
- package/dist/controllers/ai-preference.controller.js.map +1 -0
- package/dist/controllers/change-email.controller.d.ts +31 -0
- package/dist/controllers/change-email.controller.js +164 -0
- package/dist/controllers/change-email.controller.js.map +1 -0
- package/dist/controllers/me.controller.d.ts +3 -2
- package/dist/controllers/me.controller.js +10 -42
- package/dist/controllers/me.controller.js.map +1 -1
- package/dist/credentials/dynamic-credentials-proxy.js.map +1 -1
- package/dist/credentials/executing-user-identifier-proxy.d.ts +7 -0
- package/dist/credentials/executing-user-identifier-proxy.js +25 -0
- package/dist/credentials/executing-user-identifier-proxy.js.map +1 -0
- package/dist/credentials/executing-user-identifier.interface.d.ts +4 -0
- package/dist/credentials/executing-user-identifier.interface.js +3 -0
- package/dist/credentials/executing-user-identifier.interface.js.map +1 -0
- package/dist/credentials/mock-node-types.d.ts +5 -0
- package/dist/credentials/mock-node-types.js +34 -0
- package/dist/credentials/mock-node-types.js.map +1 -0
- package/dist/credentials-helper.js +5 -27
- package/dist/credentials-helper.js.map +1 -1
- package/dist/deprecation/deprecation.service.js +6 -2
- package/dist/deprecation/deprecation.service.js.map +1 -1
- package/dist/encryption/key-manager.service.js +3 -1
- package/dist/encryption/key-manager.service.js.map +1 -1
- package/dist/encryption/key-rotation-flag.js +2 -1
- package/dist/encryption/key-rotation-flag.js.map +1 -1
- package/dist/errors/pre-execute-blocked.error.d.ts +6 -0
- package/dist/errors/pre-execute-blocked.error.js +15 -0
- package/dist/errors/pre-execute-blocked.error.js.map +1 -0
- package/dist/eventbus/event-message-classes/event-message-audit.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-generic.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-mcp.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-workflow.js.map +1 -1
- package/dist/eventbus/event-message-classes/index.d.ts +4 -2
- package/dist/eventbus/event-message-classes/index.js +6 -1
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/eventbus/message-event-bus/message-event-bus.d.ts +3 -1
- package/dist/eventbus/message-event-bus/message-event-bus.js +5 -3
- package/dist/eventbus/message-event-bus/message-event-bus.js.map +1 -1
- package/dist/eventbus/message-event-bus-writer/message-event-bus-log-writer.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +24 -2
- package/dist/events/relays/log-streaming.event-relay.d.ts +2 -0
- package/dist/events/relays/log-streaming.event-relay.js +9 -0
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +6 -0
- package/dist/events/relays/telemetry.event-relay.js +88 -1
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +22 -10
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/execution-lifecycle/restore-binary-data-id.js +2 -2
- package/dist/execution-lifecycle/restore-binary-data-id.js.map +1 -1
- package/dist/executions/enqueued-execution-recovery.service.d.ts +3 -3
- package/dist/executions/enqueued-execution-recovery.service.js +6 -6
- package/dist/executions/enqueued-execution-recovery.service.js.map +1 -1
- package/dist/executions/execution-crash.service.d.ts +12 -0
- package/dist/executions/execution-crash.service.js +43 -0
- package/dist/executions/execution-crash.service.js.map +1 -0
- package/dist/executions/execution-recovery.service.d.ts +3 -1
- package/dist/executions/execution-recovery.service.js +6 -4
- package/dist/executions/execution-recovery.service.js.map +1 -1
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/executions/pre-execution-checks/credentials-permission-checker.d.ts +5 -2
- package/dist/executions/pre-execution-checks/credentials-permission-checker.js +20 -29
- package/dist/executions/pre-execution-checks/credentials-permission-checker.js.map +1 -1
- package/dist/executions/pre-execution-checks/index.d.ts +1 -0
- package/dist/executions/pre-execution-checks/index.js +3 -1
- package/dist/executions/pre-execution-checks/index.js.map +1 -1
- package/dist/executions/pre-execution-checks/workflow-pre-execute.d.ts +16 -0
- package/dist/executions/pre-execution-checks/workflow-pre-execute.js +96 -0
- package/dist/executions/pre-execution-checks/workflow-pre-execute.js.map +1 -0
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js +25 -3
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js.map +1 -1
- package/dist/license/license-renewal.task.d.ts +13 -0
- package/dist/license/license-renewal.task.js +38 -0
- package/dist/license/license-renewal.task.js.map +1 -0
- package/dist/license.d.ts +1 -2
- package/dist/license.js +5 -19
- package/dist/license.js.map +1 -1
- package/dist/load-nodes-and-credentials.d.ts +1 -0
- package/dist/load-nodes-and-credentials.js +7 -2
- package/dist/load-nodes-and-credentials.js.map +1 -1
- package/dist/metrics/prometheus/encryption-metrics.service.d.ts +10 -0
- package/dist/metrics/prometheus/encryption-metrics.service.js +55 -0
- package/dist/metrics/prometheus/encryption-metrics.service.js.map +1 -0
- package/dist/metrics/prometheus/prometheus.service.d.ts +2 -1
- package/dist/metrics/prometheus/prometheus.service.js +4 -2
- package/dist/metrics/prometheus/prometheus.service.js.map +1 -1
- package/dist/modules/agents/agent-chat.controller.d.ts +11 -2
- package/dist/modules/agents/agent-chat.controller.js +42 -2
- package/dist/modules/agents/agent-chat.controller.js.map +1 -1
- package/dist/modules/agents/agent-checkpoint-pruning.task.d.ts +14 -0
- package/dist/modules/agents/agent-checkpoint-pruning.task.js +38 -0
- package/dist/modules/agents/agent-checkpoint-pruning.task.js.map +1 -0
- package/dist/modules/agents/agent-config.service.d.ts +7 -7
- package/dist/modules/agents/agent-config.service.js +13 -3
- package/dist/modules/agents/agent-config.service.js.map +1 -1
- package/dist/modules/agents/agent-custom-tools.service.d.ts +3 -1
- package/dist/modules/agents/agent-custom-tools.service.js +6 -2
- package/dist/modules/agents/agent-custom-tools.service.js.map +1 -1
- package/dist/modules/agents/agent-execution-orchestrator.service.d.ts +34 -2
- package/dist/modules/agents/agent-execution-orchestrator.service.js +143 -16
- package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
- package/dist/modules/agents/agent-execution-update-broadcaster.d.ts +6 -1
- package/dist/modules/agents/agent-execution-update-broadcaster.js +34 -2
- package/dist/modules/agents/agent-execution-update-broadcaster.js.map +1 -1
- package/dist/modules/agents/agent-execution.service.d.ts +5 -2
- package/dist/modules/agents/agent-execution.service.js +2 -1
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-integration-management.service.d.ts +2 -0
- package/dist/modules/agents/agent-integration-management.service.js +4 -0
- package/dist/modules/agents/agent-integration-management.service.js.map +1 -1
- package/dist/modules/agents/agent-integrations.controller.d.ts +3 -1
- package/dist/modules/agents/agent-integrations.controller.js +7 -5
- package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
- package/dist/modules/agents/agent-interrupted-execution-sweeper.d.ts +3 -1
- package/dist/modules/agents/agent-interrupted-execution-sweeper.js +10 -2
- package/dist/modules/agents/agent-interrupted-execution-sweeper.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-commands.js +2 -2
- package/dist/modules/agents/agent-knowledge-commands.js.map +1 -1
- package/dist/modules/agents/agent-modification-telemetry.service.d.ts +1 -0
- package/dist/modules/agents/agent-modification-telemetry.service.js.map +1 -1
- package/dist/modules/agents/agent-publish.controller.d.ts +8 -0
- package/dist/modules/agents/agent-publish.controller.js +4 -4
- package/dist/modules/agents/agent-publish.controller.js.map +1 -1
- package/dist/modules/agents/agent-publish.service.d.ts +7 -5
- package/dist/modules/agents/agent-publish.service.js +12 -6
- package/dist/modules/agents/agent-publish.service.js.map +1 -1
- package/dist/modules/agents/agent-runnable-state.service.d.ts +2 -0
- package/dist/modules/agents/agent-runnable-state.service.js +8 -0
- package/dist/modules/agents/agent-runnable-state.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-cache.service.d.ts +3 -0
- package/dist/modules/agents/agent-runtime-cache.service.js +8 -3
- package/dist/modules/agents/agent-runtime-cache.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +7 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.js +34 -11
- package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
- package/dist/modules/agents/agent-sandbox-principal.d.ts +2 -2
- package/dist/modules/agents/agent-sandbox-principal.js +2 -2
- package/dist/modules/agents/agent-sandbox-principal.js.map +1 -1
- package/dist/modules/agents/agent-sandbox-runtime.service.js +9 -8
- package/dist/modules/agents/agent-sandbox-runtime.service.js.map +1 -1
- package/dist/modules/agents/agent-session-langsmith-export.service.js +110 -10
- package/dist/modules/agents/agent-session-langsmith-export.service.js.map +1 -1
- package/dist/modules/agents/agent-skills.service.d.ts +4 -2
- package/dist/modules/agents/agent-skills.service.js +30 -6
- package/dist/modules/agents/agent-skills.service.js.map +1 -1
- package/dist/modules/agents/agent-sse-stream.js.map +1 -1
- package/dist/modules/agents/agent-task.service.d.ts +6 -2
- package/dist/modules/agents/agent-task.service.js +79 -91
- package/dist/modules/agents/agent-task.service.js.map +1 -1
- package/dist/modules/agents/agent-tasks.controller.js +3 -0
- package/dist/modules/agents/agent-tasks.controller.js.map +1 -1
- package/dist/modules/agents/agent-test-chat.service.js +8 -1
- package/dist/modules/agents/agent-test-chat.service.js.map +1 -1
- package/dist/modules/agents/agent-test-run.service.d.ts +3 -1
- package/dist/modules/agents/agent-test-run.service.js +5 -3
- package/dist/modules/agents/agent-test-run.service.js.map +1 -1
- package/dist/modules/agents/agent-update-broadcaster.d.ts +22 -0
- package/dist/modules/agents/agent-update-broadcaster.js +74 -0
- package/dist/modules/agents/agent-update-broadcaster.js.map +1 -0
- package/dist/modules/agents/agent-validation.service.js.map +1 -1
- package/dist/modules/agents/agent-workflow-execution.service.d.ts +3 -1
- package/dist/modules/agents/agent-workflow-execution.service.js +7 -3
- package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-workflow-tool-resume.service.js +1 -0
- package/dist/modules/agents/agent-workflow-tool-resume.service.js.map +1 -1
- package/dist/modules/agents/agents-config.controller.d.ts +214 -219
- package/dist/modules/agents/agents-config.controller.js +7 -2
- package/dist/modules/agents/agents-config.controller.js.map +1 -1
- package/dist/modules/agents/agents-skills.controller.js +6 -2
- package/dist/modules/agents/agents-skills.controller.js.map +1 -1
- package/dist/modules/agents/agents.controller.d.ts +4 -0
- package/dist/modules/agents/agents.controller.js +12 -1
- package/dist/modules/agents/agents.controller.js.map +1 -1
- package/dist/modules/agents/agents.module.d.ts +2 -1
- package/dist/modules/agents/agents.module.js +25 -2
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/agents.service.d.ts +9 -4
- package/dist/modules/agents/agents.service.js +29 -7
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/background/agent-background-job.service.d.ts +16 -3
- package/dist/modules/agents/background/agent-background-job.service.js +105 -6
- package/dist/modules/agents/background/agent-background-job.service.js.map +1 -1
- package/dist/modules/agents/background/agent-wake.service.d.ts +47 -0
- package/dist/modules/agents/background/agent-wake.service.js +237 -0
- package/dist/modules/agents/background/agent-wake.service.js.map +1 -0
- package/dist/modules/agents/background/background-job-messages.d.ts +7 -0
- package/dist/modules/agents/background/background-job-messages.js +42 -0
- package/dist/modules/agents/background/background-job-messages.js.map +1 -0
- package/dist/modules/agents/background/background-job-tools.js +45 -12
- package/dist/modules/agents/background/background-job-tools.js.map +1 -1
- package/dist/modules/agents/background/sub-agent-background-runner.d.ts +1 -1
- package/dist/modules/agents/background/sub-agent-background-runner.js +3 -3
- package/dist/modules/agents/background/sub-agent-background-runner.js.map +1 -1
- package/dist/modules/agents/builder/agent-builder-preview-path.js +1 -1
- package/dist/modules/agents/builder/agent-builder-preview-path.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +3 -2
- package/dist/modules/agents/builder/agents-builder-tools.service.js +29 -17
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder.service.d.ts +4 -1
- package/dist/modules/agents/builder/agents-builder.service.js +12 -3
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-model-live-lookup.service.d.ts +7 -2
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js +21 -3
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js.map +1 -1
- package/dist/modules/agents/builder/format-preview-context.js +3 -0
- package/dist/modules/agents/builder/format-preview-context.js.map +1 -1
- package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +2 -2
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js +2 -3
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -1
- package/dist/modules/agents/builder/skills/external-services.skill.js +2 -2
- package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/memory.skill.js +4 -4
- package/dist/modules/agents/builder/skills/memory.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-skills.skill.js +4 -2
- package/dist/modules/agents/builder/skills/target-skills.skill.js.map +1 -1
- package/dist/modules/agents/entities/agent-background-job.entity.d.ts +3 -0
- package/dist/modules/agents/entities/agent-background-job.entity.js +14 -1
- package/dist/modules/agents/entities/agent-background-job.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-execution.entity.d.ts +2 -0
- package/dist/modules/agents/entities/agent-execution.entity.js +4 -0
- package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-memory-entry-candidate.entity.d.ts +15 -0
- package/dist/modules/agents/entities/agent-memory-entry-candidate.entity.js +70 -0
- package/dist/modules/agents/entities/agent-memory-entry-candidate.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-memory-entry-source.entity.d.ts +2 -1
- package/dist/modules/agents/entities/agent-memory-entry-source.entity.js +11 -2
- package/dist/modules/agents/entities/agent-memory-entry-source.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-message.entity.js +2 -1
- package/dist/modules/agents/entities/agent-message.entity.js.map +1 -1
- package/dist/modules/agents/episodic-memory.d.ts +2 -2
- package/dist/modules/agents/episodic-memory.js +1 -4
- package/dist/modules/agents/episodic-memory.js.map +1 -1
- package/dist/modules/agents/execution-recorder.d.ts +6 -2
- package/dist/modules/agents/execution-recorder.js +17 -6
- package/dist/modules/agents/execution-recorder.js.map +1 -1
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +3 -1
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +5 -4
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +5 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.js +53 -13
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.d.ts +5 -3
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.js +35 -25
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.js.map +1 -1
- package/dist/modules/agents/integrations/channel-rate-limit.d.ts +14 -0
- package/dist/modules/agents/integrations/channel-rate-limit.guard.d.ts +5 -0
- package/dist/modules/agents/integrations/channel-rate-limit.guard.js +40 -0
- package/dist/modules/agents/integrations/channel-rate-limit.guard.js.map +1 -0
- package/dist/modules/agents/integrations/channel-rate-limit.js +69 -0
- package/dist/modules/agents/integrations/channel-rate-limit.js.map +1 -0
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
- package/dist/modules/agents/integrations/component-mapper.js.map +1 -1
- package/dist/modules/agents/integrations/cron-validation.d.ts +2 -1
- package/dist/modules/agents/integrations/cron-validation.js +10 -1
- package/dist/modules/agents/integrations/cron-validation.js.map +1 -1
- package/dist/modules/agents/integrations/integration-action-executor.d.ts +3 -1
- package/dist/modules/agents/integrations/integration-action-executor.js +20 -4
- package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -1
- package/dist/modules/agents/integrations/integration-context-query-executor.d.ts +3 -1
- package/dist/modules/agents/integrations/integration-context-query-executor.js +20 -4
- package/dist/modules/agents/integrations/integration-context-query-executor.js.map +1 -1
- package/dist/modules/agents/integrations/integration-error-codes.d.ts +1 -0
- package/dist/modules/agents/integrations/integration-error-codes.js +1 -0
- package/dist/modules/agents/integrations/integration-error-codes.js.map +1 -1
- package/dist/modules/agents/integrations/integration-helpers.d.ts +1 -0
- package/dist/modules/agents/integrations/integration-helpers.js +4 -0
- package/dist/modules/agents/integrations/integration-helpers.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-factory.js.map +1 -1
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +3 -14
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +7 -64
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -1
- package/dist/modules/agents/integrations/n8n-memory.d.ts +14 -10
- package/dist/modules/agents/integrations/n8n-memory.js +119 -82
- package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/discord-integration.js +1 -1
- package/dist/modules/agents/integrations/platforms/discord-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-operations.js.map +1 -1
- package/dist/modules/agents/integrations/recording/channel-integration-recorder.js +2 -9
- package/dist/modules/agents/integrations/recording/channel-integration-recorder.js.map +1 -1
- package/dist/modules/agents/json-config/credential-field-mapping.js.map +1 -1
- package/dist/modules/agents/json-config/from-json-config.d.ts +1 -0
- package/dist/modules/agents/json-config/from-json-config.js +14 -25
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
- package/dist/modules/agents/json-config/model-config.js.map +1 -1
- package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js +0 -1
- package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js.map +1 -1
- package/dist/modules/agents/model-stream-stall-options.d.ts +3 -0
- package/dist/modules/agents/model-stream-stall-options.js +21 -0
- package/dist/modules/agents/model-stream-stall-options.js.map +1 -0
- package/dist/modules/agents/repositories/agent-background-job.repository.d.ts +8 -0
- package/dist/modules/agents/repositories/agent-background-job.repository.js +44 -1
- package/dist/modules/agents/repositories/agent-background-job.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-execution.repository.d.ts +1 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js +3 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-memory-entry-candidate.repository.d.ts +22 -0
- package/dist/modules/agents/repositories/agent-memory-entry-candidate.repository.js +75 -0
- package/dist/modules/agents/repositories/agent-memory-entry-candidate.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-message.repository.d.ts +1 -0
- package/dist/modules/agents/repositories/agent-message.repository.js +11 -0
- package/dist/modules/agents/repositories/agent-message.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent.repository.d.ts +2 -0
- package/dist/modules/agents/repositories/agent.repository.js +14 -0
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
- package/dist/modules/agents/scheduling/agent-task-job-registrar.d.ts +23 -0
- package/dist/modules/agents/scheduling/agent-task-job-registrar.js +146 -0
- package/dist/modules/agents/scheduling/agent-task-job-registrar.js.map +1 -0
- package/dist/modules/agents/scheduling/agent-task-job.d.ts +7 -0
- package/dist/modules/agents/scheduling/agent-task-job.js +12 -0
- package/dist/modules/agents/scheduling/agent-task-job.js.map +1 -0
- package/dist/modules/agents/scheduling/agent-task-task-handler.d.ts +13 -0
- package/dist/modules/agents/scheduling/agent-task-task-handler.js +68 -0
- package/dist/modules/agents/scheduling/agent-task-task-handler.js.map +1 -0
- package/dist/modules/agents/scheduling/task-timezone.d.ts +2 -0
- package/dist/modules/agents/scheduling/task-timezone.js +13 -0
- package/dist/modules/agents/scheduling/task-timezone.js.map +1 -0
- package/dist/modules/agents/sub-agents/sub-agent-runner.d.ts +3 -1
- package/dist/modules/agents/sub-agents/sub-agent-runner.js +14 -5
- package/dist/modules/agents/sub-agents/sub-agent-runner.js.map +1 -1
- package/dist/modules/agents/tools/node-tool-factory.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.d.ts +1 -0
- package/dist/modules/agents/tools/workflow-tool-factory.js +35 -6
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/utils/agent-config-hash.d.ts +4 -1
- package/dist/modules/agents/utils/agent-config-hash.js +10 -3
- package/dist/modules/agents/utils/agent-config-hash.js.map +1 -1
- package/dist/modules/agents/utils/agent-memory-scope.d.ts +7 -0
- package/dist/modules/agents/utils/agent-memory-scope.js +30 -1
- package/dist/modules/agents/utils/agent-memory-scope.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 +11 -7
- package/dist/modules/agents/utils/execution-to-message-mapper.js.map +1 -1
- package/dist/modules/agents/utils/mcp-attribution.d.ts +4 -0
- package/dist/modules/agents/utils/mcp-attribution.js +34 -0
- package/dist/modules/agents/utils/mcp-attribution.js.map +1 -0
- package/dist/modules/breaking-changes/rules/index.d.ts +4 -1
- package/dist/modules/breaking-changes/rules/index.js +4 -1
- package/dist/modules/breaking-changes/rules/index.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/chat-hub-deprecated.rule.d.ts +9 -0
- package/dist/modules/breaking-changes/rules/v3/chat-hub-deprecated.rule.js +59 -0
- package/dist/modules/breaking-changes/rules/v3/chat-hub-deprecated.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/external-secrets-project-roles-default.rule.d.ts +12 -0
- package/dist/modules/breaking-changes/rules/v3/external-secrets-project-roles-default.rule.js +70 -0
- package/dist/modules/breaking-changes/rules/v3/external-secrets-project-roles-default.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/pre-execute-error-creates-execution.rule.d.ts +9 -0
- package/dist/modules/breaking-changes/rules/v3/pre-execute-error-creates-execution.rule.js +56 -0
- package/dist/modules/breaking-changes/rules/v3/pre-execute-error-creates-execution.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/{task-runner-internal-mode.rule.d.ts → storage-path-rename.rule.d.ts} +4 -1
- package/dist/modules/breaking-changes/rules/v3/storage-path-rename.rule.js +87 -0
- package/dist/modules/breaking-changes/rules/v3/storage-path-rename.rule.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-extractor.d.ts +3 -1
- package/dist/modules/chat-hub/chat-hub-extractor.js +21 -14
- package/dist/modules/chat-hub/chat-hub-extractor.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.attachment.service.js +1 -1
- package/dist/modules/chat-hub/chat-hub.attachment.service.js.map +1 -1
- package/dist/modules/data-table/data-table-aggregate.controller.js +0 -2
- package/dist/modules/data-table/data-table-aggregate.controller.js.map +1 -1
- package/dist/modules/data-table/data-table-aggregate.service.d.ts +5 -4
- package/dist/modules/data-table/data-table-aggregate.service.js +8 -6
- package/dist/modules/data-table/data-table-aggregate.service.js.map +1 -1
- package/dist/modules/data-table/data-table-file-cleanup.service.js.map +1 -1
- package/dist/modules/data-table/data-table-rows.repository.js +6 -0
- package/dist/modules/data-table/data-table-rows.repository.js.map +1 -1
- package/dist/modules/data-table/data-table.service.js +12 -0
- package/dist/modules/data-table/data-table.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.d.ts +4 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js +30 -2
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +5 -9
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js +5 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.d.ts +2 -2
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js +2 -2
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.d.ts +5 -2
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js +9 -9
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js +1 -1
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js.map +1 -1
- package/dist/modules/engine-v2/engine-control-plane-auth.middleware.d.ts +2 -1
- package/dist/modules/engine-v2/engine-control-plane-auth.middleware.js +2 -2
- package/dist/modules/engine-v2/engine-control-plane-auth.middleware.js.map +1 -1
- package/dist/modules/engine-v2/engine-control-plane-client.d.ts +2 -4
- package/dist/modules/engine-v2/engine-control-plane-client.js +4 -13
- package/dist/modules/engine-v2/engine-control-plane-client.js.map +1 -1
- package/dist/modules/engine-v2/engine-control-plane-server.d.ts +3 -1
- package/dist/modules/engine-v2/engine-control-plane-server.js +7 -6
- package/dist/modules/engine-v2/engine-control-plane-server.js.map +1 -1
- package/dist/modules/engine-v2/engine-control-plane-transport.d.ts +10 -0
- package/dist/modules/engine-v2/engine-control-plane-transport.js +38 -0
- package/dist/modules/engine-v2/engine-control-plane-transport.js.map +1 -0
- package/dist/modules/engine-v2/engine-credentials-client.d.ts +8 -0
- package/dist/modules/engine-v2/engine-credentials-client.js +47 -0
- package/dist/modules/engine-v2/engine-credentials-client.js.map +1 -0
- package/dist/modules/engine-v2/engine-credentials.contract.d.ts +1 -0
- package/dist/modules/engine-v2/engine-credentials.contract.js +7 -0
- package/dist/modules/engine-v2/engine-credentials.contract.js.map +1 -1
- package/dist/modules/engine-v2/engine-credentials.controller.d.ts +7 -0
- package/dist/modules/engine-v2/engine-credentials.controller.js +35 -0
- package/dist/modules/engine-v2/engine-credentials.controller.js.map +1 -0
- package/dist/modules/engine-v2/engine-credentials.service.d.ts +12 -0
- package/dist/modules/engine-v2/engine-credentials.service.js +95 -0
- package/dist/modules/engine-v2/engine-credentials.service.js.map +1 -0
- package/dist/modules/engine-v2/engine-data-plane-client.js.map +1 -1
- package/dist/modules/engine-v2/remote-credentials-helper.d.ts +24 -0
- package/dist/modules/engine-v2/remote-credentials-helper.js +90 -0
- package/dist/modules/engine-v2/remote-credentials-helper.js.map +1 -0
- package/dist/modules/insights/database/entities/insights-shared.d.ts +4 -2
- package/dist/modules/insights/database/entities/insights-shared.js +1 -0
- package/dist/modules/insights/database/entities/insights-shared.js.map +1 -1
- package/dist/modules/insights/database/repositories/insights-by-period.repository.d.ts +3 -3
- package/dist/modules/insights/database/repositories/insights-by-period.repository.js +8 -2
- package/dist/modules/insights/database/repositories/insights-by-period.repository.js.map +1 -1
- package/dist/modules/insights/insights-collection.service.js +8 -0
- package/dist/modules/insights/insights-collection.service.js.map +1 -1
- package/dist/modules/insights/insights-compaction.task.js +1 -2
- package/dist/modules/insights/insights-compaction.task.js.map +1 -1
- package/dist/modules/insights/insights-pruning.task.js +1 -2
- package/dist/modules/insights/insights-pruning.task.js.map +1 -1
- package/dist/modules/insights/insights.controller.js +4 -5
- package/dist/modules/insights/insights.controller.js.map +1 -1
- package/dist/modules/insights/insights.service.d.ts +12 -22
- package/dist/modules/insights/insights.service.js +49 -18
- package/dist/modules/insights/insights.service.js.map +1 -1
- package/dist/modules/instance-ai/browser/browser-local-mcp-server.js +2 -2
- package/dist/modules/instance-ai/browser/browser-local-mcp-server.js.map +1 -1
- package/dist/modules/instance-ai/drop-rejected-attachments.d.ts +1 -1
- package/dist/modules/instance-ai/entities/instance-ai-checkpoint.entity.d.ts +1 -1
- package/dist/modules/instance-ai/entities/instance-ai-thread.entity.js +2 -1
- package/dist/modules/instance-ai/entities/instance-ai-thread.entity.js.map +1 -1
- package/dist/modules/instance-ai/eval/agent-scenario-seed.js +4 -2
- package/dist/modules/instance-ai/eval/agent-scenario-seed.js.map +1 -1
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/llm-completion-mock.js +16 -19
- package/dist/modules/instance-ai/eval/llm-completion-mock.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-handler.js +3 -2
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-utils.js +2 -4
- package/dist/modules/instance-ai/eval/mock-utils.js.map +1 -1
- package/dist/modules/instance-ai/eval/openai-envelope.js.map +1 -1
- package/dist/modules/instance-ai/eval/openai-responses-envelope.js +9 -11
- package/dist/modules/instance-ai/eval/openai-responses-envelope.js.map +1 -1
- package/dist/modules/instance-ai/eval/provider-shapes.js +30 -33
- package/dist/modules/instance-ai/eval/provider-shapes.js.map +1 -1
- package/dist/modules/instance-ai/eval/request-sanitizer.js.map +1 -1
- package/dist/modules/instance-ai/eval/structured-output-conformance.js +14 -16
- package/dist/modules/instance-ai/eval/structured-output-conformance.js.map +1 -1
- package/dist/modules/instance-ai/eval/thread-restore.service.d.ts +13 -3
- package/dist/modules/instance-ai/eval/thread-restore.service.js +95 -22
- package/dist/modules/instance-ai/eval/thread-restore.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.js +2 -4
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
- package/dist/modules/instance-ai/event-bus/durable-event-log.d.ts +4 -0
- package/dist/modules/instance-ai/event-bus/durable-event-log.js +4 -0
- package/dist/modules/instance-ai/event-bus/durable-event-log.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-checkpoint-pruning.task.d.ts +16 -0
- package/dist/modules/instance-ai/instance-ai-checkpoint-pruning.task.js +40 -0
- package/dist/modules/instance-ai/instance-ai-checkpoint-pruning.task.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-credit.service.js +12 -8
- package/dist/modules/instance-ai/instance-ai-credit.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +6 -3
- package/dist/modules/instance-ai/instance-ai-memory.service.js +36 -2
- package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-model.service.js +2 -2
- package/dist/modules/instance-ai/instance-ai-model.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-pending-agent.service.d.ts +2 -0
- package/dist/modules/instance-ai/instance-ai-settings.service.js +8 -8
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-setup-telemetry.service.js +2 -2
- package/dist/modules/instance-ai/instance-ai-setup-telemetry.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.d.ts +2 -1
- package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js +1 -1
- package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-verification.service.js +3 -4
- package/dist/modules/instance-ai/instance-ai-verification.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +9 -4
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +194 -73
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +7 -1
- package/dist/modules/instance-ai/instance-ai.controller.js +38 -6
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +2 -1
- package/dist/modules/instance-ai/instance-ai.module.js +7 -0
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +15 -20
- package/dist/modules/instance-ai/instance-ai.service.js +267 -421
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-context.service.d.ts +48 -0
- package/dist/modules/instance-ai/instance-context.service.js +388 -0
- package/dist/modules/instance-ai/instance-context.service.js.map +1 -0
- package/dist/modules/instance-ai/internal-messages.d.ts +8 -0
- package/dist/modules/instance-ai/internal-messages.js +34 -3
- package/dist/modules/instance-ai/internal-messages.js.map +1 -1
- package/dist/modules/instance-ai/message-parser.d.ts +4 -3
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.d.ts +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.d.ts +5 -1
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js +16 -0
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-thread.repository.d.ts +13 -3
- package/dist/modules/instance-ai/repositories/instance-ai-thread.repository.js +59 -4
- package/dist/modules/instance-ai/repositories/instance-ai-thread.repository.js.map +1 -1
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.d.ts +8 -2
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js +91 -55
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.d.ts +1 -1
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.d.ts +7 -2
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js +53 -24
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-observation-log-store.d.ts +1 -2
- package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js.map +1 -1
- package/dist/modules/instance-ai/stream-transport-error.js +3 -1
- package/dist/modules/instance-ai/stream-transport-error.js.map +1 -1
- package/dist/modules/instance-ai/suspended-thread-persistence.service.js.map +1 -1
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js.map +1 -1
- package/dist/modules/instance-ai/workflow-templates.service.js +3 -5
- package/dist/modules/instance-ai/workflow-templates.service.js.map +1 -1
- package/dist/modules/instance-ai/workflow-verification-obligation-service.d.ts +2 -1
- package/dist/modules/instance-ai/workflow-verification-obligation-service.js +11 -3
- package/dist/modules/instance-ai/workflow-verification-obligation-service.js.map +1 -1
- package/dist/modules/instance-registry/checks/build-check-result.d.ts +13 -0
- package/dist/modules/instance-registry/checks/build-check-result.js +19 -0
- package/dist/modules/instance-registry/checks/build-check-result.js.map +1 -0
- package/dist/modules/instance-registry/checks/hostid-clash.check.js +13 -21
- package/dist/modules/instance-registry/checks/hostid-clash.check.js.map +1 -1
- package/dist/modules/instance-registry/checks/split-brain.check.js +14 -23
- package/dist/modules/instance-registry/checks/split-brain.check.js.map +1 -1
- package/dist/modules/instance-registry/checks/version-mismatch.check.js +17 -24
- package/dist/modules/instance-registry/checks/version-mismatch.check.js.map +1 -1
- package/dist/modules/instance-reporting.ee/database/entities/instance-monitoring-report.js.map +1 -0
- package/dist/modules/{instance-reporting → instance-reporting.ee}/database/repositories/instance-monitoring-report.repository.d.ts +1 -0
- package/dist/modules/{instance-reporting → instance-reporting.ee}/database/repositories/instance-monitoring-report.repository.js +8 -0
- package/dist/modules/instance-reporting.ee/database/repositories/instance-monitoring-report.repository.js.map +1 -0
- package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting-scheduler.service.d.ts +6 -6
- package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting-scheduler.service.js +10 -18
- package/dist/modules/instance-reporting.ee/instance-reporting-scheduler.service.js.map +1 -0
- package/dist/modules/instance-reporting.ee/instance-reporting-settings.service.js.map +1 -0
- package/dist/modules/instance-reporting.ee/instance-reporting.config.js.map +1 -0
- package/dist/modules/instance-reporting.ee/instance-reporting.constants.js.map +1 -0
- package/dist/modules/instance-reporting.ee/instance-reporting.controller.d.ts +7 -0
- package/dist/modules/instance-reporting.ee/instance-reporting.controller.js +35 -0
- package/dist/modules/instance-reporting.ee/instance-reporting.controller.js.map +1 -0
- package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting.module.d.ts +8 -0
- package/dist/modules/instance-reporting.ee/instance-reporting.module.js +49 -0
- package/dist/modules/instance-reporting.ee/instance-reporting.module.js.map +1 -0
- package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting.service.d.ts +3 -1
- package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting.service.js +6 -2
- package/dist/modules/instance-reporting.ee/instance-reporting.service.js.map +1 -0
- package/dist/modules/ldap.ee/ldap.service.ee.js.map +1 -1
- package/dist/modules/mcp/mcp.controller.js +8 -6
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +9 -2
- package/dist/modules/mcp/mcp.service.js +28 -8
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/tools/agents/agent-reference.js +2 -1
- package/dist/modules/mcp/tools/agents/agent-reference.js.map +1 -1
- package/dist/modules/mcp/tools/agents/agent-tools.service.js +40 -10
- package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -1
- package/dist/modules/mcp/tools/data-table/get-data-table-rows.tool.d.ts +5 -5
- package/dist/modules/mcp/tools/get-workflow-details.tool.js +3 -3
- package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-workflow-versions-diff.tool.js +2 -2
- package/dist/modules/mcp/tools/get-workflow-versions-diff.tool.js.map +1 -1
- package/dist/modules/mcp/tools/schemas.d.ts +2 -1
- package/dist/modules/mcp/tools/schemas.js +6 -2
- package/dist/modules/mcp/tools/schemas.js.map +1 -1
- package/dist/modules/mcp/tools/webhook-utils.js +8 -6
- package/dist/modules/mcp/tools/webhook-utils.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +7 -2
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.d.ts +1 -0
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +4 -3
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/top-level-items-warning.d.ts +13 -0
- package/dist/modules/mcp/tools/workflow-builder/top-level-items-warning.js +24 -0
- package/dist/modules/mcp/tools/workflow-builder/top-level-items-warning.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +23 -4
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +7 -9
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-registry-connection.js +7 -2
- package/dist/modules/mcp-registry/mcp-registry-connection.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.types.d.ts +32 -20
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js +8 -10
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mock-servers.js +2 -0
- package/dist/modules/mcp-registry/registry/mock-servers.js.map +1 -1
- package/dist/modules/n8n-packages/engine/n8n-package-parser.d.ts +1 -0
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js +24 -7
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
- package/dist/modules/n8n-packages/entities/folder/folder.exporter.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/folder/folder.exporter.js +27 -2
- package/dist/modules/n8n-packages/entities/folder/folder.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/project/project.exporter.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/project/project.exporter.js +28 -8
- package/dist/modules/n8n-packages/entities/project/project.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js +1 -1
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-import.types.d.ts +2 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.js +9 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.js +2 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.types.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.types.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +5 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/io/entity-file-format.d.ts +1 -0
- package/dist/modules/n8n-packages/io/entity-file-format.js +7 -0
- package/dist/modules/n8n-packages/io/entity-file-format.js.map +1 -0
- package/dist/modules/n8n-packages/io/hashing-package-writer.d.ts +10 -0
- package/dist/modules/n8n-packages/io/hashing-package-writer.js +25 -0
- package/dist/modules/n8n-packages/io/hashing-package-writer.js.map +1 -0
- package/dist/modules/n8n-packages/io/manifest-entry.d.ts +38 -0
- package/dist/modules/n8n-packages/io/manifest-entry.js +26 -22
- package/dist/modules/n8n-packages/io/manifest-entry.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.service.d.ts +7 -3
- package/dist/modules/n8n-packages/n8n-packages.service.js +10 -3
- package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +5 -0
- package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
- package/dist/modules/n8n-packages/spec/constants.d.ts +1 -0
- package/dist/modules/n8n-packages/spec/constants.js +2 -1
- package/dist/modules/n8n-packages/spec/constants.js.map +1 -1
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.d.ts +9 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.js +8 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +0 -3
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +0 -1
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -1
- package/dist/modules/oauth-jwe/oauth-jwe-key.service.js.map +1 -1
- package/dist/modules/oauth-jwe/oauth-jwe.module.js +2 -4
- package/dist/modules/oauth-jwe/oauth-jwe.module.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.js +2 -4
- package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.js +2 -4
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.js +2 -4
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/utils.d.ts +2 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/utils.js +8 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/utils.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-test-trigger-resource.resolver.js +2 -4
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-test-trigger-resource.resolver.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-trigger-resource.resolver.js +2 -4
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-trigger-resource.resolver.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-test-trigger-resource.resolver.js +2 -4
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-test-trigger-resource.resolver.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-trigger-resource.resolver.js +2 -4
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-trigger-resource.resolver.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
- package/dist/modules/otel/otel-lifecycle-handler.js +3 -1
- package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
- package/dist/modules/policy-infrastructure/policy-infrastructure.module.js.map +1 -1
- package/dist/modules/promotions.ee/base-branch-files.d.ts +67 -0
- package/dist/modules/promotions.ee/base-branch-files.js +75 -0
- package/dist/modules/promotions.ee/base-branch-files.js.map +1 -0
- package/dist/modules/promotions.ee/branch-placement.d.ts +15 -0
- package/dist/modules/promotions.ee/branch-placement.js +42 -0
- package/dist/modules/promotions.ee/branch-placement.js.map +1 -0
- package/dist/modules/{git-connections.ee → promotions.ee}/constants.d.ts +7 -1
- package/dist/modules/{git-connections.ee → promotions.ee}/constants.js +5 -2
- package/dist/modules/promotions.ee/constants.js.map +1 -0
- package/dist/modules/promotions.ee/database/entities/promotion-config.entity.d.ts +11 -0
- package/dist/modules/promotions.ee/database/entities/promotion-config.entity.js +44 -0
- package/dist/modules/promotions.ee/database/entities/promotion-config.entity.js.map +1 -0
- package/dist/modules/promotions.ee/database/entities/promotion-connection-project.entity.d.ts +8 -0
- package/dist/modules/{git-connections.ee/database/entities/git-connection-project.entity.js → promotions.ee/database/entities/promotion-connection-project.entity.js} +13 -13
- package/dist/modules/promotions.ee/database/entities/promotion-connection-project.entity.js.map +1 -0
- package/dist/modules/promotions.ee/database/entities/promotion-connection.entity.d.ts +11 -0
- package/dist/modules/promotions.ee/database/entities/promotion-connection.entity.js +45 -0
- package/dist/modules/promotions.ee/database/entities/promotion-connection.entity.js.map +1 -0
- package/dist/modules/promotions.ee/database/entities/promotion-provider.entity.d.ts +9 -0
- package/dist/modules/promotions.ee/database/entities/promotion-provider.entity.js +41 -0
- package/dist/modules/promotions.ee/database/entities/promotion-provider.entity.js.map +1 -0
- package/dist/modules/promotions.ee/database/promotion-conflict.error.d.ts +6 -0
- package/dist/modules/promotions.ee/database/promotion-conflict.error.js +12 -0
- package/dist/modules/promotions.ee/database/promotion-conflict.error.js.map +1 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-config.repository.d.ts +19 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-config.repository.js +67 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-config.repository.js.map +1 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-connection-project.repository.d.ts +10 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-connection-project.repository.js +54 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-connection-project.repository.js.map +1 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-connection.repository.d.ts +27 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-connection.repository.js +77 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-connection.repository.js.map +1 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.d.ts +19 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.js +71 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.js.map +1 -0
- package/dist/modules/promotions.ee/diff-package-files.d.ts +13 -0
- package/dist/modules/promotions.ee/diff-package-files.js +48 -0
- package/dist/modules/promotions.ee/diff-package-files.js.map +1 -0
- package/dist/modules/promotions.ee/import-manifest-bridge.d.ts +8 -0
- package/dist/modules/promotions.ee/import-manifest-bridge.js +254 -0
- package/dist/modules/promotions.ee/import-manifest-bridge.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-change.service.d.ts +14 -0
- package/dist/modules/promotions.ee/promotion-change.service.js +211 -0
- package/dist/modules/promotions.ee/promotion-change.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-changes.controller.d.ts +9 -0
- package/dist/modules/promotions.ee/promotion-changes.controller.js +50 -0
- package/dist/modules/promotions.ee/promotion-changes.controller.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-config-settings.d.ts +6 -0
- package/dist/modules/promotions.ee/promotion-config-settings.js +13 -0
- package/dist/modules/promotions.ee/promotion-config-settings.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-config.resolver.d.ts +16 -0
- package/dist/modules/promotions.ee/promotion-config.resolver.js +97 -0
- package/dist/modules/promotions.ee/promotion-config.resolver.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-conflicts.d.ts +1 -0
- package/dist/modules/promotions.ee/promotion-conflicts.js +16 -0
- package/dist/modules/promotions.ee/promotion-conflicts.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-connections.service.d.ts +70 -0
- package/dist/modules/promotions.ee/promotion-connections.service.js +274 -0
- package/dist/modules/promotions.ee/promotion-connections.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-providers.service.d.ts +48 -0
- package/dist/modules/promotions.ee/promotion-providers.service.js +166 -0
- package/dist/modules/promotions.ee/promotion-providers.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-working-directory.service.d.ts +19 -0
- package/dist/modules/promotions.ee/promotion-working-directory.service.js +82 -0
- package/dist/modules/promotions.ee/promotion-working-directory.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotions-git.service.d.ts +59 -0
- package/dist/modules/promotions.ee/promotions-git.service.js +402 -0
- package/dist/modules/promotions.ee/promotions-git.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotions-git.utils.d.ts +16 -0
- package/dist/modules/{git-connections.ee/git-connections-git.utils.js → promotions.ee/promotions-git.utils.js} +15 -3
- package/dist/modules/promotions.ee/promotions-git.utils.js.map +1 -0
- package/dist/modules/promotions.ee/promotions.module.d.ts +5 -0
- package/dist/modules/promotions.ee/promotions.module.js +35 -0
- package/dist/modules/promotions.ee/promotions.module.js.map +1 -0
- package/dist/modules/promotions.ee/promotions.service.d.ts +43 -0
- package/dist/modules/promotions.ee/promotions.service.js +413 -0
- package/dist/modules/promotions.ee/promotions.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotions.types.d.ts +61 -0
- package/dist/modules/promotions.ee/promotions.types.js +15 -0
- package/dist/modules/promotions.ee/promotions.types.js.map +1 -0
- package/dist/modules/promotions.ee/working-copy-updater.d.ts +53 -0
- package/dist/modules/promotions.ee/working-copy-updater.js +487 -0
- package/dist/modules/promotions.ee/working-copy-updater.js.map +1 -0
- package/dist/modules/redaction/dynamic-credentials-context-hook.d.ts +13 -0
- package/dist/modules/redaction/dynamic-credentials-context-hook.js +68 -0
- package/dist/modules/redaction/dynamic-credentials-context-hook.js.map +1 -0
- package/dist/modules/redaction/executions/execution-redaction.service.js +11 -1
- package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
- package/dist/modules/redaction/instance-redaction-enforcement.service.js.map +1 -1
- package/dist/modules/redaction/redaction.module.js +2 -1
- package/dist/modules/redaction/redaction.module.js.map +1 -1
- package/dist/modules/runtime-credentials/runtime-credentials.module.js +2 -4
- package/dist/modules/runtime-credentials/runtime-credentials.module.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-git.service.ee.js +7 -4
- package/dist/modules/source-control.ee/source-control-git.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-helper.ee.js +3 -6
- 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.d.ts +7 -4
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +40 -9
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -1
- package/dist/modules/sso-saml/saml-helpers.js.map +1 -1
- package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
- package/dist/modules/token-exchange/services/jwks-resolver.js.map +1 -1
- package/dist/modules/token-exchange/token-exchange.module.js +3 -5
- package/dist/modules/token-exchange/token-exchange.module.js.map +1 -1
- package/dist/modules/type-availability-policies/available-types.controller.d.ts +10 -0
- package/dist/modules/type-availability-policies/available-types.controller.js +57 -0
- package/dist/modules/type-availability-policies/available-types.controller.js.map +1 -0
- package/dist/modules/type-availability-policies/constants.d.ts +1 -0
- package/dist/modules/type-availability-policies/constants.js +5 -0
- package/dist/modules/type-availability-policies/constants.js.map +1 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.d.ts +1 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js +11 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js.map +1 -1
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.d.ts +2 -1
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js +18 -5
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js.map +1 -1
- package/dist/modules/type-availability-policies/policy-evaluator.d.ts +15 -1
- package/dist/modules/type-availability-policies/policy-evaluator.js +74 -5
- package/dist/modules/type-availability-policies/policy-evaluator.js.map +1 -1
- package/dist/modules/type-availability-policies/policy-rule.types.d.ts +2 -13
- package/dist/modules/type-availability-policies/type-availability-policies.module.js +7 -1
- package/dist/modules/type-availability-policies/type-availability-policies.module.js.map +1 -1
- package/dist/modules/type-availability-policies/type-availability-policy-instance.controller.d.ts +5 -8
- package/dist/modules/type-availability-policies/type-availability-policy-instance.controller.js +10 -13
- package/dist/modules/type-availability-policies/type-availability-policy-instance.controller.js.map +1 -1
- package/dist/modules/type-availability-policies/type-availability-policy-project.controller.d.ts +25 -0
- package/dist/modules/type-availability-policies/type-availability-policy-project.controller.js +67 -0
- package/dist/modules/type-availability-policies/type-availability-policy-project.controller.js.map +1 -0
- package/dist/modules/type-availability-policies/type-availability-policy.service.d.ts +7 -0
- package/dist/modules/type-availability-policies/type-availability-policy.service.js +78 -6
- package/dist/modules/type-availability-policies/type-availability-policy.service.js.map +1 -1
- package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
- package/dist/node-types.js +9 -6
- package/dist/node-types.js.map +1 -1
- package/dist/posthog/index.js +2 -1
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/public-api-controller.registry.js +17 -10
- package/dist/public-api/public-api-controller.registry.js.map +1 -1
- package/dist/public-api/public-api-route-resolver.d.ts +11 -1
- package/dist/public-api/public-api-route-resolver.js +17 -2
- package/dist/public-api/public-api-route-resolver.js.map +1 -1
- package/dist/public-api/public-api-validation-error.d.ts +1 -1
- package/dist/public-api/public-api-validation-error.js.map +1 -1
- package/dist/public-api/types.d.ts +1 -29
- package/dist/public-api/v1/controllers/credentials.public.controller.d.ts +18 -2
- package/dist/public-api/v1/controllers/credentials.public.controller.js +210 -5
- package/dist/public-api/v1/controllers/credentials.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/executions.public.controller.js +6 -17
- package/dist/public-api/v1/controllers/executions.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/index.d.ts +4 -1
- package/dist/public-api/v1/controllers/index.js +4 -1
- package/dist/public-api/v1/controllers/index.js.map +1 -1
- package/dist/public-api/v1/controllers/node-type-policies.public.controller.d.ts +13 -0
- package/dist/public-api/v1/controllers/node-type-policies.public.controller.js +141 -0
- package/dist/public-api/v1/controllers/node-type-policies.public.controller.js.map +1 -0
- package/dist/public-api/v1/controllers/projects.public.controller.d.ts +19 -0
- package/dist/public-api/v1/controllers/projects.public.controller.js +231 -0
- package/dist/public-api/v1/controllers/projects.public.controller.js.map +1 -0
- package/dist/public-api/v1/controllers/promotions.public.controller.d.ts +33 -0
- package/dist/public-api/v1/controllers/promotions.public.controller.js +503 -0
- package/dist/public-api/v1/controllers/promotions.public.controller.js.map +1 -0
- package/dist/public-api/v1/controllers/role-mapping-rules.public.controller.js +3 -3
- package/dist/public-api/v1/controllers/role-mapping-rules.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/roles.public.controller.d.ts +3 -3
- package/dist/public-api/v1/controllers/roles.public.controller.js +14 -14
- package/dist/public-api/v1/controllers/roles.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/source-control.public.controller.d.ts +5 -2
- package/dist/public-api/v1/controllers/source-control.public.controller.js +50 -4
- package/dist/public-api/v1/controllers/source-control.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/tags.public.controller.d.ts +3 -1
- package/dist/public-api/v1/controllers/tags.public.controller.js +56 -6
- package/dist/public-api/v1/controllers/tags.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/variables.public.controller.d.ts +12 -0
- package/dist/public-api/v1/controllers/variables.public.controller.js +127 -0
- package/dist/public-api/v1/controllers/variables.public.controller.js.map +1 -0
- package/dist/public-api/v1/controllers/workflows.public.controller.d.ts +1 -1
- package/dist/public-api/v1/controllers/workflows.public.controller.js +20 -29
- package/dist/public-api/v1/controllers/workflows.public.controller.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.handler.d.ts +0 -4
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +0 -159
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.utils.d.ts +6 -0
- package/dist/public-api/v1/handlers/credentials/credentials.utils.js +30 -0
- package/dist/public-api/v1/handlers/credentials/credentials.utils.js.map +1 -1
- package/dist/public-api/v1/handlers/tags/tags.handler.d.ts +0 -2
- package/dist/public-api/v1/handlers/tags/tags.handler.js +0 -27
- package/dist/public-api/v1/handlers/tags/tags.handler.js.map +1 -1
- package/dist/public-api/v1/openapi-gen/decorator-routes.js +3 -2
- package/dist/public-api/v1/openapi-gen/decorator-routes.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +4712 -2646
- package/dist/public-api/v1/shared/project.mapper.d.ts +3 -0
- package/dist/public-api/v1/shared/project.mapper.js +20 -0
- package/dist/public-api/v1/shared/project.mapper.js.map +1 -0
- package/dist/push/abstract.push.d.ts +3 -1
- package/dist/push/abstract.push.js +2 -2
- package/dist/push/abstract.push.js.map +1 -1
- package/dist/push/index.d.ts +3 -1
- package/dist/push/index.js +2 -2
- package/dist/push/index.js.map +1 -1
- package/dist/requests.d.ts +0 -8
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/constants.js +3 -0
- package/dist/scaling/constants.js.map +1 -1
- package/dist/scaling/job-processor.d.ts +2 -0
- package/dist/scaling/job-processor.js +54 -9
- package/dist/scaling/job-processor.js.map +1 -1
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +13 -0
- package/dist/scaling/pubsub/pubsub.types.d.ts +4 -1
- package/dist/scaling/scaling.service.d.ts +3 -1
- package/dist/scaling/scaling.service.js +5 -3
- package/dist/scaling/scaling.service.js.map +1 -1
- package/dist/scheduling/poll-trigger-node/poll-trigger-task.d.ts +2 -5
- package/dist/scheduling/poll-trigger-node/poll-trigger-task.js +2 -3
- package/dist/scheduling/poll-trigger-node/poll-trigger-task.js.map +1 -1
- package/dist/scheduling/schedule-trigger-node/schedule-trigger-task-handler.js.map +1 -1
- package/dist/scheduling/schedule-trigger-node/schedule-trigger-task.d.ts +2 -5
- package/dist/scheduling/schedule-trigger-node/schedule-trigger-task.js +2 -3
- package/dist/scheduling/schedule-trigger-node/schedule-trigger-task.js.map +1 -1
- package/dist/scheduling/system-tasks/main-system-tasks.d.ts +2 -1
- package/dist/scheduling/system-tasks/main-system-tasks.js +19 -2
- package/dist/scheduling/system-tasks/main-system-tasks.js.map +1 -1
- package/dist/scheduling/system-tasks/system-task-runner.js +3 -3
- package/dist/scheduling/system-tasks/system-task-runner.js.map +1 -1
- package/dist/scheduling/workflow-node-task-payload.d.ts +5 -0
- package/dist/scheduling/workflow-node-task-payload.js +7 -0
- package/dist/scheduling/workflow-node-task-payload.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +2 -0
- package/dist/server.js.map +1 -1
- package/dist/services/ai-preference.service.d.ts +46 -0
- package/dist/services/ai-preference.service.js +336 -0
- package/dist/services/ai-preference.service.js.map +1 -0
- package/dist/services/annotation-tag.service.ee.js.map +1 -1
- package/dist/services/credentials-tester.service.js +2 -24
- package/dist/services/credentials-tester.service.js.map +1 -1
- package/dist/services/dynamic-node-parameters.service.js +3 -1
- package/dist/services/dynamic-node-parameters.service.js.map +1 -1
- package/dist/services/email-change.service.d.ts +21 -0
- package/dist/services/email-change.service.js +84 -0
- package/dist/services/email-change.service.js.map +1 -0
- package/dist/services/engine-v2-dispatcher.service.js +1 -1
- package/dist/services/engine-v2-dispatcher.service.js.map +1 -1
- package/dist/services/engine-v2-payload-guard.service.d.ts +13 -0
- package/dist/services/engine-v2-payload-guard.service.js +49 -0
- package/dist/services/engine-v2-payload-guard.service.js.map +1 -0
- package/dist/services/ownership-transfer/ownership-transfer.manifest.json +8 -3
- package/dist/services/project.service.ee.js +2 -0
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/pruning/execution-pruning-soft-delete.task.d.ts +14 -0
- package/dist/services/pruning/execution-pruning-soft-delete.task.js +38 -0
- package/dist/services/pruning/execution-pruning-soft-delete.task.js.map +1 -0
- package/dist/services/pruning/executions-pruning.service.d.ts +0 -2
- package/dist/services/pruning/executions-pruning.service.js +5 -11
- package/dist/services/pruning/executions-pruning.service.js.map +1 -1
- package/dist/services/pruning/workflow-history-compaction-optimize.task.d.ts +14 -0
- package/dist/services/pruning/workflow-history-compaction-optimize.task.js +38 -0
- package/dist/services/pruning/workflow-history-compaction-optimize.task.js.map +1 -0
- package/dist/services/pruning/workflow-history-compaction-trim.task.d.ts +12 -0
- package/dist/services/pruning/workflow-history-compaction-trim.task.js +40 -0
- package/dist/services/pruning/workflow-history-compaction-trim.task.js.map +1 -0
- package/dist/services/pruning/workflow-history-compaction.service.d.ts +7 -10
- package/dist/services/pruning/workflow-history-compaction.service.js +41 -59
- package/dist/services/pruning/workflow-history-compaction.service.js.map +1 -1
- package/dist/services/workflow-statistics.service.d.ts +6 -0
- package/dist/services/workflow-statistics.service.js +40 -30
- package/dist/services/workflow-statistics.service.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker-ws-server.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
- package/dist/task-runners/task-managers/local-task-requester.js.map +1 -1
- package/dist/task-runners/task-runner-module.js.map +1 -1
- package/dist/user-management/email/interfaces.d.ts +11 -0
- package/dist/user-management/email/templates/email-change-completed.handlebars +183 -0
- package/dist/user-management/email/templates/email-change-requested.handlebars +206 -0
- package/dist/user-management/email/user-management-mailer.d.ts +4 -2
- package/dist/user-management/email/user-management-mailer.js +20 -0
- package/dist/user-management/email/user-management-mailer.js.map +1 -1
- package/dist/utils/is-billable-execution.d.ts +5 -0
- package/dist/utils/is-billable-execution.js +32 -0
- package/dist/utils/is-billable-execution.js.map +1 -0
- package/dist/utils/object-to-error.js.map +1 -1
- package/dist/webhooks/engine-v2-webhooks.d.ts +4 -7
- package/dist/webhooks/engine-v2-webhooks.js +6 -24
- package/dist/webhooks/engine-v2-webhooks.js.map +1 -1
- package/dist/webhooks/webhook-helpers.js +9 -2
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/workflow-execute-additional-data.js +9 -2
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-runner.d.ts +7 -3
- package/dist/workflow-runner.js +54 -29
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/publication/published-workflow-trigger-deactivator.d.ts +1 -0
- package/dist/workflows/publication/published-workflow-trigger-deactivator.js +12 -4
- package/dist/workflows/publication/published-workflow-trigger-deactivator.js.map +1 -1
- package/dist/workflows/publication/trigger-diff.d.ts +4 -1
- package/dist/workflows/publication/trigger-diff.js +12 -2
- package/dist/workflows/publication/trigger-diff.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-applier.js +3 -1
- package/dist/workflows/publication/workflow-publication-applier.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-lifecycle-lock.d.ts +7 -1
- package/dist/workflows/publication/workflow-publication-lifecycle-lock.js +18 -4
- package/dist/workflows/publication/workflow-publication-lifecycle-lock.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.d.ts +3 -10
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.js +4 -49
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.task.d.ts +15 -0
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.task.js +38 -0
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.task.js.map +1 -0
- package/dist/workflows/publication/workflow-publication-outbox-consumer.d.ts +2 -0
- package/dist/workflows/publication/workflow-publication-outbox-consumer.js +62 -27
- package/dist/workflows/publication/workflow-publication-outbox-consumer.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-reconciler.service.d.ts +1 -0
- package/dist/workflows/publication/workflow-publication-reconciler.service.js +21 -8
- package/dist/workflows/publication/workflow-publication-reconciler.service.js.map +1 -1
- package/dist/workflows/triggers/engine-v2-active-triggers.d.ts +16 -0
- package/dist/workflows/triggers/engine-v2-active-triggers.js +39 -0
- package/dist/workflows/triggers/engine-v2-active-triggers.js.map +1 -0
- package/dist/workflows/triggers/trigger-execution-context.factory.d.ts +4 -1
- package/dist/workflows/triggers/trigger-execution-context.factory.js +41 -6
- package/dist/workflows/triggers/trigger-execution-context.factory.js.map +1 -1
- package/dist/workflows/workflow-execution.service.d.ts +8 -3
- package/dist/workflows/workflow-execution.service.js +44 -5
- 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 +6 -2
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow-history/workflow-history.service.js.map +1 -1
- package/package.json +49 -57
- package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.d.ts +0 -7
- package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.js +0 -38
- package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.js.map +0 -1
- package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.d.ts +0 -5
- package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.js +0 -26
- package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.js.map +0 -1
- package/dist/modules/breaking-changes/rules/v3/task-runner-internal-mode.rule.js +0 -51
- package/dist/modules/breaking-changes/rules/v3/task-runner-internal-mode.rule.js.map +0 -1
- package/dist/modules/git-connections.ee/constants.js.map +0 -1
- package/dist/modules/git-connections.ee/database/entities/git-connection-project.entity.d.ts +0 -8
- package/dist/modules/git-connections.ee/database/entities/git-connection-project.entity.js.map +0 -1
- package/dist/modules/git-connections.ee/database/entities/git-connection.entity.d.ts +0 -14
- package/dist/modules/git-connections.ee/database/entities/git-connection.entity.js +0 -61
- package/dist/modules/git-connections.ee/database/entities/git-connection.entity.js.map +0 -1
- package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.d.ts +0 -11
- package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js +0 -58
- package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js.map +0 -1
- package/dist/modules/git-connections.ee/database/repositories/git-connection.repository.d.ts +0 -12
- package/dist/modules/git-connections.ee/database/repositories/git-connection.repository.js +0 -37
- package/dist/modules/git-connections.ee/database/repositories/git-connection.repository.js.map +0 -1
- package/dist/modules/git-connections.ee/git-connections-git.service.d.ts +0 -60
- package/dist/modules/git-connections.ee/git-connections-git.service.js +0 -281
- package/dist/modules/git-connections.ee/git-connections-git.service.js.map +0 -1
- package/dist/modules/git-connections.ee/git-connections-git.utils.d.ts +0 -13
- package/dist/modules/git-connections.ee/git-connections-git.utils.js.map +0 -1
- package/dist/modules/git-connections.ee/git-connections.module.d.ts +0 -5
- package/dist/modules/git-connections.ee/git-connections.module.js +0 -32
- package/dist/modules/git-connections.ee/git-connections.module.js.map +0 -1
- package/dist/modules/git-connections.ee/git-connections.service.d.ts +0 -70
- package/dist/modules/git-connections.ee/git-connections.service.js +0 -476
- package/dist/modules/git-connections.ee/git-connections.service.js.map +0 -1
- package/dist/modules/insights/whole-seconds.d.ts +0 -1
- package/dist/modules/insights/whole-seconds.js +0 -7
- package/dist/modules/insights/whole-seconds.js.map +0 -1
- package/dist/modules/instance-reporting/database/entities/instance-monitoring-report.js.map +0 -1
- package/dist/modules/instance-reporting/database/repositories/instance-monitoring-report.repository.js.map +0 -1
- package/dist/modules/instance-reporting/instance-reporting-scheduler.service.js.map +0 -1
- package/dist/modules/instance-reporting/instance-reporting-settings.service.js.map +0 -1
- package/dist/modules/instance-reporting/instance-reporting.config.js.map +0 -1
- package/dist/modules/instance-reporting/instance-reporting.constants.js.map +0 -1
- package/dist/modules/instance-reporting/instance-reporting.module.js +0 -26
- package/dist/modules/instance-reporting/instance-reporting.module.js.map +0 -1
- package/dist/modules/instance-reporting/instance-reporting.service.js.map +0 -1
- package/dist/modules/type-availability-policies/dto/create-policy-document.dto.d.ts +0 -80
- package/dist/modules/type-availability-policies/dto/create-policy-document.dto.js +0 -11
- package/dist/modules/type-availability-policies/dto/create-policy-document.dto.js.map +0 -1
- package/dist/modules/type-availability-policies/dto/policy-rule.schema.d.ts +0 -108
- package/dist/modules/type-availability-policies/dto/policy-rule.schema.js +0 -30
- package/dist/modules/type-availability-policies/dto/policy-rule.schema.js.map +0 -1
- package/dist/modules/type-availability-policies/dto/policy-selector.schema.d.ts +0 -20
- package/dist/modules/type-availability-policies/dto/policy-selector.schema.js +0 -9
- package/dist/modules/type-availability-policies/dto/policy-selector.schema.js.map +0 -1
- package/dist/modules/type-availability-policies/dto/put-instance-policy.dto.d.ts +0 -85
- package/dist/modules/type-availability-policies/dto/put-instance-policy.dto.js +0 -14
- package/dist/modules/type-availability-policies/dto/put-instance-policy.dto.js.map +0 -1
- package/dist/modules/type-availability-policies/dto/replace-attachments.dto.d.ts +0 -97
- package/dist/modules/type-availability-policies/dto/replace-attachments.dto.js +0 -36
- package/dist/modules/type-availability-policies/dto/replace-attachments.dto.js.map +0 -1
- package/dist/modules/type-availability-policies/dto/update-policy-document.dto.d.ts +0 -83
- package/dist/modules/type-availability-policies/dto/update-policy-document.dto.js +0 -13
- package/dist/modules/type-availability-policies/dto/update-policy-document.dto.js.map +0 -1
- package/dist/public-api/v1/controllers/git-connections.public.controller.d.ts +0 -21
- package/dist/public-api/v1/controllers/git-connections.public.controller.js +0 -302
- package/dist/public-api/v1/controllers/git-connections.public.controller.js.map +0 -1
- package/dist/public-api/v1/handlers/credentials/credentials.mapper.d.ts +0 -6
- package/dist/public-api/v1/handlers/credentials/credentials.mapper.js +0 -19
- package/dist/public-api/v1/handlers/credentials/credentials.mapper.js.map +0 -1
- package/dist/public-api/v1/handlers/credentials/credentials.middleware.d.ts +0 -6
- package/dist/public-api/v1/handlers/credentials/credentials.middleware.js +0 -91
- package/dist/public-api/v1/handlers/credentials/credentials.middleware.js.map +0 -1
- package/dist/public-api/v1/handlers/projects/projects.handler.d.ts +0 -31
- package/dist/public-api/v1/handlers/projects/projects.handler.js +0 -165
- package/dist/public-api/v1/handlers/projects/projects.handler.js.map +0 -1
- package/dist/public-api/v1/handlers/source-control/source-control.handler.d.ts +0 -7
- package/dist/public-api/v1/handlers/source-control/source-control.handler.js +0 -46
- package/dist/public-api/v1/handlers/source-control/source-control.handler.js.map +0 -1
- package/dist/public-api/v1/handlers/variables/variables.handler.d.ts +0 -15
- package/dist/public-api/v1/handlers/variables/variables.handler.js +0 -56
- package/dist/public-api/v1/handlers/variables/variables.handler.js.map +0 -1
- /package/dist/modules/{instance-reporting → instance-reporting.ee}/database/entities/instance-monitoring-report.d.ts +0 -0
- /package/dist/modules/{instance-reporting → instance-reporting.ee}/database/entities/instance-monitoring-report.js +0 -0
- /package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting-settings.service.d.ts +0 -0
- /package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting-settings.service.js +0 -0
- /package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting.config.d.ts +0 -0
- /package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting.config.js +0 -0
- /package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting.constants.d.ts +0 -0
- /package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting.constants.js +0 -0
|
@@ -15,6 +15,7 @@ exports.isAttachmentRejectedByProviderError = isAttachmentRejectedByProviderErro
|
|
|
15
15
|
exports.getUserFacingErrorMessage = getUserFacingErrorMessage;
|
|
16
16
|
exports.isMaskedStreamFailure = isMaskedStreamFailure;
|
|
17
17
|
const agents_1 = require("@n8n/agents");
|
|
18
|
+
const sandbox_1 = require("@n8n/agents/sandbox");
|
|
18
19
|
const api_types_1 = require("@n8n/api-types");
|
|
19
20
|
const backend_common_1 = require("@n8n/backend-common");
|
|
20
21
|
const backend_network_1 = require("@n8n/backend-network");
|
|
@@ -32,12 +33,15 @@ const n8n_core_1 = require("n8n-core");
|
|
|
32
33
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
33
34
|
const nanoid_1 = require("nanoid");
|
|
34
35
|
const constants_1 = require("../../constants");
|
|
36
|
+
const bad_request_error_1 = require("../../errors/response-errors/bad-request.error");
|
|
35
37
|
const forbidden_error_1 = require("../../errors/response-errors/forbidden.error");
|
|
36
38
|
const event_service_1 = require("../../events/event.service");
|
|
37
39
|
const instance_ai_builder_delegate_adapter_1 = require("../../modules/agents/instance-ai-builder-delegate.adapter");
|
|
40
|
+
const model_stream_stall_options_1 = require("../../modules/agents/model-stream-stall-options");
|
|
38
41
|
const check_access_1 = require("../../permissions.ee/check-access");
|
|
39
42
|
const publisher_service_1 = require("../../scaling/pubsub/publisher.service");
|
|
40
43
|
const push_1 = require("../../push");
|
|
44
|
+
const ai_preference_service_1 = require("../../services/ai-preference.service");
|
|
41
45
|
const ai_service_1 = require("../../services/ai.service");
|
|
42
46
|
const instance_write_access_service_1 = require("../../services/instance-write-access.service");
|
|
43
47
|
const proxy_token_manager_1 = require("../../services/proxy-token-manager");
|
|
@@ -45,6 +49,7 @@ const url_service_1 = require("../../services/url.service");
|
|
|
45
49
|
const telemetry_2 = require("../../telemetry");
|
|
46
50
|
const utils_1 = require("../../utils");
|
|
47
51
|
const agent_preview_handoff_1 = require("./agent-preview-handoff");
|
|
52
|
+
const instance_context_service_1 = require("./instance-context.service");
|
|
48
53
|
const composite_local_mcp_server_1 = require("./browser/composite-local-mcp-server");
|
|
49
54
|
const instance_ai_browser_session_service_1 = require("./browser/instance-ai-browser-session.service");
|
|
50
55
|
const canvas_node_context_flag_gate_1 = require("./canvas-node-context-flag-gate");
|
|
@@ -74,7 +79,7 @@ const planned_task_action_runner_1 = require("./planned-task-action-runner");
|
|
|
74
79
|
const instance_ai_event_log_repository_1 = require("./repositories/instance-ai-event-log.repository");
|
|
75
80
|
const instance_ai_pending_confirmation_repository_1 = require("./repositories/instance-ai-pending-confirmation.repository");
|
|
76
81
|
const instance_ai_thread_grant_repository_1 = require("./repositories/instance-ai-thread-grant.repository");
|
|
77
|
-
const
|
|
82
|
+
const sandbox_2 = require("./sandbox");
|
|
78
83
|
const db_iteration_log_storage_1 = require("./storage/db-iteration-log-storage");
|
|
79
84
|
const typeorm_agent_checkpoint_store_1 = require("./storage/typeorm-agent-checkpoint-store");
|
|
80
85
|
const typeorm_agent_memory_1 = require("./storage/typeorm-agent-memory");
|
|
@@ -200,7 +205,6 @@ function isTelemetryConfigurableAgent(agent) {
|
|
|
200
205
|
agent !== null &&
|
|
201
206
|
typeof Reflect.get(agent, 'telemetry') === 'function');
|
|
202
207
|
}
|
|
203
|
-
const INSTANCE_AI_CHECKPOINT_PRUNE_RETRY_MS = 30 * 1000;
|
|
204
208
|
const WORKFLOW_SETUP_ROUTING_CLAIM_TTL_MS = 15 * 60 * 1000;
|
|
205
209
|
const CONFIRMATION_EXPIRED_MESSAGE = 'This confirmation has expired. Send a new message to continue.';
|
|
206
210
|
const RESUME_REJECTED_MESSAGE = 'I could not apply that confirmation. Send a new message to continue.';
|
|
@@ -241,7 +245,7 @@ function isAttachmentRejectedByProviderError(error) {
|
|
|
241
245
|
const haystack = [(0, get_error_message_1.getErrorMessage)(error), ...collectErrorText(error)].join(' ').toLowerCase();
|
|
242
246
|
return ATTACHMENT_SUBJECT_PATTERN.test(haystack) && ATTACHMENT_REFUSAL_PATTERN.test(haystack);
|
|
243
247
|
}
|
|
244
|
-
exports.QUOTA_EXHAUSTED_USER_MESSAGE = "You've run out of AI credits. Upgrade your plan to continue using the
|
|
248
|
+
exports.QUOTA_EXHAUSTED_USER_MESSAGE = "You've run out of AI credits. Upgrade your plan to continue using the n8n Assistant.";
|
|
245
249
|
const OPERATIONAL_ERROR_USER_MESSAGE = 'I hit an operational error before I could finish that response. Please try again.';
|
|
246
250
|
const GENERIC_ERROR_USER_MESSAGE = 'Something went wrong before I could finish that response. Please try again.';
|
|
247
251
|
function getUserFacingErrorCode(error) {
|
|
@@ -344,7 +348,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
344
348
|
}
|
|
345
349
|
return this._mcpClientManager;
|
|
346
350
|
}
|
|
347
|
-
constructor(logger, globalConfig, instanceSettings, adapterService, eventBus, eventLog, interruptedRunSweeper, settingsService, gatewayService, browserSessionService, memoryService, agentMemory, checkpointStore, aiService, threadGrantRepo, pendingConfirmationRepo, urlService, eventLogRepository, dbIterationLogStorage, instanceWriteAccess, telemetry, mcpRegistryService, userRepository, temporaryWorkflowService, errorReporter, ssrfProtectionConfig, ssrfProtectionService, eventService, evalCredentialAllowlists, runProbe, modelService, creditService, publisher, instanceAiErrorReporter, canvasNodeContextFlagGate, push, conversationHistoryService) {
|
|
351
|
+
constructor(logger, globalConfig, instanceSettings, adapterService, eventBus, eventLog, interruptedRunSweeper, settingsService, gatewayService, browserSessionService, memoryService, agentMemory, checkpointStore, aiService, threadGrantRepo, pendingConfirmationRepo, urlService, eventLogRepository, dbIterationLogStorage, instanceWriteAccess, telemetry, mcpRegistryService, userRepository, temporaryWorkflowService, errorReporter, ssrfProtectionConfig, ssrfProtectionService, eventService, evalCredentialAllowlists, runProbe, modelService, creditService, publisher, instanceAiErrorReporter, canvasNodeContextFlagGate, push, conversationHistoryService, instanceContext, aiPreferenceService) {
|
|
348
352
|
this.instanceSettings = instanceSettings;
|
|
349
353
|
this.adapterService = adapterService;
|
|
350
354
|
this.eventBus = eventBus;
|
|
@@ -377,6 +381,8 @@ let InstanceAiService = class InstanceAiService {
|
|
|
377
381
|
this.canvasNodeContextFlagGate = canvasNodeContextFlagGate;
|
|
378
382
|
this.push = push;
|
|
379
383
|
this.conversationHistoryService = conversationHistoryService;
|
|
384
|
+
this.instanceContext = instanceContext;
|
|
385
|
+
this.aiPreferenceService = aiPreferenceService;
|
|
380
386
|
this.runState = new instance_ai_1.RunStateRegistry((user) => user.id);
|
|
381
387
|
this.memoryTaskRegistry = new instance_ai_1.MemoryTaskRegistry();
|
|
382
388
|
this.domainAccessTrackersByThread = new Map();
|
|
@@ -385,16 +391,15 @@ let InstanceAiService = class InstanceAiService {
|
|
|
385
391
|
this.planRequestsByThread = new Map();
|
|
386
392
|
this.schedulerLocks = new Map();
|
|
387
393
|
this.failedInternalFollowUpStreaks = new Map();
|
|
388
|
-
this.pendingCheckpointReentries = new Map();
|
|
389
394
|
this.runDebugBuffer = new instance_ai_1.RunDebugBuffer();
|
|
390
|
-
this.checkpointPruningStopped = true;
|
|
391
395
|
this.inFlightExecutions = new Set();
|
|
392
396
|
this.preserveHitlOnShutdown = new Set();
|
|
393
397
|
this.logger = logger.scoped('instance-ai');
|
|
394
398
|
runProbe.registerActiveRunCountProvider(() => this.runState.activeRunCount());
|
|
395
|
-
this.workflowObligations = new workflow_verification_obligation_service_1.WorkflowVerificationObligationService(this.agentMemory);
|
|
399
|
+
this.workflowObligations = new workflow_verification_obligation_service_1.WorkflowVerificationObligationService(this.agentMemory, () => this.settingsService.isInstanceAiSetupPanelEnabled());
|
|
396
400
|
this.taskProjector = new workflow_verification_task_projector_1.WorkflowVerificationTaskProjector(this.agentMemory, this.eventBus, this.logger, this.workflowObligations);
|
|
397
401
|
this.instanceAiConfig = globalConfig.instanceAi;
|
|
402
|
+
this.aiConfig = globalConfig.ai;
|
|
398
403
|
this.backgroundTasks = new instance_ai_1.BackgroundTaskManager(MAX_CONCURRENT_BACKGROUND_TASKS_PER_THREAD, this.instanceAiConfig.maxConcurrentSubAgents);
|
|
399
404
|
this.suspendedThreads = new suspended_thread_persistence_service_1.SuspendedThreadPersistenceService({
|
|
400
405
|
logger: this.logger,
|
|
@@ -437,7 +442,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
437
442
|
eventLog: this.eventLogRepository,
|
|
438
443
|
aiService: this.aiService,
|
|
439
444
|
});
|
|
440
|
-
this.sandboxService = new
|
|
445
|
+
this.sandboxService = new sandbox_2.InstanceAiSandboxService({
|
|
441
446
|
config: this.instanceAiConfig,
|
|
442
447
|
logger: this.logger,
|
|
443
448
|
errorReporter: this.errorReporter,
|
|
@@ -445,6 +450,13 @@ let InstanceAiService = class InstanceAiService {
|
|
|
445
450
|
backgroundTasks: this.backgroundTasks,
|
|
446
451
|
settingsService: this.settingsService,
|
|
447
452
|
aiService: this.aiService,
|
|
453
|
+
resolveTracingConfig: async (threadId, userId) => {
|
|
454
|
+
const ownerId = userId ?? (await this.agentMemory.getThread(threadId))?.resourceId;
|
|
455
|
+
if (!ownerId)
|
|
456
|
+
return { userId: 'system' };
|
|
457
|
+
const { tracingProxyConfig } = await this.createProxyRunConfig({ id: ownerId });
|
|
458
|
+
return { userId: ownerId, proxyConfig: tracingProxyConfig };
|
|
459
|
+
},
|
|
448
460
|
});
|
|
449
461
|
this.terminalOutcome = new instance_ai_terminal_outcome_service_1.InstanceAiTerminalOutcomeService({
|
|
450
462
|
eventBus: {
|
|
@@ -459,8 +471,10 @@ let InstanceAiService = class InstanceAiService {
|
|
|
459
471
|
runState: this.runState,
|
|
460
472
|
suspendedThreads: this.suspendedThreads,
|
|
461
473
|
tracing: this.tracing,
|
|
462
|
-
publishRunFinish: (threadId, runId, status, reason) => {
|
|
463
|
-
this.publishRunFinish(threadId, runId, status, reason
|
|
474
|
+
publishRunFinish: (threadId, runId, status, reason, promptVersion) => {
|
|
475
|
+
this.publishRunFinish(threadId, runId, status, reason, undefined, undefined, {
|
|
476
|
+
promptVersion,
|
|
477
|
+
});
|
|
464
478
|
},
|
|
465
479
|
});
|
|
466
480
|
this.defaultTimeZone = globalConfig.generic.timezone;
|
|
@@ -483,8 +497,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
483
497
|
});
|
|
484
498
|
});
|
|
485
499
|
this.liveness.start();
|
|
486
|
-
if (this.instanceSettings.isLeader)
|
|
487
|
-
this.startCheckpointPruning();
|
|
488
500
|
}
|
|
489
501
|
async createProxyRunConfig(user) {
|
|
490
502
|
if (!this.aiService.isProxyEnabled())
|
|
@@ -607,7 +619,12 @@ let InstanceAiService = class InstanceAiService {
|
|
|
607
619
|
getThreadStatus(threadId) {
|
|
608
620
|
const status = this.runState.getThreadStatus(threadId, this.backgroundTasks.getTaskSnapshots(threadId));
|
|
609
621
|
const memoryTasks = this.memoryTaskRegistry.getTasks(threadId);
|
|
610
|
-
|
|
622
|
+
const selectedPrompt = this.runState.getPromptConfiguration(threadId);
|
|
623
|
+
return {
|
|
624
|
+
...status,
|
|
625
|
+
memoryTasks,
|
|
626
|
+
...(selectedPrompt ? { promptConfiguration: selectedPrompt } : {}),
|
|
627
|
+
};
|
|
611
628
|
}
|
|
612
629
|
memoryTaskObserverFor(threadId, tracing) {
|
|
613
630
|
return (event) => {
|
|
@@ -658,10 +675,15 @@ let InstanceAiService = class InstanceAiService {
|
|
|
658
675
|
maxIterations: instance_ai_1.MAX_STEPS.ORCHESTRATOR,
|
|
659
676
|
abortSignal: signal,
|
|
660
677
|
recoverUsageOnAbort: true,
|
|
678
|
+
...(0, model_stream_stall_options_1.modelStreamStallOptions)(this.aiConfig),
|
|
661
679
|
persistence: {
|
|
662
680
|
resourceId: user.id,
|
|
663
681
|
threadId,
|
|
664
682
|
hostRunId: runId,
|
|
683
|
+
hostMetadata: {
|
|
684
|
+
buildMode: this.runState.getBuildMode(threadId) ?? null,
|
|
685
|
+
promptVersion: this.runState.getPromptVersion(threadId) ?? null,
|
|
686
|
+
},
|
|
665
687
|
},
|
|
666
688
|
providerOptions: {
|
|
667
689
|
anthropic: { cacheControl: { type: 'ephemeral' } },
|
|
@@ -680,7 +702,16 @@ let InstanceAiService = class InstanceAiService {
|
|
|
680
702
|
toolCallId,
|
|
681
703
|
abortSignal: signal,
|
|
682
704
|
recoverUsageOnAbort: true,
|
|
683
|
-
|
|
705
|
+
...(0, model_stream_stall_options_1.modelStreamStallOptions)(this.aiConfig),
|
|
706
|
+
persistence: {
|
|
707
|
+
resourceId: user.id,
|
|
708
|
+
threadId,
|
|
709
|
+
hostRunId: runId,
|
|
710
|
+
hostMetadata: {
|
|
711
|
+
buildMode: this.runState.getBuildMode(threadId) ?? null,
|
|
712
|
+
promptVersion: this.runState.getPromptVersion(threadId) ?? null,
|
|
713
|
+
},
|
|
714
|
+
},
|
|
684
715
|
providerOptions: {
|
|
685
716
|
anthropic: { cacheControl: { type: 'ephemeral' } },
|
|
686
717
|
},
|
|
@@ -735,7 +766,11 @@ let InstanceAiService = class InstanceAiService {
|
|
|
735
766
|
}
|
|
736
767
|
}
|
|
737
768
|
}
|
|
738
|
-
startRun(user, threadId, message, attachments, context, timeZone, pushRef) {
|
|
769
|
+
startRun(user, threadId, message, attachments, context, timeZone, pushRef, mode, promptVersion) {
|
|
770
|
+
if (promptVersion !== undefined &&
|
|
771
|
+
(0, instance_ai_1.resolvePromptProfile)({ version: promptVersion }).fallbackFrom) {
|
|
772
|
+
throw new bad_request_error_1.BadRequestError(`Unknown Instance AI prompt version "${promptVersion}"`);
|
|
773
|
+
}
|
|
739
774
|
this.assertRunAdmissible(user);
|
|
740
775
|
this.liveness.clearThreadState(threadId);
|
|
741
776
|
const { runId, abortController, messageGroupId } = this.runState.startRun({
|
|
@@ -745,6 +780,8 @@ let InstanceAiService = class InstanceAiService {
|
|
|
745
780
|
if (timeZone) {
|
|
746
781
|
this.runState.setTimeZone(threadId, timeZone);
|
|
747
782
|
}
|
|
783
|
+
this.runState.setBuildMode(threadId, mode);
|
|
784
|
+
this.runState.setPromptVersion(threadId, promptVersion);
|
|
748
785
|
if (pushRef !== undefined) {
|
|
749
786
|
this.threadPushRef.set(threadId, pushRef);
|
|
750
787
|
}
|
|
@@ -831,7 +868,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
831
868
|
error,
|
|
832
869
|
}));
|
|
833
870
|
}
|
|
834
|
-
async applyTaskControlLocally({ threadId, taskId, action, correction, }) {
|
|
871
|
+
async applyTaskControlLocally({ threadId, taskId, action, correction, userId, }) {
|
|
835
872
|
switch (action) {
|
|
836
873
|
case 'correct':
|
|
837
874
|
if (!taskId || correction === undefined)
|
|
@@ -850,7 +887,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
850
887
|
this.cancelRun(threadId);
|
|
851
888
|
return false;
|
|
852
889
|
case 'clear-thread':
|
|
853
|
-
await this.clearThreadState(threadId);
|
|
890
|
+
await this.clearThreadState(threadId, userId);
|
|
854
891
|
return false;
|
|
855
892
|
}
|
|
856
893
|
}
|
|
@@ -873,8 +910,12 @@ let InstanceAiService = class InstanceAiService {
|
|
|
873
910
|
await this.interruptedRunSweeper.cancelUnfinishedRuns(threadId);
|
|
874
911
|
}
|
|
875
912
|
}
|
|
876
|
-
async routeClearThreadState(threadId) {
|
|
877
|
-
await this.routeTaskControl({
|
|
913
|
+
async routeClearThreadState(threadId, userId) {
|
|
914
|
+
await this.routeTaskControl({
|
|
915
|
+
threadId,
|
|
916
|
+
action: 'clear-thread',
|
|
917
|
+
...(userId ? { userId } : {}),
|
|
918
|
+
});
|
|
878
919
|
}
|
|
879
920
|
async handleRelayTaskControl(payload) {
|
|
880
921
|
try {
|
|
@@ -1018,7 +1059,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1018
1059
|
clearTraceEvents(slug) {
|
|
1019
1060
|
this.tracing.clearTraceEvents(slug);
|
|
1020
1061
|
}
|
|
1021
|
-
async clearThreadState(threadId) {
|
|
1062
|
+
async clearThreadState(threadId, userId) {
|
|
1022
1063
|
this.liveness.clearThreadState(threadId);
|
|
1023
1064
|
const { active, suspended } = this.runState.clearThread(threadId);
|
|
1024
1065
|
if (active) {
|
|
@@ -1053,7 +1094,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1053
1094
|
this.memoryTaskRegistry.clearThread(threadId);
|
|
1054
1095
|
this.tracing.deleteTraceContextsForThread(threadId);
|
|
1055
1096
|
await this.deleteAgentBuilderSessions(threadId);
|
|
1056
|
-
await this.sandboxService.destroySandbox(threadId);
|
|
1097
|
+
await this.sandboxService.destroySandbox(threadId, 'thread_cleanup', userId);
|
|
1057
1098
|
await this.temporaryWorkflowService.reapForThreadCleanup(threadId);
|
|
1058
1099
|
await this.suspendedThreads.dropPendingConfirmationsForThread(threadId);
|
|
1059
1100
|
this.eventBus.clearThread(threadId);
|
|
@@ -1072,7 +1113,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1072
1113
|
}
|
|
1073
1114
|
}
|
|
1074
1115
|
async shutdown() {
|
|
1075
|
-
this.stopCheckpointPruning();
|
|
1076
1116
|
this.liveness.shutdown();
|
|
1077
1117
|
const { activeRuns, suspendedRuns, pendingThreadIds } = this.runState.shutdown();
|
|
1078
1118
|
const threadsWithPendingHitl = new Set(pendingThreadIds);
|
|
@@ -1086,7 +1126,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1086
1126
|
run.abortController.abort();
|
|
1087
1127
|
continue;
|
|
1088
1128
|
}
|
|
1089
|
-
this.publishRunFinish(run.threadId, run.runId, 'cancelled', 'service_shutdown');
|
|
1129
|
+
this.publishRunFinish(run.threadId, run.runId, 'cancelled', 'service_shutdown', undefined, undefined, { promptVersion: run.promptVersion });
|
|
1090
1130
|
await this.tracing.finalizeRunTracing(run.runId, run.tracing, {
|
|
1091
1131
|
status: 'cancelled',
|
|
1092
1132
|
reason: 'service_shutdown',
|
|
@@ -1098,6 +1138,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1098
1138
|
status: 'cancelled',
|
|
1099
1139
|
reason: 'service_shutdown',
|
|
1100
1140
|
});
|
|
1141
|
+
this.preserveHitlOnShutdown.add(run.runId);
|
|
1101
1142
|
run.abortController.abort();
|
|
1102
1143
|
}
|
|
1103
1144
|
for (const task of this.backgroundTasks.cancelAll()) {
|
|
@@ -1125,25 +1166,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1125
1166
|
await (0, instance_ai_1.shutdownProductTelemetryProviders)();
|
|
1126
1167
|
this.logger.debug('Instance AI service shut down');
|
|
1127
1168
|
}
|
|
1128
|
-
startCheckpointPruning() {
|
|
1129
|
-
if (this.checkpointPruneTimer || this.instanceAiConfig.pruneInterval <= 0)
|
|
1130
|
-
return;
|
|
1131
|
-
this.checkpointPruningStopped = false;
|
|
1132
|
-
this.scheduleCheckpointPrune(0);
|
|
1133
|
-
}
|
|
1134
|
-
stopCheckpointPruning() {
|
|
1135
|
-
this.checkpointPruningStopped = true;
|
|
1136
|
-
clearTimeout(this.checkpointPruneTimer);
|
|
1137
|
-
this.checkpointPruneTimer = undefined;
|
|
1138
|
-
}
|
|
1139
|
-
scheduleCheckpointPrune(delayMs = this.instanceAiConfig.pruneInterval) {
|
|
1140
|
-
if (this.checkpointPruningStopped)
|
|
1141
|
-
return;
|
|
1142
|
-
this.checkpointPruneTimer = setTimeout(() => {
|
|
1143
|
-
void this.runScheduledPrune();
|
|
1144
|
-
}, delayMs);
|
|
1145
|
-
this.checkpointPruneTimer.unref();
|
|
1146
|
-
}
|
|
1147
1169
|
trackInFlightExecution(promise) {
|
|
1148
1170
|
const tracked = promise.finally(() => {
|
|
1149
1171
|
this.inFlightExecutions.delete(tracked);
|
|
@@ -1174,26 +1196,23 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1174
1196
|
});
|
|
1175
1197
|
}
|
|
1176
1198
|
}
|
|
1177
|
-
async
|
|
1199
|
+
async pruneExpiredData(now = Date.now(), signal) {
|
|
1178
1200
|
const olderThan = new Date(now - this.instanceAiConfig.snapshotRetention);
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1201
|
+
const count = await this.checkpointStore.markExpiredOlderThan(olderThan);
|
|
1202
|
+
if (count > 0) {
|
|
1203
|
+
this.logger.info('Expired stale Instance AI checkpoints', { count });
|
|
1204
|
+
}
|
|
1205
|
+
else {
|
|
1206
|
+
this.logger.debug('No stale Instance AI checkpoints to expire');
|
|
1207
|
+
}
|
|
1208
|
+
if (!signal?.aborted)
|
|
1187
1209
|
await this.hardDeleteExpiredCheckpoints(now);
|
|
1210
|
+
if (!signal?.aborted)
|
|
1188
1211
|
await this.suspendedThreads.pruneStalePendingConfirmations(now);
|
|
1189
|
-
|
|
1190
|
-
this.
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
this.logger.warn('Failed to expire stale Instance AI checkpoints', {
|
|
1194
|
-
error: (0, get_error_message_1.getErrorMessage)(error),
|
|
1195
|
-
});
|
|
1196
|
-
this.scheduleCheckpointPrune(INSTANCE_AI_CHECKPOINT_PRUNE_RETRY_MS);
|
|
1212
|
+
if (!signal?.aborted)
|
|
1213
|
+
await this.pruneExpiredThreads(signal);
|
|
1214
|
+
if (signal?.aborted) {
|
|
1215
|
+
this.logger.debug('Stopped the Instance AI prune pass early because the run was aborted');
|
|
1197
1216
|
}
|
|
1198
1217
|
}
|
|
1199
1218
|
async hardDeleteExpiredCheckpoints(now) {
|
|
@@ -1213,9 +1232,9 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1213
1232
|
});
|
|
1214
1233
|
}
|
|
1215
1234
|
}
|
|
1216
|
-
async pruneExpiredThreads() {
|
|
1235
|
+
async pruneExpiredThreads(signal) {
|
|
1217
1236
|
try {
|
|
1218
|
-
await this.memoryService.cleanupExpiredThreads(async (threadId) => await this.clearThreadState(threadId));
|
|
1237
|
+
await this.memoryService.cleanupExpiredThreads(async (threadId) => await this.clearThreadState(threadId), signal);
|
|
1219
1238
|
}
|
|
1220
1239
|
catch (error) {
|
|
1221
1240
|
this.logger.warn('Failed to clean up expired Instance AI conversation threads', {
|
|
@@ -1228,6 +1247,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1228
1247
|
observationalMemory: {
|
|
1229
1248
|
observerThresholdTokens: this.instanceAiConfig.observerMessageTokens,
|
|
1230
1249
|
reflectorThresholdTokens: this.instanceAiConfig.reflectorObservationTokens,
|
|
1250
|
+
midRunObservation: this.instanceAiConfig.midRunObservation,
|
|
1231
1251
|
onTaskUsage: async (report) => {
|
|
1232
1252
|
try {
|
|
1233
1253
|
const items = (0, instance_ai_1.tokenUsageToBuilderUsageItems)(report.model, report.usage);
|
|
@@ -1264,7 +1284,23 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1264
1284
|
await workflowTasks.updateBuildOutcome(workItemId, update);
|
|
1265
1285
|
await sync();
|
|
1266
1286
|
},
|
|
1287
|
+
beginVerification: async (outcome, state, verificationRunId) => {
|
|
1288
|
+
const resumed = await workflowTasks.beginVerification(outcome, state, verificationRunId);
|
|
1289
|
+
if (resumed)
|
|
1290
|
+
await sync();
|
|
1291
|
+
return resumed;
|
|
1292
|
+
},
|
|
1267
1293
|
getBuildOutcome: async (workItemId) => await workflowTasks.getBuildOutcome(workItemId),
|
|
1294
|
+
startVerification: async (workItemId, triggerNodeName) => {
|
|
1295
|
+
const previousProgress = await workflowTasks.startVerification(workItemId, triggerNodeName);
|
|
1296
|
+
await sync();
|
|
1297
|
+
return previousProgress;
|
|
1298
|
+
},
|
|
1299
|
+
recordVerification: async (workItemId, verification, previousProgress) => {
|
|
1300
|
+
const claim = await workflowTasks.recordVerification(workItemId, verification, previousProgress);
|
|
1301
|
+
await sync();
|
|
1302
|
+
return claim;
|
|
1303
|
+
},
|
|
1268
1304
|
getLatestBuildOutcomeForWorkflow: async (workflowId) => await workflowTasks.getLatestBuildOutcomeForWorkflow(workflowId),
|
|
1269
1305
|
getWorkflowLoopState: async (workItemId) => await workflowTasks.getWorkflowLoopState(workItemId),
|
|
1270
1306
|
};
|
|
@@ -1413,15 +1449,22 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1413
1449
|
const localGatewayDisabledForUser = await this.settingsService.isLocalGatewayDisabledForUser(user.id);
|
|
1414
1450
|
const userGateway = this.gatewayService.findGateway(user.id);
|
|
1415
1451
|
await this.creditService.ensureQuotaLockApplied(user);
|
|
1416
|
-
const { searchProxyConfig,
|
|
1452
|
+
const { searchProxyConfig, tokenManager, proxyBaseUrl } = proxyRunConfig ?? (await this.createProxyRunConfig(user));
|
|
1417
1453
|
const proxyContext = { runId, threadId };
|
|
1418
1454
|
const modelId = proxyBaseUrl && tokenManager
|
|
1419
1455
|
? await this.modelService.resolveProxyModel(user, proxyBaseUrl, tokenManager, proxyContext)
|
|
1420
1456
|
: await this.modelService.resolveAgentModelConfig(user, proxyContext);
|
|
1421
|
-
const { configEvalsEnabled, mcpConnectionsEnabled, conversationHistoryEnabled, nodeUsageEnabled, folderExplorationEnabled, } = await this.adapterService.resolveExperimentGates(user);
|
|
1457
|
+
const { configEvalsEnabled, mcpConnectionsEnabled, conversationHistoryEnabled, progressiveBuildingEnabled, nodeUsageEnabled, folderExplorationEnabled, aiPreferencesEnabled, } = await this.adapterService.resolveExperimentGates(user);
|
|
1422
1458
|
const conversationHistory = conversationHistoryEnabled
|
|
1423
1459
|
? this.conversationHistoryService.forContext(user.id, boundProjectId, threadId)
|
|
1424
1460
|
: undefined;
|
|
1461
|
+
const selectedPrompt = (0, instance_ai_1.resolvePromptProfile)({
|
|
1462
|
+
version: this.runState.getPromptVersion(threadId),
|
|
1463
|
+
mode: this.runState.getBuildMode(threadId) ??
|
|
1464
|
+
(progressiveBuildingEnabled ? 'progressive' : 'default'),
|
|
1465
|
+
});
|
|
1466
|
+
const buildMode = selectedPrompt.profile.mode;
|
|
1467
|
+
this.runState.setBuildMode(threadId, buildMode);
|
|
1425
1468
|
const context = this.adapterService.createContext(user, {
|
|
1426
1469
|
searchProxyConfig,
|
|
1427
1470
|
pushRef,
|
|
@@ -1457,7 +1500,23 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1457
1500
|
threadId,
|
|
1458
1501
|
runId,
|
|
1459
1502
|
agentId: (0, instance_ai_1.orchestratorAgentId)(runId),
|
|
1503
|
+
initialSnapshots: await this.eventLog.getSetupItemsSnapshots(threadId).catch((error) => {
|
|
1504
|
+
this.logger.warn('Failed to read setup panel snapshots', {
|
|
1505
|
+
threadId,
|
|
1506
|
+
error: (0, get_error_message_1.getErrorMessage)(error),
|
|
1507
|
+
});
|
|
1508
|
+
return [];
|
|
1509
|
+
}),
|
|
1510
|
+
readPersistedSnapshot: async (workflowId) => {
|
|
1511
|
+
const snapshots = await this.eventLog.getSetupItemsSnapshots(threadId);
|
|
1512
|
+
return snapshots.find((snapshot) => snapshot.workflowId === workflowId)?.items;
|
|
1513
|
+
},
|
|
1460
1514
|
});
|
|
1515
|
+
context.markWorkflowSetupHandled = async (workflowId) => {
|
|
1516
|
+
await this.markWorkflowSetupHandled(threadId, workflowId, runId, {
|
|
1517
|
+
requirePersisted: true,
|
|
1518
|
+
});
|
|
1519
|
+
};
|
|
1461
1520
|
}
|
|
1462
1521
|
context.browserCredentialSetup = this.createBrowserCredentialSetupTracker(runId, user.id);
|
|
1463
1522
|
const sessionGrants = await this.loadThreadSessionGrants(threadId, user.id);
|
|
@@ -1524,10 +1583,17 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1524
1583
|
if (nodeDefDirs.length > 0) {
|
|
1525
1584
|
(0, workflow_sdk_1.setSchemaBaseDirs)(nodeDefDirs);
|
|
1526
1585
|
}
|
|
1527
|
-
const flagDisabledSkillIds = (0, instance_ai_1.disabledInstanceAiSkillIds)({
|
|
1586
|
+
const flagDisabledSkillIds = (0, instance_ai_1.disabledInstanceAiSkillIds)({
|
|
1587
|
+
configEvalsEnabled,
|
|
1588
|
+
instanceContextEnabled: this.instanceAiConfig.instanceContextEnabled,
|
|
1589
|
+
});
|
|
1590
|
+
const selectedSkills = await (0, instance_ai_1.loadInstanceAiPromptSkills)(selectedPrompt.profile);
|
|
1591
|
+
const selectedRuntimeSkills = selectedSkills.source;
|
|
1528
1592
|
const allRuntimeSkills = flagDisabledSkillIds.length > 0
|
|
1529
|
-
? (0, agents_1.filterRuntimeSkillSource)(
|
|
1530
|
-
:
|
|
1593
|
+
? (0, agents_1.filterRuntimeSkillSource)(selectedRuntimeSkills, flagDisabledSkillIds)
|
|
1594
|
+
: selectedRuntimeSkills;
|
|
1595
|
+
const promptMetadata = (0, instance_ai_1.describePromptProfile)(selectedPrompt, allRuntimeSkills);
|
|
1596
|
+
this.runState.setPromptConfiguration(threadId, promptMetadata);
|
|
1531
1597
|
let runtimeSkills = allRuntimeSkills;
|
|
1532
1598
|
let runtimeWorkspace;
|
|
1533
1599
|
let workspaceRoot;
|
|
@@ -1535,7 +1601,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1535
1601
|
if (sandboxStatus.workflowBuilderAvailable) {
|
|
1536
1602
|
const sandboxConfig = await this.instanceAiErrorReporter.withBoundary('instance-ai-sandbox-setup', { threadId, runId, userId: user.id, messageGroupId }, async () => await this.sandboxService.resolveSandboxConfig(user));
|
|
1537
1603
|
if (sandboxConfig.enabled) {
|
|
1538
|
-
workspaceRoot = (0,
|
|
1604
|
+
workspaceRoot = (0, sandbox_1.getPromptWorkspaceRoot)(sandboxConfig.provider);
|
|
1539
1605
|
let sandboxEntryPromise;
|
|
1540
1606
|
const getSandboxEntry = async () => {
|
|
1541
1607
|
sandboxEntryPromise ??= this.sandboxService
|
|
@@ -1552,7 +1618,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1552
1618
|
const scopeWorkspaceForAgent = async (workspace) => {
|
|
1553
1619
|
if (!workspace)
|
|
1554
1620
|
return undefined;
|
|
1555
|
-
const root = await (0,
|
|
1621
|
+
const root = await (0, sandbox_1.getWorkspaceRoot)(workspace);
|
|
1556
1622
|
return (0, agents_1.createScopedWorkspace)(workspace, root);
|
|
1557
1623
|
};
|
|
1558
1624
|
runtimeWorkspace = (0, instance_ai_1.createLazyRuntimeWorkspace)({
|
|
@@ -1579,16 +1645,18 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1579
1645
|
context.trackTelemetry = (eventName, properties) => {
|
|
1580
1646
|
this.telemetry.track(eventName, (0, telemetry_1.redactTelemetryProperties)(properties));
|
|
1581
1647
|
};
|
|
1582
|
-
const domainTools = (0, instance_ai_1.createAllTools)(context);
|
|
1583
1648
|
const orchestrationContext = {
|
|
1584
1649
|
threadId,
|
|
1585
1650
|
runId,
|
|
1586
1651
|
messageGroupId,
|
|
1587
1652
|
userId: user.id,
|
|
1588
1653
|
projectId: boundProjectId,
|
|
1654
|
+
promptConfiguration: promptMetadata,
|
|
1655
|
+
disabledToolNames: new Set(selectedSkills.disabledTools),
|
|
1656
|
+
setupPanelEnabled: (0, instance_ai_1.isSetupPanelEnabled)(context),
|
|
1589
1657
|
orchestratorAgentId: (0, instance_ai_1.orchestratorAgentId)(runId),
|
|
1590
1658
|
modelId,
|
|
1591
|
-
|
|
1659
|
+
modelStreamStallOptions: (0, model_stream_stall_options_1.modelStreamStallOptions)(this.aiConfig),
|
|
1592
1660
|
eventBus: this.eventBus,
|
|
1593
1661
|
logger: this.logger,
|
|
1594
1662
|
trackTelemetry: (eventName, properties) => {
|
|
@@ -1615,7 +1683,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1615
1683
|
});
|
|
1616
1684
|
}
|
|
1617
1685
|
},
|
|
1618
|
-
domainTools,
|
|
1619
1686
|
abortSignal,
|
|
1620
1687
|
taskStorage,
|
|
1621
1688
|
timeZone: this.defaultTimeZone,
|
|
@@ -1625,27 +1692,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1625
1692
|
oauth2CallbackUrl: this.oauth2CallbackUrl,
|
|
1626
1693
|
webhookBaseUrl: this.webhookBaseUrl,
|
|
1627
1694
|
formBaseUrl: this.formBaseUrl,
|
|
1628
|
-
waitForConfirmation: async (requestId) => {
|
|
1629
|
-
this.runState.touchActiveRun(threadId);
|
|
1630
|
-
return await new Promise((resolve) => {
|
|
1631
|
-
this.runState.registerPendingConfirmation(requestId, {
|
|
1632
|
-
resolve,
|
|
1633
|
-
threadId,
|
|
1634
|
-
userId: user.id,
|
|
1635
|
-
createdAt: Date.now(),
|
|
1636
|
-
});
|
|
1637
|
-
void this.suspendedThreads.persistPendingConfirmation({
|
|
1638
|
-
requestId,
|
|
1639
|
-
threadId,
|
|
1640
|
-
userId: user.id,
|
|
1641
|
-
runId,
|
|
1642
|
-
messageGroupId,
|
|
1643
|
-
kind: 'inline',
|
|
1644
|
-
});
|
|
1645
|
-
});
|
|
1646
|
-
},
|
|
1647
1695
|
cancelBackgroundTask: async (taskId) => this.cancelBackgroundTask(threadId, taskId),
|
|
1648
|
-
spawnBackgroundTask: (opts) => this.spawnBackgroundTask(runId, opts, messageGroupId),
|
|
1649
1696
|
touchRun: () => this.runState.touchActiveRun(threadId),
|
|
1650
1697
|
touchBackgroundTask: (taskId) => this.backgroundTasks.touchTask(threadId, taskId),
|
|
1651
1698
|
plannedTaskService,
|
|
@@ -1657,8 +1704,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1657
1704
|
workspaceRoot,
|
|
1658
1705
|
nodeDefinitionDirs: nodeDefDirs.length > 0 ? nodeDefDirs : undefined,
|
|
1659
1706
|
domainContext: context,
|
|
1660
|
-
tracingProxyConfig,
|
|
1661
|
-
memory,
|
|
1662
1707
|
};
|
|
1663
1708
|
return {
|
|
1664
1709
|
context,
|
|
@@ -1670,6 +1715,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1670
1715
|
modelId,
|
|
1671
1716
|
orchestrationContext,
|
|
1672
1717
|
conversationHistory,
|
|
1718
|
+
aiPreferencesEnabled,
|
|
1673
1719
|
};
|
|
1674
1720
|
}
|
|
1675
1721
|
getAgentExecutionService() {
|
|
@@ -1840,37 +1886,26 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1840
1886
|
return;
|
|
1841
1887
|
await this.schedulePlannedTasks(user, task.threadId);
|
|
1842
1888
|
}
|
|
1843
|
-
async
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1889
|
+
async buildWorkflowSetupStateBlock(context) {
|
|
1890
|
+
const emitter = context.setupItemsEmitter;
|
|
1891
|
+
if (!emitter)
|
|
1892
|
+
return '';
|
|
1893
|
+
const workflowIds = emitter.workflowIds().reverse();
|
|
1894
|
+
if (workflowIds.length === 0)
|
|
1895
|
+
return '';
|
|
1896
|
+
try {
|
|
1897
|
+
const note = (0, instance_ai_1.formatWorkflowSetupStateNote)(await (0, instance_ai_1.observeWorkflowSetupStates)(context, workflowIds));
|
|
1898
|
+
return note
|
|
1899
|
+
? `${internal_messages_1.WORKFLOW_SETUP_STATE_OPEN_TAG}\n${note}\n${internal_messages_1.WORKFLOW_SETUP_STATE_CLOSE_TAG}`
|
|
1900
|
+
: '';
|
|
1901
|
+
}
|
|
1902
|
+
catch (error) {
|
|
1903
|
+
this.logger.warn('Failed to build the workflow setup state block', {
|
|
1904
|
+
threadId: context.threadId,
|
|
1905
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1906
|
+
});
|
|
1907
|
+
return '';
|
|
1855
1908
|
}
|
|
1856
|
-
const outcome = (0, workflow_verification_obligation_service_1.parseWorkflowBuildOutcome)(task.outcome);
|
|
1857
|
-
const startedRunId = await this.startInternalFollowUpRun(user, task.threadId, this.buildWorkflowVerificationFollowUpMessage({
|
|
1858
|
-
obligation,
|
|
1859
|
-
outcome,
|
|
1860
|
-
sourceTask: {
|
|
1861
|
-
taskId: task.taskId,
|
|
1862
|
-
role: task.role,
|
|
1863
|
-
status: task.status,
|
|
1864
|
-
result: task.result,
|
|
1865
|
-
error: task.error,
|
|
1866
|
-
plannedTaskId: task.plannedTaskId,
|
|
1867
|
-
workItemId: task.workItemId,
|
|
1868
|
-
},
|
|
1869
|
-
}), task.messageGroupId, false, undefined, 'workflow_verification');
|
|
1870
|
-
this.trackWorkflowVerificationObligation(obligation, 'follow_up_start_attempted', {
|
|
1871
|
-
follow_up_started: startedRunId.length > 0,
|
|
1872
|
-
});
|
|
1873
|
-
return startedRunId.length > 0;
|
|
1874
1909
|
}
|
|
1875
1910
|
buildWorkflowSetupFollowUpMessage(obligation) {
|
|
1876
1911
|
const payload = {
|
|
@@ -1888,7 +1923,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1888
1923
|
return undefined;
|
|
1889
1924
|
return typeof suspendPayload.workflowId === 'string' ? suspendPayload.workflowId : undefined;
|
|
1890
1925
|
}
|
|
1891
|
-
async markWorkflowSetupHandled(threadId, workflowId, runId) {
|
|
1926
|
+
async markWorkflowSetupHandled(threadId, workflowId, runId, options = {}) {
|
|
1892
1927
|
const records = await this.listWorkflowLoopRecords(threadId);
|
|
1893
1928
|
if (records.length === 0)
|
|
1894
1929
|
return false;
|
|
@@ -1915,9 +1950,19 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1915
1950
|
const claim = await this.claimWorkItemSetupRouting(threadId, record);
|
|
1916
1951
|
if (!claim)
|
|
1917
1952
|
continue;
|
|
1918
|
-
|
|
1953
|
+
let marked;
|
|
1954
|
+
try {
|
|
1955
|
+
marked = await this.markWorkItemSetupRouted(threadId, record.state.workItemId, claim.claimId);
|
|
1956
|
+
}
|
|
1957
|
+
catch (error) {
|
|
1958
|
+
await this.releaseWorkItemSetupRoutingClaim(threadId, record.state.workItemId, claim.claimId);
|
|
1959
|
+
throw error;
|
|
1960
|
+
}
|
|
1919
1961
|
if (!marked) {
|
|
1920
1962
|
await this.releaseWorkItemSetupRoutingClaim(threadId, record.state.workItemId, claim.claimId);
|
|
1963
|
+
if (options.requirePersisted) {
|
|
1964
|
+
throw new n8n_workflow_1.OperationalError('Workflow setup routing marker was not saved');
|
|
1965
|
+
}
|
|
1921
1966
|
this.logger.warn('Workflow setup completed but routing marker was not saved', {
|
|
1922
1967
|
threadId,
|
|
1923
1968
|
workItemId: record.state.workItemId,
|
|
@@ -2123,7 +2168,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2123
2168
|
async doSchedulePlannedTasks(user, threadId) {
|
|
2124
2169
|
const revalidated = await this.revalidateActiveUser(user.id);
|
|
2125
2170
|
if (!revalidated) {
|
|
2126
|
-
this.logger.warn('Cancelling run: user no longer authorized for
|
|
2171
|
+
this.logger.warn('Cancelling run: user no longer authorized for n8n Assistant', {
|
|
2127
2172
|
userId: user.id,
|
|
2128
2173
|
threadId,
|
|
2129
2174
|
});
|
|
@@ -2206,6 +2251,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2206
2251
|
const contextAttachments = await this.resolveContextAttachments(attachments, user);
|
|
2207
2252
|
const signal = abortController.signal;
|
|
2208
2253
|
let tracing;
|
|
2254
|
+
let promptVersion;
|
|
2209
2255
|
let messageTraceFinalization;
|
|
2210
2256
|
let aiCreatedWorkflowIds;
|
|
2211
2257
|
let messageId = '';
|
|
@@ -2318,7 +2364,9 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2318
2364
|
}
|
|
2319
2365
|
const executionPushRef = this.threadPushRef.get(threadId);
|
|
2320
2366
|
const environment = await this.createExecutionEnvironment(user, threadId, runId, signal, messageGroupId, executionPushRef, proxyRunConfig);
|
|
2321
|
-
const { context, memory, taskStorage, workflowTasks, plannedTaskService, modelId, orchestrationContext, conversationHistory, } = environment;
|
|
2367
|
+
const { context, memory, taskStorage, workflowTasks, plannedTaskService, modelId, orchestrationContext, conversationHistory, aiPreferencesEnabled, } = environment;
|
|
2368
|
+
promptVersion = orchestrationContext.promptConfiguration?.version;
|
|
2369
|
+
(0, instance_ai_1.setTracePromptVersion)(tracing, promptVersion);
|
|
2322
2370
|
aiCreatedWorkflowIds = context.aiCreatedWorkflowIds ??= new Set();
|
|
2323
2371
|
const isPostPlanFollowUp = isReplanFollowUp || checkpoint?.isCheckpointFollowUp === true;
|
|
2324
2372
|
orchestrationContext.currentUserMessage = message;
|
|
@@ -2411,9 +2459,13 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2411
2459
|
previewSession: context.agentPreviewSession,
|
|
2412
2460
|
});
|
|
2413
2461
|
}
|
|
2462
|
+
else if (handoffContext?.source === 'setup-panel-execute' && (0, instance_ai_1.isSetupPanelEnabled)(context)) {
|
|
2463
|
+
handoffContextBlock = (0, internal_messages_1.buildWorkflowTestRequestBlock)(handoffContext.workflowId);
|
|
2464
|
+
}
|
|
2414
2465
|
else {
|
|
2415
2466
|
handoffContextBlock = buildHandoffContextBlock(handoffContext);
|
|
2416
2467
|
}
|
|
2468
|
+
const setupStateBlock = resumeReason === undefined ? await this.buildWorkflowSetupStateBlock(context) : '';
|
|
2417
2469
|
const thread = await memory.getThread(threadId);
|
|
2418
2470
|
const isOpeningTurn = Boolean(thread && !thread.title);
|
|
2419
2471
|
if (isOpeningTurn) {
|
|
@@ -2431,6 +2483,13 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2431
2483
|
},
|
|
2432
2484
|
});
|
|
2433
2485
|
}
|
|
2486
|
+
const instanceContext = await this.instanceContext.buildBlock({
|
|
2487
|
+
user,
|
|
2488
|
+
...(context.projectId !== undefined ? { projectId: context.projectId } : {}),
|
|
2489
|
+
cursor: (0, instance_context_service_1.readInstanceContextCursor)(thread?.metadata),
|
|
2490
|
+
isMachineFollowUp: checkpoint?.isCheckpointFollowUp === true ||
|
|
2491
|
+
plannedBuild?.isPlannedBuildFollowUp === true,
|
|
2492
|
+
});
|
|
2434
2493
|
const existingTasks = await taskStorage.get(threadId);
|
|
2435
2494
|
if (existingTasks) {
|
|
2436
2495
|
this.eventBus.publish(threadId, {
|
|
@@ -2455,20 +2514,33 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2455
2514
|
: attachmentManifest
|
|
2456
2515
|
? `${enrichedMessage}\n\n${attachmentManifest}`
|
|
2457
2516
|
: enrichedMessage;
|
|
2458
|
-
const messageWithContext = [
|
|
2517
|
+
const messageWithContext = [
|
|
2518
|
+
contextResourcesBlock,
|
|
2519
|
+
handoffContextBlock,
|
|
2520
|
+
setupStateBlock,
|
|
2521
|
+
instanceContext?.block ?? '',
|
|
2522
|
+
messageBody,
|
|
2523
|
+
]
|
|
2459
2524
|
.filter(Boolean)
|
|
2460
2525
|
.join('\n\n');
|
|
2461
|
-
const [
|
|
2462
|
-
this.
|
|
2526
|
+
const [boundProject, pastConversationsSection] = await Promise.all([
|
|
2527
|
+
this.resolveBoundProject(context),
|
|
2463
2528
|
isOpeningTurn ? conversationHistory?.getPastConversationsSection() : undefined,
|
|
2464
2529
|
]);
|
|
2530
|
+
const projectSection = boundProject ? (0, internal_messages_1.getProjectContextSection)(boundProject) : undefined;
|
|
2531
|
+
const aiPreferencesBlock = isOpeningTurn && aiPreferencesEnabled
|
|
2532
|
+
? await this.resolveAiPreferencesBlock(user.id, boundProject)
|
|
2533
|
+
: undefined;
|
|
2465
2534
|
const messageWithProject = projectSection
|
|
2466
2535
|
? (0, internal_messages_1.withProjectContext)(messageWithContext, projectSection)
|
|
2467
2536
|
: messageWithContext;
|
|
2468
2537
|
const messageWithPastConversations = pastConversationsSection
|
|
2469
2538
|
? (0, internal_messages_1.withPastConversations)(messageWithProject, pastConversationsSection)
|
|
2470
2539
|
: messageWithProject;
|
|
2471
|
-
const
|
|
2540
|
+
const messageWithPreferences = aiPreferencesBlock
|
|
2541
|
+
? (0, internal_messages_1.withAiPreferences)(messageWithPastConversations, aiPreferencesBlock)
|
|
2542
|
+
: messageWithPastConversations;
|
|
2543
|
+
const fullMessage = (0, internal_messages_1.withCurrentDateTime)(messageWithPreferences, (0, instance_ai_1.getDateTimeSection)(timeZone ?? this.defaultTimeZone));
|
|
2472
2544
|
const promptBuildRun = tracing
|
|
2473
2545
|
? await tracing.startChildRun(tracing.messageRun, {
|
|
2474
2546
|
name: 'prepare: prompt',
|
|
@@ -2545,6 +2617,19 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2545
2617
|
const agent = await this.createAgentFromEnvironment(environment, threadId, runId, user, tracing);
|
|
2546
2618
|
const streamOptions = this.buildOrchestratorAgentStreamOptions(user, threadId, runId, signal);
|
|
2547
2619
|
streamReached = true;
|
|
2620
|
+
if (instanceContext) {
|
|
2621
|
+
try {
|
|
2622
|
+
await (0, instance_ai_1.patchThread)(memory, {
|
|
2623
|
+
threadId,
|
|
2624
|
+
update: ({ metadata }) => ({
|
|
2625
|
+
metadata: { ...metadata, [instance_context_service_1.INSTANCE_CONTEXT_CURSOR]: instanceContext.cursor },
|
|
2626
|
+
}),
|
|
2627
|
+
});
|
|
2628
|
+
}
|
|
2629
|
+
catch (error) {
|
|
2630
|
+
this.logger.warn('Failed to store the instance-context cursor', { error });
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2548
2633
|
const result = tracing
|
|
2549
2634
|
? await tracing.withActiveSpan(tracing.actorRun, async () => {
|
|
2550
2635
|
return await (0, instance_ai_1.streamAgentRun)(agent, streamInput, streamOptions, {
|
|
@@ -2597,7 +2682,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2597
2682
|
plannedBuild,
|
|
2598
2683
|
runHandoff: runControl.state,
|
|
2599
2684
|
});
|
|
2600
|
-
|
|
2685
|
+
await this.suspendedThreads.persistPendingConfirmation({
|
|
2601
2686
|
requestId: result.suspension.requestId,
|
|
2602
2687
|
threadId,
|
|
2603
2688
|
userId: user.id,
|
|
@@ -2614,6 +2699,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2614
2699
|
if (intermediateText) {
|
|
2615
2700
|
this.telemetry.track('Builder sent message', {
|
|
2616
2701
|
thread_id: threadId,
|
|
2702
|
+
...(promptVersion ? { prompt_version: promptVersion } : {}),
|
|
2617
2703
|
message: (0, telemetry_1.redactTelemetryText)(intermediateText),
|
|
2618
2704
|
is_intermediate: true,
|
|
2619
2705
|
});
|
|
@@ -2626,11 +2712,14 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2626
2712
|
messageTraceFinalization = await this.terminalOutcome.finishInvalidConfirmationRun({
|
|
2627
2713
|
threadId,
|
|
2628
2714
|
runId,
|
|
2715
|
+
promptVersion,
|
|
2629
2716
|
abortController,
|
|
2630
2717
|
tracing,
|
|
2631
2718
|
});
|
|
2632
2719
|
return;
|
|
2633
2720
|
}
|
|
2721
|
+
if (signal.aborted && !this.shouldPreserveHitlOnShutdown(runId))
|
|
2722
|
+
return;
|
|
2634
2723
|
if (result.confirmationEvent) {
|
|
2635
2724
|
this.trackConfirmationRequest(user.id, threadId, result.confirmationEvent);
|
|
2636
2725
|
this.eventBus.publish(threadId, result.confirmationEvent);
|
|
@@ -2723,6 +2812,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2723
2812
|
};
|
|
2724
2813
|
const archivedWorkflowIds = await this.temporaryWorkflowService.reapForRun(threadId, user, aiCreatedWorkflowIds, this.backgroundTasks.getRunningTasks(threadId).length);
|
|
2725
2814
|
await this.finalizeRun(threadId, runId, result.status, {
|
|
2815
|
+
promptVersion,
|
|
2726
2816
|
userId: user.id,
|
|
2727
2817
|
modelId,
|
|
2728
2818
|
archivedWorkflowIds,
|
|
@@ -2744,10 +2834,12 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2744
2834
|
if (result.status === 'completed') {
|
|
2745
2835
|
this.telemetry.track('Builder sent message', {
|
|
2746
2836
|
thread_id: threadId,
|
|
2837
|
+
...(promptVersion ? { prompt_version: promptVersion } : {}),
|
|
2747
2838
|
message: (0, telemetry_1.redactTelemetryText)(outputText),
|
|
2748
2839
|
});
|
|
2749
2840
|
this.telemetry.track('Builder satisfied user intent', {
|
|
2750
2841
|
thread_id: threadId,
|
|
2842
|
+
...(promptVersion ? { prompt_version: promptVersion } : {}),
|
|
2751
2843
|
});
|
|
2752
2844
|
}
|
|
2753
2845
|
}
|
|
@@ -2784,7 +2876,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2784
2876
|
}),
|
|
2785
2877
|
};
|
|
2786
2878
|
const archivedWorkflowIds = await this.temporaryWorkflowService.reapForRun(threadId, user, aiCreatedWorkflowIds, this.backgroundTasks.getRunningTasks(threadId).length);
|
|
2787
|
-
this.publishRunFinish(threadId, runId, 'cancelled', cancellationReason, archivedWorkflowIds, user.id);
|
|
2879
|
+
this.publishRunFinish(threadId, runId, 'cancelled', cancellationReason, archivedWorkflowIds, user.id, { promptVersion });
|
|
2788
2880
|
return;
|
|
2789
2881
|
}
|
|
2790
2882
|
const terminalError = await this.reclassifyMaskedStreamFailure(error, user, {
|
|
@@ -2837,7 +2929,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2837
2929
|
}),
|
|
2838
2930
|
};
|
|
2839
2931
|
const archivedWorkflowIds = await this.temporaryWorkflowService.reapForRun(threadId, user, aiCreatedWorkflowIds, this.backgroundTasks.getRunningTasks(threadId).length);
|
|
2840
|
-
this.publishRunFinish(threadId, runId, 'errored', userFacingErrorMessage, archivedWorkflowIds, user.id, { errorMessage, errorSource: 'exception' });
|
|
2932
|
+
this.publishRunFinish(threadId, runId, 'errored', userFacingErrorMessage, archivedWorkflowIds, user.id, { errorMessage, errorSource: 'exception', promptVersion });
|
|
2841
2933
|
}
|
|
2842
2934
|
finally {
|
|
2843
2935
|
this.runState.clearActiveRun(threadId);
|
|
@@ -2865,9 +2957,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2865
2957
|
else if (reschedule) {
|
|
2866
2958
|
await this.schedulePlannedTasks(user, threadId);
|
|
2867
2959
|
}
|
|
2868
|
-
if (reschedule) {
|
|
2869
|
-
await this.drainPendingCheckpointReentries(user, threadId);
|
|
2870
|
-
}
|
|
2871
2960
|
await this.taskProjector.syncFromWorkflowLoop(threadId, runId);
|
|
2872
2961
|
if (reschedule) {
|
|
2873
2962
|
await this.maybeStartWorkflowSetupFollowUp(user, threadId);
|
|
@@ -2878,74 +2967,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2878
2967
|
}
|
|
2879
2968
|
}
|
|
2880
2969
|
}
|
|
2881
|
-
queuePendingCheckpointReentry(threadId, checkpointTaskId) {
|
|
2882
|
-
let set = this.pendingCheckpointReentries.get(threadId);
|
|
2883
|
-
if (!set) {
|
|
2884
|
-
set = new Set();
|
|
2885
|
-
this.pendingCheckpointReentries.set(threadId, set);
|
|
2886
|
-
}
|
|
2887
|
-
set.add(checkpointTaskId);
|
|
2888
|
-
}
|
|
2889
|
-
async drainPendingCheckpointReentries(user, threadId) {
|
|
2890
|
-
const set = this.pendingCheckpointReentries.get(threadId);
|
|
2891
|
-
if (!set || set.size === 0)
|
|
2892
|
-
return;
|
|
2893
|
-
const snapshot = [...set];
|
|
2894
|
-
for (const checkpointTaskId of snapshot) {
|
|
2895
|
-
if (this.runState.getActiveRunId(threadId) || this.runState.hasSuspendedRun(threadId)) {
|
|
2896
|
-
return;
|
|
2897
|
-
}
|
|
2898
|
-
const siblings = this.backgroundTasks.getRunningTasksByParentCheckpoint(threadId, checkpointTaskId);
|
|
2899
|
-
if (siblings.length > 0)
|
|
2900
|
-
continue;
|
|
2901
|
-
set.delete(checkpointTaskId);
|
|
2902
|
-
await this.reenterCheckpointById(user, threadId, checkpointTaskId);
|
|
2903
|
-
}
|
|
2904
|
-
if (set.size === 0)
|
|
2905
|
-
this.pendingCheckpointReentries.delete(threadId);
|
|
2906
|
-
}
|
|
2907
|
-
async reenterCheckpointById(user, threadId, checkpointTaskId, messageGroupId) {
|
|
2908
|
-
try {
|
|
2909
|
-
const { plannedTaskService } = await this.createPlannedTaskState();
|
|
2910
|
-
const graph = await plannedTaskService.getGraph(threadId);
|
|
2911
|
-
const checkpoint = graph?.tasks.find((t) => t.id === checkpointTaskId);
|
|
2912
|
-
if (!graph || !checkpoint || checkpoint.kind !== 'checkpoint')
|
|
2913
|
-
return false;
|
|
2914
|
-
if (checkpoint.status !== 'running')
|
|
2915
|
-
return false;
|
|
2916
|
-
const startedRunId = await this.startInternalFollowUpRun(user, threadId, this.buildPlannedTaskFollowUpMessage('checkpoint', graph, { checkpoint }), messageGroupId, false, { isCheckpointFollowUp: true, checkpointTaskId });
|
|
2917
|
-
if (!startedRunId)
|
|
2918
|
-
return false;
|
|
2919
|
-
this.logger.debug('Re-entered checkpoint follow-up', {
|
|
2920
|
-
threadId,
|
|
2921
|
-
checkpointTaskId,
|
|
2922
|
-
messageGroupId,
|
|
2923
|
-
});
|
|
2924
|
-
return true;
|
|
2925
|
-
}
|
|
2926
|
-
catch (error) {
|
|
2927
|
-
this.logger.error('Failed to re-enter checkpoint follow-up', {
|
|
2928
|
-
threadId,
|
|
2929
|
-
checkpointTaskId,
|
|
2930
|
-
error: error instanceof Error ? error.message : String(error),
|
|
2931
|
-
});
|
|
2932
|
-
return false;
|
|
2933
|
-
}
|
|
2934
|
-
}
|
|
2935
|
-
async maybeReenterParentCheckpoint(user, threadId, task) {
|
|
2936
|
-
const parentCheckpointId = task.parentCheckpointId;
|
|
2937
|
-
if (!parentCheckpointId)
|
|
2938
|
-
return false;
|
|
2939
|
-
const siblings = this.backgroundTasks
|
|
2940
|
-
.getRunningTasksByParentCheckpoint(threadId, parentCheckpointId)
|
|
2941
|
-
.filter((t) => t.taskId !== task.taskId);
|
|
2942
|
-
if (siblings.length > 0)
|
|
2943
|
-
return false;
|
|
2944
|
-
if (this.runState.getActiveRunId(threadId) || this.runState.hasSuspendedRun(threadId)) {
|
|
2945
|
-
return false;
|
|
2946
|
-
}
|
|
2947
|
-
return await this.reenterCheckpointById(user, threadId, parentCheckpointId, task.messageGroupId);
|
|
2948
|
-
}
|
|
2949
2970
|
async finalizeCheckpointFollowUp(user, threadId, checkpointTaskId, { reschedule = true } = {}) {
|
|
2950
2971
|
try {
|
|
2951
2972
|
const { plannedTaskService } = await this.createPlannedTaskState();
|
|
@@ -3033,7 +3054,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3033
3054
|
if (suspended?.user.id === requestingUserId) {
|
|
3034
3055
|
this.cancelRun(suspended.threadId);
|
|
3035
3056
|
}
|
|
3036
|
-
this.logger.warn('Rejecting confirmation: user no longer authorized for
|
|
3057
|
+
this.logger.warn('Rejecting confirmation: user no longer authorized for n8n Assistant', {
|
|
3037
3058
|
userId: requestingUserId,
|
|
3038
3059
|
requestId,
|
|
3039
3060
|
});
|
|
@@ -3139,6 +3160,10 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3139
3160
|
const state = await this.checkpointStore.load(orphan.checkpointKey);
|
|
3140
3161
|
if (!state)
|
|
3141
3162
|
return { kind: 'no-checkpoint' };
|
|
3163
|
+
const mode = api_types_1.instanceAiBuildModeSchema.safeParse(state.persistence?.hostMetadata?.buildMode);
|
|
3164
|
+
this.runState.setBuildMode(orphan.threadId, mode.success ? mode.data : 'default');
|
|
3165
|
+
const version = state.persistence?.hostMetadata?.promptVersion;
|
|
3166
|
+
this.runState.setPromptVersion(orphan.threadId, typeof version === 'string' ? version : undefined);
|
|
3142
3167
|
}
|
|
3143
3168
|
catch (error) {
|
|
3144
3169
|
return { kind: 'no-checkpoint', error };
|
|
@@ -3201,14 +3226,14 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3201
3226
|
return null;
|
|
3202
3227
|
}
|
|
3203
3228
|
}
|
|
3204
|
-
async
|
|
3229
|
+
async resolveBoundProject(context) {
|
|
3205
3230
|
const projectId = context.projectId;
|
|
3206
3231
|
if (!projectId)
|
|
3207
3232
|
return undefined;
|
|
3208
3233
|
try {
|
|
3209
3234
|
const project = await context.workspaceService?.getProject?.(projectId);
|
|
3210
3235
|
if (project)
|
|
3211
|
-
return
|
|
3236
|
+
return project;
|
|
3212
3237
|
this.logger.warn('Instance AI could not name the bound project for this turn', {
|
|
3213
3238
|
projectId,
|
|
3214
3239
|
reason: context.workspaceService?.getProject ? 'not-readable' : 'no-workspace-adapter',
|
|
@@ -3229,6 +3254,9 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3229
3254
|
return undefined;
|
|
3230
3255
|
}
|
|
3231
3256
|
}
|
|
3257
|
+
async resolveAiPreferencesBlock(userId, project) {
|
|
3258
|
+
return await this.bestEffort('Instance AI failed to read the AI preferences for this turn', { userId }, async () => (0, ai_preference_service_1.renderAiPreferencesBlock)(await this.aiPreferenceService.getApplicable(userId, project ? [project] : [])));
|
|
3259
|
+
}
|
|
3232
3260
|
async canAccessAgentPreviewHandoff(user, projectId) {
|
|
3233
3261
|
const requiredScopes = ['agent:read', 'agent:update'];
|
|
3234
3262
|
return await (0, check_access_1.userHasScopes)(user, requiredScopes, false, { projectId });
|
|
@@ -3281,7 +3309,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3281
3309
|
}
|
|
3282
3310
|
const activeUser = await this.revalidateActiveUser(user.id);
|
|
3283
3311
|
if (!activeUser) {
|
|
3284
|
-
this.logger.warn('Cancelling suspended run: user no longer authorized for
|
|
3312
|
+
this.logger.warn('Cancelling suspended run: user no longer authorized for n8n Assistant', {
|
|
3285
3313
|
userId: user.id,
|
|
3286
3314
|
threadId,
|
|
3287
3315
|
requestId,
|
|
@@ -3385,6 +3413,9 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3385
3413
|
}
|
|
3386
3414
|
async processResumedStream(agent, resumeData, opts) {
|
|
3387
3415
|
let messageTraceFinalization;
|
|
3416
|
+
const promptVersion = opts.orchestrationContext?.promptConfiguration?.version ??
|
|
3417
|
+
this.runState.getPromptConfiguration(opts.threadId)?.version;
|
|
3418
|
+
(0, instance_ai_1.setTracePromptVersion)(opts.tracing, promptVersion);
|
|
3388
3419
|
let completedSetupWorkflowId;
|
|
3389
3420
|
let skipPostRunCleanup = false;
|
|
3390
3421
|
let resumeClaimed = false;
|
|
@@ -3455,7 +3486,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3455
3486
|
if (!resumeClaimed) {
|
|
3456
3487
|
skipPostRunCleanup = true;
|
|
3457
3488
|
const claimError = result.error ?? new Error('Resume checkpoint claim did not complete');
|
|
3458
|
-
await this.settleUnclaimedResume(opts, claimError, 'stream');
|
|
3489
|
+
await this.settleUnclaimedResume(opts, claimError, 'stream', promptVersion);
|
|
3459
3490
|
return;
|
|
3460
3491
|
}
|
|
3461
3492
|
if (result.status === 'suspended') {
|
|
@@ -3488,7 +3519,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3488
3519
|
plannedBuild: opts.plannedBuild,
|
|
3489
3520
|
runHandoff: runControl.state,
|
|
3490
3521
|
});
|
|
3491
|
-
|
|
3522
|
+
await this.suspendedThreads.persistPendingConfirmation({
|
|
3492
3523
|
requestId: result.suspension.requestId,
|
|
3493
3524
|
threadId: opts.threadId,
|
|
3494
3525
|
userId: opts.user.id,
|
|
@@ -3505,6 +3536,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3505
3536
|
if (intermediateText) {
|
|
3506
3537
|
this.telemetry.track('Builder sent message', {
|
|
3507
3538
|
thread_id: opts.threadId,
|
|
3539
|
+
...(promptVersion ? { prompt_version: promptVersion } : {}),
|
|
3508
3540
|
message: (0, telemetry_1.redactTelemetryText)(intermediateText),
|
|
3509
3541
|
is_intermediate: true,
|
|
3510
3542
|
});
|
|
@@ -3515,11 +3547,14 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3515
3547
|
messageTraceFinalization = await this.terminalOutcome.finishInvalidConfirmationRun({
|
|
3516
3548
|
threadId: opts.threadId,
|
|
3517
3549
|
runId: opts.runId,
|
|
3550
|
+
promptVersion,
|
|
3518
3551
|
abortController: opts.abortController,
|
|
3519
3552
|
tracing: opts.tracing,
|
|
3520
3553
|
});
|
|
3521
3554
|
return;
|
|
3522
3555
|
}
|
|
3556
|
+
if (opts.signal.aborted && !this.shouldPreserveHitlOnShutdown(opts.runId))
|
|
3557
|
+
return;
|
|
3523
3558
|
if (result.confirmationEvent) {
|
|
3524
3559
|
this.trackConfirmationRequest(opts.user.id, opts.threadId, result.confirmationEvent);
|
|
3525
3560
|
this.eventBus.publish(opts.threadId, result.confirmationEvent);
|
|
@@ -3616,6 +3651,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3616
3651
|
};
|
|
3617
3652
|
const archivedWorkflowIds = await this.temporaryWorkflowService.reapForRun(opts.threadId, opts.user, undefined, this.backgroundTasks.getRunningTasks(opts.threadId).length);
|
|
3618
3653
|
await this.finalizeRun(opts.threadId, opts.runId, result.status, {
|
|
3654
|
+
promptVersion,
|
|
3619
3655
|
userId: opts.user.id,
|
|
3620
3656
|
...(opts.modelId !== undefined ? { modelId: opts.modelId } : {}),
|
|
3621
3657
|
archivedWorkflowIds,
|
|
@@ -3638,17 +3674,19 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3638
3674
|
completedSetupWorkflowId = this.getWorkflowSetupSuspensionWorkflowId(opts.toolName, opts.suspendPayload);
|
|
3639
3675
|
this.telemetry.track('Builder sent message', {
|
|
3640
3676
|
thread_id: opts.threadId,
|
|
3677
|
+
...(promptVersion ? { prompt_version: promptVersion } : {}),
|
|
3641
3678
|
message: (0, telemetry_1.redactTelemetryText)(outputText),
|
|
3642
3679
|
});
|
|
3643
3680
|
this.telemetry.track('Builder satisfied user intent', {
|
|
3644
3681
|
thread_id: opts.threadId,
|
|
3682
|
+
...(promptVersion ? { prompt_version: promptVersion } : {}),
|
|
3645
3683
|
});
|
|
3646
3684
|
}
|
|
3647
3685
|
}
|
|
3648
3686
|
catch (error) {
|
|
3649
3687
|
if (!resumeClaimed) {
|
|
3650
3688
|
skipPostRunCleanup = true;
|
|
3651
|
-
await this.settleUnclaimedResume(opts, error, 'exception');
|
|
3689
|
+
await this.settleUnclaimedResume(opts, error, 'exception', promptVersion);
|
|
3652
3690
|
return;
|
|
3653
3691
|
}
|
|
3654
3692
|
if (opts.signal.aborted) {
|
|
@@ -3680,7 +3718,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3680
3718
|
}),
|
|
3681
3719
|
};
|
|
3682
3720
|
const archivedWorkflowIds = await this.temporaryWorkflowService.reapForRun(opts.threadId, opts.user, undefined, this.backgroundTasks.getRunningTasks(opts.threadId).length);
|
|
3683
|
-
this.publishRunFinish(opts.threadId, opts.runId, 'cancelled', cancellationReason, archivedWorkflowIds, opts.user.id);
|
|
3721
|
+
this.publishRunFinish(opts.threadId, opts.runId, 'cancelled', cancellationReason, archivedWorkflowIds, opts.user.id, { promptVersion });
|
|
3684
3722
|
return;
|
|
3685
3723
|
}
|
|
3686
3724
|
const terminalError = await this.reclassifyMaskedStreamFailure(error, opts.user, {
|
|
@@ -3735,7 +3773,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3735
3773
|
}),
|
|
3736
3774
|
};
|
|
3737
3775
|
const archivedWorkflowIds = await this.temporaryWorkflowService.reapForRun(opts.threadId, opts.user, undefined, this.backgroundTasks.getRunningTasks(opts.threadId).length);
|
|
3738
|
-
this.publishRunFinish(opts.threadId, opts.runId, 'errored', userFacingErrorMessage, archivedWorkflowIds, opts.user.id, { errorMessage, errorSource: 'exception' });
|
|
3776
|
+
this.publishRunFinish(opts.threadId, opts.runId, 'errored', userFacingErrorMessage, archivedWorkflowIds, opts.user.id, { errorMessage, errorSource: 'exception', promptVersion });
|
|
3739
3777
|
}
|
|
3740
3778
|
finally {
|
|
3741
3779
|
this.runState.clearActiveRun(opts.threadId, opts.resumeExecutionToken);
|
|
@@ -3766,9 +3804,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3766
3804
|
else if (reschedule) {
|
|
3767
3805
|
await this.schedulePlannedTasks(opts.user, opts.threadId);
|
|
3768
3806
|
}
|
|
3769
|
-
if (reschedule) {
|
|
3770
|
-
await this.drainPendingCheckpointReentries(opts.user, opts.threadId);
|
|
3771
|
-
}
|
|
3772
3807
|
if (completedSetupWorkflowId) {
|
|
3773
3808
|
await this.markWorkflowSetupHandled(opts.threadId, completedSetupWorkflowId, opts.runId);
|
|
3774
3809
|
}
|
|
@@ -3782,7 +3817,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3782
3817
|
}
|
|
3783
3818
|
}
|
|
3784
3819
|
}
|
|
3785
|
-
async settleUnclaimedResume(opts, error, errorSource) {
|
|
3820
|
+
async settleUnclaimedResume(opts, error, errorSource, promptVersion) {
|
|
3786
3821
|
const outcome = classifyUnclaimedResume(error, {
|
|
3787
3822
|
aborted: opts.signal.aborted,
|
|
3788
3823
|
preserveHitl: this.shouldPreserveHitlOnShutdown(opts.runId),
|
|
@@ -3809,6 +3844,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3809
3844
|
await this.emitTerminalRun({
|
|
3810
3845
|
threadId: opts.threadId,
|
|
3811
3846
|
runId: opts.runId,
|
|
3847
|
+
promptVersion,
|
|
3812
3848
|
status: 'cancelled',
|
|
3813
3849
|
reason,
|
|
3814
3850
|
messageGroupId: opts.messageGroupId,
|
|
@@ -3834,6 +3870,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3834
3870
|
await this.emitTerminalRun({
|
|
3835
3871
|
threadId: opts.threadId,
|
|
3836
3872
|
runId: opts.runId,
|
|
3873
|
+
promptVersion,
|
|
3837
3874
|
status: 'errored',
|
|
3838
3875
|
reason: outcome.reason,
|
|
3839
3876
|
errorCode: outcome.errorCode,
|
|
@@ -3854,7 +3891,10 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3854
3891
|
...(status === 'errored' ? { errorMessage: args.reason, errorCode: args.errorCode } : {}),
|
|
3855
3892
|
}));
|
|
3856
3893
|
const archivedWorkflowIds = (await this.bestEffort('Failed to reap temporary workflows for a settling run', context, async () => await this.temporaryWorkflowService.reapForRun(threadId, args.user, undefined, this.backgroundTasks.getRunningTasks(threadId).length))) ?? [];
|
|
3857
|
-
this.publishRunFinish(threadId, runId, status, args.reason, archivedWorkflowIds, args.user.id,
|
|
3894
|
+
this.publishRunFinish(threadId, runId, status, args.reason, archivedWorkflowIds, args.user.id, {
|
|
3895
|
+
...args.errorInfo,
|
|
3896
|
+
promptVersion: args.promptVersion,
|
|
3897
|
+
});
|
|
3858
3898
|
}
|
|
3859
3899
|
async bestEffort(failureMessage, context, step) {
|
|
3860
3900
|
try {
|
|
@@ -3865,190 +3905,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3865
3905
|
return undefined;
|
|
3866
3906
|
}
|
|
3867
3907
|
}
|
|
3868
|
-
spawnBackgroundTask(runId, opts, messageGroupIdOverride) {
|
|
3869
|
-
const outcome = this.backgroundTasks.spawn({
|
|
3870
|
-
taskId: opts.taskId,
|
|
3871
|
-
threadId: opts.threadId,
|
|
3872
|
-
runId,
|
|
3873
|
-
role: opts.role,
|
|
3874
|
-
agentId: opts.agentId,
|
|
3875
|
-
messageGroupId: messageGroupIdOverride ?? this.runState.getMessageGroupId(opts.threadId),
|
|
3876
|
-
plannedTaskId: opts.plannedTaskId,
|
|
3877
|
-
workItemId: opts.workItemId,
|
|
3878
|
-
traceContext: opts.traceContext,
|
|
3879
|
-
createTraceContext: opts.createTraceContext,
|
|
3880
|
-
dedupeKey: opts.dedupeKey,
|
|
3881
|
-
parentCheckpointId: opts.parentCheckpointId,
|
|
3882
|
-
run: opts.run,
|
|
3883
|
-
onLimitReached: async (errorMessage) => {
|
|
3884
|
-
await this.tracing.finalizeDetachedTraceRun(opts.taskId, opts.traceContext, {
|
|
3885
|
-
status: 'failed',
|
|
3886
|
-
outputs: {
|
|
3887
|
-
taskId: opts.taskId,
|
|
3888
|
-
agentId: opts.agentId,
|
|
3889
|
-
role: opts.role,
|
|
3890
|
-
},
|
|
3891
|
-
error: errorMessage,
|
|
3892
|
-
metadata: {
|
|
3893
|
-
...(opts.plannedTaskId ? { planned_task_id: opts.plannedTaskId } : {}),
|
|
3894
|
-
...(opts.workItemId ? { work_item_id: opts.workItemId } : {}),
|
|
3895
|
-
},
|
|
3896
|
-
});
|
|
3897
|
-
this.eventBus.publish(opts.threadId, {
|
|
3898
|
-
type: 'agent-completed',
|
|
3899
|
-
runId,
|
|
3900
|
-
agentId: opts.agentId,
|
|
3901
|
-
payload: {
|
|
3902
|
-
role: opts.role,
|
|
3903
|
-
result: '',
|
|
3904
|
-
error: errorMessage,
|
|
3905
|
-
},
|
|
3906
|
-
});
|
|
3907
|
-
},
|
|
3908
|
-
onCompleted: async (task) => {
|
|
3909
|
-
await this.tracing.finalizeBackgroundTaskTracing(task, 'completed');
|
|
3910
|
-
this.eventBus.publish(opts.threadId, {
|
|
3911
|
-
type: 'agent-completed',
|
|
3912
|
-
runId,
|
|
3913
|
-
agentId: opts.agentId,
|
|
3914
|
-
payload: { role: opts.role, result: task.result ?? '' },
|
|
3915
|
-
});
|
|
3916
|
-
const user = this.runState.getThreadUser(opts.threadId);
|
|
3917
|
-
if (user) {
|
|
3918
|
-
await this.handlePlannedTaskSettlement(user, task, 'succeeded');
|
|
3919
|
-
}
|
|
3920
|
-
},
|
|
3921
|
-
onFailed: async (task) => {
|
|
3922
|
-
await this.tracing.finalizeBackgroundTaskTracing(task, 'failed');
|
|
3923
|
-
this.instanceAiErrorReporter.report(new Error(task.error ?? 'Instance AI background task failed'), {
|
|
3924
|
-
component: 'instance-ai-background-task',
|
|
3925
|
-
threadId: opts.threadId,
|
|
3926
|
-
runId,
|
|
3927
|
-
tracing: task.traceContext,
|
|
3928
|
-
agentId: opts.agentId,
|
|
3929
|
-
messageGroupId: task.messageGroupId,
|
|
3930
|
-
taskId: task.taskId,
|
|
3931
|
-
role: task.role,
|
|
3932
|
-
});
|
|
3933
|
-
this.eventBus.publish(opts.threadId, {
|
|
3934
|
-
type: 'agent-completed',
|
|
3935
|
-
runId,
|
|
3936
|
-
agentId: opts.agentId,
|
|
3937
|
-
payload: { role: opts.role, result: '', error: task.error ?? 'Unknown error' },
|
|
3938
|
-
});
|
|
3939
|
-
const user = this.runState.getThreadUser(opts.threadId);
|
|
3940
|
-
if (user) {
|
|
3941
|
-
await this.handlePlannedTaskSettlement(user, task, 'failed');
|
|
3942
|
-
}
|
|
3943
|
-
},
|
|
3944
|
-
onSettled: async (task) => {
|
|
3945
|
-
await this.terminalOutcome.recordBackgroundTerminalOutcome(task);
|
|
3946
|
-
if (task.plannedTaskId)
|
|
3947
|
-
return;
|
|
3948
|
-
await this.taskProjector.syncFromBackgroundTask(task);
|
|
3949
|
-
const parentCheckpointId = task.parentCheckpointId;
|
|
3950
|
-
if (parentCheckpointId) {
|
|
3951
|
-
const user = this.runState.getThreadUser(opts.threadId);
|
|
3952
|
-
if (!user) {
|
|
3953
|
-
this.queuePendingCheckpointReentry(opts.threadId, parentCheckpointId);
|
|
3954
|
-
return;
|
|
3955
|
-
}
|
|
3956
|
-
const reentered = await this.maybeReenterParentCheckpoint(user, opts.threadId, task);
|
|
3957
|
-
if (!reentered) {
|
|
3958
|
-
this.queuePendingCheckpointReentry(opts.threadId, parentCheckpointId);
|
|
3959
|
-
}
|
|
3960
|
-
return;
|
|
3961
|
-
}
|
|
3962
|
-
const remaining = this.backgroundTasks.getRunningTasks(opts.threadId);
|
|
3963
|
-
const hasActiveRun = !!this.runState.getActiveRunId(opts.threadId);
|
|
3964
|
-
const hasSuspendedRun = this.runState.hasSuspendedRun(opts.threadId);
|
|
3965
|
-
if (remaining.length === 0 && !hasActiveRun && !hasSuspendedRun) {
|
|
3966
|
-
if (this.liveness.hasTimedOutActiveRunThread(opts.threadId)) {
|
|
3967
|
-
this.logger.debug('Skipping background auto-follow-up after active run timeout', {
|
|
3968
|
-
threadId: opts.threadId,
|
|
3969
|
-
taskId: task.taskId,
|
|
3970
|
-
});
|
|
3971
|
-
return;
|
|
3972
|
-
}
|
|
3973
|
-
if (task.timeoutReason) {
|
|
3974
|
-
this.logger.debug('Skipping background auto-follow-up after task timeout', {
|
|
3975
|
-
threadId: opts.threadId,
|
|
3976
|
-
taskId: task.taskId,
|
|
3977
|
-
timeoutReason: task.timeoutReason,
|
|
3978
|
-
});
|
|
3979
|
-
return;
|
|
3980
|
-
}
|
|
3981
|
-
const user = this.runState.getThreadUser(opts.threadId);
|
|
3982
|
-
if (user) {
|
|
3983
|
-
const verificationFollowUpStarted = await this.maybeStartWorkflowVerificationFollowUp(user, task);
|
|
3984
|
-
if (verificationFollowUpStarted)
|
|
3985
|
-
return;
|
|
3986
|
-
const setupFollowUpStarted = await this.maybeStartWorkflowSetupFollowUp(user, task.threadId);
|
|
3987
|
-
if (setupFollowUpStarted)
|
|
3988
|
-
return;
|
|
3989
|
-
const payload = JSON.stringify({
|
|
3990
|
-
role: opts.role,
|
|
3991
|
-
status: task.result ? 'completed' : task.error ? 'failed' : 'finished',
|
|
3992
|
-
result: task.result ?? undefined,
|
|
3993
|
-
outcome: task.outcome ?? undefined,
|
|
3994
|
-
error: task.error ?? undefined,
|
|
3995
|
-
}, null, 2);
|
|
3996
|
-
await this.startInternalFollowUpRun(user, opts.threadId, `<background-task-completed>\n${payload}\n</background-task-completed>\n\n${internal_messages_1.AUTO_FOLLOW_UP_MESSAGE}`, task.messageGroupId);
|
|
3997
|
-
}
|
|
3998
|
-
}
|
|
3999
|
-
},
|
|
4000
|
-
});
|
|
4001
|
-
if (outcome.status === 'started') {
|
|
4002
|
-
void this.taskProjector.syncFromBackgroundTask(outcome.task);
|
|
4003
|
-
return { status: 'started', taskId: outcome.task.taskId, agentId: outcome.task.agentId };
|
|
4004
|
-
}
|
|
4005
|
-
if (outcome.status === 'duplicate') {
|
|
4006
|
-
this.logger.warn('Background task dispatch deduped — task already in flight', {
|
|
4007
|
-
threadId: opts.threadId,
|
|
4008
|
-
requestedTaskId: opts.taskId,
|
|
4009
|
-
existingTaskId: outcome.existing.taskId,
|
|
4010
|
-
plannedTaskId: opts.dedupeKey?.plannedTaskId,
|
|
4011
|
-
workflowId: opts.dedupeKey?.workflowId,
|
|
4012
|
-
role: opts.role,
|
|
4013
|
-
});
|
|
4014
|
-
void this.tracing.finalizeDetachedTraceRun(opts.taskId, opts.traceContext, {
|
|
4015
|
-
status: 'cancelled',
|
|
4016
|
-
outputs: {
|
|
4017
|
-
taskId: opts.taskId,
|
|
4018
|
-
agentId: opts.agentId,
|
|
4019
|
-
role: opts.role,
|
|
4020
|
-
deduped_to: outcome.existing.taskId,
|
|
4021
|
-
},
|
|
4022
|
-
metadata: {
|
|
4023
|
-
deduped: true,
|
|
4024
|
-
existing_task_id: outcome.existing.taskId,
|
|
4025
|
-
...(opts.plannedTaskId ? { planned_task_id: opts.plannedTaskId } : {}),
|
|
4026
|
-
...(opts.workItemId ? { work_item_id: opts.workItemId } : {}),
|
|
4027
|
-
},
|
|
4028
|
-
});
|
|
4029
|
-
this.eventBus.publish(opts.threadId, {
|
|
4030
|
-
type: 'agent-completed',
|
|
4031
|
-
runId,
|
|
4032
|
-
agentId: opts.agentId,
|
|
4033
|
-
payload: {
|
|
4034
|
-
role: opts.role,
|
|
4035
|
-
result: '',
|
|
4036
|
-
error: `Deduped: task already in flight as ${outcome.existing.taskId}`,
|
|
4037
|
-
},
|
|
4038
|
-
});
|
|
4039
|
-
return {
|
|
4040
|
-
status: 'duplicate',
|
|
4041
|
-
existing: {
|
|
4042
|
-
taskId: outcome.existing.taskId,
|
|
4043
|
-
agentId: outcome.existing.agentId,
|
|
4044
|
-
role: outcome.existing.role,
|
|
4045
|
-
plannedTaskId: outcome.existing.plannedTaskId,
|
|
4046
|
-
workItemId: outcome.existing.workItemId,
|
|
4047
|
-
},
|
|
4048
|
-
};
|
|
4049
|
-
}
|
|
4050
|
-
return { status: 'limit-reached' };
|
|
4051
|
-
}
|
|
4052
3908
|
async snapshotAttachedAgents(attachments, orchestrationContext, tracing) {
|
|
4053
3909
|
const delegate = orchestrationContext.domainContext?.builderDelegate;
|
|
4054
3910
|
if (!delegate || !tracing)
|
|
@@ -4164,7 +4020,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
4164
4020
|
reason,
|
|
4165
4021
|
});
|
|
4166
4022
|
const archivedWorkflowIds = await this.temporaryWorkflowService.reapForRun(suspended.threadId, suspended.user, undefined, this.backgroundTasks.getRunningTasks(suspended.threadId).length);
|
|
4167
|
-
this.publishRunFinish(suspended.threadId, suspended.runId, 'cancelled', reason, archivedWorkflowIds, suspended.user.id);
|
|
4023
|
+
this.publishRunFinish(suspended.threadId, suspended.runId, 'cancelled', reason, archivedWorkflowIds, suspended.user.id, { promptVersion: suspended.orchestrationContext?.promptConfiguration?.version });
|
|
4168
4024
|
await this.tracing.maybeFinalizeRunTraceRoot(suspended.runId, {
|
|
4169
4025
|
status: 'cancelled',
|
|
4170
4026
|
reason,
|
|
@@ -4176,7 +4032,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
4176
4032
|
});
|
|
4177
4033
|
void this.suspendedThreads.dropPendingConfirmation(suspended.requestId);
|
|
4178
4034
|
}
|
|
4179
|
-
publishRunFinish(threadId, runId, status, reason, archivedWorkflowIds, userId,
|
|
4035
|
+
publishRunFinish(threadId, runId, status, reason, archivedWorkflowIds, userId, metadata) {
|
|
4180
4036
|
const effectiveStatus = status === 'errored' ? 'error' : status;
|
|
4181
4037
|
const hasArchived = archivedWorkflowIds && archivedWorkflowIds.length > 0;
|
|
4182
4038
|
this.eventBus.publish(threadId, {
|
|
@@ -4196,6 +4052,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
4196
4052
|
this.telemetry.track('instance_ai_run_finished', {
|
|
4197
4053
|
thread_id: threadId,
|
|
4198
4054
|
run_id: runId,
|
|
4055
|
+
...(metadata?.promptVersion ? { prompt_version: metadata.promptVersion } : {}),
|
|
4199
4056
|
status: effectiveStatus,
|
|
4200
4057
|
...(userId ? { user_id: userId } : {}),
|
|
4201
4058
|
});
|
|
@@ -4204,8 +4061,9 @@ let InstanceAiService = class InstanceAiService {
|
|
|
4204
4061
|
this.telemetry.track('Builder generation errored', {
|
|
4205
4062
|
thread_id: threadId,
|
|
4206
4063
|
run_id: runId,
|
|
4207
|
-
|
|
4208
|
-
|
|
4064
|
+
...(metadata?.promptVersion ? { prompt_version: metadata.promptVersion } : {}),
|
|
4065
|
+
error_message: (0, telemetry_1.redactTelemetryText)(metadata?.errorMessage ?? reason ?? 'unknown'),
|
|
4066
|
+
...(metadata?.errorSource ? { error_source: metadata.errorSource } : {}),
|
|
4209
4067
|
...(userId ? { user_id: userId } : {}),
|
|
4210
4068
|
});
|
|
4211
4069
|
}
|
|
@@ -4291,7 +4149,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
4291
4149
|
}
|
|
4292
4150
|
}
|
|
4293
4151
|
async finalizeRun(threadId, runId, status, options) {
|
|
4294
|
-
this.publishRunFinish(threadId, runId, status, options?.errorReason, options?.archivedWorkflowIds, options?.userId, options?.errorInfo);
|
|
4152
|
+
this.publishRunFinish(threadId, runId, status, options?.errorReason, options?.archivedWorkflowIds, options?.userId, { ...options?.errorInfo, promptVersion: options?.promptVersion });
|
|
4295
4153
|
this.emitRunMetrics(threadId, status, options);
|
|
4296
4154
|
if (status === 'completed' && options?.userId && options?.modelId) {
|
|
4297
4155
|
void this.refineTitleIfNeeded(threadId, options.userId, options.modelId);
|
|
@@ -4456,20 +4314,8 @@ __decorate([
|
|
|
4456
4314
|
__metadata("design:paramtypes", [Object]),
|
|
4457
4315
|
__metadata("design:returntype", Promise)
|
|
4458
4316
|
], InstanceAiService.prototype, "handleRelayTaskControl", null);
|
|
4459
|
-
__decorate([
|
|
4460
|
-
(0, decorators_1.OnLeaderTakeover)(),
|
|
4461
|
-
__metadata("design:type", Function),
|
|
4462
|
-
__metadata("design:paramtypes", []),
|
|
4463
|
-
__metadata("design:returntype", void 0)
|
|
4464
|
-
], InstanceAiService.prototype, "startCheckpointPruning", null);
|
|
4465
|
-
__decorate([
|
|
4466
|
-
(0, decorators_1.OnLeaderStepdown)(),
|
|
4467
|
-
__metadata("design:type", Function),
|
|
4468
|
-
__metadata("design:paramtypes", []),
|
|
4469
|
-
__metadata("design:returntype", void 0)
|
|
4470
|
-
], InstanceAiService.prototype, "stopCheckpointPruning", null);
|
|
4471
4317
|
exports.InstanceAiService = InstanceAiService = __decorate([
|
|
4472
4318
|
(0, di_1.Service)(),
|
|
4473
|
-
__metadata("design:paramtypes", [backend_common_1.Logger, config_1.GlobalConfig, n8n_core_1.InstanceSettings, instance_ai_adapter_service_1.InstanceAiAdapterService, in_process_event_bus_1.InProcessEventBus, durable_event_log_1.DurableEventLog, interrupted_run_sweeper_1.InterruptedRunSweeper, instance_ai_settings_service_1.InstanceAiSettingsService, instance_ai_gateway_service_1.InstanceAiGatewayService, instance_ai_browser_session_service_1.InstanceAiBrowserSessionService, instance_ai_memory_service_1.InstanceAiMemoryService, typeorm_agent_memory_1.TypeORMAgentMemory, typeorm_agent_checkpoint_store_1.TypeORMAgentCheckpointStore, ai_service_1.AiService, instance_ai_thread_grant_repository_1.InstanceAiThreadGrantRepository, instance_ai_pending_confirmation_repository_1.InstanceAiPendingConfirmationRepository, url_service_1.UrlService, instance_ai_event_log_repository_1.InstanceAiEventLogRepository, db_iteration_log_storage_1.DbIterationLogStorage, instance_write_access_service_1.InstanceWriteAccessService, telemetry_2.Telemetry, mcp_1.InstanceAiMcpRegistryService, db_1.UserRepository, instance_ai_temporary_workflow_service_1.InstanceAiTemporaryWorkflowService, n8n_core_1.ErrorReporter, config_1.SsrfProtectionConfig, backend_network_1.SsrfProtectionService, event_service_1.EventService, thread_credential_allowlist_service_1.EvalThreadCredentialAllowlistService, instance_ai_run_probe_1.InstanceAiRunProbe, instance_ai_model_service_1.InstanceAiModelService, instance_ai_credit_service_1.InstanceAiCreditService, publisher_service_1.Publisher, instance_ai_error_reporter_service_1.InstanceAiErrorReporterService, canvas_node_context_flag_gate_1.CanvasNodeContextFlagGate, push_1.Push, instance_ai_conversation_history_service_1.InstanceAiConversationHistoryService])
|
|
4319
|
+
__metadata("design:paramtypes", [backend_common_1.Logger, config_1.GlobalConfig, n8n_core_1.InstanceSettings, instance_ai_adapter_service_1.InstanceAiAdapterService, in_process_event_bus_1.InProcessEventBus, durable_event_log_1.DurableEventLog, interrupted_run_sweeper_1.InterruptedRunSweeper, instance_ai_settings_service_1.InstanceAiSettingsService, instance_ai_gateway_service_1.InstanceAiGatewayService, instance_ai_browser_session_service_1.InstanceAiBrowserSessionService, instance_ai_memory_service_1.InstanceAiMemoryService, typeorm_agent_memory_1.TypeORMAgentMemory, typeorm_agent_checkpoint_store_1.TypeORMAgentCheckpointStore, ai_service_1.AiService, instance_ai_thread_grant_repository_1.InstanceAiThreadGrantRepository, instance_ai_pending_confirmation_repository_1.InstanceAiPendingConfirmationRepository, url_service_1.UrlService, instance_ai_event_log_repository_1.InstanceAiEventLogRepository, db_iteration_log_storage_1.DbIterationLogStorage, instance_write_access_service_1.InstanceWriteAccessService, telemetry_2.Telemetry, mcp_1.InstanceAiMcpRegistryService, db_1.UserRepository, instance_ai_temporary_workflow_service_1.InstanceAiTemporaryWorkflowService, n8n_core_1.ErrorReporter, config_1.SsrfProtectionConfig, backend_network_1.SsrfProtectionService, event_service_1.EventService, thread_credential_allowlist_service_1.EvalThreadCredentialAllowlistService, instance_ai_run_probe_1.InstanceAiRunProbe, instance_ai_model_service_1.InstanceAiModelService, instance_ai_credit_service_1.InstanceAiCreditService, publisher_service_1.Publisher, instance_ai_error_reporter_service_1.InstanceAiErrorReporterService, canvas_node_context_flag_gate_1.CanvasNodeContextFlagGate, push_1.Push, instance_ai_conversation_history_service_1.InstanceAiConversationHistoryService, instance_context_service_1.InstanceContextService, ai_preference_service_1.AiPreferenceService])
|
|
4474
4320
|
], InstanceAiService);
|
|
4475
4321
|
//# sourceMappingURL=instance-ai.service.js.map
|