chatbot-lex-design-builder 2.0.20 → 2.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/agentic/nodes/agent-schema.d.ts +88 -0
- package/dist/cjs/agentic/nodes/agent-schema.js +61 -0
- package/dist/cjs/agentic/nodes/agent-schema.js.map +1 -1
- package/dist/cjs/agentic/nodes/schema.d.ts +10 -5
- package/dist/cjs/agentic/nodes/schema.js +32 -16
- package/dist/cjs/agentic/nodes/schema.js.map +1 -1
- package/dist/cjs/agentic/sdk.d.ts +33 -0
- package/dist/cjs/agentic/sdk.js +144 -31
- package/dist/cjs/agentic/sdk.js.map +1 -1
- package/dist/esm/agentic/nodes/agent-schema.d.ts +88 -0
- package/dist/esm/agentic/nodes/agent-schema.js +61 -0
- package/dist/esm/agentic/nodes/agent-schema.js.map +1 -1
- package/dist/esm/agentic/nodes/schema.d.ts +10 -5
- package/dist/esm/agentic/nodes/schema.js +32 -16
- package/dist/esm/agentic/nodes/schema.js.map +1 -1
- package/dist/esm/agentic/sdk.d.ts +33 -0
- package/dist/esm/agentic/sdk.js +144 -31
- package/dist/esm/agentic/sdk.js.map +1 -1
- package/package.json +1 -1
|
@@ -29,6 +29,50 @@ export declare const ToolSchema: z.ZodObject<{
|
|
|
29
29
|
required: z.ZodBoolean;
|
|
30
30
|
description: z.ZodString;
|
|
31
31
|
}, z.core.$strip>>;
|
|
32
|
+
configuration: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
|
+
type: z.ZodLiteral<"function">;
|
|
34
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<"api">;
|
|
36
|
+
url: z.ZodURL;
|
|
37
|
+
method: z.ZodEnum<{
|
|
38
|
+
delete: "delete";
|
|
39
|
+
get: "get";
|
|
40
|
+
post: "post";
|
|
41
|
+
put: "put";
|
|
42
|
+
patch: "patch";
|
|
43
|
+
}>;
|
|
44
|
+
contentType: z.ZodEnum<{
|
|
45
|
+
"application/xml": "application/xml";
|
|
46
|
+
"application/json": "application/json";
|
|
47
|
+
"text/plain": "text/plain";
|
|
48
|
+
"application/x-www-from-urlencoded": "application/x-www-from-urlencoded";
|
|
49
|
+
}>;
|
|
50
|
+
headers: z.ZodArray<z.ZodObject<{
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
value: z.ZodString;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
responseBody: z.ZodArray<z.ZodObject<{
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
value: z.ZodString;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
auth: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
59
|
+
type: z.ZodLiteral<"noAuth">;
|
|
60
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
+
type: z.ZodLiteral<"apiKey">;
|
|
62
|
+
key: z.ZodString;
|
|
63
|
+
value: z.ZodString;
|
|
64
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
65
|
+
type: z.ZodLiteral<"bearer">;
|
|
66
|
+
tokenUrl: z.ZodURL;
|
|
67
|
+
username: z.ZodString;
|
|
68
|
+
password: z.ZodString;
|
|
69
|
+
tokenResponseField: z.ZodString;
|
|
70
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
71
|
+
type: z.ZodLiteral<"basic">;
|
|
72
|
+
username: z.ZodString;
|
|
73
|
+
password: z.ZodString;
|
|
74
|
+
}, z.core.$strip>], "type">;
|
|
75
|
+
}, z.core.$strip>], "type">;
|
|
32
76
|
}, z.core.$strip>;
|
|
33
77
|
export type Tool = z.infer<typeof ToolSchema>;
|
|
34
78
|
export declare const AgentSchema: z.ZodObject<{
|
|
@@ -54,6 +98,50 @@ export declare const AgentSchema: z.ZodObject<{
|
|
|
54
98
|
required: z.ZodBoolean;
|
|
55
99
|
description: z.ZodString;
|
|
56
100
|
}, z.core.$strip>>;
|
|
101
|
+
configuration: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
102
|
+
type: z.ZodLiteral<"function">;
|
|
103
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
104
|
+
type: z.ZodLiteral<"api">;
|
|
105
|
+
url: z.ZodURL;
|
|
106
|
+
method: z.ZodEnum<{
|
|
107
|
+
delete: "delete";
|
|
108
|
+
get: "get";
|
|
109
|
+
post: "post";
|
|
110
|
+
put: "put";
|
|
111
|
+
patch: "patch";
|
|
112
|
+
}>;
|
|
113
|
+
contentType: z.ZodEnum<{
|
|
114
|
+
"application/xml": "application/xml";
|
|
115
|
+
"application/json": "application/json";
|
|
116
|
+
"text/plain": "text/plain";
|
|
117
|
+
"application/x-www-from-urlencoded": "application/x-www-from-urlencoded";
|
|
118
|
+
}>;
|
|
119
|
+
headers: z.ZodArray<z.ZodObject<{
|
|
120
|
+
name: z.ZodString;
|
|
121
|
+
value: z.ZodString;
|
|
122
|
+
}, z.core.$strip>>;
|
|
123
|
+
responseBody: z.ZodArray<z.ZodObject<{
|
|
124
|
+
id: z.ZodString;
|
|
125
|
+
value: z.ZodString;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
auth: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
128
|
+
type: z.ZodLiteral<"noAuth">;
|
|
129
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
130
|
+
type: z.ZodLiteral<"apiKey">;
|
|
131
|
+
key: z.ZodString;
|
|
132
|
+
value: z.ZodString;
|
|
133
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
134
|
+
type: z.ZodLiteral<"bearer">;
|
|
135
|
+
tokenUrl: z.ZodURL;
|
|
136
|
+
username: z.ZodString;
|
|
137
|
+
password: z.ZodString;
|
|
138
|
+
tokenResponseField: z.ZodString;
|
|
139
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
140
|
+
type: z.ZodLiteral<"basic">;
|
|
141
|
+
username: z.ZodString;
|
|
142
|
+
password: z.ZodString;
|
|
143
|
+
}, z.core.$strip>], "type">;
|
|
144
|
+
}, z.core.$strip>], "type">;
|
|
57
145
|
}, z.core.$strip>>;
|
|
58
146
|
}, z.core.$strip>;
|
|
59
147
|
export type Agent = z.infer<typeof AgentSchema>;
|
|
@@ -5,6 +5,66 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AgentSchema = exports.ToolSchema = exports.ParameterSchema = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const CommonStringSchema = zod_1.default
|
|
9
|
+
.string()
|
|
10
|
+
.trim()
|
|
11
|
+
.min(1, { error: "This is required" })
|
|
12
|
+
.max(30, { error: "This can't exceed 30 charectors" });
|
|
13
|
+
const FunctionConfigurationSchema = zod_1.default.object({
|
|
14
|
+
type: zod_1.default.literal("function"),
|
|
15
|
+
});
|
|
16
|
+
const HeaderSchema = zod_1.default.object({
|
|
17
|
+
name: CommonStringSchema,
|
|
18
|
+
value: CommonStringSchema,
|
|
19
|
+
});
|
|
20
|
+
const NoAuthConfigurationSchema = zod_1.default.object({
|
|
21
|
+
type: zod_1.default.literal("noAuth"),
|
|
22
|
+
});
|
|
23
|
+
const ApiKeyConfigurationSchema = zod_1.default.object({
|
|
24
|
+
type: zod_1.default.literal("apiKey"),
|
|
25
|
+
key: CommonStringSchema,
|
|
26
|
+
value: CommonStringSchema,
|
|
27
|
+
});
|
|
28
|
+
const BearerTokenConfigurationSchema = zod_1.default.object({
|
|
29
|
+
type: zod_1.default.literal("bearer"),
|
|
30
|
+
tokenUrl: zod_1.default.url(),
|
|
31
|
+
username: CommonStringSchema,
|
|
32
|
+
password: CommonStringSchema,
|
|
33
|
+
tokenResponseField: CommonStringSchema,
|
|
34
|
+
});
|
|
35
|
+
const BasicAuthConfigurationSchema = zod_1.default.object({
|
|
36
|
+
type: zod_1.default.literal("basic"),
|
|
37
|
+
username: CommonStringSchema,
|
|
38
|
+
password: CommonStringSchema,
|
|
39
|
+
});
|
|
40
|
+
const ApiConfigurationSchema = zod_1.default.object({
|
|
41
|
+
type: zod_1.default.literal("api"),
|
|
42
|
+
url: zod_1.default.url(),
|
|
43
|
+
method: zod_1.default.enum(["get", "put", "post", "delete", "patch"]),
|
|
44
|
+
contentType: zod_1.default.enum([
|
|
45
|
+
"application/json",
|
|
46
|
+
"application/xml",
|
|
47
|
+
"text/plain",
|
|
48
|
+
"application/x-www-from-urlencoded",
|
|
49
|
+
]),
|
|
50
|
+
headers: HeaderSchema.array(),
|
|
51
|
+
responseBody: zod_1.default
|
|
52
|
+
.object({
|
|
53
|
+
id: CommonStringSchema,
|
|
54
|
+
value: CommonStringSchema,
|
|
55
|
+
})
|
|
56
|
+
.array(),
|
|
57
|
+
auth: zod_1.default.discriminatedUnion("type", [
|
|
58
|
+
NoAuthConfigurationSchema,
|
|
59
|
+
ApiKeyConfigurationSchema,
|
|
60
|
+
BearerTokenConfigurationSchema,
|
|
61
|
+
BasicAuthConfigurationSchema,
|
|
62
|
+
]),
|
|
63
|
+
});
|
|
64
|
+
const FullfillmentNodeDataSchema = zod_1.default.discriminatedUnion("type", [
|
|
65
|
+
FunctionConfigurationSchema,
|
|
66
|
+
ApiConfigurationSchema,
|
|
67
|
+
]);
|
|
8
68
|
exports.ParameterSchema = zod_1.default.object({
|
|
9
69
|
name: zod_1.default.string().describe("Name of the parameter"),
|
|
10
70
|
type: zod_1.default
|
|
@@ -19,6 +79,7 @@ exports.ToolSchema = zod_1.default.object({
|
|
|
19
79
|
name: zod_1.default.string().describe("Name of the tool"),
|
|
20
80
|
description: zod_1.default.string().describe("Description of the tool"),
|
|
21
81
|
parameters: exports.ParameterSchema.array().describe("Parameters for the tool"),
|
|
82
|
+
configuration: FullfillmentNodeDataSchema.describe("Configuration for fullfillment"),
|
|
22
83
|
});
|
|
23
84
|
exports.AgentSchema = zod_1.default.object({
|
|
24
85
|
id: zod_1.default.string().describe("graph node id for the tool"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-schema.js","sourceRoot":"","sources":["../../../../agentic/nodes/agent-schema.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;
|
|
1
|
+
{"version":3,"file":"agent-schema.js","sourceRoot":"","sources":["../../../../agentic/nodes/agent-schema.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAEpB,MAAM,kBAAkB,GAAG,aAAC;KACvB,MAAM,EAAE;KACR,IAAI,EAAE;KACN,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;KACrC,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,iCAAiC,EAAE,CAAC,CAAC;AAI3D,MAAM,2BAA2B,GAAG,aAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,aAAC,CAAC,OAAO,CAAC,UAAU,CAAC;CAC9B,CAAC,CAAC;AAIH,MAAM,YAAY,GAAG,aAAC,CAAC,MAAM,CAAC;IAC1B,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,kBAAkB;CAC5B,CAAC,CAAC;AAIH,MAAM,yBAAyB,GAAG,aAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,aAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;CAC5B,CAAC,CAAC;AAIH,MAAM,yBAAyB,GAAG,aAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,aAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,GAAG,EAAE,kBAAkB;IACvB,KAAK,EAAE,kBAAkB;CAC5B,CAAC,CAAC;AAIH,MAAM,8BAA8B,GAAG,aAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,aAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,QAAQ,EAAE,aAAC,CAAC,GAAG,EAAE;IACjB,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ,EAAE,kBAAkB;IAC5B,kBAAkB,EAAE,kBAAkB;CACzC,CAAC,CAAC;AAIH,MAAM,4BAA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,CAAC,CAAC"}
|
|
@@ -10,8 +10,9 @@ export declare const CommonStringSchema: z.ZodString;
|
|
|
10
10
|
export type CommonString = z.infer<typeof CommonStringSchema>;
|
|
11
11
|
export declare const ConditionNodeDataSchema: z.ZodObject<{
|
|
12
12
|
conditions: z.ZodArray<z.ZodObject<{
|
|
13
|
-
id: z.ZodString;
|
|
14
13
|
expression: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
15
16
|
}, z.core.$strip>>;
|
|
16
17
|
}, z.core.$strip>;
|
|
17
18
|
export type ConditionNodeData = z.infer<typeof ConditionNodeDataSchema>;
|
|
@@ -20,8 +21,9 @@ export declare const ConditionNodeSchema: z.ZodObject<{
|
|
|
20
21
|
type: z.ZodLiteral<NodeType.conditionNode>;
|
|
21
22
|
data: z.ZodObject<{
|
|
22
23
|
conditions: z.ZodArray<z.ZodObject<{
|
|
23
|
-
id: z.ZodString;
|
|
24
24
|
expression: z.ZodString;
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
25
27
|
}, z.core.$strip>>;
|
|
26
28
|
}, z.core.$strip>;
|
|
27
29
|
}, z.core.$strip>;
|
|
@@ -301,8 +303,9 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
301
303
|
type: z.ZodLiteral<NodeType.conditionNode>;
|
|
302
304
|
data: z.ZodObject<{
|
|
303
305
|
conditions: z.ZodArray<z.ZodObject<{
|
|
304
|
-
id: z.ZodString;
|
|
305
306
|
expression: z.ZodString;
|
|
307
|
+
name: z.ZodString;
|
|
308
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
306
309
|
}, z.core.$strip>>;
|
|
307
310
|
}, z.core.$strip>;
|
|
308
311
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -389,8 +392,9 @@ export declare const GraphSchema: z.ZodObject<{
|
|
|
389
392
|
type: z.ZodLiteral<NodeType.conditionNode>;
|
|
390
393
|
data: z.ZodObject<{
|
|
391
394
|
conditions: z.ZodArray<z.ZodObject<{
|
|
392
|
-
id: z.ZodString;
|
|
393
395
|
expression: z.ZodString;
|
|
396
|
+
name: z.ZodString;
|
|
397
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
394
398
|
}, z.core.$strip>>;
|
|
395
399
|
}, z.core.$strip>;
|
|
396
400
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -487,8 +491,9 @@ export declare const WorkflowFileSchema: z.ZodObject<{
|
|
|
487
491
|
type: z.ZodLiteral<NodeType.conditionNode>;
|
|
488
492
|
data: z.ZodObject<{
|
|
489
493
|
conditions: z.ZodArray<z.ZodObject<{
|
|
490
|
-
id: z.ZodString;
|
|
491
494
|
expression: z.ZodString;
|
|
495
|
+
name: z.ZodString;
|
|
496
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
492
497
|
}, z.core.$strip>>;
|
|
493
498
|
}, z.core.$strip>;
|
|
494
499
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -19,17 +19,25 @@ exports.CommonStringSchema = zod_1.default
|
|
|
19
19
|
.min(1, { error: "This is required" })
|
|
20
20
|
.max(30, { error: "This can't exceed 30 charectors" });
|
|
21
21
|
const ConditionSchema = zod_1.default.object({
|
|
22
|
-
id: exports.CommonStringSchema,
|
|
23
22
|
expression: exports.CommonStringSchema,
|
|
23
|
+
name: exports.CommonStringSchema.describe("a short human readable name."),
|
|
24
|
+
isDefault: zod_1.default
|
|
25
|
+
.boolean()
|
|
26
|
+
.default(false)
|
|
27
|
+
.describe("indicates if this is the default condition. if this is true then expression will be ignored."),
|
|
24
28
|
});
|
|
25
29
|
exports.ConditionNodeDataSchema = zod_1.default.object({
|
|
26
|
-
conditions: ConditionSchema.array()
|
|
30
|
+
conditions: ConditionSchema.array()
|
|
31
|
+
.min(1)
|
|
32
|
+
.describe("at least a default case will be present"),
|
|
27
33
|
});
|
|
28
|
-
exports.ConditionNodeSchema = zod_1.default
|
|
34
|
+
exports.ConditionNodeSchema = zod_1.default
|
|
35
|
+
.object({
|
|
29
36
|
id: zod_1.default.string(),
|
|
30
37
|
type: zod_1.default.literal(NodeType.conditionNode),
|
|
31
38
|
data: exports.ConditionNodeDataSchema,
|
|
32
|
-
})
|
|
39
|
+
})
|
|
40
|
+
.describe("Conditional node allows agent to make decisions based on conditions");
|
|
33
41
|
exports.EdgeSchema = zod_1.default.object({
|
|
34
42
|
source: zod_1.default.string(),
|
|
35
43
|
sourceHandle: zod_1.default.string(),
|
|
@@ -92,40 +100,48 @@ exports.FullfillmentNodeDataSchema = zod_1.default.discriminatedUnion("type", [
|
|
|
92
100
|
exports.FunctionConfigurationSchema,
|
|
93
101
|
exports.ApiConfigurationSchema,
|
|
94
102
|
]);
|
|
95
|
-
exports.FullfillmentNodeSchema = zod_1.default
|
|
103
|
+
exports.FullfillmentNodeSchema = zod_1.default
|
|
104
|
+
.object({
|
|
96
105
|
id: zod_1.default.string(),
|
|
97
106
|
type: zod_1.default.literal(NodeType.fullfillmentNode),
|
|
98
107
|
data: exports.FullfillmentNodeDataSchema,
|
|
99
|
-
})
|
|
108
|
+
})
|
|
109
|
+
.describe("It represents the end action node in the flow.");
|
|
100
110
|
exports.NameDescriptionSchema = zod_1.default.object({
|
|
101
|
-
name: exports.CommonStringSchema,
|
|
102
|
-
description: exports.CommonStringSchema,
|
|
111
|
+
name: exports.CommonStringSchema.describe("a short human readable name"),
|
|
112
|
+
description: exports.CommonStringSchema.describe("a short human readable description about the node"),
|
|
103
113
|
});
|
|
104
114
|
exports.ParameterNodeDataSchema = exports.NameDescriptionSchema.extend({
|
|
105
115
|
type: zod_1.default.enum(["string", "number", "boolean", "object", "array"]),
|
|
106
116
|
required: zod_1.default.boolean(),
|
|
107
117
|
});
|
|
108
|
-
exports.ParameterNodeSchema = zod_1.default
|
|
118
|
+
exports.ParameterNodeSchema = zod_1.default
|
|
119
|
+
.object({
|
|
109
120
|
id: zod_1.default.string(),
|
|
110
121
|
type: zod_1.default.literal(NodeType.parameterNode),
|
|
111
122
|
data: exports.ParameterNodeDataSchema,
|
|
112
|
-
})
|
|
123
|
+
})
|
|
124
|
+
.describe("A Parameter node is used to define and pass parameters within the flow. It has both a target handle to receive input and a source handle to provide output.");
|
|
113
125
|
exports.StartNodeDataSchema = zod_1.default.object({
|
|
114
|
-
resourceId: zod_1.default.string().nullish()
|
|
126
|
+
resourceId: zod_1.default.string().nullish(),
|
|
115
127
|
});
|
|
116
|
-
exports.StartNodeSchema = zod_1.default
|
|
128
|
+
exports.StartNodeSchema = zod_1.default
|
|
129
|
+
.object({
|
|
117
130
|
id: zod_1.default.string(),
|
|
118
131
|
type: zod_1.default.literal(NodeType.startNode),
|
|
119
132
|
data: exports.StartNodeDataSchema,
|
|
120
|
-
})
|
|
133
|
+
})
|
|
134
|
+
.describe("The Start node represents the entry point of the flow. It acts as the parent of all tool nodes and contains only a target handle.");
|
|
121
135
|
exports.ToolNodeDataSchema = exports.NameDescriptionSchema.extend({
|
|
122
|
-
resourceId: zod_1.default.string().nullish()
|
|
136
|
+
resourceId: zod_1.default.string().nullish(),
|
|
123
137
|
});
|
|
124
|
-
exports.ToolNodeSchema = zod_1.default
|
|
138
|
+
exports.ToolNodeSchema = zod_1.default
|
|
139
|
+
.object({
|
|
125
140
|
id: zod_1.default.string(),
|
|
126
141
|
type: zod_1.default.literal(NodeType.toolNode),
|
|
127
142
|
data: exports.ToolNodeDataSchema,
|
|
128
|
-
})
|
|
143
|
+
})
|
|
144
|
+
.describe("A Tool node represents an executable step in the flow. It can receive input through a target handle and pass output through a source handle.");
|
|
129
145
|
exports.NodeSchema = zod_1.default.discriminatedUnion("type", [
|
|
130
146
|
exports.StartNodeSchema,
|
|
131
147
|
exports.ToolNodeSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../agentic/nodes/schema.ts"],"names":[],"mappings":";;;;;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AAM,GAAa,EAAE,CAAC;QAC5B,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC3B,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBACxB,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,EAAE,CAClC,CAAC;gBACF,MAAM,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;oBACjD,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC;oBACjE,OAAO,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACzD,CAAC,CAAC,CAAC;gBACH,IAAI,CAAC,cAAc,EAAE,CAAC;oBACpB,MAAM,CAAC,IAAI,CACT,gBAAgB,KAAK,mCAAmC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC9E,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -15,6 +15,39 @@ export declare function transformAgentSchema(agent: Agent): {
|
|
|
15
15
|
required: boolean;
|
|
16
16
|
description: string;
|
|
17
17
|
}[];
|
|
18
|
+
configuration: {
|
|
19
|
+
type: "function";
|
|
20
|
+
} | {
|
|
21
|
+
type: "api";
|
|
22
|
+
url: string;
|
|
23
|
+
method: "delete" | "get" | "post" | "put" | "patch";
|
|
24
|
+
contentType: "application/xml" | "application/json" | "text/plain" | "application/x-www-from-urlencoded";
|
|
25
|
+
headers: {
|
|
26
|
+
name: string;
|
|
27
|
+
value: string;
|
|
28
|
+
}[];
|
|
29
|
+
responseBody: {
|
|
30
|
+
id: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}[];
|
|
33
|
+
auth: {
|
|
34
|
+
type: "noAuth";
|
|
35
|
+
} | {
|
|
36
|
+
type: "apiKey";
|
|
37
|
+
key: string;
|
|
38
|
+
value: string;
|
|
39
|
+
} | {
|
|
40
|
+
type: "bearer";
|
|
41
|
+
tokenUrl: string;
|
|
42
|
+
username: string;
|
|
43
|
+
password: string;
|
|
44
|
+
tokenResponseField: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: "basic";
|
|
47
|
+
username: string;
|
|
48
|
+
password: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
18
51
|
resourceId?: string | null | undefined;
|
|
19
52
|
}[];
|
|
20
53
|
resourceId?: string | null | undefined;
|
package/dist/cjs/agentic/sdk.js
CHANGED
|
@@ -8,6 +8,90 @@ const nodes_1 = require("./nodes");
|
|
|
8
8
|
const agentSchema = String.raw `
|
|
9
9
|
import z from "zod";
|
|
10
10
|
|
|
11
|
+
const CommonStringSchema = z
|
|
12
|
+
.string()
|
|
13
|
+
.trim()
|
|
14
|
+
.min(1, { error: "This is required" })
|
|
15
|
+
.max(30, { error: "This can't exceed 30 charectors" });
|
|
16
|
+
|
|
17
|
+
type CommonString = z.infer<typeof CommonStringSchema>;
|
|
18
|
+
|
|
19
|
+
const FunctionConfigurationSchema = z.object({
|
|
20
|
+
type: z.literal("function"),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
type FunctionConfiguration = z.infer<typeof FunctionConfigurationSchema>;
|
|
24
|
+
|
|
25
|
+
const HeaderSchema = z.object({
|
|
26
|
+
name: CommonStringSchema,
|
|
27
|
+
value: CommonStringSchema,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
type Header = z.infer<typeof HeaderSchema>;
|
|
31
|
+
|
|
32
|
+
const NoAuthConfigurationSchema = z.object({
|
|
33
|
+
type: z.literal("noAuth"),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
type NoAuthConfig = z.infer<typeof NoAuthConfigurationSchema>;
|
|
37
|
+
|
|
38
|
+
const ApiKeyConfigurationSchema = z.object({
|
|
39
|
+
type: z.literal("apiKey"),
|
|
40
|
+
key: CommonStringSchema,
|
|
41
|
+
value: CommonStringSchema,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
type ApiKey = z.infer<typeof ApiKeyConfigurationSchema>;
|
|
45
|
+
|
|
46
|
+
const BearerTokenConfigurationSchema = z.object({
|
|
47
|
+
type: z.literal("bearer"),
|
|
48
|
+
tokenUrl: z.url(),
|
|
49
|
+
username: CommonStringSchema,
|
|
50
|
+
password: CommonStringSchema,
|
|
51
|
+
tokenResponseField: CommonStringSchema,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
type BearerToken = z.infer<typeof BearerTokenConfigurationSchema>;
|
|
55
|
+
|
|
56
|
+
const BasicAuthConfigurationSchema = z.object({
|
|
57
|
+
type: z.literal("basic"),
|
|
58
|
+
username: CommonStringSchema,
|
|
59
|
+
password: CommonStringSchema,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
type BasicAuth = z.infer<typeof BasicAuthConfigurationSchema>;
|
|
63
|
+
|
|
64
|
+
const ApiConfigurationSchema = z.object({
|
|
65
|
+
type: z.literal("api"),
|
|
66
|
+
url: z.url(),
|
|
67
|
+
method: z.enum(["get", "put", "post", "delete", "patch"]),
|
|
68
|
+
contentType: z.enum([
|
|
69
|
+
"application/json",
|
|
70
|
+
"application/xml",
|
|
71
|
+
"text/plain",
|
|
72
|
+
"application/x-www-from-urlencoded",
|
|
73
|
+
]),
|
|
74
|
+
headers: HeaderSchema.array(),
|
|
75
|
+
responseBody: z
|
|
76
|
+
.object({
|
|
77
|
+
id: CommonStringSchema,
|
|
78
|
+
value: CommonStringSchema,
|
|
79
|
+
})
|
|
80
|
+
.array(),
|
|
81
|
+
auth: z.discriminatedUnion("type", [
|
|
82
|
+
NoAuthConfigurationSchema,
|
|
83
|
+
ApiKeyConfigurationSchema,
|
|
84
|
+
BearerTokenConfigurationSchema,
|
|
85
|
+
BasicAuthConfigurationSchema,
|
|
86
|
+
]),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
type ApiConfiguration = z.infer<typeof ApiConfigurationSchema>;
|
|
90
|
+
|
|
91
|
+
const FullfillmentNodeDataSchema = z.discriminatedUnion("type", [
|
|
92
|
+
FunctionConfigurationSchema,
|
|
93
|
+
ApiConfigurationSchema,
|
|
94
|
+
]);
|
|
11
95
|
export const ParameterSchema = z.object({
|
|
12
96
|
name: z.string().describe("Name of the parameter"),
|
|
13
97
|
type: z
|
|
@@ -25,6 +109,7 @@ export const ToolSchema = z.object({
|
|
|
25
109
|
name: z.string().describe("Name of the tool"),
|
|
26
110
|
description: z.string().describe("Description of the tool"),
|
|
27
111
|
parameters: ParameterSchema.array().describe("Parameters for the tool"),
|
|
112
|
+
configuration: FullfillmentNodeDataSchema.describe("Configuration for fullfillment"),
|
|
28
113
|
});
|
|
29
114
|
|
|
30
115
|
export type Tool = z.infer<typeof ToolSchema>;
|
|
@@ -63,23 +148,35 @@ export const CommonStringSchema = z
|
|
|
63
148
|
export type CommonString = z.infer<typeof CommonStringSchema>;
|
|
64
149
|
|
|
65
150
|
const ConditionSchema = z.object({
|
|
66
|
-
id: CommonStringSchema,
|
|
67
151
|
expression: CommonStringSchema,
|
|
152
|
+
name: CommonStringSchema.describe("a short human readable name."),
|
|
153
|
+
isDefault: z
|
|
154
|
+
.boolean()
|
|
155
|
+
.default(false)
|
|
156
|
+
.describe(
|
|
157
|
+
"indicates if this is the default condition. if this is true then expression will be ignored."
|
|
158
|
+
),
|
|
68
159
|
});
|
|
69
160
|
|
|
70
161
|
type Condition = z.infer<typeof ConditionSchema>;
|
|
71
162
|
|
|
72
163
|
export const ConditionNodeDataSchema = z.object({
|
|
73
|
-
conditions: ConditionSchema.array()
|
|
164
|
+
conditions: ConditionSchema.array()
|
|
165
|
+
.min(1)
|
|
166
|
+
.describe("at least a default case will be present"),
|
|
74
167
|
});
|
|
75
168
|
|
|
76
169
|
export type ConditionNodeData = z.infer<typeof ConditionNodeDataSchema>;
|
|
77
170
|
|
|
78
|
-
export const ConditionNodeSchema = z
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
171
|
+
export const ConditionNodeSchema = z
|
|
172
|
+
.object({
|
|
173
|
+
id: z.string(),
|
|
174
|
+
type: z.literal(NodeType.conditionNode),
|
|
175
|
+
data: ConditionNodeDataSchema,
|
|
176
|
+
})
|
|
177
|
+
.describe(
|
|
178
|
+
"Conditional node allows agent to make decisions based on conditions"
|
|
179
|
+
);
|
|
83
180
|
|
|
84
181
|
export type ConditionNode = z.infer<typeof ConditionNodeSchema>;
|
|
85
182
|
|
|
@@ -172,17 +269,21 @@ export const FullfillmentNodeDataSchema = z.discriminatedUnion("type", [
|
|
|
172
269
|
|
|
173
270
|
export type FullfillmentNodeData = z.infer<typeof FullfillmentNodeDataSchema>;
|
|
174
271
|
|
|
175
|
-
export const FullfillmentNodeSchema = z
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
272
|
+
export const FullfillmentNodeSchema = z
|
|
273
|
+
.object({
|
|
274
|
+
id: z.string(),
|
|
275
|
+
type: z.literal(NodeType.fullfillmentNode),
|
|
276
|
+
data: FullfillmentNodeDataSchema,
|
|
277
|
+
})
|
|
278
|
+
.describe("It represents the end action node in the flow.");
|
|
180
279
|
|
|
181
280
|
export type FullfillmentNode = z.infer<typeof FullfillmentNodeSchema>;
|
|
182
281
|
|
|
183
282
|
export const NameDescriptionSchema = z.object({
|
|
184
|
-
name: CommonStringSchema,
|
|
185
|
-
description: CommonStringSchema
|
|
283
|
+
name: CommonStringSchema.describe("a short human readable name"),
|
|
284
|
+
description: CommonStringSchema.describe(
|
|
285
|
+
"a short human readable description about the node"
|
|
286
|
+
),
|
|
186
287
|
});
|
|
187
288
|
|
|
188
289
|
export type NameDescription = z.infer<typeof NameDescriptionSchema>;
|
|
@@ -194,39 +295,51 @@ export const ParameterNodeDataSchema = NameDescriptionSchema.extend({
|
|
|
194
295
|
|
|
195
296
|
export type ParameterNodeData = z.infer<typeof ParameterNodeDataSchema>;
|
|
196
297
|
|
|
197
|
-
export const ParameterNodeSchema = z
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
298
|
+
export const ParameterNodeSchema = z
|
|
299
|
+
.object({
|
|
300
|
+
id: z.string(),
|
|
301
|
+
type: z.literal(NodeType.parameterNode),
|
|
302
|
+
data: ParameterNodeDataSchema,
|
|
303
|
+
})
|
|
304
|
+
.describe(
|
|
305
|
+
"A Parameter node is used to define and pass parameters within the flow. It has both a target handle to receive input and a source handle to provide output."
|
|
306
|
+
);
|
|
202
307
|
|
|
203
308
|
export type ParameterNode = z.infer<typeof ParameterNodeSchema>;
|
|
204
309
|
|
|
205
310
|
export const StartNodeDataSchema = z.object({
|
|
206
|
-
resourceId: z.string().nullish()
|
|
311
|
+
resourceId: z.string().nullish(),
|
|
207
312
|
});
|
|
208
313
|
|
|
209
314
|
export type StartNodeData = z.infer<typeof StartNodeDataSchema>;
|
|
210
315
|
|
|
211
|
-
export const StartNodeSchema = z
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
316
|
+
export const StartNodeSchema = z
|
|
317
|
+
.object({
|
|
318
|
+
id: z.string(),
|
|
319
|
+
type: z.literal(NodeType.startNode),
|
|
320
|
+
data: StartNodeDataSchema,
|
|
321
|
+
})
|
|
322
|
+
.describe(
|
|
323
|
+
"The Start node represents the entry point of the flow. It acts as the parent of all tool nodes and contains only a target handle."
|
|
324
|
+
);
|
|
216
325
|
|
|
217
326
|
export type StartNode = z.infer<typeof StartNodeSchema>;
|
|
218
327
|
|
|
219
328
|
export const ToolNodeDataSchema = NameDescriptionSchema.extend({
|
|
220
|
-
resourceId: z.string().nullish()
|
|
329
|
+
resourceId: z.string().nullish(),
|
|
221
330
|
});
|
|
222
331
|
|
|
223
332
|
export type ToolNodeData = z.infer<typeof ToolNodeDataSchema>;
|
|
224
333
|
|
|
225
|
-
export const ToolNodeSchema = z
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
334
|
+
export const ToolNodeSchema = z
|
|
335
|
+
.object({
|
|
336
|
+
id: z.string(),
|
|
337
|
+
type: z.literal(NodeType.toolNode),
|
|
338
|
+
data: ToolNodeDataSchema,
|
|
339
|
+
})
|
|
340
|
+
.describe(
|
|
341
|
+
"A Tool node represents an executable step in the flow. It can receive input through a target handle and pass output through a source handle."
|
|
342
|
+
);
|
|
230
343
|
|
|
231
344
|
export type ToolNode = z.infer<typeof ToolNodeSchema>;
|
|
232
345
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../agentic/sdk.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../agentic/sdk.ts"],"names":[],"mappings":";;AAuYA,wCAsBC;AAGD,oDAEC;AAID,sDA8BC;AAsBD,0DAIC;AA9dD,mCAAwD;AAGxD,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4H7B,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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