@arvo-tools/agentic 1.0.0 → 1.1.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/dist/Agent/AgentDefaults.d.ts +10 -2
- package/dist/Agent/AgentDefaults.d.ts.map +1 -1
- package/dist/Agent/AgentDefaults.js +27 -11
- package/dist/Agent/AgentDefaults.js.map +1 -1
- package/dist/Agent/agentLoop.d.ts +25 -11
- package/dist/Agent/agentLoop.d.ts.map +1 -1
- package/dist/Agent/agentLoop.js +84 -23
- package/dist/Agent/agentLoop.js.map +1 -1
- package/dist/Agent/index.d.ts +5 -1
- package/dist/Agent/index.d.ts.map +1 -1
- package/dist/Agent/index.js +61 -30
- package/dist/Agent/index.js.map +1 -1
- package/dist/Agent/schema.d.ts +76 -76
- package/dist/Agent/schema.js +4 -4
- package/dist/Agent/schema.js.map +1 -1
- package/dist/Agent/stream/schema.d.ts +456 -0
- package/dist/Agent/stream/schema.d.ts.map +1 -0
- package/dist/Agent/stream/schema.js +88 -0
- package/dist/Agent/stream/schema.js.map +1 -0
- package/dist/Agent/stream/types.d.ts +13 -0
- package/dist/Agent/stream/types.d.ts.map +1 -0
- package/dist/Agent/stream/types.js +3 -0
- package/dist/Agent/stream/types.js.map +1 -0
- package/dist/Agent/stream/utils.d.ts +23 -0
- package/dist/Agent/stream/utils.d.ts.map +1 -0
- package/dist/Agent/stream/utils.js +37 -0
- package/dist/Agent/stream/utils.js.map +1 -0
- package/dist/Agent/types.d.ts +15 -2
- package/dist/Agent/types.d.ts.map +1 -1
- package/dist/AgentTool/index.d.ts +26 -0
- package/dist/AgentTool/index.d.ts.map +1 -1
- package/dist/AgentTool/index.js +26 -0
- package/dist/AgentTool/index.js.map +1 -1
- package/dist/AgentTool/types.d.ts +42 -4
- package/dist/AgentTool/types.d.ts.map +1 -1
- package/dist/Integrations/anthropic/index.d.ts +24 -0
- package/dist/Integrations/anthropic/index.d.ts.map +1 -0
- package/dist/Integrations/anthropic/index.js +278 -0
- package/dist/Integrations/anthropic/index.js.map +1 -0
- package/dist/Integrations/anthropic/types.d.ts +17 -0
- package/dist/Integrations/anthropic/types.d.ts.map +1 -0
- package/dist/Integrations/anthropic/types.js +3 -0
- package/dist/Integrations/anthropic/types.js.map +1 -0
- package/dist/Integrations/anthropic/utils.d.ts +14 -0
- package/dist/Integrations/anthropic/utils.d.ts.map +1 -0
- package/dist/Integrations/anthropic/utils.js +158 -0
- package/dist/Integrations/anthropic/utils.js.map +1 -0
- package/dist/Integrations/openai/index.d.ts +15 -19
- package/dist/Integrations/openai/index.d.ts.map +1 -1
- package/dist/Integrations/openai/index.js +74 -179
- package/dist/Integrations/openai/index.js.map +1 -1
- package/dist/Integrations/openai/types.d.ts +33 -0
- package/dist/Integrations/openai/types.d.ts.map +1 -0
- package/dist/Integrations/openai/types.js +3 -0
- package/dist/Integrations/openai/types.js.map +1 -0
- package/dist/Integrations/openai/utils.d.ts +13 -0
- package/dist/Integrations/openai/utils.d.ts.map +1 -0
- package/dist/Integrations/openai/utils.js +133 -0
- package/dist/Integrations/openai/utils.js.map +1 -0
- package/dist/Integrations/prompts.d.ts +1 -0
- package/dist/Integrations/prompts.d.ts.map +1 -1
- package/dist/Integrations/prompts.js +5 -1
- package/dist/Integrations/prompts.js.map +1 -1
- package/dist/Integrations/types.d.ts +41 -1
- package/dist/Integrations/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const AgentStreamEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"agent.init">;
|
|
4
|
+
data: z.ZodObject<{
|
|
5
|
+
system: z.ZodNullable<z.ZodString>;
|
|
6
|
+
messages: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">;
|
|
7
|
+
tools: z.ZodArray<z.ZodString, "many">;
|
|
8
|
+
llmResponseType: z.ZodString;
|
|
9
|
+
toolIteractionCycle: z.ZodObject<{
|
|
10
|
+
max: z.ZodNumber;
|
|
11
|
+
current: z.ZodNumber;
|
|
12
|
+
exhausted: z.ZodBoolean;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
max: number;
|
|
15
|
+
current: number;
|
|
16
|
+
exhausted: boolean;
|
|
17
|
+
}, {
|
|
18
|
+
max: number;
|
|
19
|
+
current: number;
|
|
20
|
+
exhausted: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
system: string | null;
|
|
24
|
+
messages: Record<string, any>[];
|
|
25
|
+
tools: string[];
|
|
26
|
+
llmResponseType: string;
|
|
27
|
+
toolIteractionCycle: {
|
|
28
|
+
max: number;
|
|
29
|
+
current: number;
|
|
30
|
+
exhausted: boolean;
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
system: string | null;
|
|
34
|
+
messages: Record<string, any>[];
|
|
35
|
+
tools: string[];
|
|
36
|
+
llmResponseType: string;
|
|
37
|
+
toolIteractionCycle: {
|
|
38
|
+
max: number;
|
|
39
|
+
current: number;
|
|
40
|
+
exhausted: boolean;
|
|
41
|
+
};
|
|
42
|
+
}>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
type: "agent.init";
|
|
45
|
+
data: {
|
|
46
|
+
system: string | null;
|
|
47
|
+
messages: Record<string, any>[];
|
|
48
|
+
tools: string[];
|
|
49
|
+
llmResponseType: string;
|
|
50
|
+
toolIteractionCycle: {
|
|
51
|
+
max: number;
|
|
52
|
+
current: number;
|
|
53
|
+
exhausted: boolean;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
}, {
|
|
57
|
+
type: "agent.init";
|
|
58
|
+
data: {
|
|
59
|
+
system: string | null;
|
|
60
|
+
messages: Record<string, any>[];
|
|
61
|
+
tools: string[];
|
|
62
|
+
llmResponseType: string;
|
|
63
|
+
toolIteractionCycle: {
|
|
64
|
+
max: number;
|
|
65
|
+
current: number;
|
|
66
|
+
exhausted: boolean;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
}>, z.ZodObject<{
|
|
70
|
+
type: z.ZodLiteral<"agent.resume">;
|
|
71
|
+
data: z.ZodObject<{
|
|
72
|
+
system: z.ZodNullable<z.ZodString>;
|
|
73
|
+
messages: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">;
|
|
74
|
+
tools: z.ZodArray<z.ZodString, "many">;
|
|
75
|
+
llmResponseType: z.ZodString;
|
|
76
|
+
toolIteractionCycle: z.ZodObject<{
|
|
77
|
+
max: z.ZodNumber;
|
|
78
|
+
current: z.ZodNumber;
|
|
79
|
+
exhausted: z.ZodBoolean;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
max: number;
|
|
82
|
+
current: number;
|
|
83
|
+
exhausted: boolean;
|
|
84
|
+
}, {
|
|
85
|
+
max: number;
|
|
86
|
+
current: number;
|
|
87
|
+
exhausted: boolean;
|
|
88
|
+
}>;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
system: string | null;
|
|
91
|
+
messages: Record<string, any>[];
|
|
92
|
+
tools: string[];
|
|
93
|
+
llmResponseType: string;
|
|
94
|
+
toolIteractionCycle: {
|
|
95
|
+
max: number;
|
|
96
|
+
current: number;
|
|
97
|
+
exhausted: boolean;
|
|
98
|
+
};
|
|
99
|
+
}, {
|
|
100
|
+
system: string | null;
|
|
101
|
+
messages: Record<string, any>[];
|
|
102
|
+
tools: string[];
|
|
103
|
+
llmResponseType: string;
|
|
104
|
+
toolIteractionCycle: {
|
|
105
|
+
max: number;
|
|
106
|
+
current: number;
|
|
107
|
+
exhausted: boolean;
|
|
108
|
+
};
|
|
109
|
+
}>;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
type: "agent.resume";
|
|
112
|
+
data: {
|
|
113
|
+
system: string | null;
|
|
114
|
+
messages: Record<string, any>[];
|
|
115
|
+
tools: string[];
|
|
116
|
+
llmResponseType: string;
|
|
117
|
+
toolIteractionCycle: {
|
|
118
|
+
max: number;
|
|
119
|
+
current: number;
|
|
120
|
+
exhausted: boolean;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
}, {
|
|
124
|
+
type: "agent.resume";
|
|
125
|
+
data: {
|
|
126
|
+
system: string | null;
|
|
127
|
+
messages: Record<string, any>[];
|
|
128
|
+
tools: string[];
|
|
129
|
+
llmResponseType: string;
|
|
130
|
+
toolIteractionCycle: {
|
|
131
|
+
max: number;
|
|
132
|
+
current: number;
|
|
133
|
+
exhausted: boolean;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
}>, z.ZodObject<{
|
|
137
|
+
type: z.ZodLiteral<"agent.self.correction">;
|
|
138
|
+
data: z.ZodObject<{
|
|
139
|
+
system: z.ZodNullable<z.ZodString>;
|
|
140
|
+
messages: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">;
|
|
141
|
+
tools: z.ZodArray<z.ZodString, "many">;
|
|
142
|
+
llmResponseType: z.ZodString;
|
|
143
|
+
toolIteractionCycle: z.ZodObject<{
|
|
144
|
+
max: z.ZodNumber;
|
|
145
|
+
current: z.ZodNumber;
|
|
146
|
+
exhausted: z.ZodBoolean;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
max: number;
|
|
149
|
+
current: number;
|
|
150
|
+
exhausted: boolean;
|
|
151
|
+
}, {
|
|
152
|
+
max: number;
|
|
153
|
+
current: number;
|
|
154
|
+
exhausted: boolean;
|
|
155
|
+
}>;
|
|
156
|
+
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
system: string | null;
|
|
158
|
+
messages: Record<string, any>[];
|
|
159
|
+
tools: string[];
|
|
160
|
+
llmResponseType: string;
|
|
161
|
+
toolIteractionCycle: {
|
|
162
|
+
max: number;
|
|
163
|
+
current: number;
|
|
164
|
+
exhausted: boolean;
|
|
165
|
+
};
|
|
166
|
+
}, {
|
|
167
|
+
system: string | null;
|
|
168
|
+
messages: Record<string, any>[];
|
|
169
|
+
tools: string[];
|
|
170
|
+
llmResponseType: string;
|
|
171
|
+
toolIteractionCycle: {
|
|
172
|
+
max: number;
|
|
173
|
+
current: number;
|
|
174
|
+
exhausted: boolean;
|
|
175
|
+
};
|
|
176
|
+
}>;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
type: "agent.self.correction";
|
|
179
|
+
data: {
|
|
180
|
+
system: string | null;
|
|
181
|
+
messages: Record<string, any>[];
|
|
182
|
+
tools: string[];
|
|
183
|
+
llmResponseType: string;
|
|
184
|
+
toolIteractionCycle: {
|
|
185
|
+
max: number;
|
|
186
|
+
current: number;
|
|
187
|
+
exhausted: boolean;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
}, {
|
|
191
|
+
type: "agent.self.correction";
|
|
192
|
+
data: {
|
|
193
|
+
system: string | null;
|
|
194
|
+
messages: Record<string, any>[];
|
|
195
|
+
tools: string[];
|
|
196
|
+
llmResponseType: string;
|
|
197
|
+
toolIteractionCycle: {
|
|
198
|
+
max: number;
|
|
199
|
+
current: number;
|
|
200
|
+
exhausted: boolean;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
}>, z.ZodObject<{
|
|
204
|
+
type: z.ZodLiteral<"agent.tool.request">;
|
|
205
|
+
data: z.ZodObject<{
|
|
206
|
+
tool: z.ZodObject<{
|
|
207
|
+
kind: z.ZodString;
|
|
208
|
+
name: z.ZodString;
|
|
209
|
+
originalName: z.ZodString;
|
|
210
|
+
}, "strip", z.ZodTypeAny, {
|
|
211
|
+
kind: string;
|
|
212
|
+
name: string;
|
|
213
|
+
originalName: string;
|
|
214
|
+
}, {
|
|
215
|
+
kind: string;
|
|
216
|
+
name: string;
|
|
217
|
+
originalName: string;
|
|
218
|
+
}>;
|
|
219
|
+
usage: z.ZodObject<{
|
|
220
|
+
prompt: z.ZodNumber;
|
|
221
|
+
completion: z.ZodNumber;
|
|
222
|
+
}, "strip", z.ZodTypeAny, {
|
|
223
|
+
prompt: number;
|
|
224
|
+
completion: number;
|
|
225
|
+
}, {
|
|
226
|
+
prompt: number;
|
|
227
|
+
completion: number;
|
|
228
|
+
}>;
|
|
229
|
+
executionunits: z.ZodNumber;
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
tool: {
|
|
232
|
+
kind: string;
|
|
233
|
+
name: string;
|
|
234
|
+
originalName: string;
|
|
235
|
+
};
|
|
236
|
+
usage: {
|
|
237
|
+
prompt: number;
|
|
238
|
+
completion: number;
|
|
239
|
+
};
|
|
240
|
+
executionunits: number;
|
|
241
|
+
}, {
|
|
242
|
+
tool: {
|
|
243
|
+
kind: string;
|
|
244
|
+
name: string;
|
|
245
|
+
originalName: string;
|
|
246
|
+
};
|
|
247
|
+
usage: {
|
|
248
|
+
prompt: number;
|
|
249
|
+
completion: number;
|
|
250
|
+
};
|
|
251
|
+
executionunits: number;
|
|
252
|
+
}>;
|
|
253
|
+
}, "strip", z.ZodTypeAny, {
|
|
254
|
+
type: "agent.tool.request";
|
|
255
|
+
data: {
|
|
256
|
+
tool: {
|
|
257
|
+
kind: string;
|
|
258
|
+
name: string;
|
|
259
|
+
originalName: string;
|
|
260
|
+
};
|
|
261
|
+
usage: {
|
|
262
|
+
prompt: number;
|
|
263
|
+
completion: number;
|
|
264
|
+
};
|
|
265
|
+
executionunits: number;
|
|
266
|
+
};
|
|
267
|
+
}, {
|
|
268
|
+
type: "agent.tool.request";
|
|
269
|
+
data: {
|
|
270
|
+
tool: {
|
|
271
|
+
kind: string;
|
|
272
|
+
name: string;
|
|
273
|
+
originalName: string;
|
|
274
|
+
};
|
|
275
|
+
usage: {
|
|
276
|
+
prompt: number;
|
|
277
|
+
completion: number;
|
|
278
|
+
};
|
|
279
|
+
executionunits: number;
|
|
280
|
+
};
|
|
281
|
+
}>, z.ZodObject<{
|
|
282
|
+
type: z.ZodLiteral<"agent.output.finalization">;
|
|
283
|
+
data: z.ZodObject<{
|
|
284
|
+
content: z.ZodString;
|
|
285
|
+
usage: z.ZodObject<{
|
|
286
|
+
prompt: z.ZodNumber;
|
|
287
|
+
completion: z.ZodNumber;
|
|
288
|
+
}, "strip", z.ZodTypeAny, {
|
|
289
|
+
prompt: number;
|
|
290
|
+
completion: number;
|
|
291
|
+
}, {
|
|
292
|
+
prompt: number;
|
|
293
|
+
completion: number;
|
|
294
|
+
}>;
|
|
295
|
+
executionunits: z.ZodNumber;
|
|
296
|
+
}, "strip", z.ZodTypeAny, {
|
|
297
|
+
usage: {
|
|
298
|
+
prompt: number;
|
|
299
|
+
completion: number;
|
|
300
|
+
};
|
|
301
|
+
executionunits: number;
|
|
302
|
+
content: string;
|
|
303
|
+
}, {
|
|
304
|
+
usage: {
|
|
305
|
+
prompt: number;
|
|
306
|
+
completion: number;
|
|
307
|
+
};
|
|
308
|
+
executionunits: number;
|
|
309
|
+
content: string;
|
|
310
|
+
}>;
|
|
311
|
+
}, "strip", z.ZodTypeAny, {
|
|
312
|
+
type: "agent.output.finalization";
|
|
313
|
+
data: {
|
|
314
|
+
usage: {
|
|
315
|
+
prompt: number;
|
|
316
|
+
completion: number;
|
|
317
|
+
};
|
|
318
|
+
executionunits: number;
|
|
319
|
+
content: string;
|
|
320
|
+
};
|
|
321
|
+
}, {
|
|
322
|
+
type: "agent.output.finalization";
|
|
323
|
+
data: {
|
|
324
|
+
usage: {
|
|
325
|
+
prompt: number;
|
|
326
|
+
completion: number;
|
|
327
|
+
};
|
|
328
|
+
executionunits: number;
|
|
329
|
+
content: string;
|
|
330
|
+
};
|
|
331
|
+
}>, z.ZodObject<{
|
|
332
|
+
type: z.ZodLiteral<"agent.output">;
|
|
333
|
+
data: z.ZodObject<{
|
|
334
|
+
content: z.ZodString;
|
|
335
|
+
usage: z.ZodObject<{
|
|
336
|
+
prompt: z.ZodNumber;
|
|
337
|
+
completion: z.ZodNumber;
|
|
338
|
+
}, "strip", z.ZodTypeAny, {
|
|
339
|
+
prompt: number;
|
|
340
|
+
completion: number;
|
|
341
|
+
}, {
|
|
342
|
+
prompt: number;
|
|
343
|
+
completion: number;
|
|
344
|
+
}>;
|
|
345
|
+
executionunits: z.ZodNumber;
|
|
346
|
+
}, "strip", z.ZodTypeAny, {
|
|
347
|
+
usage: {
|
|
348
|
+
prompt: number;
|
|
349
|
+
completion: number;
|
|
350
|
+
};
|
|
351
|
+
executionunits: number;
|
|
352
|
+
content: string;
|
|
353
|
+
}, {
|
|
354
|
+
usage: {
|
|
355
|
+
prompt: number;
|
|
356
|
+
completion: number;
|
|
357
|
+
};
|
|
358
|
+
executionunits: number;
|
|
359
|
+
content: string;
|
|
360
|
+
}>;
|
|
361
|
+
}, "strip", z.ZodTypeAny, {
|
|
362
|
+
type: "agent.output";
|
|
363
|
+
data: {
|
|
364
|
+
usage: {
|
|
365
|
+
prompt: number;
|
|
366
|
+
completion: number;
|
|
367
|
+
};
|
|
368
|
+
executionunits: number;
|
|
369
|
+
content: string;
|
|
370
|
+
};
|
|
371
|
+
}, {
|
|
372
|
+
type: "agent.output";
|
|
373
|
+
data: {
|
|
374
|
+
usage: {
|
|
375
|
+
prompt: number;
|
|
376
|
+
completion: number;
|
|
377
|
+
};
|
|
378
|
+
executionunits: number;
|
|
379
|
+
content: string;
|
|
380
|
+
};
|
|
381
|
+
}>, z.ZodObject<{
|
|
382
|
+
type: z.ZodLiteral<"agent.tool.request.delegation">;
|
|
383
|
+
data: z.ZodObject<{
|
|
384
|
+
tools: z.ZodArray<z.ZodString, "many">;
|
|
385
|
+
usage: z.ZodObject<{
|
|
386
|
+
prompt: z.ZodNumber;
|
|
387
|
+
completion: z.ZodNumber;
|
|
388
|
+
}, "strip", z.ZodTypeAny, {
|
|
389
|
+
prompt: number;
|
|
390
|
+
completion: number;
|
|
391
|
+
}, {
|
|
392
|
+
prompt: number;
|
|
393
|
+
completion: number;
|
|
394
|
+
}>;
|
|
395
|
+
executionunits: z.ZodNumber;
|
|
396
|
+
}, "strip", z.ZodTypeAny, {
|
|
397
|
+
tools: string[];
|
|
398
|
+
usage: {
|
|
399
|
+
prompt: number;
|
|
400
|
+
completion: number;
|
|
401
|
+
};
|
|
402
|
+
executionunits: number;
|
|
403
|
+
}, {
|
|
404
|
+
tools: string[];
|
|
405
|
+
usage: {
|
|
406
|
+
prompt: number;
|
|
407
|
+
completion: number;
|
|
408
|
+
};
|
|
409
|
+
executionunits: number;
|
|
410
|
+
}>;
|
|
411
|
+
}, "strip", z.ZodTypeAny, {
|
|
412
|
+
type: "agent.tool.request.delegation";
|
|
413
|
+
data: {
|
|
414
|
+
tools: string[];
|
|
415
|
+
usage: {
|
|
416
|
+
prompt: number;
|
|
417
|
+
completion: number;
|
|
418
|
+
};
|
|
419
|
+
executionunits: number;
|
|
420
|
+
};
|
|
421
|
+
}, {
|
|
422
|
+
type: "agent.tool.request.delegation";
|
|
423
|
+
data: {
|
|
424
|
+
tools: string[];
|
|
425
|
+
usage: {
|
|
426
|
+
prompt: number;
|
|
427
|
+
completion: number;
|
|
428
|
+
};
|
|
429
|
+
executionunits: number;
|
|
430
|
+
};
|
|
431
|
+
}>, z.ZodObject<{
|
|
432
|
+
type: z.ZodLiteral<"agent.llm.delta">;
|
|
433
|
+
data: z.ZodObject<{
|
|
434
|
+
delta: z.ZodString;
|
|
435
|
+
content: z.ZodString;
|
|
436
|
+
}, "strip", z.ZodTypeAny, {
|
|
437
|
+
content: string;
|
|
438
|
+
delta: string;
|
|
439
|
+
}, {
|
|
440
|
+
content: string;
|
|
441
|
+
delta: string;
|
|
442
|
+
}>;
|
|
443
|
+
}, "strip", z.ZodTypeAny, {
|
|
444
|
+
type: "agent.llm.delta";
|
|
445
|
+
data: {
|
|
446
|
+
content: string;
|
|
447
|
+
delta: string;
|
|
448
|
+
};
|
|
449
|
+
}, {
|
|
450
|
+
type: "agent.llm.delta";
|
|
451
|
+
data: {
|
|
452
|
+
content: string;
|
|
453
|
+
delta: string;
|
|
454
|
+
};
|
|
455
|
+
}>]>;
|
|
456
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/Agent/stream/schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAcpB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoEjC,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AgentStreamEventSchema = void 0;
|
|
7
|
+
var zod_1 = __importDefault(require("zod"));
|
|
8
|
+
var AgentStartSchema = zod_1.default.object({
|
|
9
|
+
system: zod_1.default.string().nullable(),
|
|
10
|
+
messages: zod_1.default.record(zod_1.default.string(), zod_1.default.any()).array(),
|
|
11
|
+
tools: zod_1.default.string().array(),
|
|
12
|
+
llmResponseType: zod_1.default.string(),
|
|
13
|
+
toolIteractionCycle: zod_1.default.object({
|
|
14
|
+
max: zod_1.default.number(),
|
|
15
|
+
current: zod_1.default.number(),
|
|
16
|
+
exhausted: zod_1.default.boolean(),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
exports.AgentStreamEventSchema = zod_1.default.discriminatedUnion('type', [
|
|
20
|
+
zod_1.default.object({
|
|
21
|
+
type: zod_1.default.literal('agent.init'),
|
|
22
|
+
data: AgentStartSchema,
|
|
23
|
+
}),
|
|
24
|
+
zod_1.default.object({
|
|
25
|
+
type: zod_1.default.literal('agent.resume'),
|
|
26
|
+
data: AgentStartSchema,
|
|
27
|
+
}),
|
|
28
|
+
zod_1.default.object({
|
|
29
|
+
type: zod_1.default.literal('agent.self.correction'),
|
|
30
|
+
data: AgentStartSchema,
|
|
31
|
+
}),
|
|
32
|
+
zod_1.default.object({
|
|
33
|
+
type: zod_1.default.literal('agent.tool.request'),
|
|
34
|
+
data: zod_1.default.object({
|
|
35
|
+
tool: zod_1.default.object({
|
|
36
|
+
kind: zod_1.default.string(),
|
|
37
|
+
name: zod_1.default.string(),
|
|
38
|
+
originalName: zod_1.default.string(),
|
|
39
|
+
}),
|
|
40
|
+
usage: zod_1.default.object({
|
|
41
|
+
prompt: zod_1.default.number(),
|
|
42
|
+
completion: zod_1.default.number(),
|
|
43
|
+
}),
|
|
44
|
+
executionunits: zod_1.default.number(),
|
|
45
|
+
}),
|
|
46
|
+
}),
|
|
47
|
+
zod_1.default.object({
|
|
48
|
+
type: zod_1.default.literal('agent.output.finalization'),
|
|
49
|
+
data: zod_1.default.object({
|
|
50
|
+
content: zod_1.default.string(),
|
|
51
|
+
usage: zod_1.default.object({
|
|
52
|
+
prompt: zod_1.default.number(),
|
|
53
|
+
completion: zod_1.default.number(),
|
|
54
|
+
}),
|
|
55
|
+
executionunits: zod_1.default.number(),
|
|
56
|
+
}),
|
|
57
|
+
}),
|
|
58
|
+
zod_1.default.object({
|
|
59
|
+
type: zod_1.default.literal('agent.output'),
|
|
60
|
+
data: zod_1.default.object({
|
|
61
|
+
content: zod_1.default.string(),
|
|
62
|
+
usage: zod_1.default.object({
|
|
63
|
+
prompt: zod_1.default.number(),
|
|
64
|
+
completion: zod_1.default.number(),
|
|
65
|
+
}),
|
|
66
|
+
executionunits: zod_1.default.number(),
|
|
67
|
+
}),
|
|
68
|
+
}),
|
|
69
|
+
zod_1.default.object({
|
|
70
|
+
type: zod_1.default.literal('agent.tool.request.delegation'),
|
|
71
|
+
data: zod_1.default.object({
|
|
72
|
+
tools: zod_1.default.string().array(),
|
|
73
|
+
usage: zod_1.default.object({
|
|
74
|
+
prompt: zod_1.default.number(),
|
|
75
|
+
completion: zod_1.default.number(),
|
|
76
|
+
}),
|
|
77
|
+
executionunits: zod_1.default.number(),
|
|
78
|
+
}),
|
|
79
|
+
}),
|
|
80
|
+
zod_1.default.object({
|
|
81
|
+
type: zod_1.default.literal('agent.llm.delta'),
|
|
82
|
+
data: zod_1.default.object({
|
|
83
|
+
delta: zod_1.default.string(),
|
|
84
|
+
content: zod_1.default.string(),
|
|
85
|
+
}),
|
|
86
|
+
}),
|
|
87
|
+
]);
|
|
88
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/Agent/stream/schema.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAEpB,IAAM,gBAAgB,GAAG,aAAC,CAAC,MAAM,CAAC;IAChC,MAAM,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,aAAC,CAAC,MAAM,CAAC,aAAC,CAAC,MAAM,EAAE,EAAE,aAAC,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,EAAE;IAC/C,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;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AAC,CAAC,MAAM,EAAE;YACjB,OAAO,EAAE,aAAC,CAAC,MAAM,EAAE;SACpB,CAAC;KACH,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type z from 'zod';
|
|
2
|
+
import type { AgentStreamEventSchema } from './schema';
|
|
3
|
+
export type AgentStreamListener = (event: z.infer<typeof AgentStreamEventSchema> & {
|
|
4
|
+
id: string;
|
|
5
|
+
time: string;
|
|
6
|
+
}, metadata: {
|
|
7
|
+
subject: string;
|
|
8
|
+
initiatorId: string;
|
|
9
|
+
selfId: string;
|
|
10
|
+
selfVersion: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
export type AgentEventStreamer = (event: z.infer<typeof AgentStreamEventSchema>) => void;
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Agent/stream/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG,CAChC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,GAAG;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,EACD,QAAQ,EAAE;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB,KACE,IAAI,CAAC;AAEV,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/Agent/stream/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates an RFC 3339 compliant timestamp string with an optional UTC offset.
|
|
3
|
+
*
|
|
4
|
+
* @param offsetHours - The number of hours to offset from UTC. Positive values
|
|
5
|
+
* represent hours ahead of UTC, negative values represent
|
|
6
|
+
* hours behind UTC. Defaults to 0 (UTC).
|
|
7
|
+
* @returns A string representing the current date and time in RFC 3339 format
|
|
8
|
+
* with the specified UTC offset.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Returns current time in UTC
|
|
12
|
+
* createTimestamp();
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Returns current time with +2 hours offset
|
|
16
|
+
* createTimestamp(2);
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Returns current time with -5 hours offset
|
|
20
|
+
* createTimestamp(-5);
|
|
21
|
+
*/
|
|
22
|
+
export declare const createTimestamp: (offsetHours?: number) => string;
|
|
23
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/Agent/stream/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,eAAe,GAAI,oBAAe,KAAG,MAYjD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTimestamp = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Creates an RFC 3339 compliant timestamp string with an optional UTC offset.
|
|
6
|
+
*
|
|
7
|
+
* @param offsetHours - The number of hours to offset from UTC. Positive values
|
|
8
|
+
* represent hours ahead of UTC, negative values represent
|
|
9
|
+
* hours behind UTC. Defaults to 0 (UTC).
|
|
10
|
+
* @returns A string representing the current date and time in RFC 3339 format
|
|
11
|
+
* with the specified UTC offset.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Returns current time in UTC
|
|
15
|
+
* createTimestamp();
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Returns current time with +2 hours offset
|
|
19
|
+
* createTimestamp(2);
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Returns current time with -5 hours offset
|
|
23
|
+
* createTimestamp(-5);
|
|
24
|
+
*/
|
|
25
|
+
var createTimestamp = function (offsetHours) {
|
|
26
|
+
if (offsetHours === void 0) { offsetHours = 0; }
|
|
27
|
+
var now = new Date();
|
|
28
|
+
var offsetMinutes = offsetHours * 60;
|
|
29
|
+
now.setMinutes(now.getMinutes() - now.getTimezoneOffset() + offsetMinutes);
|
|
30
|
+
return now
|
|
31
|
+
.toISOString()
|
|
32
|
+
.replace('Z', offsetHours >= 0
|
|
33
|
+
? "+".concat(String(offsetHours).padStart(2, '0'), ":00")
|
|
34
|
+
: "-".concat(String(Math.abs(offsetHours)).padStart(2, '0'), ":00"));
|
|
35
|
+
};
|
|
36
|
+
exports.createTimestamp = createTimestamp;
|
|
37
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/Agent/stream/utils.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,IAAM,eAAe,GAAG,UAAC,WAAe;IAAf,4BAAA,EAAA,eAAe;IAC7C,IAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,IAAM,aAAa,GAAG,WAAW,GAAG,EAAE,CAAC;IACvC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,GAAG,CAAC,iBAAiB,EAAE,GAAG,aAAa,CAAC,CAAC;IAC3E,OAAO,GAAG;SACP,WAAW,EAAE;SACb,OAAO,CACN,GAAG,EACH,WAAW,IAAI,CAAC;QACd,CAAC,CAAC,WAAI,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,QAAK;QAC/C,CAAC,CAAC,WAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,QAAK,CAC5D,CAAC;AACN,CAAC,CAAC;AAZW,QAAA,eAAe,mBAY1B"}
|