n8n 2.27.3 → 2.28.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.js +0 -4
- package/dist/abstract-server.js.map +1 -1
- package/dist/active-workflow-manager.js +4 -1
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/agent-library-bundle.js +7 -3
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/audit.js +6 -0
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/base-command.d.ts +1 -0
- package/dist/commands/base-command.js +36 -2
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/start.js +18 -9
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/worker.js +2 -0
- package/dist/commands/worker.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +5 -1
- package/dist/constants.js.map +1 -1
- package/dist/controllers/api-keys.controller.d.ts +17 -0
- package/dist/controllers/api-keys.controller.js +19 -0
- package/dist/controllers/api-keys.controller.js.map +1 -1
- package/dist/controllers/e2e.controller.js +1 -0
- package/dist/controllers/e2e.controller.js.map +1 -1
- package/dist/controllers/telemetry.controller.d.ts +3 -1
- package/dist/controllers/telemetry.controller.js +17 -7
- package/dist/controllers/telemetry.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +1 -1
- package/dist/credentials/credentials.service.d.ts +5 -0
- package/dist/credentials/credentials.service.js +17 -3
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/evaluation.ee/evaluation-config.controller.d.ts +7 -1
- package/dist/evaluation.ee/evaluation-config.controller.js +30 -1
- package/dist/evaluation.ee/evaluation-config.controller.js.map +1 -1
- package/dist/evaluation.ee/evaluation-dataset.service.d.ts +24 -0
- package/dist/evaluation.ee/evaluation-dataset.service.js +185 -0
- package/dist/evaluation.ee/evaluation-dataset.service.js.map +1 -0
- package/dist/evaluation.ee/llm-judge-provider-registry.js +2 -2
- package/dist/evaluation.ee/llm-judge-provider-registry.js.map +1 -1
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +6 -6
- 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 +2 -0
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js +27 -0
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js.map +1 -1
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +2 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/event.service.d.ts +2 -1
- package/dist/events/event.service.js.map +1 -1
- package/dist/events/maps/instance-ai.event-map.d.ts +15 -0
- package/dist/events/maps/instance-ai.event-map.js +3 -0
- package/dist/events/maps/instance-ai.event-map.js.map +1 -0
- package/dist/events/maps/relay.event-map.d.ts +8 -1
- package/dist/events/relays/log-streaming.event-relay.d.ts +2 -0
- package/dist/events/relays/log-streaming.event-relay.js +26 -0
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +1 -0
- package/dist/events/relays/telemetry.event-relay.js +11 -0
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +1 -0
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/execution-lifecycle/shared/shared-hook-functions.d.ts +2 -1
- package/dist/execution-lifecycle/shared/shared-hook-functions.js +8 -3
- package/dist/execution-lifecycle/shared/shared-hook-functions.js.map +1 -1
- package/dist/executions/execution-data/azure-store.ee.d.ts +15 -0
- package/dist/executions/execution-data/azure-store.ee.js +116 -0
- package/dist/executions/execution-data/azure-store.ee.js.map +1 -0
- package/dist/executions/execution-data/db-store.d.ts +7 -0
- package/dist/executions/execution-data/db-store.js +21 -0
- package/dist/executions/execution-data/db-store.js.map +1 -1
- package/dist/executions/execution-data/types.d.ts +3 -0
- package/dist/executions/execution-persistence.d.ts +17 -3
- package/dist/executions/execution-persistence.js +121 -18
- package/dist/executions/execution-persistence.js.map +1 -1
- package/dist/executions/execution.service.d.ts +3 -1
- package/dist/executions/execution.service.js +10 -4
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/executions/sum-binary-data-bytes.d.ts +2 -0
- package/dist/executions/sum-binary-data-bytes.js +46 -0
- package/dist/executions/sum-binary-data-bytes.js.map +1 -0
- package/dist/interfaces.d.ts +22 -0
- package/dist/license/license.service.d.ts +3 -1
- package/dist/license/license.service.js +36 -51
- package/dist/license/license.service.js.map +1 -1
- package/dist/metrics/prometheus/execution-data-metrics.service.js +2 -1
- package/dist/metrics/prometheus/execution-data-metrics.service.js.map +1 -1
- package/dist/metrics/prometheus/instance-ai-metrics.service.d.ts +12 -0
- package/dist/metrics/prometheus/instance-ai-metrics.service.js +101 -0
- package/dist/metrics/prometheus/instance-ai-metrics.service.js.map +1 -0
- package/dist/metrics/prometheus/instance-role-metrics.service.js +2 -2
- package/dist/metrics/prometheus/instance-role-metrics.service.js.map +1 -1
- package/dist/metrics/prometheus/prometheus.service.d.ts +4 -1
- package/dist/metrics/prometheus/prometheus.service.js +11 -2
- package/dist/metrics/prometheus/prometheus.service.js.map +1 -1
- package/dist/metrics/prometheus/webhook-and-form-metrics.service.d.ts +23 -0
- package/dist/metrics/prometheus/webhook-and-form-metrics.service.js +72 -0
- package/dist/metrics/prometheus/webhook-and-form-metrics.service.js.map +1 -0
- package/dist/metrics/prometheus/workflow-info-metrics.service.d.ts +12 -0
- package/dist/metrics/prometheus/workflow-info-metrics.service.js +66 -0
- package/dist/metrics/prometheus/workflow-info-metrics.service.js.map +1 -0
- package/dist/middlewares/body-parser.js +2 -2
- package/dist/middlewares/body-parser.js.map +1 -1
- package/dist/middlewares/list-query/dtos/workflow.filter.dto.d.ts +2 -0
- package/dist/middlewares/list-query/dtos/workflow.filter.dto.js +12 -0
- package/dist/middlewares/list-query/dtos/workflow.filter.dto.js.map +1 -1
- package/dist/modules/agents/agent-execution.service.d.ts +8 -1
- package/dist/modules/agents/agent-execution.service.js +26 -2
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-commands.d.ts +27 -0
- package/dist/modules/agents/agent-knowledge-commands.js +415 -0
- package/dist/modules/agents/agent-knowledge-commands.js.map +1 -0
- package/dist/modules/agents/agent-knowledge-gate.d.ts +2 -0
- package/dist/modules/agents/agent-knowledge-gate.js +9 -0
- package/dist/modules/agents/agent-knowledge-gate.js.map +1 -0
- package/dist/modules/agents/agent-knowledge-retrieval.d.ts +184 -0
- package/dist/modules/agents/agent-knowledge-retrieval.js +172 -0
- package/dist/modules/agents/agent-knowledge-retrieval.js.map +1 -0
- package/dist/modules/agents/agent-knowledge-sandbox.service.d.ts +40 -0
- package/dist/modules/agents/agent-knowledge-sandbox.service.js +591 -0
- package/dist/modules/agents/agent-knowledge-sandbox.service.js.map +1 -0
- package/dist/modules/agents/agent-knowledge-storage.d.ts +21 -0
- package/dist/modules/agents/agent-knowledge-storage.js +89 -0
- package/dist/modules/agents/agent-knowledge-storage.js.map +1 -0
- package/dist/modules/agents/agent-knowledge.service.d.ts +25 -5
- package/dist/modules/agents/agent-knowledge.service.js +230 -7
- package/dist/modules/agents/agent-knowledge.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +8 -2
- package/dist/modules/agents/agent-runtime-reconstruction.service.js +49 -11
- package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
- package/dist/modules/agents/agent-sandbox.controller.d.ts +18 -0
- package/dist/modules/agents/agent-sandbox.controller.js +71 -0
- package/dist/modules/agents/agent-sandbox.controller.js.map +1 -0
- package/dist/modules/agents/agent-telemetry.d.ts +5 -0
- package/dist/modules/agents/agent-telemetry.js +60 -0
- package/dist/modules/agents/agent-telemetry.js.map +1 -0
- package/dist/modules/agents/agents.controller.d.ts +4 -4
- package/dist/modules/agents/agents.controller.js +24 -23
- package/dist/modules/agents/agents.controller.js.map +1 -1
- package/dist/modules/agents/agents.module.d.ts +1 -1
- package/dist/modules/agents/agents.module.js +7 -1
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/agents.service.d.ts +5 -2
- package/dist/modules/agents/agents.service.js +68 -15
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.js +7 -0
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-settings.service.d.ts +12 -6
- package/dist/modules/agents/builder/agents-builder-settings.service.js +29 -12
- package/dist/modules/agents/builder/agents-builder-settings.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +12 -4
- package/dist/modules/agents/builder/agents-builder-tools.service.js +118 -14
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder.service.d.ts +7 -0
- package/dist/modules/agents/builder/agents-builder.service.js +24 -6
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-tool-names.d.ts +1 -0
- package/dist/modules/agents/builder/builder-tool-names.js +1 -0
- package/dist/modules/agents/builder/builder-tool-names.js.map +1 -1
- package/dist/modules/agents/builder/from-ai-node-parameters.d.ts +7 -0
- package/dist/modules/agents/builder/from-ai-node-parameters.js +43 -0
- package/dist/modules/agents/builder/from-ai-node-parameters.js.map +1 -0
- package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +10 -0
- package/dist/modules/agents/builder/get-resource-locator-options.tool.js +148 -0
- package/dist/modules/agents/builder/get-resource-locator-options.tool.js.map +1 -0
- package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.js +11 -0
- package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -1
- package/dist/modules/agents/builder/skills/index.js +2 -0
- package/dist/modules/agents/builder/skills/index.js.map +1 -1
- package/dist/modules/agents/builder/skills/resource-locators.skill.d.ts +2 -0
- package/dist/modules/agents/builder/skills/resource-locators.skill.js +107 -0
- package/dist/modules/agents/builder/skills/resource-locators.skill.js.map +1 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.d.ts +2 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.js +1 -1
- package/dist/modules/agents/builder/verify-mcp-server.tool.js.map +1 -1
- package/dist/modules/agents/entities/agent-file.entity.d.ts +11 -0
- package/dist/modules/agents/entities/agent-file.entity.js +50 -0
- package/dist/modules/agents/entities/agent-file.entity.js.map +1 -0
- package/dist/modules/agents/execution-recorder.js +4 -7
- package/dist/modules/agents/execution-recorder.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.js +7 -9
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +7 -3
- package/dist/modules/agents/integrations/agent-chat-integration.js +5 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
- package/dist/modules/agents/integrations/integration-action-executor.d.ts +704 -0
- package/dist/modules/agents/integrations/integration-action-executor.js +36 -22
- package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -1
- package/dist/modules/agents/integrations/integration-context-query-executor.js +23 -4
- package/dist/modules/agents/integrations/integration-context-query-executor.js.map +1 -1
- package/dist/modules/agents/integrations/integration-helpers.d.ts +12 -1
- package/dist/modules/agents/integrations/integration-helpers.js +17 -8
- package/dist/modules/agents/integrations/integration-helpers.js.map +1 -1
- package/dist/modules/agents/integrations/integration-message-context.service.js +2 -4
- package/dist/modules/agents/integrations/integration-message-context.service.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tools.d.ts +11 -3
- package/dist/modules/agents/integrations/integration-tools.js +19 -118
- package/dist/modules/agents/integrations/integration-tools.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/linear-integration.d.ts +3 -1
- package/dist/modules/agents/integrations/platforms/linear-integration.js +22 -6
- package/dist/modules/agents/integrations/platforms/linear-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/linear-operations.js +19 -29
- package/dist/modules/agents/integrations/platforms/linear-operations.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/n8n-chat-integration.d.ts +20 -0
- package/dist/modules/agents/integrations/platforms/n8n-chat-integration.js +99 -0
- package/dist/modules/agents/integrations/platforms/n8n-chat-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.d.ts +2 -1
- package/dist/modules/agents/integrations/platforms/slack-integration.js +5 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack-operations.js +3 -2
- package/dist/modules/agents/integrations/platforms/slack-operations.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +11 -2
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +43 -14
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.d.ts +3 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.js +19 -11
- package/dist/modules/agents/integrations/slack-app-setup.service.js.map +1 -1
- package/dist/modules/agents/json-config/from-json-config.d.ts +2 -1
- package/dist/modules/agents/json-config/from-json-config.js +11 -1
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
- package/dist/modules/agents/json-config/mcp-client-factory.d.ts +2 -0
- package/dist/modules/agents/json-config/mcp-client-factory.js +2 -2
- package/dist/modules/agents/json-config/mcp-client-factory.js.map +1 -1
- package/dist/modules/agents/repositories/agent-file.repository.d.ts +8 -0
- package/dist/modules/agents/repositories/agent-file.repository.js +38 -0
- package/dist/modules/agents/repositories/agent-file.repository.js.map +1 -0
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js +5 -0
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +1 -1
- package/dist/modules/agents/tools/knowledge/search-knowledge.tool.d.ts +90 -0
- package/dist/modules/agents/tools/knowledge/search-knowledge.tool.js +209 -0
- package/dist/modules/agents/tools/knowledge/search-knowledge.tool.js.map +1 -0
- package/dist/modules/agents/tools/workflow-tool-factory.js +6 -8
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/tracing/builder-telemetry.d.ts +6 -1
- package/dist/modules/agents/tracing/builder-telemetry.js +26 -5
- package/dist/modules/agents/tracing/builder-telemetry.js.map +1 -1
- package/dist/modules/agents/utils/agent-memory-scope.d.ts +1 -0
- package/dist/modules/agents/utils/agent-memory-scope.js +6 -1
- package/dist/modules/agents/utils/agent-memory-scope.js.map +1 -1
- package/dist/modules/agents/utils/execution-to-message-mapper.js +54 -5
- package/dist/modules/agents/utils/execution-to-message-mapper.js.map +1 -1
- package/dist/modules/agents/utils/messages-envelope.d.ts +7 -0
- package/dist/modules/agents/utils/messages-envelope.js +97 -0
- package/dist/modules/agents/utils/messages-envelope.js.map +1 -0
- package/dist/modules/community-packages/community-packages.service.d.ts +3 -1
- package/dist/modules/community-packages/community-packages.service.js +17 -9
- package/dist/modules/community-packages/community-packages.service.js.map +1 -1
- package/dist/modules/community-packages/npm-utils.js +13 -6
- package/dist/modules/community-packages/npm-utils.js.map +1 -1
- package/dist/modules/data-table/multer-upload-middleware.d.ts +8 -1
- package/dist/modules/data-table/multer-upload-middleware.js +79 -30
- package/dist/modules/data-table/multer-upload-middleware.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/index.d.ts +2 -0
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/index.js +19 -0
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/index.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/metadata.d.ts +20 -0
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/metadata.js +12 -0
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/metadata.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-extractor.d.ts +12 -0
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-extractor.js +85 -0
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-extractor.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-seeder.d.ts +10 -0
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-seeder.js +78 -0
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-seeder.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.d.ts +3 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js +17 -2
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-introspection-identifier.d.ts +4 -2
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-introspection-identifier.js +20 -40
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-introspection-identifier.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.d.ts +21 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.js +77 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-userinfo-identifier.d.ts +3 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-userinfo-identifier.js +18 -39
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-userinfo-identifier.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.d.ts +4 -2
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +46 -2
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js +3 -0
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/authorize-intent.service.d.ts +14 -0
- package/dist/modules/dynamic-credentials.ee/services/authorize-intent.service.js +39 -0
- package/dist/modules/dynamic-credentials.ee/services/authorize-intent.service.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.d.ts +7 -3
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js +23 -21
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js +111 -63
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js +0 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/index.d.ts +1 -0
- package/dist/modules/dynamic-credentials.ee/services/index.js +1 -0
- package/dist/modules/dynamic-credentials.ee/services/index.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.d.ts +3 -1
- package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js +4 -1
- package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/gcp-secrets-manager/gcp-secrets-manager.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/infisical.d.ts +4 -1
- package/dist/modules/external-secrets.ee/providers/infisical.js +45 -30
- package/dist/modules/external-secrets.ee/providers/infisical.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/one-password.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/vault.d.ts +5 -1
- package/dist/modules/external-secrets.ee/providers/vault.js +66 -61
- package/dist/modules/external-secrets.ee/providers/vault.js.map +1 -1
- package/dist/modules/insights/database/repositories/insights-by-period.repository.d.ts +2 -2
- package/dist/modules/insights/insights.service.d.ts +2 -2
- package/dist/modules/instance-ai/entities/index.d.ts +1 -0
- package/dist/modules/instance-ai/entities/index.js +3 -1
- package/dist/modules/instance-ai/entities/index.js.map +1 -1
- package/dist/modules/instance-ai/entities/instance-ai-thread-grant.entity.d.ts +9 -0
- package/dist/modules/instance-ai/entities/instance-ai-thread-grant.entity.js +45 -0
- package/dist/modules/instance-ai/entities/instance-ai-thread-grant.entity.js.map +1 -0
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.d.ts +3 -3
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js +2 -2
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js.map +1 -1
- package/dist/modules/instance-ai/eval/llm-wire-server.d.ts +2 -2
- package/dist/modules/instance-ai/eval/llm-wire-server.js +5 -5
- package/dist/modules/instance-ai/eval/llm-wire-server.js.map +1 -1
- package/dist/modules/instance-ai/eval/thread-credential-allowlist.service.d.ts +6 -0
- package/dist/modules/instance-ai/eval/thread-credential-allowlist.service.js +29 -0
- package/dist/modules/instance-ai/eval/thread-credential-allowlist.service.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-credit.service.d.ts +26 -0
- package/dist/modules/instance-ai/instance-ai-credit.service.js +210 -0
- package/dist/modules/instance-ai/instance-ai-credit.service.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-model.service.d.ts +20 -0
- package/dist/modules/instance-ai/instance-ai-model.service.js +135 -0
- package/dist/modules/instance-ai/instance-ai-model.service.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-run-probe.d.ts +5 -0
- package/dist/modules/instance-ai/instance-ai-run-probe.js +26 -0
- package/dist/modules/instance-ai/instance-ai-run-probe.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +2 -0
- package/dist/modules/instance-ai/instance-ai-settings.service.js +12 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-temporary-workflow.service.d.ts +15 -0
- package/dist/modules/instance-ai/instance-ai-temporary-workflow.service.js +140 -0
- package/dist/modules/instance-ai/instance-ai-temporary-workflow.service.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +4 -2
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +69 -10
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +20 -2
- package/dist/modules/instance-ai/instance-ai.controller.js +62 -4
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +2 -1
- package/dist/modules/instance-ai/instance-ai.module.js +3 -0
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +42 -22
- package/dist/modules/instance-ai/instance-ai.service.js +408 -379
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/internal-messages.d.ts +4 -0
- package/dist/modules/instance-ai/internal-messages.js +24 -3
- package/dist/modules/instance-ai/internal-messages.js.map +1 -1
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.d.ts +1 -1
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.js +2 -6
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.js.map +1 -1
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.d.ts +6 -1
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js +52 -2
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js.map +1 -1
- package/dist/modules/instance-ai/message-parser.js +2 -0
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-ai/observability.d.ts +13 -0
- package/dist/modules/instance-ai/observability.js +23 -0
- package/dist/modules/instance-ai/observability.js.map +1 -0
- package/dist/modules/instance-ai/repositories/index.d.ts +1 -0
- package/dist/modules/instance-ai/repositories/index.js +3 -1
- package/dist/modules/instance-ai/repositories/index.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-thread-grant.repository.d.ts +7 -0
- package/dist/modules/instance-ai/repositories/instance-ai-thread-grant.repository.js +40 -0
- package/dist/modules/instance-ai/repositories/instance-ai-thread-grant.repository.js.map +1 -0
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js +2 -1
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js +4 -6
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js.map +1 -1
- package/dist/modules/instance-ai/web-research/fetch-and-extract.d.ts +2 -3
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js +34 -44
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js.map +1 -1
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-from-db.d.ts +2 -1
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-from-db.js +2 -2
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-from-db.js.map +1 -1
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.d.ts +8 -8
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js +43 -60
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js.map +1 -1
- package/dist/modules/log-streaming.ee/log-streaming-destination.service.d.ts +3 -1
- package/dist/modules/log-streaming.ee/log-streaming-destination.service.js +6 -3
- package/dist/modules/log-streaming.ee/log-streaming-destination.service.js.map +1 -1
- package/dist/modules/log-streaming.ee/log-streaming.controller.d.ts +3 -1
- package/dist/modules/log-streaming.ee/log-streaming.controller.js +6 -3
- package/dist/modules/log-streaming.ee/log-streaming.controller.js.map +1 -1
- package/dist/modules/mcp/dto/update-allowed-redirect-uris.dto.d.ts +9 -0
- package/dist/modules/mcp/dto/update-allowed-redirect-uris.dto.js +35 -0
- package/dist/modules/mcp/dto/update-allowed-redirect-uris.dto.js.map +1 -0
- package/dist/modules/mcp/mcp-protected-resource.d.ts +4 -1
- package/dist/modules/mcp/mcp-protected-resource.js +9 -3
- package/dist/modules/mcp/mcp-protected-resource.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +5 -2
- package/dist/modules/mcp/mcp.service.js +8 -3
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.settings.controller.d.ts +7 -0
- package/dist/modules/mcp/mcp.settings.controller.js +24 -0
- package/dist/modules/mcp/mcp.settings.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.settings.service.d.ts +2 -0
- package/dist/modules/mcp/mcp.settings.service.js +15 -0
- package/dist/modules/mcp/mcp.settings.service.js.map +1 -1
- package/dist/modules/mcp/mcp.typeguards.d.ts +0 -1
- package/dist/modules/mcp/mcp.typeguards.js +9 -12
- package/dist/modules/mcp/mcp.typeguards.js.map +1 -1
- package/dist/modules/mcp/mcp.utils.js +2 -1
- package/dist/modules/mcp/mcp.utils.js.map +1 -1
- package/dist/modules/mcp/tools/execute-workflow.tool.d.ts +10 -8
- package/dist/modules/mcp/tools/execute-workflow.tool.js +25 -13
- package/dist/modules/mcp/tools/execute-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-workflow-details.tool.js +2 -0
- package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
- package/dist/modules/mcp/tools/schemas.d.ts +128 -0
- package/dist/modules/mcp/tools/schemas.js +9 -0
- package/dist/modules/mcp/tools/schemas.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +15 -4
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/credential-validation.d.ts +13 -2
- package/dist/modules/mcp/tools/workflow-builder/credential-validation.js +144 -23
- package/dist/modules/mcp/tools/workflow-builder/credential-validation.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +23 -6
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.d.ts +31 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +22 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-pipeline.js +40 -19
- package/dist/modules/n8n-packages/engine/import-pipeline.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-importer.d.ts +8 -4
- package/dist/modules/n8n-packages/entities/credential/credential-importer.js +40 -6
- package/dist/modules/n8n-packages/entities/credential/credential-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-matcher.d.ts +7 -3
- package/dist/modules/n8n-packages/entities/credential/credential-matcher.js +30 -5
- package/dist/modules/n8n-packages/entities/credential/credential-matcher.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-missing-mode.d.ts +3 -0
- package/dist/modules/n8n-packages/entities/credential/credential-missing-mode.js +17 -0
- package/dist/modules/n8n-packages/entities/credential/credential-missing-mode.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential.types.d.ts +10 -4
- package/dist/modules/n8n-packages/entities/credential/credential.types.js +2 -0
- 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 +3 -4
- package/dist/modules/n8n-packages/entities/credential/id-based-credential-matcher.js +10 -11
- package/dist/modules/n8n-packages/entities/credential/id-based-credential-matcher.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-import.types.d.ts +6 -6
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.d.ts +3 -3
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +12 -10
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.d.ts +6 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js +33 -11
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.types.d.ts +8 -0
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +23 -3
- package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
- package/dist/modules/oauth-jwe/oauth-jwe.schemas.d.ts +12 -12
- package/dist/modules/oauth-server/oauth-consent.controller.js +1 -0
- package/dist/modules/oauth-server/oauth-consent.controller.js.map +1 -1
- package/dist/modules/oauth-server/oauth-consent.service.d.ts +1 -0
- package/dist/modules/oauth-server/oauth-consent.service.js +2 -0
- package/dist/modules/oauth-server/oauth-consent.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth-server.module.js +1 -1
- package/dist/modules/oauth-server/oauth-server.module.js.map +1 -1
- package/dist/modules/oauth-server/oauth-server.service.d.ts +2 -0
- package/dist/modules/oauth-server/oauth-server.service.js +48 -1
- package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth.controller.js +4 -1
- package/dist/modules/oauth-server/oauth.controller.js.map +1 -1
- package/dist/modules/otel/otel.service.d.ts +3 -1
- package/dist/modules/otel/otel.service.js +6 -3
- package/dist/modules/otel/otel.service.js.map +1 -1
- package/dist/modules/quick-connect/handlers/firecrawl.handler.d.ts +3 -0
- package/dist/modules/quick-connect/handlers/firecrawl.handler.js +20 -7
- package/dist/modules/quick-connect/handlers/firecrawl.handler.js.map +1 -1
- package/dist/modules/quick-connect/quick-connect.config.d.ts +17 -17
- package/dist/modules/quick-connect/quick-connect.module.d.ts +3 -3
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +4 -4
- package/dist/modules/source-control.ee/source-control.service.ee.d.ts +2 -2
- package/dist/modules/sso-oidc/oidc.service.ee.d.ts +3 -1
- package/dist/modules/sso-oidc/oidc.service.ee.js +15 -25
- package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -1
- package/dist/modules/sso-saml/saml.service.ee.d.ts +3 -1
- package/dist/modules/sso-saml/saml.service.ee.js +15 -15
- package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
- package/dist/modules/token-exchange/services/jwks-resolver.d.ts +3 -1
- package/dist/modules/token-exchange/services/jwks-resolver.js +11 -3
- package/dist/modules/token-exchange/services/jwks-resolver.js.map +1 -1
- package/dist/oauth/oauth.service.d.ts +8 -3
- package/dist/oauth/oauth.service.js +106 -47
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/oauth/types.d.ts +1 -1
- package/dist/oauth/types.js.map +1 -1
- package/dist/posthog/index.js +4 -3
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/index.js +46 -3
- package/dist/public-api/index.js.map +1 -1
- package/dist/public-api/swagger-theme.css +14 -0
- package/dist/public-api/types.d.ts +2 -0
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js +4 -3
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/discover/discover.service.js +9 -11
- package/dist/public-api/v1/handlers/discover/discover.service.js.map +1 -1
- package/dist/public-api/v1/handlers/executions/executions.handler.js +8 -4
- package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js +3 -1
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.service.d.ts +1 -2
- package/dist/public-api/v1/handlers/workflows/workflows.service.js +3 -2
- package/dist/public-api/v1/handlers/workflows/workflows.service.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +124 -2
- package/dist/response-helper.d.ts +2 -1
- package/dist/response-helper.js +2 -17
- package/dist/response-helper.js.map +1 -1
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/constants.js +3 -0
- package/dist/scaling/constants.js.map +1 -1
- package/dist/scaling/execution-stop.service.d.ts +15 -0
- package/dist/scaling/execution-stop.service.js +59 -0
- package/dist/scaling/execution-stop.service.js.map +1 -0
- package/dist/scaling/job-processor.js +8 -2
- package/dist/scaling/job-processor.js.map +1 -1
- package/dist/scaling/multi-main-setup.ee.d.ts +1 -0
- package/dist/scaling/multi-main-setup.ee.js +6 -6
- package/dist/scaling/multi-main-setup.ee.js.map +1 -1
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +4 -0
- package/dist/scaling/pubsub/pubsub.types.d.ts +3 -1
- package/dist/security-audit/risk-reporters/instance-risk-reporter.d.ts +3 -1
- package/dist/security-audit/risk-reporters/instance-risk-reporter.js +27 -20
- package/dist/security-audit/risk-reporters/instance-risk-reporter.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.service.d.ts +5 -1
- package/dist/services/ai-gateway.service.js +53 -32
- package/dist/services/ai-gateway.service.js.map +1 -1
- package/dist/services/ai-workflow-builder.service.d.ts +4 -3
- package/dist/services/ai-workflow-builder.service.js +9 -5
- package/dist/services/ai-workflow-builder.service.js.map +1 -1
- package/dist/services/credentials-tester.service.js +16 -15
- package/dist/services/credentials-tester.service.js.map +1 -1
- package/dist/services/dynamic-templates.service.d.ts +3 -1
- package/dist/services/dynamic-templates.service.js +13 -9
- package/dist/services/dynamic-templates.service.js.map +1 -1
- package/dist/services/frontend.service.d.ts +6 -1
- package/dist/services/frontend.service.js +39 -2
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/node-resource-explorer.service.js +4 -22
- package/dist/services/node-resource-explorer.service.js.map +1 -1
- package/dist/services/project.service.ee.d.ts +3 -2
- package/dist/services/project.service.ee.js +14 -3
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/protected-resource.registry.d.ts +1 -0
- package/dist/services/protected-resource.registry.js.map +1 -1
- package/dist/services/public-api-key.service.d.ts +6 -2
- package/dist/services/public-api-key.service.js +56 -10
- package/dist/services/public-api-key.service.js.map +1 -1
- package/dist/services/role.service.d.ts +2 -2
- package/dist/services/role.service.js.map +1 -1
- package/dist/services/trigger-auth-identity-seeder-proxy.service.d.ts +10 -0
- package/dist/services/trigger-auth-identity-seeder-proxy.service.js +33 -0
- package/dist/services/trigger-auth-identity-seeder-proxy.service.js.map +1 -0
- package/dist/services/workflow-statistics.service.d.ts +3 -13
- package/dist/services/workflow-statistics.service.js +77 -64
- package/dist/services/workflow-statistics.service.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker-server.js +2 -1
- package/dist/task-runners/task-broker/task-broker-server.js.map +1 -1
- package/dist/task-runners/task-runner-module.js +2 -0
- package/dist/task-runners/task-runner-module.js.map +1 -1
- package/dist/telemetry/index.d.ts +25 -2
- package/dist/telemetry/index.js +80 -12
- package/dist/telemetry/index.js.map +1 -1
- package/dist/utils/ai-proxy-fetch.d.ts +3 -0
- package/dist/utils/ai-proxy-fetch.js +27 -0
- package/dist/utils/ai-proxy-fetch.js.map +1 -0
- package/dist/utils/auth-fetch.d.ts +3 -1
- package/dist/utils/auth-fetch.js +3 -4
- package/dist/utils/auth-fetch.js.map +1 -1
- package/dist/utils/strapi-utils.d.ts +8 -4
- package/dist/utils/strapi-utils.js +25 -9
- package/dist/utils/strapi-utils.js.map +1 -1
- package/dist/webhooks/live-webhooks.js +1 -0
- package/dist/webhooks/live-webhooks.js.map +1 -1
- package/dist/webhooks/test-webhooks.controller.d.ts +8 -0
- package/dist/webhooks/test-webhooks.controller.js +39 -0
- package/dist/webhooks/test-webhooks.controller.js.map +1 -0
- package/dist/webhooks/webhook-form-data.js +9 -1
- package/dist/webhooks/webhook-form-data.js.map +1 -1
- package/dist/webhooks/webhook-helpers.js +16 -0
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/webhooks/webhook-request-handler.js +35 -0
- package/dist/webhooks/webhook-request-handler.js.map +1 -1
- package/dist/workflow-execute-additional-data.js +15 -0
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.d.ts +7 -2
- package/dist/workflow-helpers.js +50 -1
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflows/publication/publication-result.d.ts +2 -0
- package/dist/workflows/publication/publication-status-reporter.d.ts +1 -0
- package/dist/workflows/publication/publication-status-reporter.js +22 -1
- package/dist/workflows/publication/publication-status-reporter.js.map +1 -1
- package/dist/workflows/publication/published-workflow-enqueuer.d.ts +13 -0
- package/dist/workflows/publication/published-workflow-enqueuer.js +53 -0
- package/dist/workflows/publication/published-workflow-enqueuer.js.map +1 -0
- package/dist/workflows/publication/published-workflow-trigger-deactivator.d.ts +16 -0
- package/dist/workflows/publication/published-workflow-trigger-deactivator.js +79 -0
- package/dist/workflows/publication/published-workflow-trigger-deactivator.js.map +1 -0
- package/dist/workflows/publication/workflow-publication-applier.d.ts +6 -1
- package/dist/workflows/publication/workflow-publication-applier.js +39 -3
- package/dist/workflows/publication/workflow-publication-applier.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-lifecycle-lock.d.ts +13 -0
- package/dist/workflows/publication/workflow-publication-lifecycle-lock.js +104 -0
- package/dist/workflows/publication/workflow-publication-lifecycle-lock.js.map +1 -0
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.d.ts +19 -0
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.js +109 -0
- package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.js.map +1 -0
- package/dist/workflows/publication/workflow-publication-outbox-consumer.d.ts +11 -4
- package/dist/workflows/publication/workflow-publication-outbox-consumer.js +105 -45
- package/dist/workflows/publication/workflow-publication-outbox-consumer.js.map +1 -1
- package/dist/workflows/triggers/non-webhook-trigger-registrar.d.ts +4 -5
- package/dist/workflows/triggers/non-webhook-trigger-registrar.js +30 -9
- package/dist/workflows/triggers/non-webhook-trigger-registrar.js.map +1 -1
- package/dist/workflows/triggers/trigger-activation-retry.d.ts +2 -0
- package/dist/workflows/triggers/trigger-activation-retry.js +23 -0
- package/dist/workflows/triggers/trigger-activation-retry.js.map +1 -0
- package/dist/workflows/triggers/webhook-trigger-registrar.d.ts +3 -2
- package/dist/workflows/triggers/webhook-trigger-registrar.js +60 -32
- package/dist/workflows/triggers/webhook-trigger-registrar.js.map +1 -1
- package/dist/workflows/triggers/workflow-trigger-activator.d.ts +6 -3
- package/dist/workflows/triggers/workflow-trigger-activator.js +126 -60
- package/dist/workflows/triggers/workflow-trigger-activator.js.map +1 -1
- package/dist/workflows/workflow-creation.service.d.ts +1 -0
- package/dist/workflows/workflow-creation.service.js +17 -8
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow-entity-mapper.d.ts +5 -0
- package/dist/workflows/workflow-entity-mapper.js +22 -0
- package/dist/workflows/workflow-entity-mapper.js.map +1 -0
- package/dist/workflows/workflow-execution.service.d.ts +6 -2
- package/dist/workflows/workflow-execution.service.js +36 -13
- package/dist/workflows/workflow-execution.service.js.map +1 -1
- package/dist/workflows/workflow-history/workflow-history.service.js +1 -0
- package/dist/workflows/workflow-history/workflow-history.service.js.map +1 -1
- package/dist/workflows/workflow-published-data.service.d.ts +1 -3
- package/dist/workflows/workflow-published-data.service.js +2 -9
- package/dist/workflows/workflow-published-data.service.js.map +1 -1
- package/dist/workflows/workflow-validation.service.js +2 -1
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +4 -3
- package/dist/workflows/workflow.service.js +72 -33
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +3 -2
- package/dist/workflows/workflows.controller.js +12 -23
- package/dist/workflows/workflows.controller.js.map +1 -1
- package/package.json +55 -37
- package/templates/form-trigger.handlebars +8 -1
|
@@ -9,7 +9,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ChatIntegrationActionExecutor = void 0;
|
|
12
|
+
exports.ChatIntegrationActionExecutor = exports.respondInputSchema = void 0;
|
|
13
|
+
const api_types_1 = require("@n8n/api-types");
|
|
13
14
|
const di_1 = require("@n8n/di");
|
|
14
15
|
const zod_1 = require("zod");
|
|
15
16
|
const agent_chat_integration_1 = require("./agent-chat-integration");
|
|
@@ -18,20 +19,8 @@ const component_mapper_1 = require("./component-mapper");
|
|
|
18
19
|
const integration_error_codes_1 = require("./integration-error-codes");
|
|
19
20
|
const integration_helpers_1 = require("./integration-helpers");
|
|
20
21
|
const slack_operations_1 = require("./platforms/slack-operations");
|
|
21
|
-
const messageSchema =
|
|
22
|
-
|
|
23
|
-
text: zod_1.z.string().optional(),
|
|
24
|
-
card: zod_1.z
|
|
25
|
-
.object({
|
|
26
|
-
awaitResponse: zod_1.z.boolean().optional(),
|
|
27
|
-
title: zod_1.z.string().optional(),
|
|
28
|
-
message: zod_1.z.string().optional(),
|
|
29
|
-
components: zod_1.z.array(zod_1.z.object({ type: zod_1.z.string() }).passthrough()).min(1),
|
|
30
|
-
})
|
|
31
|
-
.optional(),
|
|
32
|
-
})
|
|
33
|
-
.strict();
|
|
34
|
-
const respondInputSchema = zod_1.z.object({ message: messageSchema });
|
|
22
|
+
const messageSchema = api_types_1.richMessageSchema;
|
|
23
|
+
exports.respondInputSchema = zod_1.z.object({ message: messageSchema });
|
|
35
24
|
const sendDmInputSchema = zod_1.z.object({
|
|
36
25
|
userId: zod_1.z.string().min(1),
|
|
37
26
|
message: messageSchema,
|
|
@@ -49,9 +38,32 @@ let ChatIntegrationActionExecutor = class ChatIntegrationActionExecutor {
|
|
|
49
38
|
async execute(params) {
|
|
50
39
|
if (!params.descriptor.agentId)
|
|
51
40
|
return (0, integration_helpers_1.connectionUnavailable)();
|
|
41
|
+
const unsupportedAction = () => (0, integration_helpers_1.integrationError)(integration_error_codes_1.INTEGRATION_ERROR_CODES.UNSUPPORTED_ACTION, `The ${params.descriptor.integration.type} integration does not support ${params.action}.`);
|
|
42
|
+
const integrationDef = this.integrationRegistry.get(params.descriptor.integration.type);
|
|
43
|
+
if (integrationDef && !integrationDef.requiresChatInstance) {
|
|
44
|
+
if (!integrationDef.executeAction) {
|
|
45
|
+
return unsupportedAction();
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const result = await integrationDef.executeAction({
|
|
49
|
+
chat: undefined,
|
|
50
|
+
descriptor: params.descriptor,
|
|
51
|
+
action: params.action,
|
|
52
|
+
input: params.input,
|
|
53
|
+
currentMessageContext: params.currentMessageContext,
|
|
54
|
+
});
|
|
55
|
+
return result ?? unsupportedAction();
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
return (0, integration_helpers_1.integrationError)(integration_error_codes_1.INTEGRATION_ERROR_CODES.ACTION_FAILED, error instanceof Error ? error.message : String(error));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const { credentialId } = params.descriptor.integration;
|
|
62
|
+
if (!credentialId)
|
|
63
|
+
return (0, integration_helpers_1.connectionUnavailable)();
|
|
52
64
|
const chat = this.chatIntegrationService.getChatInstance(params.descriptor.agentId, {
|
|
53
65
|
type: params.descriptor.integration.type,
|
|
54
|
-
credentialId
|
|
66
|
+
credentialId,
|
|
55
67
|
});
|
|
56
68
|
if (!chat)
|
|
57
69
|
return (0, integration_helpers_1.connectionUnavailable)();
|
|
@@ -62,9 +74,8 @@ let ChatIntegrationActionExecutor = class ChatIntegrationActionExecutor {
|
|
|
62
74
|
if (params.action === 'send_dm') {
|
|
63
75
|
return await this.sendDirectMessage(chat, params);
|
|
64
76
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const result = await integration.executeAction({
|
|
77
|
+
if (integrationDef?.executeAction) {
|
|
78
|
+
const result = await integrationDef.executeAction({
|
|
68
79
|
chat,
|
|
69
80
|
descriptor: params.descriptor,
|
|
70
81
|
action: params.action,
|
|
@@ -77,14 +88,14 @@ let ChatIntegrationActionExecutor = class ChatIntegrationActionExecutor {
|
|
|
77
88
|
if (params.action === 'send_channel_message') {
|
|
78
89
|
return await this.sendChannelMessage(chat, params);
|
|
79
90
|
}
|
|
80
|
-
return (
|
|
91
|
+
return unsupportedAction();
|
|
81
92
|
}
|
|
82
93
|
catch (error) {
|
|
83
94
|
return (0, integration_helpers_1.integrationError)(integration_error_codes_1.INTEGRATION_ERROR_CODES.ACTION_FAILED, error instanceof Error ? error.message : String(error));
|
|
84
95
|
}
|
|
85
96
|
}
|
|
86
97
|
async respondInCurrentThread(chat, params) {
|
|
87
|
-
const input = respondInputSchema.parse(params.input);
|
|
98
|
+
const input = exports.respondInputSchema.parse(params.input);
|
|
88
99
|
const threadId = params.currentMessageContext?.target.threadId;
|
|
89
100
|
if (!threadId) {
|
|
90
101
|
return (0, integration_helpers_1.integrationError)(integration_error_codes_1.INTEGRATION_ERROR_CODES.NO_MESSAGE_CONTEXT, 'There is no current message context. Use an explicit send action.');
|
|
@@ -148,9 +159,12 @@ let ChatIntegrationActionExecutor = class ChatIntegrationActionExecutor {
|
|
|
148
159
|
const { agentId, integration } = descriptor;
|
|
149
160
|
if (!agentId)
|
|
150
161
|
return undefined;
|
|
162
|
+
const { credentialId } = integration;
|
|
163
|
+
if (!credentialId)
|
|
164
|
+
return undefined;
|
|
151
165
|
return this.chatIntegrationService.getShortenCallback(agentId, {
|
|
152
166
|
type: integration.type,
|
|
153
|
-
credentialId
|
|
167
|
+
credentialId,
|
|
154
168
|
});
|
|
155
169
|
}
|
|
156
170
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-action-executor.js","sourceRoot":"","sources":["../../../../src/modules/agents/integrations/integration-action-executor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAElC,6BAAwB;AAExB,qEAAmE;AACnE,yEAAuF;AACvF,yDAI4B;AAC5B,uEAAoE;AACpE,+DAI+B;AAQ/B,mEAAoE;
|
|
1
|
+
{"version":3,"file":"integration-action-executor.js","sourceRoot":"","sources":["../../../../src/modules/agents/integrations/integration-action-executor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAmD;AACnD,gCAAkC;AAElC,6BAAwB;AAExB,qEAAmE;AACnE,yEAAuF;AACvF,yDAI4B;AAC5B,uEAAoE;AACpE,+DAI+B;AAQ/B,mEAAoE;AAIpE,MAAM,aAAa,GAAG,6BAAiB,CAAC;AAE3B,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC;AACvE,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,OAAO,EAAE,aAAa;CACtB,CAAC,CAAC;AACH,MAAM,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,OAAO,EAAE,aAAa;CACtB,CAAC,CAAC;AAWI,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAGzC,YACkB,sBAA8C,EAC9C,mBAA4C;QAD5C,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC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EAAE;YAC9D,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,YAAY;SACZ,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;AArMY,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,YAAO,GAAE;qCAKiC,iDAAsB;QACzB,gDAAuB;GALlD,6BAA6B,CAqMzC;AAYD,SAAS,kCAAkC,CAAC,MAI3C;IACA,OAAO;QACN,uBAAuB,EAAE,MAAM,CAAC,UAAU,CAAC,uBAAuB;QAClE,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI;QAC5C,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;QACzB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACnC,CAAC;AACH,CAAC;AAED,KAAK,UAAU,yBAAyB,CACvC,UAA+C,EAC/C,MAA2C;IAE3C,IAAI,UAAU,CAAC,WAAW,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO;IACpD,MAAM,IAAA,uCAAoB,EAAC,MAAM,CAAC,CAAC;AACpC,CAAC;AAED,KAAK,UAAU,6BAA6B,CAC3C,UAA+C,EAC/C,IAAkB,EAClB,QAA4B;IAE5B,IAAI,UAAU,CAAC,WAAW,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,QAAQ;QAAE,OAAO;IACjE,MAAM,IAAA,uCAAoB,EAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -23,18 +23,37 @@ let ChatIntegrationContextQueryExecutor = class ChatIntegrationContextQueryExecu
|
|
|
23
23
|
async execute(params) {
|
|
24
24
|
if (!params.descriptor.agentId)
|
|
25
25
|
return (0, integration_helpers_1.connectionUnavailable)();
|
|
26
|
+
const integrationDef = this.integrationRegistry.get(params.descriptor.integration.type);
|
|
27
|
+
if (integrationDef && !integrationDef.requiresChatInstance) {
|
|
28
|
+
if (!integrationDef.executeContextQuery) {
|
|
29
|
+
return (0, integration_helpers_1.integrationError)(integration_error_codes_1.INTEGRATION_ERROR_CODES.UNSUPPORTED_QUERY, `The ${params.descriptor.integration.type} integration does not support context queries.`);
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
return await integrationDef.executeContextQuery({
|
|
33
|
+
chat: undefined,
|
|
34
|
+
descriptor: params.descriptor,
|
|
35
|
+
query: params.query,
|
|
36
|
+
input: params.input,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
return (0, integration_helpers_1.integrationError)(integration_error_codes_1.INTEGRATION_ERROR_CODES.CONTEXT_QUERY_FAILED, error instanceof Error ? error.message : String(error));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const { credentialId } = params.descriptor.integration;
|
|
44
|
+
if (!credentialId)
|
|
45
|
+
return (0, integration_helpers_1.connectionUnavailable)();
|
|
26
46
|
const chat = this.chatIntegrationService.getChatInstance(params.descriptor.agentId, {
|
|
27
47
|
type: params.descriptor.integration.type,
|
|
28
|
-
credentialId
|
|
48
|
+
credentialId,
|
|
29
49
|
});
|
|
30
50
|
if (!chat)
|
|
31
51
|
return (0, integration_helpers_1.connectionUnavailable)();
|
|
32
|
-
|
|
33
|
-
if (!integration?.executeContextQuery) {
|
|
52
|
+
if (!integrationDef?.executeContextQuery) {
|
|
34
53
|
return (0, integration_helpers_1.integrationError)(integration_error_codes_1.INTEGRATION_ERROR_CODES.UNSUPPORTED_QUERY, `The ${params.descriptor.integration.type} integration does not support context queries.`);
|
|
35
54
|
}
|
|
36
55
|
try {
|
|
37
|
-
return await
|
|
56
|
+
return await integrationDef.executeContextQuery({
|
|
38
57
|
chat,
|
|
39
58
|
descriptor: params.descriptor,
|
|
40
59
|
query: params.query,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-context-query-executor.js","sourceRoot":"","sources":["../../../../src/modules/agents/integrations/integration-context-query-executor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAElC,qEAAmE;AACnE,yEAAoE;AACpE,uEAAoE;AACpE,+DAAgF;AAazE,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAC/C,YACkB,sBAA8C,EAC9C,mBAA4C;QAD5C,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,wBAAmB,GAAnB,mBAAmB,CAAyB;IAC3D,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,MAKb;QACA,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO;YAAE,OAAO,IAAA,2CAAqB,GAAE,CAAC;QAE/D,MAAM,
|
|
1
|
+
{"version":3,"file":"integration-context-query-executor.js","sourceRoot":"","sources":["../../../../src/modules/agents/integrations/integration-context-query-executor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAElC,qEAAmE;AACnE,yEAAoE;AACpE,uEAAoE;AACpE,+DAAgF;AAazE,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAC/C,YACkB,sBAA8C,EAC9C,mBAA4C;QAD5C,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,wBAAmB,GAAnB,mBAAmB,CAAyB;IAC3D,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,MAKb;QACA,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO;YAAE,OAAO,IAAA,2CAAqB,GAAE,CAAC;QAE/D,MAAM,cAAc,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACxF,IAAI,cAAc,IAAI,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC;YAC5D,IAAI,CAAC,cAAc,CAAC,mBAAmB,EAAE,CAAC;gBACzC,OAAO,IAAA,sCAAgB,EACtB,iDAAuB,CAAC,iBAAiB,EACzC,OAAO,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,gDAA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AAM,CAAC,KAAK;aACnB,CAAC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,IAAA,sCAAgB,EACtB,iDAAuB,CAAC,oBAAoB,EAC5C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACtD,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAA;AAnEY,kFAAmC;8CAAnC,mCAAmC;IAD/C,IAAA,YAAO,GAAE;qCAGiC,iDAAsB;QACzB,gDAAuB;GAHlD,mCAAmC,CAmE/C;AAID,mEAA6F;AAApF,2HAAA,sBAAsB,OAAA;AAAE,yHAAA,oBAAoB,OAAA"}
|
|
@@ -11,7 +11,6 @@ export declare function connectionUnavailable(): IntegrationErrorResponse;
|
|
|
11
11
|
export declare function unsupportedQuery(platform: string, query: string): IntegrationErrorResponse;
|
|
12
12
|
export declare function unsupportedAction(platform: string, action: string): IntegrationErrorResponse;
|
|
13
13
|
export declare function normalizePlatformId(platform: string, id: string): string;
|
|
14
|
-
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
15
14
|
export declare function stringValue(value: unknown): string | undefined;
|
|
16
15
|
export declare function stringProperty(value: unknown, key: string): string | undefined;
|
|
17
16
|
export declare function numberProperty(value: unknown, key: string): number | undefined;
|
|
@@ -19,3 +18,15 @@ export declare function booleanProperty(value: unknown, key: string): boolean |
|
|
|
19
18
|
export declare function isoDateProperty(value: unknown, key: string): string | undefined;
|
|
20
19
|
export declare function removeUndefinedValues<T extends Record<string, unknown>>(value: T): Record<string, unknown>;
|
|
21
20
|
export declare function isDefined<T>(value: T | undefined): value is T;
|
|
21
|
+
export declare function hasUpdateIssueField(input: {
|
|
22
|
+
issueId: string;
|
|
23
|
+
teamId?: string | null;
|
|
24
|
+
title?: string;
|
|
25
|
+
description?: string | null;
|
|
26
|
+
assigneeId?: string | null;
|
|
27
|
+
projectId?: string | null;
|
|
28
|
+
labelIds?: string[];
|
|
29
|
+
priority?: number | null;
|
|
30
|
+
stateId?: string | null;
|
|
31
|
+
parentId?: string | null;
|
|
32
|
+
}): boolean;
|
|
@@ -5,7 +5,6 @@ exports.connectionUnavailable = connectionUnavailable;
|
|
|
5
5
|
exports.unsupportedQuery = unsupportedQuery;
|
|
6
6
|
exports.unsupportedAction = unsupportedAction;
|
|
7
7
|
exports.normalizePlatformId = normalizePlatformId;
|
|
8
|
-
exports.isRecord = isRecord;
|
|
9
8
|
exports.stringValue = stringValue;
|
|
10
9
|
exports.stringProperty = stringProperty;
|
|
11
10
|
exports.numberProperty = numberProperty;
|
|
@@ -13,6 +12,8 @@ exports.booleanProperty = booleanProperty;
|
|
|
13
12
|
exports.isoDateProperty = isoDateProperty;
|
|
14
13
|
exports.removeUndefinedValues = removeUndefinedValues;
|
|
15
14
|
exports.isDefined = isDefined;
|
|
15
|
+
exports.hasUpdateIssueField = hasUpdateIssueField;
|
|
16
|
+
const utils_1 = require("@n8n/utils");
|
|
16
17
|
const integration_error_codes_1 = require("./integration-error-codes");
|
|
17
18
|
function integrationError(code, message) {
|
|
18
19
|
return { ok: false, error: { code, message } };
|
|
@@ -29,31 +30,28 @@ function unsupportedAction(platform, action) {
|
|
|
29
30
|
function normalizePlatformId(platform, id) {
|
|
30
31
|
return id.includes(':') ? id : `${platform}:${id}`;
|
|
31
32
|
}
|
|
32
|
-
function isRecord(value) {
|
|
33
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
34
|
-
}
|
|
35
33
|
function stringValue(value) {
|
|
36
34
|
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
37
35
|
}
|
|
38
36
|
function stringProperty(value, key) {
|
|
39
|
-
if (!isRecord(value))
|
|
37
|
+
if (!(0, utils_1.isRecord)(value))
|
|
40
38
|
return undefined;
|
|
41
39
|
return stringValue(value[key]);
|
|
42
40
|
}
|
|
43
41
|
function numberProperty(value, key) {
|
|
44
|
-
if (!isRecord(value))
|
|
42
|
+
if (!(0, utils_1.isRecord)(value))
|
|
45
43
|
return undefined;
|
|
46
44
|
const property = value[key];
|
|
47
45
|
return typeof property === 'number' ? property : undefined;
|
|
48
46
|
}
|
|
49
47
|
function booleanProperty(value, key) {
|
|
50
|
-
if (!isRecord(value))
|
|
48
|
+
if (!(0, utils_1.isRecord)(value))
|
|
51
49
|
return undefined;
|
|
52
50
|
const property = value[key];
|
|
53
51
|
return typeof property === 'boolean' ? property : undefined;
|
|
54
52
|
}
|
|
55
53
|
function isoDateProperty(value, key) {
|
|
56
|
-
if (!isRecord(value))
|
|
54
|
+
if (!(0, utils_1.isRecord)(value))
|
|
57
55
|
return undefined;
|
|
58
56
|
const property = value[key];
|
|
59
57
|
if (property instanceof Date)
|
|
@@ -69,4 +67,15 @@ function removeUndefinedValues(value) {
|
|
|
69
67
|
function isDefined(value) {
|
|
70
68
|
return value !== undefined;
|
|
71
69
|
}
|
|
70
|
+
function hasUpdateIssueField(input) {
|
|
71
|
+
return (input.teamId !== undefined ||
|
|
72
|
+
input.title !== undefined ||
|
|
73
|
+
input.description !== undefined ||
|
|
74
|
+
input.assigneeId !== undefined ||
|
|
75
|
+
input.projectId !== undefined ||
|
|
76
|
+
input.labelIds !== undefined ||
|
|
77
|
+
input.priority !== undefined ||
|
|
78
|
+
input.stateId !== undefined ||
|
|
79
|
+
input.parentId !== undefined);
|
|
80
|
+
}
|
|
72
81
|
//# sourceMappingURL=integration-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-helpers.js","sourceRoot":"","sources":["../../../../src/modules/agents/integrations/integration-helpers.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"integration-helpers.js","sourceRoot":"","sources":["../../../../src/modules/agents/integrations/integration-helpers.ts"],"names":[],"mappings":";;AAYA,4CAKC;AAED,sDAKC;AAED,4CAKC;AAED,8CAKC;AAED,kDAEC;AAED,kCAEC;AAED,wCAGC;AAED,wCAIC;AAED,0CAIC;AAED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AAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,SAAgB,SAAS,CAAI,KAAoB;IAChD,OAAO,KAAK,KAAK,SAAS,CAAC;AAC5B,CAAC;AAED,SAAgB,mBAAmB,CAAC,KAWnC;IACA,OAAO,CACN,KAAK,CAAC,MAAM,KAAK,SAAS;QAC1B,KAAK,CAAC,KAAK,KAAK,SAAS;QACzB,KAAK,CAAC,WAAW,KAAK,SAAS;QAC/B,KAAK,CAAC,UAAU,KAAK,SAAS;QAC9B,KAAK,CAAC,SAAS,KAAK,SAAS;QAC7B,KAAK,CAAC,QAAQ,KAAK,SAAS;QAC5B,KAAK,CAAC,QAAQ,KAAK,SAAS;QAC5B,KAAK,CAAC,OAAO,KAAK,SAAS;QAC3B,KAAK,CAAC,QAAQ,KAAK,SAAS,CAC5B,CAAC;AACH,CAAC"}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.IntegrationMessageContextService = void 0;
|
|
13
13
|
exports.isIntegrationMessageContext = isIntegrationMessageContext;
|
|
14
14
|
const di_1 = require("@n8n/di");
|
|
15
|
+
const utils_1 = require("@n8n/utils");
|
|
15
16
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
16
17
|
const agent_resource_repository_1 = require("../repositories/agent-resource.repository");
|
|
17
18
|
const agent_thread_repository_1 = require("../repositories/agent-thread.repository");
|
|
@@ -56,7 +57,7 @@ let IntegrationMessageContextService = class IntegrationMessageContextService {
|
|
|
56
57
|
return {};
|
|
57
58
|
try {
|
|
58
59
|
const parsed = (0, n8n_workflow_1.jsonParse)(value);
|
|
59
|
-
return isRecord(parsed) ? parsed : {};
|
|
60
|
+
return (0, utils_1.isRecord)(parsed) ? parsed : {};
|
|
60
61
|
}
|
|
61
62
|
catch {
|
|
62
63
|
return {};
|
|
@@ -69,9 +70,6 @@ exports.IntegrationMessageContextService = IntegrationMessageContextService = __
|
|
|
69
70
|
__metadata("design:paramtypes", [agent_thread_repository_1.AgentThreadRepository,
|
|
70
71
|
agent_resource_repository_1.AgentResourceRepository])
|
|
71
72
|
], IntegrationMessageContextService);
|
|
72
|
-
function isRecord(value) {
|
|
73
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
74
|
-
}
|
|
75
73
|
function isIntegrationMessageContext(value) {
|
|
76
74
|
if (!value || typeof value !== 'object')
|
|
77
75
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-message-context.service.js","sourceRoot":"","sources":["../../../../src/modules/agents/integrations/integration-message-context.service.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"integration-message-context.service.js","sourceRoot":"","sources":["../../../../src/modules/agents/integrations/integration-message-context.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AA6EA,kEAaC;AA1FD,gCAAkC;AAClC,sCAAsC;AACtC,+CAAyC;AAEzC,yFAAoF;AACpF,qFAAgF;AAShF,MAAM,4BAA4B,GAAG,uBAAuB,CAAC;AAGtD,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAC5C,YACkB,gBAAuC,EACvC,kBAA2C;QAD3C,qBAAgB,GAAhB,gBAAgB,CAAuB;QACvC,uBAAkB,GAAlB,kBAAkB,CAAyB;IAC1D,CAAC;IAEJ,KAAK,CAAC,SAAS,CAAC,QAAgB;QAC/B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACvE,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,4BAA4B,CAAC,CAAC;QACjF,OAAO,2BAA2B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,SAAS,CACd,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KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,MAAM,GAAG,KAAgC,CAAC;IAChD,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,CACN,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ;YACnC,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC;YACxE,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAClE,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,CACN,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ;YACpC,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CACtE,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO,CACN,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ;YACjC,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CACtE,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Tool } from '@n8n/agents';
|
|
2
|
+
import { N8N_CHAT_INTEGRATION_TYPE } from '@n8n/api-types';
|
|
3
|
+
import type { AgentIntegrationConfig, RichCardComponent, RICH_CARD_BUTTON_STYLES } from '@n8n/api-types';
|
|
4
|
+
import type { ButtonStyle } from 'chat';
|
|
2
5
|
import { z } from 'zod';
|
|
3
|
-
import type { AgentIntegrationConfig } from '@n8n/api-types';
|
|
4
6
|
import { type IntegrationErrorCode } from './integration-error-codes';
|
|
5
7
|
export type IntegrationMessageTarget = {
|
|
6
8
|
type: 'thread';
|
|
@@ -41,9 +43,13 @@ export interface IntegrationSubjectPerson {
|
|
|
41
43
|
id: string;
|
|
42
44
|
name: string;
|
|
43
45
|
}
|
|
46
|
+
export type IntegrationToolConnectionSource = AgentIntegrationConfig | {
|
|
47
|
+
type: typeof N8N_CHAT_INTEGRATION_TYPE;
|
|
48
|
+
credentialId?: undefined;
|
|
49
|
+
};
|
|
44
50
|
export interface IntegrationToolConnectionDescriptor {
|
|
45
51
|
agentId?: string;
|
|
46
|
-
integration:
|
|
52
|
+
integration: IntegrationToolConnectionSource;
|
|
47
53
|
integrationConnectionId: string;
|
|
48
54
|
contextToolName: string;
|
|
49
55
|
actionToolName: string;
|
|
@@ -91,11 +97,13 @@ export type IntegrationActionResult = {
|
|
|
91
97
|
};
|
|
92
98
|
export declare const DEFAULT_INTEGRATION_CONTEXT_QUERIES: IntegrationContextQuery[];
|
|
93
99
|
export declare const DEFAULT_INTEGRATION_ACTIONS: IntegrationAction[];
|
|
100
|
+
export declare const richCardButtonStylesAreChatSdkStyles: (typeof RICH_CARD_BUTTON_STYLES)[number] extends ButtonStyle ? true : never;
|
|
101
|
+
export type IntegrationCardComponent = RichCardComponent;
|
|
94
102
|
export declare function getIntegrationToolConnectionDescriptors(integrations: AgentIntegrationConfig[], agentId?: string, capabilitiesFor?: (integration: AgentIntegrationConfig) => {
|
|
95
103
|
contextQueries?: IntegrationContextQuery[];
|
|
96
104
|
actions?: IntegrationAction[];
|
|
97
105
|
}): IntegrationToolConnectionDescriptor[];
|
|
98
|
-
export declare function buildIntegrationConnectionId(integration:
|
|
106
|
+
export declare function buildIntegrationConnectionId(integration: IntegrationToolConnectionSource): string;
|
|
99
107
|
export declare function createIntegrationContextTool(params: {
|
|
100
108
|
descriptor: IntegrationToolConnectionDescriptor;
|
|
101
109
|
messageContextStore: IntegrationMessageContextStore;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_INTEGRATION_ACTIONS = exports.DEFAULT_INTEGRATION_CONTEXT_QUERIES = void 0;
|
|
3
|
+
exports.richCardButtonStylesAreChatSdkStyles = exports.DEFAULT_INTEGRATION_ACTIONS = exports.DEFAULT_INTEGRATION_CONTEXT_QUERIES = void 0;
|
|
4
4
|
exports.getIntegrationToolConnectionDescriptors = getIntegrationToolConnectionDescriptors;
|
|
5
5
|
exports.buildIntegrationConnectionId = buildIntegrationConnectionId;
|
|
6
6
|
exports.createIntegrationContextTool = createIntegrationContextTool;
|
|
7
7
|
exports.createIntegrationActionTool = createIntegrationActionTool;
|
|
8
8
|
const agents_1 = require("@n8n/agents");
|
|
9
|
+
const api_types_1 = require("@n8n/api-types");
|
|
10
|
+
const utils_1 = require("@n8n/utils");
|
|
9
11
|
const zod_1 = require("zod");
|
|
10
12
|
const integration_error_codes_1 = require("./integration-error-codes");
|
|
13
|
+
const integration_helpers_1 = require("./integration-helpers");
|
|
11
14
|
exports.DEFAULT_INTEGRATION_CONTEXT_QUERIES = [
|
|
12
15
|
'get_current_message_context',
|
|
13
16
|
'get_current_subject',
|
|
@@ -23,104 +26,8 @@ exports.DEFAULT_INTEGRATION_ACTIONS = [
|
|
|
23
26
|
'send_dm',
|
|
24
27
|
'send_channel_message',
|
|
25
28
|
];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
label: zod_1.z.string(),
|
|
29
|
-
value: zod_1.z.string(),
|
|
30
|
-
})
|
|
31
|
-
.strict();
|
|
32
|
-
const selectOptionSchema = zod_1.z
|
|
33
|
-
.object({
|
|
34
|
-
label: zod_1.z.string(),
|
|
35
|
-
value: zod_1.z.string(),
|
|
36
|
-
description: zod_1.z.string().optional(),
|
|
37
|
-
})
|
|
38
|
-
.strict();
|
|
39
|
-
const buttonStyles = ['primary', 'danger', 'default'];
|
|
40
|
-
const buttonStyleSchema = zod_1.z.enum(buttonStyles);
|
|
41
|
-
const cardButtonSchema = zod_1.z
|
|
42
|
-
.object({
|
|
43
|
-
label: zod_1.z.string().optional(),
|
|
44
|
-
text: zod_1.z.string().optional(),
|
|
45
|
-
value: zod_1.z.string(),
|
|
46
|
-
style: buttonStyleSchema.optional(),
|
|
47
|
-
})
|
|
48
|
-
.strict();
|
|
49
|
-
const cardComponentSchema = zod_1.z.union([
|
|
50
|
-
zod_1.z
|
|
51
|
-
.object({
|
|
52
|
-
type: zod_1.z.literal('section'),
|
|
53
|
-
text: zod_1.z.string(),
|
|
54
|
-
button: cardButtonSchema.optional(),
|
|
55
|
-
})
|
|
56
|
-
.strict(),
|
|
57
|
-
zod_1.z
|
|
58
|
-
.object({
|
|
59
|
-
type: zod_1.z.literal('fields'),
|
|
60
|
-
fields: zod_1.z.array(fieldPairSchema).min(1).optional(),
|
|
61
|
-
items: zod_1.z.array(fieldPairSchema).min(1).optional(),
|
|
62
|
-
})
|
|
63
|
-
.strict()
|
|
64
|
-
.refine((component) => component.fields !== undefined || component.items !== undefined, {
|
|
65
|
-
message: 'Provide fields or items.',
|
|
66
|
-
}),
|
|
67
|
-
zod_1.z
|
|
68
|
-
.object({
|
|
69
|
-
type: zod_1.z.literal('image'),
|
|
70
|
-
url: zod_1.z.string(),
|
|
71
|
-
alt: zod_1.z.string().optional(),
|
|
72
|
-
altText: zod_1.z.string().optional(),
|
|
73
|
-
})
|
|
74
|
-
.strict(),
|
|
75
|
-
zod_1.z
|
|
76
|
-
.object({
|
|
77
|
-
type: zod_1.z.literal('divider'),
|
|
78
|
-
})
|
|
79
|
-
.strict(),
|
|
80
|
-
zod_1.z
|
|
81
|
-
.object({
|
|
82
|
-
type: zod_1.z.literal('button'),
|
|
83
|
-
label: zod_1.z.string().optional(),
|
|
84
|
-
text: zod_1.z.string().optional(),
|
|
85
|
-
value: zod_1.z.string(),
|
|
86
|
-
style: buttonStyleSchema.optional(),
|
|
87
|
-
})
|
|
88
|
-
.strict(),
|
|
89
|
-
zod_1.z
|
|
90
|
-
.object({
|
|
91
|
-
type: zod_1.z.literal('select'),
|
|
92
|
-
id: zod_1.z.string().optional(),
|
|
93
|
-
label: zod_1.z.string().optional(),
|
|
94
|
-
placeholder: zod_1.z.string().optional(),
|
|
95
|
-
options: zod_1.z.array(selectOptionSchema).min(1),
|
|
96
|
-
})
|
|
97
|
-
.strict(),
|
|
98
|
-
zod_1.z
|
|
99
|
-
.object({
|
|
100
|
-
type: zod_1.z.literal('radio_select'),
|
|
101
|
-
id: zod_1.z.string().optional(),
|
|
102
|
-
label: zod_1.z.string().optional(),
|
|
103
|
-
placeholder: zod_1.z.string().optional(),
|
|
104
|
-
options: zod_1.z.array(selectOptionSchema).min(1),
|
|
105
|
-
})
|
|
106
|
-
.strict(),
|
|
107
|
-
]);
|
|
108
|
-
const messageSchema = zod_1.z
|
|
109
|
-
.object({
|
|
110
|
-
text: zod_1.z.string().optional().describe('Plain-text fallback or summary for the message.'),
|
|
111
|
-
card: zod_1.z
|
|
112
|
-
.object({
|
|
113
|
-
awaitResponse: zod_1.z.boolean().optional(),
|
|
114
|
-
title: zod_1.z.string().optional(),
|
|
115
|
-
message: zod_1.z.string().optional(),
|
|
116
|
-
components: zod_1.z.array(cardComponentSchema).min(1),
|
|
117
|
-
})
|
|
118
|
-
.strict()
|
|
119
|
-
.describe('Generic card payload rendered by the integration. Use generic components only, not platform-native message payloads.')
|
|
120
|
-
.optional(),
|
|
121
|
-
})
|
|
122
|
-
.strict()
|
|
123
|
-
.describe('Generic message payload. Use message.text plus optional message.card only.');
|
|
29
|
+
exports.richCardButtonStylesAreChatSdkStyles = true;
|
|
30
|
+
const messageSchema = api_types_1.richMessageSchema;
|
|
124
31
|
const noInputSchema = zod_1.z.object({}).strict();
|
|
125
32
|
const platformUserIdSchema = zod_1.z
|
|
126
33
|
.string()
|
|
@@ -493,7 +400,7 @@ const updateIssueActionInputSchema = zod_1.z.object({
|
|
|
493
400
|
.describe('Optional parent Linear issue ID. Pass null to clear.'),
|
|
494
401
|
})
|
|
495
402
|
.strict()
|
|
496
|
-
.refine(hasUpdateIssueField, {
|
|
403
|
+
.refine(integration_helpers_1.hasUpdateIssueField, {
|
|
497
404
|
message: 'Provide at least one issue field to update.',
|
|
498
405
|
}),
|
|
499
406
|
});
|
|
@@ -619,7 +526,9 @@ function getIntegrationToolConnectionDescriptors(integrations, agentId, capabili
|
|
|
619
526
|
});
|
|
620
527
|
}
|
|
621
528
|
function buildIntegrationConnectionId(integration) {
|
|
622
|
-
return
|
|
529
|
+
return integration.credentialId === undefined
|
|
530
|
+
? integration.type
|
|
531
|
+
: `${integration.type}:${integration.credentialId}`;
|
|
623
532
|
}
|
|
624
533
|
function createIntegrationContextTool(params) {
|
|
625
534
|
const { descriptor, messageContextStore, queryExecutor } = params;
|
|
@@ -694,9 +603,15 @@ function buildContextToolDescription(descriptor) {
|
|
|
694
603
|
].join('\n\n');
|
|
695
604
|
}
|
|
696
605
|
function buildActionToolDescription(descriptor) {
|
|
606
|
+
const n8nChatGuidance = descriptor.integration.type === api_types_1.N8N_CHAT_INTEGRATION_TYPE
|
|
607
|
+
? [
|
|
608
|
+
'This is the built-in n8n chat: your normal assistant reply already reaches the user. NEVER call respond with only message.text — write that text directly in your reply instead. Call this tool only with message.card, to render a rich card or collect structured input.',
|
|
609
|
+
]
|
|
610
|
+
: [];
|
|
697
611
|
return [
|
|
698
612
|
`Take actions in the ${descriptor.integration.type} integration connection.`,
|
|
699
613
|
`Available actions: ${descriptor.actions.join(', ')}.`,
|
|
614
|
+
...n8nChatGuidance,
|
|
700
615
|
'Action inputs:',
|
|
701
616
|
...descriptor.actions.map((action) => `- ${ACTION_DESCRIPTIONS[action]}`),
|
|
702
617
|
`Batch form: pass actions as an array of up to ${MAX_BATCH_OPERATIONS} { action, input } objects. Batch actions run sequentially and cannot include cards that wait for a user response.`,
|
|
@@ -787,17 +702,6 @@ function toSingleActionOperation(input) {
|
|
|
787
702
|
}
|
|
788
703
|
return { action: input.action, input: input.input };
|
|
789
704
|
}
|
|
790
|
-
function hasUpdateIssueField(input) {
|
|
791
|
-
return (input.teamId !== undefined ||
|
|
792
|
-
input.title !== undefined ||
|
|
793
|
-
input.description !== undefined ||
|
|
794
|
-
input.assigneeId !== undefined ||
|
|
795
|
-
input.projectId !== undefined ||
|
|
796
|
-
input.labelIds !== undefined ||
|
|
797
|
-
input.priority !== undefined ||
|
|
798
|
-
input.stateId !== undefined ||
|
|
799
|
-
input.parentId !== undefined);
|
|
800
|
-
}
|
|
801
705
|
function validateContextOperationSchema(operation, ctx, pathPrefix = []) {
|
|
802
706
|
const operationSchema = CONTEXT_QUERY_INPUT_SCHEMAS[operation.query];
|
|
803
707
|
const result = operationSchema.safeParse(operation);
|
|
@@ -1031,22 +935,19 @@ function withPreviousSubject(context, previousContext) {
|
|
|
1031
935
|
};
|
|
1032
936
|
}
|
|
1033
937
|
function extractSuccessfulMessageContext(result) {
|
|
1034
|
-
if (!
|
|
938
|
+
if (!(0, utils_1.isRecord)(result) || result.ok !== true)
|
|
1035
939
|
return undefined;
|
|
1036
940
|
const messageContext = result.messageContext;
|
|
1037
941
|
return isIntegrationMessageContext(messageContext) ? messageContext : undefined;
|
|
1038
942
|
}
|
|
1039
943
|
function isIntegrationMessageContext(value) {
|
|
1040
|
-
return (
|
|
944
|
+
return ((0, utils_1.isRecord)(value) &&
|
|
1041
945
|
typeof value.integrationConnectionId === 'string' &&
|
|
1042
946
|
typeof value.platform === 'string' &&
|
|
1043
|
-
|
|
947
|
+
(0, utils_1.isRecord)(value.target) &&
|
|
1044
948
|
(value.agentUserId === undefined || typeof value.agentUserId === 'string') &&
|
|
1045
949
|
typeof value.updatedAt === 'string');
|
|
1046
950
|
}
|
|
1047
|
-
function isPlainRecord(value) {
|
|
1048
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
1049
|
-
}
|
|
1050
951
|
async function getOptionalCurrentContext(params) {
|
|
1051
952
|
try {
|
|
1052
953
|
const context = await params.messageContextStore.getLatest(params.threadId);
|