@n8n/instance-ai 1.16.1 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/instance-agent.js +7 -1
- package/dist/agent/instance-agent.js.map +1 -1
- package/dist/agent/system-prompt.js +3 -3
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/event-bus/event-bus.interface.d.ts +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/dist/parsers/xlsx-parser.js +1 -1
- package/dist/parsers/xlsx-parser.js.map +1 -1
- package/dist/runtime/terminal-response-guard.js +2 -1
- package/dist/runtime/terminal-response-guard.js.map +1 -1
- package/dist/skills/skill-gates.d.ts +5 -0
- package/dist/skills/skill-gates.js +12 -0
- package/dist/skills/skill-gates.js.map +1 -0
- package/dist/storage/workflow-loop-storage.d.ts +7 -7
- package/dist/stream/consume-with-hitl.d.ts +3 -0
- package/dist/stream/consume-with-hitl.js +2 -0
- package/dist/stream/consume-with-hitl.js.map +1 -1
- package/dist/stream/map-chunk.js +7 -0
- package/dist/stream/map-chunk.js.map +1 -1
- package/dist/stream/usage-accumulator.d.ts +2 -0
- package/dist/stream/usage-accumulator.js +13 -3
- package/dist/stream/usage-accumulator.js.map +1 -1
- package/dist/tool-registry.js +5 -1
- package/dist/tool-registry.js.map +1 -1
- package/dist/tools/agents.tool.d.ts +2 -0
- package/dist/tools/agents.tool.js +40 -0
- package/dist/tools/agents.tool.js.map +1 -0
- package/dist/tools/credentials.tool.js +8 -3
- package/dist/tools/credentials.tool.js.map +1 -1
- package/dist/tools/evals/eval-config.tool.js +10 -2
- package/dist/tools/evals/eval-config.tool.js.map +1 -1
- package/dist/tools/executions.tool.js +3 -2
- package/dist/tools/executions.tool.js.map +1 -1
- package/dist/tools/filesystem/create-tools-from-mcp-server.js +2 -2
- package/dist/tools/filesystem/create-tools-from-mcp-server.js.map +1 -1
- package/dist/tools/index.js +15 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/n8n-docs/registry.d.ts +2 -2
- package/dist/tools/n8n-docs/registry.js +20 -8
- package/dist/tools/n8n-docs/registry.js.map +1 -1
- package/dist/tools/n8n-docs.tool.js +18 -12
- package/dist/tools/n8n-docs.tool.js.map +1 -1
- package/dist/tools/nodes.tool.js +1 -1
- package/dist/tools/orchestration/agent-preview-session-binding.d.ts +20 -0
- package/dist/tools/orchestration/agent-preview-session-binding.js +47 -0
- package/dist/tools/orchestration/agent-preview-session-binding.js.map +1 -0
- package/dist/tools/orchestration/agent-target-binding.d.ts +6 -1
- package/dist/tools/orchestration/agent-target-binding.js +43 -4
- package/dist/tools/orchestration/agent-target-binding.js.map +1 -1
- package/dist/tools/orchestration/build-agent.tool.js +365 -71
- package/dist/tools/orchestration/build-agent.tool.js.map +1 -1
- package/dist/tools/orchestration/builder-thread-id.d.ts +1 -0
- package/dist/tools/orchestration/builder-thread-id.js +7 -0
- package/dist/tools/orchestration/builder-thread-id.js.map +1 -0
- package/dist/tools/orchestration/get-session.tool.d.ts +2 -0
- package/dist/tools/orchestration/get-session.tool.js +49 -0
- package/dist/tools/orchestration/get-session.tool.js.map +1 -0
- package/dist/tools/orchestration/verification/reconcile-plan.js +4 -1
- package/dist/tools/orchestration/verification/reconcile-plan.js.map +1 -1
- package/dist/tools/orchestration/verify-built-workflow.tool.js +1 -0
- package/dist/tools/orchestration/verify-built-workflow.tool.js.map +1 -1
- package/dist/tools/research.tool.js +2 -0
- package/dist/tools/research.tool.js.map +1 -1
- package/dist/tools/tool-ids.d.ts +2 -0
- package/dist/tools/tool-ids.js +3 -0
- package/dist/tools/tool-ids.js.map +1 -1
- package/dist/tools/workflows/build-workflow.tool.js +12 -4
- package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/classify-node-destructiveness.service.d.ts +1 -1
- package/dist/tools/workflows/classify-node-destructiveness.service.js +5 -7
- package/dist/tools/workflows/classify-node-destructiveness.service.js.map +1 -1
- package/dist/tools/workflows/credential-utils.d.ts +1 -1
- package/dist/tools/workflows/credential-utils.js +2 -2
- package/dist/tools/workflows/credential-utils.js.map +1 -1
- package/dist/tools/workflows/detect-unparseable-openai-schema.d.ts +3 -0
- package/dist/tools/workflows/detect-unparseable-openai-schema.js +85 -0
- package/dist/tools/workflows/detect-unparseable-openai-schema.js.map +1 -0
- package/dist/tools/workflows/generate-simulation-fixtures.service.d.ts +2 -1
- package/dist/tools/workflows/generate-simulation-fixtures.service.js +27 -5
- package/dist/tools/workflows/generate-simulation-fixtures.service.js.map +1 -1
- package/dist/tools/workflows/materialize-node-type.tool.js +4 -2
- package/dist/tools/workflows/materialize-node-type.tool.js.map +1 -1
- package/dist/tools/workflows/plan-verification-simulation.d.ts +5 -2
- package/dist/tools/workflows/plan-verification-simulation.js +117 -2
- package/dist/tools/workflows/plan-verification-simulation.js.map +1 -1
- package/dist/tools/workflows/reconcile-simulation-plan.js +48 -17
- package/dist/tools/workflows/reconcile-simulation-plan.js.map +1 -1
- package/dist/tools/workflows/resolve-credentials.js +35 -1
- package/dist/tools/workflows/resolve-credentials.js.map +1 -1
- package/dist/tools/workflows/setup-workflow.schema.d.ts +66 -66
- package/dist/tools/workflows/validate-workflow.service.js +4 -4
- package/dist/tools/workflows/workflow-build-routing.js +3 -3
- package/dist/tools/workflows/workflow-build-routing.js.map +1 -1
- package/dist/tools/workflows/workflow-file-bindings.d.ts +1 -1
- package/dist/tools/workflows/workflow-file-bindings.js +2 -1
- package/dist/tools/workflows/workflow-file-bindings.js.map +1 -1
- package/dist/tools/workflows/workflow-json-utils.js +11 -12
- package/dist/tools/workflows/workflow-json-utils.js.map +1 -1
- package/dist/tools/workflows/workflow-source-compiler.d.ts +1 -1
- package/dist/tools/workflows/workflow-source-compiler.js +11 -4
- package/dist/tools/workflows/workflow-source-compiler.js.map +1 -1
- package/dist/tools/workflows/write-sandbox-file.tool.js +4 -2
- package/dist/tools/workflows/write-sandbox-file.tool.js.map +1 -1
- package/dist/tracing/langsmith-tracing.d.ts +1 -0
- package/dist/tracing/langsmith-tracing.js +69 -9
- package/dist/tracing/langsmith-tracing.js.map +1 -1
- package/dist/tracing/trace-payloads.js +8 -0
- package/dist/tracing/trace-payloads.js.map +1 -1
- package/dist/types.d.ts +52 -5
- package/dist/types.js.map +1 -1
- package/dist/utils/stream-helpers.d.ts +1 -0
- package/dist/utils/stream-helpers.js +2 -1
- package/dist/utils/stream-helpers.js.map +1 -1
- package/dist/workflow-loop/workflow-loop-state.d.ts +13 -13
- package/dist/workflow-loop/workflow-loop-state.js +6 -1
- package/dist/workflow-loop/workflow-loop-state.js.map +1 -1
- package/dist/workspace/create-workspace.js +24 -1
- package/dist/workspace/create-workspace.js.map +1 -1
- package/dist/workspace/lazy-runtime-workspace.js +19 -19
- package/dist/workspace/lazy-runtime-workspace.js.map +1 -1
- package/dist/workspace/sandbox-fs.d.ts +16 -4
- package/dist/workspace/sandbox-fs.js +80 -25
- package/dist/workspace/sandbox-fs.js.map +1 -1
- package/dist/workspace/scoped-workspace.js +6 -6
- package/dist/workspace/scoped-workspace.js.map +1 -1
- package/dist/workspace/snapshot-manager.d.ts +1 -0
- package/dist/workspace/snapshot-manager.js +37 -5
- package/dist/workspace/snapshot-manager.js.map +1 -1
- package/dist/workspace/workspace-files.d.ts +4 -0
- package/dist/workspace/workspace-files.js +21 -7
- package/dist/workspace/workspace-files.js.map +1 -1
- package/knowledge-base/reference/workflow-builder-guardrails.md +3 -0
- package/package.json +13 -13
- package/skills/config-evals/SKILL.md +96 -0
- package/skills/config-evals/references/config-eval-playbook.md +109 -0
- package/skills/intent-recognition/SKILL.md +145 -34
- package/skills/workflow-builder/SKILL.md +25 -17
|
@@ -134,10 +134,16 @@ async function createInstanceAgent(options) {
|
|
|
134
134
|
if (options.memory) {
|
|
135
135
|
const mem = new agents_1.Memory().storage(options.memory);
|
|
136
136
|
if (memoryConfig.observationalMemory) {
|
|
137
|
-
const { observerThresholdTokens, reflectorThresholdTokens } = memoryConfig.observationalMemory;
|
|
137
|
+
const { observerThresholdTokens, reflectorThresholdTokens, onTaskUsage } = memoryConfig.observationalMemory;
|
|
138
138
|
mem.observationalMemory({
|
|
139
139
|
observerThresholdTokens,
|
|
140
140
|
reflectorThresholdTokens,
|
|
141
|
+
...(onTaskUsage
|
|
142
|
+
? {
|
|
143
|
+
observe: (0, agents_1.createObservationLogObserveFn)(modelId, { onUsage: onTaskUsage }),
|
|
144
|
+
reflect: (0, agents_1.createObservationLogReflectFn)(modelId, { onUsage: onTaskUsage }),
|
|
145
|
+
}
|
|
146
|
+
: {}),
|
|
141
147
|
});
|
|
142
148
|
}
|
|
143
149
|
agent.memory(mem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance-agent.js","sourceRoot":"","sources":["../../src/agent/instance-agent.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"instance-agent.js","sourceRoot":"","sources":["../../src/agent/instance-agent.ts"],"names":[],"mappings":";;;AAAA,wCAKqB;AAErB,iEAA4D;AAC5D,yEAIoC;AACpC,2DAAyE;AACzE,mDAAkD;AAClD,6DAA4D;AAC5D,oDAA+F;AAC/F,oCAAmG;AACnG,mGAAiG;AACjG,gDAA8F;AAC9F,oEAA0F;AAS1F,SAAS,kBAAkB,CAC1B,KAA6B,EAC7B,OAAO,GAAuC,EAAE;IAEhD,MAAM,SAAS,GAAG,IAAA,kCAAkB,GAAE,CAAC;IACvC,MAAM,aAAa,GAAG,IAAA,kCAAkB,GAAE,CAAC;IAE3C,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;QAClC,IACC,mCAAwB,CAAC,GAAG,CAAC,IAAI,CAAC;YAClC,CAAC,OAAO,CAAC,oBAAoB,IAAI,0CAA+B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAC1E,CAAC;YACF,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,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AE,OAAO,CAAC,MAAM;YACrB,CAAC,CAAC;gBACA,GAAG,CAAC,YAAY,CAAC,mBAAmB;oBACnC,CAAC,CAAC;wBACA,mBAAmB,EAAE;4BACpB,OAAO,EAAE,IAAI;4BACb,uBAAuB,EACtB,YAAY,CAAC,mBAAmB,CAAC,uBAAuB;4BACzD,wBAAwB,EACvB,YAAY,CAAC,mBAAmB,CAAC,wBAAwB;yBAC1D;qBACD;oBACF,CAAC,CAAC,EAAE,CAAC;aACN;YACF,CAAC,CAAC,SAAS;QACZ,iBAAiB,EAAE,kBAAkB;QACrC,eAAe,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,SAAS;QACtE,aAAa,EAAE,aAAa,EAAE,QAAQ;KACtC,CAAC,CACF,CAAC;IAEF,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -20,10 +20,10 @@ The user's current local date and time is: ${isoTime}${tzLabel}.
|
|
|
20
20
|
When you need to reference "now", use this date and time.`;
|
|
21
21
|
}
|
|
22
22
|
const INTENT_HINT = (0, agent_feature_enabled_1.isAgentFeatureEnabled)()
|
|
23
|
-
? '**Intent gate.** For any request to create a NEW automation, load `intent-recognition` FIRST — before `workflow-builder`, `planning`, or any `build-agent` call — and route on its outcome: workflow-anchored → the workflow path below; agent-anchored → the agent path below; needs-clarification → ask the missing anchor-deciding question; out-of-scope → answer directly. The gate applies whenever you commit to an automation design — including when the user asks you to lay out or walk through your approach before building; load the skill before presenting the proposed design, even for requests that look obvious. It does not apply to product or capability questions, or to operating on existing resources. The words "workflow", "agent", "assistant", or "bot" in the request are unreliable — classify the behavior, not the vocabulary, and remember an AI Agent node inside a workflow is not the same thing as an n8n Agent artifact. Mid-build increments stay on the current primitive without re-classifying. Also load it before answering classification-only or hypothetical questions about what kind of automation something is, even when the request supplies its own classification rubric.'
|
|
23
|
+
? '**Intent gate.** For any request to create a NEW automation, load `intent-recognition` FIRST — before `workflow-builder`, `planning`, or any `build-agent` call — and route on its outcome: workflow-anchored → the workflow path below; agent-anchored → the agent path below; needs-clarification → ask the missing anchor-deciding question; out-of-scope → answer directly. The gate applies whenever you commit to an automation design — including when the user asks you to lay out or walk through your approach before building; load the skill before presenting the proposed design, even for requests that look obvious. It also applies before offering the user options for how to satisfy a request you cannot answer directly (e.g. a question needing external systems you have no ad-hoc tools for): classify first — an agent with the right tools is often the missing option; never present only a workflow-or-DIY choice. It does not apply to product or capability questions, or to operating on existing resources. The words "workflow", "agent", "assistant", or "bot" in the request are unreliable — classify the behavior, not the vocabulary, and remember an AI Agent node inside a workflow is not the same thing as an n8n Agent artifact. Mid-build increments stay on the current primitive without re-classifying. Also load it before answering classification-only or hypothetical questions about what kind of automation something is, even when the request supplies its own classification rubric.'
|
|
24
24
|
: '';
|
|
25
25
|
const AGENT_BUILD_ROUTE = (0, agent_feature_enabled_1.isAgentFeatureEnabled)()
|
|
26
|
-
? '\n- **Agent build or edit** (agent-anchored per the intent gate: chat or session interaction, cross-session memory, proactive or long-running operation, learning from feedback) → call `build-agent` right away and let the builder gather requirements — do not run your own requirement-gathering round first. The builder cannot see this conversation: its only knowledge is what you pass in `message`, so include ALL requirements, constraints, and answers already gathered in the first `message` (plus `name` for a new agent or `agentId` for an existing one, and `workflowContext` for workflows built this session). While a build is in progress, forward each user follow-up to `build-agent` near-verbatim and relay its `builderReply` back.
|
|
26
|
+
? '\n- **Agent build or edit** (agent-anchored per the intent gate: chat or session interaction, cross-session memory, proactive or long-running operation, learning from feedback) → call `build-agent` right away and let the builder gather requirements — do not run your own requirement-gathering round first. The builder cannot see this conversation: its only knowledge is what you pass in `message`, so include ALL requirements, constraints, and answers already gathered in the first `message` (plus `name` for a new agent or `agentId` for an existing one, and `workflowContext` for workflows built this session). Each distinct agent the user asks for is its own build target — pass `name` or `agentId` again to create or switch agents (prefer the `agentId` returned by earlier build-agent results when switching back; a name used earlier in this conversation also switches back to that agent rather than duplicating it); calls without either continue the most recent target. When the user message includes an agent-preview reference / `<agent-preview-context>`, call `get-session` to read the transcript first. For review/analysis/assessment requests (e.g. "review the tone", "how did it do", "assess its behavior"), answer directly from the transcript — do NOT call `build-agent` or otherwise modify the agent. Only call `build-agent` when the user explicitly asks to update, improve, or fix the agent; then pass the given `agentId` and put the concrete behavioral findings (failures, bad tool use, wrong answers) into `message` — do not ask the user to re-describe what already appears in the transcript. While a build is in progress, forward each user follow-up to `build-agent` near-verbatim and relay its `builderReply` back. When the builder needs user input it asks directly through interactive cards in this chat — do not re-ask those questions yourself; the tool call resumes with the user’s answer and returns the builder’s reply. When the user asks to publish, unpublish, activate, or make an agent live/usable, forward that intent to `build-agent` (the builder calls `publish_agent` / `unpublish_agent`) — never tell the user to open the agent editor and click Publish. Pass requests to add tools or capabilities to an agent to `build-agent` near-verbatim so the delegated builder can choose MCP, node-backed, provider, or custom tools. Do not build a workflow merely because the capability is reusable by the agent: multiple independent tools do not become one workflow. Use `workflow-builder` before `build-agent` only when one agent tool call must execute an ordered multi-node procedure, or when the user explicitly asks for a workflow that is reusable or callable outside the agent; then attach it via `workflowContext`. For questions about existing agents ("what agents do I have?") call `agents(action="list")` directly — no intent gate; and to edit an agent NOT built in this conversation, find its id via `agents(action="list")` and pass it as `agentId`.'
|
|
27
27
|
: '';
|
|
28
28
|
const WORKFLOW_ROUTE_GATE_REF = (0, agent_feature_enabled_1.isAgentFeatureEnabled)()
|
|
29
29
|
? ' — for a NEW automation, pass the intent gate first —'
|
|
@@ -180,7 +180,7 @@ Don't fabricate provider setup mechanics (credential field names, secret values,
|
|
|
180
180
|
## Safety
|
|
181
181
|
|
|
182
182
|
- **Destructive operations** show a confirmation UI automatically — don't ask via text.
|
|
183
|
-
- **Credential setup** uses \`workflows(action="setup")\` when a workflowId is available — it opens the inline setup card in the AI Assistant panel and handles credentials, parameters, and triggers in one step. Use \`credentials(action="setup")\` only when the user explicitly asks to create a credential outside of any workflow context. Never call both tools for the same workflow. Never describe workflow setup as something the user starts from the canvas or editor.
|
|
183
|
+
- **Credential setup** uses \`workflows(action="setup")\` when a workflowId is available — it opens the inline setup card in the AI Assistant panel and handles credentials, parameters, and triggers in one step. Use \`credentials(action="setup")\` only when the user explicitly asks to create a credential outside of any workflow context. Never call both tools for the same workflow. Never describe workflow setup as something the user starts from the canvas or editor. Setup cards are only open while the setup call is pending — once it returns a result, the card is resolved: describe the outcome (e.g. credentials selected and ready), never that a card is open or that the user still needs to authorize.
|
|
184
184
|
- **Error workflows are per workflow** — n8n has no global/instance-wide error workflow setting. Assign a generated or selected Error Trigger workflow only through the target workflow's \`settings.errorWorkflow\`, and only after that referenced error workflow is published. Use this as implementation guidance; mention the missing global/instance-wide setting to the user only when they explicitly ask about, request, or reference global error workflow behavior.
|
|
185
185
|
- **Never expose credential secrets** — metadata only.
|
|
186
186
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":";;;;AAAA,iCAAiC;AAEjC,yEAAsE;AAEtE,+DAA6D;AAC7D,iFAAsE;AACtE,qDAI0B;AAmB1B,4BAAmC,QAAiB;IACnD,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,gBAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAQ,CAAC,GAAG,EAAE,CAAC;IACzE,MAAM,OAAO,GAAG,GAAG;SACjB,OAAO,CAAC,QAAQ,CAAC;SACjB,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,CAAC;IACpF,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D,OAAO;;;6CAGqC,OAAO,GAAG,OAAO;0DACJ,CAAC;AAC3D,CAAC;AAED,MAAM,WAAW,GAAG,IAAA,6CAAqB,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