@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.
- package/README.md +323 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/behaviors/conditions.d.ts +54 -0
- package/dist/types/behaviors/conditions.d.ts.map +1 -0
- package/dist/types/behaviors/conditions.js +103 -0
- package/dist/types/behaviors/conditions.js.map +1 -0
- package/dist/types/behaviors/index.d.ts +3 -0
- package/dist/types/behaviors/index.d.ts.map +1 -0
- package/dist/types/behaviors/index.js +19 -0
- package/dist/types/behaviors/index.js.map +1 -0
- package/dist/types/behaviors/notifications.d.ts +157 -0
- package/dist/types/behaviors/notifications.d.ts.map +1 -0
- package/dist/types/behaviors/notifications.js +89 -0
- package/dist/types/behaviors/notifications.js.map +1 -0
- package/dist/types/config/activity.d.ts +58 -0
- package/dist/types/config/activity.d.ts.map +1 -0
- package/dist/types/config/activity.js +53 -0
- package/dist/types/config/activity.js.map +1 -0
- package/dist/types/config/http.d.ts +20 -0
- package/dist/types/config/http.d.ts.map +1 -0
- package/dist/types/config/http.js +66 -0
- package/dist/types/config/http.js.map +1 -0
- package/dist/types/config/index.d.ts +5 -0
- package/dist/types/config/index.d.ts.map +1 -0
- package/dist/types/config/index.js +21 -0
- package/dist/types/config/index.js.map +1 -0
- package/dist/types/config/protocols.d.ts +3 -0
- package/dist/types/config/protocols.d.ts.map +1 -0
- package/dist/types/config/protocols.js +14 -0
- package/dist/types/config/protocols.js.map +1 -0
- package/dist/types/config/workflow.d.ts +10 -0
- package/dist/types/config/workflow.d.ts.map +1 -0
- package/dist/types/config/workflow.js +12 -0
- package/dist/types/config/workflow.js.map +1 -0
- package/dist/types/context/index.d.ts +4 -0
- package/dist/types/context/index.d.ts.map +1 -0
- package/dist/types/context/index.js +8 -0
- package/dist/types/context/index.js.map +1 -0
- package/dist/types/contracts/agents.d.ts +87 -0
- package/dist/types/contracts/agents.d.ts.map +1 -0
- package/dist/types/contracts/agents.js +94 -0
- package/dist/types/contracts/agents.js.map +1 -0
- package/dist/types/contracts/index.d.ts +3 -0
- package/dist/types/contracts/index.d.ts.map +1 -0
- package/dist/types/contracts/index.js +19 -0
- package/dist/types/contracts/index.js.map +1 -0
- package/dist/types/contracts/tools.d.ts +72 -0
- package/dist/types/contracts/tools.d.ts.map +1 -0
- package/dist/types/contracts/tools.js +101 -0
- package/dist/types/contracts/tools.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +26 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/nodes/agents.d.ts +149 -0
- package/dist/types/nodes/agents.d.ts.map +1 -0
- package/dist/types/nodes/agents.js +48 -0
- package/dist/types/nodes/agents.js.map +1 -0
- package/dist/types/nodes/common/base-node-schema.d.ts +109 -0
- package/dist/types/nodes/common/base-node-schema.d.ts.map +1 -0
- package/dist/types/nodes/common/base-node-schema.js +55 -0
- package/dist/types/nodes/common/base-node-schema.js.map +1 -0
- package/dist/types/nodes/common/index.d.ts +2 -0
- package/dist/types/nodes/common/index.d.ts.map +1 -0
- package/dist/types/nodes/common/index.js +18 -0
- package/dist/types/nodes/common/index.js.map +1 -0
- package/dist/types/nodes/destination.d.ts +148 -0
- package/dist/types/nodes/destination.d.ts.map +1 -0
- package/dist/types/nodes/destination.js +30 -0
- package/dist/types/nodes/destination.js.map +1 -0
- package/dist/types/nodes/error-boundary.d.ts +126 -0
- package/dist/types/nodes/error-boundary.d.ts.map +1 -0
- package/dist/types/nodes/error-boundary.js +24 -0
- package/dist/types/nodes/error-boundary.js.map +1 -0
- package/dist/types/nodes/http.d.ts +194 -0
- package/dist/types/nodes/http.d.ts.map +1 -0
- package/dist/types/nodes/http.js +28 -0
- package/dist/types/nodes/http.js.map +1 -0
- package/dist/types/nodes/index.d.ts +734 -0
- package/dist/types/nodes/index.d.ts.map +1 -0
- package/dist/types/nodes/index.js +48 -0
- package/dist/types/nodes/index.js.map +1 -0
- package/dist/types/nodes/iterator.d.ts +126 -0
- package/dist/types/nodes/iterator.d.ts.map +1 -0
- package/dist/types/nodes/iterator.js +21 -0
- package/dist/types/nodes/iterator.js.map +1 -0
- package/dist/types/nodes/tools.d.ts +1321 -0
- package/dist/types/nodes/tools.d.ts.map +1 -0
- package/dist/types/nodes/tools.js +65 -0
- package/dist/types/nodes/tools.js.map +1 -0
- package/dist/types/primitives/index.d.ts +2 -0
- package/dist/types/primitives/index.d.ts.map +1 -0
- package/dist/types/primitives/index.js +18 -0
- package/dist/types/primitives/index.js.map +1 -0
- package/dist/types/primitives/shared.d.ts +21 -0
- package/dist/types/primitives/shared.d.ts.map +1 -0
- package/dist/types/primitives/shared.js +113 -0
- package/dist/types/primitives/shared.js.map +1 -0
- package/dist/types/results/agent.d.ts +156 -0
- package/dist/types/results/agent.d.ts.map +1 -0
- package/dist/types/results/agent.js +54 -0
- package/dist/types/results/agent.js.map +1 -0
- package/dist/types/results/base.d.ts +4 -0
- package/dist/types/results/base.d.ts.map +1 -0
- package/dist/types/results/base.js +12 -0
- package/dist/types/results/base.js.map +1 -0
- package/dist/types/results/index.d.ts +7 -0
- package/dist/types/results/index.d.ts.map +1 -0
- package/dist/types/results/index.js +23 -0
- package/dist/types/results/index.js.map +1 -0
- package/dist/types/results/node.d.ts +38 -0
- package/dist/types/results/node.d.ts.map +1 -0
- package/dist/types/results/node.js +26 -0
- package/dist/types/results/node.js.map +1 -0
- package/dist/types/results/shared.d.ts +36 -0
- package/dist/types/results/shared.d.ts.map +1 -0
- package/dist/types/results/shared.js +31 -0
- package/dist/types/results/shared.js.map +1 -0
- package/dist/types/results/source.d.ts +53 -0
- package/dist/types/results/source.d.ts.map +1 -0
- package/dist/types/results/source.js +64 -0
- package/dist/types/results/source.js.map +1 -0
- package/dist/types/results/tool.d.ts +170 -0
- package/dist/types/results/tool.d.ts.map +1 -0
- package/dist/types/results/tool.js +110 -0
- package/dist/types/results/tool.js.map +1 -0
- package/dist/types/state/index.d.ts +2 -0
- package/dist/types/state/index.d.ts.map +1 -0
- package/dist/types/state/index.js +18 -0
- package/dist/types/state/index.js.map +1 -0
- package/dist/types/state/workflow-state.d.ts +63 -0
- package/dist/types/state/workflow-state.d.ts.map +1 -0
- package/dist/types/state/workflow-state.js +52 -0
- package/dist/types/state/workflow-state.js.map +1 -0
- package/dist/types/validation/schema.d.ts +14 -0
- package/dist/types/validation/schema.d.ts.map +1 -0
- package/dist/types/validation/schema.js +37 -0
- package/dist/types/validation/schema.js.map +1 -0
- package/dist/types/workflow.d.ts +2179 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/types/workflow.js +132 -0
- package/dist/types/workflow.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/template/index.d.ts +39 -0
- package/dist/utils/template/index.d.ts.map +1 -0
- package/dist/utils/template/index.js +151 -0
- package/dist/utils/template/index.js.map +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const WorkflowResultsSchema: z.ZodObject<{
|
|
3
|
+
context: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
4
|
+
results: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
5
|
+
httpStatuses: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
context: Record<string, any>;
|
|
8
|
+
results: Record<string, any>;
|
|
9
|
+
httpStatuses: Record<string, any>;
|
|
10
|
+
}, {
|
|
11
|
+
context: Record<string, any>;
|
|
12
|
+
results?: Record<string, any> | undefined;
|
|
13
|
+
httpStatuses?: Record<string, any> | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export type WorkflowResults = z.infer<typeof WorkflowResultsSchema>;
|
|
16
|
+
export declare const AgentResultSchema: z.ZodObject<{
|
|
17
|
+
iterations: z.ZodNumber;
|
|
18
|
+
result: z.ZodAny;
|
|
19
|
+
toolCalls: z.ZodArray<z.ZodAny, "many">;
|
|
20
|
+
toolResults: z.ZodArray<z.ZodAny, "many">;
|
|
21
|
+
error: z.ZodNullable<z.ZodString>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
error: string | null;
|
|
24
|
+
iterations: number;
|
|
25
|
+
toolCalls: any[];
|
|
26
|
+
toolResults: any[];
|
|
27
|
+
result?: any;
|
|
28
|
+
}, {
|
|
29
|
+
error: string | null;
|
|
30
|
+
iterations: number;
|
|
31
|
+
toolCalls: any[];
|
|
32
|
+
toolResults: any[];
|
|
33
|
+
result?: any;
|
|
34
|
+
}>;
|
|
35
|
+
export type AgentResult = z.infer<typeof AgentResultSchema>;
|
|
36
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/types/results/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAoB5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentResultSchema = exports.WorkflowResultsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const context_1 = require("../context");
|
|
6
|
+
const contracts_1 = require("../contracts");
|
|
7
|
+
exports.WorkflowResultsSchema = zod_1.z.object({
|
|
8
|
+
context: context_1.GlobalContextSchema,
|
|
9
|
+
results: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).default({}),
|
|
10
|
+
httpStatuses: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).default({}),
|
|
11
|
+
});
|
|
12
|
+
exports.AgentResultSchema = zod_1.z.object({
|
|
13
|
+
iterations: zod_1.z.number().openapi({
|
|
14
|
+
description: "The number of iterations the agent has executed.",
|
|
15
|
+
example: 1,
|
|
16
|
+
}),
|
|
17
|
+
result: contracts_1.AgentCompletionResponseSchema.shape["final_result"].openapi({
|
|
18
|
+
description: "The final result of the agent sent in a completion response.",
|
|
19
|
+
}),
|
|
20
|
+
toolCalls: zod_1.z.array(zod_1.z.any()).openapi({
|
|
21
|
+
description: "The Payload of all the requests made to the tool in the order they were executed.",
|
|
22
|
+
}),
|
|
23
|
+
toolResults: zod_1.z.array(zod_1.z.any()).openapi({
|
|
24
|
+
description: "The results of all tool calls in the order they were executed.",
|
|
25
|
+
}),
|
|
26
|
+
error: zod_1.z.string().nullable().openapi({
|
|
27
|
+
description: "The error message of the agent if it failed.",
|
|
28
|
+
example: "An error occurred",
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/types/results/shared.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,wCAAiD;AACjD,4CAA6D;AAEhD,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,6BAAmB;IAC5B,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAClD,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACxD,CAAC,CAAC;AAIU,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;QAC7B,WAAW,EAAE,kDAAkD;QAC/D,OAAO,EAAE,CAAC;KACX,CAAC;IACF,MAAM,EAAE,yCAA6B,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;QAClE,WAAW,EAAE,8DAA8D;KAC5E,CAAC;IACF,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC;QAClC,WAAW,EACT,mFAAmF;KACtF,CAAC;IACF,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC;QACpC,WAAW,EACT,gEAAgE;KACnE,CAAC;IACF,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnC,WAAW,EAAE,8CAA8C;QAC3D,OAAO,EAAE,mBAAmB;KAC7B,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Schema for source node metadata
|
|
4
|
+
*/
|
|
5
|
+
export declare const SourceNodeMetadataSchema: z.ZodObject<{
|
|
6
|
+
/**
|
|
7
|
+
* Total number of items in the collection (optional)
|
|
8
|
+
*/
|
|
9
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
total?: number | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
total?: number | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Schema for source node results returned by data source nodes
|
|
17
|
+
* This provides a standardized format for iterator nodes
|
|
18
|
+
*/
|
|
19
|
+
export declare const SourceNodeResultSchema: z.ZodObject<{
|
|
20
|
+
/**
|
|
21
|
+
* Array of items to be iterated over
|
|
22
|
+
* For tabular data (like spreadsheets), each item represents a row with:
|
|
23
|
+
* - Each column accessible as a property (e.g. item.columnName)
|
|
24
|
+
* - Column values can be any type (string, number, boolean, object, etc.)
|
|
25
|
+
*/
|
|
26
|
+
items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">;
|
|
27
|
+
/**
|
|
28
|
+
* Optional metadata about the items collection
|
|
29
|
+
*/
|
|
30
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
/**
|
|
32
|
+
* Total number of items in the collection (optional)
|
|
33
|
+
*/
|
|
34
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
total?: number | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
total?: number | undefined;
|
|
39
|
+
}>>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
items: Record<string, any>[];
|
|
42
|
+
metadata?: {
|
|
43
|
+
total?: number | undefined;
|
|
44
|
+
} | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
items: Record<string, any>[];
|
|
47
|
+
metadata?: {
|
|
48
|
+
total?: number | undefined;
|
|
49
|
+
} | undefined;
|
|
50
|
+
}>;
|
|
51
|
+
export type SourceNodeMetadata = z.infer<typeof SourceNodeMetadataSchema>;
|
|
52
|
+
export type SourceNodeResult = z.infer<typeof SourceNodeResultSchema>;
|
|
53
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/types/results/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,wBAAwB;IAEjC;;OAEG;;;;;;EASH,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,sBAAsB;IAE/B;;;;;OAKG;;IAsBH;;OAEG;;QAhDH;;WAEG;;;;;;;;;;;;;;;;;EAuDH,CAAC;AAEL,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SourceNodeResultSchema = exports.SourceNodeMetadataSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Schema for source node metadata
|
|
7
|
+
*/
|
|
8
|
+
exports.SourceNodeMetadataSchema = zod_1.z
|
|
9
|
+
.object({
|
|
10
|
+
/**
|
|
11
|
+
* Total number of items in the collection (optional)
|
|
12
|
+
*/
|
|
13
|
+
total: zod_1.z.number().optional().openapi({
|
|
14
|
+
description: "Total number of items in the collection",
|
|
15
|
+
example: 42,
|
|
16
|
+
}),
|
|
17
|
+
})
|
|
18
|
+
.openapi({
|
|
19
|
+
ref: "SourceNodeMetadata",
|
|
20
|
+
description: "Optional metadata for a source node result",
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Schema for source node results returned by data source nodes
|
|
24
|
+
* This provides a standardized format for iterator nodes
|
|
25
|
+
*/
|
|
26
|
+
exports.SourceNodeResultSchema = zod_1.z
|
|
27
|
+
.object({
|
|
28
|
+
/**
|
|
29
|
+
* Array of items to be iterated over
|
|
30
|
+
* For tabular data (like spreadsheets), each item represents a row with:
|
|
31
|
+
* - Each column accessible as a property (e.g. item.columnName)
|
|
32
|
+
* - Column values can be any type (string, number, boolean, object, etc.)
|
|
33
|
+
*/
|
|
34
|
+
items: zod_1.z.array(zod_1.z.record(zod_1.z.string(), zod_1.z.any())).openapi({
|
|
35
|
+
description: "Array of records to iterate over, typically representing rows in tabular data",
|
|
36
|
+
example: [
|
|
37
|
+
{
|
|
38
|
+
id: "row1",
|
|
39
|
+
name: "John Doe",
|
|
40
|
+
email: "john@example.com",
|
|
41
|
+
age: 30,
|
|
42
|
+
isActive: true,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "row2",
|
|
46
|
+
name: "Jane Smith",
|
|
47
|
+
email: "jane@example.com",
|
|
48
|
+
age: 28,
|
|
49
|
+
isActive: false,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
}),
|
|
53
|
+
/**
|
|
54
|
+
* Optional metadata about the items collection
|
|
55
|
+
*/
|
|
56
|
+
metadata: exports.SourceNodeMetadataSchema.optional().openapi({
|
|
57
|
+
description: "Optional metadata about the items collection",
|
|
58
|
+
}),
|
|
59
|
+
})
|
|
60
|
+
.openapi({
|
|
61
|
+
ref: "SourceNodeResult",
|
|
62
|
+
description: "Standard response format for data sources used with iterator nodes",
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/types/results/source.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB;;GAEG;AACU,QAAA,wBAAwB,GAAG,OAAC;KACtC,MAAM,CAAC;IACN;;OAEG;IACH,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnC,WAAW,EAAE,yCAAyC;QACtD,OAAO,EAAE,EAAE;KACZ,CAAC;CACH,CAAC;KACD,OAAO,CAAC;IACP,GAAG,EAAE,oBAAoB;IACzB,WAAW,EAAE,4CAA4C;CAC1D,CAAC,CAAC;AAEL;;;GAGG;AACU,QAAA,sBAAsB,GAAG,OAAC;KACpC,MAAM,CAAC;IACN;;;;;OAKG;IACH,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QACpD,WAAW,EACT,+EAA+E;QACjF,OAAO,EAAE;YACP;gBACE,EAAE,EAAE,MAAM;gBACV,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,kBAAkB;gBACzB,GAAG,EAAE,EAAE;gBACP,QAAQ,EAAE,IAAI;aACf;YACD;gBACE,EAAE,EAAE,MAAM;gBACV,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,kBAAkB;gBACzB,GAAG,EAAE,EAAE;gBACP,QAAQ,EAAE,KAAK;aAChB;SACF;KACF,CAAC;IAEF;;OAEG;IACH,QAAQ,EAAE,gCAAwB,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;QACpD,WAAW,EAAE,8CAA8C;KAC5D,CAAC;CACH,CAAC;KACD,OAAO,CAAC;IACP,GAAG,EAAE,kBAAkB;IACvB,WAAW,EACT,oEAAoE;CACvE,CAAC,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Tool execution result within an agent's response
|
|
4
|
+
* @see AgentResponse type
|
|
5
|
+
*/
|
|
6
|
+
export declare const HttpToolResultSchema: z.ZodObject<{
|
|
7
|
+
success: z.ZodBoolean;
|
|
8
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
9
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
code: z.ZodNumber;
|
|
11
|
+
message: z.ZodString;
|
|
12
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
code: number;
|
|
15
|
+
message: string;
|
|
16
|
+
details?: Record<string, unknown> | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
code: number;
|
|
19
|
+
message: string;
|
|
20
|
+
details?: Record<string, unknown> | undefined;
|
|
21
|
+
}>>;
|
|
22
|
+
} & {
|
|
23
|
+
/** ID of the tool that was executed */
|
|
24
|
+
toolId: z.ZodString;
|
|
25
|
+
/** When this tool execution occurred */
|
|
26
|
+
timestamp: z.ZodNumber;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
success: boolean;
|
|
29
|
+
toolId: string;
|
|
30
|
+
timestamp: number;
|
|
31
|
+
result?: unknown;
|
|
32
|
+
error?: {
|
|
33
|
+
code: number;
|
|
34
|
+
message: string;
|
|
35
|
+
details?: Record<string, unknown> | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
success: boolean;
|
|
39
|
+
toolId: string;
|
|
40
|
+
timestamp: number;
|
|
41
|
+
result?: unknown;
|
|
42
|
+
error?: {
|
|
43
|
+
code: number;
|
|
44
|
+
message: string;
|
|
45
|
+
details?: Record<string, unknown> | undefined;
|
|
46
|
+
} | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
export type HttpToolResult = z.infer<typeof HttpToolResultSchema>;
|
|
49
|
+
export declare const GraphToolResultSchema: z.ZodObject<{
|
|
50
|
+
success: z.ZodBoolean;
|
|
51
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
code: z.ZodNumber;
|
|
53
|
+
message: z.ZodString;
|
|
54
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
code: number;
|
|
57
|
+
message: string;
|
|
58
|
+
details?: Record<string, unknown> | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
code: number;
|
|
61
|
+
message: string;
|
|
62
|
+
details?: Record<string, unknown> | undefined;
|
|
63
|
+
}>>;
|
|
64
|
+
toolId: z.ZodString;
|
|
65
|
+
timestamp: z.ZodNumber;
|
|
66
|
+
} & {
|
|
67
|
+
result: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
success: boolean;
|
|
70
|
+
result: Record<string, unknown>;
|
|
71
|
+
toolId: string;
|
|
72
|
+
timestamp: number;
|
|
73
|
+
error?: {
|
|
74
|
+
code: number;
|
|
75
|
+
message: string;
|
|
76
|
+
details?: Record<string, unknown> | undefined;
|
|
77
|
+
} | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
success: boolean;
|
|
80
|
+
result: Record<string, unknown>;
|
|
81
|
+
toolId: string;
|
|
82
|
+
timestamp: number;
|
|
83
|
+
error?: {
|
|
84
|
+
code: number;
|
|
85
|
+
message: string;
|
|
86
|
+
details?: Record<string, unknown> | undefined;
|
|
87
|
+
} | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
export type GraphToolResult = z.infer<typeof GraphToolResultSchema>;
|
|
90
|
+
export declare const ToolResultSchema: z.ZodObject<{
|
|
91
|
+
toolId: z.ZodString;
|
|
92
|
+
success: z.ZodBoolean;
|
|
93
|
+
result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
94
|
+
timestamp: z.ZodNumber;
|
|
95
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
code: z.ZodNumber;
|
|
97
|
+
message: z.ZodString;
|
|
98
|
+
details: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
code: number;
|
|
101
|
+
message: string;
|
|
102
|
+
details: Record<string, unknown>;
|
|
103
|
+
}, {
|
|
104
|
+
code: number;
|
|
105
|
+
message: string;
|
|
106
|
+
details: Record<string, unknown>;
|
|
107
|
+
}>>;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
success: boolean;
|
|
110
|
+
result: Record<string, unknown> | null;
|
|
111
|
+
toolId: string;
|
|
112
|
+
timestamp: number;
|
|
113
|
+
error?: {
|
|
114
|
+
code: number;
|
|
115
|
+
message: string;
|
|
116
|
+
details: Record<string, unknown>;
|
|
117
|
+
} | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
success: boolean;
|
|
120
|
+
result: Record<string, unknown> | null;
|
|
121
|
+
toolId: string;
|
|
122
|
+
timestamp: number;
|
|
123
|
+
error?: {
|
|
124
|
+
code: number;
|
|
125
|
+
message: string;
|
|
126
|
+
details: Record<string, unknown>;
|
|
127
|
+
} | undefined;
|
|
128
|
+
}>;
|
|
129
|
+
export type ToolResult = z.infer<typeof ToolResultSchema>;
|
|
130
|
+
/**
|
|
131
|
+
* Request payload sent to a tool
|
|
132
|
+
*/
|
|
133
|
+
export declare const ToolHttpRequestSchema: z.ZodObject<{
|
|
134
|
+
toolId: z.ZodString;
|
|
135
|
+
agentIterationNumber: z.ZodNumber;
|
|
136
|
+
toolPayload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
137
|
+
allResults: z.ZodObject<{
|
|
138
|
+
context: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
139
|
+
results: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
140
|
+
httpStatuses: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
141
|
+
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
context: Record<string, any>;
|
|
143
|
+
results: Record<string, any>;
|
|
144
|
+
httpStatuses: Record<string, any>;
|
|
145
|
+
}, {
|
|
146
|
+
context: Record<string, any>;
|
|
147
|
+
results?: Record<string, any> | undefined;
|
|
148
|
+
httpStatuses?: Record<string, any> | undefined;
|
|
149
|
+
}>;
|
|
150
|
+
}, "strip", z.ZodTypeAny, {
|
|
151
|
+
toolId: string;
|
|
152
|
+
agentIterationNumber: number;
|
|
153
|
+
toolPayload: Record<string, unknown>;
|
|
154
|
+
allResults: {
|
|
155
|
+
context: Record<string, any>;
|
|
156
|
+
results: Record<string, any>;
|
|
157
|
+
httpStatuses: Record<string, any>;
|
|
158
|
+
};
|
|
159
|
+
}, {
|
|
160
|
+
toolId: string;
|
|
161
|
+
agentIterationNumber: number;
|
|
162
|
+
toolPayload: Record<string, unknown>;
|
|
163
|
+
allResults: {
|
|
164
|
+
context: Record<string, any>;
|
|
165
|
+
results?: Record<string, any> | undefined;
|
|
166
|
+
httpStatuses?: Record<string, any> | undefined;
|
|
167
|
+
};
|
|
168
|
+
}>;
|
|
169
|
+
export type ToolHttpRequest = z.infer<typeof ToolHttpRequestSchema>;
|
|
170
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/types/results/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;IAC/B,uCAAuC;;IAEvC,wCAAwC;;;;;;;;;;;;;;;;;;;;;;EAExC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAchC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BzB,CAAC;AAEL,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgD9B,CAAC;AAEL,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolHttpRequestSchema = exports.ToolResultSchema = exports.GraphToolResultSchema = exports.HttpToolResultSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const contracts_1 = require("../contracts");
|
|
6
|
+
const shared_1 = require("./shared");
|
|
7
|
+
/**
|
|
8
|
+
* Tool execution result within an agent's response
|
|
9
|
+
* @see AgentResponse type
|
|
10
|
+
*/
|
|
11
|
+
exports.HttpToolResultSchema = contracts_1.ToolHttpResponseSchema.extend({
|
|
12
|
+
/** ID of the tool that was executed */
|
|
13
|
+
toolId: zod_1.z.string(),
|
|
14
|
+
/** When this tool execution occurred */
|
|
15
|
+
timestamp: zod_1.z.number(),
|
|
16
|
+
});
|
|
17
|
+
exports.GraphToolResultSchema = exports.HttpToolResultSchema.extend({
|
|
18
|
+
result: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
19
|
+
}).openapi({
|
|
20
|
+
description: "Result of a graph tool execution",
|
|
21
|
+
example: {
|
|
22
|
+
toolId: "search",
|
|
23
|
+
success: true,
|
|
24
|
+
result: {
|
|
25
|
+
get_contacts: {
|
|
26
|
+
contacts: ["contact1", "contact2"],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
timestamp: 1709544000000, // March 4, 2024
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
exports.ToolResultSchema = zod_1.z
|
|
33
|
+
.object({
|
|
34
|
+
toolId: zod_1.z.string(),
|
|
35
|
+
success: zod_1.z.boolean(),
|
|
36
|
+
result: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullable(),
|
|
37
|
+
timestamp: zod_1.z.number(),
|
|
38
|
+
error: zod_1.z
|
|
39
|
+
.object({
|
|
40
|
+
code: zod_1.z.number(),
|
|
41
|
+
message: zod_1.z.string(),
|
|
42
|
+
details: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
43
|
+
})
|
|
44
|
+
.optional(),
|
|
45
|
+
})
|
|
46
|
+
.openapi({
|
|
47
|
+
description: "Result of a tool execution",
|
|
48
|
+
example: {
|
|
49
|
+
toolId: "get_contacts",
|
|
50
|
+
success: true,
|
|
51
|
+
result: {
|
|
52
|
+
get_contacts: {
|
|
53
|
+
contacts: ["contact1", "contact2"],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
timestamp: 1709544000000, // March 4, 2024
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* Request payload sent to a tool
|
|
61
|
+
*/
|
|
62
|
+
exports.ToolHttpRequestSchema = zod_1.z
|
|
63
|
+
.object({
|
|
64
|
+
toolId: zod_1.z.string().openapi({
|
|
65
|
+
description: "The ID of the tool to execute",
|
|
66
|
+
example: "get_contacts",
|
|
67
|
+
}),
|
|
68
|
+
agentIterationNumber: zod_1.z.number().openapi({
|
|
69
|
+
description: "The current iteration number of the agent",
|
|
70
|
+
example: 1,
|
|
71
|
+
}),
|
|
72
|
+
toolPayload: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).openapi({
|
|
73
|
+
description: "The payload to send to the tool as defined by the Agent",
|
|
74
|
+
example: {
|
|
75
|
+
query: "find contacts",
|
|
76
|
+
filters: {
|
|
77
|
+
date: "2024-03-03",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
}),
|
|
81
|
+
allResults: shared_1.WorkflowResultsSchema.openapi({
|
|
82
|
+
description: "The results of all the nodes and tools that had been executed before this tool was called",
|
|
83
|
+
example: {
|
|
84
|
+
context: {},
|
|
85
|
+
results: {},
|
|
86
|
+
httpStatuses: {},
|
|
87
|
+
},
|
|
88
|
+
}),
|
|
89
|
+
})
|
|
90
|
+
.openapi({
|
|
91
|
+
title: "Tool Request Contract",
|
|
92
|
+
description: "Request body for tool execution",
|
|
93
|
+
example: {
|
|
94
|
+
toolId: "get_contacts",
|
|
95
|
+
agentIterationNumber: 1,
|
|
96
|
+
toolPayload: {
|
|
97
|
+
query: "find contacts",
|
|
98
|
+
filters: {
|
|
99
|
+
date: "2024-03-03",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
allResults: {
|
|
103
|
+
context: {},
|
|
104
|
+
results: {},
|
|
105
|
+
httpStatuses: {},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
"x-tags": ["Tools"],
|
|
109
|
+
});
|
|
110
|
+
//# sourceMappingURL=tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../src/types/results/tool.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,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("./workflow-state"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/state/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const WorkflowStateSchema: z.ZodObject<{
|
|
3
|
+
context: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
4
|
+
executedNodeIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
5
|
+
nodeResults: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodAny, z.ZodObject<{
|
|
6
|
+
iterations: z.ZodNumber;
|
|
7
|
+
result: z.ZodAny;
|
|
8
|
+
toolCalls: z.ZodArray<z.ZodAny, "many">;
|
|
9
|
+
toolResults: z.ZodArray<z.ZodAny, "many">;
|
|
10
|
+
error: z.ZodNullable<z.ZodString>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
toolCalls: any[];
|
|
13
|
+
error: string | null;
|
|
14
|
+
toolResults: any[];
|
|
15
|
+
iterations: number;
|
|
16
|
+
result?: any;
|
|
17
|
+
}, {
|
|
18
|
+
toolCalls: any[];
|
|
19
|
+
error: string | null;
|
|
20
|
+
toolResults: any[];
|
|
21
|
+
iterations: number;
|
|
22
|
+
result?: any;
|
|
23
|
+
}>]>>>;
|
|
24
|
+
httpStatuses: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodObject<{
|
|
25
|
+
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
26
|
+
statusCode: z.ZodNumber;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
headers: Record<string, string>;
|
|
29
|
+
statusCode: number;
|
|
30
|
+
}, {
|
|
31
|
+
headers: Record<string, string>;
|
|
32
|
+
statusCode: number;
|
|
33
|
+
}>>>>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
context: Record<string, any>;
|
|
36
|
+
httpStatuses: Record<string, {
|
|
37
|
+
headers: Record<string, string>;
|
|
38
|
+
statusCode: number;
|
|
39
|
+
} | null>;
|
|
40
|
+
executedNodeIds: string[];
|
|
41
|
+
nodeResults: Record<string, any>;
|
|
42
|
+
}, {
|
|
43
|
+
context: Record<string, any>;
|
|
44
|
+
httpStatuses?: Record<string, {
|
|
45
|
+
headers: Record<string, string>;
|
|
46
|
+
statusCode: number;
|
|
47
|
+
} | null> | undefined;
|
|
48
|
+
executedNodeIds?: string[] | undefined;
|
|
49
|
+
nodeResults?: Record<string, any> | undefined;
|
|
50
|
+
}>;
|
|
51
|
+
export type WorkflowState = z.infer<typeof WorkflowStateSchema>;
|
|
52
|
+
export declare const WorkflowInfoSchema: z.ZodObject<{
|
|
53
|
+
orgId: z.ZodString;
|
|
54
|
+
workflowId: z.ZodString;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
orgId: string;
|
|
57
|
+
workflowId: string;
|
|
58
|
+
}, {
|
|
59
|
+
orgId: string;
|
|
60
|
+
workflowId: string;
|
|
61
|
+
}>;
|
|
62
|
+
export type WorkflowInfo = z.infer<typeof WorkflowInfoSchema>;
|
|
63
|
+
//# sourceMappingURL=workflow-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-state.d.ts","sourceRoot":"","sources":["../../../src/types/state/workflow-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4C9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,kBAAkB;;;;;;;;;EAG7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkflowInfoSchema = exports.WorkflowStateSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const context_1 = require("../context");
|
|
6
|
+
const results_1 = require("../results");
|
|
7
|
+
exports.WorkflowStateSchema = zod_1.z.object({
|
|
8
|
+
context: context_1.GlobalContextSchema.openapi({
|
|
9
|
+
description: "The current global context object for the workflow execution. Contains initial context merged with any updates made during the workflow run.",
|
|
10
|
+
example: {
|
|
11
|
+
userId: "user123",
|
|
12
|
+
tenantId: "tenant-abc",
|
|
13
|
+
apiKey: "INITIAL_KEY",
|
|
14
|
+
intermediateResult: { status: "processed" },
|
|
15
|
+
},
|
|
16
|
+
}),
|
|
17
|
+
executedNodeIds: zod_1.z
|
|
18
|
+
.array(zod_1.z.string())
|
|
19
|
+
.default([])
|
|
20
|
+
.openapi({
|
|
21
|
+
description: "An array containing the IDs of all nodes that have completed execution (successfully or with failure) so far in this workflow instance.",
|
|
22
|
+
example: ["start_node", "fetch_user", "process_data"],
|
|
23
|
+
}),
|
|
24
|
+
nodeResults: zod_1.z
|
|
25
|
+
.record(zod_1.z.string(), results_1.NodeResultSchema)
|
|
26
|
+
.default({})
|
|
27
|
+
.openapi({
|
|
28
|
+
description: "A record mapping node IDs to their respective results. The structure of the result depends on the node type (e.g., HTTP result, Agent result).",
|
|
29
|
+
example: {
|
|
30
|
+
fetch_user: { id: "user123", name: "Alice" },
|
|
31
|
+
process_data: { processed: true, items_count: 5 },
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
httpStatuses: zod_1.z
|
|
35
|
+
.record(zod_1.z.string(), results_1.NodeHttpStatusSchema)
|
|
36
|
+
.default({})
|
|
37
|
+
.openapi({
|
|
38
|
+
description: "A record mapping node IDs (specifically for HTTP nodes) to their last recorded HTTP status code and headers.",
|
|
39
|
+
example: {
|
|
40
|
+
fetch_user: {
|
|
41
|
+
statusCode: 200,
|
|
42
|
+
headers: { "content-type": "application/json" },
|
|
43
|
+
},
|
|
44
|
+
external_call: { statusCode: 404, headers: {} },
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
48
|
+
exports.WorkflowInfoSchema = zod_1.z.object({
|
|
49
|
+
orgId: zod_1.z.string(),
|
|
50
|
+
workflowId: zod_1.z.string(),
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=workflow-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-state.js","sourceRoot":"","sources":["../../../src/types/state/workflow-state.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,wCAAiD;AACjD,wCAAoE;AAEvD,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,OAAO,EAAE,6BAAmB,CAAC,OAAO,CAAC;QACnC,WAAW,EACT,8IAA8I;QAChJ,OAAO,EAAE;YACP,MAAM,EAAE,SAAS;YACjB,QAAQ,EAAE,YAAY;YACtB,MAAM,EAAE,aAAa;YACrB,kBAAkB,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE;SAC5C;KACF,CAAC;IACF,eAAe,EAAE,OAAC;SACf,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;SACjB,OAAO,CAAC,EAAE,CAAC;SACX,OAAO,CAAC;QACP,WAAW,EACT,yIAAyI;QAC3I,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,cAAc,CAAC;KACtD,CAAC;IACJ,WAAW,EAAE,OAAC;SACX,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,0BAAgB,CAAC;SACpC,OAAO,CAAC,EAAE,CAAC;SACX,OAAO,CAAC;QACP,WAAW,EACT,gJAAgJ;QAClJ,OAAO,EAAE;YACP,UAAU,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE;YAC5C,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE;SAClD;KACF,CAAC;IACJ,YAAY,EAAE,OAAC;SACZ,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,8BAAoB,CAAC;SACxC,OAAO,CAAC,EAAE,CAAC;SACX,OAAO,CAAC;QACP,WAAW,EACT,8GAA8G;QAChH,OAAO,EAAE;YACP,UAAU,EAAE;gBACV,UAAU,EAAE,GAAG;gBACf,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;aAChD;YACD,aAAa,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE;SAChD;KACF,CAAC;CACL,CAAC,CAAC;AAIU,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const JSONSchemaValidationSchema: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
3
|
+
export declare const ValidationSchema: z.ZodObject<{
|
|
4
|
+
input: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
5
|
+
output: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
input?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
8
|
+
output?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
input?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
11
|
+
output?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
export type ValidationSchema = z.infer<typeof ValidationSchema>;
|
|
14
|
+
//# sourceMappingURL=schema.d.ts.map
|