@n8n/instance-ai 1.26.2 → 1.27.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.
Files changed (90) hide show
  1. package/dist/agent/communication-style.prompt.d.ts +2 -0
  2. package/dist/agent/communication-style.prompt.js +73 -0
  3. package/dist/agent/communication-style.prompt.js.map +1 -0
  4. package/dist/agent/instance-agent.js +1 -2
  5. package/dist/agent/instance-agent.js.map +1 -1
  6. package/dist/agent/shared-prompts.d.ts +1 -1
  7. package/dist/agent/shared-prompts.js +1 -1
  8. package/dist/agent/shared-prompts.js.map +1 -1
  9. package/dist/agent/sub-agent-debriefing.d.ts +10 -0
  10. package/dist/agent/sub-agent-factory.d.ts +1 -1
  11. package/dist/agent/sub-agent-factory.js +3 -0
  12. package/dist/agent/sub-agent-factory.js.map +1 -1
  13. package/dist/agent/system-prompt.d.ts +3 -3
  14. package/dist/agent/system-prompt.js +18 -27
  15. package/dist/agent/system-prompt.js.map +1 -1
  16. package/dist/build.tsbuildinfo +1 -1
  17. package/dist/debug/run-debug-buffer.js +38 -1
  18. package/dist/debug/run-debug-buffer.js.map +1 -1
  19. package/dist/debug/sanitize-debug-snapshot.js +10 -7
  20. package/dist/debug/sanitize-debug-snapshot.js.map +1 -1
  21. package/dist/errors/index.d.ts +4 -0
  22. package/dist/errors/index.js +12 -0
  23. package/dist/errors/index.js.map +1 -0
  24. package/dist/index.d.ts +14 -6
  25. package/dist/index.js +17 -10
  26. package/dist/index.js.map +1 -1
  27. package/dist/prompts/prompt-profiles.d.ts +1 -0
  28. package/dist/prompts/prompt-profiles.js +11 -1
  29. package/dist/prompts/prompt-profiles.js.map +1 -1
  30. package/dist/runtime/instance-context-state.d.ts +96 -0
  31. package/dist/runtime/instance-context-state.js +12 -0
  32. package/dist/runtime/instance-context-state.js.map +1 -0
  33. package/dist/runtime/run-state-registry.d.ts +5 -0
  34. package/dist/runtime/run-state-registry.js +12 -0
  35. package/dist/runtime/run-state-registry.js.map +1 -1
  36. package/dist/stream/instance-context-reach.d.ts +4 -0
  37. package/dist/stream/instance-context-reach.js +49 -0
  38. package/dist/stream/instance-context-reach.js.map +1 -0
  39. package/dist/stream/map-chunk.js +1 -8
  40. package/dist/stream/map-chunk.js.map +1 -1
  41. package/dist/stream/work-summary-accumulator.d.ts +20 -0
  42. package/dist/stream/work-summary-accumulator.js +20 -1
  43. package/dist/stream/work-summary-accumulator.js.map +1 -1
  44. package/dist/tools/agent-context.tool.d.ts +154 -0
  45. package/dist/tools/agent-context.tool.js +125 -0
  46. package/dist/tools/agent-context.tool.js.map +1 -0
  47. package/dist/tools/conversation-history.tool.js +3 -10
  48. package/dist/tools/conversation-history.tool.js.map +1 -1
  49. package/dist/tools/credentials.tool.js +19 -8
  50. package/dist/tools/credentials.tool.js.map +1 -1
  51. package/dist/tools/executions.tool.js +12 -1
  52. package/dist/tools/executions.tool.js.map +1 -1
  53. package/dist/tools/index.js +26 -7
  54. package/dist/tools/index.js.map +1 -1
  55. package/dist/tools/nodes.tool.js +11 -3
  56. package/dist/tools/nodes.tool.js.map +1 -1
  57. package/dist/tools/orchestration/build-agent.tool.js +33 -15
  58. package/dist/tools/orchestration/build-agent.tool.js.map +1 -1
  59. package/dist/tools/save-user-preference.tool.d.ts +3 -0
  60. package/dist/tools/save-user-preference.tool.js +87 -0
  61. package/dist/tools/save-user-preference.tool.js.map +1 -0
  62. package/dist/tools/shared/ask-user.tool.d.ts +10 -0
  63. package/dist/tools/shared/ask-user.tool.js +8 -0
  64. package/dist/tools/shared/ask-user.tool.js.map +1 -1
  65. package/dist/tools/shared/leave-onboarding.tool.d.ts +1 -0
  66. package/dist/tools/shared/leave-onboarding.tool.js +29 -0
  67. package/dist/tools/shared/leave-onboarding.tool.js.map +1 -0
  68. package/dist/tools/shared/safe-error-message.d.ts +3 -0
  69. package/dist/tools/shared/safe-error-message.js +11 -0
  70. package/dist/tools/shared/safe-error-message.js.map +1 -0
  71. package/dist/tools/tool-ids.d.ts +3 -2
  72. package/dist/tools/tool-ids.js +6 -4
  73. package/dist/tools/tool-ids.js.map +1 -1
  74. package/dist/tools/workflows/build-workflow.tool.js +13 -4
  75. package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
  76. package/dist/types.d.ts +64 -15
  77. package/dist/types.js +2 -1
  78. package/dist/types.js.map +1 -1
  79. package/package.json +18 -10
  80. package/skills/agent-builder/SKILL.md +32 -2
  81. package/skills/debugging-executions/SKILL.md +53 -0
  82. package/skills/intent-recognition/SKILL.md +3 -3
  83. package/skills/suggest-automations/SKILL.md +127 -0
  84. package/skills/workflow-builder/SKILL.md +1 -1
  85. package/dist/tools/agents.tool.d.ts +0 -2
  86. package/dist/tools/agents.tool.js +0 -40
  87. package/dist/tools/agents.tool.js.map +0 -1
  88. package/dist/tools/orchestration/list-agent-capabilities.tool.d.ts +0 -2
  89. package/dist/tools/orchestration/list-agent-capabilities.tool.js +0 -45
  90. package/dist/tools/orchestration/list-agent-capabilities.tool.js.map +0 -1
@@ -9,6 +9,7 @@ description: >-
9
9
  artifact is no longer clear.
10
10
  recommended_tools:
11
11
  - build-agent
12
+ - agent-context
12
13
  - build-workflow
13
14
  - data-tables
14
15
  ---
@@ -22,11 +23,17 @@ when the conversation already targets an Agent and the user is continuing that
22
23
  build. Do not rerun intent recognition for routine Agent edits or extensions.
23
24
  Use `build-agent` only for Agent artifacts.
24
25
 
26
+ For read-only research, use `agent-context` directly. This includes explaining
27
+ an Agent, comparing Agents, inspecting its config or resources, and diagnosing
28
+ sessions. Do not call `build-agent` for these requests. Call `build-agent` only
29
+ when the request creates, changes, tests, or publishes an Agent. Set its
30
+ `operation` to the matching activity for an existing Agent.
31
+
25
32
  For a new Agent request, make the first `build-agent` call with a faithful copy
26
33
  of the request as soon as any required orchestrator-owned prerequisites are
27
34
  ready. Before that call, use `ask-user` only to choose a supported channel or to
28
35
  define a workflow or data-table prerequisite that the orchestrator must create.
29
- Only ask about the channel after `list-agent-capabilities` shows that the
36
+ Only ask about the channel after `agent-context` with `type: "capabilities"` shows that the
30
37
  requested channel is unsupported. Do not collect model, service, tool, topic,
31
38
  schedule, credential, or other Agent implementation choices first. The embedded
32
39
  Agent Builder asks those questions through the `build-agent` call.
@@ -39,7 +46,7 @@ on the Agent.
39
46
 
40
47
  ## Supported channels & unsupported requests
41
48
 
42
- `list-agent-capabilities` returns every chat channel n8n Agents support, each
49
+ `agent-context` with `type: "capabilities"` returns every chat channel n8n Agents support, each
43
50
  with `capabilities`, `useIntegrationWhen`, and `useNodeToolWhen`. It is the
44
51
  authoritative source the orchestrator can read before building; a channel
45
52
  absent from its result is unsupported for agents.
@@ -85,6 +92,19 @@ into a request for a Slack node tool. Preserve unspecified and ambiguous
85
92
  implementation details so the builder can resolve them with its own guidance
86
93
  and interactive tools.
87
94
 
95
+ Apply the confirm-first handoff only to the first handoff of a template
96
+ kickoff. That kickoff is the opening message that starts the build after a
97
+ starter template is already written on the agent, before the user has
98
+ answered. Read that config. Forward the message as a request to confirm
99
+ those selections. Do not rewrite them into requirements the user stated.
100
+ Do not tell the builder to finish the build before the user answers.
101
+
102
+ Forward every other message as the user wrote it. This includes the user's
103
+ answer and a later request to change one field, on a template agent or on
104
+ an agent the user built without a template. Do not turn a change request
105
+ into another confirmation. Do not add tools, tasks, or instructions the
106
+ user did not ask for. A change to one field updates only that field.
107
+
88
108
  ## Prerequisites
89
109
 
90
110
  Before the first `build-agent` call, create prerequisites the builder cannot
@@ -163,3 +183,13 @@ those tools do not appear in your toolset.
163
183
  When the builder needs a user choice, credential, chat channel, or approval, it
164
184
  surfaces an interactive card in this chat. Do not relay the question yourself;
165
185
  the `build-agent` call resumes with the user's answer.
186
+
187
+ ## Agent UI labels
188
+
189
+ When you send the user to the agent editor, use the labels they see:
190
+
191
+ - Sessions tab: past agent conversations, tests, and activity. Each item is a session.
192
+ - Preview: the live test-chat dock, not the history list.
193
+ - Workflow execution history stays "Executions". Do not reuse that name for agents.
194
+
195
+ Never say Runs tab, Executions tab, Activity History, or Runs Activity History for an agent.
@@ -86,6 +86,10 @@ first move whenever the user is debugging a **read** node that already failed a
86
86
  real execution: the node ran for real once already, and a mock-only check is
87
87
  what sends the user back for a second session.
88
88
 
89
+ The action refuses a replay that would re-run a node above the target: an
90
+ unpinned one the execution never reached, one that failed there, or a loop
91
+ that did not finish. Pick another execution, or tell the user which node would run again.
92
+
89
93
  ### Decide whether the node is safe to run first
90
94
 
91
95
  A step run is a real run. The node uses the user's real credentials and reaches
@@ -142,6 +146,55 @@ Mocked input does **not** make a write node safe. The node still runs for real
142
146
  against the user's systems; only its input is invented, which makes the effect
143
147
  less predictable, not more.
144
148
 
149
+ ### Running a tool
150
+
151
+ A tool never runs on its own. n8n runs it through the node that owns it —
152
+ usually the Agent. A step run on a tool therefore behaves like a step run on
153
+ that Agent:
154
+
155
+ - `mockInput` feeds the **Agent's** input, not the tool's arguments.
156
+ - `reuseExecutionId` replays the nodes above the **Agent**.
157
+ - A chain run (neither option) runs every node above the Agent for real. Give
158
+ one of the two options when a node up there writes.
159
+ - `ranThroughNodeNames` lists **every** node that can run the tool, not the one
160
+ that ran it. A tool on several agents lists them all: the engine picks one,
161
+ and it does not report which. Do not name a single Agent to the user when
162
+ this field holds more than one.
163
+ - A tool on two Agents where one runs above the other is refused. Run the
164
+ upper Agent, then read the tool with `executions(action="get-node-output")`.
165
+
166
+ The tool's own arguments come from `toolArguments` — the values the agent would
167
+ normally decide:
168
+
169
+ ```
170
+ executions(action="run-step", workflowId, nodeName="Search Tickets Tool",
171
+ reuseExecutionId=<the failed execution>,
172
+ toolArguments={"query": "login fails", "status": "open"})
173
+ ```
174
+
175
+ The example targets a **read** tool on purpose. The write rule above holds here
176
+ too, and a tool hides the write behind a friendly name: a step run on a "Create
177
+ Ticket" tool creates the ticket again, and `toolArguments` does not change that.
178
+ Only run one when the user has accepted a second write.
179
+
180
+ Use the argument names from the node's `$fromAI` calls, which
181
+ `workflows(action="get-as-code")` shows. Pass a plain string instead for a tool
182
+ that takes one free-text input (Wikipedia, Code Tool, a vector store used as a
183
+ tool).
184
+
185
+ A tool that declares `$fromAI` arguments is refused without them: it would
186
+ otherwise fail for a reason that has nothing to do with the user's problem, and
187
+ you would report that as the defect. A node that holds several tools is refused
188
+ outright, because nothing here can name one of its tools the way the agent
189
+ does: the "MCP Client Tool" node, and every node the MCP registry added, whose
190
+ type is `@n8n/mcp-registry.<server slug>`. Run the Agent for those, and read
191
+ the node's output from that execution.
192
+
193
+ A sub-node that is not a tool — a model, memory, embeddings — cannot be run this
194
+ way at all. Run the Agent, and read the sub-node with
195
+ `executions(action="get-node-output")` on **that** execution: n8n records every
196
+ call a sub-node made while the Agent ran.
197
+
145
198
  ## Successful execution with wrong or empty value
146
199
 
147
200
  When `debug` doesn't apply because nothing errored, call
@@ -281,7 +281,7 @@ continuity for that primitive.
281
281
 
282
282
  **Unsupported capabilities**: when the user names a specific channel or
283
283
  capability for an agent (e.g. "WhatsApp", "Teams"), call
284
- `list-agent-capabilities` before classifying. If the named channel is
284
+ `agent-context` with `type: "capabilities"` before classifying. If the named channel is
285
285
  absent, it is unsupported for agents — do not classify the request as a
286
286
  workflow substitute, do not improvise workflow nodes to fake the channel,
287
287
  and do not claim it can be configured. Explain that it is unavailable for
@@ -396,7 +396,7 @@ valid, apply the growth tiebreaker instead of asking a theoretical preference.
396
396
  actions or whether an investigator must choose and adapt them.
397
397
  - "Build me an agent my team can @mention on WhatsApp to triage customer
398
398
  messages." -> **agent-anchored** (explicit agent artifact + chat
399
- interaction), but call `list-agent-capabilities` first: WhatsApp is absent,
399
+ interaction), but call `agent-context` with `type: "capabilities"` first: WhatsApp is absent,
400
400
  so do not build. Explain WhatsApp is unsupported for agents, offer the
401
401
  supported chat channels the tool returned, with their
402
402
  `capabilities`, and ask which to use — or whether the user wants a
@@ -438,7 +438,7 @@ valid, apply the growth tiebreaker instead of asking a theoretical preference.
438
438
  workflow-anchored pipeline. A Chat Trigger workflow is correct only when
439
439
  chat is merely the manual trigger for a fixed graph.
440
440
  - Never improvise a workflow substitute for an unsupported agent channel or
441
- capability. When the user names a channel not in `list-agent-capabilities`,
441
+ capability. When the user names a channel not returned by `agent-context`,
442
442
  explain the limitation and offer supported alternatives — do not add
443
443
  workflow nodes that fake the channel or silently translate the request
444
444
  into a workflow change.
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: suggest-automations
3
+ description: >-
4
+ Offer the three most common automations for a user as a single-choice card,
5
+ from your own knowledge of their team and their apps, then build the one
6
+ they choose or offer more. The system preloads it on onboarding threads,
7
+ where the opening card already asked the user about themselves.
8
+ Use it on other threads when the user asks what they could automate or
9
+ wants ideas for a first workflow.
10
+ recommended_tools:
11
+ - ask-user
12
+ - build-workflow
13
+ ---
14
+
15
+ # Suggest automations
16
+
17
+ ## Input
18
+
19
+ You need to know who the user is, at least their team and the apps they use.
20
+ The user knows little about n8n: no n8n vocabulary, and no questions about
21
+ tasks or pain points.
22
+
23
+ On an onboarding thread the conversation already holds an `<onboarding-answer>`
24
+ block with the user's team and apps, one line per question. Use every line of
25
+ the block. The answers are final: use them as they come and do not ask these
26
+ questions again. Two openings:
27
+
28
+ - The block is followed by your message "Got it. Finally, tell me a little
29
+ about how you use <their apps>." and the user's reply. The reply describes how they
30
+ work, names a task in their own words, or names none. Start at step 1.
31
+ - The block is the latest message and one answer is free text the user typed
32
+ into the card. Read that text first. A tool name is one of their apps: ask
33
+ "Got it. Finally, tell me a little about how you use <their apps>." and end
34
+ the turn. A task: start at step 1 with it. Anything else, for example a wish to
35
+ stop, a request about something else, a refusal or an insult: call
36
+ `leave-onboarding`, then write a one-sentence reply that invites the user to
37
+ explore the app and to come back with a task.
38
+
39
+ On any other thread, ask in ONE `ask-user` call: a `single` question "What
40
+ team are you on?" with the options Executive/Owner, Support, Product & Design,
41
+ Sales, IT, Engineering and Marketing, and a `multi` question "Which apps do you
42
+ use?" with the ten apps people use most at work, as product names such as
43
+ Slack or Google Sheets. Never run a command or read a file to find them.
44
+
45
+ ## Flow
46
+
47
+ 1. Pick three automations that each solve a different problem, ordered from
48
+ the most to the least relevant. Each one runs on the user's apps and is
49
+ realistic for n8n. When the user named a task, even a specific and
50
+ complete one, suggestion one is that task in their words and the other two
51
+ are what people on their team set up next to it. Otherwise pick the three
52
+ that people on the team most often set up with the user's apps. The card
53
+ always comes before a build: a specific task gets confirmed with one click,
54
+ never built unasked. Decide in one step: do not run a command, read a file
55
+ or write the reasoning out.
56
+ 2. Write short text and no list: the card carries the options. First
57
+ reflect what the user shared, in their words, with no assumptions added:
58
+ - A goal or a problem: "Thanks, that helps. You want to ..."
59
+ - A clear workflow: "Thanks, that helps. You use <app> and <app> to ..."
60
+ - A general situation or activities: "Thanks, that helps. Your work
61
+ involves ..."
62
+ Say "You want" only when the user named an outcome they want. Then the
63
+ social proof that matches:
64
+ - A goal or a problem: "I've looked at how other users have solved
65
+ similar problems."
66
+ - A clear workflow: "I've looked at how other users approach similar
67
+ workflows."
68
+ - A general situation: "I've looked at how other users make their work
69
+ easier."
70
+ Then, after a blank line, "Here are three ways n8n could help:". With
71
+ nothing to reflect, drop the first part and use the general social proof.
72
+ Then ONE `ask-user` call with `questions` only: a `single`
73
+ question "Which one feels most useful?", `required: true`, with
74
+ four options: the three suggestions, most relevant first, and last
75
+ `Show me other ideas`. `Show me other ideas` is an action that asks for
76
+ three more suggestions, not a catch-all: always keep it as the fourth
77
+ option. Leave `introMessage` out. Set `freeTextLabel` to `Share more
78
+ context`: the card shows it as its built-in free-text row with a pencil
79
+ icon. Never add "Something else", "Share more context" or "None of these"
80
+ as an option.
81
+
82
+ A suggestion is one option string of two lines: the title, a newline,
83
+ then the description. The card shows the second line under the first.
84
+ - Title: a short action phrase of at most 6 words that names the result,
85
+ not the setup, for example "Capture new leads" or "Speed up customer
86
+ follow-ups". Not a sentence, and no punctuation at the end.
87
+ - Description: one plain sentence of at most 18 words about what the user
88
+ gets. State no trigger, schedule, recipient or other process detail the
89
+ user did not give. No Markdown, no n8n node names.
90
+ - Apps: name only apps the user selected or named, at most two in one
91
+ suggestion, and only where the name makes the suggestion clearer. With
92
+ no app or one app from the user, describe the result without app names.
93
+ Example option: "Capture new leads\nMove new enquiries into your sales
94
+ process so nothing gets missed."
95
+ 3. Read the answer.
96
+ - A suggestion: its first line, the title, names the automation to build.
97
+ - `Show me other ideas`: repeat step 2 with three automations not shown in
98
+ this thread yet, after one sentence such as "Here are three more."
99
+ - Free text that describes a task: that is the user's request; build it.
100
+ - Free text that asks for a change, for example another app or a topic:
101
+ repeat step 2 with three automations that fit it.
102
+ - Free text that names no task and no change, for example "skip", "no" or
103
+ "later", or `answered: false`: do not build. On an onboarding thread call
104
+ `leave-onboarding`, then write a one-sentence reply, for example "No
105
+ problem. Explore the app and tell me when you want to automate something."
106
+ 4. Write exactly one line before the first tool call, `Building <title> now.`,
107
+ and no other text until the `build-workflow` result. Load `workflow-builder`
108
+ and build the automation with the user's apps the normal way, then follow
109
+ `postBuildFlow.instructions` from the result. Ask about an app only for a
110
+ step the user's list does not cover, one question per turn.
111
+
112
+ ## Rules
113
+
114
+ - One `ask-user` call per turn. Keep every message to four sentences or fewer.
115
+ - A build needs a picked suggestion or a task in the user's words. Never
116
+ start one after a skip, a dismissal, or free text that names nothing.
117
+ - No apps given: suggest what people on the team most often automate, and
118
+ name no app.
119
+ - Talk about the automation, never about the mechanics. Do not say
120
+ "validate", "workspace" or a file name in a message. Say what is being
121
+ built and what the user gets, for example "Building the reminder now."
122
+ - If the user wants to stop the onboarding or asks for something unrelated,
123
+ drop this flow. On an onboarding thread, whenever you stop asking the card
124
+ questions, call `leave-onboarding` first and then reply. A reply that skips
125
+ the questions without that call leaves the user stuck in the flow.
126
+ - Never ask for credentials, keys, or passwords in chat.
127
+ - Reply in the language the user writes in.
@@ -978,7 +978,7 @@ For AI Agent workflows:
978
978
 
979
979
  After building a workflow that uses a trigger with an HTTP endpoint, share the
980
980
  full production URL with the user. Use the Webhook base URL and Form base URL
981
- from Instance Info in the system prompt. Each trigger type has a distinct
981
+ from the `<instance-urls>` block in the user's turn. Each trigger type has a distinct
982
982
  pattern:
983
983
 
984
984
  - **Webhook Trigger**: `{webhookBaseUrl}/{path}` (where `{path}` is the node's
@@ -1,2 +0,0 @@
1
- import type { OrchestrationContext } from '../types';
2
- export declare function createAgentsTool(context: OrchestrationContext): import("@n8n/agents").BuiltTool;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAgentsTool = createAgentsTool;
4
- const agents_1 = require("@n8n/agents");
5
- const zod_1 = require("zod");
6
- const tool_ids_1 = require("./tool-ids");
7
- const agentsInputSchema = zod_1.z.object({
8
- action: zod_1.z
9
- .literal('list')
10
- .describe('List the n8n Agents in this project (id, name, published state, last update), most recently updated first.'),
11
- });
12
- const agentsOutputSchema = zod_1.z.object({
13
- count: zod_1.z.number(),
14
- agents: zod_1.z.array(zod_1.z.object({
15
- agentId: zod_1.z.string(),
16
- name: zod_1.z.string(),
17
- published: zod_1.z.boolean(),
18
- updatedAt: zod_1.z.string(),
19
- })),
20
- });
21
- function createAgentsTool(context) {
22
- return new agents_1.Tool(tool_ids_1.DOMAIN_TOOL_IDS.AGENTS)
23
- .description('List the n8n Agent artifacts in this project — id, name, published state, and last ' +
24
- 'update, most recently updated first. Use it to answer questions about existing ' +
25
- 'agents and to find the `agentId` to pass to `build-agent` when the user wants to ' +
26
- 'edit an agent that was not built in this conversation. Read-only; agents are ' +
27
- 'created and edited via `build-agent`.')
28
- .input(agentsInputSchema)
29
- .output(agentsOutputSchema)
30
- .handler(async () => {
31
- const delegate = context.domainContext?.builderDelegate;
32
- if (!delegate) {
33
- throw new Error('Agent listing is not available on this instance.');
34
- }
35
- const agents = await delegate.listAgents();
36
- return { count: agents.length, agents };
37
- })
38
- .build();
39
- }
40
- //# sourceMappingURL=agents.tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agents.tool.js","sourceRoot":"","sources":["../../src/tools/agents.tool.ts"],"names":[],"mappings":";;;AAMA,wCAAmC;AACnC,6BAAwB;AAGxB,yCAA6C;AAE7C,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,OAAC;SACP,OAAO,CAAC,MAAM,CAAC;SACf,QAAQ,CACR,4GAA4G,CAC5G;CACF,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,OAAC,CAAC,KAAK,CACd,OAAC,CAAC,MAAM,CAAC;QACR,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,SAAS,EAAE,OAAC,CAAC,OAAO,EAAE;QACtB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;KACrB,CAAC,CACF;CACD,CAAC,CAAC;AAEH,0BAAiC,OAA6B;IAC7D,OAAO,IAAI,aAAI,CAAC,0BAAe,CAAC,MAAM,CAAC;SACrC,WAAW,CACX,qFAAqF;QACpF,iFAAiF;QACjF,mFAAmF;QACnF,+EAA+E;QAC/E,uCAAuC,CACxC;SACA,KAAK,CAAC,iBAAiB,CAAC;SACxB,MAAM,CAAC,kBAAkB,CAAC;SAC1B,OAAO,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,EAAE,eAAe,CAAC;QACxD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACrE,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IACzC,CAAC,CAAC;SACD,KAAK,EAAE,CAAC;AACX,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { OrchestrationContext } from '../../types';
2
- export declare function createListAgentCapabilitiesTool(context: OrchestrationContext): import("@n8n/agents").BuiltTool;
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createListAgentCapabilitiesTool = createListAgentCapabilitiesTool;
4
- const agents_1 = require("@n8n/agents");
5
- const zod_1 = require("zod");
6
- const tool_ids_1 = require("../tool-ids");
7
- const chatIntegrationDescriptorSchema = zod_1.z.object({
8
- type: zod_1.z.string(),
9
- label: zod_1.z.string(),
10
- icon: zod_1.z.string(),
11
- credentialTypes: zod_1.z.array(zod_1.z.string()),
12
- capabilities: zod_1.z.array(zod_1.z.string()).optional(),
13
- useIntegrationWhen: zod_1.z.array(zod_1.z.string()).optional(),
14
- useNodeToolWhen: zod_1.z.array(zod_1.z.string()).optional(),
15
- });
16
- const listAgentCapabilitiesOutputSchema = zod_1.z.object({
17
- channels: zod_1.z.array(chatIntegrationDescriptorSchema),
18
- agentCapabilities: zod_1.z.array(zod_1.z.string()),
19
- limitations: zod_1.z.array(zod_1.z.string()),
20
- });
21
- function createListAgentCapabilitiesTool(context) {
22
- return new agents_1.Tool(tool_ids_1.ORCHESTRATION_TOOL_IDS.LIST_AGENT_CAPABILITIES)
23
- .description('List what n8n Agents can do and the chat-channel integrations they support. ' +
24
- "Returns each supported channel's `type`, `label`, supported credential types, " +
25
- 'and builder guidance (`capabilities`, `useIntegrationWhen`, `useNodeToolWhen`), ' +
26
- 'plus `agentCapabilities` (what an agent can do beyond chat) and `limitations` ' +
27
- '(agent-level constraints to respect when planning a build). ' +
28
- 'Call this before building or modifying an agent whenever the user names a ' +
29
- 'specific channel or capability (e.g. WhatsApp, Teams): if the named channel ' +
30
- 'is absent from `channels`, it is unsupported for agents — explain the ' +
31
- 'limitation and offer the listed alternatives instead of improvising a ' +
32
- 'workflow substitute or claiming it is configured. Read-only; channels and ' +
33
- 'capabilities are configured via `build-agent`.')
34
- .input(zod_1.z.object({}))
35
- .output(listAgentCapabilitiesOutputSchema)
36
- .handler(async () => {
37
- const delegate = context.domainContext?.builderDelegate;
38
- if (!delegate) {
39
- throw new Error('Agent capabilities are not available on this instance.');
40
- }
41
- return await delegate.listAgentCapabilities();
42
- })
43
- .build();
44
- }
45
- //# sourceMappingURL=list-agent-capabilities.tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-agent-capabilities.tool.js","sourceRoot":"","sources":["../../../src/tools/orchestration/list-agent-capabilities.tool.ts"],"names":[],"mappings":";;;AAWA,wCAAmC;AACnC,6BAAwB;AAGxB,0CAAqD;AAErD,MAAM,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,eAAe,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IACpC,YAAY,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,kBAAkB,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAClD,eAAe,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC;AAEH,MAAM,iCAAiC,GAAG,OAAC,CAAC,MAAM,CAAC;IAElD,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,+BAA+B,CAAC;IAElD,iBAAiB,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IAEtC,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;CAChC,CAAC,CAAC;AAEH,yCAAgD,OAA6B;IAC5E,OAAO,IAAI,aAAI,CAAC,iCAAsB,CAAC,uBAAuB,CAAC;SAC7D,WAAW,CACX,8EAA8E;QAC7E,gFAAgF;QAChF,kFAAkF;QAClF,gFAAgF;QAChF,8DAA8D;QAC9D,4EAA4E;QAC5E,8EAA8E;QAC9E,wEAAwE;QACxE,wEAAwE;QACxE,4EAA4E;QAC5E,gDAAgD,CACjD;SACA,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SACnB,MAAM,CAAC,iCAAiC,CAAC;SACzC,OAAO,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,EAAE,eAAe,CAAC;QACxD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAC3E,CAAC;QAID,OAAO,MAAM,QAAQ,CAAC,qBAAqB,EAAE,CAAC;IAC/C,CAAC,CAAC;SACD,KAAK,EAAE,CAAC;AACX,CAAC"}