@graph-compose/core 1.0.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 (155) hide show
  1. package/README.md +323 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +24 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/tsconfig.tsbuildinfo +1 -0
  7. package/dist/types/behaviors/conditions.d.ts +54 -0
  8. package/dist/types/behaviors/conditions.d.ts.map +1 -0
  9. package/dist/types/behaviors/conditions.js +103 -0
  10. package/dist/types/behaviors/conditions.js.map +1 -0
  11. package/dist/types/behaviors/index.d.ts +3 -0
  12. package/dist/types/behaviors/index.d.ts.map +1 -0
  13. package/dist/types/behaviors/index.js +19 -0
  14. package/dist/types/behaviors/index.js.map +1 -0
  15. package/dist/types/behaviors/notifications.d.ts +157 -0
  16. package/dist/types/behaviors/notifications.d.ts.map +1 -0
  17. package/dist/types/behaviors/notifications.js +89 -0
  18. package/dist/types/behaviors/notifications.js.map +1 -0
  19. package/dist/types/config/activity.d.ts +58 -0
  20. package/dist/types/config/activity.d.ts.map +1 -0
  21. package/dist/types/config/activity.js +53 -0
  22. package/dist/types/config/activity.js.map +1 -0
  23. package/dist/types/config/http.d.ts +20 -0
  24. package/dist/types/config/http.d.ts.map +1 -0
  25. package/dist/types/config/http.js +66 -0
  26. package/dist/types/config/http.js.map +1 -0
  27. package/dist/types/config/index.d.ts +5 -0
  28. package/dist/types/config/index.d.ts.map +1 -0
  29. package/dist/types/config/index.js +21 -0
  30. package/dist/types/config/index.js.map +1 -0
  31. package/dist/types/config/protocols.d.ts +3 -0
  32. package/dist/types/config/protocols.d.ts.map +1 -0
  33. package/dist/types/config/protocols.js +14 -0
  34. package/dist/types/config/protocols.js.map +1 -0
  35. package/dist/types/config/workflow.d.ts +10 -0
  36. package/dist/types/config/workflow.d.ts.map +1 -0
  37. package/dist/types/config/workflow.js +12 -0
  38. package/dist/types/config/workflow.js.map +1 -0
  39. package/dist/types/context/index.d.ts +4 -0
  40. package/dist/types/context/index.d.ts.map +1 -0
  41. package/dist/types/context/index.js +8 -0
  42. package/dist/types/context/index.js.map +1 -0
  43. package/dist/types/contracts/agents.d.ts +87 -0
  44. package/dist/types/contracts/agents.d.ts.map +1 -0
  45. package/dist/types/contracts/agents.js +94 -0
  46. package/dist/types/contracts/agents.js.map +1 -0
  47. package/dist/types/contracts/index.d.ts +3 -0
  48. package/dist/types/contracts/index.d.ts.map +1 -0
  49. package/dist/types/contracts/index.js +19 -0
  50. package/dist/types/contracts/index.js.map +1 -0
  51. package/dist/types/contracts/tools.d.ts +72 -0
  52. package/dist/types/contracts/tools.d.ts.map +1 -0
  53. package/dist/types/contracts/tools.js +101 -0
  54. package/dist/types/contracts/tools.js.map +1 -0
  55. package/dist/types/index.d.ts +10 -0
  56. package/dist/types/index.d.ts.map +1 -0
  57. package/dist/types/index.js +26 -0
  58. package/dist/types/index.js.map +1 -0
  59. package/dist/types/nodes/agents.d.ts +149 -0
  60. package/dist/types/nodes/agents.d.ts.map +1 -0
  61. package/dist/types/nodes/agents.js +48 -0
  62. package/dist/types/nodes/agents.js.map +1 -0
  63. package/dist/types/nodes/common/base-node-schema.d.ts +109 -0
  64. package/dist/types/nodes/common/base-node-schema.d.ts.map +1 -0
  65. package/dist/types/nodes/common/base-node-schema.js +55 -0
  66. package/dist/types/nodes/common/base-node-schema.js.map +1 -0
  67. package/dist/types/nodes/common/index.d.ts +2 -0
  68. package/dist/types/nodes/common/index.d.ts.map +1 -0
  69. package/dist/types/nodes/common/index.js +18 -0
  70. package/dist/types/nodes/common/index.js.map +1 -0
  71. package/dist/types/nodes/destination.d.ts +148 -0
  72. package/dist/types/nodes/destination.d.ts.map +1 -0
  73. package/dist/types/nodes/destination.js +30 -0
  74. package/dist/types/nodes/destination.js.map +1 -0
  75. package/dist/types/nodes/error-boundary.d.ts +126 -0
  76. package/dist/types/nodes/error-boundary.d.ts.map +1 -0
  77. package/dist/types/nodes/error-boundary.js +24 -0
  78. package/dist/types/nodes/error-boundary.js.map +1 -0
  79. package/dist/types/nodes/http.d.ts +194 -0
  80. package/dist/types/nodes/http.d.ts.map +1 -0
  81. package/dist/types/nodes/http.js +28 -0
  82. package/dist/types/nodes/http.js.map +1 -0
  83. package/dist/types/nodes/index.d.ts +734 -0
  84. package/dist/types/nodes/index.d.ts.map +1 -0
  85. package/dist/types/nodes/index.js +48 -0
  86. package/dist/types/nodes/index.js.map +1 -0
  87. package/dist/types/nodes/iterator.d.ts +126 -0
  88. package/dist/types/nodes/iterator.d.ts.map +1 -0
  89. package/dist/types/nodes/iterator.js +21 -0
  90. package/dist/types/nodes/iterator.js.map +1 -0
  91. package/dist/types/nodes/tools.d.ts +1321 -0
  92. package/dist/types/nodes/tools.d.ts.map +1 -0
  93. package/dist/types/nodes/tools.js +65 -0
  94. package/dist/types/nodes/tools.js.map +1 -0
  95. package/dist/types/primitives/index.d.ts +2 -0
  96. package/dist/types/primitives/index.d.ts.map +1 -0
  97. package/dist/types/primitives/index.js +18 -0
  98. package/dist/types/primitives/index.js.map +1 -0
  99. package/dist/types/primitives/shared.d.ts +21 -0
  100. package/dist/types/primitives/shared.d.ts.map +1 -0
  101. package/dist/types/primitives/shared.js +113 -0
  102. package/dist/types/primitives/shared.js.map +1 -0
  103. package/dist/types/results/agent.d.ts +156 -0
  104. package/dist/types/results/agent.d.ts.map +1 -0
  105. package/dist/types/results/agent.js +54 -0
  106. package/dist/types/results/agent.js.map +1 -0
  107. package/dist/types/results/base.d.ts +4 -0
  108. package/dist/types/results/base.d.ts.map +1 -0
  109. package/dist/types/results/base.js +12 -0
  110. package/dist/types/results/base.js.map +1 -0
  111. package/dist/types/results/index.d.ts +7 -0
  112. package/dist/types/results/index.d.ts.map +1 -0
  113. package/dist/types/results/index.js +23 -0
  114. package/dist/types/results/index.js.map +1 -0
  115. package/dist/types/results/node.d.ts +38 -0
  116. package/dist/types/results/node.d.ts.map +1 -0
  117. package/dist/types/results/node.js +26 -0
  118. package/dist/types/results/node.js.map +1 -0
  119. package/dist/types/results/shared.d.ts +36 -0
  120. package/dist/types/results/shared.d.ts.map +1 -0
  121. package/dist/types/results/shared.js +31 -0
  122. package/dist/types/results/shared.js.map +1 -0
  123. package/dist/types/results/source.d.ts +53 -0
  124. package/dist/types/results/source.d.ts.map +1 -0
  125. package/dist/types/results/source.js +64 -0
  126. package/dist/types/results/source.js.map +1 -0
  127. package/dist/types/results/tool.d.ts +170 -0
  128. package/dist/types/results/tool.d.ts.map +1 -0
  129. package/dist/types/results/tool.js +110 -0
  130. package/dist/types/results/tool.js.map +1 -0
  131. package/dist/types/state/index.d.ts +2 -0
  132. package/dist/types/state/index.d.ts.map +1 -0
  133. package/dist/types/state/index.js +18 -0
  134. package/dist/types/state/index.js.map +1 -0
  135. package/dist/types/state/workflow-state.d.ts +63 -0
  136. package/dist/types/state/workflow-state.d.ts.map +1 -0
  137. package/dist/types/state/workflow-state.js +52 -0
  138. package/dist/types/state/workflow-state.js.map +1 -0
  139. package/dist/types/validation/schema.d.ts +14 -0
  140. package/dist/types/validation/schema.d.ts.map +1 -0
  141. package/dist/types/validation/schema.js +37 -0
  142. package/dist/types/validation/schema.js.map +1 -0
  143. package/dist/types/workflow.d.ts +2179 -0
  144. package/dist/types/workflow.d.ts.map +1 -0
  145. package/dist/types/workflow.js +132 -0
  146. package/dist/types/workflow.js.map +1 -0
  147. package/dist/utils/index.d.ts +2 -0
  148. package/dist/utils/index.d.ts.map +1 -0
  149. package/dist/utils/index.js +18 -0
  150. package/dist/utils/index.js.map +1 -0
  151. package/dist/utils/template/index.d.ts +39 -0
  152. package/dist/utils/template/index.d.ts.map +1 -0
  153. package/dist/utils/template/index.js +151 -0
  154. package/dist/utils/template/index.js.map +1 -0
  155. package/package.json +73 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/types/nodes/tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQvB,CAAC;AACL,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolNodeSchema = exports.GraphToolSchema = exports.GraphNodeSchema = exports.GraphNodeTypeSchema = exports.HttpToolSchema = exports.BaseToolSchema = void 0;
4
+ // Remove import from index
5
+ // import { NodeSchema } from ".";
6
+ // Import directly from specific files
7
+ const zod_1 = require("zod");
8
+ const config_1 = require("../config");
9
+ const http_1 = require("../config/http");
10
+ const http_2 = require("./http");
11
+ // Base tool configuration
12
+ exports.BaseToolSchema = zod_1.z.object({
13
+ id: zod_1.z.string().openapi({
14
+ description: "A unique identifier for this tool within the workflow's tool collection.",
15
+ example: "get_weather_api_tool",
16
+ }),
17
+ description: zod_1.z.string().optional().openapi({
18
+ description: "An optional description of the tool's purpose, used by the Agent to decide when to use it.",
19
+ example: "Fetches the current weather for a given location.",
20
+ }),
21
+ type: zod_1.z.enum(["http", "graph"]).openapi({
22
+ description: "The type of tool - either a single HTTP endpoint or a graph of nodes",
23
+ }),
24
+ activityConfig: config_1.ActivityConfigSchema.optional(),
25
+ });
26
+ // HTTP-based tool (current implementation)
27
+ exports.HttpToolSchema = exports.BaseToolSchema.extend({
28
+ type: zod_1.z.literal("http"),
29
+ http: http_1.HTTPConfigSchema,
30
+ }).openapi({
31
+ ref: "HttpTool",
32
+ description: "Defines a tool that makes a single HTTP request. \n\nTools are used by Agent nodes to interact with external services or perform specific actions. They are defined separately (e.g., under a dedicated 'tools' key) so they can be called by multiple agents. \n\nNote: The structure of an HTTP Tool is very similar to a standard HTTP Node.",
33
+ "x-tags": ["Tools"],
34
+ });
35
+ // First, define what types of nodes can be in a graph tool
36
+ exports.GraphNodeTypeSchema = zod_1.z.enum(["http"]).openapi({
37
+ description: "The types of nodes that can be included in a graph tool",
38
+ });
39
+ // Define the node reference schema
40
+ exports.GraphNodeSchema = http_2.HttpNodeSchema.openapi({
41
+ ref: "GraphNode",
42
+ description: "A reference to a node within a graph tool",
43
+ });
44
+ // Update the GraphToolSchema to use the simpler node reference
45
+ exports.GraphToolSchema = exports.BaseToolSchema.extend({
46
+ type: zod_1.z.literal("graph"),
47
+ graph: zod_1.z.object({
48
+ nodes: zod_1.z.array(exports.GraphNodeSchema),
49
+ context: zod_1.z.record(zod_1.z.any()).optional(),
50
+ }),
51
+ }).openapi({
52
+ ref: "GraphTool",
53
+ description: "Defines a tool composed of multiple connected steps (a sub-graph). \n\nTools are used by Agent nodes to perform multi-step operations. They are defined separately (e.g., under a dedicated 'tools' key) so they can be called by multiple agents. \n\nNote: The nodes within a Graph Tool are structured similarly to standard workflow nodes.",
54
+ "x-tags": ["Tools"],
55
+ });
56
+ // Combined tool schema using discriminated union
57
+ exports.ToolNodeSchema = zod_1.z
58
+ .discriminatedUnion("type", [exports.HttpToolSchema, exports.GraphToolSchema])
59
+ .openapi({
60
+ ref: "ToolNode",
61
+ title: "ToolNode",
62
+ description: "Represents a collection of available tools (HTTP or Graph-based) that can be invoked by Agent nodes within the workflow. \n\nTools are defined separately (e.g., under a dedicated 'tools' key) so they can potentially be called by multiple different agents. Note that individual tools are structured very similarly to standard nodes (like HTTP nodes). \n\nThis collection can be left empty if no agents requiring tools are present in the workflow.",
63
+ "x-tags": ["Tools"],
64
+ });
65
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../src/types/nodes/tools.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AAC3B,kCAAkC;AAClC,sCAAsC;AACtC,6BAAwB;AACxB,sCAAiD;AACjD,yCAAkD;AAClD,iCAAwC;AAExC,0BAA0B;AACb,QAAA,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;QACrB,WAAW,EACT,0EAA0E;QAC5E,OAAO,EAAE,sBAAsB;KAChC,CAAC;IACF,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;QACzC,WAAW,EACT,4FAA4F;QAC9F,OAAO,EAAE,mDAAmD;KAC7D,CAAC;IACF,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QACtC,WAAW,EACT,sEAAsE;KACzE,CAAC;IACF,cAAc,EAAE,6BAAoB,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAEH,2CAA2C;AAC9B,QAAA,cAAc,GAAG,sBAAc,CAAC,MAAM,CAAC;IAClD,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,IAAI,EAAE,uBAAgB;CACvB,CAAC,CAAC,OAAO,CAAC;IACT,GAAG,EAAE,UAAU;IACf,WAAW,EACT,iVAAiV;IACnV,QAAQ,EAAE,CAAC,OAAO,CAAC;CACpB,CAAC,CAAC;AAEH,2DAA2D;AAC9C,QAAA,mBAAmB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAC1D,WAAW,EAAE,yDAAyD;CACvE,CAAC,CAAC;AAEH,mCAAmC;AACtB,QAAA,eAAe,GAAG,qBAAc,CAAC,OAAO,CAAC;IACpD,GAAG,EAAE,WAAW;IAChB,WAAW,EAAE,2CAA2C;CACzD,CAAC,CAAC;AAEH,+DAA+D;AAClD,QAAA,eAAe,GAAG,sBAAc,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,uBAAe,CAAC;QAC/B,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;KACtC,CAAC;CACH,CAAC,CAAC,OAAO,CAAC;IACT,GAAG,EAAE,WAAW;IAChB,WAAW,EACT,iVAAiV;IACnV,QAAQ,EAAE,CAAC,OAAO,CAAC;CACpB,CAAC,CAAC;AAEH,iDAAiD;AACpC,QAAA,cAAc,GAAG,OAAC;KAC5B,kBAAkB,CAAC,MAAM,EAAE,CAAC,sBAAc,EAAE,uBAAe,CAAC,CAAC;KAC7D,OAAO,CAAC;IACP,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,WAAW,EACT,+bAA+b;IACjc,QAAQ,EAAE,CAAC,OAAO,CAAC;CACpB,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./shared";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/primitives/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./shared"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/primitives/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB"}
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ export declare const TemplatedStringSchema: z.ZodEffects<z.ZodString, string, string>;
3
+ export declare const JsonataObjectSchema: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodEffects<z.ZodString, string, string>]>;
4
+ export type JsonataObject = z.infer<typeof JsonataObjectSchema>;
5
+ export declare const JsonataExpressionSchema: z.ZodString;
6
+ export type JsonataExpression = z.infer<typeof JsonataExpressionSchema>;
7
+ export declare const JsonataParamSchema: z.ZodRecord<z.ZodString, z.ZodString>;
8
+ export type JsonataParam = z.infer<typeof JsonataParamSchema>;
9
+ export declare const durationRegex: RegExp;
10
+ export declare const DurationSchema: z.ZodEffects<z.ZodString, string, string>;
11
+ export type Duration = z.infer<typeof DurationSchema>;
12
+ interface DurationBounds {
13
+ min?: string;
14
+ max?: string;
15
+ }
16
+ /**
17
+ * Factory function to create a Zod schema for duration string with optional min/max bounds.
18
+ */
19
+ export declare function createBoundedDurationSchema({ min, max, }?: DurationBounds): z.ZodEffects<typeof DurationSchema, Duration, Duration>;
20
+ export {};
21
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/types/primitives/shared.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB,2CAO7B,CAAC;AAGN,eAAO,MAAM,mBAAmB,6FAG9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,uBAAuB,aAGlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,kBAAkB,uCAAgD,CAAC;AAEhF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,eAAO,MAAM,aAAa,QACmG,CAAC;AAwB9H,eAAO,MAAM,cAAc,2CAqBvB,CAAC;AAEL,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,UAAU,cAAc;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,GAAG,EACH,GAAG,GACJ,GAAE,cAAmB,GAAG,CAAC,CAAC,UAAU,CACnC,OAAO,cAAc,EACrB,QAAQ,EACR,QAAQ,CACT,CA+CA"}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DurationSchema = exports.durationRegex = exports.JsonataParamSchema = exports.JsonataExpressionSchema = exports.JsonataObjectSchema = exports.TemplatedStringSchema = void 0;
7
+ exports.createBoundedDurationSchema = createBoundedDurationSchema;
8
+ const ms_1 = __importDefault(require("ms"));
9
+ const zod_1 = require("zod");
10
+ const template_1 = require("../../utils/template");
11
+ // Schema for strings that must contain JSONata expressions
12
+ exports.TemplatedStringSchema = zod_1.z
13
+ .string()
14
+ .regex(/.*\{\{.*\}\}.*/, {
15
+ message: "String must contain a JSONata expression wrapped in {{ }}",
16
+ })
17
+ .refine(template_1.validateTemplateExpression, val => ({
18
+ message: `Invalid JSONata template expression in: ${val}`,
19
+ }));
20
+ // Updated to require template expressions in strings
21
+ exports.JsonataObjectSchema = zod_1.z.union([
22
+ zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
23
+ exports.TemplatedStringSchema,
24
+ ]);
25
+ exports.JsonataExpressionSchema = zod_1.z.string().regex(/^\{\{(.*)\}\}$/, {
26
+ message: "Expression must be wrapped in double curly braces (e.g. '{{your.expression}}')",
27
+ });
28
+ exports.JsonataParamSchema = zod_1.z.record(zod_1.z.string(), exports.JsonataExpressionSchema);
29
+ // Regex to validate duration strings like "1s", "5 minutes", "2.5hrs"
30
+ // This is kept for basic string format check before passing to ms()
31
+ exports.durationRegex = /^(\d*\.?\d+)\s*(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;
32
+ // Helper to convert a pre-validated duration string to milliseconds
33
+ // It assumes the input string format is already validated by DurationSchema
34
+ function durationStringToMs(duration) {
35
+ try {
36
+ // Use ms() which is robust. We expect it to succeed here.
37
+ const valueMs = (0, ms_1.default)(duration);
38
+ if (typeof valueMs !== "number" || valueMs < 0) {
39
+ // Should ideally not happen if schema validation works
40
+ return null;
41
+ }
42
+ return valueMs;
43
+ }
44
+ catch (error) {
45
+ // Should not happen if the schema validation catches format errors
46
+ console.error(`Error parsing already validated duration string: ${duration}`, error);
47
+ return null;
48
+ }
49
+ }
50
+ // Base schema for duration string, validates format using 'ms' logic
51
+ exports.DurationSchema = zod_1.z
52
+ .string()
53
+ .refine((value) => {
54
+ try {
55
+ const result = (0, ms_1.default)(value);
56
+ // Ensure ms() returned a non-negative number
57
+ return typeof result === "number" && result >= 0;
58
+ }
59
+ catch {
60
+ return false; // ms() throws on invalid format
61
+ }
62
+ }, {
63
+ message: "Invalid duration format. Must be a string parseable by 'ms' (e.g., '30s', '5m', '1h').",
64
+ })
65
+ .openapi({
66
+ description: "Duration as a string parseable by the 'ms' library (e.g., '30 seconds', '5 minutes', '1 day')",
67
+ example: "5 minutes",
68
+ });
69
+ /**
70
+ * Factory function to create a Zod schema for duration string with optional min/max bounds.
71
+ */
72
+ function createBoundedDurationSchema({ min, max, } = {}) {
73
+ // Pre-parse and validate bounds during schema creation
74
+ const minMs = min ? durationStringToMs(min) : null;
75
+ const maxMs = max ? durationStringToMs(max) : null;
76
+ if (min && minMs === null) {
77
+ throw new Error(`Invalid minimum duration format: ${min}`);
78
+ }
79
+ if (max && maxMs === null) {
80
+ throw new Error(`Invalid maximum duration format: ${max}`);
81
+ }
82
+ if (minMs !== null && maxMs !== null && minMs > maxMs) {
83
+ throw new Error(`Minimum duration (${min}) cannot be greater than maximum duration (${max})`);
84
+ }
85
+ // Refine the base string schema which already guarantees valid format
86
+ return exports.DurationSchema.refine(value => {
87
+ const valueMs = durationStringToMs(value);
88
+ // Format is already valid due to base schema, just check bounds
89
+ if (valueMs === null)
90
+ return false; // Should not happen, defensive check
91
+ if (minMs !== null && valueMs < minMs)
92
+ return false;
93
+ if (maxMs !== null && valueMs > maxMs)
94
+ return false;
95
+ return true;
96
+ }, value => {
97
+ // Constructing the error message based on which bound was violated
98
+ const valueMs = durationStringToMs(value);
99
+ let message = "Duration is out of bounds."; // Default/fallback
100
+ if (minMs !== null && valueMs !== null && valueMs < minMs) {
101
+ message = `Duration must be at least ${min}.`;
102
+ }
103
+ if (maxMs !== null && valueMs !== null && valueMs > maxMs) {
104
+ message = `Duration must be no more than ${max}.`;
105
+ }
106
+ return { message };
107
+ }).openapi({
108
+ // Update OpenAPI description for the bounded schema
109
+ description: `Duration as a string. ${min ? `Min: ${min}.` : ""} ${max ? `Max: ${max}.` : ""}`.trim(),
110
+ example: min ?? max ?? "30s",
111
+ });
112
+ }
113
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/types/primitives/shared.ts"],"names":[],"mappings":";;;;;;AA6FA,kEAsDC;AAnJD,4CAAoB;AACpB,6BAAwB;AACxB,mDAAkE;AAElE,2DAA2D;AAC9C,QAAA,qBAAqB,GAAG,OAAC;KACnC,MAAM,EAAE;KACR,KAAK,CAAC,gBAAgB,EAAE;IACvB,OAAO,EAAE,2DAA2D;CACrE,CAAC;KACD,MAAM,CAAC,qCAA0B,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IAC1C,OAAO,EAAE,2CAA2C,GAAG,EAAE;CAC1D,CAAC,CAAC,CAAC;AAEN,qDAAqD;AACxC,QAAA,mBAAmB,GAAG,OAAC,CAAC,KAAK,CAAC;IACzC,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC;IAC7B,6BAAqB;CACtB,CAAC,CAAC;AAIU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,EAAE;IACxE,OAAO,EACL,gFAAgF;CACnF,CAAC,CAAC;AAIU,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,+BAAuB,CAAC,CAAC;AAIhF,sEAAsE;AACtE,oEAAoE;AACvD,QAAA,aAAa,GACxB,2HAA2H,CAAC;AAE9H,oEAAoE;AACpE,4EAA4E;AAC5E,SAAS,kBAAkB,CAAC,QAAgB;IAC1C,I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,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC,CACF,CAAC,OAAO,CAAC;QACR,oDAAoD;QACpD,WAAW,EACT,yBAAyB,GAAG,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE;QAC1F,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,KAAK;KAC7B,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,156 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Schema for the payload sent in the body of an agent request
4
+ */
5
+ export declare const AgentRequestPayloadSchema: z.ZodObject<{
6
+ agentId: z.ZodString;
7
+ iteration: z.ZodNumber;
8
+ toolCalls: z.ZodArray<z.ZodObject<{
9
+ toolId: z.ZodString;
10
+ agentIterationNumber: z.ZodNumber;
11
+ toolPayload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
12
+ allResults: z.ZodObject<{
13
+ context: z.ZodRecord<z.ZodString, z.ZodAny>;
14
+ results: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
15
+ httpStatuses: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ context: Record<string, any>;
18
+ results: Record<string, any>;
19
+ httpStatuses: Record<string, any>;
20
+ }, {
21
+ context: Record<string, any>;
22
+ results?: Record<string, any> | undefined;
23
+ httpStatuses?: Record<string, any> | undefined;
24
+ }>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ toolId: string;
27
+ agentIterationNumber: number;
28
+ toolPayload: Record<string, unknown>;
29
+ allResults: {
30
+ context: Record<string, any>;
31
+ results: Record<string, any>;
32
+ httpStatuses: Record<string, any>;
33
+ };
34
+ }, {
35
+ toolId: string;
36
+ agentIterationNumber: number;
37
+ toolPayload: Record<string, unknown>;
38
+ allResults: {
39
+ context: Record<string, any>;
40
+ results?: Record<string, any> | undefined;
41
+ httpStatuses?: Record<string, any> | undefined;
42
+ };
43
+ }>, "many">;
44
+ toolResults: z.ZodArray<z.ZodObject<{
45
+ toolId: z.ZodString;
46
+ success: z.ZodBoolean;
47
+ result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
48
+ timestamp: z.ZodNumber;
49
+ error: z.ZodOptional<z.ZodObject<{
50
+ code: z.ZodNumber;
51
+ message: z.ZodString;
52
+ details: z.ZodRecord<z.ZodString, z.ZodUnknown>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ code: number;
55
+ message: string;
56
+ details: Record<string, unknown>;
57
+ }, {
58
+ code: number;
59
+ message: string;
60
+ details: Record<string, unknown>;
61
+ }>>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ toolId: string;
64
+ success: boolean;
65
+ result: Record<string, unknown> | null;
66
+ timestamp: number;
67
+ error?: {
68
+ code: number;
69
+ message: string;
70
+ details: Record<string, unknown>;
71
+ } | undefined;
72
+ }, {
73
+ toolId: string;
74
+ success: boolean;
75
+ result: Record<string, unknown> | null;
76
+ timestamp: number;
77
+ error?: {
78
+ code: number;
79
+ message: string;
80
+ details: Record<string, unknown>;
81
+ } | undefined;
82
+ }>, "many">;
83
+ allResults: z.ZodObject<{
84
+ context: z.ZodRecord<z.ZodString, z.ZodAny>;
85
+ results: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
86
+ httpStatuses: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ context: Record<string, any>;
89
+ results: Record<string, any>;
90
+ httpStatuses: Record<string, any>;
91
+ }, {
92
+ context: Record<string, any>;
93
+ results?: Record<string, any> | undefined;
94
+ httpStatuses?: Record<string, any> | undefined;
95
+ }>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ agentId: string;
98
+ iteration: number;
99
+ allResults: {
100
+ context: Record<string, any>;
101
+ results: Record<string, any>;
102
+ httpStatuses: Record<string, any>;
103
+ };
104
+ toolCalls: {
105
+ toolId: string;
106
+ agentIterationNumber: number;
107
+ toolPayload: Record<string, unknown>;
108
+ allResults: {
109
+ context: Record<string, any>;
110
+ results: Record<string, any>;
111
+ httpStatuses: Record<string, any>;
112
+ };
113
+ }[];
114
+ toolResults: {
115
+ toolId: string;
116
+ success: boolean;
117
+ result: Record<string, unknown> | null;
118
+ timestamp: number;
119
+ error?: {
120
+ code: number;
121
+ message: string;
122
+ details: Record<string, unknown>;
123
+ } | undefined;
124
+ }[];
125
+ }, {
126
+ agentId: string;
127
+ iteration: number;
128
+ allResults: {
129
+ context: Record<string, any>;
130
+ results?: Record<string, any> | undefined;
131
+ httpStatuses?: Record<string, any> | undefined;
132
+ };
133
+ toolCalls: {
134
+ toolId: string;
135
+ agentIterationNumber: number;
136
+ toolPayload: Record<string, unknown>;
137
+ allResults: {
138
+ context: Record<string, any>;
139
+ results?: Record<string, any> | undefined;
140
+ httpStatuses?: Record<string, any> | undefined;
141
+ };
142
+ }[];
143
+ toolResults: {
144
+ toolId: string;
145
+ success: boolean;
146
+ result: Record<string, unknown> | null;
147
+ timestamp: number;
148
+ error?: {
149
+ code: number;
150
+ message: string;
151
+ details: Record<string, unknown>;
152
+ } | undefined;
153
+ }[];
154
+ }>;
155
+ export type AgentRequestPayload = z.infer<typeof AgentRequestPayloadSchema>;
156
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/types/results/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4ClC,CAAC;AAEL,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentRequestPayloadSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_1 = require("./shared");
6
+ const tool_1 = require("./tool");
7
+ /**
8
+ * Schema for the payload sent in the body of an agent request
9
+ */
10
+ exports.AgentRequestPayloadSchema = zod_1.z
11
+ .object({
12
+ agentId: zod_1.z.string().openapi({
13
+ description: "The ID of the agent",
14
+ example: "search_agent",
15
+ }),
16
+ iteration: zod_1.z.number().openapi({
17
+ description: "The number of iterations the agent has performed",
18
+ example: 3,
19
+ }),
20
+ toolCalls: zod_1.z.array(tool_1.ToolHttpRequestSchema).openapi({
21
+ description: "The tool calls that the agent has made",
22
+ example: [],
23
+ }),
24
+ toolResults: zod_1.z.array(tool_1.ToolResultSchema).openapi({
25
+ description: "The results of the tools that have been executed so far",
26
+ example: [],
27
+ }),
28
+ allResults: shared_1.WorkflowResultsSchema.openapi({
29
+ description: "The results of all the nodes and tools that have been executed so far",
30
+ example: {
31
+ context: {},
32
+ results: {},
33
+ httpStatuses: {},
34
+ },
35
+ }),
36
+ })
37
+ .openapi({
38
+ title: "Agent Request Payload",
39
+ description: `Request payload sent to an agent when it is invoked using POST. The agent will use this payload to determine what the next action is to take.
40
+
41
+ The agent must return a response that matches the AgentResponseContract.`,
42
+ example: {
43
+ agentId: "search_agent",
44
+ iteration: 1,
45
+ toolCalls: [],
46
+ toolResults: [],
47
+ allResults: {
48
+ context: {},
49
+ results: {},
50
+ httpStatuses: {},
51
+ },
52
+ },
53
+ });
54
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/types/results/agent.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,qCAAiD;AACjD,iCAAiE;AAEjE;;GAEG;AACU,QAAA,yBAAyB,GAAG,OAAC;KACvC,MAAM,CAAC;IACN,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;QAC1B,WAAW,EAAE,qBAAqB;QAClC,OAAO,EAAE,cAAc;KACxB,CAAC;IACF,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;QAC5B,WAAW,EAAE,kDAAkD;QAC/D,OAAO,EAAE,CAAC;KACX,CAAC;IACF,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,4BAAqB,CAAC,CAAC,OAAO,CAAC;QAChD,WAAW,EAAE,wCAAwC;QACrD,OAAO,EAAE,EAAE;KACZ,CAAC;IACF,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,uBAAgB,CAAC,CAAC,OAAO,CAAC;QAC7C,WAAW,EAAE,yDAAyD;QACtE,OAAO,EAAE,EAAE;KACZ,CAAC;IACF,UAAU,EAAE,8BAAqB,CAAC,OAAO,CAAC;QACxC,WAAW,EACT,uEAAuE;QACzE,OAAO,EAAE;YACP,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,EAAE;YACX,YAAY,EAAE,EAAE;SACjB;KACF,CAAC;CACH,CAAC;KACD,OAAO,CAAC;IACP,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE;;6EAE4D;IACzE,OAAO,EAAE;QACP,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,EAAE;QACf,UAAU,EAAE;YACV,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,EAAE;YACX,YAAY,EAAE,EAAE;SACjB;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+ export declare const HTTPNodeResultSchema: z.ZodAny;
3
+ export type HTTPNodeResult = z.infer<typeof HTTPNodeResultSchema>;
4
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/types/results/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB,UAM/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HTTPNodeResultSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.HTTPNodeResultSchema = zod_1.z.any().openapi({
6
+ description: "The resulting `data` or `text` returned from the HTTP call.",
7
+ example: {
8
+ order_id: 123,
9
+ status: "success",
10
+ },
11
+ });
12
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/types/results/base.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,oBAAoB,GAAG,OAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;IAClD,WAAW,EAAE,6DAA6D;IAC1E,OAAO,EAAE;QACP,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,SAAS;KAClB;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from "./agent";
2
+ export * from "./base";
3
+ export * from "./node";
4
+ export * from "./shared";
5
+ export * from "./source";
6
+ export * from "./tool";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/results/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./agent"), exports);
18
+ __exportStar(require("./base"), exports);
19
+ __exportStar(require("./node"), exports);
20
+ __exportStar(require("./shared"), exports);
21
+ __exportStar(require("./source"), exports);
22
+ __exportStar(require("./tool"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/results/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,yCAAuB;AACvB,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB"}
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import { HTTPNodeResult } from "./base";
3
+ import { AgentResult } from "./shared";
4
+ export declare const NodeResultSchema: z.ZodUnion<[z.ZodAny, z.ZodObject<{
5
+ iterations: z.ZodNumber;
6
+ result: z.ZodAny;
7
+ toolCalls: z.ZodArray<z.ZodAny, "many">;
8
+ toolResults: z.ZodArray<z.ZodAny, "many">;
9
+ error: z.ZodNullable<z.ZodString>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ error: string | null;
12
+ iterations: number;
13
+ toolCalls: any[];
14
+ toolResults: any[];
15
+ result?: any;
16
+ }, {
17
+ error: string | null;
18
+ iterations: number;
19
+ toolCalls: any[];
20
+ toolResults: any[];
21
+ result?: any;
22
+ }>]>;
23
+ export type NodeResult = {
24
+ result: HTTPNodeResult | AgentResult;
25
+ httpStatus: NodeHttpStatus;
26
+ };
27
+ export declare const NodeHttpStatusSchema: z.ZodNullable<z.ZodObject<{
28
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
29
+ statusCode: z.ZodNumber;
30
+ }, "strip", z.ZodTypeAny, {
31
+ headers: Record<string, string>;
32
+ statusCode: number;
33
+ }, {
34
+ headers: Record<string, string>;
35
+ statusCode: number;
36
+ }>>;
37
+ export type NodeHttpStatus = z.infer<typeof NodeHttpStatusSchema>;
38
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/types/results/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAwB,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAqB,MAAM,UAAU,CAAC;AAE1D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;IAG3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,cAAc,GAAG,WAAW,CAAC;IACrC,UAAU,EAAE,cAAc,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;GAcpB,CAAC;AACd,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NodeHttpStatusSchema = exports.NodeResultSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const base_1 = require("./base");
6
+ const shared_1 = require("./shared");
7
+ exports.NodeResultSchema = zod_1.z.union([
8
+ base_1.HTTPNodeResultSchema,
9
+ shared_1.AgentResultSchema,
10
+ ]);
11
+ exports.NodeHttpStatusSchema = zod_1.z
12
+ .object({
13
+ headers: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).openapi({
14
+ description: "The HTTP headers returned from the HTTP call.",
15
+ example: {
16
+ "Content-Type": "application/json",
17
+ "X-Request-ID": "1234567890",
18
+ },
19
+ }),
20
+ statusCode: zod_1.z.number().openapi({
21
+ description: "The HTTP status code returned from the HTTP call.",
22
+ example: 200,
23
+ }),
24
+ })
25
+ .nullable();
26
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/types/results/node.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iCAA8D;AAC9D,qCAA0D;AAE7C,QAAA,gBAAgB,GAAG,OAAC,CAAC,KAAK,CAAC;IACtC,2BAAoB;IACpB,0BAAiB;CAClB,CAAC,CAAC;AAOU,QAAA,oBAAoB,GAAG,OAAC;KAClC,MAAM,CAAC;IACN,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;QAChD,WAAW,EAAE,+CAA+C;QAC5D,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,cAAc,EAAE,YAAY;SAC7B;KACF,CAAC;IACF,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;QAC7B,WAAW,EAAE,mDAAmD;QAChE,OAAO,EAAE,GAAG;KACb,CAAC;CACH,CAAC;KACD,QAAQ,EAAE,CAAC"}