@deepintel-ltd/farmpro-contracts 1.1.0 → 1.2.1

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.
@@ -0,0 +1,606 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Agents schemas - JSON:API compliant
4
+ */
5
+ export declare const messageRoleSchema: z.ZodEnum<["user", "assistant"]>;
6
+ export declare const conversationMessageSchema: z.ZodObject<{
7
+ role: z.ZodEnum<["user", "assistant"]>;
8
+ content: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ role: "user" | "assistant";
11
+ content: string;
12
+ }, {
13
+ role: "user" | "assistant";
14
+ content: string;
15
+ }>;
16
+ export declare const toolCallResultSchema: z.ZodObject<{
17
+ tool: z.ZodString;
18
+ result: z.ZodUnknown;
19
+ }, "strip", z.ZodTypeAny, {
20
+ tool: string;
21
+ result?: unknown;
22
+ }, {
23
+ tool: string;
24
+ result?: unknown;
25
+ }>;
26
+ export declare const chatRequestAttributesSchema: z.ZodObject<{
27
+ message: z.ZodString;
28
+ farmId: z.ZodOptional<z.ZodString>;
29
+ conversationId: z.ZodOptional<z.ZodString>;
30
+ conversationHistory: z.ZodOptional<z.ZodArray<z.ZodObject<{
31
+ role: z.ZodEnum<["user", "assistant"]>;
32
+ content: z.ZodString;
33
+ }, "strip", z.ZodTypeAny, {
34
+ role: "user" | "assistant";
35
+ content: string;
36
+ }, {
37
+ role: "user" | "assistant";
38
+ content: string;
39
+ }>, "many">>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ message: string;
42
+ farmId?: string | undefined;
43
+ conversationId?: string | undefined;
44
+ conversationHistory?: {
45
+ role: "user" | "assistant";
46
+ content: string;
47
+ }[] | undefined;
48
+ }, {
49
+ message: string;
50
+ farmId?: string | undefined;
51
+ conversationId?: string | undefined;
52
+ conversationHistory?: {
53
+ role: "user" | "assistant";
54
+ content: string;
55
+ }[] | undefined;
56
+ }>;
57
+ export declare const chatRequestSchema: z.ZodObject<{
58
+ type: z.ZodLiteral<"agent-chat-requests">;
59
+ attributes: z.ZodObject<{
60
+ message: z.ZodString;
61
+ farmId: z.ZodOptional<z.ZodString>;
62
+ conversationId: z.ZodOptional<z.ZodString>;
63
+ conversationHistory: z.ZodOptional<z.ZodArray<z.ZodObject<{
64
+ role: z.ZodEnum<["user", "assistant"]>;
65
+ content: z.ZodString;
66
+ }, "strip", z.ZodTypeAny, {
67
+ role: "user" | "assistant";
68
+ content: string;
69
+ }, {
70
+ role: "user" | "assistant";
71
+ content: string;
72
+ }>, "many">>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ message: string;
75
+ farmId?: string | undefined;
76
+ conversationId?: string | undefined;
77
+ conversationHistory?: {
78
+ role: "user" | "assistant";
79
+ content: string;
80
+ }[] | undefined;
81
+ }, {
82
+ message: string;
83
+ farmId?: string | undefined;
84
+ conversationId?: string | undefined;
85
+ conversationHistory?: {
86
+ role: "user" | "assistant";
87
+ content: string;
88
+ }[] | undefined;
89
+ }>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ type: "agent-chat-requests";
92
+ attributes: {
93
+ message: string;
94
+ farmId?: string | undefined;
95
+ conversationId?: string | undefined;
96
+ conversationHistory?: {
97
+ role: "user" | "assistant";
98
+ content: string;
99
+ }[] | undefined;
100
+ };
101
+ }, {
102
+ type: "agent-chat-requests";
103
+ attributes: {
104
+ message: string;
105
+ farmId?: string | undefined;
106
+ conversationId?: string | undefined;
107
+ conversationHistory?: {
108
+ role: "user" | "assistant";
109
+ content: string;
110
+ }[] | undefined;
111
+ };
112
+ }>;
113
+ export declare const agentChatResponseAttributesSchema: z.ZodObject<{
114
+ response: z.ZodString;
115
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
116
+ tool: z.ZodString;
117
+ result: z.ZodUnknown;
118
+ }, "strip", z.ZodTypeAny, {
119
+ tool: string;
120
+ result?: unknown;
121
+ }, {
122
+ tool: string;
123
+ result?: unknown;
124
+ }>, "many">>;
125
+ conversationId: z.ZodString;
126
+ }, "strip", z.ZodTypeAny, {
127
+ conversationId: string;
128
+ response: string;
129
+ toolCalls?: {
130
+ tool: string;
131
+ result?: unknown;
132
+ }[] | undefined;
133
+ }, {
134
+ conversationId: string;
135
+ response: string;
136
+ toolCalls?: {
137
+ tool: string;
138
+ result?: unknown;
139
+ }[] | undefined;
140
+ }>;
141
+ export declare const agentChatResponseResourceSchema: z.ZodObject<{
142
+ type: z.ZodLiteral<string>;
143
+ id: z.ZodString;
144
+ attributes: z.ZodObject<{
145
+ response: z.ZodString;
146
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
147
+ tool: z.ZodString;
148
+ result: z.ZodUnknown;
149
+ }, "strip", z.ZodTypeAny, {
150
+ tool: string;
151
+ result?: unknown;
152
+ }, {
153
+ tool: string;
154
+ result?: unknown;
155
+ }>, "many">>;
156
+ conversationId: z.ZodString;
157
+ }, "strip", z.ZodTypeAny, {
158
+ conversationId: string;
159
+ response: string;
160
+ toolCalls?: {
161
+ tool: string;
162
+ result?: unknown;
163
+ }[] | undefined;
164
+ }, {
165
+ conversationId: string;
166
+ response: string;
167
+ toolCalls?: {
168
+ tool: string;
169
+ result?: unknown;
170
+ }[] | undefined;
171
+ }>;
172
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
173
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
174
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
175
+ }, "strip", z.ZodTypeAny, {
176
+ type: string;
177
+ id: string;
178
+ attributes: {
179
+ conversationId: string;
180
+ response: string;
181
+ toolCalls?: {
182
+ tool: string;
183
+ result?: unknown;
184
+ }[] | undefined;
185
+ };
186
+ relationships?: Record<string, unknown> | undefined;
187
+ links?: Record<string, string> | undefined;
188
+ meta?: Record<string, unknown> | undefined;
189
+ }, {
190
+ type: string;
191
+ id: string;
192
+ attributes: {
193
+ conversationId: string;
194
+ response: string;
195
+ toolCalls?: {
196
+ tool: string;
197
+ result?: unknown;
198
+ }[] | undefined;
199
+ };
200
+ relationships?: Record<string, unknown> | undefined;
201
+ links?: Record<string, string> | undefined;
202
+ meta?: Record<string, unknown> | undefined;
203
+ }>;
204
+ export declare const agentChatResponseSchema: z.ZodObject<{
205
+ data: z.ZodObject<{
206
+ type: z.ZodLiteral<string>;
207
+ id: z.ZodString;
208
+ attributes: z.ZodObject<{
209
+ response: z.ZodString;
210
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
211
+ tool: z.ZodString;
212
+ result: z.ZodUnknown;
213
+ }, "strip", z.ZodTypeAny, {
214
+ tool: string;
215
+ result?: unknown;
216
+ }, {
217
+ tool: string;
218
+ result?: unknown;
219
+ }>, "many">>;
220
+ conversationId: z.ZodString;
221
+ }, "strip", z.ZodTypeAny, {
222
+ conversationId: string;
223
+ response: string;
224
+ toolCalls?: {
225
+ tool: string;
226
+ result?: unknown;
227
+ }[] | undefined;
228
+ }, {
229
+ conversationId: string;
230
+ response: string;
231
+ toolCalls?: {
232
+ tool: string;
233
+ result?: unknown;
234
+ }[] | undefined;
235
+ }>;
236
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
237
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
238
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
239
+ }, "strip", z.ZodTypeAny, {
240
+ type: string;
241
+ id: string;
242
+ attributes: {
243
+ conversationId: string;
244
+ response: string;
245
+ toolCalls?: {
246
+ tool: string;
247
+ result?: unknown;
248
+ }[] | undefined;
249
+ };
250
+ relationships?: Record<string, unknown> | undefined;
251
+ links?: Record<string, string> | undefined;
252
+ meta?: Record<string, unknown> | undefined;
253
+ }, {
254
+ type: string;
255
+ id: string;
256
+ attributes: {
257
+ conversationId: string;
258
+ response: string;
259
+ toolCalls?: {
260
+ tool: string;
261
+ result?: unknown;
262
+ }[] | undefined;
263
+ };
264
+ relationships?: Record<string, unknown> | undefined;
265
+ links?: Record<string, string> | undefined;
266
+ meta?: Record<string, unknown> | undefined;
267
+ }>;
268
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
269
+ type: z.ZodString;
270
+ id: z.ZodString;
271
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
272
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
273
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
274
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
275
+ }, "strip", z.ZodTypeAny, {
276
+ type: string;
277
+ id: string;
278
+ attributes?: Record<string, unknown> | undefined;
279
+ relationships?: Record<string, unknown> | undefined;
280
+ links?: Record<string, string> | undefined;
281
+ meta?: Record<string, unknown> | undefined;
282
+ }, {
283
+ type: string;
284
+ id: string;
285
+ attributes?: Record<string, unknown> | undefined;
286
+ relationships?: Record<string, unknown> | undefined;
287
+ links?: Record<string, string> | undefined;
288
+ meta?: Record<string, unknown> | undefined;
289
+ }>, "many">>;
290
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
291
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
292
+ }, "strip", z.ZodTypeAny, {
293
+ data: {
294
+ type: string;
295
+ id: string;
296
+ attributes: {
297
+ conversationId: string;
298
+ response: string;
299
+ toolCalls?: {
300
+ tool: string;
301
+ result?: unknown;
302
+ }[] | undefined;
303
+ };
304
+ relationships?: Record<string, unknown> | undefined;
305
+ links?: Record<string, string> | undefined;
306
+ meta?: Record<string, unknown> | undefined;
307
+ };
308
+ links?: Record<string, string> | undefined;
309
+ meta?: Record<string, unknown> | undefined;
310
+ included?: {
311
+ type: string;
312
+ id: string;
313
+ attributes?: Record<string, unknown> | undefined;
314
+ relationships?: Record<string, unknown> | undefined;
315
+ links?: Record<string, string> | undefined;
316
+ meta?: Record<string, unknown> | undefined;
317
+ }[] | undefined;
318
+ }, {
319
+ data: {
320
+ type: string;
321
+ id: string;
322
+ attributes: {
323
+ conversationId: string;
324
+ response: string;
325
+ toolCalls?: {
326
+ tool: string;
327
+ result?: unknown;
328
+ }[] | undefined;
329
+ };
330
+ relationships?: Record<string, unknown> | undefined;
331
+ links?: Record<string, string> | undefined;
332
+ meta?: Record<string, unknown> | undefined;
333
+ };
334
+ links?: Record<string, string> | undefined;
335
+ meta?: Record<string, unknown> | undefined;
336
+ included?: {
337
+ type: string;
338
+ id: string;
339
+ attributes?: Record<string, unknown> | undefined;
340
+ relationships?: Record<string, unknown> | undefined;
341
+ links?: Record<string, string> | undefined;
342
+ meta?: Record<string, unknown> | undefined;
343
+ }[] | undefined;
344
+ }>;
345
+ export declare const conversationHistoryMessageSchema: z.ZodObject<{
346
+ role: z.ZodEnum<["user", "assistant"]>;
347
+ content: z.ZodString;
348
+ createdAt: z.ZodOptional<z.ZodString>;
349
+ }, "strip", z.ZodTypeAny, {
350
+ role: "user" | "assistant";
351
+ content: string;
352
+ createdAt?: string | undefined;
353
+ }, {
354
+ role: "user" | "assistant";
355
+ content: string;
356
+ createdAt?: string | undefined;
357
+ }>;
358
+ export declare const conversationHistoryAttributesSchema: z.ZodObject<{
359
+ messages: z.ZodArray<z.ZodObject<{
360
+ role: z.ZodEnum<["user", "assistant"]>;
361
+ content: z.ZodString;
362
+ createdAt: z.ZodOptional<z.ZodString>;
363
+ }, "strip", z.ZodTypeAny, {
364
+ role: "user" | "assistant";
365
+ content: string;
366
+ createdAt?: string | undefined;
367
+ }, {
368
+ role: "user" | "assistant";
369
+ content: string;
370
+ createdAt?: string | undefined;
371
+ }>, "many">;
372
+ conversationId: z.ZodString;
373
+ }, "strip", z.ZodTypeAny, {
374
+ conversationId: string;
375
+ messages: {
376
+ role: "user" | "assistant";
377
+ content: string;
378
+ createdAt?: string | undefined;
379
+ }[];
380
+ }, {
381
+ conversationId: string;
382
+ messages: {
383
+ role: "user" | "assistant";
384
+ content: string;
385
+ createdAt?: string | undefined;
386
+ }[];
387
+ }>;
388
+ export declare const conversationHistoryResourceSchema: z.ZodObject<{
389
+ type: z.ZodLiteral<string>;
390
+ id: z.ZodString;
391
+ attributes: z.ZodObject<{
392
+ messages: z.ZodArray<z.ZodObject<{
393
+ role: z.ZodEnum<["user", "assistant"]>;
394
+ content: z.ZodString;
395
+ createdAt: z.ZodOptional<z.ZodString>;
396
+ }, "strip", z.ZodTypeAny, {
397
+ role: "user" | "assistant";
398
+ content: string;
399
+ createdAt?: string | undefined;
400
+ }, {
401
+ role: "user" | "assistant";
402
+ content: string;
403
+ createdAt?: string | undefined;
404
+ }>, "many">;
405
+ conversationId: z.ZodString;
406
+ }, "strip", z.ZodTypeAny, {
407
+ conversationId: string;
408
+ messages: {
409
+ role: "user" | "assistant";
410
+ content: string;
411
+ createdAt?: string | undefined;
412
+ }[];
413
+ }, {
414
+ conversationId: string;
415
+ messages: {
416
+ role: "user" | "assistant";
417
+ content: string;
418
+ createdAt?: string | undefined;
419
+ }[];
420
+ }>;
421
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
422
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
423
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
424
+ }, "strip", z.ZodTypeAny, {
425
+ type: string;
426
+ id: string;
427
+ attributes: {
428
+ conversationId: string;
429
+ messages: {
430
+ role: "user" | "assistant";
431
+ content: string;
432
+ createdAt?: string | undefined;
433
+ }[];
434
+ };
435
+ relationships?: Record<string, unknown> | undefined;
436
+ links?: Record<string, string> | undefined;
437
+ meta?: Record<string, unknown> | undefined;
438
+ }, {
439
+ type: string;
440
+ id: string;
441
+ attributes: {
442
+ conversationId: string;
443
+ messages: {
444
+ role: "user" | "assistant";
445
+ content: string;
446
+ createdAt?: string | undefined;
447
+ }[];
448
+ };
449
+ relationships?: Record<string, unknown> | undefined;
450
+ links?: Record<string, string> | undefined;
451
+ meta?: Record<string, unknown> | undefined;
452
+ }>;
453
+ export declare const conversationHistoryResponseSchema: z.ZodObject<{
454
+ data: z.ZodObject<{
455
+ type: z.ZodLiteral<string>;
456
+ id: z.ZodString;
457
+ attributes: z.ZodObject<{
458
+ messages: z.ZodArray<z.ZodObject<{
459
+ role: z.ZodEnum<["user", "assistant"]>;
460
+ content: z.ZodString;
461
+ createdAt: z.ZodOptional<z.ZodString>;
462
+ }, "strip", z.ZodTypeAny, {
463
+ role: "user" | "assistant";
464
+ content: string;
465
+ createdAt?: string | undefined;
466
+ }, {
467
+ role: "user" | "assistant";
468
+ content: string;
469
+ createdAt?: string | undefined;
470
+ }>, "many">;
471
+ conversationId: z.ZodString;
472
+ }, "strip", z.ZodTypeAny, {
473
+ conversationId: string;
474
+ messages: {
475
+ role: "user" | "assistant";
476
+ content: string;
477
+ createdAt?: string | undefined;
478
+ }[];
479
+ }, {
480
+ conversationId: string;
481
+ messages: {
482
+ role: "user" | "assistant";
483
+ content: string;
484
+ createdAt?: string | undefined;
485
+ }[];
486
+ }>;
487
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
488
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
489
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
490
+ }, "strip", z.ZodTypeAny, {
491
+ type: string;
492
+ id: string;
493
+ attributes: {
494
+ conversationId: string;
495
+ messages: {
496
+ role: "user" | "assistant";
497
+ content: string;
498
+ createdAt?: string | undefined;
499
+ }[];
500
+ };
501
+ relationships?: Record<string, unknown> | undefined;
502
+ links?: Record<string, string> | undefined;
503
+ meta?: Record<string, unknown> | undefined;
504
+ }, {
505
+ type: string;
506
+ id: string;
507
+ attributes: {
508
+ conversationId: string;
509
+ messages: {
510
+ role: "user" | "assistant";
511
+ content: string;
512
+ createdAt?: string | undefined;
513
+ }[];
514
+ };
515
+ relationships?: Record<string, unknown> | undefined;
516
+ links?: Record<string, string> | undefined;
517
+ meta?: Record<string, unknown> | undefined;
518
+ }>;
519
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
520
+ type: z.ZodString;
521
+ id: z.ZodString;
522
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
523
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
524
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
525
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
526
+ }, "strip", z.ZodTypeAny, {
527
+ type: string;
528
+ id: string;
529
+ attributes?: Record<string, unknown> | undefined;
530
+ relationships?: Record<string, unknown> | undefined;
531
+ links?: Record<string, string> | undefined;
532
+ meta?: Record<string, unknown> | undefined;
533
+ }, {
534
+ type: string;
535
+ id: string;
536
+ attributes?: Record<string, unknown> | undefined;
537
+ relationships?: Record<string, unknown> | undefined;
538
+ links?: Record<string, string> | undefined;
539
+ meta?: Record<string, unknown> | undefined;
540
+ }>, "many">>;
541
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
542
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
543
+ }, "strip", z.ZodTypeAny, {
544
+ data: {
545
+ type: string;
546
+ id: string;
547
+ attributes: {
548
+ conversationId: string;
549
+ messages: {
550
+ role: "user" | "assistant";
551
+ content: string;
552
+ createdAt?: string | undefined;
553
+ }[];
554
+ };
555
+ relationships?: Record<string, unknown> | undefined;
556
+ links?: Record<string, string> | undefined;
557
+ meta?: Record<string, unknown> | undefined;
558
+ };
559
+ links?: Record<string, string> | undefined;
560
+ meta?: Record<string, unknown> | undefined;
561
+ included?: {
562
+ type: string;
563
+ id: string;
564
+ attributes?: Record<string, unknown> | undefined;
565
+ relationships?: Record<string, unknown> | undefined;
566
+ links?: Record<string, string> | undefined;
567
+ meta?: Record<string, unknown> | undefined;
568
+ }[] | undefined;
569
+ }, {
570
+ data: {
571
+ type: string;
572
+ id: string;
573
+ attributes: {
574
+ conversationId: string;
575
+ messages: {
576
+ role: "user" | "assistant";
577
+ content: string;
578
+ createdAt?: string | undefined;
579
+ }[];
580
+ };
581
+ relationships?: Record<string, unknown> | undefined;
582
+ links?: Record<string, string> | undefined;
583
+ meta?: Record<string, unknown> | undefined;
584
+ };
585
+ links?: Record<string, string> | undefined;
586
+ meta?: Record<string, unknown> | undefined;
587
+ included?: {
588
+ type: string;
589
+ id: string;
590
+ attributes?: Record<string, unknown> | undefined;
591
+ relationships?: Record<string, unknown> | undefined;
592
+ links?: Record<string, string> | undefined;
593
+ meta?: Record<string, unknown> | undefined;
594
+ }[] | undefined;
595
+ }>;
596
+ export type MessageRole = z.infer<typeof messageRoleSchema>;
597
+ export type ConversationMessage = z.infer<typeof conversationMessageSchema>;
598
+ export type ConversationHistoryMessage = z.infer<typeof conversationHistoryMessageSchema>;
599
+ export type ToolCallResult = z.infer<typeof toolCallResultSchema>;
600
+ export type ChatRequestAttributes = z.infer<typeof chatRequestAttributesSchema>;
601
+ export type ChatRequestInput = z.infer<typeof chatRequestSchema>;
602
+ export type AgentChatResponseAttributes = z.infer<typeof agentChatResponseAttributesSchema>;
603
+ export type AgentChatResponse = z.infer<typeof agentChatResponseSchema>;
604
+ export type ConversationHistoryAttributes = z.infer<typeof conversationHistoryAttributesSchema>;
605
+ export type ConversationHistoryResponse = z.infer<typeof conversationHistoryResponseSchema>;
606
+ //# sourceMappingURL=agents.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/agents.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AAGH,eAAO,MAAM,iBAAiB,kCAAgC,CAAC;AAG/D,eAAO,MAAM,yBAAyB;;;;;;;;;EAGpC,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAGH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKtC,CAAC;AAGH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG5B,CAAC;AAGH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI5C,CAAC;AAGH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG3C,CAAC;AAGF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEnC,CAAC;AAGF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;EAI3C,CAAC;AAGH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG9C,CAAC;AAGH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG7C,CAAC;AAGF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE7C,CAAC;AAGF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAChG,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.conversationHistoryResponseSchema = exports.conversationHistoryResourceSchema = exports.conversationHistoryAttributesSchema = exports.conversationHistoryMessageSchema = exports.agentChatResponseSchema = exports.agentChatResponseResourceSchema = exports.agentChatResponseAttributesSchema = exports.chatRequestSchema = exports.chatRequestAttributesSchema = exports.toolCallResultSchema = exports.conversationMessageSchema = exports.messageRoleSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const common_schemas_1 = require("./common.schemas");
6
+ /**
7
+ * Agents schemas - JSON:API compliant
8
+ */
9
+ // Conversation message role enum
10
+ exports.messageRoleSchema = zod_1.z.enum(['user', 'assistant']);
11
+ // Conversation message schema
12
+ exports.conversationMessageSchema = zod_1.z.object({
13
+ role: exports.messageRoleSchema,
14
+ content: zod_1.z.string().min(1),
15
+ });
16
+ // Tool call result schema
17
+ exports.toolCallResultSchema = zod_1.z.object({
18
+ tool: zod_1.z.string(),
19
+ result: zod_1.z.unknown(), // Tool results can be any shape
20
+ });
21
+ // Chat request attributes schema
22
+ exports.chatRequestAttributesSchema = zod_1.z.object({
23
+ message: zod_1.z.string().min(1).max(5000),
24
+ farmId: zod_1.z.string().uuid().optional(),
25
+ conversationId: zod_1.z.string().uuid().optional(), // Continue existing conversation
26
+ conversationHistory: zod_1.z.array(exports.conversationMessageSchema).optional(),
27
+ });
28
+ // Chat request input (JSON:API format)
29
+ exports.chatRequestSchema = zod_1.z.object({
30
+ type: zod_1.z.literal('agent-chat-requests'),
31
+ attributes: exports.chatRequestAttributesSchema,
32
+ });
33
+ // Agent chat response attributes schema
34
+ exports.agentChatResponseAttributesSchema = zod_1.z.object({
35
+ response: zod_1.z.string(),
36
+ toolCalls: zod_1.z.array(exports.toolCallResultSchema).optional(),
37
+ conversationId: zod_1.z.string().uuid(), // Return conversation ID for continuing
38
+ });
39
+ // Agent chat response resource (JSON:API resource object)
40
+ exports.agentChatResponseResourceSchema = (0, common_schemas_1.createJsonApiResourceSchema)('agent-chat-responses', exports.agentChatResponseAttributesSchema);
41
+ // Agent chat response (JSON:API single response)
42
+ exports.agentChatResponseSchema = (0, common_schemas_1.jsonApiSingleResponseSchema)(exports.agentChatResponseResourceSchema);
43
+ // Conversation history message schema (with timestamp)
44
+ exports.conversationHistoryMessageSchema = zod_1.z.object({
45
+ role: exports.messageRoleSchema,
46
+ content: zod_1.z.string(),
47
+ createdAt: zod_1.z.string().datetime().optional(),
48
+ });
49
+ // Conversation history response attributes
50
+ exports.conversationHistoryAttributesSchema = zod_1.z.object({
51
+ messages: zod_1.z.array(exports.conversationHistoryMessageSchema),
52
+ conversationId: zod_1.z.string().uuid(),
53
+ });
54
+ // Conversation history resource
55
+ exports.conversationHistoryResourceSchema = (0, common_schemas_1.createJsonApiResourceSchema)('conversation-histories', exports.conversationHistoryAttributesSchema);
56
+ // Conversation history response
57
+ exports.conversationHistoryResponseSchema = (0, common_schemas_1.jsonApiSingleResponseSchema)(exports.conversationHistoryResourceSchema);
@@ -43,5 +43,5 @@ exports.categoryListResponseSchema = (0, common_schemas_1.jsonApiCollectionRespo
43
43
  // Get categories query parameters
44
44
  exports.getCategoriesQuerySchema = zod_1.z.object({
45
45
  farmId: zod_1.z.string().uuid().optional(),
46
- includeDefaults: zod_1.z.boolean().optional().default(true),
46
+ includeDefaults: zod_1.z.coerce.boolean().optional().default(true),
47
47
  });