n8n 2.39.5 → 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/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 +22 -2
- 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.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-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 +8 -4
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +192 -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 +37 -5
- 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 +13 -18
- package/dist/modules/instance-ai/instance-ai.service.js +180 -400
- 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 +6 -2
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js +20 -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 +4 -7
- package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting-scheduler.service.js +5 -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.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
- /package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting.service.d.ts +0 -0
- /package/dist/modules/{instance-reporting → instance-reporting.ee}/instance-reporting.service.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");
|
|
@@ -36,9 +37,11 @@ const bad_request_error_1 = require("../../errors/response-errors/bad-request.er
|
|
|
36
37
|
const forbidden_error_1 = require("../../errors/response-errors/forbidden.error");
|
|
37
38
|
const event_service_1 = require("../../events/event.service");
|
|
38
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");
|
|
39
41
|
const check_access_1 = require("../../permissions.ee/check-access");
|
|
40
42
|
const publisher_service_1 = require("../../scaling/pubsub/publisher.service");
|
|
41
43
|
const push_1 = require("../../push");
|
|
44
|
+
const ai_preference_service_1 = require("../../services/ai-preference.service");
|
|
42
45
|
const ai_service_1 = require("../../services/ai.service");
|
|
43
46
|
const instance_write_access_service_1 = require("../../services/instance-write-access.service");
|
|
44
47
|
const proxy_token_manager_1 = require("../../services/proxy-token-manager");
|
|
@@ -46,6 +49,7 @@ const url_service_1 = require("../../services/url.service");
|
|
|
46
49
|
const telemetry_2 = require("../../telemetry");
|
|
47
50
|
const utils_1 = require("../../utils");
|
|
48
51
|
const agent_preview_handoff_1 = require("./agent-preview-handoff");
|
|
52
|
+
const instance_context_service_1 = require("./instance-context.service");
|
|
49
53
|
const composite_local_mcp_server_1 = require("./browser/composite-local-mcp-server");
|
|
50
54
|
const instance_ai_browser_session_service_1 = require("./browser/instance-ai-browser-session.service");
|
|
51
55
|
const canvas_node_context_flag_gate_1 = require("./canvas-node-context-flag-gate");
|
|
@@ -75,7 +79,7 @@ const planned_task_action_runner_1 = require("./planned-task-action-runner");
|
|
|
75
79
|
const instance_ai_event_log_repository_1 = require("./repositories/instance-ai-event-log.repository");
|
|
76
80
|
const instance_ai_pending_confirmation_repository_1 = require("./repositories/instance-ai-pending-confirmation.repository");
|
|
77
81
|
const instance_ai_thread_grant_repository_1 = require("./repositories/instance-ai-thread-grant.repository");
|
|
78
|
-
const
|
|
82
|
+
const sandbox_2 = require("./sandbox");
|
|
79
83
|
const db_iteration_log_storage_1 = require("./storage/db-iteration-log-storage");
|
|
80
84
|
const typeorm_agent_checkpoint_store_1 = require("./storage/typeorm-agent-checkpoint-store");
|
|
81
85
|
const typeorm_agent_memory_1 = require("./storage/typeorm-agent-memory");
|
|
@@ -201,7 +205,6 @@ function isTelemetryConfigurableAgent(agent) {
|
|
|
201
205
|
agent !== null &&
|
|
202
206
|
typeof Reflect.get(agent, 'telemetry') === 'function');
|
|
203
207
|
}
|
|
204
|
-
const INSTANCE_AI_CHECKPOINT_PRUNE_RETRY_MS = 30 * 1000;
|
|
205
208
|
const WORKFLOW_SETUP_ROUTING_CLAIM_TTL_MS = 15 * 60 * 1000;
|
|
206
209
|
const CONFIRMATION_EXPIRED_MESSAGE = 'This confirmation has expired. Send a new message to continue.';
|
|
207
210
|
const RESUME_REJECTED_MESSAGE = 'I could not apply that confirmation. Send a new message to continue.';
|
|
@@ -242,7 +245,7 @@ function isAttachmentRejectedByProviderError(error) {
|
|
|
242
245
|
const haystack = [(0, get_error_message_1.getErrorMessage)(error), ...collectErrorText(error)].join(' ').toLowerCase();
|
|
243
246
|
return ATTACHMENT_SUBJECT_PATTERN.test(haystack) && ATTACHMENT_REFUSAL_PATTERN.test(haystack);
|
|
244
247
|
}
|
|
245
|
-
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.";
|
|
246
249
|
const OPERATIONAL_ERROR_USER_MESSAGE = 'I hit an operational error before I could finish that response. Please try again.';
|
|
247
250
|
const GENERIC_ERROR_USER_MESSAGE = 'Something went wrong before I could finish that response. Please try again.';
|
|
248
251
|
function getUserFacingErrorCode(error) {
|
|
@@ -345,7 +348,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
345
348
|
}
|
|
346
349
|
return this._mcpClientManager;
|
|
347
350
|
}
|
|
348
|
-
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) {
|
|
349
352
|
this.instanceSettings = instanceSettings;
|
|
350
353
|
this.adapterService = adapterService;
|
|
351
354
|
this.eventBus = eventBus;
|
|
@@ -378,6 +381,8 @@ let InstanceAiService = class InstanceAiService {
|
|
|
378
381
|
this.canvasNodeContextFlagGate = canvasNodeContextFlagGate;
|
|
379
382
|
this.push = push;
|
|
380
383
|
this.conversationHistoryService = conversationHistoryService;
|
|
384
|
+
this.instanceContext = instanceContext;
|
|
385
|
+
this.aiPreferenceService = aiPreferenceService;
|
|
381
386
|
this.runState = new instance_ai_1.RunStateRegistry((user) => user.id);
|
|
382
387
|
this.memoryTaskRegistry = new instance_ai_1.MemoryTaskRegistry();
|
|
383
388
|
this.domainAccessTrackersByThread = new Map();
|
|
@@ -386,16 +391,15 @@ let InstanceAiService = class InstanceAiService {
|
|
|
386
391
|
this.planRequestsByThread = new Map();
|
|
387
392
|
this.schedulerLocks = new Map();
|
|
388
393
|
this.failedInternalFollowUpStreaks = new Map();
|
|
389
|
-
this.pendingCheckpointReentries = new Map();
|
|
390
394
|
this.runDebugBuffer = new instance_ai_1.RunDebugBuffer();
|
|
391
|
-
this.checkpointPruningStopped = true;
|
|
392
395
|
this.inFlightExecutions = new Set();
|
|
393
396
|
this.preserveHitlOnShutdown = new Set();
|
|
394
397
|
this.logger = logger.scoped('instance-ai');
|
|
395
398
|
runProbe.registerActiveRunCountProvider(() => this.runState.activeRunCount());
|
|
396
|
-
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());
|
|
397
400
|
this.taskProjector = new workflow_verification_task_projector_1.WorkflowVerificationTaskProjector(this.agentMemory, this.eventBus, this.logger, this.workflowObligations);
|
|
398
401
|
this.instanceAiConfig = globalConfig.instanceAi;
|
|
402
|
+
this.aiConfig = globalConfig.ai;
|
|
399
403
|
this.backgroundTasks = new instance_ai_1.BackgroundTaskManager(MAX_CONCURRENT_BACKGROUND_TASKS_PER_THREAD, this.instanceAiConfig.maxConcurrentSubAgents);
|
|
400
404
|
this.suspendedThreads = new suspended_thread_persistence_service_1.SuspendedThreadPersistenceService({
|
|
401
405
|
logger: this.logger,
|
|
@@ -438,7 +442,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
438
442
|
eventLog: this.eventLogRepository,
|
|
439
443
|
aiService: this.aiService,
|
|
440
444
|
});
|
|
441
|
-
this.sandboxService = new
|
|
445
|
+
this.sandboxService = new sandbox_2.InstanceAiSandboxService({
|
|
442
446
|
config: this.instanceAiConfig,
|
|
443
447
|
logger: this.logger,
|
|
444
448
|
errorReporter: this.errorReporter,
|
|
@@ -446,6 +450,13 @@ let InstanceAiService = class InstanceAiService {
|
|
|
446
450
|
backgroundTasks: this.backgroundTasks,
|
|
447
451
|
settingsService: this.settingsService,
|
|
448
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
|
+
},
|
|
449
460
|
});
|
|
450
461
|
this.terminalOutcome = new instance_ai_terminal_outcome_service_1.InstanceAiTerminalOutcomeService({
|
|
451
462
|
eventBus: {
|
|
@@ -486,8 +497,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
486
497
|
});
|
|
487
498
|
});
|
|
488
499
|
this.liveness.start();
|
|
489
|
-
if (this.instanceSettings.isLeader)
|
|
490
|
-
this.startCheckpointPruning();
|
|
491
500
|
}
|
|
492
501
|
async createProxyRunConfig(user) {
|
|
493
502
|
if (!this.aiService.isProxyEnabled())
|
|
@@ -666,6 +675,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
666
675
|
maxIterations: instance_ai_1.MAX_STEPS.ORCHESTRATOR,
|
|
667
676
|
abortSignal: signal,
|
|
668
677
|
recoverUsageOnAbort: true,
|
|
678
|
+
...(0, model_stream_stall_options_1.modelStreamStallOptions)(this.aiConfig),
|
|
669
679
|
persistence: {
|
|
670
680
|
resourceId: user.id,
|
|
671
681
|
threadId,
|
|
@@ -692,6 +702,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
692
702
|
toolCallId,
|
|
693
703
|
abortSignal: signal,
|
|
694
704
|
recoverUsageOnAbort: true,
|
|
705
|
+
...(0, model_stream_stall_options_1.modelStreamStallOptions)(this.aiConfig),
|
|
695
706
|
persistence: {
|
|
696
707
|
resourceId: user.id,
|
|
697
708
|
threadId,
|
|
@@ -857,7 +868,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
857
868
|
error,
|
|
858
869
|
}));
|
|
859
870
|
}
|
|
860
|
-
async applyTaskControlLocally({ threadId, taskId, action, correction, }) {
|
|
871
|
+
async applyTaskControlLocally({ threadId, taskId, action, correction, userId, }) {
|
|
861
872
|
switch (action) {
|
|
862
873
|
case 'correct':
|
|
863
874
|
if (!taskId || correction === undefined)
|
|
@@ -876,7 +887,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
876
887
|
this.cancelRun(threadId);
|
|
877
888
|
return false;
|
|
878
889
|
case 'clear-thread':
|
|
879
|
-
await this.clearThreadState(threadId);
|
|
890
|
+
await this.clearThreadState(threadId, userId);
|
|
880
891
|
return false;
|
|
881
892
|
}
|
|
882
893
|
}
|
|
@@ -899,8 +910,12 @@ let InstanceAiService = class InstanceAiService {
|
|
|
899
910
|
await this.interruptedRunSweeper.cancelUnfinishedRuns(threadId);
|
|
900
911
|
}
|
|
901
912
|
}
|
|
902
|
-
async routeClearThreadState(threadId) {
|
|
903
|
-
await this.routeTaskControl({
|
|
913
|
+
async routeClearThreadState(threadId, userId) {
|
|
914
|
+
await this.routeTaskControl({
|
|
915
|
+
threadId,
|
|
916
|
+
action: 'clear-thread',
|
|
917
|
+
...(userId ? { userId } : {}),
|
|
918
|
+
});
|
|
904
919
|
}
|
|
905
920
|
async handleRelayTaskControl(payload) {
|
|
906
921
|
try {
|
|
@@ -1044,7 +1059,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1044
1059
|
clearTraceEvents(slug) {
|
|
1045
1060
|
this.tracing.clearTraceEvents(slug);
|
|
1046
1061
|
}
|
|
1047
|
-
async clearThreadState(threadId) {
|
|
1062
|
+
async clearThreadState(threadId, userId) {
|
|
1048
1063
|
this.liveness.clearThreadState(threadId);
|
|
1049
1064
|
const { active, suspended } = this.runState.clearThread(threadId);
|
|
1050
1065
|
if (active) {
|
|
@@ -1079,7 +1094,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1079
1094
|
this.memoryTaskRegistry.clearThread(threadId);
|
|
1080
1095
|
this.tracing.deleteTraceContextsForThread(threadId);
|
|
1081
1096
|
await this.deleteAgentBuilderSessions(threadId);
|
|
1082
|
-
await this.sandboxService.destroySandbox(threadId);
|
|
1097
|
+
await this.sandboxService.destroySandbox(threadId, 'thread_cleanup', userId);
|
|
1083
1098
|
await this.temporaryWorkflowService.reapForThreadCleanup(threadId);
|
|
1084
1099
|
await this.suspendedThreads.dropPendingConfirmationsForThread(threadId);
|
|
1085
1100
|
this.eventBus.clearThread(threadId);
|
|
@@ -1098,7 +1113,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1098
1113
|
}
|
|
1099
1114
|
}
|
|
1100
1115
|
async shutdown() {
|
|
1101
|
-
this.stopCheckpointPruning();
|
|
1102
1116
|
this.liveness.shutdown();
|
|
1103
1117
|
const { activeRuns, suspendedRuns, pendingThreadIds } = this.runState.shutdown();
|
|
1104
1118
|
const threadsWithPendingHitl = new Set(pendingThreadIds);
|
|
@@ -1124,6 +1138,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1124
1138
|
status: 'cancelled',
|
|
1125
1139
|
reason: 'service_shutdown',
|
|
1126
1140
|
});
|
|
1141
|
+
this.preserveHitlOnShutdown.add(run.runId);
|
|
1127
1142
|
run.abortController.abort();
|
|
1128
1143
|
}
|
|
1129
1144
|
for (const task of this.backgroundTasks.cancelAll()) {
|
|
@@ -1151,25 +1166,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1151
1166
|
await (0, instance_ai_1.shutdownProductTelemetryProviders)();
|
|
1152
1167
|
this.logger.debug('Instance AI service shut down');
|
|
1153
1168
|
}
|
|
1154
|
-
startCheckpointPruning() {
|
|
1155
|
-
if (this.checkpointPruneTimer || this.instanceAiConfig.pruneInterval <= 0)
|
|
1156
|
-
return;
|
|
1157
|
-
this.checkpointPruningStopped = false;
|
|
1158
|
-
this.scheduleCheckpointPrune(0);
|
|
1159
|
-
}
|
|
1160
|
-
stopCheckpointPruning() {
|
|
1161
|
-
this.checkpointPruningStopped = true;
|
|
1162
|
-
clearTimeout(this.checkpointPruneTimer);
|
|
1163
|
-
this.checkpointPruneTimer = undefined;
|
|
1164
|
-
}
|
|
1165
|
-
scheduleCheckpointPrune(delayMs = this.instanceAiConfig.pruneInterval) {
|
|
1166
|
-
if (this.checkpointPruningStopped)
|
|
1167
|
-
return;
|
|
1168
|
-
this.checkpointPruneTimer = setTimeout(() => {
|
|
1169
|
-
void this.runScheduledPrune();
|
|
1170
|
-
}, delayMs);
|
|
1171
|
-
this.checkpointPruneTimer.unref();
|
|
1172
|
-
}
|
|
1173
1169
|
trackInFlightExecution(promise) {
|
|
1174
1170
|
const tracked = promise.finally(() => {
|
|
1175
1171
|
this.inFlightExecutions.delete(tracked);
|
|
@@ -1200,26 +1196,23 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1200
1196
|
});
|
|
1201
1197
|
}
|
|
1202
1198
|
}
|
|
1203
|
-
async
|
|
1199
|
+
async pruneExpiredData(now = Date.now(), signal) {
|
|
1204
1200
|
const olderThan = new Date(now - this.instanceAiConfig.snapshotRetention);
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
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)
|
|
1213
1209
|
await this.hardDeleteExpiredCheckpoints(now);
|
|
1210
|
+
if (!signal?.aborted)
|
|
1214
1211
|
await this.suspendedThreads.pruneStalePendingConfirmations(now);
|
|
1215
|
-
|
|
1216
|
-
this.
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
this.logger.warn('Failed to expire stale Instance AI checkpoints', {
|
|
1220
|
-
error: (0, get_error_message_1.getErrorMessage)(error),
|
|
1221
|
-
});
|
|
1222
|
-
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');
|
|
1223
1216
|
}
|
|
1224
1217
|
}
|
|
1225
1218
|
async hardDeleteExpiredCheckpoints(now) {
|
|
@@ -1239,9 +1232,9 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1239
1232
|
});
|
|
1240
1233
|
}
|
|
1241
1234
|
}
|
|
1242
|
-
async pruneExpiredThreads() {
|
|
1235
|
+
async pruneExpiredThreads(signal) {
|
|
1243
1236
|
try {
|
|
1244
|
-
await this.memoryService.cleanupExpiredThreads(async (threadId) => await this.clearThreadState(threadId));
|
|
1237
|
+
await this.memoryService.cleanupExpiredThreads(async (threadId) => await this.clearThreadState(threadId), signal);
|
|
1245
1238
|
}
|
|
1246
1239
|
catch (error) {
|
|
1247
1240
|
this.logger.warn('Failed to clean up expired Instance AI conversation threads', {
|
|
@@ -1254,6 +1247,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1254
1247
|
observationalMemory: {
|
|
1255
1248
|
observerThresholdTokens: this.instanceAiConfig.observerMessageTokens,
|
|
1256
1249
|
reflectorThresholdTokens: this.instanceAiConfig.reflectorObservationTokens,
|
|
1250
|
+
midRunObservation: this.instanceAiConfig.midRunObservation,
|
|
1257
1251
|
onTaskUsage: async (report) => {
|
|
1258
1252
|
try {
|
|
1259
1253
|
const items = (0, instance_ai_1.tokenUsageToBuilderUsageItems)(report.model, report.usage);
|
|
@@ -1290,7 +1284,23 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1290
1284
|
await workflowTasks.updateBuildOutcome(workItemId, update);
|
|
1291
1285
|
await sync();
|
|
1292
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
|
+
},
|
|
1293
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
|
+
},
|
|
1294
1304
|
getLatestBuildOutcomeForWorkflow: async (workflowId) => await workflowTasks.getLatestBuildOutcomeForWorkflow(workflowId),
|
|
1295
1305
|
getWorkflowLoopState: async (workItemId) => await workflowTasks.getWorkflowLoopState(workItemId),
|
|
1296
1306
|
};
|
|
@@ -1439,12 +1449,12 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1439
1449
|
const localGatewayDisabledForUser = await this.settingsService.isLocalGatewayDisabledForUser(user.id);
|
|
1440
1450
|
const userGateway = this.gatewayService.findGateway(user.id);
|
|
1441
1451
|
await this.creditService.ensureQuotaLockApplied(user);
|
|
1442
|
-
const { searchProxyConfig,
|
|
1452
|
+
const { searchProxyConfig, tokenManager, proxyBaseUrl } = proxyRunConfig ?? (await this.createProxyRunConfig(user));
|
|
1443
1453
|
const proxyContext = { runId, threadId };
|
|
1444
1454
|
const modelId = proxyBaseUrl && tokenManager
|
|
1445
1455
|
? await this.modelService.resolveProxyModel(user, proxyBaseUrl, tokenManager, proxyContext)
|
|
1446
1456
|
: await this.modelService.resolveAgentModelConfig(user, proxyContext);
|
|
1447
|
-
const { configEvalsEnabled, mcpConnectionsEnabled, conversationHistoryEnabled, progressiveBuildingEnabled, nodeUsageEnabled, folderExplorationEnabled, } = await this.adapterService.resolveExperimentGates(user);
|
|
1457
|
+
const { configEvalsEnabled, mcpConnectionsEnabled, conversationHistoryEnabled, progressiveBuildingEnabled, nodeUsageEnabled, folderExplorationEnabled, aiPreferencesEnabled, } = await this.adapterService.resolveExperimentGates(user);
|
|
1448
1458
|
const conversationHistory = conversationHistoryEnabled
|
|
1449
1459
|
? this.conversationHistoryService.forContext(user.id, boundProjectId, threadId)
|
|
1450
1460
|
: undefined;
|
|
@@ -1490,7 +1500,23 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1490
1500
|
threadId,
|
|
1491
1501
|
runId,
|
|
1492
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
|
+
},
|
|
1493
1514
|
});
|
|
1515
|
+
context.markWorkflowSetupHandled = async (workflowId) => {
|
|
1516
|
+
await this.markWorkflowSetupHandled(threadId, workflowId, runId, {
|
|
1517
|
+
requirePersisted: true,
|
|
1518
|
+
});
|
|
1519
|
+
};
|
|
1494
1520
|
}
|
|
1495
1521
|
context.browserCredentialSetup = this.createBrowserCredentialSetupTracker(runId, user.id);
|
|
1496
1522
|
const sessionGrants = await this.loadThreadSessionGrants(threadId, user.id);
|
|
@@ -1557,7 +1583,10 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1557
1583
|
if (nodeDefDirs.length > 0) {
|
|
1558
1584
|
(0, workflow_sdk_1.setSchemaBaseDirs)(nodeDefDirs);
|
|
1559
1585
|
}
|
|
1560
|
-
const flagDisabledSkillIds = (0, instance_ai_1.disabledInstanceAiSkillIds)({
|
|
1586
|
+
const flagDisabledSkillIds = (0, instance_ai_1.disabledInstanceAiSkillIds)({
|
|
1587
|
+
configEvalsEnabled,
|
|
1588
|
+
instanceContextEnabled: this.instanceAiConfig.instanceContextEnabled,
|
|
1589
|
+
});
|
|
1561
1590
|
const selectedSkills = await (0, instance_ai_1.loadInstanceAiPromptSkills)(selectedPrompt.profile);
|
|
1562
1591
|
const selectedRuntimeSkills = selectedSkills.source;
|
|
1563
1592
|
const allRuntimeSkills = flagDisabledSkillIds.length > 0
|
|
@@ -1572,7 +1601,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1572
1601
|
if (sandboxStatus.workflowBuilderAvailable) {
|
|
1573
1602
|
const sandboxConfig = await this.instanceAiErrorReporter.withBoundary('instance-ai-sandbox-setup', { threadId, runId, userId: user.id, messageGroupId }, async () => await this.sandboxService.resolveSandboxConfig(user));
|
|
1574
1603
|
if (sandboxConfig.enabled) {
|
|
1575
|
-
workspaceRoot = (0,
|
|
1604
|
+
workspaceRoot = (0, sandbox_1.getPromptWorkspaceRoot)(sandboxConfig.provider);
|
|
1576
1605
|
let sandboxEntryPromise;
|
|
1577
1606
|
const getSandboxEntry = async () => {
|
|
1578
1607
|
sandboxEntryPromise ??= this.sandboxService
|
|
@@ -1589,7 +1618,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1589
1618
|
const scopeWorkspaceForAgent = async (workspace) => {
|
|
1590
1619
|
if (!workspace)
|
|
1591
1620
|
return undefined;
|
|
1592
|
-
const root = await (0,
|
|
1621
|
+
const root = await (0, sandbox_1.getWorkspaceRoot)(workspace);
|
|
1593
1622
|
return (0, agents_1.createScopedWorkspace)(workspace, root);
|
|
1594
1623
|
};
|
|
1595
1624
|
runtimeWorkspace = (0, instance_ai_1.createLazyRuntimeWorkspace)({
|
|
@@ -1616,7 +1645,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1616
1645
|
context.trackTelemetry = (eventName, properties) => {
|
|
1617
1646
|
this.telemetry.track(eventName, (0, telemetry_1.redactTelemetryProperties)(properties));
|
|
1618
1647
|
};
|
|
1619
|
-
const domainTools = (0, instance_ai_1.createAllTools)(context);
|
|
1620
1648
|
const orchestrationContext = {
|
|
1621
1649
|
threadId,
|
|
1622
1650
|
runId,
|
|
@@ -1625,9 +1653,10 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1625
1653
|
projectId: boundProjectId,
|
|
1626
1654
|
promptConfiguration: promptMetadata,
|
|
1627
1655
|
disabledToolNames: new Set(selectedSkills.disabledTools),
|
|
1656
|
+
setupPanelEnabled: (0, instance_ai_1.isSetupPanelEnabled)(context),
|
|
1628
1657
|
orchestratorAgentId: (0, instance_ai_1.orchestratorAgentId)(runId),
|
|
1629
1658
|
modelId,
|
|
1630
|
-
|
|
1659
|
+
modelStreamStallOptions: (0, model_stream_stall_options_1.modelStreamStallOptions)(this.aiConfig),
|
|
1631
1660
|
eventBus: this.eventBus,
|
|
1632
1661
|
logger: this.logger,
|
|
1633
1662
|
trackTelemetry: (eventName, properties) => {
|
|
@@ -1654,7 +1683,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1654
1683
|
});
|
|
1655
1684
|
}
|
|
1656
1685
|
},
|
|
1657
|
-
domainTools,
|
|
1658
1686
|
abortSignal,
|
|
1659
1687
|
taskStorage,
|
|
1660
1688
|
timeZone: this.defaultTimeZone,
|
|
@@ -1664,27 +1692,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1664
1692
|
oauth2CallbackUrl: this.oauth2CallbackUrl,
|
|
1665
1693
|
webhookBaseUrl: this.webhookBaseUrl,
|
|
1666
1694
|
formBaseUrl: this.formBaseUrl,
|
|
1667
|
-
waitForConfirmation: async (requestId) => {
|
|
1668
|
-
this.runState.touchActiveRun(threadId);
|
|
1669
|
-
return await new Promise((resolve) => {
|
|
1670
|
-
this.runState.registerPendingConfirmation(requestId, {
|
|
1671
|
-
resolve,
|
|
1672
|
-
threadId,
|
|
1673
|
-
userId: user.id,
|
|
1674
|
-
createdAt: Date.now(),
|
|
1675
|
-
});
|
|
1676
|
-
void this.suspendedThreads.persistPendingConfirmation({
|
|
1677
|
-
requestId,
|
|
1678
|
-
threadId,
|
|
1679
|
-
userId: user.id,
|
|
1680
|
-
runId,
|
|
1681
|
-
messageGroupId,
|
|
1682
|
-
kind: 'inline',
|
|
1683
|
-
});
|
|
1684
|
-
});
|
|
1685
|
-
},
|
|
1686
1695
|
cancelBackgroundTask: async (taskId) => this.cancelBackgroundTask(threadId, taskId),
|
|
1687
|
-
spawnBackgroundTask: (opts) => this.spawnBackgroundTask(runId, opts, messageGroupId),
|
|
1688
1696
|
touchRun: () => this.runState.touchActiveRun(threadId),
|
|
1689
1697
|
touchBackgroundTask: (taskId) => this.backgroundTasks.touchTask(threadId, taskId),
|
|
1690
1698
|
plannedTaskService,
|
|
@@ -1696,8 +1704,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1696
1704
|
workspaceRoot,
|
|
1697
1705
|
nodeDefinitionDirs: nodeDefDirs.length > 0 ? nodeDefDirs : undefined,
|
|
1698
1706
|
domainContext: context,
|
|
1699
|
-
tracingProxyConfig,
|
|
1700
|
-
memory,
|
|
1701
1707
|
};
|
|
1702
1708
|
return {
|
|
1703
1709
|
context,
|
|
@@ -1709,6 +1715,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1709
1715
|
modelId,
|
|
1710
1716
|
orchestrationContext,
|
|
1711
1717
|
conversationHistory,
|
|
1718
|
+
aiPreferencesEnabled,
|
|
1712
1719
|
};
|
|
1713
1720
|
}
|
|
1714
1721
|
getAgentExecutionService() {
|
|
@@ -1879,37 +1886,26 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1879
1886
|
return;
|
|
1880
1887
|
await this.schedulePlannedTasks(user, task.threadId);
|
|
1881
1888
|
}
|
|
1882
|
-
async
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
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 '';
|
|
1894
1908
|
}
|
|
1895
|
-
const outcome = (0, workflow_verification_obligation_service_1.parseWorkflowBuildOutcome)(task.outcome);
|
|
1896
|
-
const startedRunId = await this.startInternalFollowUpRun(user, task.threadId, this.buildWorkflowVerificationFollowUpMessage({
|
|
1897
|
-
obligation,
|
|
1898
|
-
outcome,
|
|
1899
|
-
sourceTask: {
|
|
1900
|
-
taskId: task.taskId,
|
|
1901
|
-
role: task.role,
|
|
1902
|
-
status: task.status,
|
|
1903
|
-
result: task.result,
|
|
1904
|
-
error: task.error,
|
|
1905
|
-
plannedTaskId: task.plannedTaskId,
|
|
1906
|
-
workItemId: task.workItemId,
|
|
1907
|
-
},
|
|
1908
|
-
}), task.messageGroupId, false, undefined, 'workflow_verification');
|
|
1909
|
-
this.trackWorkflowVerificationObligation(obligation, 'follow_up_start_attempted', {
|
|
1910
|
-
follow_up_started: startedRunId.length > 0,
|
|
1911
|
-
});
|
|
1912
|
-
return startedRunId.length > 0;
|
|
1913
1909
|
}
|
|
1914
1910
|
buildWorkflowSetupFollowUpMessage(obligation) {
|
|
1915
1911
|
const payload = {
|
|
@@ -1927,7 +1923,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1927
1923
|
return undefined;
|
|
1928
1924
|
return typeof suspendPayload.workflowId === 'string' ? suspendPayload.workflowId : undefined;
|
|
1929
1925
|
}
|
|
1930
|
-
async markWorkflowSetupHandled(threadId, workflowId, runId) {
|
|
1926
|
+
async markWorkflowSetupHandled(threadId, workflowId, runId, options = {}) {
|
|
1931
1927
|
const records = await this.listWorkflowLoopRecords(threadId);
|
|
1932
1928
|
if (records.length === 0)
|
|
1933
1929
|
return false;
|
|
@@ -1954,9 +1950,19 @@ let InstanceAiService = class InstanceAiService {
|
|
|
1954
1950
|
const claim = await this.claimWorkItemSetupRouting(threadId, record);
|
|
1955
1951
|
if (!claim)
|
|
1956
1952
|
continue;
|
|
1957
|
-
|
|
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
|
+
}
|
|
1958
1961
|
if (!marked) {
|
|
1959
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
|
+
}
|
|
1960
1966
|
this.logger.warn('Workflow setup completed but routing marker was not saved', {
|
|
1961
1967
|
threadId,
|
|
1962
1968
|
workItemId: record.state.workItemId,
|
|
@@ -2162,7 +2168,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2162
2168
|
async doSchedulePlannedTasks(user, threadId) {
|
|
2163
2169
|
const revalidated = await this.revalidateActiveUser(user.id);
|
|
2164
2170
|
if (!revalidated) {
|
|
2165
|
-
this.logger.warn('Cancelling run: user no longer authorized for
|
|
2171
|
+
this.logger.warn('Cancelling run: user no longer authorized for n8n Assistant', {
|
|
2166
2172
|
userId: user.id,
|
|
2167
2173
|
threadId,
|
|
2168
2174
|
});
|
|
@@ -2358,7 +2364,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2358
2364
|
}
|
|
2359
2365
|
const executionPushRef = this.threadPushRef.get(threadId);
|
|
2360
2366
|
const environment = await this.createExecutionEnvironment(user, threadId, runId, signal, messageGroupId, executionPushRef, proxyRunConfig);
|
|
2361
|
-
const { context, memory, taskStorage, workflowTasks, plannedTaskService, modelId, orchestrationContext, conversationHistory, } = environment;
|
|
2367
|
+
const { context, memory, taskStorage, workflowTasks, plannedTaskService, modelId, orchestrationContext, conversationHistory, aiPreferencesEnabled, } = environment;
|
|
2362
2368
|
promptVersion = orchestrationContext.promptConfiguration?.version;
|
|
2363
2369
|
(0, instance_ai_1.setTracePromptVersion)(tracing, promptVersion);
|
|
2364
2370
|
aiCreatedWorkflowIds = context.aiCreatedWorkflowIds ??= new Set();
|
|
@@ -2453,9 +2459,13 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2453
2459
|
previewSession: context.agentPreviewSession,
|
|
2454
2460
|
});
|
|
2455
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
|
+
}
|
|
2456
2465
|
else {
|
|
2457
2466
|
handoffContextBlock = buildHandoffContextBlock(handoffContext);
|
|
2458
2467
|
}
|
|
2468
|
+
const setupStateBlock = resumeReason === undefined ? await this.buildWorkflowSetupStateBlock(context) : '';
|
|
2459
2469
|
const thread = await memory.getThread(threadId);
|
|
2460
2470
|
const isOpeningTurn = Boolean(thread && !thread.title);
|
|
2461
2471
|
if (isOpeningTurn) {
|
|
@@ -2473,6 +2483,13 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2473
2483
|
},
|
|
2474
2484
|
});
|
|
2475
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
|
+
});
|
|
2476
2493
|
const existingTasks = await taskStorage.get(threadId);
|
|
2477
2494
|
if (existingTasks) {
|
|
2478
2495
|
this.eventBus.publish(threadId, {
|
|
@@ -2497,20 +2514,33 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2497
2514
|
: attachmentManifest
|
|
2498
2515
|
? `${enrichedMessage}\n\n${attachmentManifest}`
|
|
2499
2516
|
: enrichedMessage;
|
|
2500
|
-
const messageWithContext = [
|
|
2517
|
+
const messageWithContext = [
|
|
2518
|
+
contextResourcesBlock,
|
|
2519
|
+
handoffContextBlock,
|
|
2520
|
+
setupStateBlock,
|
|
2521
|
+
instanceContext?.block ?? '',
|
|
2522
|
+
messageBody,
|
|
2523
|
+
]
|
|
2501
2524
|
.filter(Boolean)
|
|
2502
2525
|
.join('\n\n');
|
|
2503
|
-
const [
|
|
2504
|
-
this.
|
|
2526
|
+
const [boundProject, pastConversationsSection] = await Promise.all([
|
|
2527
|
+
this.resolveBoundProject(context),
|
|
2505
2528
|
isOpeningTurn ? conversationHistory?.getPastConversationsSection() : undefined,
|
|
2506
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;
|
|
2507
2534
|
const messageWithProject = projectSection
|
|
2508
2535
|
? (0, internal_messages_1.withProjectContext)(messageWithContext, projectSection)
|
|
2509
2536
|
: messageWithContext;
|
|
2510
2537
|
const messageWithPastConversations = pastConversationsSection
|
|
2511
2538
|
? (0, internal_messages_1.withPastConversations)(messageWithProject, pastConversationsSection)
|
|
2512
2539
|
: messageWithProject;
|
|
2513
|
-
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));
|
|
2514
2544
|
const promptBuildRun = tracing
|
|
2515
2545
|
? await tracing.startChildRun(tracing.messageRun, {
|
|
2516
2546
|
name: 'prepare: prompt',
|
|
@@ -2587,6 +2617,19 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2587
2617
|
const agent = await this.createAgentFromEnvironment(environment, threadId, runId, user, tracing);
|
|
2588
2618
|
const streamOptions = this.buildOrchestratorAgentStreamOptions(user, threadId, runId, signal);
|
|
2589
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
|
+
}
|
|
2590
2633
|
const result = tracing
|
|
2591
2634
|
? await tracing.withActiveSpan(tracing.actorRun, async () => {
|
|
2592
2635
|
return await (0, instance_ai_1.streamAgentRun)(agent, streamInput, streamOptions, {
|
|
@@ -2639,7 +2682,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2639
2682
|
plannedBuild,
|
|
2640
2683
|
runHandoff: runControl.state,
|
|
2641
2684
|
});
|
|
2642
|
-
|
|
2685
|
+
await this.suspendedThreads.persistPendingConfirmation({
|
|
2643
2686
|
requestId: result.suspension.requestId,
|
|
2644
2687
|
threadId,
|
|
2645
2688
|
userId: user.id,
|
|
@@ -2675,6 +2718,8 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2675
2718
|
});
|
|
2676
2719
|
return;
|
|
2677
2720
|
}
|
|
2721
|
+
if (signal.aborted && !this.shouldPreserveHitlOnShutdown(runId))
|
|
2722
|
+
return;
|
|
2678
2723
|
if (result.confirmationEvent) {
|
|
2679
2724
|
this.trackConfirmationRequest(user.id, threadId, result.confirmationEvent);
|
|
2680
2725
|
this.eventBus.publish(threadId, result.confirmationEvent);
|
|
@@ -2912,9 +2957,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2912
2957
|
else if (reschedule) {
|
|
2913
2958
|
await this.schedulePlannedTasks(user, threadId);
|
|
2914
2959
|
}
|
|
2915
|
-
if (reschedule) {
|
|
2916
|
-
await this.drainPendingCheckpointReentries(user, threadId);
|
|
2917
|
-
}
|
|
2918
2960
|
await this.taskProjector.syncFromWorkflowLoop(threadId, runId);
|
|
2919
2961
|
if (reschedule) {
|
|
2920
2962
|
await this.maybeStartWorkflowSetupFollowUp(user, threadId);
|
|
@@ -2925,74 +2967,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
2925
2967
|
}
|
|
2926
2968
|
}
|
|
2927
2969
|
}
|
|
2928
|
-
queuePendingCheckpointReentry(threadId, checkpointTaskId) {
|
|
2929
|
-
let set = this.pendingCheckpointReentries.get(threadId);
|
|
2930
|
-
if (!set) {
|
|
2931
|
-
set = new Set();
|
|
2932
|
-
this.pendingCheckpointReentries.set(threadId, set);
|
|
2933
|
-
}
|
|
2934
|
-
set.add(checkpointTaskId);
|
|
2935
|
-
}
|
|
2936
|
-
async drainPendingCheckpointReentries(user, threadId) {
|
|
2937
|
-
const set = this.pendingCheckpointReentries.get(threadId);
|
|
2938
|
-
if (!set || set.size === 0)
|
|
2939
|
-
return;
|
|
2940
|
-
const snapshot = [...set];
|
|
2941
|
-
for (const checkpointTaskId of snapshot) {
|
|
2942
|
-
if (this.runState.getActiveRunId(threadId) || this.runState.hasSuspendedRun(threadId)) {
|
|
2943
|
-
return;
|
|
2944
|
-
}
|
|
2945
|
-
const siblings = this.backgroundTasks.getRunningTasksByParentCheckpoint(threadId, checkpointTaskId);
|
|
2946
|
-
if (siblings.length > 0)
|
|
2947
|
-
continue;
|
|
2948
|
-
set.delete(checkpointTaskId);
|
|
2949
|
-
await this.reenterCheckpointById(user, threadId, checkpointTaskId);
|
|
2950
|
-
}
|
|
2951
|
-
if (set.size === 0)
|
|
2952
|
-
this.pendingCheckpointReentries.delete(threadId);
|
|
2953
|
-
}
|
|
2954
|
-
async reenterCheckpointById(user, threadId, checkpointTaskId, messageGroupId) {
|
|
2955
|
-
try {
|
|
2956
|
-
const { plannedTaskService } = await this.createPlannedTaskState();
|
|
2957
|
-
const graph = await plannedTaskService.getGraph(threadId);
|
|
2958
|
-
const checkpoint = graph?.tasks.find((t) => t.id === checkpointTaskId);
|
|
2959
|
-
if (!graph || !checkpoint || checkpoint.kind !== 'checkpoint')
|
|
2960
|
-
return false;
|
|
2961
|
-
if (checkpoint.status !== 'running')
|
|
2962
|
-
return false;
|
|
2963
|
-
const startedRunId = await this.startInternalFollowUpRun(user, threadId, this.buildPlannedTaskFollowUpMessage('checkpoint', graph, { checkpoint }), messageGroupId, false, { isCheckpointFollowUp: true, checkpointTaskId });
|
|
2964
|
-
if (!startedRunId)
|
|
2965
|
-
return false;
|
|
2966
|
-
this.logger.debug('Re-entered checkpoint follow-up', {
|
|
2967
|
-
threadId,
|
|
2968
|
-
checkpointTaskId,
|
|
2969
|
-
messageGroupId,
|
|
2970
|
-
});
|
|
2971
|
-
return true;
|
|
2972
|
-
}
|
|
2973
|
-
catch (error) {
|
|
2974
|
-
this.logger.error('Failed to re-enter checkpoint follow-up', {
|
|
2975
|
-
threadId,
|
|
2976
|
-
checkpointTaskId,
|
|
2977
|
-
error: error instanceof Error ? error.message : String(error),
|
|
2978
|
-
});
|
|
2979
|
-
return false;
|
|
2980
|
-
}
|
|
2981
|
-
}
|
|
2982
|
-
async maybeReenterParentCheckpoint(user, threadId, task) {
|
|
2983
|
-
const parentCheckpointId = task.parentCheckpointId;
|
|
2984
|
-
if (!parentCheckpointId)
|
|
2985
|
-
return false;
|
|
2986
|
-
const siblings = this.backgroundTasks
|
|
2987
|
-
.getRunningTasksByParentCheckpoint(threadId, parentCheckpointId)
|
|
2988
|
-
.filter((t) => t.taskId !== task.taskId);
|
|
2989
|
-
if (siblings.length > 0)
|
|
2990
|
-
return false;
|
|
2991
|
-
if (this.runState.getActiveRunId(threadId) || this.runState.hasSuspendedRun(threadId)) {
|
|
2992
|
-
return false;
|
|
2993
|
-
}
|
|
2994
|
-
return await this.reenterCheckpointById(user, threadId, parentCheckpointId, task.messageGroupId);
|
|
2995
|
-
}
|
|
2996
2970
|
async finalizeCheckpointFollowUp(user, threadId, checkpointTaskId, { reschedule = true } = {}) {
|
|
2997
2971
|
try {
|
|
2998
2972
|
const { plannedTaskService } = await this.createPlannedTaskState();
|
|
@@ -3080,7 +3054,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3080
3054
|
if (suspended?.user.id === requestingUserId) {
|
|
3081
3055
|
this.cancelRun(suspended.threadId);
|
|
3082
3056
|
}
|
|
3083
|
-
this.logger.warn('Rejecting confirmation: user no longer authorized for
|
|
3057
|
+
this.logger.warn('Rejecting confirmation: user no longer authorized for n8n Assistant', {
|
|
3084
3058
|
userId: requestingUserId,
|
|
3085
3059
|
requestId,
|
|
3086
3060
|
});
|
|
@@ -3252,14 +3226,14 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3252
3226
|
return null;
|
|
3253
3227
|
}
|
|
3254
3228
|
}
|
|
3255
|
-
async
|
|
3229
|
+
async resolveBoundProject(context) {
|
|
3256
3230
|
const projectId = context.projectId;
|
|
3257
3231
|
if (!projectId)
|
|
3258
3232
|
return undefined;
|
|
3259
3233
|
try {
|
|
3260
3234
|
const project = await context.workspaceService?.getProject?.(projectId);
|
|
3261
3235
|
if (project)
|
|
3262
|
-
return
|
|
3236
|
+
return project;
|
|
3263
3237
|
this.logger.warn('Instance AI could not name the bound project for this turn', {
|
|
3264
3238
|
projectId,
|
|
3265
3239
|
reason: context.workspaceService?.getProject ? 'not-readable' : 'no-workspace-adapter',
|
|
@@ -3280,6 +3254,9 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3280
3254
|
return undefined;
|
|
3281
3255
|
}
|
|
3282
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
|
+
}
|
|
3283
3260
|
async canAccessAgentPreviewHandoff(user, projectId) {
|
|
3284
3261
|
const requiredScopes = ['agent:read', 'agent:update'];
|
|
3285
3262
|
return await (0, check_access_1.userHasScopes)(user, requiredScopes, false, { projectId });
|
|
@@ -3332,7 +3309,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3332
3309
|
}
|
|
3333
3310
|
const activeUser = await this.revalidateActiveUser(user.id);
|
|
3334
3311
|
if (!activeUser) {
|
|
3335
|
-
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', {
|
|
3336
3313
|
userId: user.id,
|
|
3337
3314
|
threadId,
|
|
3338
3315
|
requestId,
|
|
@@ -3542,7 +3519,7 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3542
3519
|
plannedBuild: opts.plannedBuild,
|
|
3543
3520
|
runHandoff: runControl.state,
|
|
3544
3521
|
});
|
|
3545
|
-
|
|
3522
|
+
await this.suspendedThreads.persistPendingConfirmation({
|
|
3546
3523
|
requestId: result.suspension.requestId,
|
|
3547
3524
|
threadId: opts.threadId,
|
|
3548
3525
|
userId: opts.user.id,
|
|
@@ -3576,6 +3553,8 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3576
3553
|
});
|
|
3577
3554
|
return;
|
|
3578
3555
|
}
|
|
3556
|
+
if (opts.signal.aborted && !this.shouldPreserveHitlOnShutdown(opts.runId))
|
|
3557
|
+
return;
|
|
3579
3558
|
if (result.confirmationEvent) {
|
|
3580
3559
|
this.trackConfirmationRequest(opts.user.id, opts.threadId, result.confirmationEvent);
|
|
3581
3560
|
this.eventBus.publish(opts.threadId, result.confirmationEvent);
|
|
@@ -3825,9 +3804,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3825
3804
|
else if (reschedule) {
|
|
3826
3805
|
await this.schedulePlannedTasks(opts.user, opts.threadId);
|
|
3827
3806
|
}
|
|
3828
|
-
if (reschedule) {
|
|
3829
|
-
await this.drainPendingCheckpointReentries(opts.user, opts.threadId);
|
|
3830
|
-
}
|
|
3831
3807
|
if (completedSetupWorkflowId) {
|
|
3832
3808
|
await this.markWorkflowSetupHandled(opts.threadId, completedSetupWorkflowId, opts.runId);
|
|
3833
3809
|
}
|
|
@@ -3929,190 +3905,6 @@ let InstanceAiService = class InstanceAiService {
|
|
|
3929
3905
|
return undefined;
|
|
3930
3906
|
}
|
|
3931
3907
|
}
|
|
3932
|
-
spawnBackgroundTask(runId, opts, messageGroupIdOverride) {
|
|
3933
|
-
const outcome = this.backgroundTasks.spawn({
|
|
3934
|
-
taskId: opts.taskId,
|
|
3935
|
-
threadId: opts.threadId,
|
|
3936
|
-
runId,
|
|
3937
|
-
role: opts.role,
|
|
3938
|
-
agentId: opts.agentId,
|
|
3939
|
-
messageGroupId: messageGroupIdOverride ?? this.runState.getMessageGroupId(opts.threadId),
|
|
3940
|
-
plannedTaskId: opts.plannedTaskId,
|
|
3941
|
-
workItemId: opts.workItemId,
|
|
3942
|
-
traceContext: opts.traceContext,
|
|
3943
|
-
createTraceContext: opts.createTraceContext,
|
|
3944
|
-
dedupeKey: opts.dedupeKey,
|
|
3945
|
-
parentCheckpointId: opts.parentCheckpointId,
|
|
3946
|
-
run: opts.run,
|
|
3947
|
-
onLimitReached: async (errorMessage) => {
|
|
3948
|
-
await this.tracing.finalizeDetachedTraceRun(opts.taskId, opts.traceContext, {
|
|
3949
|
-
status: 'failed',
|
|
3950
|
-
outputs: {
|
|
3951
|
-
taskId: opts.taskId,
|
|
3952
|
-
agentId: opts.agentId,
|
|
3953
|
-
role: opts.role,
|
|
3954
|
-
},
|
|
3955
|
-
error: errorMessage,
|
|
3956
|
-
metadata: {
|
|
3957
|
-
...(opts.plannedTaskId ? { planned_task_id: opts.plannedTaskId } : {}),
|
|
3958
|
-
...(opts.workItemId ? { work_item_id: opts.workItemId } : {}),
|
|
3959
|
-
},
|
|
3960
|
-
});
|
|
3961
|
-
this.eventBus.publish(opts.threadId, {
|
|
3962
|
-
type: 'agent-completed',
|
|
3963
|
-
runId,
|
|
3964
|
-
agentId: opts.agentId,
|
|
3965
|
-
payload: {
|
|
3966
|
-
role: opts.role,
|
|
3967
|
-
result: '',
|
|
3968
|
-
error: errorMessage,
|
|
3969
|
-
},
|
|
3970
|
-
});
|
|
3971
|
-
},
|
|
3972
|
-
onCompleted: async (task) => {
|
|
3973
|
-
await this.tracing.finalizeBackgroundTaskTracing(task, 'completed');
|
|
3974
|
-
this.eventBus.publish(opts.threadId, {
|
|
3975
|
-
type: 'agent-completed',
|
|
3976
|
-
runId,
|
|
3977
|
-
agentId: opts.agentId,
|
|
3978
|
-
payload: { role: opts.role, result: task.result ?? '' },
|
|
3979
|
-
});
|
|
3980
|
-
const user = this.runState.getThreadUser(opts.threadId);
|
|
3981
|
-
if (user) {
|
|
3982
|
-
await this.handlePlannedTaskSettlement(user, task, 'succeeded');
|
|
3983
|
-
}
|
|
3984
|
-
},
|
|
3985
|
-
onFailed: async (task) => {
|
|
3986
|
-
await this.tracing.finalizeBackgroundTaskTracing(task, 'failed');
|
|
3987
|
-
this.instanceAiErrorReporter.report(new Error(task.error ?? 'Instance AI background task failed'), {
|
|
3988
|
-
component: 'instance-ai-background-task',
|
|
3989
|
-
threadId: opts.threadId,
|
|
3990
|
-
runId,
|
|
3991
|
-
tracing: task.traceContext,
|
|
3992
|
-
agentId: opts.agentId,
|
|
3993
|
-
messageGroupId: task.messageGroupId,
|
|
3994
|
-
taskId: task.taskId,
|
|
3995
|
-
role: task.role,
|
|
3996
|
-
});
|
|
3997
|
-
this.eventBus.publish(opts.threadId, {
|
|
3998
|
-
type: 'agent-completed',
|
|
3999
|
-
runId,
|
|
4000
|
-
agentId: opts.agentId,
|
|
4001
|
-
payload: { role: opts.role, result: '', error: task.error ?? 'Unknown error' },
|
|
4002
|
-
});
|
|
4003
|
-
const user = this.runState.getThreadUser(opts.threadId);
|
|
4004
|
-
if (user) {
|
|
4005
|
-
await this.handlePlannedTaskSettlement(user, task, 'failed');
|
|
4006
|
-
}
|
|
4007
|
-
},
|
|
4008
|
-
onSettled: async (task) => {
|
|
4009
|
-
await this.terminalOutcome.recordBackgroundTerminalOutcome(task);
|
|
4010
|
-
if (task.plannedTaskId)
|
|
4011
|
-
return;
|
|
4012
|
-
await this.taskProjector.syncFromBackgroundTask(task);
|
|
4013
|
-
const parentCheckpointId = task.parentCheckpointId;
|
|
4014
|
-
if (parentCheckpointId) {
|
|
4015
|
-
const user = this.runState.getThreadUser(opts.threadId);
|
|
4016
|
-
if (!user) {
|
|
4017
|
-
this.queuePendingCheckpointReentry(opts.threadId, parentCheckpointId);
|
|
4018
|
-
return;
|
|
4019
|
-
}
|
|
4020
|
-
const reentered = await this.maybeReenterParentCheckpoint(user, opts.threadId, task);
|
|
4021
|
-
if (!reentered) {
|
|
4022
|
-
this.queuePendingCheckpointReentry(opts.threadId, parentCheckpointId);
|
|
4023
|
-
}
|
|
4024
|
-
return;
|
|
4025
|
-
}
|
|
4026
|
-
const remaining = this.backgroundTasks.getRunningTasks(opts.threadId);
|
|
4027
|
-
const hasActiveRun = !!this.runState.getActiveRunId(opts.threadId);
|
|
4028
|
-
const hasSuspendedRun = this.runState.hasSuspendedRun(opts.threadId);
|
|
4029
|
-
if (remaining.length === 0 && !hasActiveRun && !hasSuspendedRun) {
|
|
4030
|
-
if (this.liveness.hasTimedOutActiveRunThread(opts.threadId)) {
|
|
4031
|
-
this.logger.debug('Skipping background auto-follow-up after active run timeout', {
|
|
4032
|
-
threadId: opts.threadId,
|
|
4033
|
-
taskId: task.taskId,
|
|
4034
|
-
});
|
|
4035
|
-
return;
|
|
4036
|
-
}
|
|
4037
|
-
if (task.timeoutReason) {
|
|
4038
|
-
this.logger.debug('Skipping background auto-follow-up after task timeout', {
|
|
4039
|
-
threadId: opts.threadId,
|
|
4040
|
-
taskId: task.taskId,
|
|
4041
|
-
timeoutReason: task.timeoutReason,
|
|
4042
|
-
});
|
|
4043
|
-
return;
|
|
4044
|
-
}
|
|
4045
|
-
const user = this.runState.getThreadUser(opts.threadId);
|
|
4046
|
-
if (user) {
|
|
4047
|
-
const verificationFollowUpStarted = await this.maybeStartWorkflowVerificationFollowUp(user, task);
|
|
4048
|
-
if (verificationFollowUpStarted)
|
|
4049
|
-
return;
|
|
4050
|
-
const setupFollowUpStarted = await this.maybeStartWorkflowSetupFollowUp(user, task.threadId);
|
|
4051
|
-
if (setupFollowUpStarted)
|
|
4052
|
-
return;
|
|
4053
|
-
const payload = JSON.stringify({
|
|
4054
|
-
role: opts.role,
|
|
4055
|
-
status: task.result ? 'completed' : task.error ? 'failed' : 'finished',
|
|
4056
|
-
result: task.result ?? undefined,
|
|
4057
|
-
outcome: task.outcome ?? undefined,
|
|
4058
|
-
error: task.error ?? undefined,
|
|
4059
|
-
}, null, 2);
|
|
4060
|
-
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);
|
|
4061
|
-
}
|
|
4062
|
-
}
|
|
4063
|
-
},
|
|
4064
|
-
});
|
|
4065
|
-
if (outcome.status === 'started') {
|
|
4066
|
-
void this.taskProjector.syncFromBackgroundTask(outcome.task);
|
|
4067
|
-
return { status: 'started', taskId: outcome.task.taskId, agentId: outcome.task.agentId };
|
|
4068
|
-
}
|
|
4069
|
-
if (outcome.status === 'duplicate') {
|
|
4070
|
-
this.logger.warn('Background task dispatch deduped — task already in flight', {
|
|
4071
|
-
threadId: opts.threadId,
|
|
4072
|
-
requestedTaskId: opts.taskId,
|
|
4073
|
-
existingTaskId: outcome.existing.taskId,
|
|
4074
|
-
plannedTaskId: opts.dedupeKey?.plannedTaskId,
|
|
4075
|
-
workflowId: opts.dedupeKey?.workflowId,
|
|
4076
|
-
role: opts.role,
|
|
4077
|
-
});
|
|
4078
|
-
void this.tracing.finalizeDetachedTraceRun(opts.taskId, opts.traceContext, {
|
|
4079
|
-
status: 'cancelled',
|
|
4080
|
-
outputs: {
|
|
4081
|
-
taskId: opts.taskId,
|
|
4082
|
-
agentId: opts.agentId,
|
|
4083
|
-
role: opts.role,
|
|
4084
|
-
deduped_to: outcome.existing.taskId,
|
|
4085
|
-
},
|
|
4086
|
-
metadata: {
|
|
4087
|
-
deduped: true,
|
|
4088
|
-
existing_task_id: outcome.existing.taskId,
|
|
4089
|
-
...(opts.plannedTaskId ? { planned_task_id: opts.plannedTaskId } : {}),
|
|
4090
|
-
...(opts.workItemId ? { work_item_id: opts.workItemId } : {}),
|
|
4091
|
-
},
|
|
4092
|
-
});
|
|
4093
|
-
this.eventBus.publish(opts.threadId, {
|
|
4094
|
-
type: 'agent-completed',
|
|
4095
|
-
runId,
|
|
4096
|
-
agentId: opts.agentId,
|
|
4097
|
-
payload: {
|
|
4098
|
-
role: opts.role,
|
|
4099
|
-
result: '',
|
|
4100
|
-
error: `Deduped: task already in flight as ${outcome.existing.taskId}`,
|
|
4101
|
-
},
|
|
4102
|
-
});
|
|
4103
|
-
return {
|
|
4104
|
-
status: 'duplicate',
|
|
4105
|
-
existing: {
|
|
4106
|
-
taskId: outcome.existing.taskId,
|
|
4107
|
-
agentId: outcome.existing.agentId,
|
|
4108
|
-
role: outcome.existing.role,
|
|
4109
|
-
plannedTaskId: outcome.existing.plannedTaskId,
|
|
4110
|
-
workItemId: outcome.existing.workItemId,
|
|
4111
|
-
},
|
|
4112
|
-
};
|
|
4113
|
-
}
|
|
4114
|
-
return { status: 'limit-reached' };
|
|
4115
|
-
}
|
|
4116
3908
|
async snapshotAttachedAgents(attachments, orchestrationContext, tracing) {
|
|
4117
3909
|
const delegate = orchestrationContext.domainContext?.builderDelegate;
|
|
4118
3910
|
if (!delegate || !tracing)
|
|
@@ -4522,20 +4314,8 @@ __decorate([
|
|
|
4522
4314
|
__metadata("design:paramtypes", [Object]),
|
|
4523
4315
|
__metadata("design:returntype", Promise)
|
|
4524
4316
|
], InstanceAiService.prototype, "handleRelayTaskControl", null);
|
|
4525
|
-
__decorate([
|
|
4526
|
-
(0, decorators_1.OnLeaderTakeover)(),
|
|
4527
|
-
__metadata("design:type", Function),
|
|
4528
|
-
__metadata("design:paramtypes", []),
|
|
4529
|
-
__metadata("design:returntype", void 0)
|
|
4530
|
-
], InstanceAiService.prototype, "startCheckpointPruning", null);
|
|
4531
|
-
__decorate([
|
|
4532
|
-
(0, decorators_1.OnLeaderStepdown)(),
|
|
4533
|
-
__metadata("design:type", Function),
|
|
4534
|
-
__metadata("design:paramtypes", []),
|
|
4535
|
-
__metadata("design:returntype", void 0)
|
|
4536
|
-
], InstanceAiService.prototype, "stopCheckpointPruning", null);
|
|
4537
4317
|
exports.InstanceAiService = InstanceAiService = __decorate([
|
|
4538
4318
|
(0, di_1.Service)(),
|
|
4539
|
-
__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])
|
|
4540
4320
|
], InstanceAiService);
|
|
4541
4321
|
//# sourceMappingURL=instance-ai.service.js.map
|