@prompd/cli 0.4.8 → 0.4.9
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/lib/nodeTypeRegistry.d.ts +33 -0
- package/dist/lib/nodeTypeRegistry.d.ts.map +1 -0
- package/dist/lib/nodeTypeRegistry.js +168 -0
- package/dist/lib/nodeTypeRegistry.js.map +1 -0
- package/dist/lib/workflowExecutor.d.ts +11 -1
- package/dist/lib/workflowExecutor.d.ts.map +1 -1
- package/dist/lib/workflowExecutor.js +97 -2
- package/dist/lib/workflowExecutor.js.map +1 -1
- package/dist/lib/workflowParser.d.ts.map +1 -1
- package/dist/lib/workflowParser.js +1 -0
- package/dist/lib/workflowParser.js.map +1 -1
- package/dist/lib/workflowTypes.d.ts +20 -2
- package/dist/lib/workflowTypes.d.ts.map +1 -1
- package/dist/lib/workflowTypes.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node Type Registry - Single source of truth for workflow node types (CLI)
|
|
3
|
+
*
|
|
4
|
+
* Contains all valid node type keys, labels, descriptions, and categories.
|
|
5
|
+
* No icons or colors — those are frontend-only concerns.
|
|
6
|
+
*
|
|
7
|
+
* Frontend counterpart: prompd.app/frontend/src/modules/services/nodeTypeRegistry.ts
|
|
8
|
+
* Future: Consolidate both into a shared @prompd/shared package.
|
|
9
|
+
*
|
|
10
|
+
* When adding a new node type:
|
|
11
|
+
* 1. Add it to WorkflowNodeType union in workflowTypes.ts
|
|
12
|
+
* 2. Add an entry to NODE_TYPE_REGISTRY below
|
|
13
|
+
* 3. Add execution logic in workflowExecutor.ts
|
|
14
|
+
* 4. Mirror in frontend nodeTypeRegistry.ts + node components
|
|
15
|
+
*/
|
|
16
|
+
import type { WorkflowNodeType } from './workflowTypes.js';
|
|
17
|
+
export interface NodeTypeEntry {
|
|
18
|
+
type: WorkflowNodeType;
|
|
19
|
+
label: string;
|
|
20
|
+
description: string;
|
|
21
|
+
}
|
|
22
|
+
export interface NodeTypeCategory {
|
|
23
|
+
key: string;
|
|
24
|
+
label: string;
|
|
25
|
+
types: WorkflowNodeType[];
|
|
26
|
+
}
|
|
27
|
+
export declare const NODE_TYPE_REGISTRY: Record<WorkflowNodeType, NodeTypeEntry>;
|
|
28
|
+
export declare const NODE_TYPE_CATEGORIES: NodeTypeCategory[];
|
|
29
|
+
/** All valid node type keys (for parser validation) */
|
|
30
|
+
export declare const ALL_NODE_TYPES: WorkflowNodeType[];
|
|
31
|
+
/** Get a node type entry, returns undefined for unknown types */
|
|
32
|
+
export declare function getNodeTypeEntry(type: WorkflowNodeType): NodeTypeEntry | undefined;
|
|
33
|
+
//# sourceMappingURL=nodeTypeRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeTypeRegistry.d.ts","sourceRoot":"","sources":["../../src/lib/nodeTypeRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAM1D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,gBAAgB,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAC1B;AAMD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAiGtE,CAAA;AAMD,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,EAyClD,CAAA;AAMD,uDAAuD;AACvD,eAAO,MAAM,cAAc,EAAE,gBAAgB,EAA0D,CAAA;AAEvG,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,aAAa,GAAG,SAAS,CAElF"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Node Type Registry - Single source of truth for workflow node types (CLI)
|
|
4
|
+
*
|
|
5
|
+
* Contains all valid node type keys, labels, descriptions, and categories.
|
|
6
|
+
* No icons or colors — those are frontend-only concerns.
|
|
7
|
+
*
|
|
8
|
+
* Frontend counterpart: prompd.app/frontend/src/modules/services/nodeTypeRegistry.ts
|
|
9
|
+
* Future: Consolidate both into a shared @prompd/shared package.
|
|
10
|
+
*
|
|
11
|
+
* When adding a new node type:
|
|
12
|
+
* 1. Add it to WorkflowNodeType union in workflowTypes.ts
|
|
13
|
+
* 2. Add an entry to NODE_TYPE_REGISTRY below
|
|
14
|
+
* 3. Add execution logic in workflowExecutor.ts
|
|
15
|
+
* 4. Mirror in frontend nodeTypeRegistry.ts + node components
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ALL_NODE_TYPES = exports.NODE_TYPE_CATEGORIES = exports.NODE_TYPE_REGISTRY = void 0;
|
|
19
|
+
exports.getNodeTypeEntry = getNodeTypeEntry;
|
|
20
|
+
// ============================================================================
|
|
21
|
+
// Registry
|
|
22
|
+
// ============================================================================
|
|
23
|
+
exports.NODE_TYPE_REGISTRY = {
|
|
24
|
+
// Entry & Exit
|
|
25
|
+
'trigger': {
|
|
26
|
+
type: 'trigger', label: 'Trigger', description: 'Workflow entry point',
|
|
27
|
+
},
|
|
28
|
+
'output': {
|
|
29
|
+
type: 'output', label: 'Output', description: 'Workflow final output',
|
|
30
|
+
},
|
|
31
|
+
// AI & Prompts
|
|
32
|
+
'prompt': {
|
|
33
|
+
type: 'prompt', label: 'Prompt', description: 'Execute a .prmd file',
|
|
34
|
+
},
|
|
35
|
+
'provider': {
|
|
36
|
+
type: 'provider', label: 'Provider', description: 'LLM provider & model config',
|
|
37
|
+
},
|
|
38
|
+
'agent': {
|
|
39
|
+
type: 'agent', label: 'AI Agent', description: 'Autonomous agent with tools',
|
|
40
|
+
},
|
|
41
|
+
'chat-agent': {
|
|
42
|
+
type: 'chat-agent', label: 'Chat Agent', description: 'Input + Guard + Agent + Tools',
|
|
43
|
+
},
|
|
44
|
+
'claude-code': {
|
|
45
|
+
type: 'claude-code', label: 'Claude Code', description: 'Claude Code agent (local/SSH)',
|
|
46
|
+
},
|
|
47
|
+
'guardrail': {
|
|
48
|
+
type: 'guardrail', label: 'Guardrail', description: 'Validate input with pass/reject',
|
|
49
|
+
},
|
|
50
|
+
// Tools & Execution
|
|
51
|
+
'tool': {
|
|
52
|
+
type: 'tool', label: 'Tool', description: 'Unified tool execution',
|
|
53
|
+
},
|
|
54
|
+
'command': {
|
|
55
|
+
type: 'command', label: 'Command', description: 'Execute shell commands',
|
|
56
|
+
},
|
|
57
|
+
'web-search': {
|
|
58
|
+
type: 'web-search', label: 'Web Search', description: 'Search the web',
|
|
59
|
+
},
|
|
60
|
+
'code': {
|
|
61
|
+
type: 'code', label: 'Code', description: 'Run TS/Python/C# snippets',
|
|
62
|
+
},
|
|
63
|
+
'api': {
|
|
64
|
+
type: 'api', label: 'HTTP Request', description: 'Make REST API calls',
|
|
65
|
+
},
|
|
66
|
+
'mcp-tool': {
|
|
67
|
+
type: 'mcp-tool', label: 'MCP Tool', description: 'External MCP server tool',
|
|
68
|
+
},
|
|
69
|
+
// Tool Routing
|
|
70
|
+
'tool-call-parser': {
|
|
71
|
+
type: 'tool-call-parser', label: 'Tool Parser', description: 'Parse LLM tool call output',
|
|
72
|
+
},
|
|
73
|
+
'tool-call-router': {
|
|
74
|
+
type: 'tool-call-router', label: 'Tool Router', description: 'Route tool calls to handlers',
|
|
75
|
+
},
|
|
76
|
+
// Control Flow
|
|
77
|
+
'condition': {
|
|
78
|
+
type: 'condition', label: 'Condition', description: 'Branch based on expression',
|
|
79
|
+
},
|
|
80
|
+
'loop': {
|
|
81
|
+
type: 'loop', label: 'Loop', description: 'Iterate over items or count',
|
|
82
|
+
},
|
|
83
|
+
'parallel': {
|
|
84
|
+
type: 'parallel', label: 'Parallel', description: 'Execute branches concurrently',
|
|
85
|
+
},
|
|
86
|
+
'merge': {
|
|
87
|
+
type: 'merge', label: 'Merge', description: 'Combine parallel results',
|
|
88
|
+
},
|
|
89
|
+
// Data
|
|
90
|
+
'transformer': {
|
|
91
|
+
type: 'transformer', label: 'Transform', description: 'Transform data with template',
|
|
92
|
+
},
|
|
93
|
+
'memory': {
|
|
94
|
+
type: 'memory', label: 'Memory', description: 'KV store, conversation, or cache',
|
|
95
|
+
},
|
|
96
|
+
// Interaction & Debug
|
|
97
|
+
'user-input': {
|
|
98
|
+
type: 'user-input', label: 'User Input', description: 'Pause for user input',
|
|
99
|
+
},
|
|
100
|
+
'callback': {
|
|
101
|
+
type: 'callback', label: 'Checkpoint', description: 'Log, pause, approve, or notify',
|
|
102
|
+
},
|
|
103
|
+
'checkpoint': {
|
|
104
|
+
type: 'checkpoint', label: 'Checkpoint', description: 'Log, pause, approve, or notify',
|
|
105
|
+
},
|
|
106
|
+
'error-handler': {
|
|
107
|
+
type: 'error-handler', label: 'Error Handler', description: 'Configure error handling',
|
|
108
|
+
},
|
|
109
|
+
// Composition
|
|
110
|
+
'workflow': {
|
|
111
|
+
type: 'workflow', label: 'Sub-Workflow', description: 'Invoke another .pdflow',
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
// ============================================================================
|
|
115
|
+
// Categories
|
|
116
|
+
// ============================================================================
|
|
117
|
+
exports.NODE_TYPE_CATEGORIES = [
|
|
118
|
+
{
|
|
119
|
+
key: 'entry-exit',
|
|
120
|
+
label: 'Entry & Exit',
|
|
121
|
+
types: ['trigger', 'output'],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
key: 'ai-prompts',
|
|
125
|
+
label: 'AI & Prompts',
|
|
126
|
+
types: ['prompt', 'provider', 'agent', 'chat-agent', 'claude-code', 'guardrail'],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
key: 'tools-execution',
|
|
130
|
+
label: 'Tools & Execution',
|
|
131
|
+
types: ['tool', 'command', 'web-search', 'code', 'api', 'mcp-tool'],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
key: 'tool-routing',
|
|
135
|
+
label: 'Tool Routing',
|
|
136
|
+
types: ['tool-call-parser', 'tool-call-router'],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
key: 'control-flow',
|
|
140
|
+
label: 'Control Flow',
|
|
141
|
+
types: ['condition', 'loop', 'parallel', 'merge'],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
key: 'data',
|
|
145
|
+
label: 'Data',
|
|
146
|
+
types: ['transformer', 'memory'],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
key: 'interaction',
|
|
150
|
+
label: 'Interaction',
|
|
151
|
+
types: ['user-input', 'callback', 'error-handler'],
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
key: 'composition',
|
|
155
|
+
label: 'Composition',
|
|
156
|
+
types: ['workflow'],
|
|
157
|
+
},
|
|
158
|
+
];
|
|
159
|
+
// ============================================================================
|
|
160
|
+
// Derived helpers
|
|
161
|
+
// ============================================================================
|
|
162
|
+
/** All valid node type keys (for parser validation) */
|
|
163
|
+
exports.ALL_NODE_TYPES = Object.keys(exports.NODE_TYPE_REGISTRY);
|
|
164
|
+
/** Get a node type entry, returns undefined for unknown types */
|
|
165
|
+
function getNodeTypeEntry(type) {
|
|
166
|
+
return exports.NODE_TYPE_REGISTRY[type];
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=nodeTypeRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeTypeRegistry.js","sourceRoot":"","sources":["../../src/lib/nodeTypeRegistry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAkLH,4CAEC;AAhKD,+EAA+E;AAC/E,WAAW;AACX,+EAA+E;AAElE,QAAA,kBAAkB,GAA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D;IACD;QACE,GAAG,EAAE,aAAa;QAClB,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,CAAC,UAAU,CAAC;KACpB;CACF,CAAA;AAED,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E,uDAAuD;AAC1C,QAAA,cAAc,GAAuB,MAAM,CAAC,IAAI,CAAC,0BAAkB,CAAuB,CAAA;AAEvG,iEAAiE;AACjE,SAAgB,gBAAgB,CAAC,IAAsB;IACrD,OAAO,0BAAkB,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC"}
|
|
@@ -105,7 +105,7 @@ export interface DebugState {
|
|
|
105
105
|
export interface ToolCallRequest {
|
|
106
106
|
nodeId: string;
|
|
107
107
|
toolName: string;
|
|
108
|
-
toolType: 'function' | 'mcp' | 'http' | 'command' | 'code';
|
|
108
|
+
toolType: 'function' | 'mcp' | 'http' | 'command' | 'code' | 'web-search';
|
|
109
109
|
parameters: Record<string, unknown>;
|
|
110
110
|
/** For HTTP tools */
|
|
111
111
|
httpConfig?: {
|
|
@@ -134,6 +134,16 @@ export interface ToolCallRequest {
|
|
|
134
134
|
inputVariable?: string;
|
|
135
135
|
executionContext?: 'isolated' | 'main';
|
|
136
136
|
};
|
|
137
|
+
/** For web search tools */
|
|
138
|
+
webSearchConfig?: {
|
|
139
|
+
query: string;
|
|
140
|
+
resultCount?: number;
|
|
141
|
+
connectionConfig?: {
|
|
142
|
+
provider: string;
|
|
143
|
+
apiKey?: string;
|
|
144
|
+
instanceUrl?: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
137
147
|
timeout?: number;
|
|
138
148
|
}
|
|
139
149
|
/** Tool call result from external execution */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflowExecutor.d.ts","sourceRoot":"","sources":["../../src/lib/workflowExecutor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAGV,cAAc,EACd,sBAAsB,EACtB,sBAAsB,EAgBtB,oBAAoB,
|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AE,OAAO,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GACnH,eAAe,CAAC,eAAe,CAAC,CAElC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,GAAE,eAAoB;mBAMH,OAAO,CAAC,cAAc,GAAG;QAAE,KAAK,EAAE,cAAc,CAAA;KAAE,CAAC;;;;;EAuD9E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAE/D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAiB5E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAK1D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG;IACtD,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAgBA"}
|
|
@@ -976,6 +976,9 @@ async function executeWorkflow(workflow, params, options = {}) {
|
|
|
976
976
|
case 'command':
|
|
977
977
|
output = await executeCommandNode(node, context, options, trace);
|
|
978
978
|
break;
|
|
979
|
+
case 'web-search':
|
|
980
|
+
output = await executeWebSearchNode(node, context, options, trace);
|
|
981
|
+
break;
|
|
979
982
|
case 'claude-code':
|
|
980
983
|
// Claude Code node - requires Electron for SSH support
|
|
981
984
|
addTraceEntry(trace, {
|
|
@@ -1003,6 +1006,10 @@ async function executeWorkflow(workflow, params, options = {}) {
|
|
|
1003
1006
|
// Output node just passes through the previous output
|
|
1004
1007
|
output = previousOutput;
|
|
1005
1008
|
break;
|
|
1009
|
+
case 'trigger':
|
|
1010
|
+
// Trigger node outputs the workflow parameters so downstream nodes can access them
|
|
1011
|
+
output = Object.keys(params).length > 0 ? params : previousOutput;
|
|
1012
|
+
break;
|
|
1006
1013
|
default:
|
|
1007
1014
|
output = previousOutput;
|
|
1008
1015
|
}
|
|
@@ -1155,8 +1162,8 @@ async function executePromptNode(node, context, options, trace, state, workflowF
|
|
|
1155
1162
|
...context.workflow, // Also flatten workflow params for direct access
|
|
1156
1163
|
...resolvedParams, // Node-specific mappings override
|
|
1157
1164
|
};
|
|
1158
|
-
//
|
|
1159
|
-
if (
|
|
1165
|
+
// Always make previous output available for {{ previous_output }} template references
|
|
1166
|
+
if (context.previous_output !== undefined) {
|
|
1160
1167
|
allParams['previous_output'] = context.previous_output;
|
|
1161
1168
|
// Also provide as previous_step for step2.prmd style references
|
|
1162
1169
|
allParams['previous_step'] = context.previous_output;
|
|
@@ -1697,6 +1704,9 @@ async function executeNodeSubset(nodeIds, workflowFile, context, options, state,
|
|
|
1697
1704
|
case 'command':
|
|
1698
1705
|
output = await executeCommandNode(node, nodeContext, options, trace);
|
|
1699
1706
|
break;
|
|
1707
|
+
case 'web-search':
|
|
1708
|
+
output = await executeWebSearchNode(node, nodeContext, options, trace);
|
|
1709
|
+
break;
|
|
1700
1710
|
case 'mcp-tool':
|
|
1701
1711
|
output = await executeMcpToolNode(node, nodeContext, options, trace);
|
|
1702
1712
|
break;
|
|
@@ -2754,6 +2764,91 @@ async function executeCommandNode(node, context, options, trace) {
|
|
|
2754
2764
|
};
|
|
2755
2765
|
}
|
|
2756
2766
|
}
|
|
2767
|
+
/**
|
|
2768
|
+
* Execute a web search node - searches the web via configurable provider
|
|
2769
|
+
*
|
|
2770
|
+
* Uses the onToolCall callback to delegate HTTP requests to the host environment (Electron).
|
|
2771
|
+
* The connection configuration (provider, API key, instance URL) is passed through
|
|
2772
|
+
* webSearchConfig so the host can build the appropriate HTTP request.
|
|
2773
|
+
*/
|
|
2774
|
+
async function executeWebSearchNode(node, context, options, trace) {
|
|
2775
|
+
const data = node.data;
|
|
2776
|
+
// Resolve query template if it contains expressions
|
|
2777
|
+
let resolvedQuery = data.query || '';
|
|
2778
|
+
if (resolvedQuery.includes('{{')) {
|
|
2779
|
+
const result = evaluateExpression(resolvedQuery, context);
|
|
2780
|
+
resolvedQuery = typeof result === 'string' ? result : String(result);
|
|
2781
|
+
}
|
|
2782
|
+
const resultCount = data.resultCount || 5;
|
|
2783
|
+
addTraceEntry(trace, {
|
|
2784
|
+
type: 'debug_step',
|
|
2785
|
+
nodeId: node.id,
|
|
2786
|
+
nodeName: node.data.label,
|
|
2787
|
+
nodeType: 'web-search',
|
|
2788
|
+
message: `Searching web: "${resolvedQuery}" (max ${resultCount} results)`,
|
|
2789
|
+
data: { query: resolvedQuery, resultCount },
|
|
2790
|
+
}, options);
|
|
2791
|
+
if (options.onToolCall) {
|
|
2792
|
+
try {
|
|
2793
|
+
const toolCallRequest = {
|
|
2794
|
+
nodeId: node.id,
|
|
2795
|
+
toolName: 'web-search',
|
|
2796
|
+
toolType: 'web-search',
|
|
2797
|
+
parameters: {},
|
|
2798
|
+
webSearchConfig: {
|
|
2799
|
+
query: resolvedQuery,
|
|
2800
|
+
resultCount,
|
|
2801
|
+
connectionConfig: data.provider ? {
|
|
2802
|
+
provider: data.provider,
|
|
2803
|
+
apiKey: data.apiKey,
|
|
2804
|
+
instanceUrl: data.instanceUrl,
|
|
2805
|
+
} : undefined,
|
|
2806
|
+
},
|
|
2807
|
+
};
|
|
2808
|
+
const result = await options.onToolCall(toolCallRequest);
|
|
2809
|
+
if (!result.success) {
|
|
2810
|
+
throw new Error(result.error || 'Web search failed');
|
|
2811
|
+
}
|
|
2812
|
+
addTraceEntry(trace, {
|
|
2813
|
+
type: 'debug_step',
|
|
2814
|
+
nodeId: node.id,
|
|
2815
|
+
nodeName: node.data.label,
|
|
2816
|
+
nodeType: 'web-search',
|
|
2817
|
+
message: 'Web search completed successfully',
|
|
2818
|
+
data: { resultCount: Array.isArray(result.result) ? result.result.length : 1 },
|
|
2819
|
+
}, options);
|
|
2820
|
+
return result.result;
|
|
2821
|
+
}
|
|
2822
|
+
catch (error) {
|
|
2823
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
2824
|
+
addTraceEntry(trace, {
|
|
2825
|
+
type: 'node_error',
|
|
2826
|
+
nodeId: node.id,
|
|
2827
|
+
nodeName: node.data.label,
|
|
2828
|
+
nodeType: 'web-search',
|
|
2829
|
+
message: `Web search error: ${errorMessage}`,
|
|
2830
|
+
data: { error: errorMessage },
|
|
2831
|
+
}, options);
|
|
2832
|
+
throw error;
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
else {
|
|
2836
|
+
addTraceEntry(trace, {
|
|
2837
|
+
type: 'debug_step',
|
|
2838
|
+
nodeId: node.id,
|
|
2839
|
+
nodeName: node.data.label,
|
|
2840
|
+
nodeType: 'web-search',
|
|
2841
|
+
message: 'Web search requires onToolCall callback',
|
|
2842
|
+
data: { query: resolvedQuery },
|
|
2843
|
+
}, options);
|
|
2844
|
+
return {
|
|
2845
|
+
skipped: true,
|
|
2846
|
+
reason: 'onToolCall callback required for web search execution',
|
|
2847
|
+
query: resolvedQuery,
|
|
2848
|
+
resultCount,
|
|
2849
|
+
};
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2757
2852
|
/**
|
|
2758
2853
|
* Execute an MCP tool node - calls external MCP server tools
|
|
2759
2854
|
*/
|