n8n 2.45.3 → 2.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/active-executions.d.ts +1 -0
- package/dist/active-executions.js +7 -3
- package/dist/active-executions.js.map +1 -1
- package/dist/active-workflow-manager.js +11 -12
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/chat/chat-execution-manager.js +1 -1
- package/dist/chat/chat-execution-manager.js.map +1 -1
- package/dist/commands/start.d.ts +2 -0
- package/dist/commands/start.js +23 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/concurrency/concurrency-control.service.d.ts +3 -1
- package/dist/concurrency/concurrency-control.service.js +16 -5
- package/dist/concurrency/concurrency-control.service.js.map +1 -1
- package/dist/controllers/ai-preference.controller.d.ts +1 -1
- package/dist/controllers/ai-preference.controller.js +2 -2
- package/dist/controllers/ai-preference.controller.js.map +1 -1
- package/dist/controllers/folder.controller.d.ts +3 -2
- package/dist/controllers/folder.controller.js +21 -0
- package/dist/controllers/folder.controller.js.map +1 -1
- package/dist/controllers/public-api-rate-limit-settings.controller.d.ts +10 -0
- package/dist/controllers/public-api-rate-limit-settings.controller.js +50 -0
- package/dist/controllers/public-api-rate-limit-settings.controller.js.map +1 -0
- package/dist/controllers/users.controller.d.ts +3 -2
- package/dist/controllers/users.controller.js +6 -3
- package/dist/controllers/users.controller.js.map +1 -1
- package/dist/crash-journal.d.ts +2 -0
- package/dist/crash-journal.js +9 -5
- package/dist/crash-journal.js.map +1 -1
- package/dist/credentials/credential-data-merge.js +2 -2
- package/dist/credentials/credential-data-merge.js.map +1 -1
- package/dist/credentials/credential-field-mapping.js.map +1 -0
- package/dist/credentials/credentials.controller.d.ts +2 -1
- package/dist/credentials/credentials.controller.js +13 -0
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +4 -0
- package/dist/credentials/credentials.service.ee.d.ts +3 -0
- package/dist/credentials/credentials.service.ee.js +28 -18
- package/dist/credentials/credentials.service.ee.js.map +1 -1
- package/dist/credentials/credentials.service.js +28 -27
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/errors/response-errors/deprecated-nodes.error.d.ts +3 -7
- package/dist/errors/response-errors/deprecated-nodes.error.js.map +1 -1
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.d.ts +4 -3
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +15 -20
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js.map +1 -1
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +3 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +43 -3
- package/dist/events/relays/log-streaming.event-relay.d.ts +1 -0
- package/dist/events/relays/log-streaming.event-relay.js +32 -22
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +4 -0
- package/dist/events/relays/telemetry.event-relay.js +40 -0
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execute-error-workflow.js +2 -1
- package/dist/execution-lifecycle/execute-error-workflow.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +36 -4
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/execution-lifecycle/save-execution-progress.d.ts +1 -1
- package/dist/execution-lifecycle/save-execution-progress.js +4 -2
- package/dist/execution-lifecycle/save-execution-progress.js.map +1 -1
- package/dist/executions/engine-v2-execution-reader.service.d.ts +4 -0
- package/dist/executions/engine-v2-execution-reader.service.js +23 -4
- package/dist/executions/engine-v2-execution-reader.service.js.map +1 -1
- package/dist/executions/execution-persistence.d.ts +3 -1
- package/dist/executions/execution-persistence.js +50 -8
- package/dist/executions/execution-persistence.js.map +1 -1
- package/dist/executions/execution-recovery.service.d.ts +2 -2
- package/dist/executions/execution-recovery.service.js.map +1 -1
- package/dist/executions/execution-viewer-reader.d.ts +6 -0
- package/dist/executions/execution-viewer-reader.js +24 -0
- package/dist/executions/execution-viewer-reader.js.map +1 -0
- package/dist/executions/execution.service.d.ts +3 -2
- package/dist/executions/execution.service.js +25 -10
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/executions/execution.types.d.ts +2 -1
- package/dist/executions/executions.controller.d.ts +1 -1
- package/dist/executions/executions.controller.js +11 -9
- package/dist/executions/executions.controller.js.map +1 -1
- package/dist/executions/pre-execution-checks/credential-refusal.d.ts +7 -0
- package/dist/executions/pre-execution-checks/credential-refusal.js +26 -0
- package/dist/executions/pre-execution-checks/credential-refusal.js.map +1 -0
- package/dist/executions/pre-execution-checks/credentials-permission-checker.js +2 -11
- 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/subworkflow-policy-checker.d.ts +2 -0
- package/dist/executions/pre-execution-checks/subworkflow-policy-checker.js +23 -11
- package/dist/executions/pre-execution-checks/subworkflow-policy-checker.js.map +1 -1
- package/dist/executions/sum-binary-data-bytes.d.ts +1 -0
- package/dist/executions/sum-binary-data-bytes.js +16 -0
- package/dist/executions/sum-binary-data-bytes.js.map +1 -1
- package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.js +1 -0
- package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.js.map +1 -1
- package/dist/interfaces.d.ts +3 -0
- package/dist/memory-guard/estimate-run-data-size.d.ts +36 -0
- package/dist/memory-guard/estimate-run-data-size.js +233 -0
- package/dist/memory-guard/estimate-run-data-size.js.map +1 -0
- package/dist/memory-guard/memory-guard-journal.d.ts +14 -0
- package/dist/memory-guard/memory-guard-journal.js +87 -0
- package/dist/memory-guard/memory-guard-journal.js.map +1 -0
- package/dist/memory-guard/memory-guard.constants.d.ts +13 -0
- package/dist/memory-guard/memory-guard.constants.js +17 -0
- package/dist/memory-guard/memory-guard.constants.js.map +1 -0
- package/dist/memory-guard/memory-guard.service.d.ts +73 -0
- package/dist/memory-guard/memory-guard.service.js +453 -0
- package/dist/memory-guard/memory-guard.service.js.map +1 -0
- package/dist/memory-guard/memory-guard.types.d.ts +11 -0
- package/dist/{modules/agents/agent-runtime-instrumentation.js → memory-guard/memory-guard.types.js} +1 -1
- package/dist/memory-guard/memory-guard.types.js.map +1 -0
- package/dist/memory-guard/memory-guard.utils.d.ts +13 -0
- package/dist/memory-guard/memory-guard.utils.js +74 -0
- package/dist/memory-guard/memory-guard.utils.js.map +1 -0
- package/dist/memory-guard/memory-stopped-executions.d.ts +18 -0
- package/dist/memory-guard/memory-stopped-executions.js +62 -0
- package/dist/memory-guard/memory-stopped-executions.js.map +1 -0
- package/dist/memory-guard/memory-usage.d.ts +7 -0
- package/dist/memory-guard/memory-usage.js +28 -0
- package/dist/memory-guard/memory-usage.js.map +1 -0
- package/dist/memory-guard/production-hold.d.ts +14 -0
- package/dist/memory-guard/production-hold.js +63 -0
- package/dist/memory-guard/production-hold.js.map +1 -0
- package/dist/memory-guard/run-data-tracker.d.ts +27 -0
- package/dist/memory-guard/run-data-tracker.js +242 -0
- package/dist/memory-guard/run-data-tracker.js.map +1 -0
- package/dist/metrics/prometheus/memory-guard-metrics.service.d.ts +13 -0
- package/dist/metrics/prometheus/memory-guard-metrics.service.js +91 -0
- package/dist/metrics/prometheus/memory-guard-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/agent-evals/agent-eval-case-generation.service.d.ts +3 -3
- package/dist/modules/agent-evals/agent-eval-case-generation.service.js +16 -19
- package/dist/modules/agent-evals/agent-eval-case-generation.service.js.map +1 -1
- package/dist/modules/agent-evals/agent-eval-fix-suggestion.js +1 -1
- package/dist/modules/agent-evals/agent-eval-fix-suggestion.js.map +1 -1
- package/dist/modules/agent-evals/agent-eval-instructions-rewrite.js +1 -1
- package/dist/modules/agent-evals/agent-eval-instructions-rewrite.js.map +1 -1
- package/dist/modules/agent-evals/agent-eval-judge.js +1 -1
- package/dist/modules/agent-evals/agent-eval-judge.js.map +1 -1
- package/dist/modules/agents/adapters/agents-credential-provider.d.ts +5 -2
- package/dist/modules/agents/adapters/agents-credential-provider.js +5 -1
- package/dist/modules/agents/adapters/agents-credential-provider.js.map +1 -1
- package/dist/modules/agents/agent-chat-attachment.service.d.ts +5 -0
- package/dist/modules/agents/agent-chat-attachment.service.js +3 -0
- package/dist/modules/agents/agent-chat-attachment.service.js.map +1 -1
- package/dist/modules/agents/agent-chat-execution.service.d.ts +8 -5
- package/dist/modules/agents/agent-chat-execution.service.js +61 -49
- package/dist/modules/agents/agent-chat-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-chat-relay.service.d.ts +3 -2
- package/dist/modules/agents/agent-chat-relay.service.js +23 -30
- package/dist/modules/agents/agent-chat-relay.service.js.map +1 -1
- package/dist/modules/agents/agent-chat.controller.d.ts +4 -4
- package/dist/modules/agents/agent-chat.controller.js +18 -50
- package/dist/modules/agents/agent-chat.controller.js.map +1 -1
- package/dist/modules/agents/agent-config-preparation.service.d.ts +350 -2
- package/dist/modules/agents/agent-config-preparation.service.js +264 -2
- package/dist/modules/agents/agent-config-preparation.service.js.map +1 -1
- package/dist/modules/agents/agent-config.service.d.ts +10 -8
- package/dist/modules/agents/agent-config.service.js +59 -131
- package/dist/modules/agents/agent-config.service.js.map +1 -1
- package/dist/modules/agents/agent-context.contracts.d.ts +87 -0
- package/dist/modules/agents/agent-context.contracts.js +3 -0
- package/dist/modules/agents/agent-context.contracts.js.map +1 -0
- package/dist/modules/agents/agent-context.service.d.ts +338 -0
- package/dist/modules/agents/{instance-ai-agent-context.adapter.js → agent-context.service.js} +53 -19
- package/dist/modules/agents/agent-context.service.js.map +1 -0
- package/dist/modules/agents/agent-conversation-state.service.d.ts +2 -1
- package/dist/modules/agents/agent-conversation-state.service.js +3 -3
- package/dist/modules/agents/agent-conversation-state.service.js.map +1 -1
- package/dist/modules/agents/agent-credential-provider.contracts.d.ts +5 -0
- package/dist/modules/agents/agent-credential-provider.contracts.js +3 -0
- package/dist/modules/agents/agent-credential-provider.contracts.js.map +1 -0
- package/dist/modules/agents/agent-custom-tools.service.d.ts +1 -0
- package/dist/modules/agents/agent-custom-tools.service.js +9 -8
- package/dist/modules/agents/agent-custom-tools.service.js.map +1 -1
- package/dist/modules/agents/agent-default-model-resolver.service.js +6 -5
- package/dist/modules/agents/agent-default-model-resolver.service.js.map +1 -1
- package/dist/modules/agents/agent-definition.service.d.ts +2 -2
- package/dist/modules/agents/agent-definition.service.js +3 -3
- package/dist/modules/agents/agent-definition.service.js.map +1 -1
- package/dist/modules/agents/agent-draft.contracts.d.ts +51 -0
- package/dist/modules/agents/agent-draft.contracts.js +3 -0
- package/dist/modules/agents/agent-draft.contracts.js.map +1 -0
- package/dist/modules/agents/agent-draft.service.d.ts +17 -0
- package/dist/modules/agents/agent-draft.service.js +98 -0
- package/dist/modules/agents/agent-draft.service.js.map +1 -0
- package/dist/modules/agents/agent-execution-orchestrator.service.d.ts +3 -1
- package/dist/modules/agents/agent-execution-orchestrator.service.js +11 -3
- package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
- package/dist/modules/agents/agent-execution.service.d.ts +11 -4
- package/dist/modules/agents/agent-execution.service.js +43 -7
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-formatted-turn.error.d.ts +6 -0
- package/dist/modules/agents/agent-formatted-turn.error.js +12 -0
- package/dist/modules/agents/agent-formatted-turn.error.js.map +1 -0
- package/dist/modules/agents/agent-integration-management.service.js +1 -1
- package/dist/modules/agents/agent-integration-management.service.js.map +1 -1
- package/dist/modules/agents/agent-integration-persistence.service.d.ts +4 -1
- package/dist/modules/agents/agent-integration-persistence.service.js +33 -21
- package/dist/modules/agents/agent-integration-persistence.service.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-snapshot.service.d.ts +19 -0
- package/dist/modules/agents/agent-knowledge-snapshot.service.js +84 -0
- package/dist/modules/agents/agent-knowledge-snapshot.service.js.map +1 -0
- package/dist/modules/agents/agent-knowledge-snapshot.task.d.ts +13 -0
- package/dist/modules/agents/agent-knowledge-snapshot.task.js +48 -0
- package/dist/modules/agents/agent-knowledge-snapshot.task.js.map +1 -0
- package/dist/modules/agents/agent-knowledge-storage.js +2 -2
- package/dist/modules/agents/agent-knowledge-storage.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-telemetry.d.ts +3 -0
- package/dist/modules/agents/agent-knowledge-telemetry.js +28 -0
- package/dist/modules/agents/agent-knowledge-telemetry.js.map +1 -0
- package/dist/modules/agents/agent-knowledge-upload.error.d.ts +11 -0
- package/dist/modules/agents/agent-knowledge-upload.error.js +12 -0
- package/dist/modules/agents/agent-knowledge-upload.error.js.map +1 -0
- package/dist/modules/agents/agent-knowledge-usage-tracker.d.ts +33 -0
- package/dist/modules/agents/agent-knowledge-usage-tracker.js +107 -0
- package/dist/modules/agents/agent-knowledge-usage-tracker.js.map +1 -0
- package/dist/modules/agents/agent-knowledge.controller.d.ts +8 -4
- package/dist/modules/agents/agent-knowledge.controller.js +58 -10
- package/dist/modules/agents/agent-knowledge.controller.js.map +1 -1
- package/dist/modules/agents/agent-knowledge.service.d.ts +14 -3
- package/dist/modules/agents/agent-knowledge.service.js +45 -11
- package/dist/modules/agents/agent-knowledge.service.js.map +1 -1
- package/dist/modules/agents/agent-memory-entries.service.d.ts +18 -0
- package/dist/modules/agents/agent-memory-entries.service.js +124 -0
- package/dist/modules/agents/agent-memory-entries.service.js.map +1 -0
- package/dist/modules/agents/agent-memory.controller.d.ts +19 -0
- package/dist/modules/agents/agent-memory.controller.js +68 -0
- package/dist/modules/agents/agent-memory.controller.js.map +1 -0
- package/dist/modules/agents/agent-message-queue-consumer.service.d.ts +6 -1
- package/dist/modules/agents/agent-message-queue-consumer.service.js +78 -40
- package/dist/modules/agents/agent-message-queue-consumer.service.js.map +1 -1
- package/dist/modules/agents/agent-message-queue.service.d.ts +4 -1
- package/dist/modules/agents/agent-message-queue.service.js +23 -16
- package/dist/modules/agents/agent-message-queue.service.js.map +1 -1
- package/dist/modules/agents/agent-model-catalog.service.d.ts +1 -0
- package/dist/modules/agents/agent-model-catalog.service.js +22 -7
- package/dist/modules/agents/agent-model-catalog.service.js.map +1 -1
- package/dist/modules/agents/agent-modification-telemetry.service.d.ts +16 -401
- package/dist/modules/agents/agent-modification-telemetry.service.js +121 -32
- package/dist/modules/agents/agent-modification-telemetry.service.js.map +1 -1
- package/dist/modules/agents/agent-policy.service.d.ts +4 -1
- package/dist/modules/agents/agent-policy.service.js +14 -1
- package/dist/modules/agents/agent-policy.service.js.map +1 -1
- package/dist/modules/agents/agent-publish.service.d.ts +4 -1
- package/dist/modules/agents/agent-publish.service.js +32 -14
- package/dist/modules/agents/agent-publish.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-cache.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +14 -3
- package/dist/modules/agents/agent-runtime-reconstruction.service.js +113 -31
- package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
- package/dist/modules/agents/agent-sandbox-runtime.service.d.ts +1 -3
- package/dist/modules/agents/agent-sandbox-runtime.service.js +8 -32
- package/dist/modules/agents/agent-sandbox-runtime.service.js.map +1 -1
- package/dist/modules/agents/agent-sandbox.controller.d.ts +3 -3
- package/dist/modules/agents/agent-sandbox.controller.js +5 -5
- package/dist/modules/agents/agent-sandbox.controller.js.map +1 -1
- package/dist/modules/agents/agent-save-completion.service.d.ts +8 -1
- package/dist/modules/agents/agent-save-completion.service.js +28 -0
- package/dist/modules/agents/agent-save-completion.service.js.map +1 -1
- package/dist/modules/agents/agent-session-langsmith-export.service.js +27 -0
- package/dist/modules/agents/agent-session-langsmith-export.service.js.map +1 -1
- package/dist/modules/agents/agent-session-read.d.ts +3 -0
- package/dist/modules/agents/agent-session-read.js +29 -0
- package/dist/modules/agents/agent-session-read.js.map +1 -0
- package/dist/modules/agents/agent-setup-completion.service.d.ts +2 -2
- package/dist/modules/agents/agent-setup-completion.service.js +8 -2
- package/dist/modules/agents/agent-setup-completion.service.js.map +1 -1
- package/dist/modules/agents/agent-skill-refs.service.d.ts +23 -29
- package/dist/modules/agents/agent-skill-refs.service.js +61 -123
- package/dist/modules/agents/agent-skill-refs.service.js.map +1 -1
- package/dist/modules/agents/agent-skill-usage.service.d.ts +40 -0
- package/dist/modules/agents/agent-skill-usage.service.js +137 -0
- package/dist/modules/agents/agent-skill-usage.service.js.map +1 -0
- package/dist/modules/agents/agent-skills.service.d.ts +6 -4
- package/dist/modules/agents/agent-skills.service.js +30 -70
- package/dist/modules/agents/agent-skills.service.js.map +1 -1
- package/dist/modules/agents/agent-sse-stream.d.ts +2 -1
- package/dist/modules/agents/agent-sse-stream.js +24 -4
- package/dist/modules/agents/agent-sse-stream.js.map +1 -1
- package/dist/modules/agents/agent-task.service.d.ts +8 -0
- package/dist/modules/agents/agent-task.service.js +22 -14
- package/dist/modules/agents/agent-task.service.js.map +1 -1
- package/dist/modules/agents/agent-telemetry.d.ts +3 -0
- package/dist/modules/agents/agent-telemetry.js +24 -1
- package/dist/modules/agents/agent-telemetry.js.map +1 -1
- package/dist/modules/agents/agent-test-run.service.d.ts +1 -0
- package/dist/modules/agents/agent-test-run.service.js +9 -0
- package/dist/modules/agents/agent-test-run.service.js.map +1 -1
- package/dist/modules/agents/agent-threads.controller.d.ts +4 -1
- package/dist/modules/agents/agent-threads.controller.js +8 -3
- package/dist/modules/agents/agent-threads.controller.js.map +1 -1
- package/dist/modules/agents/agent-turn-execution.service.d.ts +13 -2
- package/dist/modules/agents/agent-turn-execution.service.js +123 -31
- package/dist/modules/agents/agent-turn-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-upload.middleware.d.ts +2 -0
- package/dist/modules/agents/agent-upload.middleware.js +13 -2
- package/dist/modules/agents/agent-upload.middleware.js.map +1 -1
- package/dist/modules/agents/agent-validation.service.d.ts +5 -2
- package/dist/modules/agents/agent-validation.service.js +78 -14
- package/dist/modules/agents/agent-validation.service.js.map +1 -1
- package/dist/modules/agents/agent-vector-stores.controller.d.ts +5 -3
- package/dist/modules/agents/agent-vector-stores.controller.js +9 -5
- package/dist/modules/agents/agent-vector-stores.controller.js.map +1 -1
- package/dist/modules/agents/agent-workflow-execution.service.d.ts +1 -1
- package/dist/modules/agents/agent-workflow-execution.service.js +4 -2
- package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
- package/dist/modules/agents/agents-config.controller.d.ts +1 -1
- package/dist/modules/agents/agents-settings.service.d.ts +5 -1
- package/dist/modules/agents/agents-settings.service.js +13 -3
- package/dist/modules/agents/agents-settings.service.js.map +1 -1
- package/dist/modules/agents/agents-tools.service.d.ts +2 -6
- package/dist/modules/agents/agents-tools.service.js +2 -120
- package/dist/modules/agents/agents-tools.service.js.map +1 -1
- package/dist/modules/agents/agents.controller.d.ts +26 -3
- package/dist/modules/agents/agents.controller.js +10 -4
- package/dist/modules/agents/agents.controller.js.map +1 -1
- package/dist/modules/agents/agents.module.d.ts +3 -4
- package/dist/modules/agents/agents.module.js +18 -20
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/agents.service.d.ts +37 -8
- package/dist/modules/agents/agents.service.js +164 -30
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/azure-foundry-deployments.service.d.ts +28 -0
- package/dist/modules/agents/azure-foundry-deployments.service.js +107 -0
- package/dist/modules/agents/azure-foundry-deployments.service.js.map +1 -0
- package/dist/modules/agents/background/agent-background-job.service.d.ts +8 -7
- package/dist/modules/agents/background/agent-background-job.service.js +26 -9
- package/dist/modules/agents/background/agent-background-job.service.js.map +1 -1
- package/dist/modules/agents/background/background-job-tools.js +2 -0
- package/dist/modules/agents/background/background-job-tools.js.map +1 -1
- package/dist/modules/agents/background/sub-agent-background-runner.d.ts +1 -0
- package/dist/modules/agents/background/sub-agent-background-runner.js +3 -0
- package/dist/modules/agents/background/sub-agent-background-runner.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +9 -22
- package/dist/modules/agents/builder/agents-builder-tools.service.js +87 -98
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder.service.d.ts +40 -0
- package/dist/modules/agents/builder/agents-builder.service.js +109 -0
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -0
- package/dist/modules/agents/builder/builder-model-live-lookup.service.d.ts +8 -1
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js +52 -12
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-session.d.ts +21 -0
- package/dist/modules/agents/builder/builder-session.js +7 -0
- package/dist/modules/agents/builder/builder-session.js.map +1 -0
- package/dist/modules/agents/builder/builder-telemetry-session.d.ts +9 -0
- package/dist/modules/agents/builder/builder-telemetry-session.js +14 -0
- package/dist/modules/agents/builder/builder-telemetry-session.js.map +1 -0
- package/dist/modules/agents/builder/builder-tool-names.d.ts +0 -1
- package/dist/modules/agents/builder/builder-tool-names.js +0 -1
- package/dist/modules/agents/builder/builder-tool-names.js.map +1 -1
- package/dist/modules/agents/builder/interactive/configure-channel.tool.js +2 -2
- package/dist/modules/agents/builder/interactive/configure-channel.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/finish-setup.tool.js +3 -3
- package/dist/modules/agents/builder/interactive/finish-setup.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/index.d.ts +0 -1
- package/dist/modules/agents/builder/interactive/index.js +1 -4
- package/dist/modules/agents/builder/interactive/index.js.map +1 -1
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +56 -28
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/setup-tool.types.d.ts +3 -3
- package/dist/modules/agents/builder/model-lookup.types.d.ts +1 -0
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +19 -6
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js +6 -4
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -1
- package/dist/modules/agents/builder/skills/external-services.skill.js +32 -24
- package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/memory.skill.js +6 -8
- package/dist/modules/agents/builder/skills/memory.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/node-tools.skill.js +16 -16
- package/dist/modules/agents/builder/skills/node-tools.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/resource-locators.skill.js +26 -23
- package/dist/modules/agents/builder/skills/resource-locators.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-skills.skill.js +24 -9
- package/dist/modules/agents/builder/skills/target-skills.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-tasks.skill.js +3 -3
- package/dist/modules/agents/builder/skills/target-tasks.skill.js.map +1 -1
- package/dist/modules/agents/builder/verify-mcp-server.tool.js +2 -2
- package/dist/modules/agents/builder/verify-mcp-server.tool.js.map +1 -1
- package/dist/modules/agents/entities/agent-background-job.entity.d.ts +8 -0
- package/dist/modules/agents/entities/agent-background-job.entity.js +29 -0
- package/dist/modules/agents/entities/agent-background-job.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-execution-thread.entity.d.ts +2 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js +4 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-execution.entity.d.ts +6 -0
- package/dist/modules/agents/entities/agent-execution.entity.js +46 -3
- package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-history.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-message.entity.d.ts +2 -1
- package/dist/modules/agents/entities/agent-message.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent.entity.js.map +1 -1
- package/dist/modules/agents/{agent-runtime-instrumentation.d.ts → evaluation/agent-evaluation.contracts.d.ts} +26 -3
- package/dist/modules/agents/evaluation/agent-evaluation.contracts.js +3 -0
- package/dist/modules/agents/evaluation/agent-evaluation.contracts.js.map +1 -0
- package/dist/modules/agents/evaluation/agent-evaluation.service.d.ts +21 -0
- package/dist/modules/agents/evaluation/agent-evaluation.service.js +111 -0
- package/dist/modules/agents/evaluation/agent-evaluation.service.js.map +1 -0
- package/dist/modules/agents/evaluation/evaluation-config.d.ts +8 -0
- package/dist/modules/agents/evaluation/evaluation-config.js +81 -0
- package/dist/modules/agents/evaluation/evaluation-config.js.map +1 -0
- package/dist/modules/agents/execution-recorder.d.ts +21 -0
- package/dist/modules/agents/execution-recorder.js +77 -24
- package/dist/modules/agents/execution-recorder.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +1 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.js +42 -4
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +22 -1
- package/dist/modules/agents/integrations/agent-chat-integration.js +13 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-message-context.js +5 -0
- package/dist/modules/agents/integrations/agent-chat-message-context.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.d.ts +5 -1
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.js +96 -25
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.js.map +1 -1
- package/dist/modules/agents/integrations/agent-credential-lookup.service.d.ts +2 -1
- package/dist/modules/agents/integrations/agent-credential-lookup.service.js +7 -3
- package/dist/modules/agents/integrations/agent-credential-lookup.service.js.map +1 -1
- package/dist/modules/agents/integrations/channel-rate-limit.js +2 -1
- package/dist/modules/agents/integrations/channel-rate-limit.js.map +1 -1
- package/dist/modules/agents/integrations/chat-integration.service.js +4 -1
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
- package/dist/modules/agents/integrations/episodic-scope-resolver.d.ts +4 -0
- package/dist/modules/agents/integrations/episodic-scope-resolver.js +24 -0
- package/dist/modules/agents/integrations/episodic-scope-resolver.js.map +1 -0
- package/dist/modules/agents/integrations/integration-context-query-executor.d.ts +3 -1
- package/dist/modules/agents/integrations/integration-context-query-executor.js +54 -45
- package/dist/modules/agents/integrations/integration-context-query-executor.js.map +1 -1
- package/dist/modules/agents/integrations/integration-error-codes.d.ts +2 -0
- package/dist/modules/agents/integrations/integration-error-codes.js +2 -0
- package/dist/modules/agents/integrations/integration-error-codes.js.map +1 -1
- package/dist/modules/agents/integrations/integration-message-context.js +2 -0
- package/dist/modules/agents/integrations/integration-message-context.js.map +1 -1
- package/dist/modules/agents/integrations/integration-origin-support.d.ts +19 -0
- package/dist/modules/agents/integrations/integration-origin-support.js +32 -0
- package/dist/modules/agents/integrations/integration-origin-support.js.map +1 -0
- package/dist/modules/agents/integrations/integration-origin.d.ts +6 -0
- package/dist/modules/agents/integrations/integration-origin.js +54 -0
- package/dist/modules/agents/integrations/integration-origin.js.map +1 -0
- package/dist/modules/agents/integrations/integration-tool-definitions.js +3 -3
- package/dist/modules/agents/integrations/integration-tool-definitions.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-execution.d.ts +1 -0
- package/dist/modules/agents/integrations/integration-tool-execution.js +5 -1
- package/dist/modules/agents/integrations/integration-tool-execution.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-factory.js +2 -0
- package/dist/modules/agents/integrations/integration-tool-factory.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-types.d.ts +3 -0
- package/dist/modules/agents/integrations/message-split.d.ts +2 -0
- package/dist/modules/agents/integrations/message-split.js +32 -0
- package/dist/modules/agents/integrations/message-split.js.map +1 -0
- package/dist/modules/agents/integrations/n8n-memory.d.ts +12 -2
- package/dist/modules/agents/integrations/n8n-memory.js +59 -94
- package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/discord/discord-gateway.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/{discord-integration.d.ts → discord/discord-integration.d.ts} +13 -8
- package/dist/modules/agents/integrations/platforms/{discord-integration.js → discord/discord-integration.js} +20 -9
- package/dist/modules/agents/integrations/platforms/discord/discord-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/{discord-operations.js → discord/discord-operations.js} +1 -1
- package/dist/modules/agents/integrations/platforms/discord/discord-operations.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/discord/discord-origin.d.ts +4 -0
- package/dist/modules/agents/integrations/platforms/discord/discord-origin.js +20 -0
- package/dist/modules/agents/integrations/platforms/discord/discord-origin.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/linear/linear-integration.d.ts +33 -0
- package/dist/modules/agents/integrations/platforms/{linear-integration.js → linear/linear-integration.js} +21 -4
- package/dist/modules/agents/integrations/platforms/linear/linear-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/{linear-operations.d.ts → linear/linear-operations.d.ts} +2 -2
- package/dist/modules/agents/integrations/platforms/{linear-operations.js → linear/linear-operations.js} +2 -2
- package/dist/modules/agents/integrations/platforms/linear/linear-operations.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/linear/linear-origin.d.ts +4 -0
- package/dist/modules/agents/integrations/platforms/linear/linear-origin.js +31 -0
- package/dist/modules/agents/integrations/platforms/linear/linear-origin.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/{linear-tool-definitions.js → linear/linear-tool-definitions.js} +1 -1
- package/dist/modules/agents/integrations/platforms/linear/linear-tool-definitions.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/n8n-chat/n8n-chat-flag.service.d.ts +7 -0
- package/dist/modules/agents/{skills/skills-hub-rollout.js → integrations/platforms/n8n-chat/n8n-chat-flag.service.js} +19 -19
- package/dist/modules/agents/integrations/platforms/n8n-chat/n8n-chat-flag.service.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/{n8n-chat-integration.d.ts → n8n-chat/n8n-chat-integration.d.ts} +11 -4
- package/dist/modules/agents/integrations/platforms/{n8n-chat-integration.js → n8n-chat/n8n-chat-integration.js} +24 -5
- package/dist/modules/agents/integrations/platforms/n8n-chat/n8n-chat-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-adapter.d.ts +2 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-adapter.js +17 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-adapter.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-bridge-behavior.d.ts +5 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-bridge-behavior.js +64 -18
- package/dist/modules/agents/integrations/platforms/slack/slack-bridge-behavior.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-integration.d.ts +13 -2
- package/dist/modules/agents/integrations/platforms/slack/slack-integration.js +46 -3
- package/dist/modules/agents/integrations/platforms/slack/slack-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-managed-setup.service.js +2 -2
- package/dist/modules/agents/integrations/platforms/slack/slack-managed-setup.service.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-operations.d.ts +1 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-operations.js +131 -53
- package/dist/modules/agents/integrations/platforms/slack/slack-operations.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-origin.d.ts +4 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-origin.js +38 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-origin.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-search-pagination.d.ts +33 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-search-pagination.js +53 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-search-pagination.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/teams/assets/color.png +0 -0
- package/dist/modules/agents/integrations/platforms/teams/assets/outline.png +0 -0
- package/dist/modules/agents/integrations/platforms/teams/teams-activity.d.ts +1 -0
- package/dist/modules/agents/integrations/platforms/teams/teams-activity.js +10 -0
- package/dist/modules/agents/integrations/platforms/teams/teams-activity.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/teams/teams-app-icons.d.ts +1 -1
- package/dist/modules/agents/integrations/platforms/teams/teams-app-icons.js +6 -5
- package/dist/modules/agents/integrations/platforms/teams/teams-app-icons.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/teams/teams-entra-provisioning.service.js +1 -1
- package/dist/modules/agents/integrations/platforms/teams/teams-entra-provisioning.service.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/teams/teams-integration.d.ts +5 -1
- package/dist/modules/agents/integrations/platforms/teams/teams-integration.js +13 -8
- package/dist/modules/agents/integrations/platforms/teams/teams-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/teams/teams-managed-setup.service.d.ts +4 -2
- package/dist/modules/agents/integrations/platforms/teams/teams-managed-setup.service.js +26 -9
- package/dist/modules/agents/integrations/platforms/teams/teams-managed-setup.service.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/teams/teams-manifest.service.d.ts +1 -0
- package/dist/modules/agents/integrations/platforms/teams/teams-manifest.service.js +3 -3
- package/dist/modules/agents/integrations/platforms/teams/teams-manifest.service.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/teams/teams-message-files.d.ts +1 -0
- package/dist/modules/agents/integrations/platforms/teams/teams-operations.d.ts +1 -0
- package/dist/modules/agents/integrations/platforms/teams/teams-operations.js +47 -16
- package/dist/modules/agents/integrations/platforms/teams/teams-operations.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/teams/teams-origin.d.ts +2 -0
- package/dist/modules/agents/integrations/platforms/teams/teams-origin.js +13 -0
- package/dist/modules/agents/integrations/platforms/teams/teams-origin.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/{telegram-bridge-behavior.d.ts → telegram/telegram-bridge-behavior.d.ts} +2 -2
- package/dist/modules/agents/integrations/platforms/{telegram-bridge-behavior.js → telegram/telegram-bridge-behavior.js} +1 -1
- package/dist/modules/agents/integrations/platforms/telegram/telegram-bridge-behavior.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/{telegram-integration.d.ts → telegram/telegram-integration.d.ts} +8 -4
- package/dist/modules/agents/integrations/platforms/{telegram-integration.js → telegram/telegram-integration.js} +13 -5
- package/dist/modules/agents/integrations/platforms/telegram/telegram-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/telegram/telegram-origin.d.ts +2 -0
- package/dist/modules/agents/integrations/platforms/telegram/telegram-origin.js +12 -0
- package/dist/modules/agents/integrations/platforms/telegram/telegram-origin.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/whatsapp/whatsapp-integration.d.ts +3 -0
- package/dist/modules/agents/integrations/platforms/whatsapp/whatsapp-integration.js +7 -0
- package/dist/modules/agents/integrations/platforms/whatsapp/whatsapp-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/whatsapp/whatsapp-origin.d.ts +2 -0
- package/dist/modules/agents/integrations/platforms/whatsapp/whatsapp-origin.js +12 -0
- package/dist/modules/agents/integrations/platforms/whatsapp/whatsapp-origin.js.map +1 -0
- package/dist/modules/agents/integrations/single-connection.d.ts +3 -0
- package/dist/modules/agents/integrations/single-connection.js +19 -0
- package/dist/modules/agents/integrations/single-connection.js.map +1 -0
- package/dist/modules/agents/json-config/agent-document.d.ts +0 -1
- package/dist/modules/agents/json-config/agent-document.js +0 -5
- package/dist/modules/agents/json-config/agent-document.js.map +1 -1
- package/dist/modules/agents/json-config/from-json-config.d.ts +3 -1
- package/dist/modules/agents/json-config/from-json-config.js +39 -8
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
- package/dist/modules/agents/json-config/mcp-client-factory.d.ts +6 -3
- package/dist/modules/agents/json-config/mcp-client-factory.js +23 -2
- package/dist/modules/agents/json-config/mcp-client-factory.js.map +1 -1
- package/dist/modules/agents/json-config/model-config.d.ts +3 -5
- package/dist/modules/agents/json-config/model-config.js +30 -7
- package/dist/modules/agents/json-config/model-config.js.map +1 -1
- package/dist/modules/agents/llm-provider-defaults.d.ts +2 -1
- package/dist/modules/agents/llm-provider-defaults.js +7 -0
- package/dist/modules/agents/llm-provider-defaults.js.map +1 -1
- package/dist/modules/agents/register-skill-agents-provider.d.ts +1 -0
- package/dist/modules/agents/register-skill-agents-provider.js +10 -0
- package/dist/modules/agents/register-skill-agents-provider.js.map +1 -0
- package/dist/modules/agents/register-user-deletion-handler.d.ts +1 -0
- package/dist/modules/agents/register-user-deletion-handler.js +17 -0
- package/dist/modules/agents/register-user-deletion-handler.js.map +1 -0
- package/dist/modules/agents/repositories/agent-chat-attachment.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-chat-attachment.repository.js +3 -0
- package/dist/modules/agents/repositories/agent-chat-attachment.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-execution-thread.repository.d.ts +2 -0
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js +22 -2
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-execution.repository.d.ts +12 -1
- package/dist/modules/agents/repositories/agent-execution.repository.js +55 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-file.repository.d.ts +6 -0
- package/dist/modules/agents/repositories/agent-file.repository.js +24 -0
- package/dist/modules/agents/repositories/agent-file.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-history.repository.d.ts +0 -1
- package/dist/modules/agents/repositories/agent-history.repository.js +0 -1
- package/dist/modules/agents/repositories/agent-history.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-memory-entry-candidate.repository.d.ts +3 -0
- package/dist/modules/agents/repositories/agent-memory-entry-candidate.repository.js +24 -0
- package/dist/modules/agents/repositories/agent-memory-entry-candidate.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-memory-entry.repository.d.ts +46 -3
- package/dist/modules/agents/repositories/agent-memory-entry.repository.js +176 -4
- package/dist/modules/agents/repositories/agent-memory-entry.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-message-queue.repository.d.ts +1 -0
- package/dist/modules/agents/repositories/agent-message.repository.d.ts +2 -1
- 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-observation.repository.d.ts +8 -3
- package/dist/modules/agents/repositories/agent-observation.repository.js +59 -4
- package/dist/modules/agents/repositories/agent-observation.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-skill.repository.d.ts +35 -0
- package/dist/modules/agents/repositories/agent-skill.repository.js +261 -0
- package/dist/modules/agents/repositories/agent-skill.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-task.repository.d.ts +1 -0
- package/dist/modules/agents/repositories/agent-task.repository.js +7 -0
- package/dist/modules/agents/repositories/agent-task.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-thread.repository.d.ts +1 -0
- package/dist/modules/agents/repositories/agent-thread.repository.js +7 -0
- package/dist/modules/agents/repositories/agent-thread.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent.repository.d.ts +11 -6
- package/dist/modules/agents/repositories/agent.repository.js +43 -43
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js +6 -0
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js.map +1 -1
- package/dist/modules/agents/sub-agents/sub-agent-runner.d.ts +10 -3
- package/dist/modules/agents/sub-agents/sub-agent-runner.js +76 -3
- package/dist/modules/agents/sub-agents/sub-agent-runner.js.map +1 -1
- package/dist/modules/agents/system-agents/system-agent-access.d.ts +3 -0
- package/dist/modules/agents/system-agents/system-agent-access.js +10 -0
- package/dist/modules/agents/system-agents/system-agent-access.js.map +1 -0
- package/dist/modules/agents/system-agents/system-agent-chat.controller.d.ts +83 -0
- package/dist/modules/agents/system-agents/system-agent-chat.controller.js +313 -0
- package/dist/modules/agents/system-agents/system-agent-chat.controller.js.map +1 -0
- package/dist/modules/agents/system-agents/system-agent-execution.service.d.ts +141 -0
- package/dist/modules/agents/system-agents/system-agent-execution.service.js +786 -0
- package/dist/modules/agents/system-agents/system-agent-execution.service.js.map +1 -0
- package/dist/modules/agents/system-agents/system-agent-host-events.d.ts +21 -0
- package/dist/modules/agents/system-agents/system-agent-host-events.js +73 -0
- package/dist/modules/agents/system-agents/system-agent-host-events.js.map +1 -0
- package/dist/modules/agents/system-agents/system-agent-registration.service.d.ts +9 -0
- package/dist/modules/agents/system-agents/system-agent-registration.service.js +31 -0
- package/dist/modules/agents/system-agents/system-agent-registration.service.js.map +1 -0
- package/dist/modules/agents/system-agents/system-agent-registry.d.ts +7 -0
- package/dist/modules/agents/system-agents/system-agent-registry.js +33 -0
- package/dist/modules/agents/system-agents/system-agent-registry.js.map +1 -0
- package/dist/modules/agents/system-agents/system-agent-usage-relay.d.ts +15 -0
- package/dist/modules/agents/system-agents/system-agent-usage-relay.js +63 -0
- package/dist/modules/agents/system-agents/system-agent-usage-relay.js.map +1 -0
- package/dist/modules/agents/system-agents/system-agent.types.d.ts +102 -0
- package/dist/modules/agents/system-agents/system-agent.types.js +3 -0
- package/dist/modules/agents/system-agents/system-agent.types.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/search-knowledge.tool.d.ts +3 -1
- package/dist/modules/agents/tools/knowledge/search-knowledge.tool.js +29 -4
- package/dist/modules/agents/tools/knowledge/search-knowledge.tool.js.map +1 -1
- package/dist/modules/agents/tools/node-tool-factory.d.ts +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.d.ts +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.js +3 -1
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/types/agent-queued-message.d.ts +6 -3
- package/dist/modules/agents/types/agent-queued-message.js +5 -0
- package/dist/modules/agents/types/agent-queued-message.js.map +1 -1
- package/dist/modules/agents/types/agent-task-stop.d.ts +23 -0
- package/dist/modules/agents/types/agent-task-stop.js +3 -0
- package/dist/modules/agents/types/agent-task-stop.js.map +1 -0
- package/dist/modules/agents/types/agent-turn-outcome.d.ts +10 -0
- package/dist/modules/agents/types/agent-turn-outcome.js +3 -0
- package/dist/modules/agents/types/agent-turn-outcome.js.map +1 -0
- package/dist/modules/agents/utils/agent-capabilities.d.ts +0 -1
- package/dist/modules/agents/utils/agent-capabilities.js +1 -9
- package/dist/modules/agents/utils/agent-capabilities.js.map +1 -1
- package/dist/modules/agents/utils/agent-config-hash.d.ts +2 -2
- package/dist/modules/agents/utils/agent-config-hash.js +3 -4
- package/dist/modules/agents/utils/agent-config-hash.js.map +1 -1
- package/dist/modules/agents/utils/agent-definition.d.ts +17 -1
- package/dist/modules/agents/utils/agent-definition.js +13 -0
- package/dist/modules/agents/utils/agent-definition.js.map +1 -1
- package/dist/modules/agents/utils/agent-draft.utils.d.ts +2 -1
- package/dist/modules/agents/utils/agent-draft.utils.js +2 -2
- package/dist/modules/agents/utils/agent-draft.utils.js.map +1 -1
- package/dist/modules/agents/utils/agent-memory-scope.d.ts +0 -5
- package/dist/modules/agents/utils/agent-memory-scope.js +0 -11
- package/dist/modules/agents/utils/agent-memory-scope.js.map +1 -1
- package/dist/modules/agents/utils/agent-thread-access.d.ts +6 -3
- package/dist/modules/agents/utils/agent-thread-access.js +32 -11
- package/dist/modules/agents/utils/agent-thread-access.js.map +1 -1
- package/dist/modules/agents/utils/episodic-scope-metadata.d.ts +2 -0
- package/dist/modules/agents/utils/episodic-scope-metadata.js +13 -0
- package/dist/modules/agents/utils/episodic-scope-metadata.js.map +1 -0
- package/dist/modules/agents/utils/execution-to-message-mapper.js +9 -0
- package/dist/modules/agents/utils/execution-to-message-mapper.js.map +1 -1
- package/dist/modules/agents/utils/memory-entry-source.d.ts +15 -0
- package/dist/modules/agents/utils/memory-entry-source.js +53 -0
- package/dist/modules/agents/utils/memory-entry-source.js.map +1 -0
- package/dist/modules/agents/utils/memory-source-filter.d.ts +7 -0
- package/dist/modules/agents/utils/memory-source-filter.js +154 -0
- package/dist/modules/agents/utils/memory-source-filter.js.map +1 -0
- package/dist/modules/agents/utils/messages-envelope.d.ts +2 -0
- package/dist/modules/agents/utils/messages-envelope.js +15 -0
- package/dist/modules/agents/utils/messages-envelope.js.map +1 -1
- package/dist/modules/agents/utils/visit-agent-credential-references.d.ts +1 -0
- package/dist/modules/agents/utils/visit-agent-credential-references.js +8 -7
- package/dist/modules/agents/utils/visit-agent-credential-references.js.map +1 -1
- package/dist/modules/apps/sandbox-settings.d.ts +3 -0
- package/dist/modules/apps/sandbox-settings.js +41 -0
- package/dist/modules/apps/sandbox-settings.js.map +1 -0
- package/dist/modules/breaking-changes/breaking-changes.migration.service.js +1 -1
- package/dist/modules/breaking-changes/breaking-changes.migration.service.js.map +1 -1
- package/dist/modules/breaking-changes/migration-report-csv.js +10 -0
- package/dist/modules/breaking-changes/migration-report-csv.js.map +1 -1
- package/dist/modules/breaking-changes/migrations/node-removals/agent-tools-v1-to-v2.migration.d.ts +2 -0
- package/dist/modules/breaking-changes/migrations/node-removals/agent-tools-v1-to-v2.migration.js +29 -0
- package/dist/modules/breaking-changes/migrations/node-removals/agent-tools-v1-to-v2.migration.js.map +1 -0
- package/dist/modules/breaking-changes/migrations/node-removals/edit-image-v2.migration.d.ts +2 -0
- package/dist/modules/breaking-changes/migrations/node-removals/edit-image-v2.migration.js +20 -0
- package/dist/modules/breaking-changes/migrations/node-removals/edit-image-v2.migration.js.map +1 -0
- package/dist/modules/breaking-changes/migrations/node-removals/index.js +4 -0
- package/dist/modules/breaking-changes/migrations/node-removals/index.js.map +1 -1
- package/dist/modules/breaking-changes/query/migration-finding-query.service.js +4 -1
- package/dist/modules/breaking-changes/query/migration-finding-query.service.js.map +1 -1
- package/dist/modules/breaking-changes/rules/index.d.ts +3 -0
- package/dist/modules/breaking-changes/rules/index.js +3 -0
- package/dist/modules/breaking-changes/rules/index.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/compression-node-limits.rule.js +6 -6
- package/dist/modules/breaking-changes/rules/v3/compression-node-limits.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/edit-image-version.d.ts +17 -0
- package/dist/modules/breaking-changes/rules/v3/edit-image-version.js +101 -0
- package/dist/modules/breaking-changes/rules/v3/edit-image-version.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/edit-image-version.rule.d.ts +10 -0
- package/dist/modules/breaking-changes/rules/v3/edit-image-version.rule.js +57 -0
- package/dist/modules/breaking-changes/rules/v3/edit-image-version.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/removed-nodes.rule.js +1 -0
- package/dist/modules/breaking-changes/rules/v3/removed-nodes.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/slack-credential-secret.d.ts +5 -0
- package/dist/modules/breaking-changes/rules/v3/slack-credential-secret.js +33 -0
- package/dist/modules/breaking-changes/rules/v3/slack-credential-secret.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/slack-credential-signature-secret.rule.d.ts +13 -0
- package/dist/modules/breaking-changes/rules/v3/slack-credential-signature-secret.rule.js +54 -0
- package/dist/modules/breaking-changes/rules/v3/slack-credential-signature-secret.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/slack-trigger-signature-secret.rule.d.ts +13 -0
- package/dist/modules/breaking-changes/rules/v3/slack-trigger-signature-secret.rule.js +54 -0
- package/dist/modules/breaking-changes/rules/v3/slack-trigger-signature-secret.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/ssrf-default-blocked-ranges.rule.js +5 -5
- package/dist/modules/breaking-changes/rules/v3/ssrf-default-blocked-ranges.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/task-runner-task-timeout.rule.js +5 -5
- package/dist/modules/breaking-changes/rules/v3/task-runner-task-timeout.rule.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.controller.js +11 -12
- package/dist/modules/chat-hub/chat-hub.controller.js.map +1 -1
- package/dist/modules/community-packages/community-packages.controller.d.ts +17 -1
- package/dist/modules/community-packages/community-packages.controller.js +3 -1
- package/dist/modules/community-packages/community-packages.controller.js.map +1 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.d.ts +5 -2
- package/dist/modules/community-packages/community-packages.lifecycle.service.js +18 -2
- package/dist/modules/community-packages/community-packages.lifecycle.service.js.map +1 -1
- package/dist/modules/engine-v2/engine-data-plane-client.d.ts +2 -1
- package/dist/modules/engine-v2/engine-data-plane-client.js +16 -0
- package/dist/modules/engine-v2/engine-data-plane-client.js.map +1 -1
- package/dist/modules/external-secrets.ee/redaction.service.ee.js +2 -2
- package/dist/modules/external-secrets.ee/redaction.service.ee.js.map +1 -1
- package/dist/modules/inbound-auth-core/database/repositories/trusted-source-identity.repository.d.ts +8 -8
- package/dist/modules/inbound-auth-core/database/repositories/trusted-source-identity.repository.js +8 -11
- package/dist/modules/inbound-auth-core/database/repositories/trusted-source-identity.repository.js.map +1 -1
- package/dist/modules/inbound-auth-core/database/repositories/trusted-source.repository.d.ts +10 -10
- package/dist/modules/inbound-auth-core/database/repositories/trusted-source.repository.js +10 -13
- package/dist/modules/inbound-auth-core/database/repositories/trusted-source.repository.js.map +1 -1
- package/dist/modules/inbound-auth-core/oauth2-bearer.driver.js +1 -1
- package/dist/modules/inbound-auth-core/oauth2-bearer.driver.js.map +1 -1
- package/dist/modules/inbound-auth-core/public-api-oauth.strategy.d.ts +3 -2
- package/dist/modules/inbound-auth-core/public-api-oauth.strategy.js +23 -10
- package/dist/modules/inbound-auth-core/public-api-oauth.strategy.js.map +1 -1
- package/dist/modules/inbound-auth-core/resource-admission.d.ts +5 -3
- package/dist/modules/inbound-auth-core/resource-admission.js +6 -2
- package/dist/modules/inbound-auth-core/resource-admission.js.map +1 -1
- package/dist/modules/inbound-auth-core/trusted-source.gate.js +1 -1
- package/dist/modules/inbound-auth-core/trusted-source.gate.js.map +1 -1
- package/dist/modules/inbound-auth-core/trusted-source.store.js +15 -15
- package/dist/modules/inbound-auth-core/trusted-source.store.js.map +1 -1
- package/dist/modules/inbox/inbox-source.registry.d.ts +4 -4
- package/dist/modules/inbox/inbox.service.js +5 -1
- package/dist/modules/inbox/inbox.service.js.map +1 -1
- package/dist/modules/instance-ai/agent-preview-handoff.d.ts +5 -2
- package/dist/modules/instance-ai/agent-preview-handoff.js +13 -0
- package/dist/modules/instance-ai/agent-preview-handoff.js.map +1 -1
- package/dist/modules/instance-ai/agents-access.d.ts +2 -0
- package/dist/modules/instance-ai/agents-access.js +12 -0
- package/dist/modules/instance-ai/agents-access.js.map +1 -1
- package/dist/modules/instance-ai/ai-preferences-telemetry.d.ts +11 -0
- package/dist/modules/instance-ai/ai-preferences-telemetry.js +21 -0
- package/dist/modules/instance-ai/ai-preferences-telemetry.js.map +1 -0
- package/dist/modules/instance-ai/browser/browser-use-availability.d.ts +6 -0
- package/dist/modules/instance-ai/browser/browser-use-availability.js +11 -0
- package/dist/modules/instance-ai/browser/browser-use-availability.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.d.ts +0 -1
- package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.js +0 -4
- package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.js.map +1 -1
- package/dist/modules/instance-ai/eval/agent-execution.service.d.ts +8 -11
- package/dist/modules/instance-ai/eval/agent-execution.service.js +128 -224
- package/dist/modules/instance-ai/eval/agent-execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/data-table-rows.d.ts +25 -0
- package/dist/modules/instance-ai/eval/data-table-rows.js +155 -0
- package/dist/modules/instance-ai/eval/data-table-rows.js.map +1 -0
- package/dist/modules/instance-ai/eval/eval-timings.d.ts +1 -1
- package/dist/modules/instance-ai/eval/eval-timings.js +8 -1
- package/dist/modules/instance-ai/eval/eval-timings.js.map +1 -1
- package/dist/modules/instance-ai/eval/eval.controller.d.ts +78 -0
- package/dist/modules/instance-ai/eval/eval.controller.js +282 -0
- package/dist/modules/instance-ai/eval/eval.controller.js.map +1 -0
- package/dist/modules/instance-ai/eval/execution.service.d.ts +2 -3
- package/dist/modules/instance-ai/eval/execution.service.js +109 -91
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/failed-execution-portability.service.d.ts +37 -0
- package/dist/modules/instance-ai/eval/failed-execution-portability.service.js +401 -0
- package/dist/modules/instance-ai/eval/failed-execution-portability.service.js.map +1 -0
- package/dist/modules/instance-ai/eval/form-trigger-content.d.ts +2 -0
- package/dist/modules/instance-ai/eval/form-trigger-content.js +117 -0
- package/dist/modules/instance-ai/eval/form-trigger-content.js.map +1 -0
- package/dist/modules/instance-ai/eval/llm-completion-mock.js +19 -6
- package/dist/modules/instance-ai/eval/llm-completion-mock.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-handler.d.ts +10 -0
- package/dist/modules/instance-ai/eval/mock-handler.js +147 -11
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
- package/dist/modules/instance-ai/eval/node-run-mock.d.ts +19 -0
- package/dist/modules/instance-ai/eval/node-run-mock.js +163 -0
- package/dist/modules/instance-ai/eval/node-run-mock.js.map +1 -0
- package/dist/modules/instance-ai/eval/pin-data-generator.d.ts +1 -2
- package/dist/modules/instance-ai/eval/pin-data-generator.js +3 -3
- package/dist/modules/instance-ai/eval/pin-data-generator.js.map +1 -1
- package/dist/modules/instance-ai/eval/provider-shapes.d.ts +1 -0
- package/dist/modules/instance-ai/eval/provider-shapes.js +16 -0
- package/dist/modules/instance-ai/eval/provider-shapes.js.map +1 -1
- package/dist/modules/instance-ai/eval/request-sanitizer.d.ts +1 -0
- package/dist/modules/instance-ai/eval/request-sanitizer.js +16 -0
- package/dist/modules/instance-ai/eval/request-sanitizer.js.map +1 -1
- package/dist/modules/instance-ai/eval/scoped-credential-provider.d.ts +2 -3
- package/dist/modules/instance-ai/eval/scoped-credential-provider.js.map +1 -1
- package/dist/modules/instance-ai/eval/thread-restore.service.d.ts +2 -2
- package/dist/modules/instance-ai/eval/thread-restore.service.js +22 -12
- package/dist/modules/instance-ai/eval/thread-restore.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +2 -3
- package/dist/modules/instance-ai/eval/workflow-analysis.js +7 -25
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
- package/dist/modules/instance-ai/event-bus/durable-event-log.d.ts +1 -13
- package/dist/modules/instance-ai/event-bus/durable-event-log.js +0 -4
- package/dist/modules/instance-ai/event-bus/durable-event-log.js.map +1 -1
- package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.d.ts +1 -1
- package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js.map +1 -1
- package/dist/modules/instance-ai/extract-resolved-node-parameters.d.ts +2 -1
- package/dist/modules/instance-ai/extract-resolved-node-parameters.js +14 -9
- package/dist/modules/instance-ai/extract-resolved-node-parameters.js.map +1 -1
- package/dist/modules/{agents/builder/format-preview-context.d.ts → instance-ai/format-agent-session-context.d.ts} +2 -3
- package/dist/modules/{agents/builder/format-preview-context.js → instance-ai/format-agent-session-context.js} +7 -1
- package/dist/modules/instance-ai/format-agent-session-context.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-agent-context.adapter.d.ts +8 -0
- package/dist/modules/instance-ai/instance-ai-agent-context.adapter.js +40 -0
- package/dist/modules/instance-ai/instance-ai-agent-context.adapter.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-builder-delegate.adapter.d.ts +18 -0
- package/dist/modules/instance-ai/instance-ai-builder-delegate.adapter.js +77 -0
- package/dist/modules/instance-ai/instance-ai-builder-delegate.adapter.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-checkpoint-pruning.task.d.ts +3 -1
- package/dist/modules/instance-ai/instance-ai-checkpoint-pruning.task.js +6 -3
- package/dist/modules/instance-ai/instance-ai-checkpoint-pruning.task.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-credit.service.d.ts +2 -2
- package/dist/modules/instance-ai/instance-ai-credit.service.js +6 -1
- package/dist/modules/instance-ai/instance-ai-credit.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-hub-skills.d.ts +9 -0
- package/dist/modules/instance-ai/instance-ai-hub-skills.js +240 -0
- package/dist/modules/instance-ai/instance-ai-hub-skills.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +1 -0
- package/dist/modules/instance-ai/instance-ai-memory.service.js +11 -1
- package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-model.service.d.ts +4 -2
- package/dist/modules/instance-ai/instance-ai-model.service.js +7 -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 +3 -15
- package/dist/modules/instance-ai/instance-ai-pending-agent.service.js +13 -33
- package/dist/modules/instance-ai/instance-ai-pending-agent.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-preference-card.service.d.ts +1 -1
- package/dist/modules/instance-ai/instance-ai-preference-card.service.js +2 -2
- package/dist/modules/instance-ai/instance-ai-preference-card.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +3 -10
- package/dist/modules/instance-ai/instance-ai-settings.service.js +6 -40
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-skill-display.d.ts +3 -0
- package/dist/modules/instance-ai/instance-ai-skill-display.js +38 -0
- package/dist/modules/instance-ai/instance-ai-skill-display.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-skills.adapter.d.ts +8 -0
- package/dist/modules/instance-ai/instance-ai-skills.adapter.js +72 -0
- package/dist/modules/instance-ai/instance-ai-skills.adapter.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-skills.service.d.ts +9 -4
- package/dist/modules/instance-ai/instance-ai-skills.service.js +22 -6
- package/dist/modules/instance-ai/instance-ai-skills.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.d.ts +0 -1
- package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js +0 -1
- package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +11 -7
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +304 -124
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +5 -117
- package/dist/modules/instance-ai/instance-ai.controller.js +36 -475
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +17 -3
- package/dist/modules/instance-ai/instance-ai.module.js +47 -13
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +18 -90
- package/dist/modules/instance-ai/instance-ai.service.js +273 -1644
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-context.service.d.ts +0 -1
- package/dist/modules/instance-ai/instance-context.service.js +9 -6
- package/dist/modules/instance-ai/instance-context.service.js.map +1 -1
- package/dist/modules/instance-ai/internal-messages.d.ts +1 -0
- package/dist/modules/instance-ai/internal-messages.js +17 -0
- package/dist/modules/instance-ai/internal-messages.js.map +1 -1
- package/dist/modules/instance-ai/message-parser.js +47 -4
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-ai/model-config-name.js +9 -7
- package/dist/modules/instance-ai/model-config-name.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.d.ts +4 -1
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js +12 -6
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-observation.repository.d.ts +8 -3
- package/dist/modules/instance-ai/repositories/instance-ai-observation.repository.js +58 -4
- package/dist/modules/instance-ai/repositories/instance-ai-observation.repository.js.map +1 -1
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js +8 -2
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js.map +1 -1
- package/dist/modules/instance-ai/self-healing/candidate-workflow.d.ts +22 -0
- package/dist/modules/instance-ai/self-healing/candidate-workflow.js +127 -0
- package/dist/modules/instance-ai/self-healing/candidate-workflow.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration-reviewer.entity.d.ts +9 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration-reviewer.entity.js +41 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration-reviewer.entity.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration-workflow.entity.d.ts +11 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration-workflow.entity.js +51 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration-workflow.entity.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration.entity.d.ts +11 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration.entity.js +54 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration.entity.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration.repository.d.ts +17 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration.repository.js +195 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-configuration.repository.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-investigation.entity.d.ts +21 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-investigation.entity.js +94 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-investigation.entity.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-investigation.repository.d.ts +21 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-investigation.repository.js +77 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-investigation.repository.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-result.entity.d.ts +3 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-result.entity.js +11 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-result.entity.js.map +1 -1
- package/dist/modules/instance-ai/self-healing/database/self-healing-result.repository.d.ts +8 -1
- package/dist/modules/instance-ai/self-healing/database/self-healing-result.repository.js +25 -1
- package/dist/modules/instance-ai/self-healing/database/self-healing-result.repository.js.map +1 -1
- package/dist/modules/instance-ai/self-healing/database/self-healing-temporary-workflow.repository.d.ts +14 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-temporary-workflow.repository.js +92 -0
- package/dist/modules/instance-ai/self-healing/database/self-healing-temporary-workflow.repository.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/self-healing-agent.service.d.ts +94 -0
- package/dist/modules/instance-ai/self-healing/self-healing-agent.service.js +429 -0
- package/dist/modules/instance-ai/self-healing/self-healing-agent.service.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/self-healing-candidate.service.d.ts +143 -0
- package/dist/modules/instance-ai/self-healing/self-healing-candidate.service.js +212 -0
- package/dist/modules/instance-ai/self-healing/self-healing-candidate.service.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/self-healing-configuration.service.d.ts +34 -0
- package/dist/modules/instance-ai/self-healing/self-healing-configuration.service.js +213 -0
- package/dist/modules/instance-ai/self-healing/self-healing-configuration.service.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/self-healing-configurations.controller.d.ts +20 -0
- package/dist/modules/instance-ai/self-healing/self-healing-configurations.controller.js +109 -0
- package/dist/modules/instance-ai/self-healing/self-healing-configurations.controller.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/self-healing-execution-reference.service.d.ts +2 -1
- package/dist/modules/instance-ai/self-healing/self-healing-execution-reference.service.js +23 -0
- package/dist/modules/instance-ai/self-healing/self-healing-execution-reference.service.js.map +1 -1
- package/dist/modules/instance-ai/self-healing/self-healing-investigation.service.d.ts +55 -0
- package/dist/modules/instance-ai/self-healing/self-healing-investigation.service.js +255 -0
- package/dist/modules/instance-ai/self-healing/self-healing-investigation.service.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/self-healing-reconciliation.task.d.ts +11 -0
- package/dist/modules/instance-ai/self-healing/self-healing-reconciliation.task.js +37 -0
- package/dist/modules/instance-ai/self-healing/self-healing-reconciliation.task.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/self-healing-result.service.d.ts +24 -13
- package/dist/modules/instance-ai/self-healing/self-healing-result.service.js +133 -68
- package/dist/modules/instance-ai/self-healing/self-healing-result.service.js.map +1 -1
- package/dist/modules/instance-ai/self-healing/self-healing-temporary-workflow.service.d.ts +29 -0
- package/dist/modules/instance-ai/self-healing/self-healing-temporary-workflow.service.js +118 -0
- package/dist/modules/instance-ai/self-healing/self-healing-temporary-workflow.service.js.map +1 -0
- package/dist/modules/instance-ai/self-healing/self-healing-trigger.service.d.ts +18 -0
- package/dist/modules/instance-ai/self-healing/self-healing-trigger.service.js +100 -0
- package/dist/modules/instance-ai/self-healing/self-healing-trigger.service.js.map +1 -0
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.d.ts +2 -1
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js +3 -1
- 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 +2 -1
- package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js +3 -0
- package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js.map +1 -1
- package/dist/modules/instance-ai/suspended-run-restorer.service.js +1 -0
- package/dist/modules/instance-ai/suspended-run-restorer.service.js.map +1 -1
- package/dist/modules/instance-ai/suspended-thread-persistence.service.d.ts +0 -1
- package/dist/modules/instance-ai/suspended-thread-persistence.service.js +0 -1
- package/dist/modules/instance-ai/suspended-thread-persistence.service.js.map +1 -1
- package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.d.ts +1 -1
- package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.js +0 -1
- package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.js.map +1 -1
- package/dist/modules/instance-ai/turn-setup/assistant-agent.factory.d.ts +51 -0
- package/dist/modules/instance-ai/turn-setup/assistant-agent.factory.js +226 -0
- package/dist/modules/instance-ai/turn-setup/assistant-agent.factory.js.map +1 -0
- package/dist/modules/instance-ai/turn-setup/assistant-credits.d.ts +10 -0
- package/dist/modules/instance-ai/turn-setup/assistant-credits.js +22 -0
- package/dist/modules/instance-ai/turn-setup/assistant-credits.js.map +1 -0
- package/dist/modules/instance-ai/turn-setup/assistant-turn-environment.factory.d.ts +84 -0
- package/dist/modules/instance-ai/turn-setup/assistant-turn-environment.factory.js +423 -0
- package/dist/modules/instance-ai/turn-setup/assistant-turn-environment.factory.js.map +1 -0
- package/dist/modules/instance-ai/turn-setup/assistant-turn-input.builder.d.ts +70 -0
- package/dist/modules/instance-ai/turn-setup/assistant-turn-input.builder.js +447 -0
- package/dist/modules/instance-ai/turn-setup/assistant-turn-input.builder.js.map +1 -0
- package/dist/modules/instance-ai/turn-setup/assistant-turn-runtime.d.ts +36 -0
- package/dist/modules/instance-ai/turn-setup/assistant-turn-runtime.js +3 -0
- package/dist/modules/instance-ai/turn-setup/assistant-turn-runtime.js.map +1 -0
- package/dist/modules/instance-ai/workflow-json.d.ts +6 -0
- package/dist/modules/instance-ai/workflow-json.js +36 -0
- package/dist/modules/instance-ai/workflow-json.js.map +1 -0
- package/dist/modules/instance-ai/workflow-suggestions/workflow-suggestion-actions.service.d.ts +1 -1
- package/dist/modules/instance-ai/workflow-suggestions/workflow-suggestion-actions.service.js +15 -11
- package/dist/modules/instance-ai/workflow-suggestions/workflow-suggestion-actions.service.js.map +1 -1
- package/dist/modules/instance-ai/workflow-suggestions/workflow-suggestion-event-relay.service.d.ts +8 -0
- package/dist/modules/instance-ai/workflow-suggestions/workflow-suggestion-event-relay.service.js +23 -17
- package/dist/modules/instance-ai/workflow-suggestions/workflow-suggestion-event-relay.service.js.map +1 -1
- package/dist/modules/instance-ai/workflow-suggestions/workflow-suggestion.service.d.ts +1 -0
- package/dist/modules/instance-ai/workflow-suggestions/workflow-suggestion.service.js +14 -0
- package/dist/modules/instance-ai/workflow-suggestions/workflow-suggestion.service.js.map +1 -1
- package/dist/modules/instance-ai/workflow-verification-obligation-service.d.ts +3 -13
- package/dist/modules/instance-ai/workflow-verification-obligation-service.js +3 -39
- package/dist/modules/instance-ai/workflow-verification-obligation-service.js.map +1 -1
- package/dist/modules/instance-ai/workflow-verification-task-projector.d.ts +1 -4
- package/dist/modules/instance-ai/workflow-verification-task-projector.js +3 -84
- package/dist/modules/instance-ai/workflow-verification-task-projector.js.map +1 -1
- package/dist/modules/instance-registry/instance-registry.service.d.ts +1 -0
- package/dist/modules/instance-registry/instance-registry.service.js +27 -0
- package/dist/modules/instance-registry/instance-registry.service.js.map +1 -1
- package/dist/modules/knowledge/knowledge-availability.service.d.ts +10 -0
- package/dist/modules/knowledge/knowledge-availability.service.js +39 -0
- package/dist/modules/knowledge/knowledge-availability.service.js.map +1 -0
- package/dist/modules/knowledge/knowledge-consumer-scope.d.ts +6 -0
- package/dist/modules/knowledge/knowledge-consumer-scope.js +3 -0
- package/dist/modules/knowledge/knowledge-consumer-scope.js.map +1 -0
- package/dist/modules/knowledge/knowledge-retriever.d.ts +8 -0
- package/dist/modules/knowledge/knowledge-retriever.js +3 -0
- package/dist/modules/knowledge/knowledge-retriever.js.map +1 -0
- package/dist/modules/knowledge/knowledge-sandbox-provider.d.ts +15 -0
- package/dist/modules/knowledge/knowledge-sandbox-provider.js +3 -0
- package/dist/modules/knowledge/knowledge-sandbox-provider.js.map +1 -0
- package/dist/modules/knowledge/knowledge.module.d.ts +5 -0
- package/dist/modules/knowledge/knowledge.module.js +22 -0
- package/dist/modules/knowledge/knowledge.module.js.map +1 -0
- package/dist/modules/knowledge/vector-stores/connection-test.service.d.ts +8 -0
- package/dist/modules/{agents/agent-vector-stores.service.js → knowledge/vector-stores/connection-test.service.js} +11 -21
- package/dist/modules/knowledge/vector-stores/connection-test.service.js.map +1 -0
- package/dist/modules/{agents/json-config → knowledge/vector-stores}/embedding-credential.js +1 -1
- package/dist/modules/knowledge/vector-stores/embedding-credential.js.map +1 -0
- package/dist/modules/{agents/json-config/vector-store-factory.js → knowledge/vector-stores/factory.js} +1 -1
- package/dist/modules/knowledge/vector-stores/factory.js.map +1 -0
- package/dist/modules/ldap.ee/ldap.service.ee.d.ts +1 -3
- package/dist/modules/ldap.ee/ldap.service.ee.js +36 -36
- package/dist/modules/ldap.ee/ldap.service.ee.js.map +1 -1
- package/dist/modules/mcp/mcp-api-key.service.d.ts +5 -1
- package/dist/modules/mcp/mcp-api-key.service.js +13 -10
- package/dist/modules/mcp/mcp-api-key.service.js.map +1 -1
- package/dist/modules/mcp/mcp-protected-resource.js +2 -1
- package/dist/modules/mcp/mcp-protected-resource.js.map +1 -1
- package/dist/modules/mcp/mcp-scopes.js +2 -2
- package/dist/modules/mcp/mcp-scopes.js.map +1 -1
- package/dist/modules/mcp/mcp-server-middleware.service.d.ts +12 -6
- package/dist/modules/mcp/mcp-server-middleware.service.js +107 -67
- package/dist/modules/mcp/mcp-server-middleware.service.js.map +1 -1
- package/dist/modules/mcp/mcp-tool-availability.d.ts +0 -1
- package/dist/modules/mcp/mcp-tool-availability.js +0 -4
- package/dist/modules/mcp/mcp-tool-availability.js.map +1 -1
- package/dist/modules/mcp/mcp.constants.d.ts +1 -0
- package/dist/modules/mcp/mcp.constants.js +2 -1
- package/dist/modules/mcp/mcp.constants.js.map +1 -1
- package/dist/modules/mcp/mcp.module.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +2 -2
- package/dist/modules/mcp/mcp.service.js +9 -4
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/tools/agents/agent-tools.service.js +6 -26
- package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -1
- package/dist/modules/mcp/tools/get-user-preferences.tool.d.ts +1 -1
- package/dist/modules/mcp/tools/get-user-preferences.tool.js +3 -3
- package/dist/modules/mcp/tools/get-user-preferences.tool.js.map +1 -1
- package/dist/modules/mcp/tools/save-user-preference.tool.d.ts +1 -2
- package/dist/modules/mcp/tools/save-user-preference.tool.js.map +1 -1
- package/dist/modules/mcp/tools/skills/skill-extension.service.d.ts +27 -0
- package/dist/modules/mcp/tools/skills/skill-extension.service.js +160 -0
- package/dist/modules/mcp/tools/skills/skill-extension.service.js.map +1 -0
- package/dist/modules/mcp/tools/skills/skill-tools.service.d.ts +5 -3
- package/dist/modules/mcp/tools/skills/skill-tools.service.js +28 -19
- package/dist/modules/mcp/tools/skills/skill-tools.service.js.map +1 -1
- package/dist/modules/mcp/tools/undo-user-preference.tool.d.ts +1 -1
- package/dist/modules/mcp/tools/update-user-preference.tool.d.ts +1 -2
- package/dist/modules/mcp/tools/update-user-preference.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/install-community-node.tool.js +6 -0
- package/dist/modules/mcp/tools/workflow-builder/install-community-node.tool.js.map +1 -1
- 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 +3 -3
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-auth-fetch.d.ts +2 -1
- package/dist/modules/mcp-registry/mcp-auth-fetch.js +3 -3
- package/dist/modules/mcp-registry/mcp-auth-fetch.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-connection-discovery.service.d.ts +4 -1
- package/dist/modules/mcp-registry/mcp-connection-discovery.service.js +42 -2
- package/dist/modules/mcp-registry/mcp-connection-discovery.service.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-registry-connection.d.ts +3 -1
- package/dist/modules/mcp-registry/mcp-registry-connection.js +51 -3
- package/dist/modules/mcp-registry/mcp-registry-connection.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-registry-node-loader.d.ts +1 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.js +6 -1
- package/dist/modules/mcp-registry/mcp-registry-node-loader.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-registry-response.js +2 -0
- package/dist/modules/mcp-registry/mcp-registry-response.js.map +1 -1
- package/dist/modules/mcp-registry/node-description-transform.d.ts +1 -0
- package/dist/modules/mcp-registry/node-description-transform.js +60 -2
- package/dist/modules/mcp-registry/node-description-transform.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-ai-gateway.d.ts +3 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-ai-gateway.js +50 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-ai-gateway.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-api.client.js +4 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-api.client.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-capabilities.d.ts +3 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-capabilities.js +9 -2
- package/dist/modules/mcp-registry/registry/mcp-registry-capabilities.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-search.d.ts +3 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-search.js +9 -2
- package/dist/modules/mcp-registry/registry/mcp-registry-search.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.service.d.ts +8 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js +80 -12
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.types.d.ts +20 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js +18 -3
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mock-servers.d.ts +87 -1
- package/dist/modules/mcp-registry/registry/mock-servers.js +48 -1
- package/dist/modules/mcp-registry/registry/mock-servers.js.map +1 -1
- package/dist/modules/modules.manifest.js +7 -0
- package/dist/modules/modules.manifest.js.map +1 -1
- package/dist/modules/n8n-packages/engine/credential-save-policy.d.ts +3 -1
- package/dist/modules/n8n-packages/engine/credential-save-policy.js +47 -0
- package/dist/modules/n8n-packages/engine/credential-save-policy.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-blocked.error.js +2 -1
- package/dist/modules/n8n-packages/engine/import-blocked.error.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-gates.d.ts +3 -2
- package/dist/modules/n8n-packages/engine/import-gates.js +7 -0
- package/dist/modules/n8n-packages/engine/import-gates.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-orchestrator.d.ts +11 -1
- package/dist/modules/n8n-packages/engine/import-orchestrator.js +118 -13
- package/dist/modules/n8n-packages/engine/import-orchestrator.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-result.d.ts +12 -1
- package/dist/modules/n8n-packages/engine/import-result.js +29 -4
- package/dist/modules/n8n-packages/engine/import-result.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-telemetry.js +6 -2
- package/dist/modules/n8n-packages/engine/import-telemetry.js.map +1 -1
- package/dist/modules/n8n-packages/engine/n8n-package-parser.d.ts +1 -3
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js +12 -22
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
- package/dist/modules/n8n-packages/engine/package-layout.d.ts +1 -2
- package/dist/modules/n8n-packages/engine/package-layout.js.map +1 -1
- package/dist/modules/n8n-packages/engine/project-package-importer.js +32 -8
- package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js +22 -21
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/agent/agent-body-issues.d.ts +4 -0
- package/dist/modules/n8n-packages/entities/agent/agent-body-issues.js +16 -0
- package/dist/modules/n8n-packages/entities/agent/agent-body-issues.js.map +1 -0
- package/dist/modules/n8n-packages/entities/agent/agent-import-bindings.d.ts +17 -0
- package/dist/modules/n8n-packages/entities/agent/agent-import-bindings.js +275 -0
- package/dist/modules/n8n-packages/entities/agent/agent-import-bindings.js.map +1 -0
- package/dist/modules/n8n-packages/entities/agent/agent-import-match.service.d.ts +13 -0
- package/dist/modules/n8n-packages/entities/agent/agent-import-match.service.js +111 -0
- package/dist/modules/n8n-packages/entities/agent/agent-import-match.service.js.map +1 -0
- package/dist/modules/n8n-packages/entities/agent/agent-import.types.d.ts +61 -0
- package/dist/modules/n8n-packages/entities/agent/agent-import.types.js +14 -0
- package/dist/modules/n8n-packages/entities/agent/agent-import.types.js.map +1 -1
- package/dist/modules/n8n-packages/entities/agent/agent-importer.d.ts +25 -0
- package/dist/modules/n8n-packages/entities/agent/agent-importer.js +223 -0
- package/dist/modules/n8n-packages/entities/agent/agent-importer.js.map +1 -0
- package/dist/modules/n8n-packages/entities/agent/agent-requirements.extractor.js +2 -2
- package/dist/modules/n8n-packages/entities/agent/agent-requirements.extractor.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-conflict-policy.d.ts +4 -1
- package/dist/modules/n8n-packages/entities/credential/credential-conflict-policy.js +12 -1
- package/dist/modules/n8n-packages/entities/credential/credential-conflict-policy.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-export-policy.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-export-policy.js +3 -2
- package/dist/modules/n8n-packages/entities/credential/credential-export-policy.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-importer.d.ts +15 -5
- package/dist/modules/n8n-packages/entities/credential/credential-importer.js +116 -11
- package/dist/modules/n8n-packages/entities/credential/credential-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-matcher.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/credential/credential-matcher.js +31 -14
- package/dist/modules/n8n-packages/entities/credential/credential-matcher.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-missing-mode.js +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-missing-mode.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js +2 -2
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential.types.d.ts +8 -2
- package/dist/modules/n8n-packages/entities/credential/credential.types.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/id-based-credential-matcher.d.ts +1 -0
- package/dist/modules/n8n-packages/entities/credential/id-based-credential-matcher.js +1 -0
- package/dist/modules/n8n-packages/entities/credential/id-based-credential-matcher.js.map +1 -1
- package/dist/modules/n8n-packages/entities/data-table/data-table-compat.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/data-table/data-table-compat.js.map +1 -1
- package/dist/modules/n8n-packages/entities/data-table/data-table-importer.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/data-table/data-table-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/data-table/data-table-schema-conflict-policy.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/data-table/data-table-schema-conflict-policy.js.map +1 -1
- package/dist/modules/n8n-packages/entities/data-table/data-table.serializer.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/data-table/data-table.serializer.js +2 -2
- package/dist/modules/n8n-packages/entities/data-table/data-table.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/data-table/data-table.types.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/folder/folder-import.types.d.ts +6 -2
- package/dist/modules/n8n-packages/entities/folder/folder-importer.d.ts +3 -1
- package/dist/modules/n8n-packages/entities/folder/folder-importer.js +44 -16
- package/dist/modules/n8n-packages/entities/folder/folder-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/folder/folder-remover.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/folder/folder-remover.js +12 -2
- package/dist/modules/n8n-packages/entities/folder/folder-remover.js.map +1 -1
- package/dist/modules/n8n-packages/entities/folder/folder.serializer.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/folder/folder.serializer.js +2 -2
- package/dist/modules/n8n-packages/entities/folder/folder.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/import-conflict-policy.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/import-conflict-policy.js +12 -0
- package/dist/modules/n8n-packages/entities/import-conflict-policy.js.map +1 -0
- package/dist/modules/n8n-packages/entities/import-id-policy.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/import-id-policy.js +12 -0
- package/dist/modules/n8n-packages/entities/import-id-policy.js.map +1 -0
- package/dist/modules/n8n-packages/entities/match-source-ids.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/match-source-ids.js +32 -0
- package/dist/modules/n8n-packages/entities/match-source-ids.js.map +1 -0
- package/dist/modules/n8n-packages/entities/planned-placements.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/planned-placements.js +12 -0
- package/dist/modules/n8n-packages/entities/planned-placements.js.map +1 -0
- package/dist/modules/n8n-packages/entities/project/project-import.types.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/project/project.serializer.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/project/project.serializer.js +2 -2
- package/dist/modules/n8n-packages/entities/project/project.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/tag/tag-importer.d.ts +8 -1
- package/dist/modules/n8n-packages/entities/tag/tag-importer.js +13 -5
- package/dist/modules/n8n-packages/entities/tag/tag-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/tag/tag.exporter.d.ts +5 -0
- package/dist/modules/n8n-packages/entities/tag/tag.exporter.js +6 -3
- package/dist/modules/n8n-packages/entities/tag/tag.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable.serializer.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable.serializer.js +3 -3
- package/dist/modules/n8n-packages/entities/variable/variable.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/missing-node-type-mode.d.ts +2 -2
- package/dist/modules/n8n-packages/entities/workflow/missing-node-type-mode.js +8 -5
- package/dist/modules/n8n-packages/entities/workflow/missing-node-type-mode.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/references/sub-workflow-node.reference.d.ts +0 -6
- package/dist/modules/n8n-packages/entities/workflow/references/sub-workflow-node.reference.js +3 -31
- package/dist/modules/n8n-packages/entities/workflow/references/sub-workflow-node.reference.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-import-match.service.js +8 -28
- package/dist/modules/n8n-packages/entities/workflow/workflow-import-match.service.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-import.types.d.ts +2 -6
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.d.ts +5 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +16 -7
- 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 +4 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.d.ts +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.js +8 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-remover.js +13 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-remover.js.map +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 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +17 -6
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/io/directory/package-directory-inventory-reader.d.ts +8 -4
- package/dist/modules/n8n-packages/io/directory/package-directory-inventory-reader.js +28 -10
- package/dist/modules/n8n-packages/io/directory/package-directory-inventory-reader.js.map +1 -1
- package/dist/modules/n8n-packages/io/hashing-package-writer.d.ts +1 -0
- package/dist/modules/n8n-packages/io/hashing-package-writer.js +8 -5
- package/dist/modules/n8n-packages/io/hashing-package-writer.js.map +1 -1
- package/dist/modules/n8n-packages/io/manifest-entry.d.ts +1 -2
- package/dist/modules/n8n-packages/io/manifest-entry.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.service.d.ts +2 -2
- package/dist/modules/n8n-packages/n8n-packages.service.js +4 -3
- package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +21 -4
- package/dist/modules/n8n-packages/n8n-packages.types.js +5 -1
- package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
- package/dist/modules/n8n-packages/spec/serialized/agent.schema.d.ts +13 -7
- package/dist/modules/oauth-server/oauth-token.service.js +0 -3
- package/dist/modules/oauth-server/oauth-token.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth.controller.js +7 -1
- package/dist/modules/oauth-server/oauth.controller.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-test-trigger-resource.resolver.d.ts +2 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-test-trigger-resource.resolver.js +1 -0
- 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.d.ts +2 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-trigger-resource.resolver.js +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-trigger-resource.resolver.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.d.ts +4 -1
- package/dist/modules/otel/execution-level-tracer.js +21 -26
- package/dist/modules/otel/execution-level-tracer.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.types.d.ts +2 -0
- package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
- package/dist/modules/otel/gen-ai-attributes.d.ts +3 -0
- package/dist/modules/otel/gen-ai-attributes.js +72 -0
- package/dist/modules/otel/gen-ai-attributes.js.map +1 -0
- package/dist/modules/otel/otel-lifecycle-handler.js +6 -1
- package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
- package/dist/modules/otel/otel.config.d.ts +19 -0
- package/dist/modules/otel/otel.config.js +33 -1
- package/dist/modules/otel/otel.config.js.map +1 -1
- package/dist/modules/otel/otel.constants.d.ts +7 -3
- package/dist/modules/otel/otel.constants.js +8 -4
- package/dist/modules/otel/otel.constants.js.map +1 -1
- package/dist/modules/promotions.ee/branch-placement.d.ts +3 -0
- package/dist/modules/promotions.ee/branch-placement.js +3 -1
- package/dist/modules/promotions.ee/branch-placement.js.map +1 -1
- package/dist/modules/promotions.ee/constants.d.ts +0 -5
- package/dist/modules/promotions.ee/constants.js +1 -3
- package/dist/modules/promotions.ee/constants.js.map +1 -1
- package/dist/modules/promotions.ee/cross-project-moves.d.ts +41 -0
- package/dist/modules/promotions.ee/cross-project-moves.js +59 -0
- package/dist/modules/promotions.ee/cross-project-moves.js.map +1 -0
- package/dist/modules/promotions.ee/database/entities/promotion-environment-project.entity.d.ts +10 -0
- package/dist/modules/promotions.ee/database/entities/{promotion-connection-project.entity.js → promotion-environment-project.entity.js} +18 -14
- package/dist/modules/promotions.ee/database/entities/promotion-environment-project.entity.js.map +1 -0
- package/dist/modules/promotions.ee/database/entities/promotion-environment.entity.d.ts +16 -0
- package/dist/modules/promotions.ee/database/entities/{promotion-connection.entity.js → promotion-environment.entity.js} +36 -13
- package/dist/modules/promotions.ee/database/entities/promotion-environment.entity.js.map +1 -0
- package/dist/modules/promotions.ee/database/entities/promotion-review.entity.d.ts +3 -3
- package/dist/modules/promotions.ee/database/entities/promotion-review.entity.js +7 -7
- package/dist/modules/promotions.ee/database/entities/promotion-review.entity.js.map +1 -1
- package/dist/modules/promotions.ee/database/entities/promotion-run.entity.d.ts +3 -3
- package/dist/modules/promotions.ee/database/entities/promotion-run.entity.js +6 -6
- package/dist/modules/promotions.ee/database/entities/promotion-run.entity.js.map +1 -1
- package/dist/modules/promotions.ee/database/promotion-conflict.error.d.ts +0 -3
- package/dist/modules/promotions.ee/database/promotion-conflict.error.js +0 -4
- package/dist/modules/promotions.ee/database/promotion-conflict.error.js.map +1 -1
- package/dist/modules/promotions.ee/database/repositories/promotion-environment-project.repository.d.ts +11 -0
- package/dist/modules/promotions.ee/database/repositories/{promotion-connection-project.repository.js → promotion-environment-project.repository.js} +21 -20
- package/dist/modules/promotions.ee/database/repositories/promotion-environment-project.repository.js.map +1 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-environment.repository.d.ts +28 -0
- package/dist/modules/promotions.ee/database/repositories/{promotion-connection.repository.js → promotion-environment.repository.js} +21 -22
- package/dist/modules/promotions.ee/database/repositories/promotion-environment.repository.js.map +1 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.js +1 -1
- package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.js.map +1 -1
- package/dist/modules/promotions.ee/database/repositories/promotion-review.repository.d.ts +15 -10
- package/dist/modules/promotions.ee/database/repositories/promotion-review.repository.js +53 -21
- package/dist/modules/promotions.ee/database/repositories/promotion-review.repository.js.map +1 -1
- package/dist/modules/promotions.ee/database/repositories/promotion-run.repository.d.ts +2 -1
- package/dist/modules/promotions.ee/database/repositories/promotion-run.repository.js +8 -0
- package/dist/modules/promotions.ee/database/repositories/promotion-run.repository.js.map +1 -1
- package/dist/modules/promotions.ee/git-hosts/{git-host-target.d.ts → git-host-remote.d.ts} +7 -6
- package/dist/modules/promotions.ee/git-hosts/{git-host-target.js → git-host-remote.js} +24 -18
- package/dist/modules/promotions.ee/git-hosts/git-host-remote.js.map +1 -0
- package/dist/modules/promotions.ee/git-hosts/gitlab-host.client.js +2 -2
- package/dist/modules/promotions.ee/git-hosts/gitlab-merge-request.client.d.ts +21 -0
- package/dist/modules/promotions.ee/git-hosts/gitlab-merge-request.client.js +230 -0
- package/dist/modules/promotions.ee/git-hosts/gitlab-merge-request.client.js.map +1 -0
- package/dist/modules/promotions.ee/git-hosts/gitlab-merge-request.types.d.ts +87 -0
- package/dist/modules/promotions.ee/git-hosts/gitlab-merge-request.types.js +33 -0
- package/dist/modules/promotions.ee/git-hosts/gitlab-merge-request.types.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-change.service.d.ts +37 -5
- package/dist/modules/promotions.ee/promotion-change.service.js +294 -48
- package/dist/modules/promotions.ee/promotion-change.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotion-changes.controller.d.ts +7 -3
- package/dist/modules/promotions.ee/promotion-changes.controller.js +38 -6
- package/dist/modules/promotions.ee/promotion-changes.controller.js.map +1 -1
- package/dist/modules/promotions.ee/promotion-commit-message.d.ts +15 -0
- package/dist/modules/promotions.ee/promotion-commit-message.js +30 -0
- package/dist/modules/promotions.ee/promotion-commit-message.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-environment.resolver.d.ts +14 -0
- package/dist/modules/promotions.ee/promotion-environment.resolver.js +79 -0
- package/dist/modules/promotions.ee/promotion-environment.resolver.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-environments.service.d.ts +95 -0
- package/dist/modules/promotions.ee/promotion-environments.service.js +224 -0
- package/dist/modules/promotions.ee/promotion-environments.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-preview.d.ts +47 -0
- package/dist/modules/promotions.ee/promotion-preview.js +349 -0
- package/dist/modules/promotions.ee/promotion-preview.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-providers.service.d.ts +3 -3
- package/dist/modules/promotions.ee/promotion-providers.service.js +6 -6
- package/dist/modules/promotions.ee/promotion-providers.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotion-review-changes.service.d.ts +19 -0
- package/dist/modules/promotions.ee/promotion-review-changes.service.js +186 -0
- package/dist/modules/promotions.ee/promotion-review-changes.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-review-gate.service.d.ts +17 -0
- package/dist/modules/promotions.ee/promotion-review-gate.service.js +91 -0
- package/dist/modules/promotions.ee/promotion-review-gate.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-review-host.resolver.d.ts +16 -0
- package/dist/modules/promotions.ee/promotion-review-host.resolver.js +55 -0
- package/dist/modules/promotions.ee/promotion-review-host.resolver.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-review-inbox.service.d.ts +45 -0
- package/dist/modules/promotions.ee/promotion-review-inbox.service.js +283 -0
- package/dist/modules/promotions.ee/promotion-review-inbox.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-review.utils.d.ts +3 -0
- package/dist/modules/promotions.ee/promotion-review.utils.js +27 -0
- package/dist/modules/promotions.ee/promotion-review.utils.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-reviews.controller.d.ts +13 -0
- package/dist/modules/promotions.ee/promotion-reviews.controller.js +70 -0
- package/dist/modules/promotions.ee/promotion-reviews.controller.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-reviews.service.d.ts +29 -0
- package/dist/modules/promotions.ee/promotion-reviews.service.js +100 -0
- package/dist/modules/promotions.ee/promotion-reviews.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-working-directory.service.d.ts +5 -5
- package/dist/modules/promotions.ee/promotion-working-directory.service.js +15 -16
- package/dist/modules/promotions.ee/promotion-working-directory.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotions-git.service.d.ts +40 -6
- package/dist/modules/promotions.ee/promotions-git.service.js +235 -17
- package/dist/modules/promotions.ee/promotions-git.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotions-git.utils.d.ts +3 -4
- package/dist/modules/promotions.ee/promotions-git.utils.js +3 -4
- package/dist/modules/promotions.ee/promotions-git.utils.js.map +1 -1
- package/dist/modules/promotions.ee/promotions-selective-push.error.d.ts +4 -1
- package/dist/modules/promotions.ee/promotions-selective-push.error.js +4 -3
- package/dist/modules/promotions.ee/promotions-selective-push.error.js.map +1 -1
- package/dist/modules/promotions.ee/promotions.module.d.ts +1 -1
- package/dist/modules/promotions.ee/promotions.module.js +14 -6
- package/dist/modules/promotions.ee/promotions.module.js.map +1 -1
- package/dist/modules/promotions.ee/promotions.service.d.ts +38 -9
- package/dist/modules/promotions.ee/promotions.service.js +452 -107
- package/dist/modules/promotions.ee/promotions.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotions.types.d.ts +13 -8
- package/dist/modules/promotions.ee/working-copy-updater.js +5 -2
- package/dist/modules/promotions.ee/working-copy-updater.js.map +1 -1
- package/dist/modules/provisioning.ee/provisioning.service.ee.d.ts +0 -1
- package/dist/modules/provisioning.ee/provisioning.service.ee.js +2 -14
- package/dist/modules/provisioning.ee/provisioning.service.ee.js.map +1 -1
- package/dist/modules/redaction/executions/execution-redaction.service.js +0 -3
- package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
- package/dist/modules/scim/database/scim-token.repository.d.ts +32 -0
- package/dist/modules/scim/database/scim-token.repository.js +95 -0
- package/dist/modules/scim/database/scim-token.repository.js.map +1 -0
- package/dist/modules/scim/database/scim-user.repository.js +1 -2
- package/dist/modules/scim/database/scim-user.repository.js.map +1 -1
- package/dist/modules/scim/scim-auth.middleware.d.ts +4 -1
- package/dist/modules/scim/scim-auth.middleware.js +18 -10
- package/dist/modules/scim/scim-auth.middleware.js.map +1 -1
- package/dist/modules/scim/scim-discovery.controller.js +1 -8
- package/dist/modules/scim/scim-discovery.controller.js.map +1 -1
- package/dist/modules/scim/scim-settings.service.d.ts +15 -2
- package/dist/modules/scim/scim-settings.service.js +36 -3
- package/dist/modules/scim/scim-settings.service.js.map +1 -1
- package/dist/modules/scim/scim-sso.service.d.ts +16 -0
- package/dist/modules/scim/scim-sso.service.js +72 -0
- package/dist/modules/scim/scim-sso.service.js.map +1 -0
- package/dist/modules/scim/scim-token.controller.d.ts +7 -3
- package/dist/modules/scim/scim-token.controller.js +43 -10
- package/dist/modules/scim/scim-token.controller.js.map +1 -1
- package/dist/modules/scim/scim-token.service.d.ts +8 -13
- package/dist/modules/scim/scim-token.service.js +35 -48
- package/dist/modules/scim/scim-token.service.js.map +1 -1
- package/dist/modules/scim/scim.controller.js +5 -0
- package/dist/modules/scim/scim.controller.js.map +1 -1
- package/dist/modules/scim/scim.errors.d.ts +9 -0
- package/dist/modules/scim/scim.errors.js +19 -1
- package/dist/modules/scim/scim.errors.js.map +1 -1
- package/dist/modules/scim/scim.module.js +2 -0
- package/dist/modules/scim/scim.module.js.map +1 -1
- package/dist/modules/scim/scim.service.d.ts +9 -9
- package/dist/modules/scim/scim.service.js +46 -69
- package/dist/modules/scim/scim.service.js.map +1 -1
- package/dist/modules/skills/assistant-skills-rollout.d.ts +8 -0
- package/dist/modules/skills/assistant-skills-rollout.js +32 -0
- package/dist/modules/skills/assistant-skills-rollout.js.map +1 -0
- package/dist/modules/skills/hub-assistant-skill-provider.service.d.ts +12 -0
- package/dist/modules/skills/hub-assistant-skill-provider.service.js +45 -0
- package/dist/modules/skills/hub-assistant-skill-provider.service.js.map +1 -0
- package/dist/modules/skills/skill-agents-proxy.service.d.ts +39 -0
- package/dist/modules/skills/skill-agents-proxy.service.js +74 -0
- package/dist/modules/skills/skill-agents-proxy.service.js.map +1 -0
- package/dist/modules/{agents/skills → skills}/skill-content-hash.d.ts +1 -1
- package/dist/modules/skills/skill-content-hash.js.map +1 -0
- package/dist/modules/skills/skill-file.entity.js.map +1 -0
- package/dist/modules/skills/skill-hash.d.ts +2 -0
- package/dist/modules/skills/skill-hash.js +21 -0
- package/dist/modules/skills/skill-hash.js.map +1 -0
- package/dist/modules/skills/skill-name-taken.error.js.map +1 -0
- package/dist/modules/skills/skill-names.js.map +1 -0
- package/dist/modules/skills/skill-version.entity.js.map +1 -0
- package/dist/modules/{agents/entities → skills}/skill.entity.d.ts +4 -1
- package/dist/modules/{agents/entities → skills}/skill.entity.js +8 -0
- package/dist/modules/skills/skill.entity.js.map +1 -0
- package/dist/modules/{agents/repositories → skills}/skill.repository.d.ts +39 -38
- package/dist/modules/skills/skill.repository.js +410 -0
- package/dist/modules/skills/skill.repository.js.map +1 -0
- package/dist/modules/{agents/skills → skills}/skill.service.d.ts +35 -27
- package/dist/modules/{agents/skills → skills}/skill.service.js +138 -102
- package/dist/modules/skills/skill.service.js.map +1 -0
- package/dist/modules/{agents/skills → skills}/skills-api.service.d.ts +11 -3
- package/dist/modules/{agents/skills → skills}/skills-api.service.js +111 -31
- package/dist/modules/skills/skills-api.service.js.map +1 -0
- package/dist/modules/{agents/skills → skills}/skills-telemetry.d.ts +7 -5
- package/dist/modules/{agents/skills → skills}/skills-telemetry.js +7 -5
- package/dist/modules/skills/skills-telemetry.js.map +1 -0
- package/dist/modules/{agents → skills}/skills.controller.d.ts +8 -6
- package/dist/modules/{agents → skills}/skills.controller.js +27 -8
- package/dist/modules/skills/skills.controller.js.map +1 -0
- package/dist/modules/skills/skills.module.d.ts +5 -0
- package/dist/modules/skills/skills.module.js +30 -0
- package/dist/modules/skills/skills.module.js.map +1 -0
- package/dist/modules/source-control.ee/source-control-export.service.ee.js +15 -11
- package/dist/modules/source-control.ee/source-control-export.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-helper.ee.d.ts +1 -1
- package/dist/modules/source-control.ee/source-control-helper.ee.js +4 -2
- package/dist/modules/source-control.ee/source-control-helper.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +13 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-preferences.service.ee.js +11 -6
- package/dist/modules/source-control.ee/source-control-preferences.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.js +18 -2
- package/dist/modules/source-control.ee/source-control.controller.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.service.ee.js +2 -0
- package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/types/source-control-preferences.d.ts +2 -0
- package/dist/modules/source-control.ee/types/source-control-preferences.js +7 -0
- package/dist/modules/source-control.ee/types/source-control-preferences.js.map +1 -1
- package/dist/modules/sso-oidc/oidc.service.ee.js +2 -0
- package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -1
- package/dist/modules/sso-saml/saml-helpers.js +2 -0
- package/dist/modules/sso-saml/saml-helpers.js.map +1 -1
- package/dist/modules/sso-saml/saml.service.ee.d.ts +3 -2
- package/dist/modules/sso-saml/saml.service.ee.js +15 -3
- package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
- package/dist/modules/token-exchange/services/scoped-jwt.strategy.d.ts +2 -2
- package/dist/modules/token-exchange/services/scoped-jwt.strategy.js +7 -4
- package/dist/modules/token-exchange/services/scoped-jwt.strategy.js.map +1 -1
- package/dist/modules/type-availability-policies/installed-type-restrictions.provider.d.ts +18 -0
- package/dist/modules/type-availability-policies/installed-type-restrictions.provider.js +56 -0
- package/dist/modules/type-availability-policies/installed-type-restrictions.provider.js.map +1 -0
- package/dist/modules/type-availability-policies/sub-workflow-policy-check.controller.d.ts +9 -0
- package/dist/modules/type-availability-policies/sub-workflow-policy-check.controller.js +46 -0
- package/dist/modules/type-availability-policies/sub-workflow-policy-check.controller.js.map +1 -0
- package/dist/modules/type-availability-policies/sub-workflow-policy-check.service.d.ts +24 -0
- package/dist/modules/type-availability-policies/sub-workflow-policy-check.service.js +88 -0
- package/dist/modules/type-availability-policies/sub-workflow-policy-check.service.js.map +1 -0
- package/dist/modules/type-availability-policies/type-availability-policies.module.d.ts +1 -1
- package/dist/modules/type-availability-policies/type-availability-policies.module.js +3 -0
- package/dist/modules/type-availability-policies/type-availability-policies.module.js.map +1 -1
- package/dist/modules/type-availability-policies/type-violation.d.ts +2 -1
- package/dist/modules/type-availability-policies/type-violation.js +20 -4
- package/dist/modules/type-availability-policies/type-violation.js.map +1 -1
- package/dist/modules/workflow-index/workflow-dependency-query.service.js +2 -5
- package/dist/modules/workflow-index/workflow-dependency-query.service.js.map +1 -1
- package/dist/node-execution/ephemeral-node-executor.d.ts +3 -3
- package/dist/node-execution/ephemeral-node-executor.js +16 -17
- package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
- package/dist/node-execution/execute-node.service.d.ts +7 -1
- package/dist/node-execution/execute-node.service.js +23 -7
- package/dist/node-execution/execute-node.service.js.map +1 -1
- package/dist/oauth/oauth.service.js +3 -0
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/policy/policed-agent-nodes.d.ts +2 -1
- package/dist/policy/policed-agent-nodes.js +45 -7
- package/dist/policy/policed-agent-nodes.js.map +1 -1
- package/dist/policy/policy-enforcement.service.d.ts +2 -0
- package/dist/policy/policy-enforcement.service.js +6 -3
- package/dist/policy/policy-enforcement.service.js.map +1 -1
- package/dist/posthog/index.d.ts +1 -0
- package/dist/posthog/index.js +11 -5
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/index.js +2 -0
- package/dist/public-api/index.js.map +1 -1
- package/dist/public-api/media-types/binary-response.js +2 -35
- package/dist/public-api/media-types/binary-response.js.map +1 -1
- package/dist/public-api/public-api-controller.registry.js +10 -3
- package/dist/public-api/public-api-controller.registry.js.map +1 -1
- package/dist/public-api/public-api-rate-limit-settings.service.d.ts +25 -0
- package/dist/public-api/public-api-rate-limit-settings.service.js +133 -0
- package/dist/public-api/public-api-rate-limit-settings.service.js.map +1 -0
- package/dist/public-api/public-api-rate-limit-store.factory.d.ts +16 -0
- package/dist/public-api/public-api-rate-limit-store.factory.js +100 -0
- package/dist/public-api/public-api-rate-limit-store.factory.js.map +1 -0
- package/dist/public-api/public-api-rate-limit.service.d.ts +6 -4
- package/dist/public-api/public-api-rate-limit.service.js +15 -13
- package/dist/public-api/public-api-rate-limit.service.js.map +1 -1
- package/dist/public-api/types.d.ts +2 -3
- package/dist/public-api/v1/controllers/community-packages.public.controller.d.ts +2 -2
- package/dist/public-api/v1/controllers/community-packages.public.controller.js +4 -2
- package/dist/public-api/v1/controllers/community-packages.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/credentials.public.controller.d.ts +5 -2
- package/dist/public-api/v1/controllers/credentials.public.controller.js +28 -2
- package/dist/public-api/v1/controllers/credentials.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/data-tables.public.controller.d.ts +5 -2
- package/dist/public-api/v1/controllers/data-tables.public.controller.js +31 -2
- package/dist/public-api/v1/controllers/data-tables.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/executions.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/promotions.public.controller.d.ts +15 -18
- package/dist/public-api/v1/controllers/promotions.public.controller.js +105 -174
- package/dist/public-api/v1/controllers/promotions.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/workflows.public.controller.d.ts +5 -2
- package/dist/public-api/v1/controllers/workflows.public.controller.js +30 -2
- package/dist/public-api/v1/controllers/workflows.public.controller.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.utils.js +6 -0
- package/dist/public-api/v1/handlers/credentials/credentials.utils.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +1150 -881
- package/dist/public-api/v1/shared/dependency.mapper.d.ts +5 -0
- package/dist/public-api/v1/shared/dependency.mapper.js +28 -0
- package/dist/public-api/v1/shared/dependency.mapper.js.map +1 -0
- package/dist/response-helper.d.ts +2 -0
- package/dist/response-helper.js +43 -1
- package/dist/response-helper.js.map +1 -1
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/constants.js +2 -0
- package/dist/scaling/constants.js.map +1 -1
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +5 -0
- package/dist/scaling/pubsub/pubsub.types.d.ts +3 -1
- package/dist/scheduling/durable-job-provisioner.js.map +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.js +1 -0
- package/dist/server.js.map +1 -1
- package/dist/services/ai-gateway-eligibility.d.ts +1 -1
- package/dist/services/ai-gateway-eligibility.js +3 -0
- package/dist/services/ai-gateway-eligibility.js.map +1 -1
- package/dist/services/ai-gateway.service.d.ts +7 -1
- package/dist/services/ai-gateway.service.js +90 -12
- package/dist/services/ai-gateway.service.js.map +1 -1
- package/dist/services/ai-preference-write.d.ts +1 -1
- package/dist/services/ai-preference-write.js +2 -2
- package/dist/services/ai-preference-write.js.map +1 -1
- package/dist/services/api-key-auth.strategy.d.ts +2 -2
- package/dist/services/api-key-auth.strategy.js +8 -5
- package/dist/services/api-key-auth.strategy.js.map +1 -1
- package/dist/services/engine-data-plane-proxy.service.d.ts +3 -1
- package/dist/services/engine-data-plane-proxy.service.js +5 -0
- package/dist/services/engine-data-plane-proxy.service.js.map +1 -1
- package/dist/services/engine-v2-dispatcher.service.d.ts +5 -1
- package/dist/services/engine-v2-dispatcher.service.js +37 -23
- package/dist/services/engine-v2-dispatcher.service.js.map +1 -1
- package/dist/services/engine-v2-manual-run-planner.d.ts +25 -0
- package/dist/services/engine-v2-manual-run-planner.js +190 -0
- package/dist/services/engine-v2-manual-run-planner.js.map +1 -0
- package/dist/services/export.service.js +3 -1
- package/dist/services/export.service.js.map +1 -1
- package/dist/services/frontend.service.js +0 -2
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/node-resource-explorer.service.d.ts +8 -1
- package/dist/services/node-resource-explorer.service.js +155 -1
- package/dist/services/node-resource-explorer.service.js.map +1 -1
- package/dist/services/ownership-transfer/ownership-transfer.manifest.json +25 -5
- package/dist/services/ownership-transfer/ownership-transfer.service.d.ts +1 -0
- package/dist/services/ownership-transfer/ownership-transfer.service.js +7 -0
- package/dist/services/ownership-transfer/ownership-transfer.service.js.map +1 -1
- package/dist/services/ownership.service.js +3 -1
- package/dist/services/ownership.service.js.map +1 -1
- package/dist/services/project.service.ee.d.ts +2 -2
- package/dist/services/project.service.ee.js +16 -72
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/rate-limit.service.js +2 -2
- package/dist/services/rate-limit.service.js.map +1 -1
- package/dist/services/sandbox-settings.service.d.ts +7 -1
- package/dist/services/sandbox-settings.service.js +32 -2
- package/dist/services/sandbox-settings.service.js.map +1 -1
- package/dist/services/session-cookie-auth.strategy.d.ts +2 -2
- package/dist/services/session-cookie-auth.strategy.js +3 -3
- package/dist/services/session-cookie-auth.strategy.js.map +1 -1
- package/dist/services/user.service.js +2 -2
- package/dist/services/user.service.js.map +1 -1
- package/dist/sso.ee/scim-switch-reader.d.ts +16 -0
- package/dist/sso.ee/scim-switch-reader.js +56 -0
- package/dist/sso.ee/scim-switch-reader.js.map +1 -0
- package/dist/sso.ee/sso-helpers.d.ts +4 -0
- package/dist/sso.ee/sso-helpers.js +29 -0
- package/dist/sso.ee/sso-helpers.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker-server.js +3 -5
- package/dist/task-runners/task-broker/task-broker-server.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker.service.js +25 -7
- package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
- package/dist/task-runners/task-managers/task-requester.js +17 -1
- package/dist/task-runners/task-managers/task-requester.js.map +1 -1
- package/dist/task-runners/task-runner-module.js +3 -0
- package/dist/task-runners/task-runner-module.js.map +1 -1
- package/dist/task-runners/task-runner-process-js.js +5 -1
- package/dist/task-runners/task-runner-process-js.js.map +1 -1
- package/dist/telemetry/cluster-footprint.d.ts +12 -0
- package/dist/telemetry/cluster-footprint.js +20 -0
- package/dist/telemetry/cluster-footprint.js.map +1 -0
- package/dist/telemetry/index.d.ts +3 -0
- package/dist/telemetry/index.js +16 -0
- package/dist/telemetry/index.js.map +1 -1
- package/dist/user-management/email/templates/workflow-deactivated.handlebars +2 -2
- package/dist/user-management/email/user-management-mailer.d.ts +2 -1
- package/dist/user-management/email/user-management-mailer.js +12 -1
- package/dist/user-management/email/user-management-mailer.js.map +1 -1
- package/dist/utils/detect-managed-services.d.ts +5 -0
- package/dist/utils/detect-managed-services.js +33 -0
- package/dist/utils/detect-managed-services.js.map +1 -0
- package/dist/utils/model-stream-stall-options.js.map +1 -0
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +2 -18
- package/dist/utils.js.map +1 -1
- package/dist/wait-tracker.js +1 -0
- package/dist/wait-tracker.js.map +1 -1
- package/dist/webhooks/hitl-interaction-webhooks.d.ts +2 -0
- package/dist/webhooks/hitl-interaction-webhooks.js +3 -0
- package/dist/webhooks/hitl-interaction-webhooks.js.map +1 -1
- package/dist/webhooks/waiting-webhooks.d.ts +2 -0
- package/dist/webhooks/waiting-webhooks.js +25 -2
- package/dist/webhooks/waiting-webhooks.js.map +1 -1
- package/dist/webhooks/webhook-helpers.js +6 -4
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/webhooks/webhook-request-handler.js +8 -10
- package/dist/webhooks/webhook-request-handler.js.map +1 -1
- package/dist/workflow-execute-additional-data.d.ts +1 -1
- package/dist/workflow-execute-additional-data.js +56 -14
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.js +7 -3
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-runner.js +4 -1
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/deprecated-nodes-validation.service.d.ts +1 -0
- package/dist/workflows/deprecated-nodes-validation.service.js +43 -12
- package/dist/workflows/deprecated-nodes-validation.service.js.map +1 -1
- package/dist/workflows/error-workflow-id.d.ts +3 -0
- package/dist/workflows/error-workflow-id.js +17 -0
- package/dist/workflows/error-workflow-id.js.map +1 -0
- package/dist/workflows/error-workflow-validation.service.d.ts +0 -3
- package/dist/workflows/error-workflow-validation.service.js +0 -14
- package/dist/workflows/error-workflow-validation.service.js.map +1 -1
- package/dist/workflows/publication/publication-status-reporter.js +10 -1
- package/dist/workflows/publication/publication-status-reporter.js.map +1 -1
- package/dist/workflows/publication/trigger-node-id-too-long.error.d.ts +5 -0
- package/dist/workflows/publication/trigger-node-id-too-long.error.js +18 -0
- package/dist/workflows/publication/trigger-node-id-too-long.error.js.map +1 -0
- package/dist/workflows/publication/workflow-publication-applier.d.ts +1 -0
- package/dist/workflows/publication/workflow-publication-applier.js +27 -0
- package/dist/workflows/publication/workflow-publication-applier.js.map +1 -1
- package/dist/workflows/workflow-creation.service.js +4 -3
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow-finder.service.d.ts +1 -1
- package/dist/workflows/workflow-finder.service.js +2 -2
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow-publisher.service.js +0 -3
- package/dist/workflows/workflow-publisher.service.js.map +1 -1
- package/dist/workflows/workflow-validation.service.js +6 -2
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.ee.d.ts +10 -22
- package/dist/workflows/workflow.service.ee.js +119 -57
- package/dist/workflows/workflow.service.ee.js.map +1 -1
- package/dist/workflows/workflow.service.js +15 -2
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +3 -18
- package/dist/workflows/workflows.controller.js +12 -0
- package/dist/workflows/workflows.controller.js.map +1 -1
- package/package.json +52 -48
- package/templates/form-trigger.handlebars +1 -0
- package/dist/constants/credential-sharing.d.ts +0 -1
- package/dist/constants/credential-sharing.js +0 -8
- package/dist/constants/credential-sharing.js.map +0 -1
- package/dist/errors/response-errors/ai-preference-scope-full.error.d.ts +0 -12
- package/dist/errors/response-errors/ai-preference-scope-full.error.js +0 -13
- package/dist/errors/response-errors/ai-preference-scope-full.error.js.map +0 -1
- package/dist/modules/agents/agent-runtime-instrumentation.js.map +0 -1
- package/dist/modules/agents/agent-vector-stores.service.d.ts +0 -11
- package/dist/modules/agents/agent-vector-stores.service.js.map +0 -1
- package/dist/modules/agents/builder/format-preview-context.js.map +0 -1
- package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +0 -107
- package/dist/modules/agents/builder/get-resource-locator-options.tool.js +0 -152
- package/dist/modules/agents/builder/get-resource-locator-options.tool.js.map +0 -1
- package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +0 -7
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js +0 -122
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +0 -1
- package/dist/modules/agents/entities/skill-file.entity.js.map +0 -1
- package/dist/modules/agents/entities/skill-version.entity.js.map +0 -1
- package/dist/modules/agents/entities/skill.entity.js.map +0 -1
- package/dist/modules/agents/instance-ai-agent-context.adapter.d.ts +0 -27
- package/dist/modules/agents/instance-ai-agent-context.adapter.js.map +0 -1
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +0 -28
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +0 -137
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/discord-gateway.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/discord-integration.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/discord-operations.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/linear-integration.d.ts +0 -27
- package/dist/modules/agents/integrations/platforms/linear-integration.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/linear-operations.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/linear-tool-definitions.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/n8n-chat-integration.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +0 -1
- package/dist/modules/agents/json-config/credential-field-mapping.js.map +0 -1
- package/dist/modules/agents/json-config/embedding-credential.js.map +0 -1
- package/dist/modules/agents/json-config/vector-store-factory.js.map +0 -1
- package/dist/modules/agents/model-stream-stall-options.js.map +0 -1
- package/dist/modules/agents/repositories/skill.repository.js +0 -569
- package/dist/modules/agents/repositories/skill.repository.js.map +0 -1
- package/dist/modules/agents/skills/skill-content-hash.js.map +0 -1
- package/dist/modules/agents/skills/skill-name-taken.error.js.map +0 -1
- package/dist/modules/agents/skills/skill-names.js.map +0 -1
- package/dist/modules/agents/skills/skill.service.js.map +0 -1
- package/dist/modules/agents/skills/skills-api.service.js.map +0 -1
- package/dist/modules/agents/skills/skills-hub-rollout.d.ts +0 -10
- package/dist/modules/agents/skills/skills-hub-rollout.js.map +0 -1
- package/dist/modules/agents/skills/skills-hub-startup-copy.d.ts +0 -40
- package/dist/modules/agents/skills/skills-hub-startup-copy.js +0 -402
- package/dist/modules/agents/skills/skills-hub-startup-copy.js.map +0 -1
- package/dist/modules/agents/skills/skills-telemetry.js.map +0 -1
- package/dist/modules/agents/skills.controller.js.map +0 -1
- package/dist/modules/instance-ai/browser/composite-local-mcp-server.d.ts +0 -16
- package/dist/modules/instance-ai/browser/composite-local-mcp-server.js +0 -57
- package/dist/modules/instance-ai/browser/composite-local-mcp-server.js.map +0 -1
- package/dist/modules/instance-ai/computer-use-availability.d.ts +0 -14
- package/dist/modules/instance-ai/computer-use-availability.js +0 -42
- package/dist/modules/instance-ai/computer-use-availability.js.map +0 -1
- package/dist/modules/instance-ai/eval/data-table-pin-filter.d.ts +0 -7
- package/dist/modules/instance-ai/eval/data-table-pin-filter.js +0 -171
- package/dist/modules/instance-ai/eval/data-table-pin-filter.js.map +0 -1
- package/dist/modules/instance-ai/filesystem/index.d.ts +0 -3
- package/dist/modules/instance-ai/filesystem/index.js +0 -8
- package/dist/modules/instance-ai/filesystem/index.js.map +0 -1
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.d.ts +0 -31
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.js +0 -160
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.js.map +0 -1
- package/dist/modules/instance-ai/filesystem/local-gateway.d.ts +0 -45
- package/dist/modules/instance-ai/filesystem/local-gateway.js +0 -163
- package/dist/modules/instance-ai/filesystem/local-gateway.js.map +0 -1
- package/dist/modules/instance-ai/instance-ai-gateway.service.d.ts +0 -35
- package/dist/modules/instance-ai/instance-ai-gateway.service.js +0 -90
- package/dist/modules/instance-ai/instance-ai-gateway.service.js.map +0 -1
- package/dist/modules/instance-ai/planned-task-action-runner.d.ts +0 -91
- package/dist/modules/instance-ai/planned-task-action-runner.js +0 -138
- package/dist/modules/instance-ai/planned-task-action-runner.js.map +0 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy.d.ts +0 -4
- package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy.js +0 -12
- package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy.js.map +0 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-id-policy.d.ts +0 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-id-policy.js +0 -12
- package/dist/modules/n8n-packages/entities/workflow/workflow-id-policy.js.map +0 -1
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.d.ts +0 -26
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.js +0 -24
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.js.map +0 -1
- package/dist/modules/n8n-packages/spec/serialized/data-table.schema.d.ts +0 -75
- package/dist/modules/n8n-packages/spec/serialized/data-table.schema.js +0 -43
- package/dist/modules/n8n-packages/spec/serialized/data-table.schema.js.map +0 -1
- package/dist/modules/n8n-packages/spec/serialized/folder.schema.d.ts +0 -15
- package/dist/modules/n8n-packages/spec/serialized/folder.schema.js +0 -12
- package/dist/modules/n8n-packages/spec/serialized/folder.schema.js.map +0 -1
- package/dist/modules/n8n-packages/spec/serialized/project.schema.d.ts +0 -51
- package/dist/modules/n8n-packages/spec/serialized/project.schema.js +0 -20
- package/dist/modules/n8n-packages/spec/serialized/project.schema.js.map +0 -1
- package/dist/modules/n8n-packages/spec/serialized/tag.schema.d.ts +0 -12
- package/dist/modules/n8n-packages/spec/serialized/tag.schema.js +0 -11
- package/dist/modules/n8n-packages/spec/serialized/tag.schema.js.map +0 -1
- package/dist/modules/n8n-packages/spec/serialized/variable.schema.d.ts +0 -15
- package/dist/modules/n8n-packages/spec/serialized/variable.schema.js +0 -13
- package/dist/modules/n8n-packages/spec/serialized/variable.schema.js.map +0 -1
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.d.ts +0 -12
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.js +0 -9
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.js.map +0 -1
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +0 -201
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +0 -53
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +0 -1
- package/dist/modules/promotions.ee/database/entities/promotion-config.entity.d.ts +0 -11
- package/dist/modules/promotions.ee/database/entities/promotion-config.entity.js +0 -44
- package/dist/modules/promotions.ee/database/entities/promotion-config.entity.js.map +0 -1
- package/dist/modules/promotions.ee/database/entities/promotion-connection-project.entity.d.ts +0 -8
- package/dist/modules/promotions.ee/database/entities/promotion-connection-project.entity.js.map +0 -1
- package/dist/modules/promotions.ee/database/entities/promotion-connection.entity.d.ts +0 -12
- package/dist/modules/promotions.ee/database/entities/promotion-connection.entity.js.map +0 -1
- package/dist/modules/promotions.ee/database/repositories/promotion-config.repository.d.ts +0 -19
- package/dist/modules/promotions.ee/database/repositories/promotion-config.repository.js +0 -67
- package/dist/modules/promotions.ee/database/repositories/promotion-config.repository.js.map +0 -1
- package/dist/modules/promotions.ee/database/repositories/promotion-connection-project.repository.d.ts +0 -10
- package/dist/modules/promotions.ee/database/repositories/promotion-connection-project.repository.js.map +0 -1
- package/dist/modules/promotions.ee/database/repositories/promotion-connection.repository.d.ts +0 -28
- package/dist/modules/promotions.ee/database/repositories/promotion-connection.repository.js.map +0 -1
- package/dist/modules/promotions.ee/git-hosts/git-host-target.js.map +0 -1
- package/dist/modules/promotions.ee/promotion-config.resolver.d.ts +0 -16
- package/dist/modules/promotions.ee/promotion-config.resolver.js +0 -94
- package/dist/modules/promotions.ee/promotion-config.resolver.js.map +0 -1
- package/dist/modules/promotions.ee/promotion-connections.service.d.ts +0 -117
- package/dist/modules/promotions.ee/promotion-connections.service.js +0 -350
- package/dist/modules/promotions.ee/promotion-connections.service.js.map +0 -1
- package/dist/modules/scim/database/scim-api-key.repository.d.ts +0 -11
- package/dist/modules/scim/database/scim-api-key.repository.js +0 -51
- package/dist/modules/scim/database/scim-api-key.repository.js.map +0 -1
- package/dist/services/ai-preference.service.d.ts +0 -86
- package/dist/services/ai-preference.service.js +0 -507
- package/dist/services/ai-preference.service.js.map +0 -1
- /package/dist/{modules/agents/json-config → credentials}/credential-field-mapping.d.ts +0 -0
- /package/dist/{modules/agents/json-config → credentials}/credential-field-mapping.js +0 -0
- /package/dist/modules/agents/integrations/platforms/{discord-gateway.d.ts → discord/discord-gateway.d.ts} +0 -0
- /package/dist/modules/agents/integrations/platforms/{discord-gateway.js → discord/discord-gateway.js} +0 -0
- /package/dist/modules/agents/integrations/platforms/{discord-operations.d.ts → discord/discord-operations.d.ts} +0 -0
- /package/dist/modules/agents/integrations/platforms/{linear-tool-definitions.d.ts → linear/linear-tool-definitions.d.ts} +0 -0
- /package/dist/modules/{agents/json-config → knowledge/vector-stores}/embedding-credential.d.ts +0 -0
- /package/dist/modules/{agents/json-config/vector-store-factory.d.ts → knowledge/vector-stores/factory.d.ts} +0 -0
- /package/dist/modules/{agents/skills → skills}/skill-content-hash.js +0 -0
- /package/dist/modules/{agents/entities → skills}/skill-file.entity.d.ts +0 -0
- /package/dist/modules/{agents/entities → skills}/skill-file.entity.js +0 -0
- /package/dist/modules/{agents/skills → skills}/skill-name-taken.error.d.ts +0 -0
- /package/dist/modules/{agents/skills → skills}/skill-name-taken.error.js +0 -0
- /package/dist/modules/{agents/skills → skills}/skill-names.d.ts +0 -0
- /package/dist/modules/{agents/skills → skills}/skill-names.js +0 -0
- /package/dist/modules/{agents/entities → skills}/skill-version.entity.d.ts +0 -0
- /package/dist/modules/{agents/entities → skills}/skill-version.entity.js +0 -0
- /package/dist/{modules/agents → utils}/model-stream-stall-options.d.ts +0 -0
- /package/dist/{modules/agents → utils}/model-stream-stall-options.js +0 -0
|
@@ -10,17 +10,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
var InstanceAiService_1;
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.InstanceAiService = exports.QuotaExhaustedStreamError = exports.
|
|
13
|
+
exports.InstanceAiService = exports.QUOTA_EXHAUSTED_USER_MESSAGE = exports.QuotaExhaustedStreamError = exports.isAssistantCreditBalanceExhausted = void 0;
|
|
14
14
|
exports.isAttachmentRejectedByProviderError = isAttachmentRejectedByProviderError;
|
|
15
15
|
exports.getUserFacingErrorMessage = getUserFacingErrorMessage;
|
|
16
16
|
exports.isMaskedStreamFailure = isMaskedStreamFailure;
|
|
17
|
-
exports.isAssistantCreditBalanceExhausted = isAssistantCreditBalanceExhausted;
|
|
18
|
-
exports.resolveOperatorPromptVersion = resolveOperatorPromptVersion;
|
|
19
|
-
const agents_1 = require("@n8n/agents");
|
|
20
|
-
const sandbox_1 = require("@n8n/agents/sandbox");
|
|
21
17
|
const api_types_1 = require("@n8n/api-types");
|
|
22
18
|
const backend_common_1 = require("@n8n/backend-common");
|
|
23
|
-
const backend_network_1 = require("@n8n/backend-network");
|
|
24
19
|
const backend_services_1 = require("@n8n/backend-services");
|
|
25
20
|
const config_1 = require("@n8n/config");
|
|
26
21
|
const db_1 = require("@n8n/db");
|
|
@@ -32,72 +27,60 @@ const telemetry_1 = require("@n8n/telemetry");
|
|
|
32
27
|
const get_error_message_1 = require("@n8n/utils/errors/get-error-message");
|
|
33
28
|
const is_record_1 = require("@n8n/utils/is-record");
|
|
34
29
|
const lazy_import_1 = require("@n8n/utils/lazy-import");
|
|
35
|
-
const workflow_sdk_1 = require("@n8n/workflow-sdk");
|
|
36
30
|
const n8n_core_1 = require("n8n-core");
|
|
37
31
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
38
32
|
const nanoid_1 = require("nanoid");
|
|
39
33
|
const constants_1 = require("../../constants");
|
|
40
34
|
const errors_1 = require("@n8n/errors");
|
|
41
|
-
const instance_ai_builder_delegate_adapter_1 = require("
|
|
42
|
-
const
|
|
43
|
-
const model_stream_stall_options_1 = require("../../modules/agents/model-stream-stall-options");
|
|
44
|
-
const check_access_1 = require("../../permissions.ee/check-access");
|
|
45
|
-
const push_1 = require("../../push");
|
|
35
|
+
const instance_ai_builder_delegate_adapter_1 = require("./instance-ai-builder-delegate.adapter");
|
|
36
|
+
const model_stream_stall_options_1 = require("../../utils/model-stream-stall-options");
|
|
46
37
|
const publisher_service_1 = require("../../scaling/pubsub/publisher.service");
|
|
47
|
-
const ai_preference_service_1 = require("../../services/ai-preference.service");
|
|
48
|
-
const ai_usage_service_1 = require("../../services/ai-usage.service");
|
|
49
38
|
const ai_service_1 = require("../../services/ai.service");
|
|
50
|
-
const proxy_token_manager_1 = require("../../services/proxy-token-manager");
|
|
51
39
|
const telemetry_2 = require("../../telemetry");
|
|
52
40
|
const utils_1 = require("../../utils");
|
|
53
|
-
const
|
|
54
|
-
const agents_access_1 = require("./agents-access");
|
|
55
|
-
const instance_context_service_1 = require("./instance-context.service");
|
|
56
|
-
const composite_local_mcp_server_1 = require("./browser/composite-local-mcp-server");
|
|
41
|
+
const ai_preferences_telemetry_1 = require("./ai-preferences-telemetry");
|
|
57
42
|
const instance_ai_browser_session_service_1 = require("./browser/instance-ai-browser-session.service");
|
|
58
|
-
const computer_use_availability_1 = require("./computer-use-availability");
|
|
59
43
|
const drop_rejected_attachments_1 = require("./drop-rejected-attachments");
|
|
60
44
|
const thread_credential_allowlist_service_1 = require("./eval/thread-credential-allowlist.service");
|
|
61
45
|
const durable_event_log_1 = require("./event-bus/durable-event-log");
|
|
62
46
|
const in_process_event_bus_1 = require("./event-bus/in-process-event-bus");
|
|
63
47
|
const interrupted_run_sweeper_1 = require("./event-bus/interrupted-run-sweeper");
|
|
64
|
-
const instance_ai_conversation_history_service_1 = require("./instance-ai-conversation-history.service");
|
|
65
48
|
const instance_ai_credit_service_1 = require("./instance-ai-credit.service");
|
|
66
49
|
const instance_ai_error_reporter_service_1 = require("./instance-ai-error-reporter.service");
|
|
67
|
-
const instance_ai_gateway_service_1 = require("./instance-ai-gateway.service");
|
|
68
50
|
const instance_ai_memory_service_1 = require("./instance-ai-memory.service");
|
|
69
51
|
const instance_ai_model_service_1 = require("./instance-ai-model.service");
|
|
70
52
|
const instance_ai_run_limit_error_1 = require("./instance-ai-run-limit.error");
|
|
71
53
|
const instance_ai_run_probe_1 = require("./instance-ai-run-probe");
|
|
72
54
|
const instance_ai_settings_service_1 = require("./instance-ai-settings.service");
|
|
73
|
-
const instance_ai_skills_service_1 = require("./instance-ai-skills.service");
|
|
74
55
|
const instance_ai_temporary_workflow_service_1 = require("./instance-ai-temporary-workflow.service");
|
|
75
56
|
const instance_ai_terminal_outcome_service_1 = require("./instance-ai-terminal-outcome.service");
|
|
76
57
|
const instance_ai_thread_tabs_service_1 = require("./instance-ai-thread-tabs.service");
|
|
77
58
|
const instance_ai_adapter_service_1 = require("./instance-ai.adapter.service");
|
|
78
59
|
const internal_messages_1 = require("./internal-messages");
|
|
79
|
-
const onboarding_opening_1 = require("./onboarding-opening");
|
|
80
60
|
const liveness_1 = require("./liveness");
|
|
81
|
-
const mcp_1 = require("./mcp");
|
|
82
61
|
const observability_1 = require("./observability");
|
|
83
|
-
const planned_task_action_runner_1 = require("./planned-task-action-runner");
|
|
84
62
|
const instance_ai_event_log_repository_1 = require("./repositories/instance-ai-event-log.repository");
|
|
85
63
|
const instance_ai_observation_cursor_repository_1 = require("./repositories/instance-ai-observation-cursor.repository");
|
|
86
64
|
const instance_ai_observation_repository_1 = require("./repositories/instance-ai-observation.repository");
|
|
87
65
|
const instance_ai_pending_confirmation_repository_1 = require("./repositories/instance-ai-pending-confirmation.repository");
|
|
88
66
|
const instance_ai_thread_grant_repository_1 = require("./repositories/instance-ai-thread-grant.repository");
|
|
89
|
-
const
|
|
90
|
-
const
|
|
67
|
+
const sandbox_1 = require("./sandbox");
|
|
68
|
+
const self_healing_agent_service_1 = require("./self-healing/self-healing-agent.service");
|
|
91
69
|
const typeorm_agent_checkpoint_store_1 = require("./storage/typeorm-agent-checkpoint-store");
|
|
92
70
|
const typeorm_agent_memory_1 = require("./storage/typeorm-agent-memory");
|
|
71
|
+
const assistant_credits_1 = require("./turn-setup/assistant-credits");
|
|
72
|
+
const assistant_agent_factory_1 = require("./turn-setup/assistant-agent.factory");
|
|
73
|
+
const assistant_turn_environment_factory_1 = require("./turn-setup/assistant-turn-environment.factory");
|
|
74
|
+
const assistant_turn_input_builder_1 = require("./turn-setup/assistant-turn-input.builder");
|
|
75
|
+
var assistant_credits_2 = require("./turn-setup/assistant-credits");
|
|
76
|
+
Object.defineProperty(exports, "isAssistantCreditBalanceExhausted", { enumerable: true, get: function () { return assistant_credits_2.isAssistantCreditBalanceExhausted; } });
|
|
77
|
+
Object.defineProperty(exports, "QuotaExhaustedStreamError", { enumerable: true, get: function () { return assistant_credits_2.QuotaExhaustedStreamError; } });
|
|
93
78
|
const stream_transport_error_1 = require("./stream-transport-error");
|
|
94
79
|
const suspended_run_restorer_service_1 = require("./suspended-run-restorer.service");
|
|
95
80
|
const suspended_thread_persistence_service_1 = require("./suspended-thread-persistence.service");
|
|
96
81
|
const tracing_1 = require("./tracing");
|
|
97
82
|
const workflow_verification_obligation_service_1 = require("./workflow-verification-obligation-service");
|
|
98
83
|
const workflow_verification_task_projector_1 = require("./workflow-verification-task-projector");
|
|
99
|
-
const agent_execution_service_1 = require("../agents/agent-execution.service");
|
|
100
|
-
const format_preview_context_1 = require("../agents/builder/format-preview-context");
|
|
101
84
|
function buildSuspensionTraceOutputs(runId, suspension) {
|
|
102
85
|
const rawMessage = suspension?.suspendPayload.message;
|
|
103
86
|
const message = typeof rawMessage === 'string' && rawMessage ? rawMessage : undefined;
|
|
@@ -110,42 +93,6 @@ function buildSuspensionTraceOutputs(runId, suspension) {
|
|
|
110
93
|
...(message ? { message } : {}),
|
|
111
94
|
};
|
|
112
95
|
}
|
|
113
|
-
function isNamedResourceAttachment(attachment) {
|
|
114
|
-
return attachment.type !== 'nodes' && Boolean(attachment.name);
|
|
115
|
-
}
|
|
116
|
-
function buildHandoffContextBlock(context) {
|
|
117
|
-
if (!context || context.source !== 'credential-modal')
|
|
118
|
-
return '';
|
|
119
|
-
const { credential } = context;
|
|
120
|
-
const placeholderTitles = credential.placeholderTitles ?? [];
|
|
121
|
-
const lines = [
|
|
122
|
-
`- Credential type: \`${credential.credentialType}\` (${credential.displayName}).`,
|
|
123
|
-
credential.id ? `- Existing credential id: \`${credential.id}\`.` : '',
|
|
124
|
-
credential.nodeName ? `- Node name: "${credential.nodeName}".` : '',
|
|
125
|
-
credential.nodeType ? `- Node type: \`${credential.nodeType}\`.` : '',
|
|
126
|
-
placeholderTitles.length
|
|
127
|
-
? `- The credential form is fully pre-filled from a recipe; the user only pastes: ${placeholderTitles.map((title) => `"${title}"`).join(', ')}.`
|
|
128
|
-
: '',
|
|
129
|
-
credential.docsUrl
|
|
130
|
-
? `- The provider page where the user creates/copies the secret (verified during recipe research): ${credential.docsUrl}`
|
|
131
|
-
: '',
|
|
132
|
-
credential.documentationUrl ? `- n8n documentation URL: ${credential.documentationUrl}` : '',
|
|
133
|
-
credential.oauthRedirectUrl
|
|
134
|
-
? `- OAuth redirect/callback URL shown in the modal: ${credential.oauthRedirectUrl}`
|
|
135
|
-
: '',
|
|
136
|
-
].filter(Boolean);
|
|
137
|
-
const prose = [
|
|
138
|
-
'The user opened this conversation from the credential setup modal and is asking for setup guidance.',
|
|
139
|
-
...lines,
|
|
140
|
-
'Use this metadata only as setup context. Never ask the user to paste credential secrets into chat. For credential setup docs, load `n8n-docs-assistant` and use `n8n-docs` with `intent: "credential-setup"`.',
|
|
141
|
-
placeholderTitles.length
|
|
142
|
-
? `Because the form is pre-filled, give step-by-step guidance on where to obtain the listed value(s) on the provider side${credential.docsUrl ? ' — direct the user to the provider page above rather than re-researching' : ' (research the provider if needed)'} — and do NOT suggest editing the auth template, test URL, or any other credential field.`
|
|
143
|
-
: '',
|
|
144
|
-
]
|
|
145
|
-
.filter(Boolean)
|
|
146
|
-
.join('\n');
|
|
147
|
-
return `${internal_messages_1.CREDENTIAL_CONTEXT_OPEN_TAG}\n${JSON.stringify(context)}\n\n${prose}\n${internal_messages_1.CREDENTIAL_CONTEXT_CLOSE_TAG}`;
|
|
148
|
-
}
|
|
149
96
|
function isTelemetryConfigurableAgent(agent) {
|
|
150
97
|
return (typeof agent === 'object' &&
|
|
151
98
|
agent !== null &&
|
|
@@ -155,14 +102,6 @@ const WORKFLOW_SETUP_ROUTING_CLAIM_TTL_MS = 15 * 60 * 1000;
|
|
|
155
102
|
const CONFIRMATION_EXPIRED_MESSAGE = 'This confirmation has expired. Send a new message to continue.';
|
|
156
103
|
const RESUME_REJECTED_MESSAGE = 'I could not apply that confirmation. Send a new message to continue.';
|
|
157
104
|
const INSTANCE_AI_SHUTDOWN_DRAIN_TIMEOUT_MS = 5 * 1000;
|
|
158
|
-
function isTextMessagePart(part) {
|
|
159
|
-
return (typeof part === 'object' &&
|
|
160
|
-
part !== null &&
|
|
161
|
-
'type' in part &&
|
|
162
|
-
part.type === 'text' &&
|
|
163
|
-
'text' in part &&
|
|
164
|
-
typeof part.text === 'string');
|
|
165
|
-
}
|
|
166
105
|
function isSandboxEndpointNotAllowedError(error) {
|
|
167
106
|
return (0, get_error_message_1.getErrorMessage)(error).toLowerCase().includes('endpoint not allowed');
|
|
168
107
|
}
|
|
@@ -247,32 +186,14 @@ function failureStageForErrorCode(errorCode) {
|
|
|
247
186
|
return 'persistence';
|
|
248
187
|
return 'unknown';
|
|
249
188
|
}
|
|
250
|
-
class QuotaExhaustedStreamError extends n8n_workflow_1.UserError {
|
|
251
|
-
constructor(maskedError) {
|
|
252
|
-
super(`AI credits exhausted (${maskedError.name}: ${maskedError.message})`, {
|
|
253
|
-
cause: maskedError,
|
|
254
|
-
});
|
|
255
|
-
this.errorCode = 'quota_exhausted';
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
exports.QuotaExhaustedStreamError = QuotaExhaustedStreamError;
|
|
259
|
-
function createInertAbortSignal() {
|
|
260
|
-
return new AbortController().signal;
|
|
261
|
-
}
|
|
262
|
-
function isAssistantCreditBalanceExhausted(credits) {
|
|
263
|
-
return credits.creditsQuota >= 0 && credits.creditsClaimed >= credits.creditsQuota;
|
|
264
|
-
}
|
|
265
|
-
function assistantCreditsExhaustedError() {
|
|
266
|
-
return new QuotaExhaustedStreamError(new Error('Assistant credits exhausted'));
|
|
267
|
-
}
|
|
268
189
|
function asQuotaExhaustedError(error) {
|
|
269
|
-
if (error instanceof QuotaExhaustedStreamError)
|
|
190
|
+
if (error instanceof assistant_credits_1.QuotaExhaustedStreamError)
|
|
270
191
|
return error;
|
|
271
192
|
if (!(0, instance_ai_1.isQuotaExhaustedError)(error))
|
|
272
193
|
return undefined;
|
|
273
194
|
if (error instanceof Error)
|
|
274
|
-
return new QuotaExhaustedStreamError(error);
|
|
275
|
-
return assistantCreditsExhaustedError();
|
|
195
|
+
return new assistant_credits_1.QuotaExhaustedStreamError(error);
|
|
196
|
+
return (0, assistant_credits_1.assistantCreditsExhaustedError)();
|
|
276
197
|
}
|
|
277
198
|
function quotaExhaustedFromSignal(signal) {
|
|
278
199
|
if (!('reason' in signal))
|
|
@@ -315,28 +236,14 @@ const MAX_CONCURRENT_BACKGROUND_TASKS_PER_THREAD = 5;
|
|
|
315
236
|
const UNLIMITED_CONCURRENCY = -1;
|
|
316
237
|
const MAX_CONSECUTIVE_FAILED_INTERNAL_FOLLOW_UPS = 3;
|
|
317
238
|
const TITLE_REFINE_HISTORY_LIMIT = 50;
|
|
318
|
-
function resolveOperatorPromptVersion(configured) {
|
|
319
|
-
const version = configured?.trim();
|
|
320
|
-
if (!version)
|
|
321
|
-
return undefined;
|
|
322
|
-
(0, instance_ai_1.assertInstanceAiPromptVersion)(version);
|
|
323
|
-
return version;
|
|
324
|
-
}
|
|
325
239
|
let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
326
|
-
|
|
327
|
-
if (!this._mcpClientManager) {
|
|
328
|
-
this._mcpClientManager = new instance_ai_1.McpClientManager(this._ssrfProtectionConfig.enabled ? this._ssrfProtectionService : undefined, { onToolCallSettled: (event) => this.trackMcpToolCall(event) });
|
|
329
|
-
}
|
|
330
|
-
return this._mcpClientManager;
|
|
331
|
-
}
|
|
332
|
-
constructor(logger, globalConfig, instanceSettings, adapterService, eventBus, eventLog, interruptedRunSweeper, settingsService, gatewayService, browserSessionService, memoryService, agentMemory, checkpointStore, aiService, threadGrantRepo, pendingConfirmationRepo, observationRepo, observationCursorRepo, urlService, eventLogRepository, dbIterationLogStorage, instanceWriteAccess, telemetry, mcpRegistryService, userRepository, temporaryWorkflowService, errorReporter, ssrfProtectionConfig, ssrfProtectionService, eventService, evalCredentialAllowlists, runProbe, modelService, creditService, publisher, instanceAiErrorReporter, push, conversationHistoryService, instanceContext, aiPreferenceService, aiUsageService, threadTabsService, skillsService) {
|
|
240
|
+
constructor(logger, globalConfig, instanceSettings, adapterService, eventBus, eventLog, interruptedRunSweeper, settingsService, browserSessionService, memoryService, agentMemory, checkpointStore, aiService, threadGrantRepo, pendingConfirmationRepo, observationRepo, observationCursorRepo, eventLogRepository, telemetry, userRepository, temporaryWorkflowService, errorReporter, eventService, evalCredentialAllowlists, runProbe, modelService, creditService, publisher, instanceAiErrorReporter, threadTabsService, selfHealingAgent, turnEnvironment, turnInput, agentFactory) {
|
|
333
241
|
this.instanceSettings = instanceSettings;
|
|
334
242
|
this.adapterService = adapterService;
|
|
335
243
|
this.eventBus = eventBus;
|
|
336
244
|
this.eventLog = eventLog;
|
|
337
245
|
this.interruptedRunSweeper = interruptedRunSweeper;
|
|
338
246
|
this.settingsService = settingsService;
|
|
339
|
-
this.gatewayService = gatewayService;
|
|
340
247
|
this.browserSessionService = browserSessionService;
|
|
341
248
|
this.memoryService = memoryService;
|
|
342
249
|
this.agentMemory = agentMemory;
|
|
@@ -346,12 +253,8 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
346
253
|
this.pendingConfirmationRepo = pendingConfirmationRepo;
|
|
347
254
|
this.observationRepo = observationRepo;
|
|
348
255
|
this.observationCursorRepo = observationCursorRepo;
|
|
349
|
-
this.urlService = urlService;
|
|
350
256
|
this.eventLogRepository = eventLogRepository;
|
|
351
|
-
this.dbIterationLogStorage = dbIterationLogStorage;
|
|
352
|
-
this.instanceWriteAccess = instanceWriteAccess;
|
|
353
257
|
this.telemetry = telemetry;
|
|
354
|
-
this.mcpRegistryService = mcpRegistryService;
|
|
355
258
|
this.userRepository = userRepository;
|
|
356
259
|
this.temporaryWorkflowService = temporaryWorkflowService;
|
|
357
260
|
this.errorReporter = errorReporter;
|
|
@@ -361,20 +264,17 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
361
264
|
this.creditService = creditService;
|
|
362
265
|
this.publisher = publisher;
|
|
363
266
|
this.instanceAiErrorReporter = instanceAiErrorReporter;
|
|
364
|
-
this.push = push;
|
|
365
|
-
this.conversationHistoryService = conversationHistoryService;
|
|
366
|
-
this.instanceContext = instanceContext;
|
|
367
|
-
this.aiPreferenceService = aiPreferenceService;
|
|
368
|
-
this.aiUsageService = aiUsageService;
|
|
369
267
|
this.threadTabsService = threadTabsService;
|
|
370
|
-
this.
|
|
268
|
+
this.selfHealingAgent = selfHealingAgent;
|
|
269
|
+
this.turnEnvironment = turnEnvironment;
|
|
270
|
+
this.turnInput = turnInput;
|
|
271
|
+
this.agentFactory = agentFactory;
|
|
371
272
|
this.runState = new instance_ai_1.RunStateRegistry((user) => user.id);
|
|
273
|
+
this.finalizingSelfHealingRuns = new Set();
|
|
372
274
|
this.memoryTaskRegistry = new instance_ai_1.MemoryTaskRegistry();
|
|
373
275
|
this.domainAccessTrackersByThread = new Map();
|
|
374
276
|
this.threadPushRef = new Map();
|
|
375
277
|
this.pendingBrowserCredentialSetups = new Map();
|
|
376
|
-
this.planRequestsByThread = new Map();
|
|
377
|
-
this.schedulerLocks = new Map();
|
|
378
278
|
this.failedInternalFollowUpStreaks = new Map();
|
|
379
279
|
this.runDebugBuffer = new instance_ai_1.RunDebugBuffer();
|
|
380
280
|
this.inFlightExecutions = new Set();
|
|
@@ -430,7 +330,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
430
330
|
eventLog: this.eventLogRepository,
|
|
431
331
|
aiService: this.aiService,
|
|
432
332
|
});
|
|
433
|
-
this.sandboxService = new
|
|
333
|
+
this.sandboxService = new sandbox_1.InstanceAiSandboxService({
|
|
434
334
|
config: this.instanceAiConfig,
|
|
435
335
|
logger: this.logger,
|
|
436
336
|
errorReporter: this.errorReporter,
|
|
@@ -439,7 +339,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
439
339
|
settingsService: this.settingsService,
|
|
440
340
|
aiService: this.aiService,
|
|
441
341
|
resolveTracingConfig: async (threadId, userId) => {
|
|
442
|
-
const ownerId = userId ?? (await this.
|
|
342
|
+
const ownerId = userId ?? (await this.memoryService.getThreadActorId(threadId));
|
|
443
343
|
if (!ownerId)
|
|
444
344
|
return { userId: 'system' };
|
|
445
345
|
const { tracingProxyConfig } = await this.createProxyRunConfig({ id: ownerId });
|
|
@@ -466,19 +366,11 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
466
366
|
},
|
|
467
367
|
});
|
|
468
368
|
this.defaultTimeZone = globalConfig.generic.timezone;
|
|
469
|
-
const restEndpoint = globalConfig.endpoints.rest;
|
|
470
|
-
this.oauth2CallbackUrl = `${this.urlService.getInstanceBaseUrl()}/${restEndpoint}/oauth2-credential/callback`;
|
|
471
|
-
this.webhookBaseUrl = `${this.urlService.getWebhookBaseUrl()}${globalConfig.endpoints.webhook}`;
|
|
472
|
-
this.formBaseUrl = `${this.urlService.getWebhookBaseUrl()}${globalConfig.endpoints.form}`;
|
|
473
|
-
this._ssrfProtectionConfig = ssrfProtectionConfig;
|
|
474
|
-
this._ssrfProtectionService = ssrfProtectionService;
|
|
475
369
|
this.eventService.on('instance-ai-settings-updated', ({ mcpSettingsChanged }) => {
|
|
476
370
|
this.sandboxService.invalidateCachedWorkspaces();
|
|
477
371
|
if (!mcpSettingsChanged)
|
|
478
372
|
return;
|
|
479
|
-
|
|
480
|
-
return;
|
|
481
|
-
this._mcpClientManager.disconnect().catch((error) => {
|
|
373
|
+
this.agentFactory.disconnectMcpClients().catch((error) => {
|
|
482
374
|
this.logger.warn('Failed to disconnect MCP clients after settings change', {
|
|
483
375
|
error: (0, get_error_message_1.getErrorMessage)(error),
|
|
484
376
|
});
|
|
@@ -487,35 +379,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
487
379
|
this.liveness.start();
|
|
488
380
|
}
|
|
489
381
|
async createProxyRunConfig(user) {
|
|
490
|
-
|
|
491
|
-
return {};
|
|
492
|
-
const client = await this.aiService.getClient();
|
|
493
|
-
const proxyBaseUrl = client.getApiProxyBaseUrl();
|
|
494
|
-
const tokenManager = new proxy_token_manager_1.ProxyTokenManager(async () => {
|
|
495
|
-
return await client.getInstanceAiApiProxyToken({ id: user.id }, { userMessageId: (0, nanoid_1.nanoid)() });
|
|
496
|
-
});
|
|
497
|
-
const featureHeaders = (0, api_types_1.buildProxyHeaders)({
|
|
498
|
-
feature: 'instance-ai',
|
|
499
|
-
n8nVersion: constants_1.N8N_VERSION,
|
|
500
|
-
});
|
|
501
|
-
return {
|
|
502
|
-
proxyBaseUrl,
|
|
503
|
-
tokenManager,
|
|
504
|
-
searchProxyConfig: {
|
|
505
|
-
apiUrl: proxyBaseUrl + '/brave-search',
|
|
506
|
-
getAuthHeaders: async () => ({
|
|
507
|
-
...(await tokenManager.getAuthHeaders()),
|
|
508
|
-
...featureHeaders,
|
|
509
|
-
}),
|
|
510
|
-
},
|
|
511
|
-
tracingProxyConfig: {
|
|
512
|
-
apiUrl: proxyBaseUrl + '/langsmith',
|
|
513
|
-
getAuthHeaders: async () => ({
|
|
514
|
-
...(await tokenManager.getAuthHeaders()),
|
|
515
|
-
...featureHeaders,
|
|
516
|
-
}),
|
|
517
|
-
},
|
|
518
|
-
};
|
|
382
|
+
return await this.turnEnvironment.createProxyRunConfig(user);
|
|
519
383
|
}
|
|
520
384
|
async resolveAgentModelConfig(user) {
|
|
521
385
|
return await this.modelService.resolveAgentModelConfig(user);
|
|
@@ -572,20 +436,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
572
436
|
return args.turnHadAttachments && args.producedNoOutput;
|
|
573
437
|
}
|
|
574
438
|
async assertAssistantCreditsAvailable(user) {
|
|
575
|
-
|
|
576
|
-
try {
|
|
577
|
-
credits = await this.modelService.getCredits(user);
|
|
578
|
-
}
|
|
579
|
-
catch (error) {
|
|
580
|
-
this.logger.debug('Skipping pre-run credit check; balance read failed', {
|
|
581
|
-
userId: user.id,
|
|
582
|
-
error: (0, get_error_message_1.getErrorMessage)(error),
|
|
583
|
-
});
|
|
584
|
-
return;
|
|
585
|
-
}
|
|
586
|
-
if (!isAssistantCreditBalanceExhausted(credits))
|
|
587
|
-
return;
|
|
588
|
-
throw assistantCreditsExhaustedError();
|
|
439
|
+
await this.turnEnvironment.assertAssistantCreditsAvailable(user);
|
|
589
440
|
}
|
|
590
441
|
async reclassifyMaskedStreamFailure(error, user, context) {
|
|
591
442
|
if (!isMaskedStreamFailure(error))
|
|
@@ -606,7 +457,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
606
457
|
maskedError: (0, get_error_message_1.getErrorMessage)(error),
|
|
607
458
|
...context,
|
|
608
459
|
});
|
|
609
|
-
return new QuotaExhaustedStreamError(error);
|
|
460
|
+
return new assistant_credits_1.QuotaExhaustedStreamError(error);
|
|
610
461
|
}
|
|
611
462
|
isEnabled() {
|
|
612
463
|
return this.settingsService.isAgentEnabled() && !!this.instanceAiConfig.model;
|
|
@@ -651,21 +502,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
651
502
|
this.logger.info(`Observational memory task ${event.type}`, logContext);
|
|
652
503
|
};
|
|
653
504
|
}
|
|
654
|
-
subscribeToAgentErrors(agent, threadId, runId) {
|
|
655
|
-
agent.on("error", (event) => {
|
|
656
|
-
if (event.type !== "error")
|
|
657
|
-
return;
|
|
658
|
-
if (!event.source)
|
|
659
|
-
return;
|
|
660
|
-
const severity = (0, instance_ai_error_reporter_service_1.getAgentErrorSeverity)(event.source);
|
|
661
|
-
this.instanceAiErrorReporter.report(event.error, {
|
|
662
|
-
component: `instance-ai-${event.source}`,
|
|
663
|
-
...(severity ? { severity } : {}),
|
|
664
|
-
threadId,
|
|
665
|
-
runId,
|
|
666
|
-
});
|
|
667
|
-
});
|
|
668
|
-
}
|
|
669
505
|
isRunDebugEnabled() {
|
|
670
506
|
return this.instanceAiConfig.runDebugEnabled;
|
|
671
507
|
}
|
|
@@ -789,7 +625,62 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
789
625
|
}
|
|
790
626
|
}
|
|
791
627
|
}
|
|
792
|
-
|
|
628
|
+
async startSelfHealingRun(input, lifecycle) {
|
|
629
|
+
this.selfHealingAgent.assertEnabled();
|
|
630
|
+
this.assertRunAdmissible(input.user);
|
|
631
|
+
const { threadId } = lifecycle;
|
|
632
|
+
this.liveness.clearThreadState(threadId);
|
|
633
|
+
const { runId, abortController, messageGroupId } = this.runState.startRun({
|
|
634
|
+
threadId,
|
|
635
|
+
runId: lifecycle.runId,
|
|
636
|
+
user: input.user,
|
|
637
|
+
});
|
|
638
|
+
const execution = this.selfHealingAgent
|
|
639
|
+
.execute(input, {
|
|
640
|
+
threadId,
|
|
641
|
+
runId,
|
|
642
|
+
messageGroupId,
|
|
643
|
+
signal: abortController.signal,
|
|
644
|
+
sandbox: this.sandboxService,
|
|
645
|
+
tracing: this.tracing,
|
|
646
|
+
createProxyRunConfig: async () => await this.createProxyRunConfig(input.user),
|
|
647
|
+
assertCreditsAvailable: async () => await this.assertAssistantCreditsAvailable(input.user),
|
|
648
|
+
onActivity: () => this.runState.touchActiveRun(threadId),
|
|
649
|
+
onFinalizing: () => {
|
|
650
|
+
this.finalizingSelfHealingRuns.add(runId);
|
|
651
|
+
},
|
|
652
|
+
onComplete: lifecycle.onComplete,
|
|
653
|
+
getAbortReason: () => {
|
|
654
|
+
if (this.liveness.consumeRunTimeout(runId).timedOut)
|
|
655
|
+
return liveness_1.INSTANCE_AI_RUN_TIMEOUT_REASON;
|
|
656
|
+
if (quotaExhaustedFromSignal(abortController.signal))
|
|
657
|
+
return 'quota_exhausted';
|
|
658
|
+
return getAbortReason(abortController.signal);
|
|
659
|
+
},
|
|
660
|
+
onFinish: (result, modelId, stream) => {
|
|
661
|
+
const status = result.status === 'suspended' ? 'errored' : result.status;
|
|
662
|
+
if (abortController.signal.reason !== 'service_shutdown') {
|
|
663
|
+
this.publishRunFinish(threadId, runId, status, result.reason ?? result.finishReason, undefined, input.user.id, {
|
|
664
|
+
modelId,
|
|
665
|
+
promptVersion: instance_ai_1.SELF_HEALING_PROFILE_VERSION,
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
this.emitRunMetrics(threadId, status, {
|
|
669
|
+
modelId,
|
|
670
|
+
workSummary: stream?.workSummary,
|
|
671
|
+
usage: stream?.usage,
|
|
672
|
+
});
|
|
673
|
+
},
|
|
674
|
+
})
|
|
675
|
+
.finally(() => {
|
|
676
|
+
this.finalizingSelfHealingRuns.delete(runId);
|
|
677
|
+
this.runState.clearActiveRun(threadId);
|
|
678
|
+
this.liveness.clearThreadState(threadId);
|
|
679
|
+
});
|
|
680
|
+
this.trackInFlightExecution(execution);
|
|
681
|
+
return await execution;
|
|
682
|
+
}
|
|
683
|
+
startRun(user, threadId, message, attachments, context, timeZone, pushRef, mode, promptVersion, browserUseAvailable, threadArtifacts, observerThresholdTokens) {
|
|
793
684
|
if (promptVersion !== undefined &&
|
|
794
685
|
(0, instance_ai_1.resolvePromptProfile)({ version: promptVersion }).fallbackFrom) {
|
|
795
686
|
throw new errors_1.BadRequestError(`Unknown Instance AI prompt version "${promptVersion}"`);
|
|
@@ -803,14 +694,14 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
803
694
|
if (timeZone) {
|
|
804
695
|
this.runState.setTimeZone(threadId, timeZone);
|
|
805
696
|
}
|
|
806
|
-
this.runState.
|
|
697
|
+
this.runState.setBrowserUseAvailable(threadId, browserUseAvailable);
|
|
807
698
|
this.runState.setBuildMode(threadId, mode);
|
|
808
699
|
this.runState.setPromptVersion(threadId, promptVersion);
|
|
809
700
|
this.runState.setObserverThresholdTokens(threadId, observerThresholdTokens);
|
|
810
701
|
if (pushRef !== undefined) {
|
|
811
702
|
this.threadPushRef.set(threadId, pushRef);
|
|
812
703
|
}
|
|
813
|
-
this.startExecuteRun(user, threadId, runId, message, abortController, attachments, context, messageGroupId, timeZone,
|
|
704
|
+
this.startExecuteRun(user, threadId, runId, message, abortController, attachments, context, messageGroupId, timeZone, undefined, threadArtifacts);
|
|
814
705
|
return runId;
|
|
815
706
|
}
|
|
816
707
|
getMessageGroupId(threadId) {
|
|
@@ -833,6 +724,9 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
833
724
|
}
|
|
834
725
|
}
|
|
835
726
|
for (const threadId of threadIds) {
|
|
727
|
+
const runId = this.runState.getActiveRunId(threadId);
|
|
728
|
+
if (runId && this.finalizingSelfHealingRuns.has(runId))
|
|
729
|
+
continue;
|
|
836
730
|
try {
|
|
837
731
|
this.cancelRun(threadId, 'quota_exhausted');
|
|
838
732
|
}
|
|
@@ -847,9 +741,8 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
847
741
|
}
|
|
848
742
|
cancelRun(threadId, reason = 'user_cancelled') {
|
|
849
743
|
const quotaStop = reason === 'quota_exhausted';
|
|
850
|
-
const abortReason = quotaStop ? assistantCreditsExhaustedError() : undefined;
|
|
744
|
+
const abortReason = quotaStop ? (0, assistant_credits_1.assistantCreditsExhaustedError)() : undefined;
|
|
851
745
|
const cancelledTasks = this.backgroundTasks.cancelThread(threadId, abortReason);
|
|
852
|
-
const user = this.runState.getThreadUser(threadId);
|
|
853
746
|
for (const task of cancelledTasks) {
|
|
854
747
|
void this.tracing.finalizeBackgroundTaskTracing(task, 'cancelled');
|
|
855
748
|
if (quotaStop) {
|
|
@@ -875,11 +768,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
875
768
|
},
|
|
876
769
|
});
|
|
877
770
|
void this.terminalOutcome.recordBackgroundTerminalOutcome(task);
|
|
878
|
-
if (user) {
|
|
879
|
-
void this.handlePlannedTaskSettlement(user, task, 'cancelled', { reschedule: false });
|
|
880
|
-
}
|
|
881
771
|
}
|
|
882
|
-
void this.cancelAwaitingApprovalPlan(threadId);
|
|
883
772
|
const { active, suspended } = this.runState.cancelThread(threadId);
|
|
884
773
|
if (active) {
|
|
885
774
|
if (reason === liveness_1.INSTANCE_AI_RUN_TIMEOUT_REASON)
|
|
@@ -930,10 +819,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
930
819
|
payload: { role: task.role, result: '', status: 'cancelled' },
|
|
931
820
|
});
|
|
932
821
|
void this.terminalOutcome.recordBackgroundTerminalOutcome(task);
|
|
933
|
-
const user = this.runState.getThreadUser(threadId);
|
|
934
|
-
if (user) {
|
|
935
|
-
void this.handlePlannedTaskSettlement(user, task, 'cancelled');
|
|
936
|
-
}
|
|
937
822
|
}
|
|
938
823
|
broadcastTaskControl(payload) {
|
|
939
824
|
if (!this.instanceSettings.isMultiMain)
|
|
@@ -1163,12 +1048,10 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
1163
1048
|
reason: 'thread_cleared',
|
|
1164
1049
|
metadata: { completion_source: 'service_cleanup' },
|
|
1165
1050
|
});
|
|
1166
|
-
this.schedulerLocks.delete(threadId);
|
|
1167
1051
|
this.failedInternalFollowUpStreaks.delete(threadId);
|
|
1168
1052
|
this.domainAccessTrackersByThread.delete(threadId);
|
|
1169
1053
|
this.evalCredentialAllowlists.clearThread(threadId);
|
|
1170
1054
|
this.threadPushRef.delete(threadId);
|
|
1171
|
-
this.planRequestsByThread.delete(threadId);
|
|
1172
1055
|
this.memoryTaskRegistry.clearThread(threadId);
|
|
1173
1056
|
this.tracing.deleteTraceContextsForThread(threadId);
|
|
1174
1057
|
await this.deleteAgentBuilderSessions(threadId);
|
|
@@ -1195,6 +1078,8 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
1195
1078
|
const { activeRuns, suspendedRuns, pendingThreadIds } = this.runState.shutdown();
|
|
1196
1079
|
const threadsWithPendingHitl = new Set(pendingThreadIds);
|
|
1197
1080
|
for (const run of activeRuns) {
|
|
1081
|
+
if (run.abortController.signal.aborted)
|
|
1082
|
+
continue;
|
|
1198
1083
|
if (threadsWithPendingHitl.has(run.threadId)) {
|
|
1199
1084
|
await this.tracing.finalizeRunTracing(run.runId, run.tracing, {
|
|
1200
1085
|
status: 'cancelled',
|
|
@@ -1205,11 +1090,11 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
1205
1090
|
continue;
|
|
1206
1091
|
}
|
|
1207
1092
|
this.publishRunFinish(run.threadId, run.runId, 'cancelled', 'service_shutdown', undefined, undefined, { promptVersion: run.promptVersion });
|
|
1093
|
+
run.abortController.abort('service_shutdown');
|
|
1208
1094
|
await this.tracing.finalizeRunTracing(run.runId, run.tracing, {
|
|
1209
1095
|
status: 'cancelled',
|
|
1210
1096
|
reason: 'service_shutdown',
|
|
1211
1097
|
});
|
|
1212
|
-
run.abortController.abort();
|
|
1213
1098
|
}
|
|
1214
1099
|
for (const run of suspendedRuns) {
|
|
1215
1100
|
await this.tracing.finalizeRunTracing(run.runId, run.tracing, {
|
|
@@ -1233,28 +1118,42 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
1233
1118
|
metadata: { completion_source: 'service_cleanup' },
|
|
1234
1119
|
});
|
|
1235
1120
|
}
|
|
1236
|
-
this.gatewayService.disconnectAll();
|
|
1237
1121
|
await this.browserSessionService.shutdown();
|
|
1238
1122
|
this.sandboxService.stopSandboxExpiryTimers();
|
|
1239
1123
|
this.domainAccessTrackersByThread.clear();
|
|
1240
1124
|
this.tracing.clear();
|
|
1241
1125
|
await this.eventLog.flushAll();
|
|
1242
1126
|
this.eventBus.clear();
|
|
1243
|
-
await this.
|
|
1127
|
+
await this.agentFactory.disconnectMcpClients();
|
|
1244
1128
|
await (0, instance_ai_1.shutdownProductTelemetryProviders)();
|
|
1245
1129
|
this.logger.debug('Instance AI service shut down');
|
|
1246
1130
|
}
|
|
1247
|
-
trackInFlightExecution(promise) {
|
|
1248
|
-
const
|
|
1131
|
+
trackInFlightExecution(promise, failureContext) {
|
|
1132
|
+
const clear = () => {
|
|
1249
1133
|
this.inFlightExecutions.delete(tracked);
|
|
1134
|
+
};
|
|
1135
|
+
const tracked = promise.then(clear, (error) => {
|
|
1136
|
+
try {
|
|
1137
|
+
if (failureContext) {
|
|
1138
|
+
this.logger.error('Unexpected Instance AI execution failure', {
|
|
1139
|
+
...failureContext,
|
|
1140
|
+
error,
|
|
1141
|
+
});
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
finally {
|
|
1145
|
+
clear();
|
|
1146
|
+
}
|
|
1250
1147
|
});
|
|
1251
1148
|
this.inFlightExecutions.add(tracked);
|
|
1252
1149
|
}
|
|
1253
1150
|
startExecuteRun(...args) {
|
|
1254
|
-
|
|
1151
|
+
const [, threadId, runId] = args;
|
|
1152
|
+
this.trackInFlightExecution(this.executeRun(...args), { threadId, runId });
|
|
1255
1153
|
}
|
|
1256
1154
|
startProcessResumedStream(...args) {
|
|
1257
|
-
|
|
1155
|
+
const { threadId, runId } = args[2];
|
|
1156
|
+
this.trackInFlightExecution(this.processResumedStream(...args), { threadId, runId });
|
|
1258
1157
|
}
|
|
1259
1158
|
shouldPreserveHitlOnShutdown(runId) {
|
|
1260
1159
|
return this.preserveHitlOnShutdown.has(runId);
|
|
@@ -1320,71 +1219,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
1320
1219
|
});
|
|
1321
1220
|
}
|
|
1322
1221
|
}
|
|
1323
|
-
createAgentMemoryOptions(user, threadId, runId, memoryModelId) {
|
|
1324
|
-
return {
|
|
1325
|
-
observationalMemory: {
|
|
1326
|
-
model: memoryModelId,
|
|
1327
|
-
observerThresholdTokens: this.runState.getObserverThresholdTokens(threadId) ??
|
|
1328
|
-
this.instanceAiConfig.observerMessageTokens,
|
|
1329
|
-
reflectorThresholdTokens: this.instanceAiConfig.reflectorObservationTokens,
|
|
1330
|
-
midRunObservation: this.instanceAiConfig.midRunObservation,
|
|
1331
|
-
onTaskUsage: async (report) => {
|
|
1332
|
-
try {
|
|
1333
|
-
const items = (0, instance_ai_1.tokenUsageToBuilderUsageItems)(report.model, report.usage);
|
|
1334
|
-
if (items.length === 0)
|
|
1335
|
-
return;
|
|
1336
|
-
await this.creditService.claimRunUsage(user, threadId, `${runId}:memory:${report.task}:${report.reportId}`, items, 'completed');
|
|
1337
|
-
}
|
|
1338
|
-
catch (error) {
|
|
1339
|
-
this.logger.warn('Failed to claim observational-memory usage', {
|
|
1340
|
-
threadId,
|
|
1341
|
-
runId,
|
|
1342
|
-
task: report.task,
|
|
1343
|
-
error: (0, get_error_message_1.getErrorMessage)(error),
|
|
1344
|
-
});
|
|
1345
|
-
}
|
|
1346
|
-
},
|
|
1347
|
-
},
|
|
1348
|
-
};
|
|
1349
|
-
}
|
|
1350
|
-
createWorkflowTaskServiceWithUiSync(threadId, runId, workflowTasks) {
|
|
1351
|
-
const sync = async () => await this.taskProjector.syncFromWorkflowLoop(threadId, runId);
|
|
1352
|
-
return {
|
|
1353
|
-
reportBuildOutcome: async (outcome) => {
|
|
1354
|
-
const action = await workflowTasks.reportBuildOutcome(outcome);
|
|
1355
|
-
await sync();
|
|
1356
|
-
return action;
|
|
1357
|
-
},
|
|
1358
|
-
reportVerificationVerdict: async (verdict) => {
|
|
1359
|
-
const action = await workflowTasks.reportVerificationVerdict(verdict);
|
|
1360
|
-
await sync();
|
|
1361
|
-
return action;
|
|
1362
|
-
},
|
|
1363
|
-
updateBuildOutcome: async (workItemId, update) => {
|
|
1364
|
-
await workflowTasks.updateBuildOutcome(workItemId, update);
|
|
1365
|
-
await sync();
|
|
1366
|
-
},
|
|
1367
|
-
beginVerification: async (outcome, state, verificationRunId) => {
|
|
1368
|
-
const resumed = await workflowTasks.beginVerification(outcome, state, verificationRunId);
|
|
1369
|
-
if (resumed)
|
|
1370
|
-
await sync();
|
|
1371
|
-
return resumed;
|
|
1372
|
-
},
|
|
1373
|
-
getBuildOutcome: async (workItemId) => await workflowTasks.getBuildOutcome(workItemId),
|
|
1374
|
-
startVerification: async (workItemId, triggerNodeName) => {
|
|
1375
|
-
const previousProgress = await workflowTasks.startVerification(workItemId, triggerNodeName);
|
|
1376
|
-
await sync();
|
|
1377
|
-
return previousProgress;
|
|
1378
|
-
},
|
|
1379
|
-
recordVerification: async (workItemId, verification, previousProgress) => {
|
|
1380
|
-
const claim = await workflowTasks.recordVerification(workItemId, verification, previousProgress);
|
|
1381
|
-
await sync();
|
|
1382
|
-
return claim;
|
|
1383
|
-
},
|
|
1384
|
-
getLatestBuildOutcomeForWorkflow: async (workflowId) => await workflowTasks.getLatestBuildOutcomeForWorkflow(workflowId),
|
|
1385
|
-
getWorkflowLoopState: async (workItemId) => await workflowTasks.getWorkflowLoopState(workItemId),
|
|
1386
|
-
};
|
|
1387
|
-
}
|
|
1388
1222
|
trackWorkflowVerificationObligation(obligation, event, extra = {}) {
|
|
1389
1223
|
try {
|
|
1390
1224
|
this.telemetry?.track('instance_ai_workflow_verification_obligation', {
|
|
@@ -1392,10 +1226,8 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
1392
1226
|
thread_id: obligation.threadId,
|
|
1393
1227
|
run_id: obligation.runId,
|
|
1394
1228
|
task_id: obligation.taskId,
|
|
1395
|
-
planned_task_id: obligation.plannedTaskId,
|
|
1396
1229
|
work_item_id: obligation.workItemId,
|
|
1397
1230
|
workflow_id: obligation.workflowId,
|
|
1398
|
-
source: obligation.source,
|
|
1399
1231
|
policy: obligation.policy,
|
|
1400
1232
|
status: obligation.status,
|
|
1401
1233
|
readiness_status: obligation.readiness?.status,
|
|
@@ -1414,589 +1246,83 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
1414
1246
|
});
|
|
1415
1247
|
}
|
|
1416
1248
|
}
|
|
1417
|
-
buildPlannedTaskFollowUpMessage(type, graph, options = {}) {
|
|
1418
|
-
const payload = {
|
|
1419
|
-
tasks: graph.tasks.map((task) => ({
|
|
1420
|
-
id: task.id,
|
|
1421
|
-
title: task.title,
|
|
1422
|
-
kind: task.kind,
|
|
1423
|
-
status: task.status,
|
|
1424
|
-
result: task.result,
|
|
1425
|
-
error: task.error,
|
|
1426
|
-
outcome: task.outcome,
|
|
1427
|
-
})),
|
|
1428
|
-
};
|
|
1429
|
-
if (options.failedTask) {
|
|
1430
|
-
payload.failedTask = {
|
|
1431
|
-
id: options.failedTask.id,
|
|
1432
|
-
title: options.failedTask.title,
|
|
1433
|
-
kind: options.failedTask.kind,
|
|
1434
|
-
error: options.failedTask.error,
|
|
1435
|
-
result: options.failedTask.result,
|
|
1436
|
-
};
|
|
1437
|
-
}
|
|
1438
|
-
if (options.checkpoint) {
|
|
1439
|
-
const depOutcomes = graph.tasks
|
|
1440
|
-
.filter((t) => options.checkpoint.deps.includes(t.id))
|
|
1441
|
-
.map((t) => ({
|
|
1442
|
-
id: t.id,
|
|
1443
|
-
title: t.title,
|
|
1444
|
-
kind: t.kind,
|
|
1445
|
-
status: t.status,
|
|
1446
|
-
result: t.result,
|
|
1447
|
-
outcome: t.outcome,
|
|
1448
|
-
}));
|
|
1449
|
-
payload.checkpoint = {
|
|
1450
|
-
id: options.checkpoint.id,
|
|
1451
|
-
title: options.checkpoint.title,
|
|
1452
|
-
instructions: options.checkpoint.spec,
|
|
1453
|
-
dependsOn: depOutcomes,
|
|
1454
|
-
};
|
|
1455
|
-
}
|
|
1456
|
-
if (options.buildTask) {
|
|
1457
|
-
payload.buildTask = {
|
|
1458
|
-
id: options.buildTask.id,
|
|
1459
|
-
title: options.buildTask.title,
|
|
1460
|
-
kind: options.buildTask.kind,
|
|
1461
|
-
spec: options.buildTask.spec,
|
|
1462
|
-
workflowId: options.buildTask.workflowId,
|
|
1463
|
-
isSupportingWorkflow: options.buildTask.isSupportingWorkflow,
|
|
1464
|
-
deps: options.buildTask.deps,
|
|
1465
|
-
};
|
|
1466
|
-
}
|
|
1467
|
-
return `<planned-task-follow-up type="${type}">\n${JSON.stringify(payload, null, 2)}\n</planned-task-follow-up>\n\n${internal_messages_1.AUTO_FOLLOW_UP_MESSAGE}`;
|
|
1468
|
-
}
|
|
1469
|
-
buildWorkflowVerificationFollowUpMessage(input) {
|
|
1470
|
-
const payload = {
|
|
1471
|
-
obligation: input.obligation,
|
|
1472
|
-
outcome: input.outcome,
|
|
1473
|
-
sourceTask: input.sourceTask,
|
|
1474
|
-
};
|
|
1475
|
-
return `<workflow-verification-follow-up>\n${JSON.stringify(payload, null, 2)}\n</workflow-verification-follow-up>\n\n${internal_messages_1.AUTO_FOLLOW_UP_MESSAGE}`;
|
|
1476
|
-
}
|
|
1477
|
-
async createPlannedTaskState() {
|
|
1478
|
-
const memory = this.agentMemory;
|
|
1479
|
-
const taskStorage = new instance_ai_1.ThreadTaskStorage(memory);
|
|
1480
|
-
const plannedTaskStorage = new instance_ai_1.PlannedTaskStorage(memory);
|
|
1481
|
-
const plannedTaskService = new instance_ai_1.PlannedTaskCoordinator(plannedTaskStorage);
|
|
1482
|
-
return { memory, taskStorage, plannedTaskService };
|
|
1483
|
-
}
|
|
1484
1249
|
async replayUndeliveredTerminalOutcomes(threadId) {
|
|
1485
1250
|
await this.terminalOutcome.replayUndeliveredTerminalOutcomes(threadId);
|
|
1486
1251
|
}
|
|
1487
|
-
async syncPlannedTasksToUi(threadId, graph) {
|
|
1488
|
-
const { taskStorage } = await this.createPlannedTaskState();
|
|
1489
|
-
const tasks = await this.taskProjector.projectPlannedTaskList(threadId, graph);
|
|
1490
|
-
await taskStorage.save(threadId, tasks);
|
|
1491
|
-
this.eventBus.publish(threadId, {
|
|
1492
|
-
type: 'tasks-update',
|
|
1493
|
-
runId: graph.planRunId,
|
|
1494
|
-
agentId: (0, instance_ai_1.orchestratorAgentId)(graph.planRunId),
|
|
1495
|
-
payload: { tasks },
|
|
1496
|
-
});
|
|
1497
|
-
}
|
|
1498
|
-
async cancelAwaitingApprovalPlan(threadId) {
|
|
1499
|
-
try {
|
|
1500
|
-
const { plannedTaskService, taskStorage } = await this.createPlannedTaskState();
|
|
1501
|
-
const graph = await plannedTaskService.getGraph(threadId);
|
|
1502
|
-
if (!graph || graph.status !== 'awaiting_approval')
|
|
1503
|
-
return;
|
|
1504
|
-
await plannedTaskService.clear(threadId);
|
|
1505
|
-
await taskStorage.save(threadId, { tasks: [] });
|
|
1506
|
-
this.eventBus.publish(threadId, {
|
|
1507
|
-
type: 'tasks-update',
|
|
1508
|
-
runId: graph.planRunId,
|
|
1509
|
-
agentId: (0, instance_ai_1.orchestratorAgentId)(graph.planRunId),
|
|
1510
|
-
payload: { tasks: { tasks: [] }, planItems: [] },
|
|
1511
|
-
});
|
|
1512
|
-
}
|
|
1513
|
-
catch (error) {
|
|
1514
|
-
this.logger.warn('Failed to clean up awaiting_approval plan on cancel', {
|
|
1515
|
-
threadId,
|
|
1516
|
-
error: error instanceof Error ? error.message : String(error),
|
|
1517
|
-
});
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1520
1252
|
areMcpConnectionsAvailable() {
|
|
1521
|
-
return
|
|
1522
|
-
this.settingsService.isMcpAccessEnabled());
|
|
1253
|
+
return this.turnEnvironment.areMcpConnectionsAvailable();
|
|
1523
1254
|
}
|
|
1524
1255
|
async createExecutionEnvironment(user, threadId, runId, abortSignal, messageGroupId, pushRef, proxyRunConfig, instanceContextGates, experimentGates) {
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
if (!boundProjectId) {
|
|
1528
|
-
throw new n8n_workflow_1.UnexpectedError(`Instance AI thread "${threadId}" has no bound project; it must be created via POST /instance-ai/threads before a run can start`);
|
|
1529
|
-
}
|
|
1530
|
-
const adminSettings = await this.settingsService.getAdminSettings();
|
|
1531
|
-
const localGatewayDisabledGlobally = adminSettings.localGatewayDisabled;
|
|
1532
|
-
const browserUseEnabledGlobally = adminSettings.browserUseEnabled;
|
|
1533
|
-
const mcpConnectionsAvailable = this.areMcpConnectionsAvailable();
|
|
1534
|
-
const localGatewayDisabledForUser = await this.settingsService.isLocalGatewayDisabledForUser(user.id);
|
|
1535
|
-
const userGateway = this.gatewayService.findGateway(user.id);
|
|
1536
|
-
await this.assertAssistantCreditsAvailable(user);
|
|
1537
|
-
const { searchProxyConfig, tokenManager, proxyBaseUrl } = proxyRunConfig ?? (await this.createProxyRunConfig(user));
|
|
1538
|
-
const proxyContext = { runId, threadId };
|
|
1539
|
-
const modelId = proxyBaseUrl && tokenManager
|
|
1540
|
-
? await this.modelService.resolveProxyModel(user, proxyBaseUrl, tokenManager, proxyContext)
|
|
1541
|
-
: await this.modelService.resolveAgentModelConfig(user, proxyContext);
|
|
1542
|
-
const memoryModelId = await this.modelService.resolveMemoryModelConfig(user, modelId, {
|
|
1543
|
-
proxyBaseUrl,
|
|
1544
|
-
tokenManager,
|
|
1545
|
-
proxyContext,
|
|
1546
|
-
});
|
|
1547
|
-
const gates = experimentGates ?? (await this.adapterService.resolveExperimentGates(user));
|
|
1548
|
-
const { configEvalsEnabled, conversationHistoryEnabled, progressiveBuildingEnabled, conciseStyleEnabled, setupPanelEnabled, setupPanelVariant, folderExplorationEnabled, credentialDescriptionsEnabled, aiPreferencesEnabled, } = gates;
|
|
1549
|
-
this.runState.setSetupPanelEnabled(threadId, setupPanelEnabled);
|
|
1550
|
-
const { instanceContextEnabled, nodeUsageEnabled } = instanceContextGates ?? gates;
|
|
1551
|
-
const conversationHistory = conversationHistoryEnabled
|
|
1552
|
-
? this.conversationHistoryService.forContext(user.id, boundProjectId, threadId)
|
|
1553
|
-
: undefined;
|
|
1554
|
-
const mode = this.runState.getBuildMode(threadId) ??
|
|
1555
|
-
(progressiveBuildingEnabled ? 'progressive' : 'default');
|
|
1556
|
-
const selectedPrompt = (0, instance_ai_1.resolvePromptProfile)({
|
|
1557
|
-
version: this.runState.getPromptVersion(threadId) ??
|
|
1558
|
-
resolveOperatorPromptVersion(this.instanceAiConfig.promptVersion) ??
|
|
1559
|
-
(conciseStyleEnabled && mode === 'default' ? instance_ai_1.CONCISE_PROMPT_VERSION : undefined),
|
|
1560
|
-
mode,
|
|
1561
|
-
});
|
|
1562
|
-
const buildMode = selectedPrompt.profile.mode;
|
|
1563
|
-
this.runState.setBuildMode(threadId, buildMode);
|
|
1564
|
-
const allowSendingParameterValues = await this.aiUsageService.isParameterValueSharingAllowed();
|
|
1565
|
-
const thread = await memory.getThread(threadId);
|
|
1566
|
-
const onboardingThread = thread?.metadata?.source === 'onboarding' && !thread.metadata.onboardingLeft;
|
|
1567
|
-
const context = this.adapterService.createContext(user, {
|
|
1568
|
-
searchProxyConfig,
|
|
1569
|
-
pushRef,
|
|
1570
|
-
threadId,
|
|
1571
|
-
projectId: boundProjectId,
|
|
1572
|
-
getCredentialIdAllowlist: () => this.evalCredentialAllowlists.get(threadId),
|
|
1573
|
-
shouldBypassCredentialTest: (credentialId) => this.evalCredentialAllowlists.shouldBypassTest(threadId, credentialId),
|
|
1574
|
-
getCredentialTestTarget: (credentialType) => this.evalCredentialAllowlists.getTestTarget(threadId, credentialType),
|
|
1575
|
-
configEvalsEnabled,
|
|
1576
|
-
setupPanelVariant,
|
|
1577
|
-
mcpConnectionsAvailable,
|
|
1578
|
-
nodeUsageEnabled,
|
|
1579
|
-
instanceContextEnabled,
|
|
1580
|
-
conversationHistory,
|
|
1581
|
-
folderExplorationEnabled,
|
|
1582
|
-
onboardingThread,
|
|
1583
|
-
credentialDescriptionsEnabled,
|
|
1584
|
-
aiPreferencesEnabled,
|
|
1585
|
-
modelId,
|
|
1586
|
-
allowSendingParameterValues,
|
|
1587
|
-
});
|
|
1588
|
-
this.gatewayService.applyToolPolicy(user.id);
|
|
1589
|
-
const gatewayMcpServer = !localGatewayDisabledForUser && userGateway?.isConnected ? userGateway : undefined;
|
|
1590
|
-
const browserMcpServer = browserUseEnabledGlobally
|
|
1591
|
-
? this.browserSessionService.findMcpServer(user.id)
|
|
1592
|
-
: undefined;
|
|
1593
|
-
const localMcpServer = (0, composite_local_mcp_server_1.composeLocalMcpServers)(gatewayMcpServer, browserMcpServer);
|
|
1594
|
-
if (localMcpServer) {
|
|
1595
|
-
context.localMcpServer = localMcpServer;
|
|
1596
|
-
}
|
|
1597
|
-
context.permissions = this.settingsService.getPermissions();
|
|
1598
|
-
if (this.instanceWriteAccess.isReadOnly()) {
|
|
1599
|
-
context.permissions = (0, api_types_1.applyBranchReadOnlyOverrides)(context.permissions);
|
|
1600
|
-
context.branchReadOnly = true;
|
|
1601
|
-
}
|
|
1602
|
-
context.runId = runId;
|
|
1603
|
-
if (setupPanelEnabled) {
|
|
1604
|
-
context.setupItemsEmitter = (0, instance_ai_1.createSetupItemsEmitter)({
|
|
1605
|
-
eventBus: this.eventBus,
|
|
1606
|
-
threadId,
|
|
1607
|
-
runId,
|
|
1608
|
-
agentId: (0, instance_ai_1.orchestratorAgentId)(runId),
|
|
1609
|
-
initialSnapshots: await this.eventLog.getSetupItemsSnapshots(threadId).catch((error) => {
|
|
1610
|
-
this.logger.warn('Failed to read setup panel snapshots', {
|
|
1611
|
-
threadId,
|
|
1612
|
-
error: (0, get_error_message_1.getErrorMessage)(error),
|
|
1613
|
-
});
|
|
1614
|
-
return [];
|
|
1615
|
-
}),
|
|
1616
|
-
readPersistedSnapshot: async (workflowId) => {
|
|
1617
|
-
const snapshots = await this.eventLog.getSetupItemsSnapshots(threadId);
|
|
1618
|
-
return snapshots.find((snapshot) => snapshot.workflowId === workflowId)?.items;
|
|
1619
|
-
},
|
|
1620
|
-
});
|
|
1621
|
-
context.markWorkflowSetupHandled = async (workflowId) => {
|
|
1622
|
-
await this.markWorkflowSetupHandled(threadId, workflowId, runId, {
|
|
1623
|
-
requirePersisted: true,
|
|
1624
|
-
});
|
|
1625
|
-
};
|
|
1626
|
-
}
|
|
1627
|
-
context.browserCredentialSetup = this.createBrowserCredentialSetupTracker(runId, user.id);
|
|
1628
|
-
context.onArtifactChanged = async (artifact) => {
|
|
1629
|
-
try {
|
|
1630
|
-
await this.threadTabsService.showArtifactTab(threadId, user.id, artifact);
|
|
1631
|
-
}
|
|
1632
|
-
catch (error) {
|
|
1633
|
-
this.logger.warn('Failed to show an Instance AI artifact tab', {
|
|
1634
|
-
threadId,
|
|
1635
|
-
error: (0, get_error_message_1.getErrorMessage)(error),
|
|
1636
|
-
});
|
|
1637
|
-
}
|
|
1638
|
-
};
|
|
1639
|
-
const sessionGrants = await this.loadThreadSessionGrants(threadId, user.id);
|
|
1640
|
-
context.sessionApprovedToolKeys = sessionGrants;
|
|
1641
|
-
const grantSessionToolApproval = async (key) => {
|
|
1642
|
-
await this.persistThreadSessionGrant(threadId, user.id, key);
|
|
1643
|
-
sessionGrants.add(key);
|
|
1644
|
-
};
|
|
1645
|
-
context.grantSessionToolApproval = grantSessionToolApproval;
|
|
1646
|
-
context.revokeSessionToolApproval = async (key) => {
|
|
1647
|
-
await this.revokeThreadSessionGrant(threadId, user.id, key);
|
|
1648
|
-
sessionGrants.delete(key);
|
|
1649
|
-
};
|
|
1650
|
-
const domainTracker = (0, instance_ai_1.createDomainAccessTracker)({
|
|
1651
|
-
grantedKeys: sessionGrants,
|
|
1652
|
-
persistGrant: grantSessionToolApproval,
|
|
1653
|
-
});
|
|
1654
|
-
this.domainAccessTrackersByThread.set(threadId, domainTracker);
|
|
1655
|
-
context.domainAccessTracker = domainTracker;
|
|
1656
|
-
if (this.isRunDebugEnabled()) {
|
|
1657
|
-
context.recordWorkflowCodeSnapshot = (snapshot) => {
|
|
1658
|
-
this.runDebugBuffer.ensure(runId, threadId);
|
|
1659
|
-
this.runDebugBuffer.recordWorkflowCode(runId, snapshot);
|
|
1660
|
-
};
|
|
1661
|
-
}
|
|
1662
|
-
browserMcpServer?.setDomainGate({
|
|
1663
|
-
tracker: domainTracker,
|
|
1664
|
-
runId,
|
|
1665
|
-
permissionMode: context.permissions?.fetchUrl,
|
|
1666
|
-
createCredentialPermissionMode: context.permissions?.createCredential,
|
|
1667
|
-
});
|
|
1668
|
-
context.computerUseState = (0, computer_use_availability_1.resolveComputerUseState)({
|
|
1669
|
-
localGatewayDisabledGlobally,
|
|
1670
|
-
localGatewayDisabledForUser,
|
|
1671
|
-
browserUseEnabledGlobally,
|
|
1672
|
-
clientChannels: this.runState.getComputerUseChannels(threadId),
|
|
1673
|
-
localComputerToolCategories: gatewayMcpServer
|
|
1674
|
-
? (0, computer_use_availability_1.enabledToolCategories)(gatewayMcpServer.getStatus().toolCategories)
|
|
1675
|
-
: undefined,
|
|
1676
|
-
browserConnected: browserMcpServer !== undefined,
|
|
1677
|
-
});
|
|
1678
|
-
const taskStorage = new instance_ai_1.ThreadTaskStorage(memory);
|
|
1679
|
-
const iterationLog = this.dbIterationLogStorage;
|
|
1680
|
-
const workflowLoopStorage = new instance_ai_1.WorkflowLoopStorage(memory);
|
|
1681
|
-
const workflowTasks = this.createWorkflowTaskServiceWithUiSync(threadId, runId, new instance_ai_1.WorkflowTaskCoordinator(threadId, workflowLoopStorage));
|
|
1682
|
-
const plannedTaskStorage = new instance_ai_1.PlannedTaskStorage(memory);
|
|
1683
|
-
const plannedTaskService = new instance_ai_1.PlannedTaskCoordinator(plannedTaskStorage);
|
|
1684
|
-
const nodeDefDirs = this.adapterService.getNodeDefinitionDirs();
|
|
1685
|
-
if (nodeDefDirs.length > 0) {
|
|
1686
|
-
(0, workflow_sdk_1.setSchemaBaseDirs)(nodeDefDirs);
|
|
1687
|
-
}
|
|
1688
|
-
const skillScope = {
|
|
1689
|
-
profile: selectedPrompt.profile,
|
|
1690
|
-
flags: { configEvalsEnabled, instanceContextEnabled },
|
|
1691
|
-
agentBuildingEnabled: context.builderDelegate !== undefined,
|
|
1692
|
-
};
|
|
1693
|
-
const skills = await this.skillsService.loadSkills(skillScope);
|
|
1694
|
-
const promptMetadata = (0, instance_ai_1.describePromptProfile)(selectedPrompt, skills.source);
|
|
1695
|
-
this.runState.setPromptConfiguration(threadId, promptMetadata);
|
|
1696
|
-
let runtimeWorkspace;
|
|
1697
|
-
let workspaceRoot;
|
|
1698
|
-
const sandboxStatus = this.settingsService.getSandboxStatus();
|
|
1699
|
-
if (sandboxStatus.workflowBuilderAvailable) {
|
|
1700
|
-
const sandboxConfig = await this.instanceAiErrorReporter.withBoundary('instance-ai-sandbox-setup', { threadId, runId, userId: user.id, messageGroupId }, async () => await this.sandboxService.resolveSandboxConfig(user));
|
|
1701
|
-
if (sandboxConfig.enabled) {
|
|
1702
|
-
workspaceRoot = (0, sandbox_1.getPromptWorkspaceRoot)(sandboxConfig.provider);
|
|
1703
|
-
const scopeWorkspaceForAgent = async (workspace) => {
|
|
1704
|
-
if (!workspace)
|
|
1705
|
-
return undefined;
|
|
1706
|
-
const root = await (0, sandbox_1.getWorkspaceRoot)(workspace);
|
|
1707
|
-
return (0, agents_1.createScopedWorkspace)(workspace, root);
|
|
1708
|
-
};
|
|
1709
|
-
runtimeWorkspace = (0, instance_ai_1.createLazyRuntimeWorkspace)({
|
|
1710
|
-
sandboxInstructions: '',
|
|
1711
|
-
filesystemInstructions: '',
|
|
1712
|
-
ensureWorkspace: async () => await scopeWorkspaceForAgent((await this.sandboxService.getOrCreateWorkspace(threadId, user, context))?.workspace),
|
|
1713
|
-
});
|
|
1714
|
-
}
|
|
1715
|
-
}
|
|
1716
|
-
context.workspace = runtimeWorkspace;
|
|
1717
|
-
context.workspaceRoot = workspaceRoot;
|
|
1718
|
-
context.threadId = threadId;
|
|
1719
|
-
context.threadMemory = memory;
|
|
1720
|
-
context.trackTelemetry = (eventName, properties) => {
|
|
1721
|
-
this.telemetry.track(eventName, (0, telemetry_1.redactTelemetryProperties)(properties));
|
|
1722
|
-
};
|
|
1723
|
-
const orchestrationContext = {
|
|
1256
|
+
return await this.turnEnvironment.create({
|
|
1257
|
+
user,
|
|
1724
1258
|
threadId,
|
|
1725
1259
|
runId,
|
|
1260
|
+
abortSignal,
|
|
1726
1261
|
messageGroupId,
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1262
|
+
pushRef,
|
|
1263
|
+
proxyRunConfig,
|
|
1264
|
+
instanceContextGates,
|
|
1265
|
+
experimentGates,
|
|
1266
|
+
}, this.createTurnRuntime(user, threadId, runId));
|
|
1267
|
+
}
|
|
1268
|
+
createTurnRuntime(user, threadId, runId) {
|
|
1269
|
+
return {
|
|
1270
|
+
memory: this.agentMemory,
|
|
1271
|
+
resourceId: user.id,
|
|
1735
1272
|
eventBus: this.eventBus,
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1273
|
+
checkpointStore: this.checkpointStore,
|
|
1274
|
+
turnState: {
|
|
1275
|
+
getBuildMode: () => this.runState.getBuildMode(threadId),
|
|
1276
|
+
setBuildMode: (mode) => this.runState.setBuildMode(threadId, mode),
|
|
1277
|
+
getPromptVersion: () => this.runState.getPromptVersion(threadId),
|
|
1278
|
+
setPromptConfiguration: (configuration) => this.runState.setPromptConfiguration(threadId, configuration),
|
|
1279
|
+
setSetupPanelEnabled: (enabled) => this.runState.setSetupPanelEnabled(threadId, enabled),
|
|
1280
|
+
getBrowserUseAvailable: () => this.runState.getBrowserUseAvailable(threadId),
|
|
1281
|
+
getObserverThresholdTokens: () => this.runState.getObserverThresholdTokens(threadId),
|
|
1739
1282
|
},
|
|
1740
|
-
|
|
1283
|
+
sessionGrants: {
|
|
1284
|
+
load: async () => await this.loadThreadSessionGrants(threadId, user.id),
|
|
1285
|
+
grant: async (key) => await this.persistThreadSessionGrant(threadId, user.id, key),
|
|
1286
|
+
revoke: async (key) => await this.revokeThreadSessionGrant(threadId, user.id, key),
|
|
1287
|
+
},
|
|
1288
|
+
onDomainAccessTracker: (tracker) => {
|
|
1289
|
+
this.domainAccessTrackersByThread.set(threadId, tracker);
|
|
1290
|
+
},
|
|
1291
|
+
readSetupItemsSnapshots: async () => await this.eventLog.getSetupItemsSnapshots(threadId),
|
|
1292
|
+
markWorkflowSetupHandled: async (workflowId) => {
|
|
1293
|
+
await this.markWorkflowSetupHandled(threadId, workflowId, runId, {
|
|
1294
|
+
requirePersisted: true,
|
|
1295
|
+
});
|
|
1296
|
+
},
|
|
1297
|
+
browserCredentialSetup: this.createBrowserCredentialSetupTracker(runId, user.id),
|
|
1298
|
+
onArtifactChanged: async (artifact) => {
|
|
1741
1299
|
try {
|
|
1742
|
-
await this.
|
|
1300
|
+
await this.threadTabsService.showArtifactTab(threadId, user.id, artifact);
|
|
1743
1301
|
}
|
|
1744
1302
|
catch (error) {
|
|
1745
|
-
this.
|
|
1746
|
-
component: 'instance-ai-agent-builder-usage',
|
|
1303
|
+
this.logger.warn('Failed to show an Instance AI artifact tab', {
|
|
1747
1304
|
threadId,
|
|
1748
|
-
runId,
|
|
1749
|
-
userId: user.id,
|
|
1750
|
-
...(boundProjectId ? { projectId: boundProjectId } : {}),
|
|
1751
|
-
...(messageGroupId ? { messageGroupId } : {}),
|
|
1752
|
-
});
|
|
1753
|
-
this.logger.warn('Failed to claim agent-builder usage', {
|
|
1754
|
-
threadId,
|
|
1755
|
-
runId,
|
|
1756
|
-
dedupeId,
|
|
1757
1305
|
error: (0, get_error_message_1.getErrorMessage)(error),
|
|
1758
1306
|
});
|
|
1759
1307
|
}
|
|
1760
1308
|
},
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1309
|
+
recordWorkflowCodeSnapshot: this.isRunDebugEnabled()
|
|
1310
|
+
? (snapshot) => {
|
|
1311
|
+
this.runDebugBuffer.ensure(runId, threadId);
|
|
1312
|
+
this.runDebugBuffer.recordWorkflowCode(runId, snapshot);
|
|
1313
|
+
}
|
|
1314
|
+
: undefined,
|
|
1315
|
+
syncWorkflowTasks: async () => await this.taskProjector.syncFromWorkflowLoop(threadId, runId),
|
|
1316
|
+
sandbox: {
|
|
1317
|
+
resolveConfig: async () => await this.sandboxService.resolveSandboxConfig(user),
|
|
1318
|
+
getOrCreateWorkspace: async (context) => (await this.sandboxService.getOrCreateWorkspace(threadId, user, context))?.workspace,
|
|
1319
|
+
},
|
|
1768
1320
|
touchRun: () => this.runState.touchActiveRun(threadId),
|
|
1321
|
+
cancelBackgroundTask: async (taskId) => this.cancelBackgroundTask(threadId, taskId),
|
|
1769
1322
|
touchBackgroundTask: (taskId) => this.backgroundTasks.touchTask(threadId, taskId),
|
|
1770
|
-
plannedTaskService,
|
|
1771
|
-
schedulePlannedTasks: async () => await this.schedulePlannedTasks(user, threadId),
|
|
1772
|
-
iterationLog,
|
|
1773
1323
|
sendCorrectionToTask: (taskId, correction) => this.sendCorrectionToTask(threadId, taskId, correction),
|
|
1774
|
-
workflowTaskService: workflowTasks,
|
|
1775
|
-
workspace: runtimeWorkspace,
|
|
1776
|
-
workspaceRoot,
|
|
1777
|
-
nodeDefinitionDirs: nodeDefDirs.length > 0 ? nodeDefDirs : undefined,
|
|
1778
|
-
domainContext: context,
|
|
1779
|
-
};
|
|
1780
|
-
return {
|
|
1781
|
-
context,
|
|
1782
|
-
memory,
|
|
1783
|
-
taskStorage,
|
|
1784
|
-
iterationLog,
|
|
1785
|
-
workflowTasks,
|
|
1786
|
-
plannedTaskService,
|
|
1787
|
-
modelId,
|
|
1788
|
-
memoryModelId,
|
|
1789
|
-
orchestrationContext,
|
|
1790
|
-
conversationHistory,
|
|
1791
|
-
aiPreferencesEnabled,
|
|
1792
|
-
instanceContextEnabled,
|
|
1793
|
-
nodeUsageEnabled,
|
|
1794
|
-
skillScope,
|
|
1795
|
-
};
|
|
1796
|
-
}
|
|
1797
|
-
getAgentExecutionService() {
|
|
1798
|
-
if (!(0, agents_access_1.isAgentsAccessEnabled)())
|
|
1799
|
-
return null;
|
|
1800
|
-
try {
|
|
1801
|
-
return di_1.Container.get(agent_execution_service_1.AgentExecutionService);
|
|
1802
|
-
}
|
|
1803
|
-
catch {
|
|
1804
|
-
return null;
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1807
|
-
async bindAgentContextReader(context, user) {
|
|
1808
|
-
const projectId = context.projectId;
|
|
1809
|
-
if (!projectId)
|
|
1810
|
-
return;
|
|
1811
|
-
if (!(await (0, check_access_1.userHasScopes)(user, ['agent:read'], false, { projectId })))
|
|
1812
|
-
return;
|
|
1813
|
-
if (!(0, agents_access_1.isAgentsAccessEnabled)())
|
|
1814
|
-
return;
|
|
1815
|
-
context.agentContextService = di_1.Container.get(instance_ai_agent_context_adapter_1.InstanceAiAgentContextAdapterService).createReader(user, projectId);
|
|
1816
|
-
}
|
|
1817
|
-
async bindAgentPreviewSession(context, user) {
|
|
1818
|
-
await (0, instance_ai_1.resolveAgentPreviewSession)(context);
|
|
1819
|
-
const projectId = context.projectId;
|
|
1820
|
-
if (!context.agentPreviewSession || !projectId)
|
|
1821
|
-
return;
|
|
1822
|
-
if (!(0, agents_access_1.isAgentsAccessEnabled)()) {
|
|
1823
|
-
context.agentPreviewSession = undefined;
|
|
1824
|
-
return;
|
|
1825
|
-
}
|
|
1826
|
-
if (!(await this.canAccessAgentPreviewHandoff(user, projectId))) {
|
|
1827
|
-
context.agentPreviewSession = undefined;
|
|
1828
|
-
return;
|
|
1829
|
-
}
|
|
1830
|
-
context.resolvePreviewSession = async (ref) => {
|
|
1831
|
-
const service = this.getAgentExecutionService();
|
|
1832
|
-
if (!service)
|
|
1833
|
-
return null;
|
|
1834
|
-
const detail = await service.getThreadDetail(ref.threadId, projectId, ref.agentId, user.id);
|
|
1835
|
-
if (!detail)
|
|
1836
|
-
return null;
|
|
1837
|
-
const transcript = (0, format_preview_context_1.formatPreviewSessionContext)(detail.thread, detail.executions, ref.executionId);
|
|
1838
|
-
if (transcript === null)
|
|
1839
|
-
return null;
|
|
1840
|
-
return {
|
|
1841
|
-
title: detail.thread.title?.trim() || `Session #${detail.thread.sessionNumber}`,
|
|
1842
|
-
sessionNumber: detail.thread.sessionNumber,
|
|
1843
|
-
transcript,
|
|
1844
|
-
};
|
|
1845
1324
|
};
|
|
1846
1325
|
}
|
|
1847
|
-
async dispatchPlannedTask(task, context, _graph) {
|
|
1848
|
-
if (task.kind === 'build-workflow' || task.kind === 'checkpoint') {
|
|
1849
|
-
this.logger.warn('dispatchPlannedTask called for a runtime planned-task kind', {
|
|
1850
|
-
threadId: context.threadId,
|
|
1851
|
-
taskId: task.id,
|
|
1852
|
-
kind: task.kind,
|
|
1853
|
-
});
|
|
1854
|
-
return;
|
|
1855
|
-
}
|
|
1856
|
-
await context.plannedTaskService?.markFailed(context.threadId, task.id, {
|
|
1857
|
-
error: `Planned task kind "${task.kind}" is no longer supported`,
|
|
1858
|
-
});
|
|
1859
|
-
const nextGraph = await context.plannedTaskService?.getGraph(context.threadId);
|
|
1860
|
-
if (nextGraph) {
|
|
1861
|
-
await this.syncPlannedTasksToUi(context.threadId, nextGraph);
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
collectWorkflowIds(value, workflowIds) {
|
|
1865
|
-
if (value === null || value === undefined || typeof value !== 'object')
|
|
1866
|
-
return;
|
|
1867
|
-
if (Array.isArray(value)) {
|
|
1868
|
-
for (const item of value) {
|
|
1869
|
-
this.collectWorkflowIds(item, workflowIds);
|
|
1870
|
-
}
|
|
1871
|
-
return;
|
|
1872
|
-
}
|
|
1873
|
-
for (const [key, child] of Object.entries(value)) {
|
|
1874
|
-
if (key === 'workflowId' && typeof child === 'string' && child.length > 0) {
|
|
1875
|
-
workflowIds.add(child);
|
|
1876
|
-
continue;
|
|
1877
|
-
}
|
|
1878
|
-
if (key === 'supportingWorkflowIds' && Array.isArray(child)) {
|
|
1879
|
-
for (const workflowId of child) {
|
|
1880
|
-
if (typeof workflowId === 'string' && workflowId.length > 0) {
|
|
1881
|
-
workflowIds.add(workflowId);
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
continue;
|
|
1885
|
-
}
|
|
1886
|
-
this.collectWorkflowIds(child, workflowIds);
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
getBuildTaskWorkflowName(task) {
|
|
1890
|
-
if (task.kind !== 'build-workflow')
|
|
1891
|
-
return undefined;
|
|
1892
|
-
const titleMatch = task.title.match(/^Build '(.+)' workflow$/) ?? task.title.match(/^Build "(.+)" workflow$/);
|
|
1893
|
-
return titleMatch?.[1];
|
|
1894
|
-
}
|
|
1895
|
-
checkpointRequiresRunApproval(graph, _checkpoint) {
|
|
1896
|
-
return graph.postBuildRunApprovalRequired === true;
|
|
1897
|
-
}
|
|
1898
|
-
async getCheckpointRunPolicy(threadId, checkpointTaskId) {
|
|
1899
|
-
try {
|
|
1900
|
-
const { plannedTaskService } = await this.createPlannedTaskState();
|
|
1901
|
-
const graph = await plannedTaskService.getGraph(threadId);
|
|
1902
|
-
const checkpoint = graph?.tasks.find((t) => t.id === checkpointTaskId);
|
|
1903
|
-
if (!graph || !checkpoint) {
|
|
1904
|
-
return {
|
|
1905
|
-
allowedWorkflowIds: new Set(),
|
|
1906
|
-
allowedWorkflowNames: new Set(),
|
|
1907
|
-
requireApproval: false,
|
|
1908
|
-
};
|
|
1909
|
-
}
|
|
1910
|
-
const deps = new Set(checkpoint.deps);
|
|
1911
|
-
const ids = new Set();
|
|
1912
|
-
const names = new Set();
|
|
1913
|
-
for (const task of graph.tasks) {
|
|
1914
|
-
if (!deps.has(task.id))
|
|
1915
|
-
continue;
|
|
1916
|
-
const workflowName = this.getBuildTaskWorkflowName(task);
|
|
1917
|
-
if (workflowName) {
|
|
1918
|
-
names.add(workflowName);
|
|
1919
|
-
}
|
|
1920
|
-
if (task.workflowId) {
|
|
1921
|
-
ids.add(task.workflowId);
|
|
1922
|
-
}
|
|
1923
|
-
this.collectWorkflowIds(task.outcome, ids);
|
|
1924
|
-
}
|
|
1925
|
-
const tracing = this.tracing.getTraceContextForContinuation(threadId);
|
|
1926
|
-
for (const workflowId of [...ids]) {
|
|
1927
|
-
const remappedWorkflowId = tracing?.idRemapper?.remapOutput(workflowId);
|
|
1928
|
-
if (typeof remappedWorkflowId === 'string' && remappedWorkflowId.length > 0) {
|
|
1929
|
-
ids.add(remappedWorkflowId);
|
|
1930
|
-
}
|
|
1931
|
-
}
|
|
1932
|
-
return {
|
|
1933
|
-
allowedWorkflowIds: ids,
|
|
1934
|
-
allowedWorkflowNames: names,
|
|
1935
|
-
requireApproval: this.checkpointRequiresRunApproval(graph, checkpoint),
|
|
1936
|
-
};
|
|
1937
|
-
}
|
|
1938
|
-
catch (error) {
|
|
1939
|
-
this.logger.warn('Failed to resolve checkpoint allowed workflow IDs', {
|
|
1940
|
-
threadId,
|
|
1941
|
-
checkpointTaskId,
|
|
1942
|
-
error: error instanceof Error ? error.message : String(error),
|
|
1943
|
-
});
|
|
1944
|
-
return {
|
|
1945
|
-
allowedWorkflowIds: new Set(),
|
|
1946
|
-
allowedWorkflowNames: new Set(),
|
|
1947
|
-
requireApproval: false,
|
|
1948
|
-
};
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
async handlePlannedTaskSettlement(user, task, status, { reschedule = true } = {}) {
|
|
1952
|
-
if (!task.plannedTaskId)
|
|
1953
|
-
return;
|
|
1954
|
-
const { plannedTaskService } = await this.createPlannedTaskState();
|
|
1955
|
-
let graph = null;
|
|
1956
|
-
if (status === 'succeeded') {
|
|
1957
|
-
graph = await plannedTaskService.markSucceeded(task.threadId, task.plannedTaskId, {
|
|
1958
|
-
result: task.result,
|
|
1959
|
-
outcome: task.outcome,
|
|
1960
|
-
});
|
|
1961
|
-
}
|
|
1962
|
-
else if (status === 'failed') {
|
|
1963
|
-
graph = await plannedTaskService.markFailed(task.threadId, task.plannedTaskId, {
|
|
1964
|
-
error: task.error,
|
|
1965
|
-
});
|
|
1966
|
-
}
|
|
1967
|
-
else {
|
|
1968
|
-
graph = await plannedTaskService.markCancelled(task.threadId, task.plannedTaskId, {
|
|
1969
|
-
error: task.error,
|
|
1970
|
-
});
|
|
1971
|
-
}
|
|
1972
|
-
if (graph) {
|
|
1973
|
-
await this.syncPlannedTasksToUi(task.threadId, graph);
|
|
1974
|
-
}
|
|
1975
|
-
if (!reschedule)
|
|
1976
|
-
return;
|
|
1977
|
-
await this.schedulePlannedTasks(user, task.threadId);
|
|
1978
|
-
}
|
|
1979
|
-
async buildWorkflowSetupStateBlock(context) {
|
|
1980
|
-
const emitter = context.setupItemsEmitter;
|
|
1981
|
-
if (!emitter)
|
|
1982
|
-
return '';
|
|
1983
|
-
const workflowIds = emitter.workflowIds().reverse();
|
|
1984
|
-
if (workflowIds.length === 0)
|
|
1985
|
-
return '';
|
|
1986
|
-
try {
|
|
1987
|
-
const note = (0, instance_ai_1.formatWorkflowSetupStateNote)(await (0, instance_ai_1.observeWorkflowSetupStates)(context, workflowIds));
|
|
1988
|
-
return note
|
|
1989
|
-
? `${internal_messages_1.WORKFLOW_SETUP_STATE_OPEN_TAG}\n${note}\n${internal_messages_1.WORKFLOW_SETUP_STATE_CLOSE_TAG}`
|
|
1990
|
-
: '';
|
|
1991
|
-
}
|
|
1992
|
-
catch (error) {
|
|
1993
|
-
this.logger.warn('Failed to build the workflow setup state block', {
|
|
1994
|
-
threadId: context.threadId,
|
|
1995
|
-
error: error instanceof Error ? error.message : String(error),
|
|
1996
|
-
});
|
|
1997
|
-
return '';
|
|
1998
|
-
}
|
|
1999
|
-
}
|
|
2000
1326
|
buildWorkflowSetupFollowUpMessage(obligation) {
|
|
2001
1327
|
const payload = {
|
|
2002
1328
|
workflowId: obligation.workflowId,
|
|
@@ -2023,11 +1349,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2023
1349
|
for (const record of records) {
|
|
2024
1350
|
if (record.state.setupRoutedAt)
|
|
2025
1351
|
continue;
|
|
2026
|
-
|
|
2027
|
-
continue;
|
|
2028
|
-
const obligation = this.workflowObligations.obligationFromRecord(threadId, record, {
|
|
2029
|
-
source: 'direct',
|
|
2030
|
-
});
|
|
1352
|
+
const obligation = this.workflowObligations.obligationFromRecord(threadId, record);
|
|
2031
1353
|
if (obligation.workflowId !== workflowId)
|
|
2032
1354
|
continue;
|
|
2033
1355
|
if (obligation.setupRequirement?.status !== 'required')
|
|
@@ -2074,11 +1396,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2074
1396
|
for (const record of records) {
|
|
2075
1397
|
if (record.state.setupRoutedAt)
|
|
2076
1398
|
continue;
|
|
2077
|
-
|
|
2078
|
-
continue;
|
|
2079
|
-
const obligation = this.workflowObligations.obligationFromRecord(threadId, record, {
|
|
2080
|
-
source: 'direct',
|
|
2081
|
-
});
|
|
1399
|
+
const obligation = this.workflowObligations.obligationFromRecord(threadId, record);
|
|
2082
1400
|
const verificationConcluded = obligation.status === 'verified' ||
|
|
2083
1401
|
obligation.status === 'needs_setup' ||
|
|
2084
1402
|
obligation.status === 'not_verifiable';
|
|
@@ -2089,7 +1407,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2089
1407
|
const claim = await this.claimWorkItemSetupRouting(threadId, record);
|
|
2090
1408
|
if (!claim)
|
|
2091
1409
|
continue;
|
|
2092
|
-
const startedRunId = await this.startInternalFollowUpRun(user, threadId, this.buildWorkflowSetupFollowUpMessage(obligation), this.runState.getMessageGroupId(threadId),
|
|
1410
|
+
const startedRunId = await this.startInternalFollowUpRun(user, threadId, this.buildWorkflowSetupFollowUpMessage(obligation), this.runState.getMessageGroupId(threadId), 'workflow_setup');
|
|
2093
1411
|
if (startedRunId.length === 0) {
|
|
2094
1412
|
await this.releaseWorkItemSetupRoutingClaim(threadId, record.state.workItemId, claim.claimId);
|
|
2095
1413
|
return false;
|
|
@@ -2121,173 +1439,45 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2121
1439
|
async claimWorkItemSetupRouting(threadId, record) {
|
|
2122
1440
|
const claim = this.createWorkflowSetupRoutingClaim();
|
|
2123
1441
|
const claimed = await new instance_ai_1.WorkflowLoopStorage(this.agentMemory).claimSetupRouting(threadId, record.state.workItemId, claim);
|
|
2124
|
-
return claimed ? claim : null;
|
|
2125
|
-
}
|
|
2126
|
-
async markWorkItemSetupRouted(threadId, workItemId, claimId) {
|
|
2127
|
-
return await new instance_ai_1.WorkflowLoopStorage(this.agentMemory).markSetupRouted(threadId, workItemId, claimId, new Date().toISOString());
|
|
2128
|
-
}
|
|
2129
|
-
async releaseWorkItemSetupRoutingClaim(threadId, workItemId, claimId) {
|
|
2130
|
-
await new instance_ai_1.WorkflowLoopStorage(this.agentMemory).releaseSetupRoutingClaim(threadId, workItemId, claimId);
|
|
2131
|
-
}
|
|
2132
|
-
updateInternalFollowUpFailureStreak(threadId, status, isInternalFollowUp) {
|
|
2133
|
-
if (status === 'completed' || status === 'suspended') {
|
|
2134
|
-
this.failedInternalFollowUpStreaks.delete(threadId);
|
|
2135
|
-
return;
|
|
2136
|
-
}
|
|
2137
|
-
if (status === 'error' && isInternalFollowUp) {
|
|
2138
|
-
this.failedInternalFollowUpStreaks.set(threadId, (this.failedInternalFollowUpStreaks.get(threadId) ?? 0) + 1);
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
async startInternalFollowUpRun(user, threadId, message, messageGroupId, isReplanFollowUp = false, checkpoint, resumeReasonOverride, plannedBuild) {
|
|
2142
|
-
if (this.runState.hasLiveRun(threadId)) {
|
|
2143
|
-
this.logger.warn('Skipping internal follow-up: active run exists', { threadId });
|
|
2144
|
-
return '';
|
|
2145
|
-
}
|
|
2146
|
-
const failedStreak = this.failedInternalFollowUpStreaks.get(threadId) ?? 0;
|
|
2147
|
-
if (failedStreak >= MAX_CONSECUTIVE_FAILED_INTERNAL_FOLLOW_UPS) {
|
|
2148
|
-
this.logger.warn('Skipping internal follow-up: consecutive follow-up runs keep failing', {
|
|
2149
|
-
threadId,
|
|
2150
|
-
failedStreak,
|
|
2151
|
-
resumeReason: resumeReasonOverride,
|
|
2152
|
-
});
|
|
2153
|
-
return '';
|
|
2154
|
-
}
|
|
2155
|
-
const { runId, abortController } = this.runState.startRun({
|
|
2156
|
-
threadId,
|
|
2157
|
-
user,
|
|
2158
|
-
messageGroupId,
|
|
2159
|
-
});
|
|
2160
|
-
const timeZone = this.runState.getTimeZone(threadId) ?? this.defaultTimeZone;
|
|
2161
|
-
const resumeReason = resumeReasonOverride ??
|
|
2162
|
-
(checkpoint
|
|
2163
|
-
? 'planned_checkpoint'
|
|
2164
|
-
: isReplanFollowUp
|
|
2165
|
-
? 'replan'
|
|
2166
|
-
: 'background_task_completed');
|
|
2167
|
-
this.startExecuteRun(user, threadId, runId, message, abortController, undefined, undefined, messageGroupId, timeZone, isReplanFollowUp, checkpoint, resumeReason, plannedBuild);
|
|
2168
|
-
return runId;
|
|
2169
|
-
}
|
|
2170
|
-
async schedulePlannedTasks(user, threadId) {
|
|
2171
|
-
const prev = this.schedulerLocks.get(threadId) ?? Promise.resolve();
|
|
2172
|
-
const current = prev.then(() => this.doSchedulePlannedTasks(user, threadId)).catch(() => { });
|
|
2173
|
-
this.schedulerLocks.set(threadId, current);
|
|
2174
|
-
await current;
|
|
2175
|
-
}
|
|
2176
|
-
createPlannedTaskActionRunner(activeUser, threadId, plannedTaskService) {
|
|
2177
|
-
const scope = { user: activeUser, threadId };
|
|
2178
|
-
return new planned_task_action_runner_1.PlannedTaskActionRunner({
|
|
2179
|
-
scope,
|
|
2180
|
-
plannedTaskService,
|
|
2181
|
-
logger: this.logger,
|
|
2182
|
-
view: this.createPlannedTaskView(),
|
|
2183
|
-
runGate: this.createPlannedTaskRunGate(),
|
|
2184
|
-
dispatcher: this.createPlannedTaskDispatcher(),
|
|
2185
|
-
followUps: this.createPlannedTaskFollowUps(),
|
|
2186
|
-
workflowVerificationGate: this.createPlannedWorkflowVerificationGate(threadId),
|
|
2187
|
-
workflowVerificationTracker: this.createPlannedWorkflowVerificationTracker(),
|
|
2188
|
-
});
|
|
2189
|
-
}
|
|
2190
|
-
createPlannedTaskView() {
|
|
2191
|
-
return {
|
|
2192
|
-
sync: async (scope, graph) => await this.syncPlannedTasksToUi(scope.threadId, graph),
|
|
2193
|
-
};
|
|
2194
|
-
}
|
|
2195
|
-
createPlannedTaskRunGate() {
|
|
2196
|
-
return {
|
|
2197
|
-
hasLiveRun: (threadId) => this.runState.hasLiveRun(threadId),
|
|
2198
|
-
};
|
|
2199
|
-
}
|
|
2200
|
-
createPlannedTaskDispatcher() {
|
|
2201
|
-
return {
|
|
2202
|
-
dispatch: async ({ scope, graph, tasks }) => {
|
|
2203
|
-
const context = await this.createPlannedTaskDispatchContext(scope.user, scope.threadId, graph);
|
|
2204
|
-
for (const task of tasks) {
|
|
2205
|
-
await this.dispatchPlannedTask(task, context, graph);
|
|
2206
|
-
}
|
|
2207
|
-
},
|
|
2208
|
-
};
|
|
2209
|
-
}
|
|
2210
|
-
createPlannedTaskFollowUps() {
|
|
2211
|
-
return {
|
|
2212
|
-
startReplan: async ({ scope, graph, failedTask }) => await this.startInternalFollowUpRun(scope.user, scope.threadId, this.buildPlannedTaskFollowUpMessage('replan', graph, { failedTask }), graph.messageGroupId, true, undefined, undefined, undefined),
|
|
2213
|
-
startWorkflowVerification: async ({ scope, graph, verification }) => await this.startInternalFollowUpRun(scope.user, scope.threadId, this.buildWorkflowVerificationFollowUpMessage({
|
|
2214
|
-
obligation: verification.obligation,
|
|
2215
|
-
outcome: verification.outcome,
|
|
2216
|
-
sourceTask: this.toWorkflowVerificationSourceTask(verification),
|
|
2217
|
-
}), graph.messageGroupId, false, undefined, 'workflow_verification', undefined),
|
|
2218
|
-
startSynthesis: async ({ scope, graph }) => await this.startInternalFollowUpRun(scope.user, scope.threadId, this.buildPlannedTaskFollowUpMessage('synthesize', graph), graph.messageGroupId, false, undefined, 'synthesize', undefined),
|
|
2219
|
-
startWorkflowBuild: async ({ scope, graph, task, workItemId }) => {
|
|
2220
|
-
const plannedBuild = {
|
|
2221
|
-
isPlannedBuildFollowUp: true,
|
|
2222
|
-
buildTaskId: task.id,
|
|
2223
|
-
workItemId,
|
|
2224
|
-
isSupportingWorkflowTask: task.isSupportingWorkflow === true,
|
|
2225
|
-
};
|
|
2226
|
-
return await this.startInternalFollowUpRun(scope.user, scope.threadId, this.buildPlannedTaskFollowUpMessage('build-workflow', graph, { buildTask: task }), graph.messageGroupId, false, undefined, undefined, plannedBuild);
|
|
2227
|
-
},
|
|
2228
|
-
startCheckpoint: async ({ scope, graph, task }) => await this.startInternalFollowUpRun(scope.user, scope.threadId, this.buildPlannedTaskFollowUpMessage('checkpoint', graph, { checkpoint: task }), graph.messageGroupId, false, { isCheckpointFollowUp: true, checkpointTaskId: task.id }, undefined, undefined),
|
|
2229
|
-
};
|
|
2230
|
-
}
|
|
2231
|
-
createPlannedWorkflowVerificationGate(threadId) {
|
|
2232
|
-
return {
|
|
2233
|
-
revalidate: async (verification) => await this.workflowObligations.revalidatePlannedWorkflowVerification(threadId, verification),
|
|
2234
|
-
};
|
|
2235
|
-
}
|
|
2236
|
-
toWorkflowVerificationSourceTask(verification) {
|
|
2237
|
-
return {
|
|
2238
|
-
taskId: verification.task.backgroundTaskId ?? verification.task.id,
|
|
2239
|
-
role: 'workflow-builder',
|
|
2240
|
-
status: 'completed',
|
|
2241
|
-
result: verification.task.result,
|
|
2242
|
-
error: verification.task.error,
|
|
2243
|
-
plannedTaskId: verification.task.id,
|
|
2244
|
-
workItemId: verification.obligation.workItemId,
|
|
2245
|
-
};
|
|
2246
|
-
}
|
|
2247
|
-
createPlannedWorkflowVerificationTracker() {
|
|
2248
|
-
return {
|
|
2249
|
-
scheduled: ({ obligation }) => this.trackWorkflowVerificationObligation(obligation, 'planned_verification_scheduled'),
|
|
2250
|
-
followUpStartAttempted: ({ obligation }, started) => this.trackWorkflowVerificationObligation(obligation, 'follow_up_start_attempted', {
|
|
2251
|
-
follow_up_started: started,
|
|
2252
|
-
}),
|
|
2253
|
-
};
|
|
1442
|
+
return claimed ? claim : null;
|
|
2254
1443
|
}
|
|
2255
|
-
async
|
|
2256
|
-
|
|
2257
|
-
environment.orchestrationContext.tracing = this.tracing.getTraceContext(graph.planRunId);
|
|
2258
|
-
return environment.orchestrationContext;
|
|
1444
|
+
async markWorkItemSetupRouted(threadId, workItemId, claimId) {
|
|
1445
|
+
return await new instance_ai_1.WorkflowLoopStorage(this.agentMemory).markSetupRouted(threadId, workItemId, claimId, new Date().toISOString());
|
|
2259
1446
|
}
|
|
2260
|
-
async
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
});
|
|
2267
|
-
this.cancelRun(threadId);
|
|
1447
|
+
async releaseWorkItemSetupRoutingClaim(threadId, workItemId, claimId) {
|
|
1448
|
+
await new instance_ai_1.WorkflowLoopStorage(this.agentMemory).releaseSetupRoutingClaim(threadId, workItemId, claimId);
|
|
1449
|
+
}
|
|
1450
|
+
updateInternalFollowUpFailureStreak(threadId, status, isInternalFollowUp) {
|
|
1451
|
+
if (status === 'completed' || status === 'suspended') {
|
|
1452
|
+
this.failedInternalFollowUpStreaks.delete(threadId);
|
|
2268
1453
|
return;
|
|
2269
1454
|
}
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
1455
|
+
if (status === 'error' && isInternalFollowUp) {
|
|
1456
|
+
this.failedInternalFollowUpStreaks.set(threadId, (this.failedInternalFollowUpStreaks.get(threadId) ?? 0) + 1);
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
async startInternalFollowUpRun(user, threadId, message, messageGroupId, resumeReason) {
|
|
1460
|
+
if (this.runState.hasLiveRun(threadId)) {
|
|
1461
|
+
this.logger.warn('Skipping internal follow-up: active run exists', { threadId });
|
|
1462
|
+
return '';
|
|
1463
|
+
}
|
|
1464
|
+
const failedStreak = this.failedInternalFollowUpStreaks.get(threadId) ?? 0;
|
|
1465
|
+
if (failedStreak >= MAX_CONSECUTIVE_FAILED_INTERNAL_FOLLOW_UPS) {
|
|
1466
|
+
this.logger.warn('Skipping internal follow-up: consecutive follow-up runs keep failing', {
|
|
1467
|
+
threadId,
|
|
1468
|
+
failedStreak,
|
|
1469
|
+
resumeReason,
|
|
2284
1470
|
});
|
|
2285
|
-
|
|
2286
|
-
return;
|
|
2287
|
-
const result = await actionRunner.run(action);
|
|
2288
|
-
if (result.type !== 'continue-scheduling')
|
|
2289
|
-
return;
|
|
1471
|
+
return '';
|
|
2290
1472
|
}
|
|
1473
|
+
const { runId, abortController } = this.runState.startRun({
|
|
1474
|
+
threadId,
|
|
1475
|
+
user,
|
|
1476
|
+
messageGroupId,
|
|
1477
|
+
});
|
|
1478
|
+
const timeZone = this.runState.getTimeZone(threadId) ?? this.defaultTimeZone;
|
|
1479
|
+
this.startExecuteRun(user, threadId, runId, message, abortController, undefined, undefined, messageGroupId, timeZone, resumeReason);
|
|
1480
|
+
return runId;
|
|
2291
1481
|
}
|
|
2292
1482
|
async persistInterruptedUserMessage(threadId, userId, message, createdAt) {
|
|
2293
1483
|
if (!message)
|
|
@@ -2337,7 +1527,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2337
1527
|
return {};
|
|
2338
1528
|
}
|
|
2339
1529
|
}
|
|
2340
|
-
async executeRun(user, threadId, runId, message, abortController, attachments, handoffContext, messageGroupId, timeZone,
|
|
1530
|
+
async executeRun(user, threadId, runId, message, abortController, attachments, handoffContext, messageGroupId, timeZone, resumeReason, threadArtifacts) {
|
|
2341
1531
|
const fileAttachments = (attachments ?? []).filter((attachment) => attachment.type === 'file');
|
|
2342
1532
|
const experimentGates = await this.adapterService.resolveExperimentGates(user);
|
|
2343
1533
|
const contextAttachments = this.resolveContextAttachments(attachments, experimentGates.nodeContextEnabled);
|
|
@@ -2357,7 +1547,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2357
1547
|
let contextSegmentReported = false;
|
|
2358
1548
|
let blockedForQuota = false;
|
|
2359
1549
|
const observedContextWork = new instance_ai_1.WorkSummaryAccumulator();
|
|
2360
|
-
const contextEventBus = this.observeInstanceContextEvents(observedContextWork);
|
|
2361
1550
|
try {
|
|
2362
1551
|
errorReporterExecutionToken = this.instanceAiErrorReporter.beginRun(runId);
|
|
2363
1552
|
messageId = (0, nanoid_1.nanoid)();
|
|
@@ -2404,15 +1593,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2404
1593
|
userId: user.id,
|
|
2405
1594
|
input: traceInput,
|
|
2406
1595
|
resumeReason,
|
|
2407
|
-
metadata:
|
|
2408
|
-
...threadProvenance,
|
|
2409
|
-
...(checkpoint?.isCheckpointFollowUp
|
|
2410
|
-
? { checkpoint_task_id: checkpoint.checkpointTaskId }
|
|
2411
|
-
: {}),
|
|
2412
|
-
...(plannedBuild?.isPlannedBuildFollowUp
|
|
2413
|
-
? { build_task_id: plannedBuild.buildTaskId }
|
|
2414
|
-
: {}),
|
|
2415
|
-
},
|
|
1596
|
+
metadata: threadProvenance,
|
|
2416
1597
|
browserExtension,
|
|
2417
1598
|
});
|
|
2418
1599
|
}
|
|
@@ -2469,60 +1650,20 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2469
1650
|
}
|
|
2470
1651
|
const executionPushRef = this.threadPushRef.get(threadId);
|
|
2471
1652
|
const environment = await this.createExecutionEnvironment(user, threadId, runId, signal, messageGroupId, executionPushRef, proxyRunConfig, undefined, experimentGates);
|
|
2472
|
-
const { context,
|
|
1653
|
+
const { context, modelId: resolvedModelId, orchestrationContext, instanceContextEnabled, nodeUsageEnabled, } = environment;
|
|
1654
|
+
const contextEventBus = this.createRunEventBus(observedContextWork, orchestrationContext);
|
|
2473
1655
|
modelId = resolvedModelId;
|
|
2474
1656
|
promptVersion = orchestrationContext.promptConfiguration?.version;
|
|
2475
1657
|
(0, instance_ai_1.setTracePromptVersion)(tracing, promptVersion);
|
|
2476
1658
|
(0, instance_ai_1.setTraceModelId)(tracing, modelId);
|
|
2477
1659
|
aiCreatedWorkflowIds = context.aiCreatedWorkflowIds ??= new Set();
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
context.permissions = {
|
|
2486
|
-
...context.permissions,
|
|
2487
|
-
...(instance_ai_1.PLANNED_TASK_PERMISSION_OVERRIDES.checkpoint ?? {}),
|
|
2488
|
-
};
|
|
2489
|
-
const runPolicy = await this.getCheckpointRunPolicy(threadId, checkpoint.checkpointTaskId);
|
|
2490
|
-
context.allowedRunWorkflowIds = runPolicy.allowedWorkflowIds;
|
|
2491
|
-
context.allowedRunWorkflowNames = runPolicy.allowedWorkflowNames;
|
|
2492
|
-
context.requireRunWorkflowApproval = runPolicy.requireApproval;
|
|
2493
|
-
}
|
|
2494
|
-
if (plannedBuild?.isPlannedBuildFollowUp) {
|
|
2495
|
-
context.permissions = {
|
|
2496
|
-
...context.permissions,
|
|
2497
|
-
...(instance_ai_1.PLANNED_TASK_PERMISSION_OVERRIDES['build-workflow'] ?? {}),
|
|
2498
|
-
};
|
|
2499
|
-
context.workflowBuildContext = {
|
|
2500
|
-
threadId,
|
|
2501
|
-
runId,
|
|
2502
|
-
taskId: plannedBuild.buildTaskId,
|
|
2503
|
-
workItemId: plannedBuild.workItemId,
|
|
2504
|
-
allowPostPlanWorkflowCreate: true,
|
|
2505
|
-
isSupportingWorkflowTask: plannedBuild.isSupportingWorkflowTask,
|
|
2506
|
-
plannedTaskService,
|
|
2507
|
-
workflowTaskService: workflowTasks,
|
|
2508
|
-
onBuildOutcome: (outcome) => {
|
|
2509
|
-
plannedBuild.savedOutcome = outcome;
|
|
2510
|
-
},
|
|
2511
|
-
};
|
|
2512
|
-
}
|
|
2513
|
-
else {
|
|
2514
|
-
context.workflowBuildContext = {
|
|
2515
|
-
threadId,
|
|
2516
|
-
runId,
|
|
2517
|
-
taskId: `build-${runId}`,
|
|
2518
|
-
workItemId: `wi_${(0, nanoid_1.nanoid)(8)}`,
|
|
2519
|
-
allowPostPlanWorkflowCreate: isPostPlanFollowUp,
|
|
2520
|
-
workflowTaskService: workflowTasks,
|
|
2521
|
-
};
|
|
2522
|
-
}
|
|
2523
|
-
if (fileAttachments.length > 0) {
|
|
2524
|
-
context.currentUserAttachments = fileAttachments;
|
|
2525
|
-
}
|
|
1660
|
+
this.turnInput.applyTurnScope(environment, {
|
|
1661
|
+
threadId,
|
|
1662
|
+
runId,
|
|
1663
|
+
message,
|
|
1664
|
+
timeZone,
|
|
1665
|
+
fileAttachments,
|
|
1666
|
+
});
|
|
2526
1667
|
if (!tracing && process.env.E2E_TESTS === 'true') {
|
|
2527
1668
|
const { createTraceReplayOnlyContext } = await (0, lazy_import_1.lazyImport)(async () => await import('@n8n/instance-ai'));
|
|
2528
1669
|
tracing = createTraceReplayOnlyContext();
|
|
@@ -2536,151 +1677,35 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2536
1677
|
}
|
|
2537
1678
|
}
|
|
2538
1679
|
await this.snapshotAttachedAgents(contextAttachments, orchestrationContext, tracing);
|
|
2539
|
-
const
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
throw new n8n_workflow_1.UnexpectedError(`Instance AI thread "${threadId}" has no bound project; agent-preview handoff requires a project`);
|
|
2546
|
-
}
|
|
2547
|
-
await this.assertAgentPreviewHandoffScopes(user, projectId);
|
|
2548
|
-
const agentExecutionService = this.getAgentExecutionService();
|
|
2549
|
-
if (!agentExecutionService) {
|
|
2550
|
-
throw new n8n_workflow_1.UserError('Agent preview handoff is not available');
|
|
2551
|
-
}
|
|
2552
|
-
const resolved = await (0, agent_preview_handoff_1.resolveAgentPreviewHandoff)(handoffContext, {
|
|
2553
|
-
projectId,
|
|
2554
|
-
userId: user.id,
|
|
2555
|
-
getThreadDetail: agentExecutionService.getThreadDetail.bind(agentExecutionService),
|
|
2556
|
-
});
|
|
2557
|
-
handoffContextBlock = resolved.block;
|
|
2558
|
-
agentPreviewTitleFallback = resolved.titleFallback;
|
|
2559
|
-
context.agentBuilderTarget = resolved.target;
|
|
2560
|
-
context.agentPreviewSession = {
|
|
2561
|
-
agentId: handoffContext.agentId,
|
|
2562
|
-
threadId: handoffContext.threadId,
|
|
2563
|
-
...(handoffContext.executionId ? { executionId: handoffContext.executionId } : {}),
|
|
2564
|
-
};
|
|
2565
|
-
await (0, instance_ai_1.saveAgentBuilderTarget)(context, resolved.target, {
|
|
2566
|
-
previewSession: context.agentPreviewSession,
|
|
2567
|
-
});
|
|
2568
|
-
}
|
|
2569
|
-
else if (handoffContext?.source === 'setup-panel-execute' && (0, instance_ai_1.isSetupPanelEnabled)(context)) {
|
|
2570
|
-
handoffContextBlock = (0, internal_messages_1.buildWorkflowTestRequestBlock)(handoffContext.workflowId);
|
|
2571
|
-
}
|
|
2572
|
-
else {
|
|
2573
|
-
handoffContextBlock = buildHandoffContextBlock(handoffContext);
|
|
2574
|
-
}
|
|
2575
|
-
const setupStateBlock = resumeReason === undefined ? await this.buildWorkflowSetupStateBlock(context) : '';
|
|
2576
|
-
const thread = await memory.getThread(threadId);
|
|
2577
|
-
const unopenedOnboarding = thread?.metadata?.source === 'onboarding' && !thread.metadata.titleRefined;
|
|
2578
|
-
const isOpeningTurn = Boolean(thread && (!thread.title || unopenedOnboarding));
|
|
2579
|
-
const onboardingSkill = unopenedOnboarding
|
|
2580
|
-
? (await this.skillsService.loadSkill(instance_ai_skills_service_1.SKILLS.suggestAutomations, skillScope)).instructions
|
|
2581
|
-
: undefined;
|
|
2582
|
-
if (isOpeningTurn) {
|
|
2583
|
-
const handoffTitle = unopenedOnboarding
|
|
2584
|
-
? onboarding_opening_1.ONBOARDING_OPENING.title
|
|
2585
|
-
: (contextAttachments.find(isNamedResourceAttachment)?.name ?? agentPreviewTitleFallback);
|
|
2586
|
-
await (0, instance_ai_1.patchThread)(memory, {
|
|
2587
|
-
threadId,
|
|
2588
|
-
update: ({ metadata }) => handoffTitle
|
|
2589
|
-
? {
|
|
2590
|
-
title: (0, instance_ai_1.truncateToTitle)(handoffTitle),
|
|
2591
|
-
metadata: { ...metadata, titleRefined: true },
|
|
2592
|
-
}
|
|
2593
|
-
:
|
|
2594
|
-
{
|
|
2595
|
-
title: (0, instance_ai_1.truncateToTitle)(message) || (0, instance_ai_1.truncateToTitle)(fileAttachments[0]?.fileName ?? ''),
|
|
2596
|
-
},
|
|
2597
|
-
});
|
|
2598
|
-
}
|
|
2599
|
-
const isMachineFollowUp = checkpoint?.isCheckpointFollowUp === true || plannedBuild?.isPlannedBuildFollowUp === true;
|
|
2600
|
-
const instanceContext = await this.instanceContext.buildBlock({
|
|
1680
|
+
const turnInputRuntime = {
|
|
1681
|
+
eventBus: this.eventBus,
|
|
1682
|
+
resourceId: user.id,
|
|
1683
|
+
getRunningBackgroundTasks: () => this.backgroundTasks.getRunningTasks(threadId),
|
|
1684
|
+
};
|
|
1685
|
+
const turnInput = await this.turnInput.buildInput(environment, turnInputRuntime, {
|
|
2601
1686
|
user,
|
|
2602
|
-
scope: {
|
|
2603
|
-
surface: 'conversation',
|
|
2604
|
-
...(context.projectId !== undefined ? { projectId: context.projectId } : {}),
|
|
2605
|
-
},
|
|
2606
|
-
cursor: (0, instance_context_service_1.readInstanceContextCursor)(thread?.metadata),
|
|
2607
|
-
isMachineFollowUp,
|
|
2608
|
-
enabled: instanceContextEnabled,
|
|
2609
|
-
});
|
|
2610
|
-
const contextInjection = (0, instance_context_service_1.toContextInjection)(instanceContext);
|
|
2611
|
-
contextTurn = {
|
|
2612
|
-
userId: user.id,
|
|
2613
1687
|
threadId,
|
|
2614
1688
|
runId,
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
}
|
|
2636
|
-
let nonStructuredAttachments = [];
|
|
2637
|
-
let attachmentManifest = '';
|
|
2638
|
-
let hasParseableAttachment = false;
|
|
2639
|
-
if (fileAttachments.length > 0) {
|
|
2640
|
-
const classifiedAttachments = (0, instance_ai_1.classifyAttachments)(fileAttachments);
|
|
2641
|
-
nonStructuredAttachments = fileAttachments.filter((attachment) => !(0, instance_ai_1.isParseableAttachment)(attachment));
|
|
2642
|
-
turnHadFileAttachments = nonStructuredAttachments.length > 0;
|
|
2643
|
-
hasParseableAttachment = classifiedAttachments.some((attachment) => attachment.parseable);
|
|
2644
|
-
attachmentManifest = (0, instance_ai_1.buildAttachmentManifest)(classifiedAttachments);
|
|
2645
|
-
}
|
|
2646
|
-
const messageBody = !message && hasParseableAttachment
|
|
2647
|
-
? `The user attached file(s) without a message. Inspect the first parseable attachment with parse-file and provide a concise summary.\n\n${attachmentManifest}`
|
|
2648
|
-
: attachmentManifest
|
|
2649
|
-
? `${enrichedMessage}\n\n${attachmentManifest}`
|
|
2650
|
-
: enrichedMessage;
|
|
2651
|
-
let replayedHistory;
|
|
2652
|
-
const loadReplayedHistory = async () => await (replayedHistory ??= this.getReplayedMessages(threadId));
|
|
2653
|
-
const threadArtifactsBlock = resumeReason === undefined
|
|
2654
|
-
? await this.resolveThreadArtifactsTurn(threadId, threadArtifacts, contextAttachments, loadReplayedHistory)
|
|
2655
|
-
: '';
|
|
2656
|
-
const [boundProject, pastConversationsSection] = await Promise.all([
|
|
2657
|
-
this.resolveBoundProject(context),
|
|
2658
|
-
isOpeningTurn ? conversationHistory?.getPastConversationsSection() : undefined,
|
|
2659
|
-
]);
|
|
2660
|
-
const projectSection = boundProject ? (0, internal_messages_1.getProjectContextSection)(boundProject) : undefined;
|
|
2661
|
-
const aiPreferencesTurn = aiPreferencesEnabled && resumeReason === undefined && !isMachineFollowUp
|
|
2662
|
-
? await this.resolveAiPreferencesTurn(user.id, boundProject, threadId, loadReplayedHistory)
|
|
2663
|
-
: undefined;
|
|
2664
|
-
const threadContextBlock = (0, internal_messages_1.buildThreadContextBlock)([
|
|
2665
|
-
instanceContext.state === 'injected' ? instanceContext.block : '',
|
|
2666
|
-
onboardingSkill ? (0, internal_messages_1.buildOnboardingSkillBlock)(onboardingSkill) : undefined,
|
|
2667
|
-
threadArtifactsBlock,
|
|
2668
|
-
projectSection ? (0, internal_messages_1.buildProjectContextBlock)(projectSection) : undefined,
|
|
2669
|
-
resumeReason === undefined
|
|
2670
|
-
? (0, internal_messages_1.buildInstanceUrlsBlock)({
|
|
2671
|
-
webhookBaseUrl: this.webhookBaseUrl,
|
|
2672
|
-
formBaseUrl: this.formBaseUrl,
|
|
2673
|
-
})
|
|
2674
|
-
: undefined,
|
|
2675
|
-
pastConversationsSection
|
|
2676
|
-
? (0, internal_messages_1.buildPastConversationsBlock)(pastConversationsSection)
|
|
2677
|
-
: undefined,
|
|
2678
|
-
aiPreferencesTurn?.block,
|
|
2679
|
-
(0, internal_messages_1.buildCurrentDateTimeBlock)((0, instance_ai_1.getDateTimeSection)(timeZone ?? this.defaultTimeZone)),
|
|
2680
|
-
]);
|
|
2681
|
-
const fullMessage = [handoffContextBlock, setupStateBlock, threadContextBlock, messageBody]
|
|
2682
|
-
.filter(Boolean)
|
|
2683
|
-
.join('\n\n');
|
|
1689
|
+
message,
|
|
1690
|
+
fileAttachments,
|
|
1691
|
+
contextAttachments,
|
|
1692
|
+
handoffContext,
|
|
1693
|
+
timeZone,
|
|
1694
|
+
resumeReason,
|
|
1695
|
+
threadArtifacts,
|
|
1696
|
+
onInstanceContextInjection: (injection) => {
|
|
1697
|
+
contextTurn = {
|
|
1698
|
+
userId: user.id,
|
|
1699
|
+
threadId,
|
|
1700
|
+
runId,
|
|
1701
|
+
injection,
|
|
1702
|
+
instanceContextEnabled,
|
|
1703
|
+
nodeUsageEnabled,
|
|
1704
|
+
};
|
|
1705
|
+
},
|
|
1706
|
+
});
|
|
1707
|
+
const { fullMessage, nonStructuredAttachments, contextInjection, aiPreferencesTurn } = turnInput;
|
|
1708
|
+
turnHadFileAttachments = turnInput.turnHadFileAttachments;
|
|
2684
1709
|
const promptBuildRun = tracing
|
|
2685
1710
|
? await tracing.startChildRun(tracing.messageRun, {
|
|
2686
1711
|
name: 'prepare: prompt',
|
|
@@ -2695,25 +1720,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2695
1720
|
: undefined;
|
|
2696
1721
|
let streamInput;
|
|
2697
1722
|
try {
|
|
2698
|
-
|
|
2699
|
-
const baseContent = [
|
|
2700
|
-
{ type: 'text', text: fullMessage },
|
|
2701
|
-
...nonStructuredAttachments.map((attachment) => ({
|
|
2702
|
-
type: 'file',
|
|
2703
|
-
data: attachment.data,
|
|
2704
|
-
mediaType: attachment.mimeType,
|
|
2705
|
-
})),
|
|
2706
|
-
];
|
|
2707
|
-
streamInput = [
|
|
2708
|
-
{
|
|
2709
|
-
role: 'user',
|
|
2710
|
-
content: baseContent,
|
|
2711
|
-
},
|
|
2712
|
-
];
|
|
2713
|
-
}
|
|
2714
|
-
else {
|
|
2715
|
-
streamInput = fullMessage;
|
|
2716
|
-
}
|
|
1723
|
+
streamInput = (0, assistant_turn_input_builder_1.buildTurnStreamInput)(turnInput);
|
|
2717
1724
|
if (promptBuildRun && tracing) {
|
|
2718
1725
|
const traceOutput = typeof streamInput === 'string'
|
|
2719
1726
|
? { fullMessage: streamInput }
|
|
@@ -2757,29 +1764,11 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2757
1764
|
const agent = await this.createAgentFromEnvironment(environment, threadId, runId, user, tracing);
|
|
2758
1765
|
const streamOptions = this.buildOrchestratorAgentStreamOptions(user, threadId, runId, signal);
|
|
2759
1766
|
streamReached = true;
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
update: ({ metadata }) => ({
|
|
2766
|
-
metadata: { ...metadata, [instance_context_service_1.INSTANCE_CONTEXT_CURSOR]: injectedCursor },
|
|
2767
|
-
}),
|
|
2768
|
-
});
|
|
2769
|
-
}
|
|
2770
|
-
catch (error) {
|
|
2771
|
-
this.logger.warn('Failed to store the instance-context cursor', { error });
|
|
2772
|
-
}
|
|
2773
|
-
}
|
|
2774
|
-
if (aiPreferencesTurn) {
|
|
2775
|
-
this.eventBus.publish(threadId, {
|
|
2776
|
-
type: 'preferences-applied',
|
|
2777
|
-
runId,
|
|
2778
|
-
agentId: (0, instance_ai_1.orchestratorAgentId)(runId),
|
|
2779
|
-
userId: user.id,
|
|
2780
|
-
payload: aiPreferencesTurn.payload,
|
|
2781
|
-
});
|
|
2782
|
-
}
|
|
1767
|
+
await this.turnInput.onInputAccepted(environment, turnInputRuntime, turnInput, {
|
|
1768
|
+
user,
|
|
1769
|
+
threadId,
|
|
1770
|
+
runId,
|
|
1771
|
+
});
|
|
2783
1772
|
const result = tracing
|
|
2784
1773
|
? await tracing.withActiveSpan(tracing.actorRun, async () => {
|
|
2785
1774
|
return await (0, instance_ai_1.streamAgentRun)(agent, streamInput, streamOptions, {
|
|
@@ -2804,17 +1793,16 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2804
1793
|
stopSignal,
|
|
2805
1794
|
});
|
|
2806
1795
|
contextResult = result;
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
injected_this_turn: aiPreferencesTurn.payload.injectedThisTurn,
|
|
2815
|
-
turn_latency_ms: Date.now() - turnStartedAt.getTime(),
|
|
2816
|
-
...(result.usage ? { turn_token_count: result.usage.promptTokens } : {}),
|
|
1796
|
+
const preferencesApplied = aiPreferencesTurn &&
|
|
1797
|
+
(0, ai_preferences_telemetry_1.buildPreferencesAppliedTelemetry)(aiPreferencesTurn.payload, {
|
|
1798
|
+
userId: user.id,
|
|
1799
|
+
threadId,
|
|
1800
|
+
runId,
|
|
1801
|
+
latencyMs: Date.now() - turnStartedAt.getTime(),
|
|
1802
|
+
promptTokens: result.usage?.promptTokens,
|
|
2817
1803
|
});
|
|
1804
|
+
if (preferencesApplied) {
|
|
1805
|
+
this.telemetry.track(telemetry_1.TELEMETRY_EVENT.CONTEXT.PREFERENCES_APPLIED_TO_TURN, preferencesApplied);
|
|
2818
1806
|
}
|
|
2819
1807
|
if (result.status === 'suspended') {
|
|
2820
1808
|
this.emitRunMetrics(threadId, 'suspended', {
|
|
@@ -2856,8 +1844,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2856
1844
|
createdAt: Date.now(),
|
|
2857
1845
|
tracing,
|
|
2858
1846
|
modelId,
|
|
2859
|
-
checkpoint,
|
|
2860
|
-
plannedBuild,
|
|
2861
1847
|
runHandoff: runControl.state,
|
|
2862
1848
|
instanceContext: suspendedContext,
|
|
2863
1849
|
});
|
|
@@ -2871,7 +1857,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2871
1857
|
kind: 'suspended',
|
|
2872
1858
|
toolCallId: result.suspension.toolCallId,
|
|
2873
1859
|
checkpointKey: result.agentRunId,
|
|
2874
|
-
checkpointTaskId: checkpoint?.checkpointTaskId,
|
|
2875
1860
|
});
|
|
2876
1861
|
void this.creditService.claimRunUsage(user, threadId, `${result.agentRunId || runId}:${result.suspension.requestId}`, result.usage?.usage ?? [], 'suspended');
|
|
2877
1862
|
}
|
|
@@ -2977,8 +1962,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
2977
1962
|
workSummary: result.workSummary,
|
|
2978
1963
|
errorMessage: userFacingErrorMessage,
|
|
2979
1964
|
errorCode: userFacingErrorCode,
|
|
2980
|
-
suppressCompletedFallback: checkpoint?.isCheckpointFollowUp === true ||
|
|
2981
|
-
plannedBuild?.isPlannedBuildFollowUp === true,
|
|
2982
1965
|
});
|
|
2983
1966
|
}
|
|
2984
1967
|
const finalStatus = result.status === 'errored' ? 'error' : result.status;
|
|
@@ -3166,17 +2149,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
3166
2149
|
this.updateInternalFollowUpFailureStreak(threadId, messageTraceFinalization?.status, resumeReason !== undefined);
|
|
3167
2150
|
if (!segmentSuspended && !this.runState.hasSuspendedRun(threadId)) {
|
|
3168
2151
|
const reschedule = !signal.aborted && !blockedForQuota;
|
|
3169
|
-
if (checkpoint?.isCheckpointFollowUp) {
|
|
3170
|
-
await this.finalizeCheckpointFollowUp(user, threadId, checkpoint.checkpointTaskId, {
|
|
3171
|
-
reschedule,
|
|
3172
|
-
});
|
|
3173
|
-
}
|
|
3174
|
-
else if (plannedBuild?.isPlannedBuildFollowUp) {
|
|
3175
|
-
await this.finalizePlannedBuildFollowUp(user, threadId, plannedBuild, { reschedule });
|
|
3176
|
-
}
|
|
3177
|
-
else if (reschedule) {
|
|
3178
|
-
await this.schedulePlannedTasks(user, threadId);
|
|
3179
|
-
}
|
|
3180
2152
|
await this.taskProjector.syncFromWorkflowLoop(threadId, runId);
|
|
3181
2153
|
if (reschedule) {
|
|
3182
2154
|
await this.maybeStartWorkflowSetupFollowUp(user, threadId);
|
|
@@ -3187,84 +2159,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
3187
2159
|
}
|
|
3188
2160
|
}
|
|
3189
2161
|
}
|
|
3190
|
-
async finalizeCheckpointFollowUp(user, threadId, checkpointTaskId, { reschedule = true } = {}) {
|
|
3191
|
-
try {
|
|
3192
|
-
const { plannedTaskService } = await this.createPlannedTaskState();
|
|
3193
|
-
const graph = await plannedTaskService.getGraph(threadId);
|
|
3194
|
-
const task = graph?.tasks.find((t) => t.id === checkpointTaskId);
|
|
3195
|
-
if (task && task.status === 'running') {
|
|
3196
|
-
const inflightChildren = this.backgroundTasks.getRunningTasksByParentCheckpoint(threadId, checkpointTaskId);
|
|
3197
|
-
if (inflightChildren.length > 0) {
|
|
3198
|
-
this.logger.debug('Checkpoint run ended with in-flight child tasks — deferring finalization', {
|
|
3199
|
-
threadId,
|
|
3200
|
-
checkpointTaskId,
|
|
3201
|
-
inflightTaskIds: inflightChildren.map((t) => t.taskId),
|
|
3202
|
-
});
|
|
3203
|
-
}
|
|
3204
|
-
else {
|
|
3205
|
-
this.logger.warn('Checkpoint run ended without reporting completion — marking failed', {
|
|
3206
|
-
threadId,
|
|
3207
|
-
checkpointTaskId,
|
|
3208
|
-
});
|
|
3209
|
-
await plannedTaskService.markCheckpointFailed(threadId, checkpointTaskId, {
|
|
3210
|
-
error: 'Checkpoint run ended without reporting completion',
|
|
3211
|
-
});
|
|
3212
|
-
const nextGraph = await plannedTaskService.getGraph(threadId);
|
|
3213
|
-
if (nextGraph) {
|
|
3214
|
-
await this.syncPlannedTasksToUi(threadId, nextGraph);
|
|
3215
|
-
}
|
|
3216
|
-
}
|
|
3217
|
-
}
|
|
3218
|
-
}
|
|
3219
|
-
catch (error) {
|
|
3220
|
-
this.logger.error('Checkpoint finalization failed', {
|
|
3221
|
-
threadId,
|
|
3222
|
-
checkpointTaskId,
|
|
3223
|
-
error: error instanceof Error ? error.message : String(error),
|
|
3224
|
-
});
|
|
3225
|
-
}
|
|
3226
|
-
if (!reschedule)
|
|
3227
|
-
return;
|
|
3228
|
-
await this.schedulePlannedTasks(user, threadId);
|
|
3229
|
-
}
|
|
3230
|
-
async finalizePlannedBuildFollowUp(user, threadId, plannedBuild, { reschedule = true } = {}) {
|
|
3231
|
-
try {
|
|
3232
|
-
const { plannedTaskService } = await this.createPlannedTaskState();
|
|
3233
|
-
const graph = await plannedTaskService.getGraph(threadId);
|
|
3234
|
-
const task = graph?.tasks.find((t) => t.id === plannedBuild.buildTaskId);
|
|
3235
|
-
if (task && task.status === 'running') {
|
|
3236
|
-
if (plannedBuild.savedOutcome?.submitted === true) {
|
|
3237
|
-
await plannedTaskService.markSucceeded(threadId, plannedBuild.buildTaskId, {
|
|
3238
|
-
result: plannedBuild.savedOutcome.summary,
|
|
3239
|
-
outcome: plannedBuild.savedOutcome,
|
|
3240
|
-
});
|
|
3241
|
-
}
|
|
3242
|
-
else {
|
|
3243
|
-
this.logger.warn('Build workflow follow-up ended without saving — marking failed', {
|
|
3244
|
-
threadId,
|
|
3245
|
-
buildTaskId: plannedBuild.buildTaskId,
|
|
3246
|
-
});
|
|
3247
|
-
await plannedTaskService.markFailed(threadId, plannedBuild.buildTaskId, {
|
|
3248
|
-
error: 'Workflow build run ended without saving a workflow',
|
|
3249
|
-
});
|
|
3250
|
-
}
|
|
3251
|
-
const nextGraph = await plannedTaskService.getGraph(threadId);
|
|
3252
|
-
if (nextGraph) {
|
|
3253
|
-
await this.syncPlannedTasksToUi(threadId, nextGraph);
|
|
3254
|
-
}
|
|
3255
|
-
}
|
|
3256
|
-
}
|
|
3257
|
-
catch (error) {
|
|
3258
|
-
this.logger.error('Build workflow finalization failed', {
|
|
3259
|
-
threadId,
|
|
3260
|
-
buildTaskId: plannedBuild.buildTaskId,
|
|
3261
|
-
error: error instanceof Error ? error.message : String(error),
|
|
3262
|
-
});
|
|
3263
|
-
}
|
|
3264
|
-
if (!reschedule)
|
|
3265
|
-
return;
|
|
3266
|
-
await this.schedulePlannedTasks(user, threadId);
|
|
3267
|
-
}
|
|
3268
2162
|
async resolveConfirmation(requestingUserId, requestId, request) {
|
|
3269
2163
|
const data = (0, confirmation_payload_1.toConfirmationData)(request);
|
|
3270
2164
|
const freshUser = await this.revalidateActiveUser(requestingUserId);
|
|
@@ -3309,60 +2203,15 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
3309
2203
|
}
|
|
3310
2204
|
return await this.suspendedRunRestorer.resolveOrphanedConfirmation(requestingUserId, requestId, data);
|
|
3311
2205
|
}
|
|
3312
|
-
async buildMcpServers(user, threadId, runId, tracing, messageGroupId) {
|
|
3313
|
-
const staticMcpServers = this.parseMcpServers(this.instanceAiConfig.mcpServers);
|
|
3314
|
-
const registryMcpServers = this.settingsService.isMcpAccessEnabled()
|
|
3315
|
-
? await this.instanceAiErrorReporter.withBoundary('instance-ai-mcp-setup', {
|
|
3316
|
-
threadId,
|
|
3317
|
-
runId,
|
|
3318
|
-
tracing,
|
|
3319
|
-
agentId: (0, instance_ai_1.orchestratorAgentId)(runId),
|
|
3320
|
-
userId: user.id,
|
|
3321
|
-
messageGroupId,
|
|
3322
|
-
}, async () => await this.mcpRegistryService.getRegistryMcpServers(user))
|
|
3323
|
-
: [];
|
|
3324
|
-
return [...staticMcpServers, ...registryMcpServers];
|
|
3325
|
-
}
|
|
3326
2206
|
async createAgentFromEnvironment(environment, threadId, runId, user, tracing) {
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
}
|
|
3330
|
-
await this.bindAgentContextReader(environment.context, user);
|
|
3331
|
-
await this.bindAgentPreviewSession(environment.context, user);
|
|
3332
|
-
const mcpServers = await this.buildMcpServers(user, threadId, runId, tracing, environment.orchestrationContext.messageGroupId);
|
|
3333
|
-
const { agent, mcpConnectionFailures } = await (0, instance_ai_1.createInstanceAgent)({
|
|
3334
|
-
modelId: environment.modelId,
|
|
3335
|
-
context: environment.context,
|
|
3336
|
-
orchestrationContext: environment.orchestrationContext,
|
|
3337
|
-
mcpServers,
|
|
3338
|
-
mcpManager: this.mcpClientManager,
|
|
3339
|
-
memoryConfig: this.createAgentMemoryOptions(user, threadId, runId, environment.memoryModelId),
|
|
3340
|
-
memory: environment.memory,
|
|
2207
|
+
return await this.agentFactory.createAgent(environment, {
|
|
2208
|
+
eventBus: this.eventBus,
|
|
3341
2209
|
checkpointStore: this.checkpointStore,
|
|
3342
2210
|
onMemoryTaskEvent: this.memoryTaskObserverFor(threadId, tracing),
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
for (const failure of mcpConnectionFailures) {
|
|
3348
|
-
this.errorReporter.error(new Error(`MCP server "${failure.server}" failed to connect: ${failure.error}`), {
|
|
3349
|
-
level: 'warning',
|
|
3350
|
-
tags: { component: 'instance-ai-mcp', server: failure.server },
|
|
3351
|
-
extra: { runId, threadId, server: failure.server, error: failure.error },
|
|
3352
|
-
shouldIsolate: true,
|
|
3353
|
-
});
|
|
3354
|
-
}
|
|
3355
|
-
this.eventBus.publish(threadId, {
|
|
3356
|
-
type: 'status',
|
|
3357
|
-
runId,
|
|
3358
|
-
agentId: (0, instance_ai_1.orchestratorAgentId)(runId),
|
|
3359
|
-
payload: {
|
|
3360
|
-
message: `Couldn't reach MCP server${mcpConnectionFailures.length > 1 ? 's' : ''} ${names}; continuing without their tools.`,
|
|
3361
|
-
},
|
|
3362
|
-
});
|
|
3363
|
-
}
|
|
3364
|
-
this.subscribeToAgentErrors(agent, threadId, runId);
|
|
3365
|
-
return agent;
|
|
2211
|
+
turnState: {
|
|
2212
|
+
getObserverThresholdTokens: () => this.runState.getObserverThresholdTokens(threadId),
|
|
2213
|
+
},
|
|
2214
|
+
}, { user, threadId, runId, tracing });
|
|
3366
2215
|
}
|
|
3367
2216
|
async buildFreshInstanceAgent(user, threadId, runId, abortSignal, tracing, messageGroupId, pushRef, instanceContextGates) {
|
|
3368
2217
|
const environment = await this.createExecutionEnvironment(user, threadId, runId, abortSignal, messageGroupId, pushRef, undefined, instanceContextGates);
|
|
@@ -3437,9 +2286,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
3437
2286
|
createdAt: Date.now(),
|
|
3438
2287
|
tracing: undefined,
|
|
3439
2288
|
modelId: environment.modelId,
|
|
3440
|
-
checkpoint: orphan.checkpointTaskId
|
|
3441
|
-
? { isCheckpointFollowUp: true, checkpointTaskId: orphan.checkpointTaskId }
|
|
3442
|
-
: undefined,
|
|
3443
2289
|
runHandoff: runControl.state,
|
|
3444
2290
|
},
|
|
3445
2291
|
};
|
|
@@ -3463,157 +2309,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
3463
2309
|
return null;
|
|
3464
2310
|
}
|
|
3465
2311
|
}
|
|
3466
|
-
async resolveBoundProject(context) {
|
|
3467
|
-
const projectId = context.projectId;
|
|
3468
|
-
if (!projectId)
|
|
3469
|
-
return undefined;
|
|
3470
|
-
try {
|
|
3471
|
-
const project = await context.workspaceService?.getProject?.(projectId);
|
|
3472
|
-
if (project)
|
|
3473
|
-
return project;
|
|
3474
|
-
this.logger.warn('Instance AI could not name the bound project for this turn', {
|
|
3475
|
-
projectId,
|
|
3476
|
-
reason: context.workspaceService?.getProject ? 'not-readable' : 'no-workspace-adapter',
|
|
3477
|
-
});
|
|
3478
|
-
return undefined;
|
|
3479
|
-
}
|
|
3480
|
-
catch (error) {
|
|
3481
|
-
this.logger.warn('Instance AI failed to resolve the bound project for this turn', {
|
|
3482
|
-
projectId,
|
|
3483
|
-
error: error instanceof Error ? error.message : String(error),
|
|
3484
|
-
});
|
|
3485
|
-
this.errorReporter.error(error, {
|
|
3486
|
-
level: 'warning',
|
|
3487
|
-
tags: { component: 'instance-ai-project-context' },
|
|
3488
|
-
extra: { projectId },
|
|
3489
|
-
shouldIsolate: true,
|
|
3490
|
-
});
|
|
3491
|
-
return undefined;
|
|
3492
|
-
}
|
|
3493
|
-
}
|
|
3494
|
-
async resolveAiPreferencesTurn(userId, project, threadId, loadHistory = async () => await this.getReplayedMessages(threadId)) {
|
|
3495
|
-
const resolved = await this.bestEffort('Instance AI failed to read the AI preferences for this turn', { userId }, async () => {
|
|
3496
|
-
const preferences = await this.aiPreferenceService.getApplicable(userId, project ? [project] : []);
|
|
3497
|
-
return { preferences, rendered: (0, ai_preference_service_1.renderAiPreferencesBlock)(preferences) };
|
|
3498
|
-
});
|
|
3499
|
-
if (!resolved) {
|
|
3500
|
-
return {
|
|
3501
|
-
block: undefined,
|
|
3502
|
-
payload: { preferences: [], renderedLength: 0, injectedThisTurn: false },
|
|
3503
|
-
};
|
|
3504
|
-
}
|
|
3505
|
-
const history = await this.bestEffort('Instance AI failed to read the last AI preferences block of this thread', { threadId }, async () => await this.findAiPreferencesHistory(loadHistory));
|
|
3506
|
-
const lastBlock = history?.block;
|
|
3507
|
-
const savedSinceLastBlock = history?.savedSinceLastBlock === true;
|
|
3508
|
-
const { preferences, rendered } = resolved;
|
|
3509
|
-
const freshBlock = rendered ??
|
|
3510
|
-
(lastBlock !== undefined || savedSinceLastBlock ? ai_preference_service_1.AI_PREFERENCES_CLEARED_BLOCK : undefined);
|
|
3511
|
-
if (freshBlock === undefined) {
|
|
3512
|
-
return {
|
|
3513
|
-
block: undefined,
|
|
3514
|
-
payload: (0, ai_preference_service_1.buildAppliedPreferencesPayload)({
|
|
3515
|
-
preferences,
|
|
3516
|
-
renderedLength: 0,
|
|
3517
|
-
injectedThisTurn: false,
|
|
3518
|
-
}),
|
|
3519
|
-
};
|
|
3520
|
-
}
|
|
3521
|
-
if (!savedSinceLastBlock &&
|
|
3522
|
-
lastBlock !== undefined &&
|
|
3523
|
-
(0, internal_messages_1.asStoredThreadContextSection)(freshBlock) === lastBlock) {
|
|
3524
|
-
const carriedFromRunId = await this.bestEffort('Instance AI failed to resolve which run sent the AI preferences block', { threadId }, async () => await this.eventLog.getLastPreferencesInjectionRunId(threadId));
|
|
3525
|
-
return {
|
|
3526
|
-
block: undefined,
|
|
3527
|
-
payload: (0, ai_preference_service_1.buildAppliedPreferencesPayload)({
|
|
3528
|
-
preferences,
|
|
3529
|
-
renderedLength: freshBlock.length,
|
|
3530
|
-
injectedThisTurn: false,
|
|
3531
|
-
...(carriedFromRunId ? { carriedFromRunId } : {}),
|
|
3532
|
-
}),
|
|
3533
|
-
};
|
|
3534
|
-
}
|
|
3535
|
-
return {
|
|
3536
|
-
block: freshBlock,
|
|
3537
|
-
payload: (0, ai_preference_service_1.buildAppliedPreferencesPayload)({
|
|
3538
|
-
preferences,
|
|
3539
|
-
renderedLength: freshBlock.length,
|
|
3540
|
-
injectedThisTurn: true,
|
|
3541
|
-
}),
|
|
3542
|
-
};
|
|
3543
|
-
}
|
|
3544
|
-
async findAiPreferencesHistory(loadHistory) {
|
|
3545
|
-
const history = await loadHistory();
|
|
3546
|
-
let savedSinceLastBlock = false;
|
|
3547
|
-
for (let i = history.length - 1; i >= 0; i--) {
|
|
3548
|
-
const m = history[i];
|
|
3549
|
-
if (!('role' in m))
|
|
3550
|
-
continue;
|
|
3551
|
-
if (m.role === 'assistant' && Array.isArray(m.content)) {
|
|
3552
|
-
savedSinceLastBlock ||= m.content.some((part) => part.type === 'tool-call' &&
|
|
3553
|
-
part.toolName === 'save_user_preference' &&
|
|
3554
|
-
part.state === 'resolved' &&
|
|
3555
|
-
(0, is_record_1.isRecord)(part.output) &&
|
|
3556
|
-
part.output.ok === true);
|
|
3557
|
-
}
|
|
3558
|
-
if (m.role !== 'user')
|
|
3559
|
-
continue;
|
|
3560
|
-
const block = (0, internal_messages_1.extractAiPreferencesBlock)(this.extractStoredMessageText(m.content));
|
|
3561
|
-
if (block !== undefined)
|
|
3562
|
-
return { block, savedSinceLastBlock };
|
|
3563
|
-
}
|
|
3564
|
-
return { savedSinceLastBlock };
|
|
3565
|
-
}
|
|
3566
|
-
async resolveThreadArtifactsTurn(threadId, context, attachments, loadHistory) {
|
|
3567
|
-
const freshBlock = (0, internal_messages_1.buildThreadArtifactsBlock)(context, attachments);
|
|
3568
|
-
if (!freshBlock)
|
|
3569
|
-
return '';
|
|
3570
|
-
if (attachments.length > 0)
|
|
3571
|
-
return freshBlock;
|
|
3572
|
-
const history = await this.bestEffort('Instance AI failed to read the last thread artifacts block of this thread', { threadId }, async () => ({ block: await this.findLastThreadArtifactsBlock(loadHistory) }));
|
|
3573
|
-
if (!history)
|
|
3574
|
-
return freshBlock;
|
|
3575
|
-
return (0, internal_messages_1.asStoredThreadContextSection)(freshBlock) === history.block ? '' : freshBlock;
|
|
3576
|
-
}
|
|
3577
|
-
async findLastThreadArtifactsBlock(loadHistory) {
|
|
3578
|
-
const history = await loadHistory();
|
|
3579
|
-
for (let i = history.length - 1; i >= 0; i--) {
|
|
3580
|
-
const m = history[i];
|
|
3581
|
-
if (!('role' in m) || m.role !== 'user')
|
|
3582
|
-
continue;
|
|
3583
|
-
const block = (0, internal_messages_1.extractThreadArtifactsBlock)(this.extractStoredMessageText(m.content));
|
|
3584
|
-
if (block !== undefined)
|
|
3585
|
-
return block;
|
|
3586
|
-
}
|
|
3587
|
-
return undefined;
|
|
3588
|
-
}
|
|
3589
|
-
async getReplayedMessages(threadId) {
|
|
3590
|
-
const cursor = await this.agentMemory.getCursor(threadId);
|
|
3591
|
-
if (cursor) {
|
|
3592
|
-
const observations = await this.agentMemory.getActiveObservationLog({
|
|
3593
|
-
observationScopeId: threadId,
|
|
3594
|
-
limit: 1,
|
|
3595
|
-
order: 'desc',
|
|
3596
|
-
});
|
|
3597
|
-
if (observations.length > 0) {
|
|
3598
|
-
return await this.agentMemory.getMessagesForObservationScope(threadId, {
|
|
3599
|
-
since: {
|
|
3600
|
-
sinceCreatedAt: cursor.lastObservedAt,
|
|
3601
|
-
sinceMessageId: cursor.lastObservedMessageId,
|
|
3602
|
-
},
|
|
3603
|
-
});
|
|
3604
|
-
}
|
|
3605
|
-
}
|
|
3606
|
-
return await this.agentMemory.getMessages(threadId);
|
|
3607
|
-
}
|
|
3608
|
-
async canAccessAgentPreviewHandoff(user, projectId) {
|
|
3609
|
-
const requiredScopes = ['agent:read', 'agent:update'];
|
|
3610
|
-
return await (0, check_access_1.userHasScopes)(user, requiredScopes, false, { projectId });
|
|
3611
|
-
}
|
|
3612
|
-
async assertAgentPreviewHandoffScopes(user, projectId) {
|
|
3613
|
-
if (!(await this.canAccessAgentPreviewHandoff(user, projectId))) {
|
|
3614
|
-
throw new errors_1.ForbiddenError('You do not have permission to load or edit agent previews in this project.');
|
|
3615
|
-
}
|
|
3616
|
-
}
|
|
3617
2312
|
async rebuildAgentForResume(user, threadId, runId, abortController, tracing, runHandoff, messageGroupId, instanceContextGates) {
|
|
3618
2313
|
try {
|
|
3619
2314
|
const rebuilt = await this.buildFreshInstanceAgent(user, threadId, runId, abortController.signal, tracing, messageGroupId, this.threadPushRef.get(threadId), instanceContextGates);
|
|
@@ -3642,7 +2337,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
3642
2337
|
});
|
|
3643
2338
|
return null;
|
|
3644
2339
|
}
|
|
3645
|
-
const { agent, runId, agentRunId, threadId, user, toolCallId, toolName, suspendPayload, abortController, tracing, modelId, messageGroupId,
|
|
2340
|
+
const { agent, runId, agentRunId, threadId, user, toolCallId, toolName, suspendPayload, abortController, tracing, modelId, messageGroupId, runHandoff, orchestrationContext, instanceContext, } = suspended;
|
|
3646
2341
|
if (user.id !== requestingUserId)
|
|
3647
2342
|
return null;
|
|
3648
2343
|
const activeRun = this.runState.getActiveRun(threadId);
|
|
@@ -3695,12 +2390,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
3695
2390
|
request_id: requestId,
|
|
3696
2391
|
pending_tool_call_id: toolCallId,
|
|
3697
2392
|
approved: data.approved,
|
|
3698
|
-
...(checkpoint?.isCheckpointFollowUp
|
|
3699
|
-
? { checkpoint_task_id: checkpoint.checkpointTaskId }
|
|
3700
|
-
: {}),
|
|
3701
|
-
...(plannedBuild?.isPlannedBuildFollowUp
|
|
3702
|
-
? { build_task_id: plannedBuild.buildTaskId }
|
|
3703
|
-
: {}),
|
|
3704
2393
|
},
|
|
3705
2394
|
browserExtension: this.browserSessionService.getExtensionTraceContext(activeUser.id),
|
|
3706
2395
|
register: false,
|
|
@@ -3753,8 +2442,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
3753
2442
|
tracing: effectiveTracing,
|
|
3754
2443
|
orchestrationContext: resumeOrchestrationContext,
|
|
3755
2444
|
modelId: resumeModelId,
|
|
3756
|
-
checkpoint,
|
|
3757
|
-
plannedBuild,
|
|
3758
2445
|
runHandoff,
|
|
3759
2446
|
resumeExecutionToken,
|
|
3760
2447
|
messageGroupId,
|
|
@@ -3780,7 +2467,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
3780
2467
|
let contextSegmentReported = false;
|
|
3781
2468
|
let blockedForQuota = false;
|
|
3782
2469
|
const observedContextWork = new instance_ai_1.WorkSummaryAccumulator();
|
|
3783
|
-
const contextEventBus = this.
|
|
2470
|
+
const contextEventBus = this.createRunEventBus(observedContextWork, opts.orchestrationContext);
|
|
3784
2471
|
let resumedRunProducedOutput = false;
|
|
3785
2472
|
const onResumeClaimed = async () => {
|
|
3786
2473
|
if (resumeClaimed)
|
|
@@ -3891,8 +2578,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
3891
2578
|
createdAt: Date.now(),
|
|
3892
2579
|
tracing: opts.tracing,
|
|
3893
2580
|
...(opts.modelId !== undefined ? { modelId: opts.modelId } : {}),
|
|
3894
|
-
checkpoint: opts.checkpoint,
|
|
3895
|
-
plannedBuild: opts.plannedBuild,
|
|
3896
2581
|
runHandoff: runControl.state,
|
|
3897
2582
|
instanceContext: suspendedContext,
|
|
3898
2583
|
});
|
|
@@ -3906,7 +2591,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
3906
2591
|
kind: 'suspended',
|
|
3907
2592
|
toolCallId: result.suspension.toolCallId,
|
|
3908
2593
|
checkpointKey: result.agentRunId,
|
|
3909
|
-
checkpointTaskId: opts.checkpoint?.checkpointTaskId,
|
|
3910
2594
|
});
|
|
3911
2595
|
void this.creditService.claimRunUsage(opts.user, opts.threadId, `${result.agentRunId || opts.runId}:${result.suspension.requestId}`, result.usage?.usage ?? [], 'suspended');
|
|
3912
2596
|
}
|
|
@@ -4016,8 +2700,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
4016
2700
|
workSummary: result.workSummary,
|
|
4017
2701
|
errorMessage: userFacingErrorMessage,
|
|
4018
2702
|
errorCode: userFacingErrorCode,
|
|
4019
|
-
suppressCompletedFallback: opts.checkpoint?.isCheckpointFollowUp === true ||
|
|
4020
|
-
opts.plannedBuild?.isPlannedBuildFollowUp === true,
|
|
4021
2703
|
});
|
|
4022
2704
|
}
|
|
4023
2705
|
const finalStatus = result.status === 'errored' ? 'error' : result.status;
|
|
@@ -4221,17 +2903,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
4221
2903
|
!segmentSuspended &&
|
|
4222
2904
|
!this.runState.hasSuspendedRun(opts.threadId)) {
|
|
4223
2905
|
const reschedule = !opts.signal.aborted && !blockedForQuota;
|
|
4224
|
-
if (opts.checkpoint?.isCheckpointFollowUp) {
|
|
4225
|
-
await this.finalizeCheckpointFollowUp(opts.user, opts.threadId, opts.checkpoint.checkpointTaskId, { reschedule });
|
|
4226
|
-
}
|
|
4227
|
-
else if (opts.plannedBuild?.isPlannedBuildFollowUp) {
|
|
4228
|
-
await this.finalizePlannedBuildFollowUp(opts.user, opts.threadId, opts.plannedBuild, {
|
|
4229
|
-
reschedule,
|
|
4230
|
-
});
|
|
4231
|
-
}
|
|
4232
|
-
else if (reschedule) {
|
|
4233
|
-
await this.schedulePlannedTasks(opts.user, opts.threadId);
|
|
4234
|
-
}
|
|
4235
2906
|
if (completedSetupWorkflowId) {
|
|
4236
2907
|
await this.markWorkflowSetupHandled(opts.threadId, completedSetupWorkflowId, opts.runId);
|
|
4237
2908
|
}
|
|
@@ -4362,11 +3033,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
4362
3033
|
});
|
|
4363
3034
|
}
|
|
4364
3035
|
}
|
|
4365
|
-
async buildMessageWithRunningTasks(threadId, message) {
|
|
4366
|
-
return await (0, instance_ai_1.enrichMessageWithBackgroundTasks)(message, this.backgroundTasks.getRunningTasks(threadId), {
|
|
4367
|
-
formatTask: async (task) => `[Running task — ${task.role}]: taskId=${task.taskId}`,
|
|
4368
|
-
});
|
|
4369
|
-
}
|
|
4370
3036
|
trackConfirmationRequest(userId, threadId, confirmationEvent) {
|
|
4371
3037
|
const payload = confirmationEvent.payload;
|
|
4372
3038
|
const inputThreadId = (0, nanoid_1.nanoid)();
|
|
@@ -4403,14 +3069,6 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
4403
3069
|
else if (mcpConnectServers) {
|
|
4404
3070
|
numSteps = mcpConnectServers.length;
|
|
4405
3071
|
}
|
|
4406
|
-
if (inputType === 'plan-review') {
|
|
4407
|
-
const planCount = (this.planRequestsByThread.get(threadId) ?? 0) + 1;
|
|
4408
|
-
this.planRequestsByThread.set(threadId, planCount);
|
|
4409
|
-
type = planCount === 1 ? 'first_plan' : 'revised_plan';
|
|
4410
|
-
if (Array.isArray(payload.planItems)) {
|
|
4411
|
-
numSteps = payload.planItems.length;
|
|
4412
|
-
}
|
|
4413
|
-
}
|
|
4414
3072
|
const credentialRequests = (Array.isArray(payload.credentialRequests) ? payload.credentialRequests : []).filter((request) => typeof request === 'object' && request !== null);
|
|
4415
3073
|
const containsTemplatedCred = credentialRequests.some((request) => request.credentialType === api_types_1.TEMPLATED_CUSTOM_AUTH_CREDENTIAL_TYPE ||
|
|
4416
3074
|
(request.setupHint !== null && request.setupHint !== undefined));
|
|
@@ -4478,7 +3136,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
4478
3136
|
status: effectiveStatus,
|
|
4479
3137
|
...(status === 'cancelled'
|
|
4480
3138
|
? { reason: reason ?? 'user_cancelled' }
|
|
4481
|
-
:
|
|
3139
|
+
: reason
|
|
4482
3140
|
? { reason }
|
|
4483
3141
|
: {}),
|
|
4484
3142
|
...(hasArchived ? { archivedWorkflowIds } : {}),
|
|
@@ -4636,16 +3294,18 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
4636
3294
|
nodeUsageEnabled: opts.instanceContext.nodeUsageEnabled,
|
|
4637
3295
|
};
|
|
4638
3296
|
}
|
|
4639
|
-
|
|
3297
|
+
createRunEventBus(workSummary, context) {
|
|
4640
3298
|
return {
|
|
4641
3299
|
publish: (threadId, event) => {
|
|
4642
3300
|
workSummary.observe(event);
|
|
4643
|
-
this.eventBus.publish(threadId, event);
|
|
3301
|
+
this.eventBus.publish(threadId, context?.mapSkillEventForDisplay?.(event) ?? event);
|
|
4644
3302
|
},
|
|
4645
3303
|
subscribe: (threadId, handler) => this.eventBus.subscribe(threadId, handler),
|
|
4646
3304
|
};
|
|
4647
3305
|
}
|
|
4648
3306
|
emitInstanceContextTurn(turn, input) {
|
|
3307
|
+
if (!turn)
|
|
3308
|
+
return;
|
|
4649
3309
|
const { injection } = turn;
|
|
4650
3310
|
this.telemetry.track(telemetry_1.TELEMETRY_EVENT.INSTANCE_AI.INSTANCE_CONTEXT_TURN, {
|
|
4651
3311
|
user_id: turn.userId,
|
|
@@ -4705,7 +3365,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
4705
3365
|
for (const m of history) {
|
|
4706
3366
|
if (!('role' in m) || m.role !== 'user')
|
|
4707
3367
|
continue;
|
|
4708
|
-
const text = (0, internal_messages_1.cleanStoredUserMessage)(
|
|
3368
|
+
const text = (0, internal_messages_1.cleanStoredUserMessage)((0, internal_messages_1.extractStoredMessageText)(m.content));
|
|
4709
3369
|
if (text && text.length > 0)
|
|
4710
3370
|
userTexts.push(text);
|
|
4711
3371
|
if (userTexts.length >= 5)
|
|
@@ -4749,6 +3409,7 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
4749
3409
|
llmTitle = await titleTracing.withActiveSpan(titleTracing.rootRun, async () => {
|
|
4750
3410
|
const title = await (0, instance_ai_1.generateTitleForRun)(modelId, userText, {
|
|
4751
3411
|
...(titleTelemetry ? { telemetry: titleTelemetry } : {}),
|
|
3412
|
+
modelFetch: this.modelService.getModelFetch(),
|
|
4752
3413
|
});
|
|
4753
3414
|
if (title) {
|
|
4754
3415
|
await titleTracing.finishRun(titleTracing.rootRun, {
|
|
@@ -4770,7 +3431,9 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
4770
3431
|
}
|
|
4771
3432
|
}
|
|
4772
3433
|
else {
|
|
4773
|
-
llmTitle = await (0, instance_ai_1.generateTitleForRun)(modelId, userText
|
|
3434
|
+
llmTitle = await (0, instance_ai_1.generateTitleForRun)(modelId, userText, {
|
|
3435
|
+
modelFetch: this.modelService.getModelFetch(),
|
|
3436
|
+
});
|
|
4774
3437
|
}
|
|
4775
3438
|
if (!llmTitle)
|
|
4776
3439
|
return;
|
|
@@ -4795,44 +3458,10 @@ let InstanceAiService = InstanceAiService_1 = class InstanceAiService {
|
|
|
4795
3458
|
});
|
|
4796
3459
|
}
|
|
4797
3460
|
}
|
|
4798
|
-
extractStoredMessageText(content) {
|
|
4799
|
-
if (typeof content === 'string')
|
|
4800
|
-
return content;
|
|
4801
|
-
if (Array.isArray(content)) {
|
|
4802
|
-
return content.flatMap((part) => (isTextMessagePart(part) ? [part.text] : [])).join('\n');
|
|
4803
|
-
}
|
|
4804
|
-
return '';
|
|
4805
|
-
}
|
|
4806
3461
|
async readRunEvents(threadId, runIds) {
|
|
4807
3462
|
await this.eventLog.flush(threadId);
|
|
4808
3463
|
return await this.eventLog.getEventsForRuns(threadId, runIds);
|
|
4809
3464
|
}
|
|
4810
|
-
parseMcpServers(raw) {
|
|
4811
|
-
if (!raw.trim())
|
|
4812
|
-
return [];
|
|
4813
|
-
return raw.split(',').map((entry) => {
|
|
4814
|
-
const [name, url] = entry.trim().split('=');
|
|
4815
|
-
return { name: name.trim(), url: url?.trim() };
|
|
4816
|
-
});
|
|
4817
|
-
}
|
|
4818
|
-
trackMcpToolCall({ server, toolName, success, }) {
|
|
4819
|
-
const serverSlug = server.metadata?.serverSlug;
|
|
4820
|
-
const userId = server.metadata?.userId;
|
|
4821
|
-
const connectionId = server.metadata?.connectionId;
|
|
4822
|
-
if (serverSlug && userId) {
|
|
4823
|
-
this.telemetry.track('Instance AI mcp tool called', {
|
|
4824
|
-
user_id: userId,
|
|
4825
|
-
server_slug: serverSlug,
|
|
4826
|
-
tool_name: toolName,
|
|
4827
|
-
success,
|
|
4828
|
-
});
|
|
4829
|
-
}
|
|
4830
|
-
if (!success && connectionId && userId) {
|
|
4831
|
-
this.push.sendToUsers({ type: 'instanceAiMcpToolCallFailed', data: { connectionId } }, [
|
|
4832
|
-
userId,
|
|
4833
|
-
]);
|
|
4834
|
-
}
|
|
4835
|
-
}
|
|
4836
3465
|
};
|
|
4837
3466
|
exports.InstanceAiService = InstanceAiService;
|
|
4838
3467
|
InstanceAiService.BLOCK_CHARS_PER_TOKEN = 4;
|
|
@@ -4844,6 +3473,6 @@ __decorate([
|
|
|
4844
3473
|
], InstanceAiService.prototype, "handleRelayTaskControl", null);
|
|
4845
3474
|
exports.InstanceAiService = InstanceAiService = InstanceAiService_1 = __decorate([
|
|
4846
3475
|
(0, di_1.Service)(),
|
|
4847
|
-
__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,
|
|
3476
|
+
__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_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, instance_ai_observation_repository_1.InstanceAiObservationRepository, instance_ai_observation_cursor_repository_1.InstanceAiObservationCursorRepository, instance_ai_event_log_repository_1.InstanceAiEventLogRepository, telemetry_2.Telemetry, db_1.UserRepository, instance_ai_temporary_workflow_service_1.InstanceAiTemporaryWorkflowService, n8n_core_1.ErrorReporter, backend_services_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, instance_ai_thread_tabs_service_1.InstanceAiThreadTabsService, self_healing_agent_service_1.SelfHealingAgentService, assistant_turn_environment_factory_1.AssistantTurnEnvironmentFactory, assistant_turn_input_builder_1.AssistantTurnInputBuilder, assistant_agent_factory_1.AssistantAgentFactory])
|
|
4848
3477
|
], InstanceAiService);
|
|
4849
3478
|
//# sourceMappingURL=instance-ai.service.js.map
|