chatbot-lex-design-builder 2.0.21 → 2.0.23
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/dto.d.ts +67 -0
- package/dist/cjs/agentic/nodes/dto.js +3 -0
- package/dist/cjs/agentic/nodes/dto.js.map +1 -0
- package/dist/cjs/agentic/sdk.d.ts +4 -1
- package/dist/cjs/agentic/sdk.js +110 -144
- package/dist/cjs/agentic/sdk.js.map +1 -1
- package/dist/esm/agentic/nodes/dto.d.ts +67 -0
- package/dist/esm/agentic/nodes/dto.js +2 -0
- package/dist/esm/agentic/nodes/dto.js.map +1 -0
- package/dist/esm/agentic/sdk.d.ts +4 -1
- package/dist/esm/agentic/sdk.js +108 -144
- package/dist/esm/agentic/sdk.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface ApiConfig {
|
|
2
|
+
url: string;
|
|
3
|
+
body: FormFieldSchema[];
|
|
4
|
+
mode: 'inputs' | 'outputs' | string;
|
|
5
|
+
alias: AliasMapping;
|
|
6
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | string;
|
|
7
|
+
headers: Header[];
|
|
8
|
+
contentType: string;
|
|
9
|
+
apiSchemaJson: string;
|
|
10
|
+
authConfig?: AuthConfig;
|
|
11
|
+
}
|
|
12
|
+
export type AuthConfig = NoAuth | ApiKeyAuth | BearerTokenAuth | BasicAuth;
|
|
13
|
+
export type NoAuth = {
|
|
14
|
+
type: "1";
|
|
15
|
+
authValue: any;
|
|
16
|
+
};
|
|
17
|
+
export type ApiKeyAuth = {
|
|
18
|
+
type: "2";
|
|
19
|
+
authValue: {
|
|
20
|
+
Key: "AuthApiHeader" | "AuthApiValue";
|
|
21
|
+
Value: string;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
export type AuthConfigItem = {
|
|
25
|
+
Key: "AuthBearerUsername";
|
|
26
|
+
Value: string;
|
|
27
|
+
} | {
|
|
28
|
+
Key: "AuthBearerPassword";
|
|
29
|
+
Value: string;
|
|
30
|
+
} | {
|
|
31
|
+
Key: "AuthBearerURL";
|
|
32
|
+
Value: string;
|
|
33
|
+
} | {
|
|
34
|
+
Key: "AuthBearerToken";
|
|
35
|
+
Value: string;
|
|
36
|
+
};
|
|
37
|
+
export type BearerTokenAuth = {
|
|
38
|
+
type: "3";
|
|
39
|
+
authValue: AuthConfigItem[];
|
|
40
|
+
};
|
|
41
|
+
export type AuthBasicConfigItem = {
|
|
42
|
+
Key: "AuthBasicUsername";
|
|
43
|
+
Value: string;
|
|
44
|
+
} | {
|
|
45
|
+
Key: "AuthBasicPassword";
|
|
46
|
+
Value: string;
|
|
47
|
+
};
|
|
48
|
+
export type BasicAuth = {
|
|
49
|
+
type: "4";
|
|
50
|
+
authValue: AuthBasicConfigItem[];
|
|
51
|
+
};
|
|
52
|
+
export interface FormFieldSchema {
|
|
53
|
+
key: string;
|
|
54
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array' | string;
|
|
55
|
+
required: boolean;
|
|
56
|
+
defaultValue: string | number | boolean | null;
|
|
57
|
+
}
|
|
58
|
+
export interface AliasMapping {
|
|
59
|
+
[fieldKey: string]: {
|
|
60
|
+
key: string;
|
|
61
|
+
alias: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export interface Header {
|
|
65
|
+
key: string;
|
|
66
|
+
value: string;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../../../agentic/nodes/dto.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Agent, WorkflowFile } from "./nodes";
|
|
1
|
+
import { Agent, Tool, WorkflowFile } from "./nodes";
|
|
2
|
+
import { ApiConfig } from "./nodes/dto";
|
|
2
3
|
export declare function getInstruction(workflow: any): string;
|
|
3
4
|
export declare function transformAgentSchema(agent: Agent): {
|
|
4
5
|
id: string;
|
|
@@ -61,4 +62,6 @@ export declare function updateWorkflowWrtDiff(oldWorkflow: WorkflowFile, newWork
|
|
|
61
62
|
deletedAgentResourceIds: string[];
|
|
62
63
|
deletedToolResourceIds: string[];
|
|
63
64
|
};
|
|
65
|
+
export declare function updateWorkflow(workflow: WorkflowFile, diff: UpdatedResourceDiff, resourceIdsToDelete: string[]): any;
|
|
64
66
|
export declare function getStartNodeResourceIds(workflow: WorkflowFile): any[];
|
|
67
|
+
export declare function toApiConfig({ configuration, parameters }: Tool): ApiConfig;
|
package/dist/cjs/agentic/sdk.js
CHANGED
|
@@ -3,95 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getInstruction = getInstruction;
|
|
4
4
|
exports.transformAgentSchema = transformAgentSchema;
|
|
5
5
|
exports.updateWorkflowWrtDiff = updateWorkflowWrtDiff;
|
|
6
|
+
exports.updateWorkflow = updateWorkflow;
|
|
6
7
|
exports.getStartNodeResourceIds = getStartNodeResourceIds;
|
|
8
|
+
exports.toApiConfig = toApiConfig;
|
|
9
|
+
const ts_pattern_1 = require("ts-pattern");
|
|
7
10
|
const nodes_1 = require("./nodes");
|
|
8
11
|
const agentSchema = String.raw `
|
|
9
12
|
import z from "zod";
|
|
10
13
|
|
|
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
|
-
]);
|
|
95
14
|
export const ParameterSchema = z.object({
|
|
96
15
|
name: z.string().describe("Name of the parameter"),
|
|
97
16
|
type: z
|
|
@@ -109,7 +28,6 @@ export const ToolSchema = z.object({
|
|
|
109
28
|
name: z.string().describe("Name of the tool"),
|
|
110
29
|
description: z.string().describe("Description of the tool"),
|
|
111
30
|
parameters: ParameterSchema.array().describe("Parameters for the tool"),
|
|
112
|
-
configuration: FullfillmentNodeDataSchema.describe("Configuration for fullfillment"),
|
|
113
31
|
});
|
|
114
32
|
|
|
115
33
|
export type Tool = z.infer<typeof ToolSchema>;
|
|
@@ -148,35 +66,23 @@ export const CommonStringSchema = z
|
|
|
148
66
|
export type CommonString = z.infer<typeof CommonStringSchema>;
|
|
149
67
|
|
|
150
68
|
const ConditionSchema = z.object({
|
|
69
|
+
id: CommonStringSchema,
|
|
151
70
|
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
|
-
),
|
|
159
71
|
});
|
|
160
72
|
|
|
161
73
|
type Condition = z.infer<typeof ConditionSchema>;
|
|
162
74
|
|
|
163
75
|
export const ConditionNodeDataSchema = z.object({
|
|
164
|
-
conditions: ConditionSchema.array()
|
|
165
|
-
.min(1)
|
|
166
|
-
.describe("at least a default case will be present"),
|
|
76
|
+
conditions: ConditionSchema.array().min(1),
|
|
167
77
|
});
|
|
168
78
|
|
|
169
79
|
export type ConditionNodeData = z.infer<typeof ConditionNodeDataSchema>;
|
|
170
80
|
|
|
171
|
-
export const ConditionNodeSchema = z
|
|
172
|
-
.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
})
|
|
177
|
-
.describe(
|
|
178
|
-
"Conditional node allows agent to make decisions based on conditions"
|
|
179
|
-
);
|
|
81
|
+
export const ConditionNodeSchema = z.object({
|
|
82
|
+
id: z.string(),
|
|
83
|
+
type: z.literal(NodeType.conditionNode),
|
|
84
|
+
data: ConditionNodeDataSchema,
|
|
85
|
+
});
|
|
180
86
|
|
|
181
87
|
export type ConditionNode = z.infer<typeof ConditionNodeSchema>;
|
|
182
88
|
|
|
@@ -269,21 +175,17 @@ export const FullfillmentNodeDataSchema = z.discriminatedUnion("type", [
|
|
|
269
175
|
|
|
270
176
|
export type FullfillmentNodeData = z.infer<typeof FullfillmentNodeDataSchema>;
|
|
271
177
|
|
|
272
|
-
export const FullfillmentNodeSchema = z
|
|
273
|
-
.
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
})
|
|
278
|
-
.describe("It represents the end action node in the flow.");
|
|
178
|
+
export const FullfillmentNodeSchema = z.object({
|
|
179
|
+
id: z.string(),
|
|
180
|
+
type: z.literal(NodeType.fullfillmentNode),
|
|
181
|
+
data: FullfillmentNodeDataSchema,
|
|
182
|
+
});
|
|
279
183
|
|
|
280
184
|
export type FullfillmentNode = z.infer<typeof FullfillmentNodeSchema>;
|
|
281
185
|
|
|
282
186
|
export const NameDescriptionSchema = z.object({
|
|
283
|
-
name: CommonStringSchema
|
|
284
|
-
description: CommonStringSchema
|
|
285
|
-
"a short human readable description about the node"
|
|
286
|
-
),
|
|
187
|
+
name: CommonStringSchema,
|
|
188
|
+
description: CommonStringSchema,
|
|
287
189
|
});
|
|
288
190
|
|
|
289
191
|
export type NameDescription = z.infer<typeof NameDescriptionSchema>;
|
|
@@ -295,51 +197,39 @@ export const ParameterNodeDataSchema = NameDescriptionSchema.extend({
|
|
|
295
197
|
|
|
296
198
|
export type ParameterNodeData = z.infer<typeof ParameterNodeDataSchema>;
|
|
297
199
|
|
|
298
|
-
export const ParameterNodeSchema = z
|
|
299
|
-
.
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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
|
-
);
|
|
200
|
+
export const ParameterNodeSchema = z.object({
|
|
201
|
+
id: z.string(),
|
|
202
|
+
type: z.literal(NodeType.parameterNode),
|
|
203
|
+
data: ParameterNodeDataSchema,
|
|
204
|
+
});
|
|
307
205
|
|
|
308
206
|
export type ParameterNode = z.infer<typeof ParameterNodeSchema>;
|
|
309
207
|
|
|
310
208
|
export const StartNodeDataSchema = z.object({
|
|
311
|
-
resourceId: z.string().nullish()
|
|
209
|
+
resourceId: z.string().nullish()
|
|
312
210
|
});
|
|
313
211
|
|
|
314
212
|
export type StartNodeData = z.infer<typeof StartNodeDataSchema>;
|
|
315
213
|
|
|
316
|
-
export const StartNodeSchema = z
|
|
317
|
-
.
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
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
|
-
);
|
|
214
|
+
export const StartNodeSchema = z.object({
|
|
215
|
+
id: z.string(),
|
|
216
|
+
type: z.literal(NodeType.startNode),
|
|
217
|
+
data: StartNodeDataSchema,
|
|
218
|
+
});
|
|
325
219
|
|
|
326
220
|
export type StartNode = z.infer<typeof StartNodeSchema>;
|
|
327
221
|
|
|
328
222
|
export const ToolNodeDataSchema = NameDescriptionSchema.extend({
|
|
329
|
-
resourceId: z.string().nullish()
|
|
223
|
+
resourceId: z.string().nullish()
|
|
330
224
|
});
|
|
331
225
|
|
|
332
226
|
export type ToolNodeData = z.infer<typeof ToolNodeDataSchema>;
|
|
333
227
|
|
|
334
|
-
export const ToolNodeSchema = z
|
|
335
|
-
.
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
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
|
-
);
|
|
228
|
+
export const ToolNodeSchema = z.object({
|
|
229
|
+
id: z.string(),
|
|
230
|
+
type: z.literal(NodeType.toolNode),
|
|
231
|
+
data: ToolNodeDataSchema,
|
|
232
|
+
});
|
|
343
233
|
|
|
344
234
|
export type ToolNode = z.infer<typeof ToolNodeSchema>;
|
|
345
235
|
|
|
@@ -445,6 +335,39 @@ function updateWorkflowWrtDiff(oldWorkflow, newWorkflow, diff) {
|
|
|
445
335
|
deletedToolResourceIds
|
|
446
336
|
};
|
|
447
337
|
}
|
|
338
|
+
function updateWorkflow(workflow, diff, resourceIdsToDelete) {
|
|
339
|
+
const _newWorkflow = JSON.parse(JSON.stringify(workflow));
|
|
340
|
+
// update resource ids in new workflow based on diff
|
|
341
|
+
diff.forEach(({ nodeId, resourceId }) => {
|
|
342
|
+
const node = _newWorkflow.graph.nodes.find((n) => n.id === nodeId);
|
|
343
|
+
if (node) {
|
|
344
|
+
node.data.resourceId = resourceId;
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
// remove edges associated with deleted nodes
|
|
348
|
+
_newWorkflow.graph.edges = _newWorkflow.graph.edges.filter((edge) => {
|
|
349
|
+
const sourceNode = _newWorkflow.graph.nodes.find((n) => n.id === edge.source);
|
|
350
|
+
const targetNode = _newWorkflow.graph.nodes.find((n) => n.id === edge.target);
|
|
351
|
+
if (sourceNode && targetNode) {
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
return false;
|
|
355
|
+
});
|
|
356
|
+
// remove tools and start nodes which are deleted in new workflow
|
|
357
|
+
_newWorkflow.graph.nodes = _newWorkflow.graph.nodes.filter((node) => {
|
|
358
|
+
var _a, _b;
|
|
359
|
+
if (node.type === nodes_1.NodeType.startNode) {
|
|
360
|
+
const resourceId = (_a = node.data) === null || _a === void 0 ? void 0 : _a.resourceId;
|
|
361
|
+
return !resourceIdsToDelete.includes(resourceId);
|
|
362
|
+
}
|
|
363
|
+
else if (node.type === nodes_1.NodeType.toolNode) {
|
|
364
|
+
const resourceId = (_b = node.data) === null || _b === void 0 ? void 0 : _b.resourceId;
|
|
365
|
+
return !resourceIdsToDelete.includes(resourceId);
|
|
366
|
+
}
|
|
367
|
+
return true;
|
|
368
|
+
});
|
|
369
|
+
return _newWorkflow;
|
|
370
|
+
}
|
|
448
371
|
function getDeletedAgentResourceIds(oldWorkflow, newWorkflow) {
|
|
449
372
|
const oldAgentIds = new Set(getStartNodeResourceIds(oldWorkflow).filter(Boolean));
|
|
450
373
|
const newAgentIds = new Set(getStartNodeResourceIds(newWorkflow).filter(Boolean));
|
|
@@ -465,4 +388,47 @@ function getStartNodeResourceIds(workflow) {
|
|
|
465
388
|
.filter((n) => n.type === nodes_1.NodeType.startNode)
|
|
466
389
|
.map((n) => { var _a; return (_a = n.data) === null || _a === void 0 ? void 0 : _a.resourceId; });
|
|
467
390
|
}
|
|
391
|
+
function toApiConfig({ configuration, parameters }) {
|
|
392
|
+
return configuration.type === 'api' ? {
|
|
393
|
+
url: configuration.url,
|
|
394
|
+
body: parameters.map(param => ({
|
|
395
|
+
key: param.name,
|
|
396
|
+
defaultValue: "",
|
|
397
|
+
type: param.type,
|
|
398
|
+
required: param.required
|
|
399
|
+
})),
|
|
400
|
+
mode: "inputs",
|
|
401
|
+
alias: configuration.responseBody.reduce((acc, curr) => {
|
|
402
|
+
acc[curr.id] = { key: curr.id, alias: curr.value };
|
|
403
|
+
return acc;
|
|
404
|
+
}, {}),
|
|
405
|
+
method: configuration.method.toUpperCase(),
|
|
406
|
+
headers: configuration.headers.map(h => ({ key: h.name, value: h.value })),
|
|
407
|
+
contentType: configuration.contentType,
|
|
408
|
+
apiSchemaJson: "",
|
|
409
|
+
authConfig: toAuthConfig(configuration.auth)
|
|
410
|
+
} : {};
|
|
411
|
+
}
|
|
412
|
+
function toAuthConfig(config) {
|
|
413
|
+
return (0, ts_pattern_1.match)(config)
|
|
414
|
+
.with({ type: "noAuth" }, () => ({ type: "1", authValue: {} }))
|
|
415
|
+
.with({ type: "apiKey" }, (c) => ({
|
|
416
|
+
type: "2", authValue: [{ Key: "AuthApiHeader", Value: c.key }, { Key: "AuthApiValue", Value: c.value }],
|
|
417
|
+
}))
|
|
418
|
+
.with({ type: "bearer" }, (c) => ({
|
|
419
|
+
type: "3", authValue: [
|
|
420
|
+
{ Key: "AuthBearerUsername", Value: c.username },
|
|
421
|
+
{ Key: "AuthBearerPassword", Value: c.password },
|
|
422
|
+
{ Key: "AuthBearerURL", Value: c.tokenUrl },
|
|
423
|
+
{ Key: "AuthBearerToken", Value: c.tokenResponseField },
|
|
424
|
+
],
|
|
425
|
+
}))
|
|
426
|
+
.with({ type: "basic" }, (c) => ({
|
|
427
|
+
type: "4", authValue: [
|
|
428
|
+
{ Key: "AuthBasicUsername", Value: c.username },
|
|
429
|
+
{ Key: "AuthBasicPassword", Value: c.password },
|
|
430
|
+
],
|
|
431
|
+
}))
|
|
432
|
+
.otherwise(() => undefined);
|
|
433
|
+
}
|
|
468
434
|
//# sourceMappingURL=sdk.js.map
|
|
@@ -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":";;AAwRA,wCAsBC;A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,EAAE,CAAC,CAAC,kBAAkB,EAAE;SACxD;KACF,CAA2B,CAAC;SAC5B,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/B,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE;YACpB,EAAE,GAAG,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE;YAC/C,EAAE,GAAG,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE;SAChD;KACF,CAAqB,CAAC;SACtB,SAAS,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface ApiConfig {
|
|
2
|
+
url: string;
|
|
3
|
+
body: FormFieldSchema[];
|
|
4
|
+
mode: 'inputs' | 'outputs' | string;
|
|
5
|
+
alias: AliasMapping;
|
|
6
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | string;
|
|
7
|
+
headers: Header[];
|
|
8
|
+
contentType: string;
|
|
9
|
+
apiSchemaJson: string;
|
|
10
|
+
authConfig?: AuthConfig;
|
|
11
|
+
}
|
|
12
|
+
export type AuthConfig = NoAuth | ApiKeyAuth | BearerTokenAuth | BasicAuth;
|
|
13
|
+
export type NoAuth = {
|
|
14
|
+
type: "1";
|
|
15
|
+
authValue: any;
|
|
16
|
+
};
|
|
17
|
+
export type ApiKeyAuth = {
|
|
18
|
+
type: "2";
|
|
19
|
+
authValue: {
|
|
20
|
+
Key: "AuthApiHeader" | "AuthApiValue";
|
|
21
|
+
Value: string;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
export type AuthConfigItem = {
|
|
25
|
+
Key: "AuthBearerUsername";
|
|
26
|
+
Value: string;
|
|
27
|
+
} | {
|
|
28
|
+
Key: "AuthBearerPassword";
|
|
29
|
+
Value: string;
|
|
30
|
+
} | {
|
|
31
|
+
Key: "AuthBearerURL";
|
|
32
|
+
Value: string;
|
|
33
|
+
} | {
|
|
34
|
+
Key: "AuthBearerToken";
|
|
35
|
+
Value: string;
|
|
36
|
+
};
|
|
37
|
+
export type BearerTokenAuth = {
|
|
38
|
+
type: "3";
|
|
39
|
+
authValue: AuthConfigItem[];
|
|
40
|
+
};
|
|
41
|
+
export type AuthBasicConfigItem = {
|
|
42
|
+
Key: "AuthBasicUsername";
|
|
43
|
+
Value: string;
|
|
44
|
+
} | {
|
|
45
|
+
Key: "AuthBasicPassword";
|
|
46
|
+
Value: string;
|
|
47
|
+
};
|
|
48
|
+
export type BasicAuth = {
|
|
49
|
+
type: "4";
|
|
50
|
+
authValue: AuthBasicConfigItem[];
|
|
51
|
+
};
|
|
52
|
+
export interface FormFieldSchema {
|
|
53
|
+
key: string;
|
|
54
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array' | string;
|
|
55
|
+
required: boolean;
|
|
56
|
+
defaultValue: string | number | boolean | null;
|
|
57
|
+
}
|
|
58
|
+
export interface AliasMapping {
|
|
59
|
+
[fieldKey: string]: {
|
|
60
|
+
key: string;
|
|
61
|
+
alias: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export interface Header {
|
|
65
|
+
key: string;
|
|
66
|
+
value: string;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../../../agentic/nodes/dto.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Agent, WorkflowFile } from "./nodes";
|
|
1
|
+
import { Agent, Tool, WorkflowFile } from "./nodes";
|
|
2
|
+
import { ApiConfig } from "./nodes/dto";
|
|
2
3
|
export declare function getInstruction(workflow: any): string;
|
|
3
4
|
export declare function transformAgentSchema(agent: Agent): {
|
|
4
5
|
id: string;
|
|
@@ -61,4 +62,6 @@ export declare function updateWorkflowWrtDiff(oldWorkflow: WorkflowFile, newWork
|
|
|
61
62
|
deletedAgentResourceIds: string[];
|
|
62
63
|
deletedToolResourceIds: string[];
|
|
63
64
|
};
|
|
65
|
+
export declare function updateWorkflow(workflow: WorkflowFile, diff: UpdatedResourceDiff, resourceIdsToDelete: string[]): any;
|
|
64
66
|
export declare function getStartNodeResourceIds(workflow: WorkflowFile): any[];
|
|
67
|
+
export declare function toApiConfig({ configuration, parameters }: Tool): ApiConfig;
|
package/dist/esm/agentic/sdk.js
CHANGED
|
@@ -1,91 +1,8 @@
|
|
|
1
|
+
import { match } from "ts-pattern";
|
|
1
2
|
import { NodeType } from "./nodes";
|
|
2
3
|
const agentSchema = String.raw `
|
|
3
4
|
import z from "zod";
|
|
4
5
|
|
|
5
|
-
const CommonStringSchema = z
|
|
6
|
-
.string()
|
|
7
|
-
.trim()
|
|
8
|
-
.min(1, { error: "This is required" })
|
|
9
|
-
.max(30, { error: "This can't exceed 30 charectors" });
|
|
10
|
-
|
|
11
|
-
type CommonString = z.infer<typeof CommonStringSchema>;
|
|
12
|
-
|
|
13
|
-
const FunctionConfigurationSchema = z.object({
|
|
14
|
-
type: z.literal("function"),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
type FunctionConfiguration = z.infer<typeof FunctionConfigurationSchema>;
|
|
18
|
-
|
|
19
|
-
const HeaderSchema = z.object({
|
|
20
|
-
name: CommonStringSchema,
|
|
21
|
-
value: CommonStringSchema,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
type Header = z.infer<typeof HeaderSchema>;
|
|
25
|
-
|
|
26
|
-
const NoAuthConfigurationSchema = z.object({
|
|
27
|
-
type: z.literal("noAuth"),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
type NoAuthConfig = z.infer<typeof NoAuthConfigurationSchema>;
|
|
31
|
-
|
|
32
|
-
const ApiKeyConfigurationSchema = z.object({
|
|
33
|
-
type: z.literal("apiKey"),
|
|
34
|
-
key: CommonStringSchema,
|
|
35
|
-
value: CommonStringSchema,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
type ApiKey = z.infer<typeof ApiKeyConfigurationSchema>;
|
|
39
|
-
|
|
40
|
-
const BearerTokenConfigurationSchema = z.object({
|
|
41
|
-
type: z.literal("bearer"),
|
|
42
|
-
tokenUrl: z.url(),
|
|
43
|
-
username: CommonStringSchema,
|
|
44
|
-
password: CommonStringSchema,
|
|
45
|
-
tokenResponseField: CommonStringSchema,
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
type BearerToken = z.infer<typeof BearerTokenConfigurationSchema>;
|
|
49
|
-
|
|
50
|
-
const BasicAuthConfigurationSchema = z.object({
|
|
51
|
-
type: z.literal("basic"),
|
|
52
|
-
username: CommonStringSchema,
|
|
53
|
-
password: CommonStringSchema,
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
type BasicAuth = z.infer<typeof BasicAuthConfigurationSchema>;
|
|
57
|
-
|
|
58
|
-
const ApiConfigurationSchema = z.object({
|
|
59
|
-
type: z.literal("api"),
|
|
60
|
-
url: z.url(),
|
|
61
|
-
method: z.enum(["get", "put", "post", "delete", "patch"]),
|
|
62
|
-
contentType: z.enum([
|
|
63
|
-
"application/json",
|
|
64
|
-
"application/xml",
|
|
65
|
-
"text/plain",
|
|
66
|
-
"application/x-www-from-urlencoded",
|
|
67
|
-
]),
|
|
68
|
-
headers: HeaderSchema.array(),
|
|
69
|
-
responseBody: z
|
|
70
|
-
.object({
|
|
71
|
-
id: CommonStringSchema,
|
|
72
|
-
value: CommonStringSchema,
|
|
73
|
-
})
|
|
74
|
-
.array(),
|
|
75
|
-
auth: z.discriminatedUnion("type", [
|
|
76
|
-
NoAuthConfigurationSchema,
|
|
77
|
-
ApiKeyConfigurationSchema,
|
|
78
|
-
BearerTokenConfigurationSchema,
|
|
79
|
-
BasicAuthConfigurationSchema,
|
|
80
|
-
]),
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
type ApiConfiguration = z.infer<typeof ApiConfigurationSchema>;
|
|
84
|
-
|
|
85
|
-
const FullfillmentNodeDataSchema = z.discriminatedUnion("type", [
|
|
86
|
-
FunctionConfigurationSchema,
|
|
87
|
-
ApiConfigurationSchema,
|
|
88
|
-
]);
|
|
89
6
|
export const ParameterSchema = z.object({
|
|
90
7
|
name: z.string().describe("Name of the parameter"),
|
|
91
8
|
type: z
|
|
@@ -103,7 +20,6 @@ export const ToolSchema = z.object({
|
|
|
103
20
|
name: z.string().describe("Name of the tool"),
|
|
104
21
|
description: z.string().describe("Description of the tool"),
|
|
105
22
|
parameters: ParameterSchema.array().describe("Parameters for the tool"),
|
|
106
|
-
configuration: FullfillmentNodeDataSchema.describe("Configuration for fullfillment"),
|
|
107
23
|
});
|
|
108
24
|
|
|
109
25
|
export type Tool = z.infer<typeof ToolSchema>;
|
|
@@ -142,35 +58,23 @@ export const CommonStringSchema = z
|
|
|
142
58
|
export type CommonString = z.infer<typeof CommonStringSchema>;
|
|
143
59
|
|
|
144
60
|
const ConditionSchema = z.object({
|
|
61
|
+
id: CommonStringSchema,
|
|
145
62
|
expression: CommonStringSchema,
|
|
146
|
-
name: CommonStringSchema.describe("a short human readable name."),
|
|
147
|
-
isDefault: z
|
|
148
|
-
.boolean()
|
|
149
|
-
.default(false)
|
|
150
|
-
.describe(
|
|
151
|
-
"indicates if this is the default condition. if this is true then expression will be ignored."
|
|
152
|
-
),
|
|
153
63
|
});
|
|
154
64
|
|
|
155
65
|
type Condition = z.infer<typeof ConditionSchema>;
|
|
156
66
|
|
|
157
67
|
export const ConditionNodeDataSchema = z.object({
|
|
158
|
-
conditions: ConditionSchema.array()
|
|
159
|
-
.min(1)
|
|
160
|
-
.describe("at least a default case will be present"),
|
|
68
|
+
conditions: ConditionSchema.array().min(1),
|
|
161
69
|
});
|
|
162
70
|
|
|
163
71
|
export type ConditionNodeData = z.infer<typeof ConditionNodeDataSchema>;
|
|
164
72
|
|
|
165
|
-
export const ConditionNodeSchema = z
|
|
166
|
-
.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
})
|
|
171
|
-
.describe(
|
|
172
|
-
"Conditional node allows agent to make decisions based on conditions"
|
|
173
|
-
);
|
|
73
|
+
export const ConditionNodeSchema = z.object({
|
|
74
|
+
id: z.string(),
|
|
75
|
+
type: z.literal(NodeType.conditionNode),
|
|
76
|
+
data: ConditionNodeDataSchema,
|
|
77
|
+
});
|
|
174
78
|
|
|
175
79
|
export type ConditionNode = z.infer<typeof ConditionNodeSchema>;
|
|
176
80
|
|
|
@@ -263,21 +167,17 @@ export const FullfillmentNodeDataSchema = z.discriminatedUnion("type", [
|
|
|
263
167
|
|
|
264
168
|
export type FullfillmentNodeData = z.infer<typeof FullfillmentNodeDataSchema>;
|
|
265
169
|
|
|
266
|
-
export const FullfillmentNodeSchema = z
|
|
267
|
-
.
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
})
|
|
272
|
-
.describe("It represents the end action node in the flow.");
|
|
170
|
+
export const FullfillmentNodeSchema = z.object({
|
|
171
|
+
id: z.string(),
|
|
172
|
+
type: z.literal(NodeType.fullfillmentNode),
|
|
173
|
+
data: FullfillmentNodeDataSchema,
|
|
174
|
+
});
|
|
273
175
|
|
|
274
176
|
export type FullfillmentNode = z.infer<typeof FullfillmentNodeSchema>;
|
|
275
177
|
|
|
276
178
|
export const NameDescriptionSchema = z.object({
|
|
277
|
-
name: CommonStringSchema
|
|
278
|
-
description: CommonStringSchema
|
|
279
|
-
"a short human readable description about the node"
|
|
280
|
-
),
|
|
179
|
+
name: CommonStringSchema,
|
|
180
|
+
description: CommonStringSchema,
|
|
281
181
|
});
|
|
282
182
|
|
|
283
183
|
export type NameDescription = z.infer<typeof NameDescriptionSchema>;
|
|
@@ -289,51 +189,39 @@ export const ParameterNodeDataSchema = NameDescriptionSchema.extend({
|
|
|
289
189
|
|
|
290
190
|
export type ParameterNodeData = z.infer<typeof ParameterNodeDataSchema>;
|
|
291
191
|
|
|
292
|
-
export const ParameterNodeSchema = z
|
|
293
|
-
.
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
})
|
|
298
|
-
.describe(
|
|
299
|
-
"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."
|
|
300
|
-
);
|
|
192
|
+
export const ParameterNodeSchema = z.object({
|
|
193
|
+
id: z.string(),
|
|
194
|
+
type: z.literal(NodeType.parameterNode),
|
|
195
|
+
data: ParameterNodeDataSchema,
|
|
196
|
+
});
|
|
301
197
|
|
|
302
198
|
export type ParameterNode = z.infer<typeof ParameterNodeSchema>;
|
|
303
199
|
|
|
304
200
|
export const StartNodeDataSchema = z.object({
|
|
305
|
-
resourceId: z.string().nullish()
|
|
201
|
+
resourceId: z.string().nullish()
|
|
306
202
|
});
|
|
307
203
|
|
|
308
204
|
export type StartNodeData = z.infer<typeof StartNodeDataSchema>;
|
|
309
205
|
|
|
310
|
-
export const StartNodeSchema = z
|
|
311
|
-
.
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
})
|
|
316
|
-
.describe(
|
|
317
|
-
"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."
|
|
318
|
-
);
|
|
206
|
+
export const StartNodeSchema = z.object({
|
|
207
|
+
id: z.string(),
|
|
208
|
+
type: z.literal(NodeType.startNode),
|
|
209
|
+
data: StartNodeDataSchema,
|
|
210
|
+
});
|
|
319
211
|
|
|
320
212
|
export type StartNode = z.infer<typeof StartNodeSchema>;
|
|
321
213
|
|
|
322
214
|
export const ToolNodeDataSchema = NameDescriptionSchema.extend({
|
|
323
|
-
resourceId: z.string().nullish()
|
|
215
|
+
resourceId: z.string().nullish()
|
|
324
216
|
});
|
|
325
217
|
|
|
326
218
|
export type ToolNodeData = z.infer<typeof ToolNodeDataSchema>;
|
|
327
219
|
|
|
328
|
-
export const ToolNodeSchema = z
|
|
329
|
-
.
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
})
|
|
334
|
-
.describe(
|
|
335
|
-
"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."
|
|
336
|
-
);
|
|
220
|
+
export const ToolNodeSchema = z.object({
|
|
221
|
+
id: z.string(),
|
|
222
|
+
type: z.literal(NodeType.toolNode),
|
|
223
|
+
data: ToolNodeDataSchema,
|
|
224
|
+
});
|
|
337
225
|
|
|
338
226
|
export type ToolNode = z.infer<typeof ToolNodeSchema>;
|
|
339
227
|
|
|
@@ -439,6 +327,39 @@ export function updateWorkflowWrtDiff(oldWorkflow, newWorkflow, diff) {
|
|
|
439
327
|
deletedToolResourceIds
|
|
440
328
|
};
|
|
441
329
|
}
|
|
330
|
+
export function updateWorkflow(workflow, diff, resourceIdsToDelete) {
|
|
331
|
+
const _newWorkflow = JSON.parse(JSON.stringify(workflow));
|
|
332
|
+
// update resource ids in new workflow based on diff
|
|
333
|
+
diff.forEach(({ nodeId, resourceId }) => {
|
|
334
|
+
const node = _newWorkflow.graph.nodes.find((n) => n.id === nodeId);
|
|
335
|
+
if (node) {
|
|
336
|
+
node.data.resourceId = resourceId;
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
// remove edges associated with deleted nodes
|
|
340
|
+
_newWorkflow.graph.edges = _newWorkflow.graph.edges.filter((edge) => {
|
|
341
|
+
const sourceNode = _newWorkflow.graph.nodes.find((n) => n.id === edge.source);
|
|
342
|
+
const targetNode = _newWorkflow.graph.nodes.find((n) => n.id === edge.target);
|
|
343
|
+
if (sourceNode && targetNode) {
|
|
344
|
+
return true;
|
|
345
|
+
}
|
|
346
|
+
return false;
|
|
347
|
+
});
|
|
348
|
+
// remove tools and start nodes which are deleted in new workflow
|
|
349
|
+
_newWorkflow.graph.nodes = _newWorkflow.graph.nodes.filter((node) => {
|
|
350
|
+
var _a, _b;
|
|
351
|
+
if (node.type === NodeType.startNode) {
|
|
352
|
+
const resourceId = (_a = node.data) === null || _a === void 0 ? void 0 : _a.resourceId;
|
|
353
|
+
return !resourceIdsToDelete.includes(resourceId);
|
|
354
|
+
}
|
|
355
|
+
else if (node.type === NodeType.toolNode) {
|
|
356
|
+
const resourceId = (_b = node.data) === null || _b === void 0 ? void 0 : _b.resourceId;
|
|
357
|
+
return !resourceIdsToDelete.includes(resourceId);
|
|
358
|
+
}
|
|
359
|
+
return true;
|
|
360
|
+
});
|
|
361
|
+
return _newWorkflow;
|
|
362
|
+
}
|
|
442
363
|
function getDeletedAgentResourceIds(oldWorkflow, newWorkflow) {
|
|
443
364
|
const oldAgentIds = new Set(getStartNodeResourceIds(oldWorkflow).filter(Boolean));
|
|
444
365
|
const newAgentIds = new Set(getStartNodeResourceIds(newWorkflow).filter(Boolean));
|
|
@@ -459,4 +380,47 @@ export function getStartNodeResourceIds(workflow) {
|
|
|
459
380
|
.filter((n) => n.type === NodeType.startNode)
|
|
460
381
|
.map((n) => { var _a; return (_a = n.data) === null || _a === void 0 ? void 0 : _a.resourceId; });
|
|
461
382
|
}
|
|
383
|
+
export function toApiConfig({ configuration, parameters }) {
|
|
384
|
+
return configuration.type === 'api' ? {
|
|
385
|
+
url: configuration.url,
|
|
386
|
+
body: parameters.map(param => ({
|
|
387
|
+
key: param.name,
|
|
388
|
+
defaultValue: "",
|
|
389
|
+
type: param.type,
|
|
390
|
+
required: param.required
|
|
391
|
+
})),
|
|
392
|
+
mode: "inputs",
|
|
393
|
+
alias: configuration.responseBody.reduce((acc, curr) => {
|
|
394
|
+
acc[curr.id] = { key: curr.id, alias: curr.value };
|
|
395
|
+
return acc;
|
|
396
|
+
}, {}),
|
|
397
|
+
method: configuration.method.toUpperCase(),
|
|
398
|
+
headers: configuration.headers.map(h => ({ key: h.name, value: h.value })),
|
|
399
|
+
contentType: configuration.contentType,
|
|
400
|
+
apiSchemaJson: "",
|
|
401
|
+
authConfig: toAuthConfig(configuration.auth)
|
|
402
|
+
} : {};
|
|
403
|
+
}
|
|
404
|
+
function toAuthConfig(config) {
|
|
405
|
+
return match(config)
|
|
406
|
+
.with({ type: "noAuth" }, () => ({ type: "1", authValue: {} }))
|
|
407
|
+
.with({ type: "apiKey" }, (c) => ({
|
|
408
|
+
type: "2", authValue: [{ Key: "AuthApiHeader", Value: c.key }, { Key: "AuthApiValue", Value: c.value }],
|
|
409
|
+
}))
|
|
410
|
+
.with({ type: "bearer" }, (c) => ({
|
|
411
|
+
type: "3", authValue: [
|
|
412
|
+
{ Key: "AuthBearerUsername", Value: c.username },
|
|
413
|
+
{ Key: "AuthBearerPassword", Value: c.password },
|
|
414
|
+
{ Key: "AuthBearerURL", Value: c.tokenUrl },
|
|
415
|
+
{ Key: "AuthBearerToken", Value: c.tokenResponseField },
|
|
416
|
+
],
|
|
417
|
+
}))
|
|
418
|
+
.with({ type: "basic" }, (c) => ({
|
|
419
|
+
type: "4", authValue: [
|
|
420
|
+
{ Key: "AuthBasicUsername", Value: c.username },
|
|
421
|
+
{ Key: "AuthBasicPassword", Value: c.password },
|
|
422
|
+
],
|
|
423
|
+
}))
|
|
424
|
+
.otherwise(() => undefined);
|
|
425
|
+
}
|
|
462
426
|
//# sourceMappingURL=sdk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../agentic/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../agentic/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAA2B,QAAQ,EAAsB,MAAM,SAAS,CAAC;AAIhF,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuC7B,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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