n8n 2.22.3 → 2.23.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/auth/auth.service.d.ts +2 -0
- package/dist/auth/auth.service.js +15 -4
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/chat/chat-service.types.d.ts +4 -4
- package/dist/commands/execute.d.ts +2 -2
- package/dist/commands/export/workflow.js +1 -0
- package/dist/commands/export/workflow.js.map +1 -1
- package/dist/commands/license/info.js +4 -4
- package/dist/commands/license/info.js.map +1 -1
- package/dist/commands/start.js +21 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/controllers/annotation-tags.controller.ee.d.ts +1 -1
- package/dist/controllers/e2e.controller.js +1 -0
- package/dist/controllers/e2e.controller.js.map +1 -1
- package/dist/controllers/oauth/oauth1-credential.controller.d.ts +1 -1
- package/dist/controllers/oauth/oauth1-credential.controller.js +4 -7
- package/dist/controllers/oauth/oauth1-credential.controller.js.map +1 -1
- package/dist/controllers/oauth/oauth2-credential.controller.js +3 -6
- package/dist/controllers/oauth/oauth2-credential.controller.js.map +1 -1
- package/dist/controllers/redaction-enforcement-mapper.d.ts +3 -0
- package/dist/controllers/redaction-enforcement-mapper.js +27 -0
- package/dist/controllers/redaction-enforcement-mapper.js.map +1 -0
- package/dist/controllers/security-settings.controller.d.ts +8 -2
- package/dist/controllers/security-settings.controller.js +35 -25
- package/dist/controllers/security-settings.controller.js.map +1 -1
- package/dist/credentials/credential-connection-status-provider.interface.d.ts +3 -0
- package/dist/credentials/credential-connection-status-provider.interface.js +3 -0
- package/dist/credentials/credential-connection-status-provider.interface.js.map +1 -0
- package/dist/credentials/credential-connection-status-proxy.d.ts +6 -0
- package/dist/credentials/credential-connection-status-proxy.js +25 -0
- package/dist/credentials/credential-connection-status-proxy.js.map +1 -0
- package/dist/credentials/credential-resolution-provider.interface.d.ts +1 -0
- package/dist/credentials/credentials.controller.d.ts +2 -0
- package/dist/credentials/credentials.service.d.ts +10 -1
- package/dist/credentials/credentials.service.ee.d.ts +2 -0
- package/dist/credentials/credentials.service.ee.js +13 -3
- package/dist/credentials/credentials.service.ee.js.map +1 -1
- package/dist/credentials/credentials.service.js +34 -7
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials/dynamic-credentials-proxy.d.ts +2 -0
- package/dist/credentials/dynamic-credentials-proxy.js +9 -0
- package/dist/credentials/dynamic-credentials-proxy.js.map +1 -1
- package/dist/credentials-helper.js +2 -1
- package/dist/credentials-helper.js.map +1 -1
- package/dist/errors/feature-not-licensed.error.d.ts +3 -1
- package/dist/errors/feature-not-licensed.error.js +2 -2
- package/dist/errors/feature-not-licensed.error.js.map +1 -1
- package/dist/evaluation.ee/evaluation-collection.service.js +2 -0
- package/dist/evaluation.ee/evaluation-collection.service.js.map +1 -1
- package/dist/evaluation.ee/insights/eval-insights.controller.ee.d.ts +41 -0
- package/dist/evaluation.ee/insights/eval-insights.controller.ee.js +62 -0
- package/dist/evaluation.ee/insights/eval-insights.controller.ee.js.map +1 -0
- package/dist/evaluation.ee/insights/eval-insights.service.d.ts +25 -0
- package/dist/evaluation.ee/insights/eval-insights.service.js +206 -0
- package/dist/evaluation.ee/insights/eval-insights.service.js.map +1 -0
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.d.ts +3 -2
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +16 -2
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +3 -1
- package/dist/events/relays/telemetry.event-relay.js +9 -3
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.d.ts +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +4 -2
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/executions/execution-data/db-store.d.ts +4 -2
- package/dist/executions/execution-data/db-store.js +9 -4
- package/dist/executions/execution-data/db-store.js.map +1 -1
- package/dist/executions/execution-data/missing-execution-data.error.d.ts +5 -0
- package/dist/executions/execution-data/missing-execution-data.error.js +11 -0
- package/dist/executions/execution-data/missing-execution-data.error.js.map +1 -0
- package/dist/executions/execution-data/types.d.ts +3 -2
- package/dist/executions/execution-data/types.js.map +1 -1
- package/dist/executions/execution-persistence.d.ts +12 -3
- package/dist/executions/execution-persistence.js +102 -26
- package/dist/executions/execution-persistence.js.map +1 -1
- package/dist/external-hooks.d.ts +6 -1
- package/dist/external-hooks.js.map +1 -1
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.d.ts +3 -2
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js +17 -12
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js.map +1 -1
- package/dist/interfaces.d.ts +1 -0
- package/dist/license.d.ts +2 -0
- package/dist/license.js +6 -0
- package/dist/license.js.map +1 -1
- package/dist/load-nodes-and-credentials.d.ts +32 -6
- package/dist/load-nodes-and-credentials.js +8 -79
- package/dist/load-nodes-and-credentials.js.map +1 -1
- package/dist/manual-execution.service.js +3 -0
- package/dist/manual-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-execution.service.js +5 -5
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-sse-stream.js +17 -1
- package/dist/modules/agents/agent-sse-stream.js.map +1 -1
- package/dist/modules/agents/agents-tools.service.js +7 -5
- package/dist/modules/agents/agents-tools.service.js.map +1 -1
- package/dist/modules/agents/agents.controller.d.ts +29 -3
- package/dist/modules/agents/agents.controller.js +88 -7
- 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 +12 -6
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/agents.service.d.ts +7 -8
- package/dist/modules/agents/agents.service.js +120 -65
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-model-recommendations.d.ts +1 -1
- package/dist/modules/agents/builder/agents-builder-model-recommendations.js +3 -3
- package/dist/modules/agents/builder/agents-builder-model-recommendations.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +9 -17
- package/dist/modules/agents/builder/agents-builder-prompts.js +145 -549
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-settings.service.js +2 -2
- package/dist/modules/agents/builder/agents-builder-settings.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.js +10 -10
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder.service.d.ts +3 -1
- package/dist/modules/agents/builder/agents-builder.service.js +58 -9
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js +2 -2
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/ask-llm.tool.js +2 -2
- package/dist/modules/agents/builder/interactive/ask-llm.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/ask-question.tool.js +2 -2
- package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +2 -2
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.d.ts +1 -0
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +132 -0
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js.map +1 -0
- package/dist/modules/agents/builder/prompts/config-rules.prompt.d.ts +2 -0
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js +63 -0
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -0
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.d.ts +1 -0
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +47 -0
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -0
- package/dist/modules/agents/builder/prompts/memory.prompt.d.ts +1 -0
- package/dist/modules/agents/builder/prompts/memory.prompt.js +60 -0
- package/dist/modules/agents/builder/prompts/memory.prompt.js.map +1 -0
- package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -0
- package/dist/modules/agents/builder/prompts/tools.prompt.js +81 -0
- package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -0
- package/dist/modules/agents/builder/skills/index.d.ts +2 -0
- package/dist/modules/agents/builder/skills/index.js +12 -0
- package/dist/modules/agents/builder/skills/index.js.map +1 -0
- package/dist/modules/agents/builder/skills/integrations.skill.d.ts +2 -0
- package/dist/modules/agents/builder/skills/integrations.skill.js +53 -0
- package/dist/modules/agents/builder/skills/integrations.skill.js.map +1 -0
- package/dist/modules/agents/builder/skills/research.skill.d.ts +2 -0
- package/dist/modules/agents/builder/skills/research.skill.js +42 -0
- package/dist/modules/agents/builder/skills/research.skill.js.map +1 -0
- package/dist/modules/agents/builder/skills/target-skills.skill.d.ts +2 -0
- package/dist/modules/agents/builder/skills/target-skills.skill.js +59 -0
- package/dist/modules/agents/builder/skills/target-skills.skill.js.map +1 -0
- package/dist/modules/agents/entities/{agent-published-version.entity.d.ts → agent-history.entity.d.ts} +4 -7
- package/dist/modules/agents/entities/{agent-published-version.entity.js → agent-history.entity.js} +22 -34
- package/dist/modules/agents/entities/agent-history.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.d.ts +7 -0
- package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.js +38 -0
- package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-memory-entry-lock.entity.d.ts +7 -0
- package/dist/modules/{instance-ai/entities/instance-ai-workflow-snapshot.entity.js → agents/entities/agent-memory-entry-lock.entity.js} +16 -19
- package/dist/modules/agents/entities/agent-memory-entry-lock.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-memory-entry-source.entity.d.ts +9 -0
- package/dist/modules/agents/entities/agent-memory-entry-source.entity.js +49 -0
- package/dist/modules/agents/entities/agent-memory-entry-source.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-memory-entry.entity.d.ts +15 -0
- package/dist/modules/agents/entities/agent-memory-entry.entity.js +65 -0
- package/dist/modules/agents/entities/agent-memory-entry.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-observation-cursor.entity.d.ts +2 -3
- package/dist/modules/agents/entities/agent-observation-cursor.entity.js +5 -4
- package/dist/modules/agents/entities/agent-observation-cursor.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-observation-lock.entity.d.ts +2 -3
- package/dist/modules/agents/entities/agent-observation-lock.entity.js +5 -4
- package/dist/modules/agents/entities/agent-observation-lock.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-observation.entity.d.ts +2 -3
- package/dist/modules/agents/entities/agent-observation.entity.js +6 -5
- package/dist/modules/agents/entities/agent-observation.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent.entity.d.ts +3 -5
- package/dist/modules/agents/entities/agent.entity.js +7 -14
- package/dist/modules/agents/entities/agent.entity.js.map +1 -1
- package/dist/modules/agents/episodic-memory.d.ts +2 -0
- package/dist/modules/agents/episodic-memory.js +12 -0
- package/dist/modules/agents/episodic-memory.js.map +1 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +2 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.js +19 -5
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-schedule.service.js +10 -6
- package/dist/modules/agents/integrations/agent-schedule.service.js.map +1 -1
- package/dist/modules/agents/integrations/chat-integration.service.js +1 -1
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
- package/dist/modules/agents/integrations/n8n-memory.d.ts +41 -18
- package/dist/modules/agents/integrations/n8n-memory.js +519 -77
- package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack-integration.js +2 -12
- package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -1
- package/dist/modules/agents/integrations/rich-interaction-tool.d.ts +1 -1
- package/dist/modules/agents/integrations/rich-interaction-tool.js +2 -2
- package/dist/modules/agents/integrations/rich-interaction-tool.js.map +1 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.d.ts +52 -0
- package/dist/modules/agents/integrations/slack-app-setup.service.js +316 -0
- package/dist/modules/agents/integrations/slack-app-setup.service.js.map +1 -0
- package/dist/modules/agents/json-config/from-json-config.d.ts +2 -3
- package/dist/modules/agents/json-config/from-json-config.js +76 -61
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
- package/dist/modules/agents/json-config/schema-text-serializer.js +2 -1
- package/dist/modules/agents/json-config/schema-text-serializer.js.map +1 -1
- package/dist/modules/agents/repositories/agent-history.repository.d.ts +19 -0
- package/dist/modules/agents/repositories/agent-history.repository.js +51 -0
- package/dist/modules/agents/repositories/agent-history.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.d.ts +5 -0
- package/dist/modules/{instance-ai/repositories/instance-ai-workflow-snapshot.repository.js → agents/repositories/agent-memory-entry-cursor.repository.js} +8 -8
- package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-memory-entry-lock.repository.d.ts +5 -0
- package/dist/modules/{instance-ai/repositories/instance-ai-observational-memory.repository.js → agents/repositories/agent-memory-entry-lock.repository.js} +8 -8
- package/dist/modules/agents/repositories/agent-memory-entry-lock.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-memory-entry-source.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-memory-entry-source.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-memory-entry-source.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-memory-entry.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-memory-entry.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-memory-entry.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent.repository.js +3 -3
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
- package/dist/modules/agents/runtime/agent-secure-runtime.js +5 -5
- package/dist/modules/agents/runtime/agent-secure-runtime.js.map +1 -1
- package/dist/modules/agents/tools/environment-tool.d.ts +1 -1
- package/dist/modules/agents/tools/environment-tool.js +3 -3
- package/dist/modules/agents/tools/environment-tool.js.map +1 -1
- package/dist/modules/agents/tools/node-tool-factory.js +5 -5
- package/dist/modules/agents/tools/node-tool-factory.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.js +3 -3
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/tracing/builder-telemetry.d.ts +2 -3
- package/dist/modules/agents/tracing/builder-telemetry.js +36 -3
- package/dist/modules/agents/tracing/builder-telemetry.js.map +1 -1
- package/dist/modules/agents/utils/agent-draft.utils.js +1 -2
- package/dist/modules/agents/utils/agent-draft.utils.js.map +1 -1
- package/dist/modules/agents/utils/agent-memory-scope.d.ts +3 -0
- package/dist/modules/agents/utils/agent-memory-scope.js +15 -0
- package/dist/modules/agents/utils/agent-memory-scope.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub.constants.js +4 -0
- package/dist/modules/chat-hub/chat-hub.constants.js.map +1 -1
- package/dist/modules/chat-hub/context-limits.js +1 -0
- package/dist/modules/chat-hub/context-limits.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/constants.d.ts +3 -0
- package/dist/modules/dynamic-credentials.ee/constants.js +7 -0
- package/dist/modules/dynamic-credentials.ee/constants.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js +14 -2
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.d.ts +2 -2
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js +18 -4
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js +4 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/errors/system-resolver-modification.error.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/errors/system-resolver-modification.error.js +11 -0
- package/dist/modules/dynamic-credentials.ee/errors/system-resolver-modification.error.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.d.ts +7 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js +40 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.d.ts +3 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js +6 -3
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.d.ts +2 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js +22 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.d.ts +3 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js +7 -3
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.d.ts +4 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +11 -3
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/index.d.ts +2 -0
- package/dist/modules/dynamic-credentials.ee/services/index.js +2 -0
- package/dist/modules/dynamic-credentials.ee/services/index.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.d.ts +14 -0
- package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.js +70 -0
- package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.js.map +1 -0
- package/dist/modules/insights/insights-collection.service.js +1 -1
- package/dist/modules/insights/insights-collection.service.js.map +1 -1
- package/dist/modules/instance-ai/entities/index.d.ts +6 -2
- package/dist/modules/instance-ai/entities/index.js +9 -5
- package/dist/modules/instance-ai/entities/index.js.map +1 -1
- package/dist/modules/instance-ai/entities/instance-ai-checkpoint.entity.d.ts +12 -0
- package/dist/modules/instance-ai/entities/instance-ai-checkpoint.entity.js +54 -0
- package/dist/modules/instance-ai/entities/instance-ai-checkpoint.entity.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-observation-cursor.entity.d.ts +6 -0
- package/dist/modules/instance-ai/entities/instance-ai-observation-cursor.entity.js +33 -0
- package/dist/modules/instance-ai/entities/instance-ai-observation-cursor.entity.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-observation-lock.entity.d.ts +8 -0
- package/dist/modules/instance-ai/entities/instance-ai-observation-lock.entity.js +37 -0
- package/dist/modules/instance-ai/entities/instance-ai-observation-lock.entity.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-observation.entity.d.ts +12 -0
- package/dist/modules/instance-ai/entities/instance-ai-observation.entity.js +52 -0
- package/dist/modules/instance-ai/entities/instance-ai-observation.entity.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.d.ts +19 -0
- package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.js +82 -0
- package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.d.ts +2 -0
- package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.js +8 -0
- package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.js.map +1 -1
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.d.ts +12 -2
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js +40 -4
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js.map +1 -1
- package/dist/modules/instance-ai/eval/execution.service.d.ts +8 -2
- package/dist/modules/instance-ai/eval/execution.service.js +137 -47
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/llm-wire-server.d.ts +31 -0
- package/dist/modules/instance-ai/eval/llm-wire-server.js +127 -0
- package/dist/modules/instance-ai/eval/llm-wire-server.js.map +1 -0
- package/dist/modules/instance-ai/eval/openai-envelope.d.ts +6 -0
- package/dist/modules/instance-ai/eval/openai-envelope.js +96 -0
- package/dist/modules/instance-ai/eval/openai-envelope.js.map +1 -0
- package/dist/modules/instance-ai/eval/proxy-loopback.d.ts +1 -0
- package/dist/modules/instance-ai/eval/proxy-loopback.js +44 -0
- package/dist/modules/instance-ai/eval/proxy-loopback.js.map +1 -0
- package/dist/modules/instance-ai/eval/sub-agent-eval.service.js +29 -7
- package/dist/modules/instance-ai/eval/sub-agent-eval.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +7 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.js +178 -3
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +6 -6
- package/dist/modules/instance-ai/instance-ai-memory.service.js +44 -85
- package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +2 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.js +11 -22
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +2 -0
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +105 -13
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +1 -1
- package/dist/modules/instance-ai/instance-ai.module.js +10 -6
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +34 -12
- package/dist/modules/instance-ai/instance-ai.service.js +724 -264
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.d.ts +4 -1
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js +3 -1
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js.map +1 -1
- package/dist/modules/instance-ai/message-parser.d.ts +3 -3
- package/dist/modules/instance-ai/message-parser.js +65 -61
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-ai/node-definition-resolver.js +12 -48
- package/dist/modules/instance-ai/node-definition-resolver.js.map +1 -1
- package/dist/modules/instance-ai/repositories/index.d.ts +4 -2
- package/dist/modules/instance-ai/repositories/index.js +9 -5
- package/dist/modules/instance-ai/repositories/index.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.d.ts +5 -0
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js +26 -0
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js.map +1 -0
- package/dist/modules/instance-ai/repositories/instance-ai-observation-cursor.repository.d.ts +5 -0
- package/dist/modules/instance-ai/repositories/instance-ai-observation-cursor.repository.js +26 -0
- package/dist/modules/instance-ai/repositories/instance-ai-observation-cursor.repository.js.map +1 -0
- package/dist/modules/instance-ai/repositories/instance-ai-observation-lock.repository.d.ts +5 -0
- package/dist/modules/instance-ai/repositories/instance-ai-observation-lock.repository.js +26 -0
- package/dist/modules/instance-ai/repositories/instance-ai-observation-lock.repository.js.map +1 -0
- package/dist/modules/instance-ai/repositories/instance-ai-observation.repository.d.ts +5 -0
- package/dist/modules/{agents/repositories/agent-published-version.repository.js → instance-ai/repositories/instance-ai-observation.repository.js} +8 -17
- package/dist/modules/instance-ai/repositories/instance-ai-observation.repository.js.map +1 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.d.ts +2 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js +12 -2
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
- package/dist/modules/instance-ai/storage/index.d.ts +2 -3
- package/dist/modules/instance-ai/storage/index.js +5 -7
- package/dist/modules/instance-ai/storage/index.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.d.ts +15 -0
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js +94 -0
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js.map +1 -0
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.d.ts +94 -0
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js +324 -0
- package/dist/modules/instance-ai/storage/typeorm-agent-memory.js.map +1 -0
- package/dist/modules/instance-ai/storage/typeorm-observation-log-store.d.ts +37 -0
- package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js +212 -0
- package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js.map +1 -0
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js +34 -11
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js.map +1 -1
- package/dist/modules/mcp/mcp.service.js +5 -5
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/tools/schemas.d.ts +24 -24
- package/dist/modules/mcp/tools/search-projects.tool.js +59 -13
- package/dist/modules/mcp/tools/search-projects.tool.js.map +1 -1
- package/dist/modules/mcp/tools/test-workflow.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/connection-structure-check.d.ts +35 -0
- package/dist/modules/mcp/tools/workflow-builder/connection-structure-check.js +88 -0
- package/dist/modules/mcp/tools/workflow-builder/connection-structure-check.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.d.ts +3 -2
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +41 -9
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/data-table-validation.d.ts +13 -0
- package/dist/modules/mcp/tools/workflow-builder/data-table-validation.js +87 -0
- package/dist/modules/mcp/tools/workflow-builder/data-table-validation.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +2 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +42 -6
- 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.d.ts +2 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +5 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-validation.utils.js +1 -1
- package/dist/modules/mcp/tools/workflow-validation.utils.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-registry-test.controller.js +5 -1
- package/dist/modules/mcp-registry/mcp-registry-test.controller.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.d.ts +18 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +73 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +5 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +31 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -0
- package/dist/modules/n8n-packages/io/package-writer.d.ts +6 -0
- package/dist/{scaling/multi-main-setup.types.js → modules/n8n-packages/io/package-writer.js} +1 -1
- package/dist/modules/n8n-packages/io/package-writer.js.map +1 -0
- package/dist/modules/n8n-packages/io/slug.utils.d.ts +1 -0
- package/dist/modules/n8n-packages/io/slug.utils.js +16 -0
- package/dist/modules/n8n-packages/io/slug.utils.js.map +1 -0
- package/dist/modules/n8n-packages/io/tar/tar-package-writer.d.ts +9 -0
- package/dist/modules/n8n-packages/io/tar/tar-package-writer.js +71 -0
- package/dist/modules/n8n-packages/io/tar/tar-package-writer.js.map +1 -0
- package/dist/modules/n8n-packages/n8n-packages.controller.d.ts +10 -0
- package/dist/modules/n8n-packages/n8n-packages.controller.js +45 -0
- package/dist/modules/n8n-packages/n8n-packages.controller.js.map +1 -0
- package/dist/modules/{inbound-secrets/inbound-secrets.module.d.ts → n8n-packages/n8n-packages.module.d.ts} +1 -1
- package/dist/modules/{inbound-secrets/inbound-secrets.module.js → n8n-packages/n8n-packages.module.js} +12 -16
- package/dist/modules/n8n-packages/n8n-packages.module.js.map +1 -0
- package/dist/modules/n8n-packages/n8n-packages.service.d.ts +10 -0
- package/dist/modules/n8n-packages/n8n-packages.service.js +49 -0
- package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -0
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +5 -0
- package/dist/modules/n8n-packages/n8n-packages.types.js +3 -0
- package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -0
- package/dist/modules/n8n-packages/spec/constants.d.ts +1 -0
- package/dist/modules/n8n-packages/spec/constants.js +5 -0
- package/dist/modules/n8n-packages/spec/constants.js.map +1 -0
- package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +55 -0
- package/dist/modules/n8n-packages/spec/manifest.schema.js +17 -0
- package/dist/modules/n8n-packages/spec/manifest.schema.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +169 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +46 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -0
- package/dist/modules/oauth-jwe/oauth-jwe-decrypt.service.d.ts +5 -1
- package/dist/modules/oauth-jwe/oauth-jwe-decrypt.service.js +18 -2
- package/dist/modules/oauth-jwe/oauth-jwe-decrypt.service.js.map +1 -1
- package/dist/modules/oauth-jwe/oauth-jwe.utils.js +27 -2
- package/dist/modules/oauth-jwe/oauth-jwe.utils.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.js +1 -0
- package/dist/modules/otel/execution-level-tracer.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.types.d.ts +11 -6
- package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
- package/dist/modules/otel/otel-lifecycle-handler.d.ts +5 -1
- package/dist/modules/otel/otel-lifecycle-handler.js +30 -2
- package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
- package/dist/modules/otel/otel.constants.d.ts +1 -0
- package/dist/modules/otel/otel.constants.js +1 -0
- package/dist/modules/otel/otel.constants.js.map +1 -1
- package/dist/modules/runtime-credentials/path-traversal.js.map +1 -0
- package/dist/modules/runtime-credentials/runtime-credentials-access.service.d.ts +8 -0
- package/dist/modules/runtime-credentials/runtime-credentials-access.service.js +35 -0
- package/dist/modules/runtime-credentials/runtime-credentials-access.service.js.map +1 -0
- package/dist/modules/{inbound-secrets/inbound-secrets-context-hook.d.ts → runtime-credentials/runtime-credentials-context-hook.d.ts} +4 -5
- package/dist/modules/{inbound-secrets/inbound-secrets-context-hook.js → runtime-credentials/runtime-credentials-context-hook.js} +14 -22
- package/dist/modules/runtime-credentials/runtime-credentials-context-hook.js.map +1 -0
- package/dist/modules/runtime-credentials/runtime-credentials.config.d.ts +3 -0
- package/dist/modules/{inbound-secrets/inbound-secrets.config.js → runtime-credentials/runtime-credentials.config.js} +7 -7
- package/dist/modules/runtime-credentials/runtime-credentials.config.js.map +1 -0
- package/dist/modules/runtime-credentials/runtime-credentials.module.d.ts +4 -0
- package/dist/modules/runtime-credentials/runtime-credentials.module.js +65 -0
- package/dist/modules/runtime-credentials/runtime-credentials.module.js.map +1 -0
- package/dist/modules/runtime-credentials/runtime-credentials.schemas.d.ts +23 -0
- package/dist/modules/runtime-credentials/runtime-credentials.schemas.js +10 -0
- package/dist/modules/runtime-credentials/runtime-credentials.schemas.js.map +1 -0
- package/dist/modules/runtime-credentials/runtime-credentials.service.d.ts +18 -0
- package/dist/modules/{inbound-secrets/inbound-secrets.service.js → runtime-credentials/runtime-credentials.service.js} +31 -28
- package/dist/modules/runtime-credentials/runtime-credentials.service.js.map +1 -0
- package/dist/modules/source-control.ee/source-control-export.service.ee.d.ts +1 -1
- package/dist/modules/source-control.ee/source-control-export.service.ee.js +3 -1
- package/dist/modules/source-control.ee/source-control-export.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +2 -2
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +29 -8
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-status.service.ee.js +4 -4
- package/dist/modules/source-control.ee/source-control-status.service.ee.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/source-control.ee/types/exportable-workflow.d.ts +2 -1
- package/dist/modules/sso-saml/saml.service.ee.js +5 -1
- package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
- package/dist/modules/workflow-index/workflow-dependency.controller.d.ts +1 -4
- package/dist/modules/workflow-index/workflow-dependency.controller.js +2 -13
- package/dist/modules/workflow-index/workflow-dependency.controller.js.map +1 -1
- package/dist/node-catalog/node-catalog.service.d.ts +1 -2
- package/dist/node-catalog/node-catalog.service.js +6 -10
- package/dist/node-catalog/node-catalog.service.js.map +1 -1
- package/dist/node-execution/ephemeral-node-executor.js +19 -11
- package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
- package/dist/oauth/oauth-jwe-service.proxy.d.ts +12 -2
- package/dist/oauth/oauth-jwe-service.proxy.js +5 -0
- package/dist/oauth/oauth-jwe-service.proxy.js.map +1 -1
- package/dist/oauth/oauth.service.d.ts +6 -1
- package/dist/oauth/oauth.service.js +42 -4
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/permissions.ee/check-access.d.ts +2 -2
- package/dist/permissions.ee/check-access.js +15 -11
- package/dist/permissions.ee/check-access.js.map +1 -1
- package/dist/posthog/index.d.ts +2 -0
- package/dist/posthog/index.js +28 -6
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.d.ts +10 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +42 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -0
- package/dist/public-api/v1/openapi.yml +55 -0
- package/dist/requests.d.ts +1 -1
- package/dist/scaling/constants.js +3 -0
- package/dist/scaling/constants.js.map +1 -1
- package/dist/scaling/multi-main-setup.ee.d.ts +12 -7
- package/dist/scaling/multi-main-setup.ee.js +125 -22
- package/dist/scaling/multi-main-setup.ee.js.map +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.js +3 -4
- package/dist/server.js.map +1 -1
- package/dist/services/dynamic-node-parameters.service.d.ts +0 -1
- package/dist/services/dynamic-node-parameters.service.js +6 -14
- package/dist/services/dynamic-node-parameters.service.js.map +1 -1
- package/dist/services/frontend.service.js +1 -1
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/import.service.js +3 -1
- package/dist/services/import.service.js.map +1 -1
- package/dist/services/proxy-token-manager.js +2 -13
- package/dist/services/proxy-token-manager.js.map +1 -1
- package/dist/services/runtime-credential-proxy.service.d.ts +9 -0
- package/dist/services/runtime-credential-proxy.service.js +29 -0
- package/dist/services/runtime-credential-proxy.service.js.map +1 -0
- package/dist/services/url.service.d.ts +1 -0
- package/dist/services/url.service.js +3 -0
- package/dist/services/url.service.js.map +1 -1
- package/dist/telemetry/index.d.ts +4 -1
- package/dist/telemetry/index.js +16 -8
- package/dist/telemetry/index.js.map +1 -1
- package/dist/utils.d.ts +2 -1
- package/dist/utils.js +10 -0
- package/dist/utils.js.map +1 -1
- package/dist/webhooks/live-webhooks.js +2 -2
- package/dist/webhooks/live-webhooks.js.map +1 -1
- package/dist/webhooks/webhook-helpers.js +1 -1
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/workflow-execute-additional-data.d.ts +3 -1
- package/dist/workflow-execute-additional-data.js +26 -3
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.d.ts +3 -1
- package/dist/workflow-helpers.js +39 -5
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-hook-context.service.d.ts +6 -0
- package/dist/workflow-hook-context.service.js +32 -0
- package/dist/workflow-hook-context.service.js.map +1 -0
- package/dist/workflow-runner.js +2 -1
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/utils.d.ts +3 -0
- package/dist/workflows/utils.js +19 -0
- package/dist/workflows/utils.js.map +1 -1
- package/dist/workflows/workflow-creation.service.js +4 -2
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow-execution.service.d.ts +4 -3
- package/dist/workflows/workflow-execution.service.js +8 -3
- package/dist/workflows/workflow-execution.service.js.map +1 -1
- package/dist/workflows/workflow-finder.service.d.ts +6 -2
- package/dist/workflows/workflow-finder.service.js +18 -0
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow-history/workflow-history.controller.d.ts +1 -1
- package/dist/workflows/workflow-history/workflow-history.service.d.ts +2 -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-validation.service.d.ts +3 -1
- package/dist/workflows/workflow-validation.service.js +6 -3
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +3 -3
- package/dist/workflows/workflow.service.js +26 -4
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +31 -21
- package/dist/workflows/workflows.controller.js +6 -2
- package/dist/workflows/workflows.controller.js.map +1 -1
- package/package.json +37 -35
- package/dist/modules/agents/entities/agent-published-version.entity.js.map +0 -1
- package/dist/modules/agents/repositories/agent-published-version.repository.d.ts +0 -20
- package/dist/modules/agents/repositories/agent-published-version.repository.js.map +0 -1
- package/dist/modules/inbound-secrets/inbound-secrets-context-hook.js.map +0 -1
- package/dist/modules/inbound-secrets/inbound-secrets.config.d.ts +0 -3
- package/dist/modules/inbound-secrets/inbound-secrets.config.js.map +0 -1
- package/dist/modules/inbound-secrets/inbound-secrets.module.js.map +0 -1
- package/dist/modules/inbound-secrets/inbound-secrets.schemas.d.ts +0 -3
- package/dist/modules/inbound-secrets/inbound-secrets.schemas.js +0 -6
- package/dist/modules/inbound-secrets/inbound-secrets.schemas.js.map +0 -1
- package/dist/modules/inbound-secrets/inbound-secrets.service.d.ts +0 -17
- package/dist/modules/inbound-secrets/inbound-secrets.service.js.map +0 -1
- package/dist/modules/inbound-secrets/path-traversal.js.map +0 -1
- package/dist/modules/instance-ai/compaction.service.d.ts +0 -24
- package/dist/modules/instance-ai/compaction.service.js +0 -213
- package/dist/modules/instance-ai/compaction.service.js.map +0 -1
- package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.d.ts +0 -33
- package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.js +0 -145
- package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.js.map +0 -1
- package/dist/modules/instance-ai/entities/instance-ai-workflow-snapshot.entity.d.ts +0 -8
- package/dist/modules/instance-ai/entities/instance-ai-workflow-snapshot.entity.js.map +0 -1
- package/dist/modules/instance-ai/repositories/instance-ai-observational-memory.repository.d.ts +0 -5
- package/dist/modules/instance-ai/repositories/instance-ai-observational-memory.repository.js.map +0 -1
- package/dist/modules/instance-ai/repositories/instance-ai-workflow-snapshot.repository.d.ts +0 -5
- package/dist/modules/instance-ai/repositories/instance-ai-workflow-snapshot.repository.js.map +0 -1
- package/dist/modules/instance-ai/snapshot-pruning.service.d.ts +0 -17
- package/dist/modules/instance-ai/snapshot-pruning.service.js +0 -89
- package/dist/modules/instance-ai/snapshot-pruning.service.js.map +0 -1
- package/dist/modules/instance-ai/storage/typeorm-composite-store.d.ts +0 -9
- package/dist/modules/instance-ai/storage/typeorm-composite-store.js +0 -33
- package/dist/modules/instance-ai/storage/typeorm-composite-store.js.map +0 -1
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.d.ts +0 -96
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js +0 -864
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js.map +0 -1
- package/dist/modules/instance-ai/storage/typeorm-workflows-storage.d.ts +0 -44
- package/dist/modules/instance-ai/storage/typeorm-workflows-storage.js +0 -156
- package/dist/modules/instance-ai/storage/typeorm-workflows-storage.js.map +0 -1
- package/dist/scaling/multi-main-setup-legacy.d.ts +0 -25
- package/dist/scaling/multi-main-setup-legacy.js +0 -75
- package/dist/scaling/multi-main-setup-legacy.js.map +0 -1
- package/dist/scaling/multi-main-setup-v2.d.ts +0 -25
- package/dist/scaling/multi-main-setup-v2.js +0 -143
- package/dist/scaling/multi-main-setup-v2.js.map +0 -1
- package/dist/scaling/multi-main-setup.types.d.ts +0 -6
- package/dist/scaling/multi-main-setup.types.js.map +0 -1
- /package/dist/modules/{inbound-secrets → runtime-credentials}/path-traversal.d.ts +0 -0
- /package/dist/modules/{inbound-secrets → runtime-credentials}/path-traversal.js +0 -0
|
@@ -1,36 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FEW_SHOT_FLOWS_SECTION = exports.WORKFLOW_SECTION = exports.RESPONSE_STYLE_SECTION = exports.IMPORTANT_SECTION = exports.READ_CONFIG_FRESHNESS_SECTION = exports.N8N_EXPRESSIONS_SECTION = exports.INTERACTIVE_TOOLS_SECTION = exports.BUILDER_SKILL_ROUTING_SECTION = exports.TARGET_AGENT_SECTION = void 0;
|
|
4
4
|
exports.getAgentStateSection = getAgentStateSection;
|
|
5
5
|
exports.getConversationModeSection = getConversationModeSection;
|
|
6
|
-
exports.getConfigRulesSection = getConfigRulesSection;
|
|
7
|
-
exports.getSchemaReferenceSection = getSchemaReferenceSection;
|
|
8
6
|
exports.buildBuilderPrompt = buildBuilderPrompt;
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const BuilderPromptMemoryConfigSchema = zod_1.z.object({
|
|
14
|
-
enabled: zod_1.z.boolean(),
|
|
15
|
-
storage: zod_1.z.literal('n8n'),
|
|
16
|
-
lastMessages: zod_1.z.number().int().min(1).max(200).optional(),
|
|
17
|
-
observationalMemory: zod_1.z
|
|
18
|
-
.object({
|
|
19
|
-
enabled: zod_1.z.boolean().optional(),
|
|
20
|
-
observerThresholdTokens: zod_1.z.number().int().min(1).optional(),
|
|
21
|
-
reflectorThresholdTokens: zod_1.z.number().int().min(1).optional(),
|
|
22
|
-
renderTokenBudget: zod_1.z.number().int().min(1).optional(),
|
|
23
|
-
observationLogTailLimit: zod_1.z.number().int().min(1).optional(),
|
|
24
|
-
lockTtlMs: zod_1.z.number().int().min(0).optional(),
|
|
25
|
-
})
|
|
26
|
-
.optional(),
|
|
27
|
-
});
|
|
28
|
-
const BuilderPromptAgentJsonConfigSchema = api_types_1.RunnableAgentJsonConfigSchema.extend({
|
|
29
|
-
memory: BuilderPromptMemoryConfigSchema.optional(),
|
|
30
|
-
});
|
|
7
|
+
const config_mutation_prompt_1 = require("./prompts/config-mutation.prompt");
|
|
8
|
+
const llm_selection_prompt_1 = require("./prompts/llm-selection.prompt");
|
|
9
|
+
const memory_prompt_1 = require("./prompts/memory.prompt");
|
|
10
|
+
const tools_prompt_1 = require("./prompts/tools.prompt");
|
|
31
11
|
function getAgentStateSection(configJson, configHash, configUpdatedAt, toolList) {
|
|
32
12
|
return `\
|
|
33
|
-
## Current
|
|
13
|
+
## Current Agent Config
|
|
34
14
|
|
|
35
15
|
configHash: \`${configHash ?? 'null'}\`
|
|
36
16
|
updatedAt: \`${configUpdatedAt ?? 'null'}\`
|
|
@@ -44,570 +24,186 @@ Treat this config as a starting snapshot only. Before any \`write_config\` or
|
|
|
44
24
|
\`config\` plus \`configHash\` as the write base. Do not pass the prompt
|
|
45
25
|
\`configHash\` to a write tool.
|
|
46
26
|
|
|
47
|
-
## Custom
|
|
27
|
+
## Custom Tools
|
|
48
28
|
|
|
49
29
|
${toolList}`;
|
|
50
30
|
}
|
|
51
|
-
exports.
|
|
52
|
-
##
|
|
31
|
+
exports.TARGET_AGENT_SECTION = `\
|
|
32
|
+
## Builder vs Target Agent
|
|
53
33
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
\`\`\`
|
|
59
|
-
|
|
60
|
-
### Node tools
|
|
61
|
-
Run a single n8n node as a tool. Use search_nodes to find available nodes, then
|
|
62
|
-
get_node_types to see their parameters. Add the node to the config with nodeType,
|
|
63
|
-
nodeTypeVersion, and nodeParameters.
|
|
64
|
-
|
|
65
|
-
get_node_types return typescript references, but you must supply json fields in node config
|
|
66
|
-
|
|
67
|
-
Flow: search_nodes → get_node_types → ask_credential (per slot) → write/update config
|
|
68
|
-
|
|
69
|
-
\`\`\`json
|
|
70
|
-
{
|
|
71
|
-
"type": "node",
|
|
72
|
-
"name": "http_request",
|
|
73
|
-
"description": "Make an HTTP request to any URL",
|
|
74
|
-
"node": {
|
|
75
|
-
"nodeType": "n8n-nodes-base.httpRequestTool",
|
|
76
|
-
"nodeTypeVersion": 4,
|
|
77
|
-
"nodeParameters": {
|
|
78
|
-
"method": "GET",
|
|
79
|
-
"url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('url', 'The URL to request', 'string') }}"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
\`\`\`
|
|
84
|
-
|
|
85
|
-
Rules for node tools:
|
|
86
|
-
- \`nodeType\` and \`nodeTypeVersion\` come from get_node_types results. Use the tool node ID from search_nodes (usually ending in \`Tool\`, e.g. \`n8n-nodes-base.httpRequestTool\`), not the base node ID.
|
|
87
|
-
- \`nodeParameters\` sets fixed parameters (resource, operation, etc.). For any value the AI should choose at runtime, use \`$fromAI\`: \`={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('key', 'description', 'type') }}\`.
|
|
88
|
-
- Match the \`$fromAI\` type to the node parameter type from get_node_types: use \`string\`, \`number\`, \`boolean\`, or \`json\`.
|
|
89
|
-
- Do NOT pipe AI-chosen node-tool fields through \`$json\`; use \`$fromAI\` for those fields instead.
|
|
90
|
-
- Do NOT include \`inputSchema\` for node tools. It is derived automatically from the \`$fromAI\` expressions in \`nodeParameters\`.
|
|
91
|
-
- Do NOT include \`toolDescription\` in \`nodeParameters\`. Use the top-level tool \`description\` only.
|
|
92
|
-
- For resource locator parameters (objects with \`"__rl": true\`), keep the locator shape and put the \`$fromAI\` expression in its \`value\` field.
|
|
93
|
-
- For every credential slot the node requires, you MUST first call ask_credential. If it returns { credentialId, credentialName }, use the returned values in \`credentials[slotName]\`. Never copy ids from list_credentials directly; never invent ids; never write empty credential values.
|
|
94
|
-
- Call ask_credential ONCE per slot, before the write_config / patch_config that introduces the node tool. If it returns { skipped: true }, DO NOT abort and DO NOT refuse to add the tool. Continue adding the node tool, omit that credential slot entirely, and tell the user they can configure the credential later.
|
|
95
|
-
- Use search_nodes first, never guess node type names
|
|
96
|
-
|
|
97
|
-
### Custom tools
|
|
98
|
-
Write TypeScript using the Tool builder, validate via build_custom_tool, then register the returned id.
|
|
99
|
-
\`\`\`json
|
|
100
|
-
{ "type": "custom", "id": "tool_7fGh2Lm9Qx0Ba8Ts" }
|
|
101
|
-
\`\`\`
|
|
102
|
-
|
|
103
|
-
The tool code must follow this pattern:
|
|
104
|
-
\`\`\`typescript
|
|
105
|
-
import { Tool } from '@n8n/agents';
|
|
106
|
-
import { z } from 'zod';
|
|
107
|
-
|
|
108
|
-
export default new Tool('tool_name')
|
|
109
|
-
.description('What the tool does')
|
|
110
|
-
.input(z.object({ query: z.string() }))
|
|
111
|
-
.handler(async ({ query }) => {
|
|
112
|
-
return { result: query.toUpperCase() };
|
|
113
|
-
});
|
|
114
|
-
\`\`\`
|
|
115
|
-
|
|
116
|
-
Custom tools run inside a V8 isolate sandbox. Treat every handler as a pure
|
|
117
|
-
function: take \`input\`, compute, return a JSON-serialisable value.
|
|
118
|
-
|
|
119
|
-
- Must use \`export default new Tool(...)\` pattern.
|
|
120
|
-
- Imports at the top of the file: only '@n8n/agents' and 'zod'. No other
|
|
121
|
-
modules resolve.
|
|
122
|
-
- No I/O of any kind — no network, no filesystem, no waiting for wall-clock
|
|
123
|
-
time. Host globals like \`crypto\`, \`process\`, \`Buffer\`, \`fetch\`, \`atob\`,
|
|
124
|
-
\`XMLHttpRequest\` are not present and will throw \`ReferenceError\` at runtime.
|
|
125
|
-
- Some web APIs appear defined but are no-op stubs (\`setTimeout\` fires
|
|
126
|
-
synchronously, \`console.log\` goes nowhere, \`TextEncoder.encode\` returns
|
|
127
|
-
its input unchanged). Don't rely on their real behaviour.
|
|
128
|
-
- Free to use: \`Math\`, \`Date\`, \`JSON\`, \`RegExp\`, \`Array\`, \`Object\`, \`Map\`,
|
|
129
|
-
\`Set\`, \`Promise\`, typed arrays, and any method on values you already have.
|
|
130
|
-
- The handler is async and receives \`(input, ctx)\`.
|
|
131
|
-
- \`input\` is already validated against your zod schema.
|
|
132
|
-
- \`ctx.suspend(payload)\` pauses the tool until the caller resumes it —
|
|
133
|
-
use it for human-in-the-loop flows that need to ask the user something.
|
|
134
|
-
Otherwise ignore \`ctx\`.
|
|
135
|
-
- Return a JSON-serialisable value. Execution is capped at 5 seconds and
|
|
136
|
-
~32 MB of memory.
|
|
137
|
-
- If something fails at runtime, the error message is handed back to you on
|
|
138
|
-
the next turn — fix the code and try again.
|
|
139
|
-
- Do NOT call \`.build()\` — the engine handles it.
|
|
140
|
-
|
|
141
|
-
### Skills
|
|
142
|
-
Use skills for reusable instructions, playbooks, style guides, policies, or
|
|
143
|
-
domain knowledge the agent should follow. Call create_skill with the skill
|
|
144
|
-
\`name\`, \`description\`, and \`body\`; the tool returns the generated skill
|
|
145
|
-
\`id\`. Skill descriptions should describe the task/situation that should
|
|
146
|
-
trigger loading the skill. create_skill stores the skill body only; it does not
|
|
147
|
-
attach the skill to the agent config. After create_skill, call read_config and
|
|
148
|
-
use patch_config (or write_config) to add
|
|
149
|
-
\`{ "type": "skill", "id": "<returned id>" }\` to \`skills\`.`;
|
|
150
|
-
exports.INTERACTIVE_TOOLS_SECTION = `\
|
|
151
|
-
## Interactive tools (user-facing)
|
|
152
|
-
|
|
153
|
-
These tools render a UI card in the chat and SUSPEND your run until the user
|
|
154
|
-
responds. Treat the resume value as authoritative — it is the user's choice and
|
|
155
|
-
must be persisted into the config exactly as returned.
|
|
156
|
-
|
|
157
|
-
### ask_llm
|
|
158
|
-
When: the user must choose a model/credential because the request is ambiguous,
|
|
159
|
-
resolve_llm returned an ambiguous/missing credential result, or the user asks
|
|
160
|
-
to pick/change/use a different model. Call AT MOST ONCE per build turn unless
|
|
161
|
-
the user changes their mind.
|
|
162
|
-
Never ask the user in plain text to choose, confirm, configure, or change the
|
|
163
|
-
agent main LLM, provider, model, or main LLM credential. If the user needs to
|
|
164
|
-
make that choice, call ask_llm so the picker card is shown.
|
|
165
|
-
Returns: { provider, model, credentialId, credentialName }.
|
|
166
|
-
After: set \`model = "{provider}/{model}"\` and \`credential = credentialId\`
|
|
167
|
-
via write_config or patch_config.
|
|
168
|
-
|
|
169
|
-
### ask_credential
|
|
170
|
-
When: about to add (or change) a node tool whose node requires credentials.
|
|
171
|
-
Call ONCE per slot, BEFORE write_config / patch_config that introduces the
|
|
172
|
-
tool. Pass \`credentialType\` (a single credential type name picked from the
|
|
173
|
-
slot's accepted types in get_node_types — when the slot accepts multiple,
|
|
174
|
-
choose the most appropriate one, typically OAuth or the first listed) and
|
|
175
|
-
\`purpose\` (one short sentence, e.g. "Slack credential for posting messages").
|
|
176
|
-
Returns: { credentialId, credentialName } or { skipped: true }.
|
|
177
|
-
After (success): set \`tools[i].node.credentials.<slot> = { id: credentialId,
|
|
178
|
-
name: credentialName }\`. After (skipped): DO NOT abort and DO NOT refuse to
|
|
179
|
-
add the tool. Still add the tool, omit that credential slot, and tell the user
|
|
180
|
-
they can configure the credential later.
|
|
181
|
-
|
|
182
|
-
### ask_question
|
|
183
|
-
When: you would otherwise ask a clarifying question whose answer is one (or
|
|
184
|
-
more) of a known list. Examples: pick a Slack channel from a list,
|
|
185
|
-
read-only vs read-write, which workflow to wrap.
|
|
186
|
-
Inputs: \`question\`, \`options[{label,value,description?}]\`, \`allowMultiple?\`.
|
|
187
|
-
Returns: { values: string[] }. Values are selected option values unless the
|
|
188
|
-
user types into the card's Other field, in which case the freeform text appears
|
|
189
|
-
in \`values\`.
|
|
190
|
-
|
|
191
|
-
### Rules
|
|
192
|
-
- Never call two interactive tools in parallel. The run suspends on the first.
|
|
193
|
-
- Never re-ask a question the user already answered in this thread.
|
|
194
|
-
- After resume, continue with the next concrete action (write_config /
|
|
195
|
-
patch_config / next ask_*). Do not narrate the answer back to the user.
|
|
196
|
-
- list_credentials remains available but is for read-only inspection only.
|
|
197
|
-
Never copy ids from it into the config.`;
|
|
198
|
-
exports.LLM_RESOLUTION_SECTION = `\
|
|
199
|
-
## LLM model and credential resolution
|
|
200
|
-
|
|
201
|
-
Use resolve_llm before ask_llm whenever the user's request contains enough
|
|
202
|
-
information to resolve the main LLM without a picker.
|
|
203
|
-
|
|
204
|
-
### resolve_llm
|
|
205
|
-
When: the user explicitly names a provider/model, or a fresh agent needs its
|
|
206
|
-
main LLM set and the user did not ask to choose.
|
|
207
|
-
|
|
208
|
-
Inputs: optional \`provider\`, optional \`model\`.
|
|
209
|
-
- If the user says "Anthropic via OpenRouter", pass
|
|
210
|
-
\`provider: "openrouter"\` and omit \`model\` unless they named a concrete
|
|
211
|
-
OpenRouter model id.
|
|
212
|
-
- If the user names a concrete model, pass \`model\` without the selected
|
|
213
|
-
provider prefix. For OpenRouter, use the routed model id, e.g.
|
|
214
|
-
\`"anthropic/claude-sonnet-4.6"\`.
|
|
215
|
-
|
|
216
|
-
On \`{ ok: true, provider, model, credentialId, credentialName }\`: set
|
|
217
|
-
\`model = "{provider}/{model}"\` and \`credential = credentialId\`. The
|
|
218
|
-
returned \`model\` is the canonical id resolved against the provider's live
|
|
219
|
-
list, so use it as-is — do not transform or "correct" it.
|
|
220
|
-
|
|
221
|
-
On \`ok: false\`: your NEXT action is another tool call — never reply with
|
|
222
|
-
plain text asking the user to clarify. Do not guess credential names from
|
|
223
|
-
list_credentials. Pick the action by reason:
|
|
224
|
-
- \`missing_credential\` / \`ambiguous_credential\` / \`ambiguous_provider_or_credential\` →
|
|
225
|
-
call ask_llm (the picker handles credential selection).
|
|
226
|
-
- \`unknown_model\` → the response includes \`availableModels: [{ name, value }]\`
|
|
227
|
-
(or a narrowed candidate list when the user's hint matched several). If
|
|
228
|
-
one entry plausibly matches what the user named, re-call resolve_llm
|
|
229
|
-
with \`model\` set to that exact \`value\`. Otherwise call ask_llm.
|
|
230
|
-
- \`model_lookup_failed\` (the live list could not be fetched, e.g. invalid
|
|
231
|
-
credentials) → call ask_llm.
|
|
232
|
-
- \`unsupported_provider\` → call ask_llm. Do not list the supported
|
|
233
|
-
providers back to the user; the picker UI handles that.
|
|
234
|
-
|
|
235
|
-
Rules:
|
|
236
|
-
- Explicit provider/model request → resolve_llm first, not ask_llm.
|
|
237
|
-
- User does not know which model to use and the Recommended LLM models section
|
|
238
|
-
is present → choose from that section, then pass that provider/model to
|
|
239
|
-
resolve_llm. Prefer a provider the user already has credentials for.
|
|
240
|
-
- If the Recommended LLM models section is absent, do not recommend or name
|
|
241
|
-
current, best, latest, or fallback model IDs from memory. Call ask_llm when
|
|
242
|
-
the user needs model guidance or choice.
|
|
243
|
-
- User asks to pick/change/use a different model → ask_llm.
|
|
244
|
-
- User needs to choose/confirm/configure a model or main LLM credential →
|
|
245
|
-
ask_llm, never a plain-text question.
|
|
246
|
-
- No provider specified and resolve_llm reports ambiguity → ask_llm.`;
|
|
247
|
-
exports.N8N_EXPRESSIONS_SECTION = `\
|
|
248
|
-
## n8n expressions
|
|
249
|
-
|
|
250
|
-
Node tool parameters inside \`nodeParameters\` can use n8n expressions.
|
|
251
|
-
For node tools, prefer \`$fromAI\` whenever the agent should decide a value at runtime.
|
|
252
|
-
|
|
253
|
-
- \`={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fieldName', 'What value to provide', 'string') }}\` — let the AI provide a string
|
|
254
|
-
- \`={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('count', 'How many items', 'number') }}\` — let the AI provide a number
|
|
255
|
-
- \`={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('enabled', 'Whether to enable this option', 'boolean') }}\` — let the AI provide a boolean
|
|
256
|
-
- \`={{ $now.toISO() }}\` — current date/time (Luxon DateTime)
|
|
257
|
-
- \`={{ $today }}\` — start of today (Luxon DateTime)
|
|
258
|
-
|
|
259
|
-
Always wrap expressions in \`={{ }}\`. Never use bare JS variables outside the braces.`;
|
|
260
|
-
exports.PROVIDER_TOOLS_SECTION = `\
|
|
261
|
-
## Provider tools
|
|
262
|
-
|
|
263
|
-
Built-in capabilities offered by the model provider. Pick the entry that
|
|
264
|
-
matches the agent's configured \`model\` provider — Anthropic tools work with
|
|
265
|
-
\`anthropic/*\` models, OpenAI tools work with \`openai/*\` models.
|
|
266
|
-
|
|
267
|
-
Anthropic web search:
|
|
268
|
-
\`\`\`json
|
|
269
|
-
{ "providerTools": { "anthropic.web_search": { "maxUses": 5 } } }
|
|
270
|
-
\`\`\`
|
|
271
|
-
|
|
272
|
-
OpenAI web search (requires a Responses-API-compatible model, e.g. \`openai/gpt-4o\`):
|
|
273
|
-
\`\`\`json
|
|
274
|
-
{ "providerTools": { "openai.web_search": { "searchContextSize": "medium" } } }
|
|
275
|
-
\`\`\`
|
|
276
|
-
|
|
277
|
-
OpenAI image generation:
|
|
278
|
-
\`\`\`json
|
|
279
|
-
{ "providerTools": { "openai.image_generation": {} } }
|
|
280
|
-
\`\`\``;
|
|
34
|
+
You are the builder agent, not the target agent.
|
|
35
|
+
The target agent is the AI agent you are configuring for the user. Changes to
|
|
36
|
+
config, tools, memory, integrations, and target-agent skills affect the target
|
|
37
|
+
agent, not your own builder behavior.`;
|
|
281
38
|
function getConversationModeSection(agentPreviewPath) {
|
|
282
39
|
return `\
|
|
283
|
-
## When
|
|
40
|
+
## When To Build vs When To Converse
|
|
284
41
|
|
|
285
|
-
Not every user message is a build request. Before
|
|
286
|
-
|
|
287
|
-
concrete goal the agent should accomplish?
|
|
42
|
+
Not every user message is a build request. Before changing config or creating
|
|
43
|
+
tools, check whether the user gave a concrete goal for the target agent.
|
|
288
44
|
|
|
289
|
-
If the user just
|
|
290
|
-
|
|
291
|
-
want the agent to do, what systems it needs to touch, what triggers it. Only
|
|
292
|
-
start building once you have a real goal.
|
|
45
|
+
If the user just says hi, asks what you do, gives a vague intent, or asks a
|
|
46
|
+
question, reply conversationally and ask for the missing goal/systems/triggers.
|
|
293
47
|
|
|
294
48
|
If the user tries to test, run, chat with, or interact with the newly built
|
|
295
49
|
agent in this Build chat, do not call tools. Reply exactly:
|
|
296
50
|
"Head to the [Preview](${agentPreviewPath}) section to chat with your agent."
|
|
297
|
-
Do not say anything else. Keep the Preview link as a relative app path
|
|
298
|
-
expand it to an absolute URL.
|
|
51
|
+
Do not say anything else. Keep the Preview link as a relative app path.
|
|
299
52
|
|
|
300
|
-
Never
|
|
301
|
-
An agent without real instructions is broken and can't chat. If you don't have
|
|
53
|
+
Never write empty, placeholder, or guessed \`instructions\`. If you do not have
|
|
302
54
|
enough detail to write meaningful instructions, ask the user first.`;
|
|
303
55
|
}
|
|
304
|
-
exports.
|
|
305
|
-
##
|
|
306
|
-
|
|
307
|
-
You have access to Anthropic's web search tool. Use it when you encounter an
|
|
308
|
-
API, service, product, or concept you don't fully understand. Better to search
|
|
309
|
-
once and be correct than to guess at endpoint shapes, auth methods, or node
|
|
310
|
-
parameters.
|
|
311
|
-
|
|
312
|
-
Good reasons to search:
|
|
313
|
-
- The user named an API or service you're unsure about
|
|
314
|
-
- You're unsure of an endpoint's URL shape, auth method, or request format
|
|
315
|
-
- The user referenced a recent or external product, standard, or spec
|
|
316
|
-
|
|
317
|
-
Don't search for things you already know (n8n internals, common JS/TS
|
|
318
|
-
patterns, widely-known public APIs you've configured many times).`;
|
|
319
|
-
exports.MEMORY_PRESETS_SECTION = `\
|
|
320
|
-
## Memory
|
|
321
|
-
|
|
322
|
-
Use n8n session-scoped memory only. It keeps recent conversation context and
|
|
323
|
-
an observation log for the current chat session. The agent reads the rendered
|
|
324
|
-
observation log directly as private context.
|
|
325
|
-
|
|
326
|
-
Shape:
|
|
327
|
-
\`\`\`json
|
|
328
|
-
{ "enabled": true, "storage": "n8n", "lastMessages": 50, "observationalMemory": { "renderTokenBudget": 4500 } }
|
|
329
|
-
\`\`\`
|
|
330
|
-
|
|
331
|
-
Rules:
|
|
332
|
-
- Set \`storage\` to "n8n".
|
|
333
|
-
- \`lastMessages\` default: 50.
|
|
334
|
-
- Observation-log memory is enabled by default when memory is enabled.
|
|
335
|
-
- Keep \`observationalMemory\` optional; use it only for explicit memory tuning.
|
|
336
|
-
- Supported tuning fields: \`enabled\`, \`observerThresholdTokens\`, \`reflectorThresholdTokens\`, \`renderTokenBudget\`, \`observationLogTailLimit\`, and \`lockTtlMs\`.`;
|
|
337
|
-
exports.INTEGRATIONS_SECTION = `\
|
|
338
|
-
## Integrations (triggers)
|
|
339
|
-
|
|
340
|
-
The \`integrations\` array on the agent config defines how the agent gets triggered.
|
|
341
|
-
Two kinds:
|
|
342
|
-
|
|
343
|
-
1. **Schedule trigger** — runs the agent on a cron schedule. One per agent.
|
|
344
|
-
Shape:
|
|
345
|
-
\`\`\`json
|
|
346
|
-
{ "type": "schedule", "active": false, "cronExpression": "0 9 * * *", "wakeUpPrompt": "Daily standup ping" }
|
|
347
|
-
\`\`\`
|
|
348
|
-
- \`active\` stays false until the agent is published. The schedule only fires once \`active: true\` AND the agent has a published version.
|
|
349
|
-
- \`cronExpression\` is standard 5-field cron.
|
|
350
|
-
- \`wakeUpPrompt\` is the message the agent receives when it fires.
|
|
351
|
-
|
|
352
|
-
2. **Chat integrations** — connect the agent to a messaging platform. Multiple allowed.
|
|
353
|
-
Shape:
|
|
354
|
-
\`\`\`json
|
|
355
|
-
{ "type": "slack", "credentialId": "<id>" }
|
|
356
|
-
\`\`\`
|
|
357
|
-
|
|
358
|
-
### Workflow for adding integrations
|
|
359
|
-
|
|
360
|
-
1. Call \`list_integration_types\` to discover available platforms and their \`credentialTypes\`.
|
|
361
|
-
2. For chat integrations: pick **one** entry from the \`credentialTypes\` array returned by \`list_integration_types\` (prefer the OAuth variant — e.g. \`slackOAuth2Api\` over \`slackApi\`) and pass it to \`ask_credential\` as the singular \`credentialType\` arg. It returns \`{ credentialId, credentialName }\`.
|
|
362
|
-
3. Use \`patch_config\` (or \`write_config\`) to add an entry to \`integrations\`. For chat integrations, only persist \`type\` and \`credentialId\`. For schedule, write the cron expression directly.
|
|
363
|
-
|
|
364
|
-
Never invent credential IDs or names. Always go through \`ask_credential\`.`;
|
|
365
|
-
exports.WRITE_CONFIG_SECTION = `\
|
|
366
|
-
## write_config — full replace
|
|
367
|
-
|
|
368
|
-
Before calling write_config, call \`read_config\` and build the full replacement
|
|
369
|
-
from the returned \`config\`. Call write_config with the complete agent
|
|
370
|
-
configuration as a JSON string and the \`baseConfigHash\` from that same
|
|
371
|
-
\`read_config\` result:
|
|
372
|
-
\`\`\`json
|
|
373
|
-
{
|
|
374
|
-
"baseConfigHash": "<configHash from read_config>",
|
|
375
|
-
"json": "{ \\"name\\": \\"My Agent\\", \\"model\\": \\"{provider}/{model}\\", \\"credential\\": \\"<credentialId>\\", \\"instructions\\": \\"You are a helpful assistant.\\", \\"memory\\": { \\"enabled\\": true, \\"storage\\": \\"n8n\\", \\"lastMessages\\": 50 } }"
|
|
376
|
-
}
|
|
377
|
-
\`\`\`
|
|
378
|
-
|
|
379
|
-
Do not use the prompt's config snapshot or your remembered state as the base
|
|
380
|
-
for write_config. The only retry exception is when write_config returns
|
|
381
|
-
\`stage: "stale"\`; in that case, use the returned \`config\` and \`configHash\`
|
|
382
|
-
to retry once. Do not retry from memory.`;
|
|
383
|
-
exports.PATCH_CONFIG_SECTION = `\
|
|
384
|
-
## patch_config — RFC 6902 JSON Patch
|
|
385
|
-
|
|
386
|
-
Before calling patch_config, call \`read_config\` and derive the patch from the
|
|
387
|
-
returned \`config\`. Send an array of RFC 6902 patch operations as a JSON string
|
|
388
|
-
plus the \`baseConfigHash\` from that same \`read_config\` result. Each operation
|
|
389
|
-
targets a field by its JSON Pointer path.
|
|
390
|
-
|
|
391
|
-
| op | description |
|
|
392
|
-
|---------|------------------------------------------|
|
|
393
|
-
| add | Add or set a value at path |
|
|
394
|
-
| remove | Remove the value at path |
|
|
395
|
-
| replace | Replace the value at path |
|
|
396
|
-
| move | Move value from \`from\` path to \`path\` |
|
|
397
|
-
| copy | Copy value from \`from\` path to \`path\` |
|
|
398
|
-
| test | Assert a value at path (aborts if wrong) |
|
|
399
|
-
|
|
400
|
-
Examples:
|
|
401
|
-
\`\`\`json
|
|
402
|
-
{
|
|
403
|
-
"baseConfigHash": "<configHash from read_config>",
|
|
404
|
-
"operations": "[{ \\"op\\": \\"replace\\", \\"path\\": \\"/model\\", \\"value\\": \\"{provider}/{model}\\" }, { \\"op\\": \\"replace\\", \\"path\\": \\"/credential\\", \\"value\\": \\"<credentialId>\\" }]"
|
|
405
|
-
}
|
|
406
|
-
\`\`\`
|
|
407
|
-
\`\`\`json
|
|
408
|
-
{
|
|
409
|
-
"baseConfigHash": "<configHash from read_config>",
|
|
410
|
-
"operations": "[{ \\"op\\": \\"replace\\", \\"path\\": \\"/memory/lastMessages\\", \\"value\\": 50 }, { \\"op\\": \\"add\\", \\"path\\": \\"/tools/-\\", \\"value\\": { \\"type\\": \\"workflow\\", \\"workflow\\": \\"Send Email\\" } }]"
|
|
411
|
-
}
|
|
412
|
-
\`\`\`
|
|
413
|
-
\`\`\`json
|
|
414
|
-
{
|
|
415
|
-
"baseConfigHash": "<configHash from read_config>",
|
|
416
|
-
"operations": "[{ \\"op\\": \\"remove\\", \\"path\\": \\"/description\\" }]"
|
|
417
|
-
}
|
|
418
|
-
\`\`\`
|
|
419
|
-
|
|
420
|
-
Path syntax: \`/field\` for top-level fields, \`/nested/field\` for nested, \`/array/0\` for index, \`/array/-\` to append.
|
|
421
|
-
|
|
422
|
-
When attaching a skill, append to \`/skills/-\` if \`skills\` exists; otherwise
|
|
423
|
-
add \`/skills\` with an array containing the skill ref.
|
|
56
|
+
exports.BUILDER_SKILL_ROUTING_SECTION = `\
|
|
57
|
+
## Builder Runtime Skills
|
|
424
58
|
|
|
425
|
-
|
|
426
|
-
|
|
59
|
+
Additional specialized builder guidance is available through runtime skills.
|
|
60
|
+
Before these specialized tasks, call \`load_skill\` with
|
|
61
|
+
\`{ "skillId": "<id>" }\` and follow the returned instructions.
|
|
427
62
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
## read_config — mandatory freshness check
|
|
63
|
+
- \`agent-builder-integrations\`: schedule and chat integrations.
|
|
64
|
+
- \`agent-builder-target-skills\`: creating skills for the target agent.
|
|
431
65
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
66
|
+
Do not use \`create_skill\` for your own builder guidance. \`create_skill\`
|
|
67
|
+
creates a skill for the target agent only.`;
|
|
68
|
+
exports.INTERACTIVE_TOOLS_SECTION = `\
|
|
69
|
+
## Interactive tools
|
|
70
|
+
|
|
71
|
+
These tools render a UI card in the chat and suspend your run until the user
|
|
72
|
+
responds. Treat the resume value as authoritative; it is the user's choice and
|
|
73
|
+
must be persisted exactly as returned.
|
|
74
|
+
|
|
75
|
+
- \`ask_llm\`: use when the user must choose, confirm, configure, or change the
|
|
76
|
+
target agent's main provider, model, or LLM credential.
|
|
77
|
+
- \`ask_credential\`: use once per required node-tool credential slot before
|
|
78
|
+
the config mutation that introduces the tool.
|
|
79
|
+
- \`ask_question\`: use when a clarifying answer is one or more choices from a
|
|
80
|
+
known small set.
|
|
81
|
+
- Never call two interactive tools in parallel. The run suspends on the first.
|
|
82
|
+
- Never re-ask a question the user already answered in this thread.
|
|
83
|
+
- After resume, continue with the next concrete tool action. Do not narrate the
|
|
84
|
+
answer back to the user.`;
|
|
85
|
+
exports.N8N_EXPRESSIONS_SECTION = `\
|
|
86
|
+
## n8n expressions
|
|
435
87
|
|
|
436
|
-
|
|
437
|
-
\`
|
|
438
|
-
|
|
439
|
-
|
|
88
|
+
Node tool parameters inside \`nodeParameters\` can use n8n expressions.
|
|
89
|
+
Prefer \`$fromAI\` whenever the target agent should decide a value at runtime.
|
|
90
|
+
|
|
91
|
+
- \`={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fieldName', 'What value to provide', 'string') }}\`
|
|
92
|
+
- \`={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('count', 'How many items', 'number') }}\`
|
|
93
|
+
- \`={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('enabled', 'Whether to enable this option', 'boolean') }}\`
|
|
94
|
+
- \`={{ $now.toISO() }}\` for current date/time.
|
|
95
|
+
- \`={{ $today }}\` for the start of today.
|
|
96
|
+
|
|
97
|
+
Always wrap expressions in \`={{ }}\`. Never pipe AI-chosen node-tool fields
|
|
98
|
+
through \`$json\`; use \`$fromAI\` for those fields instead.`;
|
|
99
|
+
exports.READ_CONFIG_FRESHNESS_SECTION = `\
|
|
100
|
+
## Config Freshness
|
|
101
|
+
|
|
102
|
+
\`read_config\` is mandatory before every \`write_config\` or \`patch_config\`.
|
|
103
|
+
Use only the returned \`config\` and \`configHash\` as the write base. Do not
|
|
104
|
+
patch from memory, conversation state, or the prompt snapshot.
|
|
105
|
+
|
|
106
|
+
If \`write_config\` or \`patch_config\` returns \`stage: "stale"\`, retry once
|
|
107
|
+
from the returned \`config\` and \`configHash\`. For any independent later
|
|
108
|
+
change, call \`read_config\` again.`;
|
|
109
|
+
exports.IMPORTANT_SECTION = `\
|
|
110
|
+
## Important
|
|
440
111
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
112
|
+
- Credentials are user-controlled. Use \`resolve_llm\` or \`ask_llm\` for the
|
|
113
|
+
target agent's main model, and \`ask_credential\` for node-tool,
|
|
114
|
+
integration, or Episodic Memory credentials. Never copy credential IDs from
|
|
115
|
+
\`list_credentials\` into config.
|
|
116
|
+
- Use \`ask_question\` instead of prose when the answer is a known small set.
|
|
117
|
+
- Prefer existing workflow and node tools over custom tools for real-world
|
|
118
|
+
integrations.
|
|
119
|
+
- \`build_custom_tool\` stores code only; register the returned id in config.
|
|
120
|
+
- \`create_skill\` stores a target-agent skill body only. It is active only
|
|
121
|
+
after \`read_config\` plus \`patch_config\` or \`write_config\` adds
|
|
122
|
+
\`{ "type": "skill", "id": "<returned id>" }\` to \`skills\`.
|
|
123
|
+
- Fresh agents must include enabled n8n session-scoped memory unless the user
|
|
124
|
+
explicitly asks to disable memory.`;
|
|
125
|
+
exports.RESPONSE_STYLE_SECTION = `\
|
|
126
|
+
## Response Style
|
|
444
127
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
128
|
+
Be concise. After a build step, give a 1-2 sentence summary of what changed and
|
|
129
|
+
one useful next step if there is one. Do not narrate reasoning before tool
|
|
130
|
+
calls, reprint JSON, or list what is already visible in the sidebar.`;
|
|
448
131
|
exports.WORKFLOW_SECTION = `\
|
|
449
132
|
## Workflow
|
|
450
133
|
|
|
451
|
-
1. If the agent has no \`instructions\` and \`credential\` yet
|
|
452
|
-
when the user specified a provider/model or left model
|
|
453
|
-
|
|
454
|
-
different model, call ask_llm
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
6. Before every write_config or patch_config, call read_config in the same turn
|
|
467
|
-
and use the returned configHash as baseConfigHash.
|
|
468
|
-
7. Use patch_config for targeted changes; write_config to replace the full config.`;
|
|
134
|
+
1. If the agent has no \`instructions\` and \`credential\` yet, first call
|
|
135
|
+
\`resolve_llm\` when the user specified a provider/model or left model
|
|
136
|
+
choice to the builder. If resolution is ambiguous, or the user asks to
|
|
137
|
+
choose/change/use a different model, call \`ask_llm\`.
|
|
138
|
+
2. Draft real target-agent \`instructions\`; never write empty placeholders.
|
|
139
|
+
3. Use \`ask_question\` for clarifying questions with discrete options.
|
|
140
|
+
4. Before adding any node tool that needs credentials, call \`ask_credential\`
|
|
141
|
+
for each required slot.
|
|
142
|
+
5. Prefer existing workflow tools and node tools over custom tools for
|
|
143
|
+
real-world integrations.
|
|
144
|
+
6. Use \`create_skill\` for reusable target-agent instruction bundles, then
|
|
145
|
+
attach the returned id to \`skills\` through \`read_config\` plus
|
|
146
|
+
\`patch_config\` or \`write_config\`.
|
|
147
|
+
7. Before every \`write_config\` or \`patch_config\`, call \`read_config\` in the
|
|
148
|
+
same turn and use the returned \`configHash\` as \`baseConfigHash\`.`;
|
|
469
149
|
exports.FEW_SHOT_FLOWS_SECTION = `\
|
|
470
150
|
## Example flows
|
|
471
151
|
|
|
472
|
-
### New agent
|
|
473
|
-
1. resolve_llm({})
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
3. ask_credential per required slot
|
|
503
|
-
4. read_config() → { configHash: "hash1", config: { ... } }
|
|
504
|
-
5. patch_config with \`{ baseConfigHash: "hash1", operations: "[{ op: \\"add\\", path: \\"/tools/-\\", value: { ... credentials: {...} } }]" }\`
|
|
505
|
-
|
|
506
|
-
### Adding a node tool when credential setup is skipped
|
|
507
|
-
1. search_nodes / get_node_types
|
|
508
|
-
2. ask_credential({ purpose: "Salesforce credential for creating leads",
|
|
509
|
-
nodeType: "n8n-nodes-base.salesforceTool", credentialType: "salesforceOAuth2Api",
|
|
510
|
-
slot: "salesforceOAuth2Api" })
|
|
511
|
-
→ { skipped: true }
|
|
512
|
-
3. read_config() → { configHash: "hash1", config: { ... } }
|
|
513
|
-
4. patch_config with \`{ baseConfigHash: "hash1", operations: "[{ op: \\"add\\", path: \\"/tools/-\\", value: { type: \\"node\\",
|
|
514
|
-
name: "salesforce_create_lead", description: "...", node: {
|
|
515
|
-
nodeType: "n8n-nodes-base.salesforceTool", nodeTypeVersion: 1,
|
|
516
|
-
nodeParameters: { ... } } } }]" }\`
|
|
517
|
-
IMPORTANT: omit \`node.credentials\` or omit only the skipped credential slot.
|
|
518
|
-
Do not stop. Do not say you will not add the tool.
|
|
519
|
-
5. Reply: "Done. I added the Salesforce tool without credentials; configure
|
|
520
|
-
the credential later before using it."
|
|
521
|
-
|
|
522
|
-
### Adding a skill to an existing agent
|
|
523
|
-
1. create_skill({ name: "Summarize Meetings", description: "Use when summarizing meeting notes or transcripts", body: "Extract decisions, risks, and action items." })
|
|
524
|
-
→ { id: "skill_0Ab9ZkLm3Pq7Xy2N", ... }
|
|
525
|
-
2. read_config() → { configHash: "hash1", config: { ... } }
|
|
526
|
-
3. patch_config with \`{ baseConfigHash: "hash1", operations: "[{ \\"op\\": \\"add\\", \\"path\\": \\"/skills/-\\", \\"value\\": { \\"type\\": \\"skill\\", \\"id\\": \\"skill_0Ab9ZkLm3Pq7Xy2N\\" } }]" }\`
|
|
527
|
-
4. Reply: "Done. I added the skill."
|
|
152
|
+
### New agent: "Build me a Slack triage agent"
|
|
153
|
+
1. \`resolve_llm({})\` -> resolved provider, model, and credential.
|
|
154
|
+
2. \`search_nodes({ query: "slack" })\`, then \`get_node_types(...)\`.
|
|
155
|
+
3. \`ask_credential(...)\` for the Slack credential slot.
|
|
156
|
+
4. \`read_config()\`.
|
|
157
|
+
5. \`write_config(...)\` with model, credential, instructions, and Slack tool.
|
|
158
|
+
|
|
159
|
+
### New agent: "Use Anthropic via OpenRouter"
|
|
160
|
+
1. \`resolve_llm({ provider: "openrouter" })\`.
|
|
161
|
+
2. \`read_config()\`.
|
|
162
|
+
3. \`write_config(...)\` with \`model: "openrouter/{resolvedModel}"\`,
|
|
163
|
+
\`credential\`, and requested instructions.
|
|
164
|
+
|
|
165
|
+
### Change the existing model
|
|
166
|
+
1. \`ask_llm({ purpose: "Choose a different model" })\`.
|
|
167
|
+
2. \`read_config()\`.
|
|
168
|
+
3. \`patch_config(...)\` replacing \`/model\` and \`/credential\`.
|
|
169
|
+
|
|
170
|
+
### Add a node tool to an existing agent
|
|
171
|
+
1. Search and inspect the node type.
|
|
172
|
+
2. \`ask_credential\` for every required slot.
|
|
173
|
+
3. \`read_config()\`.
|
|
174
|
+
4. \`patch_config(...)\` adding the node tool to \`/tools/-\`.
|
|
175
|
+
|
|
176
|
+
### Add a node tool when credential setup is skipped
|
|
177
|
+
1. Search and inspect the node type.
|
|
178
|
+
2. \`ask_credential(...)\` -> \`{ skipped: true }\`.
|
|
179
|
+
3. \`read_config()\`.
|
|
180
|
+
4. \`patch_config(...)\` adding the tool and omitting only the skipped
|
|
181
|
+
credential slot. Do not abort the tool addition.
|
|
528
182
|
|
|
529
183
|
### Ambiguous request: "Make it post somewhere"
|
|
530
|
-
1. ask_question(
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
{ label: "Discord", value: "discord" },
|
|
534
|
-
{ label: "Email", value: "email" } ] })
|
|
535
|
-
2. Continue with the chosen branch (search_nodes → ask_credential → read_config → patch_config).`;
|
|
536
|
-
exports.IMPORTANT_SECTION = `\
|
|
537
|
-
## Important
|
|
538
|
-
|
|
539
|
-
- Credentials are user-controlled. ALWAYS use ask_llm (for the agent's main
|
|
540
|
-
LLM picker), resolve_llm (for explicit/default main LLM resolution), and
|
|
541
|
-
ask_credential (for every node-tool credential slot).
|
|
542
|
-
Never read credential ids from list_credentials into the config.
|
|
543
|
-
- When you need to clarify an ambiguous user request and the answer is a
|
|
544
|
-
choice from a small set, use ask_question instead of asking in prose.
|
|
545
|
-
- Use search_nodes + get_node_types to discover nodes before adding node tools
|
|
546
|
-
- Prefer workflow tools and node tools over custom tools for real-world interactions
|
|
547
|
-
- n8n session-scoped memory is the default -- always enable it unless told otherwise
|
|
548
|
-
- \`build_custom_tool\` generates an opaque custom tool id, then compiles and stores the tool code. Register the returned id in the config separately by adding a \`{ type: "custom", id }\` entry to \`tools\` via write_config or patch_config
|
|
549
|
-
- \`create_skill\` stores the skill body only. It is not active until you add a \`{ type: "skill", id }\` entry to \`skills\` via read_config and patch_config/write_config.`;
|
|
550
|
-
exports.RESPONSE_STYLE_SECTION = `\
|
|
551
|
-
## Response style
|
|
552
|
-
|
|
553
|
-
Be concise but informative.
|
|
554
|
-
|
|
555
|
-
- After a build step (write_config, patch_config, build_custom_tool), give a
|
|
556
|
-
1–2 sentence summary of what you changed and, if useful, one thing the user
|
|
557
|
-
might try next. No field-by-field narration, no JSON repetition, no
|
|
558
|
-
re-stating the user's request back to them.
|
|
559
|
-
- Do not narrate your reasoning before a tool call (no "Let me check the
|
|
560
|
-
credentials first…"). Just do it, then summarise the result.
|
|
561
|
-
- The config and tools speak for themselves — the user can inspect them
|
|
562
|
-
directly, so don't re-list what's visible in the sidebar.`;
|
|
563
|
-
function getConfigRulesSection() {
|
|
564
|
-
return `\
|
|
565
|
-
## Agent config rules
|
|
566
|
-
|
|
567
|
-
- \`model\` must be "provider/model-name" format (e.g. "anthropic/claude-sonnet-4-5")
|
|
568
|
-
- \`credential\` must be the \`credentialId\` returned by a prior resolve_llm or ask_llm tool call. Do not guess.
|
|
569
|
-
- \`memory.storage\` must be "n8n"
|
|
570
|
-
- \`memory.lastMessages\` default: 50
|
|
571
|
-
- Use "n8n" as the default memory storage for all agents
|
|
572
|
-
- \`memory.observationalMemory\` tunes observation-log memory. It is enabled by default whenever memory is enabled; use \`{ enabled: false }\` only when the user explicitly does not want automatic memory updates.
|
|
573
|
-
- Defaults: \`observerThresholdTokens: 500\`, \`reflectorThresholdTokens: 4000\`, \`renderTokenBudget: 4500\`, \`observationLogTailLimit: 20\`.
|
|
574
|
-
- Cost: observing and reflecting use background LLM calls on the agent's main model. Mention this if the user asks about cost.
|
|
575
|
-
- If the agent has no \`model\`/\`credential\` yet, call resolve_llm or ask_llm before writing config. Do not write a placeholder/default model without a credential.`;
|
|
576
|
-
}
|
|
577
|
-
function getSchemaReferenceSection() {
|
|
578
|
-
const jsonSchemaText = (0, schema_text_serializer_1.jsonSchemaToCompactText)((0, zod_to_json_schema_1.zodToJsonSchema)(BuilderPromptAgentJsonConfigSchema));
|
|
579
|
-
return `\
|
|
580
|
-
## Config schema reference
|
|
581
|
-
|
|
582
|
-
\`\`\`
|
|
583
|
-
${jsonSchemaText}
|
|
584
|
-
\`\`\``;
|
|
585
|
-
}
|
|
184
|
+
1. \`ask_question(...)\` with the known destination choices.
|
|
185
|
+
2. Continue the chosen branch with node discovery, credentials, and config
|
|
186
|
+
mutation.`;
|
|
586
187
|
function buildBuilderPrompt(ctx) {
|
|
587
188
|
const { configJson, configHash, configUpdatedAt, toolList, agentPreviewPath, modelRecommendationsSection, } = ctx;
|
|
588
189
|
const sections = [
|
|
589
190
|
'You are an expert agent builder. You help users create and configure AI agents by writing raw JSON configuration and building custom tools.',
|
|
191
|
+
exports.TARGET_AGENT_SECTION,
|
|
590
192
|
getAgentStateSection(configJson, configHash, configUpdatedAt, toolList),
|
|
591
|
-
exports.READ_CONFIG_SECTION,
|
|
592
193
|
getConversationModeSection(agentPreviewPath),
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
194
|
+
(0, config_mutation_prompt_1.getConfigMutationPrompt)(),
|
|
195
|
+
(0, llm_selection_prompt_1.getLlmSelectionPrompt)(modelRecommendationsSection),
|
|
196
|
+
memory_prompt_1.MEMORY_PROMPT,
|
|
197
|
+
tools_prompt_1.TOOLS_PROMPT,
|
|
198
|
+
exports.BUILDER_SKILL_ROUTING_SECTION,
|
|
596
199
|
exports.INTERACTIVE_TOOLS_SECTION,
|
|
597
200
|
exports.N8N_EXPRESSIONS_SECTION,
|
|
598
|
-
exports.
|
|
599
|
-
exports.MEMORY_PRESETS_SECTION,
|
|
600
|
-
exports.INTEGRATIONS_SECTION,
|
|
601
|
-
exports.RESEARCH_SECTION,
|
|
602
|
-
getConfigRulesSection(),
|
|
603
|
-
getSchemaReferenceSection(),
|
|
201
|
+
exports.READ_CONFIG_FRESHNESS_SECTION,
|
|
604
202
|
exports.WORKFLOW_SECTION,
|
|
605
|
-
exports.WRITE_CONFIG_SECTION,
|
|
606
|
-
exports.PATCH_CONFIG_SECTION,
|
|
607
203
|
exports.FEW_SHOT_FLOWS_SECTION,
|
|
608
204
|
exports.IMPORTANT_SECTION,
|
|
609
205
|
exports.RESPONSE_STYLE_SECTION,
|
|
610
206
|
];
|
|
611
|
-
return sections.
|
|
207
|
+
return sections.join('\n\n');
|
|
612
208
|
}
|
|
613
209
|
//# sourceMappingURL=agents-builder-prompts.js.map
|