@n8n/ai-workflow-builder 1.9.0 → 1.10.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/agents/supervisor.agent.d.ts +8 -5
- package/dist/agents/supervisor.agent.js +31 -21
- package/dist/agents/supervisor.agent.js.map +1 -1
- package/dist/ai-workflow-builder-agent.service.d.ts +6 -2
- package/dist/ai-workflow-builder-agent.service.js +30 -7
- package/dist/ai-workflow-builder-agent.service.js.map +1 -1
- package/dist/assistant/assistant-handler.js +31 -15
- package/dist/assistant/assistant-handler.js.map +1 -1
- package/dist/assistant/types.d.ts +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/code-builder/tools/ask-assistant.tool.js +5 -1
- package/dist/code-builder/tools/ask-assistant.tool.js.map +1 -1
- package/dist/code-builder/tools/build-workflow.tool.js +5 -1
- package/dist/code-builder/tools/build-workflow.tool.js.map +1 -1
- package/dist/code-builder/triage.agent.js +51 -21
- package/dist/code-builder/triage.agent.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/multi-agent-workflow-subgraphs.d.ts +66 -12
- package/dist/multi-agent-workflow-subgraphs.js +145 -45
- package/dist/multi-agent-workflow-subgraphs.js.map +1 -1
- package/dist/parent-graph-state.d.ts +1 -0
- package/dist/parent-graph-state.js +4 -0
- package/dist/parent-graph-state.js.map +1 -1
- package/dist/prompts/agents/supervisor.prompt.d.ts +3 -1
- package/dist/prompts/agents/supervisor.prompt.js +85 -13
- package/dist/prompts/agents/supervisor.prompt.js.map +1 -1
- package/dist/session-manager.service.d.ts +11 -2
- package/dist/session-manager.service.js +212 -69
- package/dist/session-manager.service.js.map +1 -1
- package/dist/subgraphs/builder.subgraph.d.ts +1 -0
- package/dist/subgraphs/builder.subgraph.js +2 -0
- package/dist/subgraphs/builder.subgraph.js.map +1 -1
- package/dist/subgraphs/discovery.subgraph.d.ts +1 -0
- package/dist/subgraphs/discovery.subgraph.js +2 -0
- package/dist/subgraphs/discovery.subgraph.js.map +1 -1
- package/dist/types/coordination.d.ts +8 -2
- package/dist/types/coordination.js +5 -0
- package/dist/types/coordination.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/session-storage.d.ts +11 -0
- package/dist/types/session-storage.js +3 -0
- package/dist/types/session-storage.js.map +1 -0
- package/dist/types/streaming.d.ts +14 -1
- package/dist/utils/cache-control/helpers.d.ts +6 -0
- package/dist/utils/cache-control/helpers.js +13 -0
- package/dist/utils/cache-control/helpers.js.map +1 -1
- package/dist/utils/cache-control/index.d.ts +1 -1
- package/dist/utils/cache-control/index.js +3 -1
- package/dist/utils/cache-control/index.js.map +1 -1
- package/dist/utils/coordination-log.d.ts +5 -2
- package/dist/utils/coordination-log.js +14 -0
- package/dist/utils/coordination-log.js.map +1 -1
- package/dist/utils/state-modifier.d.ts +1 -1
- package/dist/utils/state-modifier.js +15 -19
- package/dist/utils/state-modifier.js.map +1 -1
- package/dist/utils/stream-processor.js +20 -7
- package/dist/utils/stream-processor.js.map +1 -1
- package/dist/utils/subgraph-helpers.d.ts +2 -0
- package/dist/utils/subgraph-helpers.js +34 -1
- package/dist/utils/subgraph-helpers.js.map +1 -1
- package/dist/workflow-builder-agent.d.ts +3 -1
- package/dist/workflow-builder-agent.js +13 -9
- package/dist/workflow-builder-agent.js.map +1 -1
- package/package.json +7 -7
|
@@ -4,7 +4,11 @@ exports.ASK_ASSISTANT_TOOL = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.ASK_ASSISTANT_TOOL = {
|
|
6
6
|
name: 'ask_assistant',
|
|
7
|
-
description: 'Ask the n8n assistant a question. Use this when the user needs help
|
|
7
|
+
description: 'Ask the n8n assistant a pure knowledge question. Use this ONLY when the user needs help ' +
|
|
8
|
+
'understanding n8n concepts, learning how something works, or diagnosing workflow errors. ' +
|
|
9
|
+
'Do NOT use this when the user wants you to take action on their workflow — use build_workflow instead. ' +
|
|
10
|
+
'NOT ask_assistant: "help me set up X", "can you fix this?", "configure the node" — these are action requests. ' +
|
|
11
|
+
'After diagnosis, use build_workflow to apply any needed fix.',
|
|
8
12
|
schema: zod_1.z.object({
|
|
9
13
|
query: zod_1.z.string().describe('The user question to send to the assistant'),
|
|
10
14
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-assistant.tool.js","sourceRoot":"","sources":["../../../src/code-builder/tools/ask-assistant.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAOX,QAAA,kBAAkB,GAAG;IACjC,IAAI,EAAE,eAAe;IACrB,WAAW,EACV,
|
|
1
|
+
{"version":3,"file":"ask-assistant.tool.js","sourceRoot":"","sources":["../../../src/code-builder/tools/ask-assistant.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAOX,QAAA,kBAAkB,GAAG;IACjC,IAAI,EAAE,eAAe;IACrB,WAAW,EACV,0FAA0F;QAC1F,2FAA2F;QAC3F,yGAAyG;QACzG,gHAAgH;QAChH,8DAA8D;IAC/D,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;QAChB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;KACxE,CAAC;CACF,CAAC"}
|
|
@@ -4,7 +4,11 @@ exports.BUILD_WORKFLOW_TOOL = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.BUILD_WORKFLOW_TOOL = {
|
|
6
6
|
name: 'build_workflow',
|
|
7
|
-
description: 'Build or modify an n8n workflow. Use this when the user wants to create
|
|
7
|
+
description: 'Build or modify an n8n workflow. Use this when the user wants to create, modify, configure, ' +
|
|
8
|
+
'fix, or set up a workflow. This includes adding/removing nodes, changing connections, ' +
|
|
9
|
+
'configuring node parameters, setting up credentials on nodes, fixing workflow issues, ' +
|
|
10
|
+
'or any action request on the workflow. ' +
|
|
11
|
+
'IMPORTANT: "fix this", "make it work", "set up X", "help me configure" are all action requests — use this tool.',
|
|
8
12
|
schema: zod_1.z.object({
|
|
9
13
|
instructions: zod_1.z.string().describe('Clear instructions for what to build or modify'),
|
|
10
14
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-workflow.tool.js","sourceRoot":"","sources":["../../../src/code-builder/tools/build-workflow.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAOX,QAAA,mBAAmB,GAAG;IAClC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACV,
|
|
1
|
+
{"version":3,"file":"build-workflow.tool.js","sourceRoot":"","sources":["../../../src/code-builder/tools/build-workflow.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAOX,QAAA,mBAAmB,GAAG;IAClC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACV,8FAA8F;QAC9F,wFAAwF;QACxF,wFAAwF;QACxF,yCAAyC;QACzC,iHAAiH;IAClH,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;QAChB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;KACnF,CAAC;CACF,CAAC"}
|
|
@@ -5,6 +5,7 @@ const messages_1 = require("@langchain/core/messages");
|
|
|
5
5
|
const content_extractors_1 = require("../code-builder/utils/content-extractors");
|
|
6
6
|
const constants_1 = require("../constants");
|
|
7
7
|
const builder_1 = require("../prompts/builder");
|
|
8
|
+
const context_builders_1 = require("../utils/context-builders");
|
|
8
9
|
const ask_assistant_tool_1 = require("./tools/ask-assistant.tool");
|
|
9
10
|
const build_workflow_tool_1 = require("./tools/build-workflow.tool");
|
|
10
11
|
function conversationEntryToString(entry) {
|
|
@@ -17,24 +18,54 @@ function conversationEntryToString(entry) {
|
|
|
17
18
|
return `[Plan] Q: ${entry.userQuery} → ${entry.plan}`;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
function buildTriagePrompt(conversationHistory) {
|
|
21
|
+
function buildTriagePrompt(conversationHistory, workflowContext) {
|
|
22
|
+
const selectedNodesSummary = (0, context_builders_1.buildSelectedNodesSummary)(workflowContext);
|
|
23
|
+
const currentWorkflow = workflowContext?.currentWorkflow;
|
|
24
|
+
const workflowNodes = currentWorkflow?.nodes ?? [];
|
|
25
|
+
const hasWorkflow = workflowNodes.length > 0;
|
|
26
|
+
const workflowSummary = hasWorkflow
|
|
27
|
+
? (0, context_builders_1.buildWorkflowSummary)({
|
|
28
|
+
name: currentWorkflow?.name ?? '',
|
|
29
|
+
nodes: workflowNodes,
|
|
30
|
+
connections: currentWorkflow?.connections ?? {},
|
|
31
|
+
})
|
|
32
|
+
: '';
|
|
21
33
|
return (0, builder_1.prompt)()
|
|
22
34
|
.section('role', 'You are a triage agent for the n8n workflow builder. ' +
|
|
23
35
|
'Your job is to classify each user message and route it to the right handler.')
|
|
36
|
+
.sectionIf(!!selectedNodesSummary, 'selected_nodes', () => selectedNodesSummary)
|
|
37
|
+
.sectionIf(hasWorkflow, 'workflow_summary', () => workflowSummary)
|
|
24
38
|
.section('routing', `Route each message using one or more of these:
|
|
25
39
|
|
|
26
|
-
1. **build_workflow** — The user wants to create, modify, or change a workflow.
|
|
27
|
-
|
|
40
|
+
1. **build_workflow** — The user wants to create, modify, configure, or change a workflow.
|
|
41
|
+
This includes any action request: adding nodes, setting up nodes, configuring parameters,
|
|
42
|
+
connecting nodes, or any instruction that implies "do this to my workflow."
|
|
43
|
+
You may include a brief transition before calling (e.g., "Let me build that for you.").
|
|
28
44
|
|
|
29
|
-
2. **ask_assistant** — The user has a
|
|
30
|
-
|
|
45
|
+
2. **ask_assistant** — The user has a pure knowledge question about n8n concepts, needs help
|
|
46
|
+
understanding how something works, or needs to diagnose a workflow error.
|
|
47
|
+
Only use this when the user is asking for information, NOT when they want you to take action.
|
|
48
|
+
You may include a brief transition before calling (e.g., "Let me look into that.").
|
|
31
49
|
|
|
32
50
|
3. **Direct reply** — Simple conversational messages that don't need either tool.
|
|
33
51
|
Respond with helpful text directly.`)
|
|
34
|
-
.section('rules',
|
|
35
|
-
-
|
|
52
|
+
.section('rules', `Error handling:
|
|
53
|
+
- User reports error AND asks for a fix ("fix this error", "it's broken, fix it") → ask_assistant to diagnose, then build_workflow to apply the fix
|
|
54
|
+
- User asks WHY something failed (no fix request) → ask_assistant only
|
|
55
|
+
- User tells you exactly what to change ("increase timeout to 30s") → build_workflow directly, skip diagnosis
|
|
56
|
+
- User describes a vague symptom without requesting a fix ("something's wrong") → ask_assistant only, let user decide next step
|
|
57
|
+
|
|
58
|
+
General rules:
|
|
59
|
+
- For pure questions (no fix needed): call ask_assistant — its response will be shown directly to the user
|
|
36
60
|
- When in doubt between ask_assistant and build_workflow, prefer build_workflow for any message that implies changing the workflow
|
|
37
|
-
-
|
|
61
|
+
- Action-oriented language ("set it up", "configure this", "do it", "add that", "connect them", "now set them up") ALWAYS means build_workflow, even if "set up" could sound like a question. If the user is telling you to DO something, use build_workflow.
|
|
62
|
+
- Polite wrappers like "help me", "can you", "could you" followed by an action verb are action requests → build_workflow.
|
|
63
|
+
- When <selected_nodes> is present, resolve "this", "it", "that" to the selected node(s). With action verbs ("fix this", "change it") → build_workflow. With question words ("what is this?", "why is this failing?") → ask_assistant.
|
|
64
|
+
- When no nodes are selected, resolve references using conversation history and <workflow_summary>.
|
|
65
|
+
- Tool responses are shown directly to the user. After a tool completes, either call another tool or respond with an empty message. Never repeat, summarize, or rephrase tool output.
|
|
66
|
+
- Keep transition text before tool calls to one sentence maximum.`)
|
|
67
|
+
.section('examples', `build_workflow: "Add a Slack node", "Configure the email settings", "Help me set up Gmail", "Can you fix the error?", "Fix the broken connection", "Set the timeout to 30 seconds", "Make it send to a different channel", "The timeout should be higher"
|
|
68
|
+
ask_assistant: "Why did my workflow fail?", "How do webhooks work?", "What's the difference between Set and Code?", "Explain this error", "How do I use expressions?", "This doesn't work" (diagnosis needed), "Something went wrong"`)
|
|
38
69
|
.sectionIf(conversationHistory && conversationHistory.length > 0, 'conversation history', () => conversationHistory
|
|
39
70
|
.map((entry, i) => `${i + 1}. ${conversationEntryToString(entry)}`)
|
|
40
71
|
.join('\n'))
|
|
@@ -57,7 +88,7 @@ class TriageAgent {
|
|
|
57
88
|
throw new Error('LLM does not support bindTools');
|
|
58
89
|
}
|
|
59
90
|
const llmWithTools = this.llm.bindTools([ask_assistant_tool_1.ASK_ASSISTANT_TOOL, build_workflow_tool_1.BUILD_WORKFLOW_TOOL]);
|
|
60
|
-
const systemContent = buildTriagePrompt(conversationHistory);
|
|
91
|
+
const systemContent = buildTriagePrompt(conversationHistory, payload.workflowContext);
|
|
61
92
|
const messages = [
|
|
62
93
|
new messages_1.SystemMessage(systemContent),
|
|
63
94
|
new messages_1.HumanMessage(payload.message),
|
|
@@ -65,24 +96,21 @@ class TriageAgent {
|
|
|
65
96
|
const ctx = { userId, payload, abortSignal };
|
|
66
97
|
const state = { sdkSessionId };
|
|
67
98
|
let reachedMaxIterations = true;
|
|
99
|
+
let responseHandled = false;
|
|
68
100
|
for (let iteration = 0; iteration < constants_1.MAX_TRIAGE_ITERATIONS; iteration++) {
|
|
69
101
|
const response = await llmWithTools.invoke(messages, {
|
|
70
102
|
signal: abortSignal,
|
|
71
103
|
});
|
|
72
104
|
messages.push(response);
|
|
73
105
|
const toolCalls = response.tool_calls ?? [];
|
|
106
|
+
const text = (0, content_extractors_1.extractTextContent)(new messages_1.AIMessage({ content: response.content })) ?? '';
|
|
107
|
+
if (text && (toolCalls.length > 0 || !responseHandled)) {
|
|
108
|
+
yield this.wrapChunk({ role: 'assistant', type: 'message', text });
|
|
109
|
+
}
|
|
74
110
|
if (toolCalls.length === 0) {
|
|
75
|
-
this.logger?.debug('[TriageAgent] No tool call,
|
|
111
|
+
this.logger?.debug('[TriageAgent] No tool call, exiting loop', {
|
|
76
112
|
iteration: iteration + 1,
|
|
77
113
|
});
|
|
78
|
-
const text = (0, content_extractors_1.extractTextContent)(new messages_1.AIMessage({ content: response.content })) ?? '';
|
|
79
|
-
if (text) {
|
|
80
|
-
yield this.wrapChunk({
|
|
81
|
-
role: 'assistant',
|
|
82
|
-
type: 'message',
|
|
83
|
-
text,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
114
|
reachedMaxIterations = false;
|
|
87
115
|
break;
|
|
88
116
|
}
|
|
@@ -93,6 +121,8 @@ class TriageAgent {
|
|
|
93
121
|
});
|
|
94
122
|
const toolCallId = toolCall.id ?? `tc-${iteration}`;
|
|
95
123
|
const result = yield* this.executeToolWithStreaming(toolCall, ctx, state);
|
|
124
|
+
if (result.handledResponse)
|
|
125
|
+
responseHandled = true;
|
|
96
126
|
this.logger?.debug('[TriageAgent] Tool completed', {
|
|
97
127
|
toolName: toolCall.name,
|
|
98
128
|
iteration: iteration + 1,
|
|
@@ -147,7 +177,7 @@ class TriageAgent {
|
|
|
147
177
|
type: 'tool',
|
|
148
178
|
toolName: 'assistant',
|
|
149
179
|
toolCallId: assistantToolCallId,
|
|
150
|
-
|
|
180
|
+
displayTitle: 'Asking assistant',
|
|
151
181
|
status: 'running',
|
|
152
182
|
}));
|
|
153
183
|
const progressWriter = (chunk) => {
|
|
@@ -186,7 +216,7 @@ class TriageAgent {
|
|
|
186
216
|
enqueue({ messages: chunks });
|
|
187
217
|
state.sdkSessionId = result.sdkSessionId;
|
|
188
218
|
state.assistantSummary = result.summary;
|
|
189
|
-
return { content: result.summary };
|
|
219
|
+
return { content: result.summary, handledResponse: true };
|
|
190
220
|
}
|
|
191
221
|
case 'build_workflow': {
|
|
192
222
|
const enrichedPayload = state.assistantSummary
|
|
@@ -199,7 +229,7 @@ class TriageAgent {
|
|
|
199
229
|
enqueue(chunk);
|
|
200
230
|
}
|
|
201
231
|
state.buildExecuted = true;
|
|
202
|
-
return { content: 'Workflow built.', endLoop: true };
|
|
232
|
+
return { content: 'Workflow built.', endLoop: true, handledResponse: true };
|
|
203
233
|
}
|
|
204
234
|
default:
|
|
205
235
|
this.logger?.warn('[TriageAgent] Unknown tool call', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triage.agent.js","sourceRoot":"","sources":["../../src/code-builder/triage.agent.ts"],"names":[],"mappings":";;;AAEA,uDAA+F;AAK/F,gFAA6E;AAC7E,2CAAoD;AACpD,+CAA2C;
|
|
1
|
+
{"version":3,"file":"triage.agent.js","sourceRoot":"","sources":["../../src/code-builder/triage.agent.ts"],"names":[],"mappings":";;;AAEA,uDAA+F;AAK/F,gFAA6E;AAC7E,2CAAoD;AACpD,+CAA2C;AAE3C,+DAA2F;AAG3F,mEAAgE;AAChE,qEAAkE;AAsDlE,SAAS,yBAAyB,CAAC,KAA8B;IAChE,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,eAAe;YACnB,OAAO,KAAK,CAAC,OAAO,CAAC;QACtB,KAAK,oBAAoB;YACxB,OAAO,aAAa,KAAK,CAAC,SAAS,SAAS,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACtE,KAAK,MAAM;YACV,OAAO,aAAa,KAAK,CAAC,SAAS,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;IACxD,CAAC;AACF,CAAC;AAED,SAAS,iBAAiB,CACzB,mBAA+C,EAC/C,eAAgD;IAEhD,MAAM,oBAAoB,GAAG,IAAA,4CAAyB,EAAC,eAAe,CAAC,CAAC;IACxE,MAAM,eAAe,GAAG,eAAe,EAAE,eAAe,CAAC;IACzD,MAAM,aAAa,GAAG,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC;IACnD,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,MAAM,eAAe,GAAG,WAAW;QAClC,CAAC,CAAC,IAAA,uCAAoB,EAAC;YACrB,IAAI,EAAE,eAAe,EAAE,IAAI,IAAI,EAAE;YACjC,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,eAAe,EAAE,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IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,iCAAiC,EAAE;oBACpD,QAAQ,EAAE,QAAQ,CAAC,IAAI;iBACvB,CAAC,CAAC;gBACH,OAAO,EAAE,OAAO,EAAE,iBAAiB,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACvD,CAAC;IACF,CAAC;IAKO,UAAU,CAAC,KAAuB;QACzC,OAAO;YACN,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;YACxC,aAAa,EAAE,KAAK,CAAC,aAAa;SAClC,CAAC;IACH,CAAC;IAEO,SAAS,CAAC,KAAkB;QACnC,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IAC9B,CAAC;CACD;AAjRD,kCAiRC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -14,3 +14,4 @@ export declare const MAX_DISCOVERY_ITERATIONS = 50;
|
|
|
14
14
|
export declare const MAX_TRIAGE_ITERATIONS = 10;
|
|
15
15
|
export declare const MAX_MULTI_AGENT_STREAM_ITERATIONS: number;
|
|
16
16
|
export declare const STREAM_SEPARATOR = "\u29C9\u21CB\u21CB\u27BD\u2311\u29C9\u00A7\u00A7\n";
|
|
17
|
+
export declare const ASSISTANT_SDK_TIMEOUT_MS: number;
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.STREAM_SEPARATOR = exports.MAX_MULTI_AGENT_STREAM_ITERATIONS = exports.MAX_TRIAGE_ITERATIONS = exports.MAX_DISCOVERY_ITERATIONS = exports.MAX_BUILDER_ITERATIONS = exports.MAX_AI_RESPONSE_CHARS = exports.MAX_EXECUTION_DATA_CHARS = exports.MAX_NODE_EXAMPLE_CHARS = exports.AVG_CHARS_PER_TOKEN_ANTHROPIC = exports.MAX_WORKFLOW_LENGTH_TOKENS = exports.DEFAULT_AUTO_COMPACT_THRESHOLD_TOKENS = exports.MAX_PARAMETER_VALUE_LENGTH = exports.MAX_INPUT_TOKENS = exports.MAX_OUTPUT_TOKENS = exports.MAX_TOTAL_TOKENS = exports.MAX_AI_BUILDER_PROMPT_LENGTH = void 0;
|
|
3
|
+
exports.ASSISTANT_SDK_TIMEOUT_MS = exports.STREAM_SEPARATOR = exports.MAX_MULTI_AGENT_STREAM_ITERATIONS = exports.MAX_TRIAGE_ITERATIONS = exports.MAX_DISCOVERY_ITERATIONS = exports.MAX_BUILDER_ITERATIONS = exports.MAX_AI_RESPONSE_CHARS = exports.MAX_EXECUTION_DATA_CHARS = exports.MAX_NODE_EXAMPLE_CHARS = exports.AVG_CHARS_PER_TOKEN_ANTHROPIC = exports.MAX_WORKFLOW_LENGTH_TOKENS = exports.DEFAULT_AUTO_COMPACT_THRESHOLD_TOKENS = exports.MAX_PARAMETER_VALUE_LENGTH = exports.MAX_INPUT_TOKENS = exports.MAX_OUTPUT_TOKENS = exports.MAX_TOTAL_TOKENS = exports.MAX_AI_BUILDER_PROMPT_LENGTH = void 0;
|
|
4
4
|
exports.MAX_AI_BUILDER_PROMPT_LENGTH = 5000;
|
|
5
5
|
exports.MAX_TOTAL_TOKENS = 200_000;
|
|
6
6
|
exports.MAX_OUTPUT_TOKENS = 16_000;
|
|
@@ -17,4 +17,5 @@ exports.MAX_DISCOVERY_ITERATIONS = 50;
|
|
|
17
17
|
exports.MAX_TRIAGE_ITERATIONS = 10;
|
|
18
18
|
exports.MAX_MULTI_AGENT_STREAM_ITERATIONS = exports.MAX_BUILDER_ITERATIONS + exports.MAX_DISCOVERY_ITERATIONS;
|
|
19
19
|
exports.STREAM_SEPARATOR = '⧉⇋⇋➽⌑⧉§§\n';
|
|
20
|
+
exports.ASSISTANT_SDK_TIMEOUT_MS = 3 * 60 * 1000;
|
|
20
21
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAIa,QAAA,4BAA4B,GAAG,IAAI,CAAC;AAKpC,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAC3B,QAAA,iBAAiB,GAAG,MAAM,CAAC;AAC3B,QAAA,gBAAgB,GAAG,wBAAgB,GAAG,yBAAiB,GAAG,KAAK,CAAC;AAMhE,QAAA,0BAA0B,GAAG,MAAM,CAAC;AAQpC,QAAA,qCAAqC,GAAG,wBAAgB,GAAG,MAAM,CAAC;AAMlE,QAAA,0BAA0B,GAAG,MAAM,CAAC;AAMpC,QAAA,6BAA6B,GAAG,GAAG,CAAC;AAOpC,QAAA,sBAAsB,GAAG,IAAI,GAAG,qCAA6B,CAAC;AAM9D,QAAA,wBAAwB,GAAG,KAAK,CAAC;AAMjC,QAAA,qBAAqB,GAAG,GAAG,CAAC;AAM5B,QAAA,sBAAsB,GAAG,GAAG,CAAC;AAC7B,QAAA,wBAAwB,GAAG,EAAE,CAAC;AAC9B,QAAA,qBAAqB,GAAG,EAAE,CAAC;AAC3B,QAAA,iCAAiC,GAAG,8BAAsB,GAAG,gCAAwB,CAAC;AAMtF,QAAA,gBAAgB,GAAG,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAIa,QAAA,4BAA4B,GAAG,IAAI,CAAC;AAKpC,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAC3B,QAAA,iBAAiB,GAAG,MAAM,CAAC;AAC3B,QAAA,gBAAgB,GAAG,wBAAgB,GAAG,yBAAiB,GAAG,KAAK,CAAC;AAMhE,QAAA,0BAA0B,GAAG,MAAM,CAAC;AAQpC,QAAA,qCAAqC,GAAG,wBAAgB,GAAG,MAAM,CAAC;AAMlE,QAAA,0BAA0B,GAAG,MAAM,CAAC;AAMpC,QAAA,6BAA6B,GAAG,GAAG,CAAC;AAOpC,QAAA,sBAAsB,GAAG,IAAI,GAAG,qCAA6B,CAAC;AAM9D,QAAA,wBAAwB,GAAG,KAAK,CAAC;AAMjC,QAAA,qBAAqB,GAAG,GAAG,CAAC;AAM5B,QAAA,sBAAsB,GAAG,GAAG,CAAC;AAC7B,QAAA,wBAAwB,GAAG,EAAE,CAAC;AAC9B,QAAA,qBAAqB,GAAG,EAAE,CAAC;AAC3B,QAAA,iCAAiC,GAAG,8BAAsB,GAAG,gCAAwB,CAAC;AAMtF,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAQhC,QAAA,wBAAwB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './ai-workflow-builder-agent.service';
|
|
2
|
-
export
|
|
2
|
+
export * from './types';
|
|
3
3
|
export * from './workflow-state';
|
|
4
4
|
export { resolveConnections } from './validation/utils/resolve-connections';
|
|
5
5
|
export { CodeBuilderAgent, type CodeBuilderAgentConfig } from './code-builder';
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.AssistantHandler = exports.CodeWorkflowBuilder = exports.CodeBuilderAgent = exports.resolveConnections = void 0;
|
|
18
18
|
__exportStar(require("./ai-workflow-builder-agent.service"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
19
20
|
__exportStar(require("./workflow-state"), exports);
|
|
20
21
|
var resolve_connections_1 = require("./validation/utils/resolve-connections");
|
|
21
22
|
Object.defineProperty(exports, "resolveConnections", { enumerable: true, get: function () { return resolve_connections_1.resolveConnections; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sEAAoD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sEAAoD;AACpD,0CAAwB;AACxB,mDAAiC;AACjC,8EAA4E;AAAnE,yHAAA,kBAAkB,OAAA;AAC3B,+CAA+E;AAAtE,gHAAA,gBAAgB,OAAA;AACzB,+CAAqF;AAA5E,mHAAA,mBAAmB,OAAA;AAC5B,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type MemorySaver } from '@langchain/langgraph';
|
|
2
2
|
import type { Logger } from '@n8n/backend-common';
|
|
3
3
|
import type { INodeTypeDescription } from 'n8n-workflow';
|
|
4
|
+
import type { AssistantHandler } from './assistant';
|
|
4
5
|
import type { ResourceLocatorCallback } from './types/callbacks';
|
|
6
|
+
import { type CoordinationLogEntry } from './types/coordination';
|
|
5
7
|
import type { BuilderFeatureFlags, StageLLMs } from './workflow-builder-agent';
|
|
6
8
|
export interface MultiAgentSubgraphConfig {
|
|
7
9
|
parsedNodeTypes: INodeTypeDescription[];
|
|
@@ -13,6 +15,7 @@ export interface MultiAgentSubgraphConfig {
|
|
|
13
15
|
featureFlags?: BuilderFeatureFlags;
|
|
14
16
|
onGenerationSuccess?: () => Promise<void>;
|
|
15
17
|
resourceLocatorCallback?: ResourceLocatorCallback;
|
|
18
|
+
assistantHandler?: AssistantHandler;
|
|
16
19
|
}
|
|
17
20
|
export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgentSubgraphConfig): import("@langchain/langgraph").CompiledStateGraph<{
|
|
18
21
|
messages: import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[];
|
|
@@ -29,7 +32,7 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
29
32
|
nextPhase: string;
|
|
30
33
|
discoveryContext: import("./types/discovery-types").DiscoveryContext | null;
|
|
31
34
|
workflowOperations: import("./types").WorkflowOperation[];
|
|
32
|
-
coordinationLog:
|
|
35
|
+
coordinationLog: CoordinationLogEntry[];
|
|
33
36
|
previousSummary: string;
|
|
34
37
|
templateIds: number[];
|
|
35
38
|
cachedTemplates: import("./types").WorkflowMetadata[];
|
|
@@ -39,6 +42,7 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
39
42
|
planFeedback: string | null;
|
|
40
43
|
planPrevious: import("./types").PlanOutput | null;
|
|
41
44
|
introspectionEvents: import("./tools/introspect.tool").IntrospectionEvent[];
|
|
45
|
+
sdkSessionId: string | undefined;
|
|
42
46
|
}, {
|
|
43
47
|
messages?: import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[] | undefined;
|
|
44
48
|
workflowJSON?: import("./types").SimpleWorkflow | undefined;
|
|
@@ -54,7 +58,7 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
54
58
|
nextPhase?: string | undefined;
|
|
55
59
|
discoveryContext?: import("./types/discovery-types").DiscoveryContext | null | undefined;
|
|
56
60
|
workflowOperations?: import("./types").WorkflowOperation[] | undefined;
|
|
57
|
-
coordinationLog?:
|
|
61
|
+
coordinationLog?: CoordinationLogEntry[] | undefined;
|
|
58
62
|
previousSummary?: string | undefined;
|
|
59
63
|
templateIds?: number[] | undefined;
|
|
60
64
|
cachedTemplates?: import("./types").WorkflowMetadata[] | undefined;
|
|
@@ -64,7 +68,8 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
64
68
|
planFeedback?: string | null | undefined;
|
|
65
69
|
planPrevious?: import("./types").PlanOutput | null | undefined;
|
|
66
70
|
introspectionEvents?: import("./tools/introspect.tool").IntrospectionEvent[] | undefined;
|
|
67
|
-
|
|
71
|
+
sdkSessionId?: string | undefined;
|
|
72
|
+
}, "responder" | "supervisor" | "create_workflow_name" | "builder_subgraph" | "discovery_subgraph" | "assistant_subgraph" | "compact_messages" | "delete_messages" | "process_operations" | "__start__" | "cleanup_dangling" | "clear_error_state" | "route_next_phase" | "check_state", {
|
|
68
73
|
messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[]>;
|
|
69
74
|
workflowJSON: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").SimpleWorkflow, import("./types").SimpleWorkflow>;
|
|
70
75
|
workflowContext: import("@langchain/langgraph").BinaryOperatorAggregate<{
|
|
@@ -87,7 +92,7 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
87
92
|
nextPhase: import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
88
93
|
discoveryContext: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types/discovery-types").DiscoveryContext | null, import("./types/discovery-types").DiscoveryContext | null>;
|
|
89
94
|
workflowOperations: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").WorkflowOperation[], import("./types").WorkflowOperation[]>;
|
|
90
|
-
coordinationLog: import("@langchain/langgraph").BinaryOperatorAggregate<
|
|
95
|
+
coordinationLog: import("@langchain/langgraph").BinaryOperatorAggregate<CoordinationLogEntry[], CoordinationLogEntry[]>;
|
|
91
96
|
previousSummary: import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
92
97
|
templateIds: import("@langchain/langgraph").BinaryOperatorAggregate<number[], number[]>;
|
|
93
98
|
cachedTemplates: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").WorkflowMetadata[], import("./types").WorkflowMetadata[]>;
|
|
@@ -97,6 +102,7 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
97
102
|
planFeedback: import("@langchain/langgraph").BinaryOperatorAggregate<string | null, string | null>;
|
|
98
103
|
planPrevious: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").PlanOutput | null, import("./types").PlanOutput | null>;
|
|
99
104
|
introspectionEvents: import("@langchain/langgraph").BinaryOperatorAggregate<import("./tools/introspect.tool").IntrospectionEvent[], import("./tools/introspect.tool").IntrospectionEvent[]>;
|
|
105
|
+
sdkSessionId: import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
100
106
|
}, {
|
|
101
107
|
messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[]>;
|
|
102
108
|
workflowJSON: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").SimpleWorkflow, import("./types").SimpleWorkflow>;
|
|
@@ -120,7 +126,7 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
120
126
|
nextPhase: import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
121
127
|
discoveryContext: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types/discovery-types").DiscoveryContext | null, import("./types/discovery-types").DiscoveryContext | null>;
|
|
122
128
|
workflowOperations: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").WorkflowOperation[], import("./types").WorkflowOperation[]>;
|
|
123
|
-
coordinationLog: import("@langchain/langgraph").BinaryOperatorAggregate<
|
|
129
|
+
coordinationLog: import("@langchain/langgraph").BinaryOperatorAggregate<CoordinationLogEntry[], CoordinationLogEntry[]>;
|
|
124
130
|
previousSummary: import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
125
131
|
templateIds: import("@langchain/langgraph").BinaryOperatorAggregate<number[], number[]>;
|
|
126
132
|
cachedTemplates: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").WorkflowMetadata[], import("./types").WorkflowMetadata[]>;
|
|
@@ -130,11 +136,22 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
130
136
|
planFeedback: import("@langchain/langgraph").BinaryOperatorAggregate<string | null, string | null>;
|
|
131
137
|
planPrevious: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").PlanOutput | null, import("./types").PlanOutput | null>;
|
|
132
138
|
introspectionEvents: import("@langchain/langgraph").BinaryOperatorAggregate<import("./tools/introspect.tool").IntrospectionEvent[], import("./tools/introspect.tool").IntrospectionEvent[]>;
|
|
139
|
+
sdkSessionId: import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
133
140
|
}, import("@langchain/langgraph").StateDefinition, {
|
|
134
141
|
supervisor: {
|
|
135
|
-
nextPhase: "responder" | "discovery" | "builder";
|
|
142
|
+
nextPhase: "assistant" | "responder" | "discovery" | "builder";
|
|
136
143
|
};
|
|
137
144
|
responder: {
|
|
145
|
+
coordinationLog: {
|
|
146
|
+
phase: "responder";
|
|
147
|
+
status: "completed";
|
|
148
|
+
timestamp: number;
|
|
149
|
+
summary: string;
|
|
150
|
+
metadata: import("./types/coordination").ResponderMetadata;
|
|
151
|
+
}[];
|
|
152
|
+
messages?: undefined;
|
|
153
|
+
introspectionEvents?: undefined;
|
|
154
|
+
} | {
|
|
138
155
|
messages: import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[];
|
|
139
156
|
coordinationLog: ({
|
|
140
157
|
phase: "responder";
|
|
@@ -152,7 +169,7 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
152
169
|
introspectionEvents: import("./tools/introspect.tool").IntrospectionEvent[];
|
|
153
170
|
};
|
|
154
171
|
check_state: {
|
|
155
|
-
nextPhase:
|
|
172
|
+
nextPhase: string;
|
|
156
173
|
};
|
|
157
174
|
cleanup_dangling: {
|
|
158
175
|
messages: import("@langchain/core/messages").RemoveMessage[];
|
|
@@ -160,18 +177,18 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
160
177
|
compact_messages: {
|
|
161
178
|
previousSummary: string;
|
|
162
179
|
messages: import("@langchain/core/messages").BaseMessage[];
|
|
163
|
-
coordinationLog:
|
|
180
|
+
coordinationLog: CoordinationLogEntry[];
|
|
164
181
|
};
|
|
165
182
|
delete_messages: {
|
|
166
183
|
messages: import("@langchain/core/messages").RemoveMessage[];
|
|
167
184
|
workflowJSON: import("./types").SimpleWorkflow;
|
|
168
185
|
previousSummary: string;
|
|
169
186
|
discoveryContext: null;
|
|
170
|
-
coordinationLog:
|
|
187
|
+
coordinationLog: CoordinationLogEntry[];
|
|
171
188
|
workflowOperations: [];
|
|
172
189
|
};
|
|
173
190
|
clear_error_state: {
|
|
174
|
-
coordinationLog:
|
|
191
|
+
coordinationLog: CoordinationLogEntry[];
|
|
175
192
|
};
|
|
176
193
|
create_workflow_name: {
|
|
177
194
|
workflowJSON: import("./types").SimpleWorkflow;
|
|
@@ -199,7 +216,7 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
199
216
|
nextPhase: import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
200
217
|
discoveryContext: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types/discovery-types").DiscoveryContext | null, import("./types/discovery-types").DiscoveryContext | null>;
|
|
201
218
|
workflowOperations: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").WorkflowOperation[], import("./types").WorkflowOperation[]>;
|
|
202
|
-
coordinationLog: import("@langchain/langgraph").BinaryOperatorAggregate<
|
|
219
|
+
coordinationLog: import("@langchain/langgraph").BinaryOperatorAggregate<CoordinationLogEntry[], CoordinationLogEntry[]>;
|
|
203
220
|
previousSummary: import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
204
221
|
templateIds: import("@langchain/langgraph").BinaryOperatorAggregate<number[], number[]>;
|
|
205
222
|
cachedTemplates: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").WorkflowMetadata[], import("./types").WorkflowMetadata[]>;
|
|
@@ -209,6 +226,7 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
209
226
|
planFeedback: import("@langchain/langgraph").BinaryOperatorAggregate<string | null, string | null>;
|
|
210
227
|
planPrevious: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").PlanOutput | null, import("./types").PlanOutput | null>;
|
|
211
228
|
introspectionEvents: import("@langchain/langgraph").BinaryOperatorAggregate<import("./tools/introspect.tool").IntrospectionEvent[], import("./tools/introspect.tool").IntrospectionEvent[]>;
|
|
229
|
+
sdkSessionId: import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
212
230
|
}>;
|
|
213
231
|
builder_subgraph: import("@langchain/langgraph").UpdateType<{
|
|
214
232
|
messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[]>;
|
|
@@ -233,7 +251,42 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
233
251
|
nextPhase: import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
234
252
|
discoveryContext: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types/discovery-types").DiscoveryContext | null, import("./types/discovery-types").DiscoveryContext | null>;
|
|
235
253
|
workflowOperations: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").WorkflowOperation[], import("./types").WorkflowOperation[]>;
|
|
236
|
-
coordinationLog: import("@langchain/langgraph").BinaryOperatorAggregate<
|
|
254
|
+
coordinationLog: import("@langchain/langgraph").BinaryOperatorAggregate<CoordinationLogEntry[], CoordinationLogEntry[]>;
|
|
255
|
+
previousSummary: import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
256
|
+
templateIds: import("@langchain/langgraph").BinaryOperatorAggregate<number[], number[]>;
|
|
257
|
+
cachedTemplates: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").WorkflowMetadata[], import("./types").WorkflowMetadata[]>;
|
|
258
|
+
planOutput: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").PlanOutput | null, import("./types").PlanOutput | null>;
|
|
259
|
+
mode: import("@langchain/langgraph").BinaryOperatorAggregate<"plan" | "build", "plan" | "build">;
|
|
260
|
+
planDecision: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").PlanDecision | null, import("./types").PlanDecision | null>;
|
|
261
|
+
planFeedback: import("@langchain/langgraph").BinaryOperatorAggregate<string | null, string | null>;
|
|
262
|
+
planPrevious: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").PlanOutput | null, import("./types").PlanOutput | null>;
|
|
263
|
+
introspectionEvents: import("@langchain/langgraph").BinaryOperatorAggregate<import("./tools/introspect.tool").IntrospectionEvent[], import("./tools/introspect.tool").IntrospectionEvent[]>;
|
|
264
|
+
sdkSessionId: import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
265
|
+
}>;
|
|
266
|
+
assistant_subgraph: import("@langchain/langgraph").UpdateType<{
|
|
267
|
+
messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure, import("@langchain/core/messages").MessageType>[]>;
|
|
268
|
+
workflowJSON: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").SimpleWorkflow, import("./types").SimpleWorkflow>;
|
|
269
|
+
workflowContext: import("@langchain/langgraph").BinaryOperatorAggregate<{
|
|
270
|
+
executionSchema?: import("n8n-workflow").NodeExecutionSchema[];
|
|
271
|
+
currentWorkflow?: Partial<import("n8n-workflow").IWorkflowBase>;
|
|
272
|
+
executionData?: import("n8n-workflow").IRunExecutionData["resultData"];
|
|
273
|
+
expressionValues?: Record<string, import("./workflow-builder-agent").ExpressionValue[]>;
|
|
274
|
+
valuesExcluded?: boolean;
|
|
275
|
+
pinnedNodes?: string[];
|
|
276
|
+
selectedNodes?: import("@n8n/api-types").SelectedNodeContext[];
|
|
277
|
+
} | undefined, {
|
|
278
|
+
executionSchema?: import("n8n-workflow").NodeExecutionSchema[];
|
|
279
|
+
currentWorkflow?: Partial<import("n8n-workflow").IWorkflowBase>;
|
|
280
|
+
executionData?: import("n8n-workflow").IRunExecutionData["resultData"];
|
|
281
|
+
expressionValues?: Record<string, import("./workflow-builder-agent").ExpressionValue[]>;
|
|
282
|
+
valuesExcluded?: boolean;
|
|
283
|
+
pinnedNodes?: string[];
|
|
284
|
+
selectedNodes?: import("@n8n/api-types").SelectedNodeContext[];
|
|
285
|
+
} | undefined>;
|
|
286
|
+
nextPhase: import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
287
|
+
discoveryContext: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types/discovery-types").DiscoveryContext | null, import("./types/discovery-types").DiscoveryContext | null>;
|
|
288
|
+
workflowOperations: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").WorkflowOperation[], import("./types").WorkflowOperation[]>;
|
|
289
|
+
coordinationLog: import("@langchain/langgraph").BinaryOperatorAggregate<CoordinationLogEntry[], CoordinationLogEntry[]>;
|
|
237
290
|
previousSummary: import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
238
291
|
templateIds: import("@langchain/langgraph").BinaryOperatorAggregate<number[], number[]>;
|
|
239
292
|
cachedTemplates: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").WorkflowMetadata[], import("./types").WorkflowMetadata[]>;
|
|
@@ -243,5 +296,6 @@ export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgent
|
|
|
243
296
|
planFeedback: import("@langchain/langgraph").BinaryOperatorAggregate<string | null, string | null>;
|
|
244
297
|
planPrevious: import("@langchain/langgraph").BinaryOperatorAggregate<import("./types").PlanOutput | null, import("./types").PlanOutput | null>;
|
|
245
298
|
introspectionEvents: import("@langchain/langgraph").BinaryOperatorAggregate<import("./tools/introspect.tool").IntrospectionEvent[], import("./tools/introspect.tool").IntrospectionEvent[]>;
|
|
299
|
+
sdkSessionId: import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
246
300
|
}>;
|
|
247
301
|
}, unknown, unknown>;
|