n8n 2.20.6 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstract-server.d.ts +1 -0
- package/dist/abstract-server.js +10 -3
- package/dist/abstract-server.js.map +1 -1
- package/dist/agent-library-bundle.js +5989 -0
- package/dist/auth/auth.service.js +3 -3
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/execute-batch.d.ts +2 -2
- package/dist/commands/export/workflow.d.ts +2 -2
- package/dist/commands/import/workflow.d.ts +3 -0
- package/dist/commands/import/workflow.js +15 -1
- package/dist/commands/import/workflow.js.map +1 -1
- package/dist/commands/start.js +2 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +6 -1
- package/dist/constants.js.map +1 -1
- package/dist/controller.registry.js +6 -0
- package/dist/controller.registry.js.map +1 -1
- package/dist/controllers/auth.controller.js +7 -2
- package/dist/controllers/auth.controller.js.map +1 -1
- package/dist/controllers/me.controller.d.ts +1 -0
- package/dist/controllers/me.controller.js +4 -1
- package/dist/controllers/me.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +2 -2
- package/dist/credentials/credentials.service.d.ts +1 -0
- package/dist/credentials/credentials.service.js +11 -4
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/evaluation.ee/evaluation-api-error.d.ts +7 -0
- package/dist/evaluation.ee/evaluation-api-error.js +16 -0
- package/dist/evaluation.ee/evaluation-api-error.js.map +1 -0
- package/dist/evaluation.ee/evaluation-config-validator.d.ts +30 -0
- package/dist/evaluation.ee/evaluation-config-validator.js +236 -0
- package/dist/evaluation.ee/evaluation-config-validator.js.map +1 -0
- package/dist/evaluation.ee/evaluation-config.controller.d.ts +24 -0
- package/dist/evaluation.ee/evaluation-config.controller.js +94 -0
- package/dist/evaluation.ee/evaluation-config.controller.js.map +1 -0
- package/dist/evaluation.ee/evaluation-config.service.d.ts +18 -0
- package/dist/evaluation.ee/evaluation-config.service.js +74 -0
- package/dist/evaluation.ee/evaluation-config.service.js.map +1 -0
- package/dist/evaluation.ee/llm-judge-provider-registry.d.ts +13 -0
- package/dist/evaluation.ee/llm-judge-provider-registry.js +122 -0
- package/dist/evaluation.ee/llm-judge-provider-registry.js.map +1 -0
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.d.ts +5 -0
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +32 -10
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js.map +1 -1
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.d.ts +22 -0
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js +285 -0
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js.map +1 -0
- package/dist/evaluation.ee/test-runs.controller.ee.d.ts +3 -0
- package/dist/evaluation.ee/test-runs.controller.ee.js +26 -9
- package/dist/evaluation.ee/test-runs.controller.ee.js.map +1 -1
- package/dist/evaluation.ee/test-runs.types.ee.d.ts +3 -0
- package/dist/eventbus/message-event-bus/message-event-bus.d.ts +2 -0
- package/dist/eventbus/message-event-bus/message-event-bus.js +54 -46
- package/dist/eventbus/message-event-bus/message-event-bus.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +3 -0
- package/dist/instance-settings-loader/instance-settings-loader.service.d.ts +4 -2
- package/dist/instance-settings-loader/instance-settings-loader.service.js +7 -3
- package/dist/instance-settings-loader/instance-settings-loader.service.js.map +1 -1
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.d.ts +20 -0
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js +235 -0
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/{sso.instance-settings-loader.d.ts → sso/oidc.instance-settings-loader.d.ts} +4 -10
- package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js +98 -0
- package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.d.ts +10 -0
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js +65 -0
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.d.ts +12 -0
- package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.js +75 -0
- package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.d.ts +15 -0
- package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.js +75 -0
- package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.js.map +1 -0
- package/dist/load-nodes-and-credentials.d.ts +3 -3
- package/dist/load-nodes-and-credentials.js +25 -17
- package/dist/load-nodes-and-credentials.js.map +1 -1
- package/dist/modules/agents/adapters/agents-credential-provider.d.ts +12 -0
- package/dist/modules/agents/adapters/agents-credential-provider.js +63 -0
- package/dist/modules/agents/adapters/agents-credential-provider.js.map +1 -0
- package/dist/modules/agents/agent-execution.service.d.ts +42 -0
- package/dist/modules/agents/agent-execution.service.js +153 -0
- package/dist/modules/agents/agent-execution.service.js.map +1 -0
- package/dist/modules/agents/agent-message-mapper.d.ts +5 -0
- package/dist/modules/agents/agent-message-mapper.js +43 -0
- package/dist/modules/agents/agent-message-mapper.js.map +1 -0
- package/dist/modules/agents/agent-skills.service.d.ts +24 -0
- package/dist/modules/agents/agent-skills.service.js +166 -0
- package/dist/modules/agents/agent-skills.service.js.map +1 -0
- package/dist/modules/agents/agent-sse-stream.d.ts +15 -0
- package/dist/modules/agents/agent-sse-stream.js +194 -0
- package/dist/modules/agents/agent-sse-stream.js.map +1 -0
- package/dist/modules/agents/agents-tools.service.d.ts +18 -0
- package/dist/modules/agents/agents-tools.service.js +193 -0
- package/dist/modules/agents/agents-tools.service.js.map +1 -0
- package/dist/modules/agents/agents.controller.d.ts +260 -0
- package/dist/modules/agents/agents.controller.js +818 -0
- package/dist/modules/agents/agents.controller.js.map +1 -0
- package/dist/modules/agents/agents.module.d.ts +12 -0
- package/dist/modules/agents/agents.module.js +136 -0
- package/dist/modules/agents/agents.module.js.map +1 -0
- package/dist/modules/agents/agents.service.d.ts +151 -0
- package/dist/modules/agents/agents.service.js +1134 -0
- package/dist/modules/agents/agents.service.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +27 -0
- package/dist/modules/agents/builder/agents-builder-prompts.js +584 -0
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-settings.controller.d.ts +11 -0
- package/dist/modules/agents/builder/agents-builder-settings.controller.js +61 -0
- package/dist/modules/agents/builder/agents-builder-settings.controller.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-settings.service.d.ts +31 -0
- package/dist/modules/agents/builder/agents-builder-settings.service.js +199 -0
- package/dist/modules/agents/builder/agents-builder-settings.service.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +31 -0
- package/dist/modules/agents/builder/agents-builder-tools.service.js +420 -0
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder.service.d.ts +26 -0
- package/dist/modules/agents/builder/agents-builder.service.js +164 -0
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -0
- package/dist/modules/agents/builder/builder-model-lookup.service.d.ts +17 -0
- package/dist/modules/agents/builder/builder-model-lookup.service.js +67 -0
- package/dist/modules/agents/builder/builder-model-lookup.service.js.map +1 -0
- package/dist/modules/agents/builder/builder-tool-names.d.ts +14 -0
- package/dist/modules/agents/builder/builder-tool-names.js +17 -0
- package/dist/modules/agents/builder/builder-tool-names.js.map +1 -0
- package/dist/modules/agents/builder/errors.d.ts +6 -0
- package/dist/modules/agents/builder/errors.js +13 -0
- package/dist/modules/agents/builder/errors.js.map +1 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +5 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js +29 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -0
- package/dist/modules/agents/builder/interactive/ask-llm.tool.d.ts +2 -0
- package/dist/modules/agents/builder/interactive/ask-llm.tool.js +27 -0
- package/dist/modules/agents/builder/interactive/ask-llm.tool.js.map +1 -0
- package/dist/modules/agents/builder/interactive/ask-question.tool.d.ts +2 -0
- package/dist/modules/agents/builder/interactive/ask-question.tool.js +26 -0
- package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +1 -0
- package/dist/modules/agents/builder/interactive/index.d.ts +4 -0
- package/dist/modules/agents/builder/interactive/index.js +12 -0
- package/dist/modules/agents/builder/interactive/index.js.map +1 -0
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.d.ts +17 -0
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.js +60 -0
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.js.map +1 -0
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.d.ts +13 -0
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +136 -0
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -0
- package/dist/modules/agents/entities/agent-checkpoint.entity.d.ts +9 -0
- package/dist/modules/agents/entities/agent-checkpoint.entity.js +43 -0
- package/dist/modules/agents/entities/agent-checkpoint.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.d.ts +16 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js +74 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-execution.entity.d.ts +26 -0
- package/dist/modules/agents/entities/agent-execution.entity.js +100 -0
- package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-message.entity.d.ts +10 -0
- package/dist/modules/agents/entities/agent-message.entity.js +47 -0
- package/dist/modules/agents/entities/agent-message.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-observation-cursor.entity.d.ts +8 -0
- package/dist/modules/agents/entities/agent-observation-cursor.entity.js +37 -0
- package/dist/modules/agents/entities/agent-observation-cursor.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-observation-lock.entity.d.ts +8 -0
- package/dist/modules/agents/entities/agent-observation-lock.entity.js +37 -0
- package/dist/modules/agents/entities/agent-observation-lock.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-observation.entity.d.ts +10 -0
- package/dist/modules/agents/entities/agent-observation.entity.js +47 -0
- package/dist/modules/agents/entities/agent-observation.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-published-version.entity.d.ts +22 -0
- package/dist/modules/agents/entities/agent-published-version.entity.js +67 -0
- package/dist/modules/agents/entities/agent-published-version.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-resource.entity.d.ts +5 -0
- package/dist/modules/agents/entities/agent-resource.entity.js +29 -0
- package/dist/modules/agents/entities/agent-resource.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-thread.entity.d.ts +6 -0
- package/dist/modules/agents/entities/agent-thread.entity.js +33 -0
- package/dist/modules/agents/entities/agent-thread.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent.entity.d.ts +24 -0
- package/dist/modules/agents/entities/agent.entity.js +74 -0
- package/dist/modules/agents/entities/agent.entity.js.map +1 -0
- package/dist/modules/agents/execution-recorder.d.ts +82 -0
- package/dist/modules/agents/execution-recorder.js +272 -0
- package/dist/modules/agents/execution-recorder.js.map +1 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +62 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.js +540 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -0
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +39 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js +45 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -0
- package/dist/modules/agents/integrations/agent-schedule.service.d.ts +30 -0
- package/dist/modules/agents/integrations/agent-schedule.service.js +327 -0
- package/dist/modules/agents/integrations/agent-schedule.service.js.map +1 -0
- package/dist/modules/agents/integrations/callback-store.d.ts +11 -0
- package/dist/modules/agents/integrations/callback-store.js +30 -0
- package/dist/modules/agents/integrations/callback-store.js.map +1 -0
- package/dist/modules/agents/integrations/chat-integration.service.d.ts +58 -0
- package/dist/modules/agents/integrations/chat-integration.service.js +397 -0
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -0
- package/dist/modules/agents/integrations/component-mapper.d.ts +57 -0
- package/dist/modules/agents/integrations/component-mapper.js +223 -0
- package/dist/modules/agents/integrations/component-mapper.js.map +1 -0
- package/dist/modules/agents/integrations/cron-validation.d.ts +1 -0
- package/dist/modules/agents/integrations/cron-validation.js +8 -0
- package/dist/modules/agents/integrations/cron-validation.js.map +1 -0
- package/dist/modules/agents/integrations/esm-loader.d.ts +5 -0
- package/dist/modules/agents/integrations/esm-loader.js +24 -0
- package/dist/modules/agents/integrations/esm-loader.js.map +1 -0
- package/dist/modules/agents/integrations/integrations-sync.d.ts +4 -0
- package/dist/modules/agents/integrations/integrations-sync.js +78 -0
- package/dist/modules/agents/integrations/integrations-sync.js.map +1 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +36 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +148 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -0
- package/dist/modules/agents/integrations/n8n-memory.d.ts +76 -0
- package/dist/modules/agents/integrations/n8n-memory.js +383 -0
- package/dist/modules/agents/integrations/n8n-memory.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/linear-integration.d.ts +14 -0
- package/dist/modules/agents/integrations/platforms/linear-integration.js +83 -0
- package/dist/modules/agents/integrations/platforms/linear-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.d.ts +12 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.js +81 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +30 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +122 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -0
- package/dist/modules/agents/integrations/rich-interaction-tool.d.ts +47 -0
- package/dist/modules/agents/integrations/rich-interaction-tool.js +109 -0
- package/dist/modules/agents/integrations/rich-interaction-tool.js.map +1 -0
- package/dist/modules/agents/integrations/types.d.ts +8 -0
- package/dist/modules/agents/integrations/types.js +12 -0
- package/dist/modules/agents/integrations/types.js.map +1 -0
- package/dist/modules/agents/json-config/agent-config-composition.d.ts +9 -0
- package/dist/modules/agents/json-config/agent-config-composition.js +27 -0
- package/dist/modules/agents/json-config/agent-config-composition.js.map +1 -0
- package/dist/modules/agents/json-config/agent-json-config.d.ts +1022 -0
- package/dist/modules/agents/json-config/agent-json-config.js +128 -0
- package/dist/modules/agents/json-config/agent-json-config.js.map +1 -0
- package/dist/modules/agents/json-config/credential-field-mapping.d.ts +4 -0
- package/dist/modules/agents/json-config/credential-field-mapping.js +41 -0
- package/dist/modules/agents/json-config/credential-field-mapping.js.map +1 -0
- package/dist/modules/agents/json-config/from-json-config.d.ts +18 -0
- package/dist/modules/agents/json-config/from-json-config.js +209 -0
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -0
- package/dist/modules/agents/json-config/integration-config.d.ts +61 -0
- package/dist/modules/agents/json-config/integration-config.js +33 -0
- package/dist/modules/agents/json-config/integration-config.js.map +1 -0
- package/dist/modules/agents/json-config/provider-tool-aliases.d.ts +1 -0
- package/dist/modules/agents/json-config/provider-tool-aliases.js +15 -0
- package/dist/modules/agents/json-config/provider-tool-aliases.js.map +1 -0
- package/dist/modules/agents/json-config/schema-text-serializer.d.ts +2 -0
- package/dist/modules/agents/json-config/schema-text-serializer.js +205 -0
- package/dist/modules/agents/json-config/schema-text-serializer.js.map +1 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.d.ts +6 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js +35 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-execution-thread.repository.d.ts +18 -0
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js +120 -0
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-execution.repository.d.ts +10 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js +59 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-message.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-message.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-message.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-observation-cursor.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-observation-cursor.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-observation-cursor.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-observation-lock.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-observation-lock.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-observation-lock.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-observation.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-observation.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-observation.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-published-version.repository.d.ts +20 -0
- package/dist/modules/agents/repositories/agent-published-version.repository.js +35 -0
- package/dist/modules/agents/repositories/agent-published-version.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-resource.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-resource.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-resource.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-thread.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-thread.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-thread.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent.repository.d.ts +9 -0
- package/dist/modules/agents/repositories/agent.repository.js +50 -0
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -0
- package/dist/modules/agents/runtime/agent-isolate-pool.d.ts +48 -0
- package/dist/modules/agents/runtime/agent-isolate-pool.js +246 -0
- package/dist/modules/agents/runtime/agent-isolate-pool.js.map +1 -0
- package/dist/modules/agents/runtime/agent-secure-runtime.d.ts +21 -0
- package/dist/modules/agents/runtime/agent-secure-runtime.js +281 -0
- package/dist/modules/agents/runtime/agent-secure-runtime.js.map +1 -0
- package/dist/modules/agents/runtime/sandbox-polyfills.d.ts +1 -0
- package/dist/modules/agents/runtime/sandbox-polyfills.js +74 -0
- package/dist/modules/agents/runtime/sandbox-polyfills.js.map +1 -0
- package/dist/modules/agents/tool-registry.d.ts +13 -0
- package/dist/modules/agents/tool-registry.js +42 -0
- package/dist/modules/agents/tool-registry.js.map +1 -0
- package/dist/modules/agents/tools/environment-tool.d.ts +3 -0
- package/dist/modules/agents/tools/environment-tool.js +26 -0
- package/dist/modules/agents/tools/environment-tool.js.map +1 -0
- package/dist/modules/agents/tools/node-tool-factory.d.ts +10 -0
- package/dist/modules/agents/tools/node-tool-factory.js +100 -0
- package/dist/modules/agents/tools/node-tool-factory.js.map +1 -0
- package/dist/modules/agents/tools/workflow-tool-factory.d.ts +43 -0
- package/dist/modules/agents/tools/workflow-tool-factory.js +404 -0
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -0
- package/dist/modules/agents/tracing/builder-telemetry.d.ts +12 -0
- package/dist/modules/agents/tracing/builder-telemetry.js +48 -0
- package/dist/modules/agents/tracing/builder-telemetry.js.map +1 -0
- package/dist/modules/agents/types/components.d.ts +71 -0
- package/dist/modules/agents/types/components.js +3 -0
- package/dist/modules/agents/types/components.js.map +1 -0
- package/dist/modules/agents/types/index.d.ts +1 -0
- package/dist/modules/agents/types/index.js +3 -0
- package/dist/modules/agents/types/index.js.map +1 -0
- package/dist/modules/agents/utils/agent-draft.utils.d.ts +2 -0
- package/dist/modules/agents/utils/agent-draft.utils.js +11 -0
- package/dist/modules/agents/utils/agent-draft.utils.js.map +1 -0
- package/dist/modules/agents/utils/agent-resource-id.d.ts +3 -0
- package/dist/modules/agents/utils/agent-resource-id.js +14 -0
- package/dist/modules/agents/utils/agent-resource-id.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub.module.d.ts +2 -2
- package/dist/modules/chat-hub/chat-hub.settings.controller.d.ts +4 -4
- package/dist/modules/chat-hub/chat-hub.types.d.ts +2 -2
- package/dist/modules/chat-hub/dto/chat-models-request.dto.d.ts +1 -1
- package/dist/modules/community-packages/community-packages.config.js +2 -2
- package/dist/modules/community-packages/community-packages.config.js.map +1 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.d.ts +4 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.js +14 -2
- package/dist/modules/community-packages/community-packages.lifecycle.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.module.d.ts +1 -1
- package/dist/modules/community-packages/community-packages.module.js +10 -5
- package/dist/modules/community-packages/community-packages.module.js.map +1 -1
- package/dist/modules/data-table/data-table.service.js +6 -0
- package/dist/modules/data-table/data-table.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/slack-signature-identifier.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.d.ts +2 -0
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.js +10 -0
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +16 -4
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.d.ts +3 -3
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js +11 -3
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js.map +1 -1
- package/dist/modules/encryption-key-manager/encryption-bootstrap.service.js +4 -2
- package/dist/modules/encryption-key-manager/encryption-bootstrap.service.js.map +1 -1
- package/dist/modules/encryption-key-manager/encryption-key-manager.module.js +5 -2
- package/dist/modules/encryption-key-manager/encryption-key-manager.module.js.map +1 -1
- package/dist/modules/encryption-key-manager/encryption-key.controller.d.ts +3 -3
- package/dist/modules/encryption-key-manager/encryption-key.controller.js +8 -2
- package/dist/modules/encryption-key-manager/encryption-key.controller.js.map +1 -1
- package/dist/modules/encryption-key-manager/key-manager.service.d.ts +5 -1
- package/dist/modules/encryption-key-manager/key-manager.service.js +11 -4
- package/dist/modules/encryption-key-manager/key-manager.service.js.map +1 -1
- package/dist/modules/insights/insights-collection.service.js +1 -0
- package/dist/modules/insights/insights-collection.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-handler.js +17 -49
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.d.ts +1 -0
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.js +21 -3
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +3 -2
- package/dist/modules/instance-ai/instance-ai-settings.service.js +10 -9
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-test.controller.d.ts +21 -2
- package/dist/modules/instance-ai/instance-ai-test.controller.js +35 -3
- package/dist/modules/instance-ai/instance-ai-test.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +72 -42
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +2 -0
- package/dist/modules/instance-ai/instance-ai.controller.js +25 -1
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +0 -1
- package/dist/modules/instance-ai/instance-ai.module.js +0 -2
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +34 -5
- package/dist/modules/instance-ai/instance-ai.service.js +723 -76
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/liveness/index.d.ts +1 -0
- package/dist/modules/instance-ai/liveness/index.js +7 -0
- package/dist/modules/instance-ai/liveness/index.js.map +1 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.d.ts +72 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js +123 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js.map +1 -0
- package/dist/modules/instance-ai/message-parser.js +85 -6
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js +4 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js +1 -0
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js.map +1 -1
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js +23 -7
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +3 -3
- package/dist/modules/mcp/mcp.service.js +12 -9
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/tools/get-execution.tool.js +6 -4
- package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -1
- package/dist/modules/mcp/tools/list-credentials.tool.d.ts +40 -0
- package/dist/modules/mcp/tools/list-credentials.tool.js +148 -0
- package/dist/modules/mcp/tools/list-credentials.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +5 -4
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js +3 -3
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js +2 -2
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js +3 -2
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +3 -3
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.d.ts +1 -1
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +12 -4
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +12 -5
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +1 -2
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +1 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-validation.utils.d.ts +5 -1
- package/dist/modules/mcp/tools/workflow-validation.utils.js +4 -2
- package/dist/modules/mcp/tools/workflow-validation.utils.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-registry-node-loader.d.ts +27 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.js +105 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.js.map +1 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.test.d.ts +1 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.test.js +244 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.test.js.map +1 -0
- package/dist/modules/mcp-registry/mcp-registry.module.d.ts +4 -0
- package/dist/modules/mcp-registry/mcp-registry.module.js +60 -0
- package/dist/modules/mcp-registry/mcp-registry.module.js.map +1 -0
- package/dist/modules/mcp-registry/node-description-transform.d.ts +8 -0
- package/dist/modules/mcp-registry/node-description-transform.js +133 -0
- package/dist/modules/mcp-registry/node-description-transform.js.map +1 -0
- package/dist/modules/mcp-registry/node-description-transform.test.d.ts +1 -0
- package/dist/modules/mcp-registry/node-description-transform.test.js +286 -0
- package/dist/modules/mcp-registry/node-description-transform.test.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.d.ts +8 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js +31 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.test.d.ts +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.test.js +41 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.test.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.d.ts +36 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js +3 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mock-servers.d.ts +3 -0
- package/dist/modules/mcp-registry/registry/mock-servers.js +80 -0
- package/dist/modules/mcp-registry/registry/mock-servers.js.map +1 -0
- package/dist/modules/otel/execution-level-tracer.d.ts +1 -1
- package/dist/modules/otel/execution-level-tracer.js +24 -9
- package/dist/modules/otel/execution-level-tracer.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.types.d.ts +9 -7
- package/dist/modules/otel/execution-level-tracer.types.js +14 -0
- package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
- package/dist/modules/quick-connect/quick-connect.config.d.ts +176 -0
- package/dist/modules/quick-connect/quick-connect.config.js +8 -0
- package/dist/modules/quick-connect/quick-connect.config.js.map +1 -1
- package/dist/modules/quick-connect/quick-connect.module.d.ts +15 -0
- package/dist/modules/redaction/executions/execution-redaction.service.d.ts +1 -3
- package/dist/modules/redaction/executions/execution-redaction.service.js +2 -6
- package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +2 -2
- package/dist/modules/source-control.ee/source-control.service.ee.d.ts +1 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.d.ts +3 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.js +8 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -1
- package/dist/node-catalog/index.d.ts +1 -0
- package/dist/node-catalog/index.js +6 -0
- package/dist/node-catalog/index.js.map +1 -0
- package/dist/{modules/mcp/tools/workflow-builder/workflow-builder-tools.service.d.ts → node-catalog/node-catalog.service.d.ts} +9 -15
- package/dist/{modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js → node-catalog/node-catalog.service.js} +38 -28
- package/dist/node-catalog/node-catalog.service.js.map +1 -0
- package/dist/node-execution/ephemeral-node-executor.d.ts +47 -0
- package/dist/node-execution/ephemeral-node-executor.js +289 -0
- package/dist/node-execution/ephemeral-node-executor.js.map +1 -0
- package/dist/node-execution/index.d.ts +2 -0
- package/dist/node-execution/index.js +8 -0
- package/dist/node-execution/index.js.map +1 -0
- package/dist/public-api/v1/handlers/audit/audit.handler.d.ts +5 -4
- package/dist/public-api/v1/handlers/audit/audit.handler.js +5 -9
- package/dist/public-api/v1/handlers/audit/audit.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.d.ts +20 -17
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js +12 -39
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.handler.d.ts +12 -49
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +6 -5
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.d.ts +8 -19
- package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.js +11 -11
- package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.d.ts +9 -17
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js +19 -23
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.d.ts +9 -23
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js +17 -27
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/discover/discover.handler.d.ts +11 -9
- package/dist/public-api/v1/handlers/discover/discover.handler.js +5 -3
- package/dist/public-api/v1/handlers/discover/discover.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/executions/executions.handler.d.ts +12 -11
- package/dist/public-api/v1/handlers/executions/executions.handler.js +46 -80
- package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/folders/folders.handler.d.ts +12 -17
- package/dist/public-api/v1/handlers/folders/folders.handler.js +17 -20
- package/dist/public-api/v1/handlers/folders/folders.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/insights/insights.handler.d.ts +5 -4
- package/dist/public-api/v1/handlers/insights/insights.handler.js +9 -5
- package/dist/public-api/v1/handlers/insights/insights.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/projects/projects.handler.d.ts +28 -11
- package/dist/public-api/v1/handlers/projects/projects.handler.js +44 -75
- package/dist/public-api/v1/handlers/projects/projects.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/source-control/source-control.handler.d.ts +5 -6
- package/dist/public-api/v1/handlers/source-control/source-control.handler.js +3 -2
- package/dist/public-api/v1/handlers/source-control/source-control.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/tags/tags.handler.d.ts +9 -8
- package/dist/public-api/v1/handlers/tags/tags.handler.js +11 -8
- package/dist/public-api/v1/handlers/tags/tags.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/users/users.handler.ee.d.ts +14 -11
- package/dist/public-api/v1/handlers/users/users.handler.ee.js +7 -8
- package/dist/public-api/v1/handlers/users/users.handler.ee.js.map +1 -1
- package/dist/public-api/v1/handlers/variables/variables.handler.d.ts +13 -7
- package/dist/public-api/v1/handlers/variables/variables.handler.js +5 -3
- package/dist/public-api/v1/handlers/variables/variables.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +17 -49
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js +27 -46
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
- package/dist/public-api/v1/shared/handler.types.d.ts +7 -1
- package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -2
- package/dist/public-api/v1/shared/middlewares/global.middleware.js +7 -6
- package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/job-processor.js +2 -0
- package/dist/scaling/job-processor.js.map +1 -1
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +9 -0
- package/dist/scaling/pubsub/pubsub.types.d.ts +3 -1
- package/dist/scaling/scaling.types.d.ts +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +2 -0
- package/dist/server.js.map +1 -1
- package/dist/services/frontend.service.js +7 -14
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/import.service.d.ts +9 -3
- package/dist/services/import.service.js +72 -5
- package/dist/services/import.service.js.map +1 -1
- package/dist/services/proxy-token-manager.js.map +1 -0
- package/dist/services/workflow-statistics.service.js +1 -0
- package/dist/services/workflow-statistics.service.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker.service.d.ts +2 -0
- package/dist/task-runners/task-broker/task-broker.service.js +13 -1
- package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
- package/dist/utils/ttl-map.d.ts +17 -0
- package/dist/utils/ttl-map.js +80 -0
- package/dist/utils/ttl-map.js.map +1 -0
- package/dist/webhooks/test-webhooks.d.ts +3 -1
- package/dist/webhooks/test-webhooks.js +11 -3
- package/dist/webhooks/test-webhooks.js.map +1 -1
- package/dist/workflow-execute-additional-data.d.ts +2 -1
- package/dist/workflow-execute-additional-data.js +34 -0
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.d.ts +1 -0
- package/dist/workflow-helpers.js +15 -0
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-runner.js +2 -0
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/workflow-creation.service.js +1 -0
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow.service.js +4 -0
- package/dist/workflows/workflow.service.js.map +1 -1
- package/package.json +40 -25
- package/dist/instance-settings-loader/loaders/sso.instance-settings-loader.js +0 -203
- package/dist/instance-settings-loader/loaders/sso.instance-settings-loader.js.map +0 -1
- package/dist/modules/instance-ai/proxy-token-manager.js.map +0 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js.map +0 -1
- /package/dist/{modules/instance-ai → services}/proxy-token-manager.d.ts +0 -0
- /package/dist/{modules/instance-ai → services}/proxy-token-manager.js +0 -0
|
@@ -0,0 +1,818 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
45
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.AgentsController = void 0;
|
|
49
|
+
const api_types_1 = require("@n8n/api-types");
|
|
50
|
+
const decorators_1 = require("@n8n/decorators");
|
|
51
|
+
const crypto_1 = require("crypto");
|
|
52
|
+
const credentials_service_1 = require("../../credentials/credentials.service");
|
|
53
|
+
const conflict_error_1 = require("../../errors/response-errors/conflict.error");
|
|
54
|
+
const not_found_error_1 = require("../../errors/response-errors/not-found.error");
|
|
55
|
+
const agents_credential_provider_1 = require("./adapters/agents-credential-provider");
|
|
56
|
+
const agent_execution_service_1 = require("./agent-execution.service");
|
|
57
|
+
const agent_message_mapper_1 = require("./agent-message-mapper");
|
|
58
|
+
const agent_sse_stream_1 = require("./agent-sse-stream");
|
|
59
|
+
const agents_service_1 = require("./agents.service");
|
|
60
|
+
const agents_builder_service_1 = require("./builder/agents-builder.service");
|
|
61
|
+
const builder_tool_names_1 = require("./builder/builder-tool-names");
|
|
62
|
+
const agent_chat_integration_1 = require("./integrations/agent-chat-integration");
|
|
63
|
+
const agent_schedule_service_1 = require("./integrations/agent-schedule.service");
|
|
64
|
+
const chat_integration_service_1 = require("./integrations/chat-integration.service");
|
|
65
|
+
const agent_repository_1 = require("./repositories/agent.repository");
|
|
66
|
+
function makeBuilderToolEvents(send) {
|
|
67
|
+
let streamingToolName;
|
|
68
|
+
return {
|
|
69
|
+
toolInputStart: (name) => {
|
|
70
|
+
streamingToolName = name;
|
|
71
|
+
},
|
|
72
|
+
toolInputDelta: (_toolCallId, delta) => {
|
|
73
|
+
if (streamingToolName === builder_tool_names_1.BUILDER_TOOLS.BUILD_CUSTOM_TOOL) {
|
|
74
|
+
send({ type: 'code-delta', delta });
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
toolResult: (name) => {
|
|
78
|
+
if (name === builder_tool_names_1.BUILDER_TOOLS.WRITE_CONFIG || name === builder_tool_names_1.BUILDER_TOOLS.PATCH_CONFIG) {
|
|
79
|
+
send({ type: 'config-updated' });
|
|
80
|
+
streamingToolName = undefined;
|
|
81
|
+
}
|
|
82
|
+
if (name === builder_tool_names_1.BUILDER_TOOLS.CREATE_SKILL) {
|
|
83
|
+
send({ type: 'config-updated' });
|
|
84
|
+
streamingToolName = undefined;
|
|
85
|
+
}
|
|
86
|
+
if (name === builder_tool_names_1.BUILDER_TOOLS.BUILD_CUSTOM_TOOL) {
|
|
87
|
+
send({ type: 'tool-updated' });
|
|
88
|
+
streamingToolName = undefined;
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
let AgentsController = class AgentsController {
|
|
94
|
+
constructor(agentsService, agentsBuilderService, credentialsService, chatIntegrationService, agentScheduleService, agentRepository, agentExecutionService, chatIntegrationRegistry) {
|
|
95
|
+
this.agentsService = agentsService;
|
|
96
|
+
this.agentsBuilderService = agentsBuilderService;
|
|
97
|
+
this.credentialsService = credentialsService;
|
|
98
|
+
this.chatIntegrationService = chatIntegrationService;
|
|
99
|
+
this.agentScheduleService = agentScheduleService;
|
|
100
|
+
this.agentRepository = agentRepository;
|
|
101
|
+
this.agentExecutionService = agentExecutionService;
|
|
102
|
+
this.chatIntegrationRegistry = chatIntegrationRegistry;
|
|
103
|
+
}
|
|
104
|
+
async create(req, _res, payload) {
|
|
105
|
+
const { projectId } = req.params;
|
|
106
|
+
return await this.agentsService.create(projectId, payload.name);
|
|
107
|
+
}
|
|
108
|
+
async list(req) {
|
|
109
|
+
if (req.query.all === 'true') {
|
|
110
|
+
return await this.agentsService.findByUser(req.user.id);
|
|
111
|
+
}
|
|
112
|
+
return await this.agentsService.findByProjectId(req.params.projectId);
|
|
113
|
+
}
|
|
114
|
+
async getConfig(req) {
|
|
115
|
+
const { projectId, agentId } = req.params;
|
|
116
|
+
return await this.agentsService.getConfig(agentId, projectId);
|
|
117
|
+
}
|
|
118
|
+
async putConfig(req, _res, agentId, payload) {
|
|
119
|
+
const { projectId } = req.params;
|
|
120
|
+
const { config } = payload;
|
|
121
|
+
return await this.agentsService.updateConfig(agentId, projectId, config);
|
|
122
|
+
}
|
|
123
|
+
async deleteTool(req, _res, agentId, toolId) {
|
|
124
|
+
const { projectId } = req.params;
|
|
125
|
+
await this.agentsService.deleteCustomTool(agentId, projectId, toolId);
|
|
126
|
+
return { ok: true };
|
|
127
|
+
}
|
|
128
|
+
async listSkills(req) {
|
|
129
|
+
const { projectId, agentId } = req.params;
|
|
130
|
+
return await this.agentsService.listSkills(agentId, projectId);
|
|
131
|
+
}
|
|
132
|
+
async getSkill(req, _res, agentId, skillId) {
|
|
133
|
+
const { projectId } = req.params;
|
|
134
|
+
return await this.agentsService.getSkill(agentId, projectId, skillId);
|
|
135
|
+
}
|
|
136
|
+
async createSkill(req, _res, agentId, payload) {
|
|
137
|
+
const { projectId } = req.params;
|
|
138
|
+
const skill = {
|
|
139
|
+
name: payload.name,
|
|
140
|
+
description: payload.description,
|
|
141
|
+
instructions: payload.instructions,
|
|
142
|
+
};
|
|
143
|
+
return await this.agentsService.createAndAttachSkill(agentId, projectId, skill);
|
|
144
|
+
}
|
|
145
|
+
async updateSkill(req, _res, agentId, skillId, payload) {
|
|
146
|
+
const { projectId } = req.params;
|
|
147
|
+
return await this.agentsService.updateSkill(agentId, projectId, skillId, payload);
|
|
148
|
+
}
|
|
149
|
+
async deleteSkill(req, _res, agentId, skillId) {
|
|
150
|
+
const { projectId } = req.params;
|
|
151
|
+
await this.agentsService.deleteSkill(agentId, projectId, skillId);
|
|
152
|
+
return { ok: true };
|
|
153
|
+
}
|
|
154
|
+
async listCredentials(req) {
|
|
155
|
+
const { projectId } = req.params;
|
|
156
|
+
const credentialProvider = new agents_credential_provider_1.AgentsCredentialProvider(this.credentialsService, projectId, req.user);
|
|
157
|
+
return await credentialProvider.list();
|
|
158
|
+
}
|
|
159
|
+
async getModelCatalog() {
|
|
160
|
+
const { fetchProviderCatalog } = await Promise.resolve().then(() => __importStar(require('@n8n/agents')));
|
|
161
|
+
return await fetchProviderCatalog();
|
|
162
|
+
}
|
|
163
|
+
listIntegrations() {
|
|
164
|
+
return this.agentsService.listChatIntegrations();
|
|
165
|
+
}
|
|
166
|
+
async listThreads(req) {
|
|
167
|
+
const limit = Math.min(Math.max(Number(req.query.limit) || 20, 1), 100);
|
|
168
|
+
return await this.agentExecutionService.getThreads(req.params.projectId, limit, req.query.cursor, req.query.agentId);
|
|
169
|
+
}
|
|
170
|
+
async getThread(req) {
|
|
171
|
+
const result = await this.agentExecutionService.getThreadDetail(req.params.threadId, req.params.projectId, req.query.agentId);
|
|
172
|
+
if (!result) {
|
|
173
|
+
throw new not_found_error_1.NotFoundError(`Thread "${req.params.threadId}" not found`);
|
|
174
|
+
}
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
async deleteThread(req) {
|
|
178
|
+
const { projectId, threadId } = req.params;
|
|
179
|
+
const deleted = await this.agentExecutionService.deleteThread(projectId, threadId);
|
|
180
|
+
if (!deleted) {
|
|
181
|
+
throw new not_found_error_1.NotFoundError(`Thread "${threadId}" not found`);
|
|
182
|
+
}
|
|
183
|
+
return { success: true };
|
|
184
|
+
}
|
|
185
|
+
async get(req, _res, agentId) {
|
|
186
|
+
const agent = await this.agentsService.findById(agentId, req.params.projectId);
|
|
187
|
+
if (!agent) {
|
|
188
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
189
|
+
}
|
|
190
|
+
return agent;
|
|
191
|
+
}
|
|
192
|
+
async update(req, _res, agentId, payload) {
|
|
193
|
+
const { name, description } = payload;
|
|
194
|
+
let agent = await this.agentsService.findById(agentId, req.params.projectId);
|
|
195
|
+
if (!agent) {
|
|
196
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
197
|
+
}
|
|
198
|
+
if (name !== undefined) {
|
|
199
|
+
agent = await this.agentsService.updateName(agentId, req.params.projectId, name);
|
|
200
|
+
}
|
|
201
|
+
if (description !== undefined && agent) {
|
|
202
|
+
const latestUpdatedAt = agent.updatedAt instanceof Date ? agent.updatedAt.toISOString() : agent.updatedAt;
|
|
203
|
+
agent = await this.agentsService.updateDescription(agentId, req.params.projectId, description, latestUpdatedAt);
|
|
204
|
+
}
|
|
205
|
+
return agent;
|
|
206
|
+
}
|
|
207
|
+
async delete(req, _res, agentId) {
|
|
208
|
+
const deleted = await this.agentsService.delete(agentId, req.params.projectId);
|
|
209
|
+
if (!deleted) {
|
|
210
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
211
|
+
}
|
|
212
|
+
return { success: true };
|
|
213
|
+
}
|
|
214
|
+
async publish(req, _res, agentId) {
|
|
215
|
+
return await this.agentsService.publishAgent(agentId, req.params.projectId, req.user.id);
|
|
216
|
+
}
|
|
217
|
+
async unpublish(req, _res, agentId) {
|
|
218
|
+
return await this.agentsService.unpublishAgent(agentId, req.params.projectId);
|
|
219
|
+
}
|
|
220
|
+
async revertToPublished(req, _res, agentId) {
|
|
221
|
+
return await this.agentsService.revertToPublishedAgent(agentId, req.params.projectId);
|
|
222
|
+
}
|
|
223
|
+
async chat(req, res, agentId, payload) {
|
|
224
|
+
const { projectId } = req.params;
|
|
225
|
+
const { message, sessionId } = payload;
|
|
226
|
+
const credentialProvider = new agents_credential_provider_1.AgentsCredentialProvider(this.credentialsService, projectId, req.user);
|
|
227
|
+
const { send } = (0, agent_sse_stream_1.initSseStream)(res);
|
|
228
|
+
if (sessionId) {
|
|
229
|
+
const existing = await this.agentExecutionService.findThreadById(sessionId);
|
|
230
|
+
if (existing && !(0, agent_execution_service_1.threadBelongsTo)(existing, projectId, agentId)) {
|
|
231
|
+
send({ type: 'error', message: 'Session not found' });
|
|
232
|
+
res.end();
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const threadId = sessionId ?? (0, crypto_1.randomUUID)();
|
|
237
|
+
const { missing } = await this.agentsService.validateAgentIsRunnable(agentId, projectId, credentialProvider);
|
|
238
|
+
if (missing.length > 0) {
|
|
239
|
+
send({
|
|
240
|
+
type: 'error',
|
|
241
|
+
message: 'This agent is not ready to run yet.',
|
|
242
|
+
errorCode: 'agent_misconfigured',
|
|
243
|
+
missing,
|
|
244
|
+
});
|
|
245
|
+
res.end();
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
try {
|
|
249
|
+
await (0, agent_sse_stream_1.pumpChunks)(this.agentsService.executeForChat({
|
|
250
|
+
agentId,
|
|
251
|
+
projectId,
|
|
252
|
+
message,
|
|
253
|
+
userId: req.user.id,
|
|
254
|
+
memory: { threadId, resourceId: req.user.id },
|
|
255
|
+
}), send);
|
|
256
|
+
send({ type: 'done', sessionId: threadId });
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
const errorMessage = error instanceof Error ? error.message : 'Chat failed';
|
|
260
|
+
send({ type: 'error', message: errorMessage });
|
|
261
|
+
}
|
|
262
|
+
res.end();
|
|
263
|
+
}
|
|
264
|
+
async getChatMessages(req) {
|
|
265
|
+
const { projectId, agentId, threadId } = req.params;
|
|
266
|
+
const agent = await this.agentsService.findById(agentId, projectId);
|
|
267
|
+
if (!agent)
|
|
268
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
269
|
+
const thread = await this.agentExecutionService.findThreadById(threadId);
|
|
270
|
+
if (!thread || !(0, agent_execution_service_1.threadBelongsTo)(thread, projectId, agentId)) {
|
|
271
|
+
throw new not_found_error_1.NotFoundError(`Thread "${threadId}" not found`);
|
|
272
|
+
}
|
|
273
|
+
return await this.agentsService.getChatMessages(threadId);
|
|
274
|
+
}
|
|
275
|
+
async getBuilderMessages(req) {
|
|
276
|
+
const { projectId, agentId } = req.params;
|
|
277
|
+
const agent = await this.agentsService.findById(agentId, projectId);
|
|
278
|
+
if (!agent)
|
|
279
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
280
|
+
const memory = await this.agentsBuilderService.getBuilderMessages(agentId);
|
|
281
|
+
const checkpoint = await this.agentsBuilderService.findOpenCheckpoint(agentId);
|
|
282
|
+
const openSuspensions = Object.values(checkpoint?.pendingToolCalls ?? {})
|
|
283
|
+
.filter((tc) => tc.suspended)
|
|
284
|
+
.map((tc) => ({
|
|
285
|
+
toolCallId: tc.toolCallId,
|
|
286
|
+
runId: tc.runId,
|
|
287
|
+
}));
|
|
288
|
+
let messages;
|
|
289
|
+
if (!checkpoint) {
|
|
290
|
+
messages = (0, agent_message_mapper_1.messagesToDto)(memory);
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
const memoryIds = new Set(memory.map((m) => m.id));
|
|
294
|
+
const newFromCheckpoint = checkpoint.messageList.messages.filter((m) => !memoryIds.has(m.id));
|
|
295
|
+
messages = (0, agent_message_mapper_1.messagesToDto)([...memory, ...newFromCheckpoint]);
|
|
296
|
+
}
|
|
297
|
+
return { messages, openSuspensions };
|
|
298
|
+
}
|
|
299
|
+
async clearBuilderMessages(req) {
|
|
300
|
+
const { projectId, agentId } = req.params;
|
|
301
|
+
const agent = await this.agentsService.findById(agentId, projectId);
|
|
302
|
+
if (!agent)
|
|
303
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
304
|
+
await this.agentsBuilderService.clearBuilderMessages(agentId);
|
|
305
|
+
return { ok: true };
|
|
306
|
+
}
|
|
307
|
+
async getTestChatMessages(req) {
|
|
308
|
+
const { projectId, agentId } = req.params;
|
|
309
|
+
const agent = await this.agentsService.findById(agentId, projectId);
|
|
310
|
+
if (!agent)
|
|
311
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
312
|
+
const messages = await this.agentsService.getTestChatMessages(agentId, req.user.id);
|
|
313
|
+
return (0, agent_message_mapper_1.messagesToDto)(messages);
|
|
314
|
+
}
|
|
315
|
+
async clearTestChatMessages(req) {
|
|
316
|
+
const { projectId, agentId } = req.params;
|
|
317
|
+
const agent = await this.agentsService.findById(agentId, projectId);
|
|
318
|
+
if (!agent)
|
|
319
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
320
|
+
await this.agentsService.clearTestChatMessages(agentId, req.user.id);
|
|
321
|
+
return { ok: true };
|
|
322
|
+
}
|
|
323
|
+
async build(req, res, agentId, payload) {
|
|
324
|
+
const { projectId } = req.params;
|
|
325
|
+
const { message } = payload;
|
|
326
|
+
const agent = await this.agentsService.findById(agentId, projectId);
|
|
327
|
+
if (!agent)
|
|
328
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
329
|
+
const credentialProvider = new agents_credential_provider_1.AgentsCredentialProvider(this.credentialsService, projectId, req.user);
|
|
330
|
+
const { send } = (0, agent_sse_stream_1.initSseStream)(res);
|
|
331
|
+
try {
|
|
332
|
+
const suspended = await (0, agent_sse_stream_1.pumpChunks)(this.agentsBuilderService.buildAgent(agentId, projectId, message, credentialProvider, req.user), send, makeBuilderToolEvents(send));
|
|
333
|
+
if (!suspended) {
|
|
334
|
+
send({ type: 'done' });
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
catch (error) {
|
|
338
|
+
const errorMessage = error instanceof Error ? error.message : 'Build failed';
|
|
339
|
+
const errorCode = error && typeof error === 'object' && 'code' in error
|
|
340
|
+
? error.code
|
|
341
|
+
: undefined;
|
|
342
|
+
send({
|
|
343
|
+
type: 'error',
|
|
344
|
+
message: errorMessage,
|
|
345
|
+
...(typeof errorCode === 'string' ? { code: errorCode } : {}),
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
res.end();
|
|
349
|
+
}
|
|
350
|
+
async buildResume(req, res, agentId, payload) {
|
|
351
|
+
const { projectId } = req.params;
|
|
352
|
+
const { runId, toolCallId, resumeData } = payload;
|
|
353
|
+
const agent = await this.agentsService.findById(agentId, projectId);
|
|
354
|
+
if (!agent)
|
|
355
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
356
|
+
const credentialProvider = new agents_credential_provider_1.AgentsCredentialProvider(this.credentialsService, projectId, req.user);
|
|
357
|
+
const { send } = (0, agent_sse_stream_1.initSseStream)(res);
|
|
358
|
+
try {
|
|
359
|
+
const suspended = await (0, agent_sse_stream_1.pumpChunks)(this.agentsBuilderService.resumeBuild(agentId, projectId, runId, toolCallId, resumeData, credentialProvider, req.user), send, makeBuilderToolEvents(send));
|
|
360
|
+
if (!suspended) {
|
|
361
|
+
send({ type: 'done' });
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
const errorMessage = error instanceof Error ? error.message : 'Resume failed';
|
|
366
|
+
send({ type: 'error', message: errorMessage });
|
|
367
|
+
}
|
|
368
|
+
res.end();
|
|
369
|
+
}
|
|
370
|
+
async connectIntegration(req, _res, agentId, payload) {
|
|
371
|
+
const { type, credentialId } = payload;
|
|
372
|
+
const agent = await this.agentRepository.findByIdAndProjectId(agentId, req.params.projectId);
|
|
373
|
+
if (!agent)
|
|
374
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
375
|
+
if (!agent.publishedVersion)
|
|
376
|
+
throw new conflict_error_1.ConflictError(`Agent "${agentId}" must be published before connecting an integration`);
|
|
377
|
+
const usableCredentials = await this.credentialsService.getCredentialsAUserCanUseInAWorkflow(req.user, { projectId: agent.projectId });
|
|
378
|
+
const credential = usableCredentials.find((c) => c.id === credentialId);
|
|
379
|
+
if (!credential)
|
|
380
|
+
throw new not_found_error_1.NotFoundError(`Credential "${credentialId}" not found`);
|
|
381
|
+
await this.chatIntegrationService.connect(agentId, credentialId, type, req.user.id, agent.projectId);
|
|
382
|
+
const existing = agent.integrations ?? [];
|
|
383
|
+
const alreadyExists = existing.some((i) => (0, api_types_1.isAgentCredentialIntegration)(i) && i.type === type && i.credentialId === credentialId);
|
|
384
|
+
if (!alreadyExists) {
|
|
385
|
+
agent.integrations = [...existing, { type, credentialId, credentialName: credential.name }];
|
|
386
|
+
await this.agentRepository.save(agent);
|
|
387
|
+
}
|
|
388
|
+
await this.chatIntegrationService.broadcastIntegrationChange(agentId, type, credentialId, 'connect');
|
|
389
|
+
return { status: 'connected' };
|
|
390
|
+
}
|
|
391
|
+
async disconnectIntegration(req, _res, agentId, payload) {
|
|
392
|
+
const { type, credentialId } = payload;
|
|
393
|
+
const agent = await this.agentRepository.findByIdAndProjectId(agentId, req.params.projectId);
|
|
394
|
+
if (!agent)
|
|
395
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
396
|
+
await this.chatIntegrationService.disconnect(agentId, type, credentialId);
|
|
397
|
+
agent.integrations = (agent.integrations ?? []).filter((i) => !(0, api_types_1.isAgentCredentialIntegration)(i) || i.type !== type || i.credentialId !== credentialId);
|
|
398
|
+
await this.agentRepository.save(agent);
|
|
399
|
+
await this.chatIntegrationService.broadcastIntegrationChange(agentId, type, credentialId, 'disconnect');
|
|
400
|
+
return { status: 'disconnected' };
|
|
401
|
+
}
|
|
402
|
+
async getScheduleIntegration(req, _res, agentId) {
|
|
403
|
+
const agent = await this.agentRepository.findByIdAndProjectId(agentId, req.params.projectId);
|
|
404
|
+
if (!agent)
|
|
405
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
406
|
+
return this.agentScheduleService.getConfig(agent);
|
|
407
|
+
}
|
|
408
|
+
async updateScheduleIntegration(req, _res, agentId, payload) {
|
|
409
|
+
const agent = await this.agentRepository.findByIdAndProjectId(agentId, req.params.projectId);
|
|
410
|
+
if (!agent)
|
|
411
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
412
|
+
return await this.agentScheduleService.saveConfig(agent, payload.cronExpression, payload.wakeUpPrompt);
|
|
413
|
+
}
|
|
414
|
+
async activateScheduleIntegration(req, _res, agentId) {
|
|
415
|
+
const agent = await this.agentRepository.findByIdAndProjectId(agentId, req.params.projectId);
|
|
416
|
+
if (!agent)
|
|
417
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
418
|
+
return await this.agentScheduleService.activate(agent);
|
|
419
|
+
}
|
|
420
|
+
async deactivateScheduleIntegration(req, _res, agentId) {
|
|
421
|
+
const agent = await this.agentRepository.findByIdAndProjectId(agentId, req.params.projectId);
|
|
422
|
+
if (!agent)
|
|
423
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
424
|
+
return await this.agentScheduleService.deactivate(agent);
|
|
425
|
+
}
|
|
426
|
+
async integrationStatus(req, _res, agentId) {
|
|
427
|
+
const agent = await this.agentRepository.findByIdAndProjectId(agentId, req.params.projectId);
|
|
428
|
+
if (!agent)
|
|
429
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
430
|
+
const chatStatus = this.chatIntegrationService.getStatus(agentId);
|
|
431
|
+
const schedule = this.agentScheduleService.getConfig(agent);
|
|
432
|
+
const scheduleIntegrations = schedule.active ? [{ type: api_types_1.AGENT_SCHEDULE_TRIGGER_TYPE }] : [];
|
|
433
|
+
const connectedIntegrations = [...chatStatus.integrations, ...scheduleIntegrations];
|
|
434
|
+
return {
|
|
435
|
+
status: connectedIntegrations.length > 0 ? 'connected' : 'disconnected',
|
|
436
|
+
integrations: connectedIntegrations,
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
async handleWebhook(req, res) {
|
|
440
|
+
const { agentId, platform } = req.params;
|
|
441
|
+
const webhookHandler = this.chatIntegrationService.getWebhookHandler(agentId, platform);
|
|
442
|
+
if (!webhookHandler) {
|
|
443
|
+
const integration = this.chatIntegrationRegistry.get(platform);
|
|
444
|
+
const earlyResponse = integration?.handleUnauthenticatedWebhook?.(req.body);
|
|
445
|
+
if (earlyResponse) {
|
|
446
|
+
res.status(earlyResponse.status).json(earlyResponse.body);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
res.status(404).json({ error: `No active ${platform} integration for agent "${agentId}"` });
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
const forwardedProto = req.headers['x-forwarded-proto'];
|
|
453
|
+
const protocol = (Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto) ?? req.protocol;
|
|
454
|
+
const forwardedHost = req.headers['x-forwarded-host'];
|
|
455
|
+
const host = (Array.isArray(forwardedHost) ? forwardedHost[0] : forwardedHost) ??
|
|
456
|
+
req.headers.host ??
|
|
457
|
+
'localhost';
|
|
458
|
+
const url = `${protocol}://${host}${req.originalUrl}`;
|
|
459
|
+
let requestBody;
|
|
460
|
+
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
461
|
+
const rawBody = req.rawBody;
|
|
462
|
+
if (rawBody) {
|
|
463
|
+
requestBody = rawBody.toString('utf-8');
|
|
464
|
+
}
|
|
465
|
+
else if (req.headers['content-type']?.includes('application/json')) {
|
|
466
|
+
requestBody = JSON.stringify(req.body);
|
|
467
|
+
}
|
|
468
|
+
else if (req.headers['content-type']?.includes('application/x-www-form-urlencoded')) {
|
|
469
|
+
requestBody = new URLSearchParams(req.body).toString();
|
|
470
|
+
}
|
|
471
|
+
else {
|
|
472
|
+
requestBody = JSON.stringify(req.body);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
const sanitizedHeaders = {};
|
|
476
|
+
for (const [key, value] of Object.entries(req.headers)) {
|
|
477
|
+
if (typeof value === 'string') {
|
|
478
|
+
sanitizedHeaders[key] = value;
|
|
479
|
+
}
|
|
480
|
+
else if (Array.isArray(value)) {
|
|
481
|
+
sanitizedHeaders[key] = value.join(', ');
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
const webRequest = new globalThis.Request(url, {
|
|
485
|
+
method: req.method,
|
|
486
|
+
headers: sanitizedHeaders,
|
|
487
|
+
body: requestBody,
|
|
488
|
+
});
|
|
489
|
+
const backgroundTasks = [];
|
|
490
|
+
const waitUntil = (task) => {
|
|
491
|
+
backgroundTasks.push(task.catch((error) => {
|
|
492
|
+
console.warn('[AgentsController] Background task failed:', error instanceof Error ? error.message : String(error));
|
|
493
|
+
}));
|
|
494
|
+
};
|
|
495
|
+
const webResponse = await webhookHandler(webRequest, { waitUntil });
|
|
496
|
+
res.status(webResponse.status);
|
|
497
|
+
webResponse.headers.forEach((value, key) => {
|
|
498
|
+
res.setHeader(key, value);
|
|
499
|
+
});
|
|
500
|
+
const body = await webResponse.text();
|
|
501
|
+
res.send(body);
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
exports.AgentsController = AgentsController;
|
|
505
|
+
__decorate([
|
|
506
|
+
(0, decorators_1.Post)('/'),
|
|
507
|
+
(0, decorators_1.ProjectScope)('agent:create'),
|
|
508
|
+
__param(2, decorators_1.Body),
|
|
509
|
+
__metadata("design:type", Function),
|
|
510
|
+
__metadata("design:paramtypes", [Object, Object, api_types_1.CreateAgentDto]),
|
|
511
|
+
__metadata("design:returntype", Promise)
|
|
512
|
+
], AgentsController.prototype, "create", null);
|
|
513
|
+
__decorate([
|
|
514
|
+
(0, decorators_1.Get)('/'),
|
|
515
|
+
(0, decorators_1.ProjectScope)('agent:list'),
|
|
516
|
+
__metadata("design:type", Function),
|
|
517
|
+
__metadata("design:paramtypes", [Object]),
|
|
518
|
+
__metadata("design:returntype", Promise)
|
|
519
|
+
], AgentsController.prototype, "list", null);
|
|
520
|
+
__decorate([
|
|
521
|
+
(0, decorators_1.Get)('/:agentId/config'),
|
|
522
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
523
|
+
__metadata("design:type", Function),
|
|
524
|
+
__metadata("design:paramtypes", [Object]),
|
|
525
|
+
__metadata("design:returntype", Promise)
|
|
526
|
+
], AgentsController.prototype, "getConfig", null);
|
|
527
|
+
__decorate([
|
|
528
|
+
(0, decorators_1.Put)('/:agentId/config'),
|
|
529
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
530
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
531
|
+
__param(3, decorators_1.Body),
|
|
532
|
+
__metadata("design:type", Function),
|
|
533
|
+
__metadata("design:paramtypes", [Object, Object, String, api_types_1.UpdateAgentConfigDto]),
|
|
534
|
+
__metadata("design:returntype", Promise)
|
|
535
|
+
], AgentsController.prototype, "putConfig", null);
|
|
536
|
+
__decorate([
|
|
537
|
+
(0, decorators_1.Delete)('/:agentId/tools/:toolId'),
|
|
538
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
539
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
540
|
+
__param(3, (0, decorators_1.Param)('toolId')),
|
|
541
|
+
__metadata("design:type", Function),
|
|
542
|
+
__metadata("design:paramtypes", [Object, Object, String, String]),
|
|
543
|
+
__metadata("design:returntype", Promise)
|
|
544
|
+
], AgentsController.prototype, "deleteTool", null);
|
|
545
|
+
__decorate([
|
|
546
|
+
(0, decorators_1.Get)('/:agentId/skills'),
|
|
547
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
548
|
+
__metadata("design:type", Function),
|
|
549
|
+
__metadata("design:paramtypes", [Object]),
|
|
550
|
+
__metadata("design:returntype", Promise)
|
|
551
|
+
], AgentsController.prototype, "listSkills", null);
|
|
552
|
+
__decorate([
|
|
553
|
+
(0, decorators_1.Get)('/:agentId/skills/:skillId'),
|
|
554
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
555
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
556
|
+
__param(3, (0, decorators_1.Param)('skillId')),
|
|
557
|
+
__metadata("design:type", Function),
|
|
558
|
+
__metadata("design:paramtypes", [Object, Object, String, String]),
|
|
559
|
+
__metadata("design:returntype", Promise)
|
|
560
|
+
], AgentsController.prototype, "getSkill", null);
|
|
561
|
+
__decorate([
|
|
562
|
+
(0, decorators_1.Post)('/:agentId/skills'),
|
|
563
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
564
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
565
|
+
__param(3, decorators_1.Body),
|
|
566
|
+
__metadata("design:type", Function),
|
|
567
|
+
__metadata("design:paramtypes", [Object, Object, String, api_types_1.CreateAgentSkillDto]),
|
|
568
|
+
__metadata("design:returntype", Promise)
|
|
569
|
+
], AgentsController.prototype, "createSkill", null);
|
|
570
|
+
__decorate([
|
|
571
|
+
(0, decorators_1.Patch)('/:agentId/skills/:skillId'),
|
|
572
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
573
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
574
|
+
__param(3, (0, decorators_1.Param)('skillId')),
|
|
575
|
+
__param(4, decorators_1.Body),
|
|
576
|
+
__metadata("design:type", Function),
|
|
577
|
+
__metadata("design:paramtypes", [Object, Object, String, String, api_types_1.UpdateAgentSkillDto]),
|
|
578
|
+
__metadata("design:returntype", Promise)
|
|
579
|
+
], AgentsController.prototype, "updateSkill", null);
|
|
580
|
+
__decorate([
|
|
581
|
+
(0, decorators_1.Delete)('/:agentId/skills/:skillId'),
|
|
582
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
583
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
584
|
+
__param(3, (0, decorators_1.Param)('skillId')),
|
|
585
|
+
__metadata("design:type", Function),
|
|
586
|
+
__metadata("design:paramtypes", [Object, Object, String, String]),
|
|
587
|
+
__metadata("design:returntype", Promise)
|
|
588
|
+
], AgentsController.prototype, "deleteSkill", null);
|
|
589
|
+
__decorate([
|
|
590
|
+
(0, decorators_1.Get)('/:agentId/credentials'),
|
|
591
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
592
|
+
__metadata("design:type", Function),
|
|
593
|
+
__metadata("design:paramtypes", [Object]),
|
|
594
|
+
__metadata("design:returntype", Promise)
|
|
595
|
+
], AgentsController.prototype, "listCredentials", null);
|
|
596
|
+
__decorate([
|
|
597
|
+
(0, decorators_1.Get)('/catalog/models'),
|
|
598
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
599
|
+
__metadata("design:type", Function),
|
|
600
|
+
__metadata("design:paramtypes", []),
|
|
601
|
+
__metadata("design:returntype", Promise)
|
|
602
|
+
], AgentsController.prototype, "getModelCatalog", null);
|
|
603
|
+
__decorate([
|
|
604
|
+
(0, decorators_1.Get)('/catalog/integrations'),
|
|
605
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
606
|
+
__metadata("design:type", Function),
|
|
607
|
+
__metadata("design:paramtypes", []),
|
|
608
|
+
__metadata("design:returntype", Array)
|
|
609
|
+
], AgentsController.prototype, "listIntegrations", null);
|
|
610
|
+
__decorate([
|
|
611
|
+
(0, decorators_1.Get)('/threads'),
|
|
612
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
613
|
+
__metadata("design:type", Function),
|
|
614
|
+
__metadata("design:paramtypes", [Object]),
|
|
615
|
+
__metadata("design:returntype", Promise)
|
|
616
|
+
], AgentsController.prototype, "listThreads", null);
|
|
617
|
+
__decorate([
|
|
618
|
+
(0, decorators_1.Get)('/threads/:threadId'),
|
|
619
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
620
|
+
__metadata("design:type", Function),
|
|
621
|
+
__metadata("design:paramtypes", [Object]),
|
|
622
|
+
__metadata("design:returntype", Promise)
|
|
623
|
+
], AgentsController.prototype, "getThread", null);
|
|
624
|
+
__decorate([
|
|
625
|
+
(0, decorators_1.Delete)('/threads/:threadId'),
|
|
626
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
627
|
+
__metadata("design:type", Function),
|
|
628
|
+
__metadata("design:paramtypes", [Object]),
|
|
629
|
+
__metadata("design:returntype", Promise)
|
|
630
|
+
], AgentsController.prototype, "deleteThread", null);
|
|
631
|
+
__decorate([
|
|
632
|
+
(0, decorators_1.Get)('/:agentId'),
|
|
633
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
634
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
635
|
+
__metadata("design:type", Function),
|
|
636
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
637
|
+
__metadata("design:returntype", Promise)
|
|
638
|
+
], AgentsController.prototype, "get", null);
|
|
639
|
+
__decorate([
|
|
640
|
+
(0, decorators_1.Patch)('/:agentId'),
|
|
641
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
642
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
643
|
+
__param(3, decorators_1.Body),
|
|
644
|
+
__metadata("design:type", Function),
|
|
645
|
+
__metadata("design:paramtypes", [Object, Object, String, api_types_1.UpdateAgentDto]),
|
|
646
|
+
__metadata("design:returntype", Promise)
|
|
647
|
+
], AgentsController.prototype, "update", null);
|
|
648
|
+
__decorate([
|
|
649
|
+
(0, decorators_1.Delete)('/:agentId'),
|
|
650
|
+
(0, decorators_1.ProjectScope)('agent:delete'),
|
|
651
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
652
|
+
__metadata("design:type", Function),
|
|
653
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
654
|
+
__metadata("design:returntype", Promise)
|
|
655
|
+
], AgentsController.prototype, "delete", null);
|
|
656
|
+
__decorate([
|
|
657
|
+
(0, decorators_1.Post)('/:agentId/publish'),
|
|
658
|
+
(0, decorators_1.ProjectScope)('agent:publish'),
|
|
659
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
660
|
+
__metadata("design:type", Function),
|
|
661
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
662
|
+
__metadata("design:returntype", Promise)
|
|
663
|
+
], AgentsController.prototype, "publish", null);
|
|
664
|
+
__decorate([
|
|
665
|
+
(0, decorators_1.Post)('/:agentId/unpublish'),
|
|
666
|
+
(0, decorators_1.ProjectScope)('agent:unpublish'),
|
|
667
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
668
|
+
__metadata("design:type", Function),
|
|
669
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
670
|
+
__metadata("design:returntype", Promise)
|
|
671
|
+
], AgentsController.prototype, "unpublish", null);
|
|
672
|
+
__decorate([
|
|
673
|
+
(0, decorators_1.Post)('/:agentId/revert-to-published'),
|
|
674
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
675
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
676
|
+
__metadata("design:type", Function),
|
|
677
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
678
|
+
__metadata("design:returntype", Promise)
|
|
679
|
+
], AgentsController.prototype, "revertToPublished", null);
|
|
680
|
+
__decorate([
|
|
681
|
+
(0, decorators_1.Post)('/:agentId/chat', { usesTemplates: true }),
|
|
682
|
+
(0, decorators_1.ProjectScope)('agent:execute'),
|
|
683
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
684
|
+
__param(3, decorators_1.Body),
|
|
685
|
+
__metadata("design:type", Function),
|
|
686
|
+
__metadata("design:paramtypes", [Object, Object, String, api_types_1.AgentChatMessageDto]),
|
|
687
|
+
__metadata("design:returntype", Promise)
|
|
688
|
+
], AgentsController.prototype, "chat", null);
|
|
689
|
+
__decorate([
|
|
690
|
+
(0, decorators_1.Get)('/:agentId/chat/:threadId/messages'),
|
|
691
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
692
|
+
__metadata("design:type", Function),
|
|
693
|
+
__metadata("design:paramtypes", [Object]),
|
|
694
|
+
__metadata("design:returntype", Promise)
|
|
695
|
+
], AgentsController.prototype, "getChatMessages", null);
|
|
696
|
+
__decorate([
|
|
697
|
+
(0, decorators_1.Get)('/:agentId/build/messages'),
|
|
698
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
699
|
+
__metadata("design:type", Function),
|
|
700
|
+
__metadata("design:paramtypes", [Object]),
|
|
701
|
+
__metadata("design:returntype", Promise)
|
|
702
|
+
], AgentsController.prototype, "getBuilderMessages", null);
|
|
703
|
+
__decorate([
|
|
704
|
+
(0, decorators_1.Delete)('/:agentId/build/messages'),
|
|
705
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
706
|
+
__metadata("design:type", Function),
|
|
707
|
+
__metadata("design:paramtypes", [Object]),
|
|
708
|
+
__metadata("design:returntype", Promise)
|
|
709
|
+
], AgentsController.prototype, "clearBuilderMessages", null);
|
|
710
|
+
__decorate([
|
|
711
|
+
(0, decorators_1.Get)('/:agentId/chat/messages'),
|
|
712
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
713
|
+
__metadata("design:type", Function),
|
|
714
|
+
__metadata("design:paramtypes", [Object]),
|
|
715
|
+
__metadata("design:returntype", Promise)
|
|
716
|
+
], AgentsController.prototype, "getTestChatMessages", null);
|
|
717
|
+
__decorate([
|
|
718
|
+
(0, decorators_1.Delete)('/:agentId/chat/messages'),
|
|
719
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
720
|
+
__metadata("design:type", Function),
|
|
721
|
+
__metadata("design:paramtypes", [Object]),
|
|
722
|
+
__metadata("design:returntype", Promise)
|
|
723
|
+
], AgentsController.prototype, "clearTestChatMessages", null);
|
|
724
|
+
__decorate([
|
|
725
|
+
(0, decorators_1.Post)('/:agentId/build', { usesTemplates: true }),
|
|
726
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
727
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
728
|
+
__param(3, decorators_1.Body),
|
|
729
|
+
__metadata("design:type", Function),
|
|
730
|
+
__metadata("design:paramtypes", [Object, Object, String, api_types_1.AgentChatMessageDto]),
|
|
731
|
+
__metadata("design:returntype", Promise)
|
|
732
|
+
], AgentsController.prototype, "build", null);
|
|
733
|
+
__decorate([
|
|
734
|
+
(0, decorators_1.Post)('/:agentId/build/resume', { usesTemplates: true }),
|
|
735
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
736
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
737
|
+
__param(3, decorators_1.Body),
|
|
738
|
+
__metadata("design:type", Function),
|
|
739
|
+
__metadata("design:paramtypes", [Object, Object, String, api_types_1.AgentBuildResumeDto]),
|
|
740
|
+
__metadata("design:returntype", Promise)
|
|
741
|
+
], AgentsController.prototype, "buildResume", null);
|
|
742
|
+
__decorate([
|
|
743
|
+
(0, decorators_1.Post)('/:agentId/integrations/connect'),
|
|
744
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
745
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
746
|
+
__param(3, decorators_1.Body),
|
|
747
|
+
__metadata("design:type", Function),
|
|
748
|
+
__metadata("design:paramtypes", [Object, Object, String, api_types_1.AgentIntegrationDto]),
|
|
749
|
+
__metadata("design:returntype", Promise)
|
|
750
|
+
], AgentsController.prototype, "connectIntegration", null);
|
|
751
|
+
__decorate([
|
|
752
|
+
(0, decorators_1.Post)('/:agentId/integrations/disconnect'),
|
|
753
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
754
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
755
|
+
__param(3, decorators_1.Body),
|
|
756
|
+
__metadata("design:type", Function),
|
|
757
|
+
__metadata("design:paramtypes", [Object, Object, String, api_types_1.AgentIntegrationDto]),
|
|
758
|
+
__metadata("design:returntype", Promise)
|
|
759
|
+
], AgentsController.prototype, "disconnectIntegration", null);
|
|
760
|
+
__decorate([
|
|
761
|
+
(0, decorators_1.Get)('/:agentId/integrations/schedule'),
|
|
762
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
763
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
764
|
+
__metadata("design:type", Function),
|
|
765
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
766
|
+
__metadata("design:returntype", Promise)
|
|
767
|
+
], AgentsController.prototype, "getScheduleIntegration", null);
|
|
768
|
+
__decorate([
|
|
769
|
+
(0, decorators_1.Put)('/:agentId/integrations/schedule'),
|
|
770
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
771
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
772
|
+
__param(3, decorators_1.Body),
|
|
773
|
+
__metadata("design:type", Function),
|
|
774
|
+
__metadata("design:paramtypes", [Object, Object, String, api_types_1.UpdateAgentScheduleDto]),
|
|
775
|
+
__metadata("design:returntype", Promise)
|
|
776
|
+
], AgentsController.prototype, "updateScheduleIntegration", null);
|
|
777
|
+
__decorate([
|
|
778
|
+
(0, decorators_1.Post)('/:agentId/integrations/schedule/activate'),
|
|
779
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
780
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
781
|
+
__metadata("design:type", Function),
|
|
782
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
783
|
+
__metadata("design:returntype", Promise)
|
|
784
|
+
], AgentsController.prototype, "activateScheduleIntegration", null);
|
|
785
|
+
__decorate([
|
|
786
|
+
(0, decorators_1.Post)('/:agentId/integrations/schedule/deactivate'),
|
|
787
|
+
(0, decorators_1.ProjectScope)('agent:update'),
|
|
788
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
789
|
+
__metadata("design:type", Function),
|
|
790
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
791
|
+
__metadata("design:returntype", Promise)
|
|
792
|
+
], AgentsController.prototype, "deactivateScheduleIntegration", null);
|
|
793
|
+
__decorate([
|
|
794
|
+
(0, decorators_1.Get)('/:agentId/integrations/status'),
|
|
795
|
+
(0, decorators_1.ProjectScope)('agent:read'),
|
|
796
|
+
__param(2, (0, decorators_1.Param)('agentId')),
|
|
797
|
+
__metadata("design:type", Function),
|
|
798
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
799
|
+
__metadata("design:returntype", Promise)
|
|
800
|
+
], AgentsController.prototype, "integrationStatus", null);
|
|
801
|
+
__decorate([
|
|
802
|
+
(0, decorators_1.Post)('/:agentId/webhooks/:platform', { skipAuth: true, allowBots: true }),
|
|
803
|
+
__metadata("design:type", Function),
|
|
804
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
805
|
+
__metadata("design:returntype", Promise)
|
|
806
|
+
], AgentsController.prototype, "handleWebhook", null);
|
|
807
|
+
exports.AgentsController = AgentsController = __decorate([
|
|
808
|
+
(0, decorators_1.RestController)('/projects/:projectId/agents/v2'),
|
|
809
|
+
__metadata("design:paramtypes", [agents_service_1.AgentsService,
|
|
810
|
+
agents_builder_service_1.AgentsBuilderService,
|
|
811
|
+
credentials_service_1.CredentialsService,
|
|
812
|
+
chat_integration_service_1.ChatIntegrationService,
|
|
813
|
+
agent_schedule_service_1.AgentScheduleService,
|
|
814
|
+
agent_repository_1.AgentRepository,
|
|
815
|
+
agent_execution_service_1.AgentExecutionService,
|
|
816
|
+
agent_chat_integration_1.ChatIntegrationRegistry])
|
|
817
|
+
], AgentsController);
|
|
818
|
+
//# sourceMappingURL=agents.controller.js.map
|