@graph-compose/client 1.0.0 → 1.0.3

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 (49) hide show
  1. package/README.md +949 -476
  2. package/dist/core/adk-helpers.d.ts +94 -0
  3. package/dist/core/adk-helpers.d.ts.map +1 -0
  4. package/dist/core/adk-helpers.js +134 -0
  5. package/dist/core/adk-helpers.js.map +1 -0
  6. package/dist/core/adk-node-builder.d.ts +128 -0
  7. package/dist/core/adk-node-builder.d.ts.map +1 -0
  8. package/dist/core/adk-node-builder.js +175 -0
  9. package/dist/core/adk-node-builder.js.map +1 -0
  10. package/dist/core/adk-workflow-builder.d.ts +74 -0
  11. package/dist/core/adk-workflow-builder.d.ts.map +1 -0
  12. package/dist/core/adk-workflow-builder.js +138 -0
  13. package/dist/core/adk-workflow-builder.js.map +1 -0
  14. package/dist/core/base-builder.d.ts +80 -0
  15. package/dist/core/base-builder.d.ts.map +1 -0
  16. package/dist/core/base-builder.js +63 -0
  17. package/dist/core/base-builder.js.map +1 -0
  18. package/dist/core/builder.d.ts +35 -67
  19. package/dist/core/builder.d.ts.map +1 -1
  20. package/dist/core/builder.js +45 -144
  21. package/dist/core/builder.js.map +1 -1
  22. package/dist/core/node-builder.d.ts +15 -59
  23. package/dist/core/node-builder.d.ts.map +1 -1
  24. package/dist/core/node-builder.js +36 -106
  25. package/dist/core/node-builder.js.map +1 -1
  26. package/dist/index.d.ts +5 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +7 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/types.d.ts +50 -4
  31. package/dist/types.d.ts.map +1 -1
  32. package/dist/types.js.map +1 -1
  33. package/dist/validation/adk-validation.d.ts +10 -0
  34. package/dist/validation/adk-validation.d.ts.map +1 -0
  35. package/dist/validation/adk-validation.js +362 -0
  36. package/dist/validation/adk-validation.js.map +1 -0
  37. package/dist/validation/index.d.ts +34 -9
  38. package/dist/validation/index.d.ts.map +1 -1
  39. package/dist/validation/index.js +40 -131
  40. package/dist/validation/index.js.map +1 -1
  41. package/package.json +4 -2
  42. package/dist/core/tool-builder.d.ts +0 -130
  43. package/dist/core/tool-builder.d.ts.map +0 -1
  44. package/dist/core/tool-builder.js +0 -343
  45. package/dist/core/tool-builder.js.map +0 -1
  46. package/dist/node-builder.d.ts +0 -64
  47. package/dist/node-builder.d.ts.map +0 -1
  48. package/dist/node-builder.js +0 -261
  49. package/dist/node-builder.js.map +0 -1
@@ -1,17 +1,13 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.GraphCompose = void 0;
7
- const console_1 = __importDefault(require("console"));
8
4
  const validation_1 = require("../validation");
9
5
  const node_builder_1 = require("./node-builder");
10
- const tool_builder_1 = require("./tool-builder");
6
+ const adk_node_builder_1 = require("./adk-node-builder");
11
7
  /**
12
8
  * GraphCompose is the main builder class for creating workflow graphs.
13
9
  * It provides a fluent API for building and executing workflows composed of HTTP nodes, agents, and error boundaries.
14
- * You configure each node or tool using chained methods and **must** call `.end()` to finalize its definition.
10
+ * You configure each node using chained methods and **must** call `.end()` to finalize its definition.
15
11
  *
16
12
  * @example
17
13
  * ```typescript
@@ -23,30 +19,26 @@ const tool_builder_1 = require("./tool-builder");
23
19
  * .withHeaders({ "Authorization": "Bearer token" })
24
20
  * .end(); // Required!
25
21
  *
26
- * // Define and end a tool (example)
27
- * graph.tool("analyze")
28
- * .post("https://api.example.com/analyze")
29
- * .end();
30
- *
31
- * // Create and finalize an agent node that uses the tool
32
- * graph.agent("process_data")
33
- * .withMaxIterations(5)
34
- * .withTools(["analyze"])
35
- * .post("https://api.example.com/agent")
22
+ * // Create and finalize another node with dependencies
23
+ * graph.node("process_data")
24
+ * .post("https://api.example.com/process")
36
25
  * .withDependencies(["fetch_data"])
26
+ * .withBody(({ results }) => ({
27
+ * data: results.fetch_data
28
+ * }))
37
29
  * .end(); // Required!
38
30
  *
39
- * // Validate the complete workflow (requires all nodes/tools ended)
31
+ * // Validate the complete workflow (requires all nodes ended)
40
32
  * const validationResult = graph.validate();
41
33
  * if (!validationResult.isValid) { console.error("Validation failed:", validationResult.errors); }
42
34
  *
43
- * // Execute the workflow (requires all nodes/tools ended)
35
+ * // Execute the workflow (requires all nodes ended)
44
36
  * try {
45
37
  * const result = await graph.execute({});
46
38
  * console.log("Execution started:", result);
47
39
  * } catch (error) { console.error("Execution failed:", error); }
48
40
  *
49
- * // Get the raw workflow definition (requires all nodes/tools ended)
41
+ * // Get the raw workflow definition (requires all nodes ended)
50
42
  * const definition = graph.toJSON();
51
43
  * console.log("Workflow JSON:", JSON.stringify(definition, null, 2));
52
44
  *
@@ -64,7 +56,6 @@ class GraphCompose {
64
56
  */
65
57
  constructor(options = {}) {
66
58
  this.nodes = [];
67
- this._tools = [];
68
59
  this.token = options.token || process.env.GRAPH_COMPOSE_TOKEN || "";
69
60
  if (!this.token) {
70
61
  throw new Error("API token is required. Set GRAPH_COMPOSE_TOKEN environment variable or pass token in constructor options.");
@@ -72,15 +63,6 @@ class GraphCompose {
72
63
  // Default to production API URL
73
64
  this.baseUrl = "https://api.graphcompose.io/api/v1";
74
65
  }
75
- /** Internal method for ToolBuilder to add its definition */
76
- _addToolDefinition(tool) {
77
- if (this._tools.some((t) => t.id === tool.id)) {
78
- console_1.default.warn(`GraphCompose: Tool with ID '${tool.id}' already exists. Overwriting.`);
79
- this._tools = this._tools.filter((t) => t.id !== tool.id);
80
- }
81
- this._tools.push(tool);
82
- this.currentToolBuilder = undefined;
83
- }
84
66
  /** Internal method for NodeBuilder to add its definition */
85
67
  _addNodeDefinition(node) {
86
68
  this.nodes.push(node);
@@ -94,9 +76,6 @@ class GraphCompose {
94
76
  if (this.currentNodeBuilder) {
95
77
  throw new Error(`Cannot ${operation} while node '${this.currentNodeBuilder.getId()}' is being built. Call .end() first.`);
96
78
  }
97
- if (this.currentToolBuilder) {
98
- throw new Error(`Cannot ${operation} while tool '${this.currentToolBuilder.getId()}' is being built. Call .end() first.`);
99
- }
100
79
  }
101
80
  /**
102
81
  * Start building a new HTTP node.
@@ -145,47 +124,39 @@ class GraphCompose {
145
124
  return this.currentNodeBuilder;
146
125
  }
147
126
  /**
148
- * Start building a new agent node.
149
- * Agent nodes are special nodes that can execute multiple iterations and use tools.
150
- * **Note:** You must call `.end()` on the returned `NodeBuilder` before starting another node or finishing the graph.
127
+ * Start building a new ADK (Agent Development Kit) node.
128
+ * ADK nodes enable agentic workflows with multi-agent orchestration.
129
+ * **Note:** You must call `.end()` on the returned `AdkNodeBuilder` before starting another node or finishing the graph.
151
130
  *
152
131
  * @param id Unique identifier for the node (must be alphanumeric with underscores)
153
- * @returns NodeBuilder instance for method chaining
132
+ * @returns AdkNodeBuilder instance for method chaining
154
133
  * @throws {Error} If another node or tool is currently being built.
155
134
  * @example
156
135
  * ```typescript
157
- * graph.agent("research_agent")
158
- * .withMaxIterations(10)
159
- * .withTools(["search", "analyze"])
160
- * .post("https://api.example.com/agent")
161
- * .end(); // Required!
162
- * ```
163
- */
164
- agent(id) {
165
- this.ensureBuildersFinalized(`start agent '${id}'`);
166
- this.currentNodeBuilder = new node_builder_1.NodeBuilder(this, id, "agent");
167
- return this.currentNodeBuilder;
168
- }
169
- /**
170
- * Start building a new tool definition.
171
- * Tools are reusable components (HTTP calls or sub-graphs) usable by agent nodes.
172
- * **Note:** You must call `.end()` on the returned `ToolBuilder` before starting another tool/node or finishing the graph.
173
- *
174
- * @param id Unique identifier for the tool (must be alphanumeric with underscores)
175
- * @returns ToolBuilder instance for method chaining
176
- * @throws {Error} If another node or tool is currently being built.
177
- * @example
178
- * ```typescript
179
- * graph.tool("search")
180
- * .get("https://api.search.com")
181
- * .withHeaders({ "Authorization": "Bearer token" })
136
+ * graph.adk("customer_support")
137
+ * .withWorkflow(builder =>
138
+ * builder
139
+ * .rootAgent("support_agent")
140
+ * .agent(createLlmAgent({
141
+ * id: "support_agent",
142
+ * httpConfig: { url: "https://llm.example.com", method: "POST" },
143
+ * tools: ["search_kb"],
144
+ * outputKey: "support_response"
145
+ * }))
146
+ * .httpTool(createHttpTool({
147
+ * id: "search_kb",
148
+ * httpConfig: { url: "https://kb.example.com/search", method: "POST" }
149
+ * }))
150
+ * .build()
151
+ * )
182
152
  * .end(); // Required!
183
153
  * ```
184
154
  */
185
- tool(id) {
186
- this.ensureBuildersFinalized(`start tool '${id}'`);
187
- this.currentToolBuilder = new tool_builder_1.ToolBuilder(this, id);
188
- return this.currentToolBuilder;
155
+ adk(id) {
156
+ this.ensureBuildersFinalized(`start ADK node '${id}'`);
157
+ const builder = new adk_node_builder_1.AdkNodeBuilder(this, id);
158
+ this.currentNodeBuilder = builder;
159
+ return builder;
189
160
  }
190
161
  /**
191
162
  * Add a pre-configured node to the workflow.
@@ -200,23 +171,6 @@ class GraphCompose {
200
171
  this.nodes.push(node);
201
172
  return this;
202
173
  }
203
- /**
204
- * Add a pre-configured tool definition to the workflow.
205
- * Ensures no other builder is active before adding.
206
- *
207
- * @param tool The tool configuration to add
208
- * @returns this GraphCompose instance for method chaining
209
- * @throws {Error} If another node or tool is currently being built.
210
- */
211
- addTool(tool) {
212
- this.ensureBuildersFinalized("add pre-configured tool");
213
- if (this._tools.some((t) => t.id === tool.id)) {
214
- console_1.default.warn(`GraphCompose: Tool with ID '${tool.id}' already exists. Overwriting.`);
215
- this._tools = this._tools.filter((t) => t.id !== tool.id);
216
- }
217
- this._tools.push(tool);
218
- return this;
219
- }
220
174
  /**
221
175
  * Get the complete workflow definition object.
222
176
  * This includes all nodes, tools, webhook URL, context, and workflow configuration.
@@ -229,7 +183,6 @@ class GraphCompose {
229
183
  this.ensureBuildersFinalized("get workflow definition");
230
184
  return {
231
185
  nodes: this.nodes,
232
- tools: this._tools,
233
186
  webhookUrl: this.webhookUrl,
234
187
  context: this.context,
235
188
  workflowConfig: this.workflowConfig,
@@ -253,9 +206,8 @@ class GraphCompose {
253
206
  * - Valid node IDs
254
207
  * - Valid URLs
255
208
  * - Valid dependencies
256
- * - Valid tool configurations
257
209
  * - No circular dependencies
258
- * - Agent-specific requirements (e.g., `max_iterations` presence and value)
210
+ * - Valid error boundary configurations
259
211
  *
260
212
  * Note: This performs client-side validation only. Use `validateApi()` for server-side checks including tier limits.
261
213
  *
@@ -279,7 +231,6 @@ class GraphCompose {
279
231
  this.ensureBuildersFinalized("validate workflow via API");
280
232
  const workflow = this.getWorkflow();
281
233
  const requestBody = { workflow };
282
- console_1.default.log(`Validating workflow via API: ${this.baseUrl}/workflows/validate`);
283
234
  try {
284
235
  const response = await fetch(`${this.baseUrl}/workflows/validate`, {
285
236
  method: "POST",
@@ -291,13 +242,13 @@ class GraphCompose {
291
242
  });
292
243
  const responseJson = await response.json();
293
244
  if (!response.ok) {
294
- console_1.default.error(`API Validation Error ${response.status}:`, responseJson?.message || response.statusText);
245
+ console.error(`API Validation Error ${response.status}:`, responseJson?.message || response.statusText);
295
246
  }
296
247
  // Assert the response structure matches ApiResponse<ApiValidationResult | null>
297
248
  return responseJson;
298
249
  }
299
250
  catch (error) {
300
- console_1.default.error("Error calling validation API:", error);
251
+ console.error("Error calling validation API:", error);
301
252
  if (error instanceof Error) {
302
253
  throw new Error(`Failed to call validation API: ${error.message}`);
303
254
  }
@@ -315,7 +266,6 @@ class GraphCompose {
315
266
  if (!workflowId) {
316
267
  throw new Error("Workflow ID is required to get status.");
317
268
  }
318
- console_1.default.log(`Getting workflow status via API: ${this.baseUrl}/workflows/${workflowId}`);
319
269
  try {
320
270
  const response = await fetch(`${this.baseUrl}/workflows/${workflowId}`, {
321
271
  method: "GET",
@@ -325,12 +275,12 @@ class GraphCompose {
325
275
  });
326
276
  const responseJson = await response.json();
327
277
  if (!response.ok) {
328
- console_1.default.error(`API Get Status Error ${response.status}:`, responseJson?.message || response.statusText);
278
+ console.error(`API Get Status Error ${response.status}:`, responseJson?.message || response.statusText);
329
279
  }
330
280
  return responseJson;
331
281
  }
332
282
  catch (error) {
333
- console_1.default.error("Error calling get workflow status API:", error);
283
+ console.error("Error calling get workflow status API:", error);
334
284
  if (error instanceof Error) {
335
285
  throw new Error(`Failed to get workflow status: ${error.message}`);
336
286
  }
@@ -349,7 +299,6 @@ class GraphCompose {
349
299
  if (!workflowId) {
350
300
  throw new Error("Workflow ID is required to terminate.");
351
301
  }
352
- console_1.default.log(`Terminating workflow via API: ${this.baseUrl}/workflows/${workflowId}/terminate`);
353
302
  const requestBody = {
354
303
  run_id: options?.runId,
355
304
  reason: options?.reason,
@@ -365,12 +314,12 @@ class GraphCompose {
365
314
  });
366
315
  const responseJson = await response.json();
367
316
  if (!response.ok) {
368
- console_1.default.error(`API Terminate Error ${response.status}:`, responseJson?.message || response.statusText);
317
+ console.error(`API Terminate Error ${response.status}:`, responseJson?.message || response.statusText);
369
318
  }
370
319
  return responseJson;
371
320
  }
372
321
  catch (error) {
373
- console_1.default.error("Error calling terminate workflow API:", error);
322
+ console.error("Error calling terminate workflow API:", error);
374
323
  if (error instanceof Error) {
375
324
  throw new Error(`Failed to terminate workflow: ${error.message}`);
376
325
  }
@@ -419,7 +368,7 @@ class GraphCompose {
419
368
  this.ensureBuildersFinalized("execute workflow (async)");
420
369
  const validationResult = this.validate();
421
370
  if (!validationResult.isValid) {
422
- console_1.default.error("Workflow validation failed:", validationResult.errors);
371
+ console.error("Workflow validation failed:", validationResult.errors);
423
372
  throw new Error(`Workflow validation failed: ${validationResult.errors.map((e) => e.message).join(", ")}`);
424
373
  }
425
374
  const workflow = this.getWorkflow();
@@ -451,55 +400,7 @@ class GraphCompose {
451
400
  return (await response.json());
452
401
  }
453
402
  catch (error) {
454
- console_1.default.error("Error initiating async workflow execution:", error);
455
- throw error;
456
- }
457
- }
458
- /**
459
- * Execute the workflow synchronously and wait for completion.
460
- * **Note:** Requires all active builders to be finalized using `.end()`.
461
- *
462
- * @param options Execution options including webhook URL and context
463
- * @returns Promise resolving to the full API response containing the final workflow details (status, results, error) upon completion or failure.
464
- * @throws {Error} If a node or tool is currently being built (missing `.end()`).
465
- */
466
- async executeSync(options = {}) {
467
- this.ensureBuildersFinalized("execute workflow (sync)");
468
- const validationResult = this.validate();
469
- if (!validationResult.isValid) {
470
- console_1.default.error("Workflow validation failed:", validationResult.errors);
471
- throw new Error(`Workflow validation failed: ${validationResult.errors.map((e) => e.message).join(", ")}`);
472
- }
473
- const workflow = this.getWorkflow();
474
- const executionContext = { ...this.context, ...options.context };
475
- const requestBody = {
476
- ...workflow,
477
- context: executionContext,
478
- webhookUrl: options.webhookUrl || this.webhookUrl,
479
- };
480
- try {
481
- const response = await fetch(`${this.baseUrl}/workflows/execute-sync`, {
482
- method: "POST",
483
- headers: {
484
- "Content-Type": "application/json",
485
- Authorization: `Bearer ${this.token}`,
486
- },
487
- body: JSON.stringify(requestBody),
488
- });
489
- if (!response.ok) {
490
- let errorBody;
491
- try {
492
- errorBody = await response.json();
493
- }
494
- catch (e) {
495
- errorBody = await response.text();
496
- }
497
- throw new Error(`HTTP Error: ${response.status} ${response.statusText}. Body: ${JSON.stringify(errorBody)}`);
498
- }
499
- return (await response.json());
500
- }
501
- catch (error) {
502
- console_1.default.error("Error executing sync workflow:", error);
403
+ console.error("Error initiating async workflow execution:", error);
503
404
  throw error;
504
405
  }
505
406
  }
@@ -1 +1 @@
1
- {"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/core/builder.ts"],"names":[],"mappings":";;;;;;AACA,sDAA8B;AAS9B,8CAAiD;AACjD,iDAA6C;AAC7C,iDAA6C;AAoB7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAa,YAAY;IAWvB;;;;;OAKG;IACH,YAAY,UAA+B,EAAE;QAhBrC,UAAK,GAAW,EAAE,CAAC;QACnB,WAAM,GAAe,EAAE,CAAC;QAgB9B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,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AAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACpC,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACpC,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,eAAe,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,WAAW,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAC5F,CAAC;YACJ,CAAC;YACD,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAyC,CAAC;QACzE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,KAAK,CAAC,CAAC;YACnE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAGD;;;;;;;OAOG;IACH,cAAc,CAAC,GAAW;QACxB,IAAI,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;QAChD,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,MAAsB;QACvC,IAAI,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,CAAC;QACpD,IAAI,CAAC,cAAc,GAAG,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA3bD,oCA2bC"}
@@ -1,25 +1,26 @@
1
- import { ActivityConfig, AgentNode, ErrorBoundaryNode, HttpNode, JsonataParam, Node, NodeConditions } from "@graph-compose/core";
1
+ import { ActivityConfig, ErrorBoundaryNode, HttpNode, JsonataParam, NodeConditions } from "@graph-compose/core";
2
2
  import { z } from "zod";
3
+ import { AbstractNodeBuilder } from "./base-builder";
3
4
  import { GraphCompose } from "./builder";
4
5
  /**
5
6
  * Fluent API for configuring individual nodes within a GraphCompose workflow.
6
7
  * Chain configuration methods (e.g., `.get()`, `.withHeaders()`, `.withDependencies()`).
7
8
  * Call `.end()` to finalize the node definition and add it to the graph.
9
+ *
10
+ * Extends AbstractNodeBuilder to inherit common builder functionality.
8
11
  */
9
- export declare class NodeBuilder {
10
- private readonly graph;
11
- protected node: HttpNode | ErrorBoundaryNode | AgentNode;
12
+ export declare class NodeBuilder extends AbstractNodeBuilder<HttpNode | ErrorBoundaryNode> {
13
+ protected node: HttpNode | ErrorBoundaryNode;
12
14
  private isHttpNode;
13
- private isAgentNode;
14
- private readonly id;
15
+ private isErrorBoundaryNode;
15
16
  /**
16
17
  * Creates an instance of NodeBuilder.
17
18
  * @param graph The parent GraphCompose instance.
18
19
  * @param id The unique identifier for the node.
19
- * @param type The type of the node ('http', 'error_boundary', 'agent'). Defaults to 'http'.
20
+ * @param type The type of the node ('http' or 'error_boundary'). Defaults to 'http'.
20
21
  * @param protectedNodes Optional array of node IDs to protect if type is 'error_boundary'.
21
22
  */
22
- constructor(graph: GraphCompose, id: string, type?: "http" | "error_boundary" | "agent", protectedNodes?: string[]);
23
+ constructor(graph: GraphCompose, id: string, type?: "http" | "error_boundary", protectedNodes?: string[]);
23
24
  /**
24
25
  * Validates a JSONata expression within the context of the current node.
25
26
  * @param expression The JSONata expression string to validate.
@@ -31,12 +32,14 @@ export declare class NodeBuilder {
31
32
  * Sets the HTTP method to GET and specifies the URL for the node.
32
33
  * @param url The URL endpoint for the GET request.
33
34
  * @returns The NodeBuilder instance for chaining.
35
+ * @throws {Error} If called on a non-HTTP node.
34
36
  */
35
37
  get(url: string): NodeBuilder;
36
38
  /**
37
39
  * Sets the HTTP method to POST and specifies the URL for the node.
38
40
  * @param url The URL endpoint for the POST request.
39
41
  * @returns The NodeBuilder instance for chaining.
42
+ * @throws {Error} If called on a non-HTTP node.
40
43
  */
41
44
  post(url: string): NodeBuilder;
42
45
  /**
@@ -106,7 +109,7 @@ export declare class NodeBuilder {
106
109
  /**
107
110
  * Specifies the nodes that this node depends on.
108
111
  * The node will only execute after all its dependencies have successfully completed.
109
- * Applicable only to HTTP and agent nodes.
112
+ * Applicable to HTTP and agent nodes.
110
113
  * @param nodeIds An array of node IDs that this node depends on.
111
114
  * @returns The NodeBuilder instance for chaining.
112
115
  * @throws {Error} If called on a non-HTTP or non-agent node.
@@ -124,57 +127,10 @@ export declare class NodeBuilder {
124
127
  output?: z.ZodType<any>;
125
128
  }): NodeBuilder;
126
129
  /**
127
- * Set the maximum number of iterations for an agent node.
128
- * An agent runs until it returns a completion schema response.
129
- * You are responsible for ensuring the agent returns a `complete` response before this limit.
130
- * If the agent reaches the max iterations without completing, it will fail.
131
- *
132
- * @default 5
133
- * @param maxIterations Must be greater than 0
134
- * @throws {Error} If called on a non-agent node
135
- * @throws {ValidationError} If maxIterations is less than 1
136
- */
137
- withMaxIterations(maxIterations: number): NodeBuilder;
138
- /**
139
- * Set the tools available to the agent.
140
- * Tools must be defined in the global tools section of the workflow.
141
- * Each tool name must be unique within the workflow and have no dashes or spaces.
142
- *
143
- * @param tools Array of tool names that the agent can use
144
- * @throws {Error} If called on a non-agent node
145
- * @throws {ValidationError} If any tool is not found in global tools
146
- */
147
- withTools(tools: string[]): NodeBuilder;
148
- /**
149
- * Add a single tool to the agent's available tools.
150
- * The tool must be defined in the global tools section of the workflow.
151
- * The tool name must be unique within the workflow and have no dashes or spaces.
152
- *
153
- * @param tool Name of the tool to add
154
- * @throws {Error} If called on a non-agent node
155
- * @throws {ValidationError} If the tool is not found in global tools
156
- */
157
- addTool(tool: string): NodeBuilder;
158
- /**
159
- * Finalizes the node configuration and adds it to the parent GraphCompose builder.
160
- * This method MUST be called to complete the node definition.
161
- *
162
- * @returns The parent GraphCompose instance, allowing for further chaining on the main graph.
163
- */
164
- end(): GraphCompose;
165
- /**
166
- * @internal
167
- * Retrieves the fully configured node object.
168
- * This method is intended for internal use by the GraphCompose builder.
169
- * @returns The configured Node object.
170
- */
171
- build(): Node;
172
- /**
130
+ * Builds the final node configuration.
131
+ * Called internally by the base class when end() is invoked.
173
132
  * @internal
174
- * Retrieves the ID of the node being built.
175
- * Used for generating informative error messages.
176
- * @returns The ID of the node.
177
133
  */
178
- getId(): string;
134
+ build(): HttpNode | ErrorBoundaryNode;
179
135
  }
180
136
  //# sourceMappingURL=node-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-builder.d.ts","sourceRoot":"","sources":["../../src/core/node-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,IAAI,EACJ,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;GAIG;AACH,qBAAa,WAAW;IAgBpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAfxB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,iBAAiB,GAAG,SAAS,CAAC;IACzD,OAAO,CAAC,UAAU,CAAU;IAC5B,OAAO,CAAC,WAAW,CAAU;IAG7B,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAS;IAE5B;;;;;;OAMG;gBAEgB,KAAK,EAAE,YAAY,EACpC,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,MAAM,GAAG,gBAAgB,GAAG,OAAgB,EAClD,cAAc,CAAC,EAAE,MAAM,EAAE;IA8C3B;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;IAajC;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAM7B;;;;OAIG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAM9B;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAM7B;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAMhC;;;;OAIG;IACH,KAAK,CA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