@deepintel-ltd/farmpro-contracts 1.3.1 → 1.3.4

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.
Files changed (55) hide show
  1. package/dist/index.d.ts +7 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +10 -1
  4. package/dist/routes/admin.routes.d.ts +747 -0
  5. package/dist/routes/admin.routes.d.ts.map +1 -0
  6. package/dist/routes/admin.routes.js +26 -0
  7. package/dist/routes/agent-workflows.routes.d.ts +2900 -0
  8. package/dist/routes/agent-workflows.routes.d.ts.map +1 -0
  9. package/dist/routes/agent-workflows.routes.js +160 -0
  10. package/dist/routes/documents.routes.d.ts +417 -0
  11. package/dist/routes/documents.routes.d.ts.map +1 -1
  12. package/dist/routes/documents.routes.js +16 -0
  13. package/dist/routes/field-monitoring.routes.d.ts +568 -23
  14. package/dist/routes/field-monitoring.routes.d.ts.map +1 -1
  15. package/dist/routes/field-monitoring.routes.js +64 -0
  16. package/dist/routes/field-observations.routes.d.ts +130 -58
  17. package/dist/routes/field-observations.routes.d.ts.map +1 -1
  18. package/dist/routes/health.routes.d.ts +317 -0
  19. package/dist/routes/health.routes.d.ts.map +1 -0
  20. package/dist/routes/health.routes.js +18 -0
  21. package/dist/routes/index.d.ts +9 -0
  22. package/dist/routes/index.d.ts.map +1 -1
  23. package/dist/routes/index.js +6 -0
  24. package/dist/routes/tasks.routes.d.ts +408 -0
  25. package/dist/routes/tasks.routes.d.ts.map +1 -1
  26. package/dist/routes/weather.routes.d.ts +264 -17
  27. package/dist/routes/weather.routes.d.ts.map +1 -1
  28. package/dist/schemas/admin.schemas.d.ts +1063 -0
  29. package/dist/schemas/admin.schemas.d.ts.map +1 -0
  30. package/dist/schemas/admin.schemas.js +63 -0
  31. package/dist/schemas/agent-workflows.schemas.d.ts +2399 -0
  32. package/dist/schemas/agent-workflows.schemas.d.ts.map +1 -0
  33. package/dist/schemas/agent-workflows.schemas.js +70 -0
  34. package/dist/schemas/documents.schemas.d.ts +202 -0
  35. package/dist/schemas/documents.schemas.d.ts.map +1 -1
  36. package/dist/schemas/documents.schemas.js +10 -1
  37. package/dist/schemas/field-monitoring.schemas.d.ts +215 -9
  38. package/dist/schemas/field-monitoring.schemas.d.ts.map +1 -1
  39. package/dist/schemas/field-monitoring.schemas.js +26 -2
  40. package/dist/schemas/field-observations.schemas.d.ts +100 -40
  41. package/dist/schemas/field-observations.schemas.d.ts.map +1 -1
  42. package/dist/schemas/field-observations.schemas.js +2 -24
  43. package/dist/schemas/health.schemas.d.ts +176 -0
  44. package/dist/schemas/health.schemas.d.ts.map +1 -0
  45. package/dist/schemas/health.schemas.js +26 -0
  46. package/dist/schemas/recommendations.schemas.d.ts +112 -0
  47. package/dist/schemas/recommendations.schemas.d.ts.map +1 -0
  48. package/dist/schemas/recommendations.schemas.js +32 -0
  49. package/dist/schemas/tasks.schemas.d.ts +344 -0
  50. package/dist/schemas/tasks.schemas.d.ts.map +1 -1
  51. package/dist/schemas/tasks.schemas.js +9 -0
  52. package/dist/schemas/weather.schemas.d.ts +780 -44
  53. package/dist/schemas/weather.schemas.d.ts.map +1 -1
  54. package/dist/schemas/weather.schemas.js +2 -1
  55. package/package.json +1 -1
@@ -0,0 +1,2900 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Agent Workflows Routes
4
+ *
5
+ * API endpoints for querying and monitoring autonomous agent workflows.
6
+ * These workflows track the system's automated decision-making process
7
+ * for converting recommendations into tasks.
8
+ */
9
+ export declare const agentWorkflowsRouter: {
10
+ listWorkflows: {
11
+ query: z.ZodObject<{
12
+ farmId: z.ZodOptional<z.ZodString>;
13
+ fieldId: z.ZodOptional<z.ZodString>;
14
+ status: z.ZodOptional<z.ZodEnum<["in_progress", "completed", "failed"]>>;
15
+ triggerEvent: z.ZodOptional<z.ZodString>;
16
+ startDate: z.ZodOptional<z.ZodString>;
17
+ endDate: z.ZodOptional<z.ZodString>;
18
+ limit: z.ZodDefault<z.ZodNumber>;
19
+ offset: z.ZodDefault<z.ZodNumber>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ limit: number;
22
+ offset: number;
23
+ status?: "completed" | "in_progress" | "failed" | undefined;
24
+ farmId?: string | undefined;
25
+ fieldId?: string | undefined;
26
+ triggerEvent?: string | undefined;
27
+ startDate?: string | undefined;
28
+ endDate?: string | undefined;
29
+ }, {
30
+ status?: "completed" | "in_progress" | "failed" | undefined;
31
+ farmId?: string | undefined;
32
+ fieldId?: string | undefined;
33
+ limit?: number | undefined;
34
+ offset?: number | undefined;
35
+ triggerEvent?: string | undefined;
36
+ startDate?: string | undefined;
37
+ endDate?: string | undefined;
38
+ }>;
39
+ summary: "List agent workflows with filters";
40
+ method: "GET";
41
+ path: "/agent-workflows";
42
+ responses: {
43
+ 200: z.ZodObject<{
44
+ data: z.ZodArray<z.ZodObject<{
45
+ type: z.ZodLiteral<string>;
46
+ id: z.ZodString;
47
+ attributes: z.ZodObject<{
48
+ workflowType: z.ZodLiteral<"recommendation_to_task">;
49
+ triggerEvent: z.ZodString;
50
+ triggerId: z.ZodString;
51
+ fieldId: z.ZodString;
52
+ farmId: z.ZodString;
53
+ status: z.ZodEnum<["in_progress", "completed", "failed"]>;
54
+ outcome: z.ZodNullable<z.ZodEnum<["task_created", "task_updated", "no_action_needed", "error"]>>;
55
+ agentResults: z.ZodNullable<z.ZodObject<{
56
+ summary: z.ZodObject<{
57
+ sourceType: z.ZodString;
58
+ tasksCreated: z.ZodNumber;
59
+ tasksUpdated: z.ZodNumber;
60
+ skipped: z.ZodNumber;
61
+ }, "strip", z.ZodTypeAny, {
62
+ skipped: number;
63
+ sourceType: string;
64
+ tasksCreated: number;
65
+ tasksUpdated: number;
66
+ }, {
67
+ skipped: number;
68
+ sourceType: string;
69
+ tasksCreated: number;
70
+ tasksUpdated: number;
71
+ }>;
72
+ results: z.ZodArray<z.ZodObject<{
73
+ recommendation: z.ZodObject<{
74
+ priority: z.ZodNumber;
75
+ action: z.ZodString;
76
+ details: z.ZodString;
77
+ timing: z.ZodString;
78
+ severity: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
79
+ confidence: z.ZodOptional<z.ZodNumber>;
80
+ materials: z.ZodOptional<z.ZodArray<z.ZodObject<{
81
+ inventoryItemId: z.ZodOptional<z.ZodString>;
82
+ name: z.ZodString;
83
+ quantity: z.ZodNumber;
84
+ unit: z.ZodString;
85
+ costPerUnit: z.ZodOptional<z.ZodNumber>;
86
+ totalCost: z.ZodOptional<z.ZodNumber>;
87
+ availability: z.ZodOptional<z.ZodString>;
88
+ }, "strip", z.ZodTypeAny, {
89
+ name: string;
90
+ unit: string;
91
+ quantity: number;
92
+ inventoryItemId?: string | undefined;
93
+ totalCost?: number | undefined;
94
+ costPerUnit?: number | undefined;
95
+ availability?: string | undefined;
96
+ }, {
97
+ name: string;
98
+ unit: string;
99
+ quantity: number;
100
+ inventoryItemId?: string | undefined;
101
+ totalCost?: number | undefined;
102
+ costPerUnit?: number | undefined;
103
+ availability?: string | undefined;
104
+ }>, "many">>;
105
+ applicationMethod: z.ZodOptional<z.ZodString>;
106
+ expectedOutcome: z.ZodOptional<z.ZodString>;
107
+ preventiveMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
108
+ estimatedTime: z.ZodOptional<z.ZodString>;
109
+ riskLevel: z.ZodOptional<z.ZodString>;
110
+ }, "strip", z.ZodTypeAny, {
111
+ priority: number;
112
+ action: string;
113
+ details: string;
114
+ timing: string;
115
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
116
+ confidence?: number | undefined;
117
+ materials?: {
118
+ name: string;
119
+ unit: string;
120
+ quantity: number;
121
+ inventoryItemId?: string | undefined;
122
+ totalCost?: number | undefined;
123
+ costPerUnit?: number | undefined;
124
+ availability?: string | undefined;
125
+ }[] | undefined;
126
+ applicationMethod?: string | undefined;
127
+ expectedOutcome?: string | undefined;
128
+ preventiveMeasures?: string[] | undefined;
129
+ estimatedTime?: string | undefined;
130
+ riskLevel?: string | undefined;
131
+ }, {
132
+ priority: number;
133
+ action: string;
134
+ details: string;
135
+ timing: string;
136
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
137
+ confidence?: number | undefined;
138
+ materials?: {
139
+ name: string;
140
+ unit: string;
141
+ quantity: number;
142
+ inventoryItemId?: string | undefined;
143
+ totalCost?: number | undefined;
144
+ costPerUnit?: number | undefined;
145
+ availability?: string | undefined;
146
+ }[] | undefined;
147
+ applicationMethod?: string | undefined;
148
+ expectedOutcome?: string | undefined;
149
+ preventiveMeasures?: string[] | undefined;
150
+ estimatedTime?: string | undefined;
151
+ riskLevel?: string | undefined;
152
+ }>;
153
+ outcome: z.ZodEnum<["created", "updated", "skipped", "error"]>;
154
+ taskId: z.ZodOptional<z.ZodString>;
155
+ reason: z.ZodString;
156
+ }, "strip", z.ZodTypeAny, {
157
+ reason: string;
158
+ recommendation: {
159
+ priority: number;
160
+ action: string;
161
+ details: string;
162
+ timing: string;
163
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
164
+ confidence?: number | undefined;
165
+ materials?: {
166
+ name: string;
167
+ unit: string;
168
+ quantity: number;
169
+ inventoryItemId?: string | undefined;
170
+ totalCost?: number | undefined;
171
+ costPerUnit?: number | undefined;
172
+ availability?: string | undefined;
173
+ }[] | undefined;
174
+ applicationMethod?: string | undefined;
175
+ expectedOutcome?: string | undefined;
176
+ preventiveMeasures?: string[] | undefined;
177
+ estimatedTime?: string | undefined;
178
+ riskLevel?: string | undefined;
179
+ };
180
+ outcome: "error" | "created" | "updated" | "skipped";
181
+ taskId?: string | undefined;
182
+ }, {
183
+ reason: string;
184
+ recommendation: {
185
+ priority: number;
186
+ action: string;
187
+ details: string;
188
+ timing: string;
189
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
190
+ confidence?: number | undefined;
191
+ materials?: {
192
+ name: string;
193
+ unit: string;
194
+ quantity: number;
195
+ inventoryItemId?: string | undefined;
196
+ totalCost?: number | undefined;
197
+ costPerUnit?: number | undefined;
198
+ availability?: string | undefined;
199
+ }[] | undefined;
200
+ applicationMethod?: string | undefined;
201
+ expectedOutcome?: string | undefined;
202
+ preventiveMeasures?: string[] | undefined;
203
+ estimatedTime?: string | undefined;
204
+ riskLevel?: string | undefined;
205
+ };
206
+ outcome: "error" | "created" | "updated" | "skipped";
207
+ taskId?: string | undefined;
208
+ }>, "many">;
209
+ taskReview: z.ZodOptional<z.ZodAny>;
210
+ }, "strip", z.ZodTypeAny, {
211
+ summary: {
212
+ skipped: number;
213
+ sourceType: string;
214
+ tasksCreated: number;
215
+ tasksUpdated: number;
216
+ };
217
+ results: {
218
+ reason: string;
219
+ recommendation: {
220
+ priority: number;
221
+ action: string;
222
+ details: string;
223
+ timing: string;
224
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
225
+ confidence?: number | undefined;
226
+ materials?: {
227
+ name: string;
228
+ unit: string;
229
+ quantity: number;
230
+ inventoryItemId?: string | undefined;
231
+ totalCost?: number | undefined;
232
+ costPerUnit?: number | undefined;
233
+ availability?: string | undefined;
234
+ }[] | undefined;
235
+ applicationMethod?: string | undefined;
236
+ expectedOutcome?: string | undefined;
237
+ preventiveMeasures?: string[] | undefined;
238
+ estimatedTime?: string | undefined;
239
+ riskLevel?: string | undefined;
240
+ };
241
+ outcome: "error" | "created" | "updated" | "skipped";
242
+ taskId?: string | undefined;
243
+ }[];
244
+ taskReview?: any;
245
+ }, {
246
+ summary: {
247
+ skipped: number;
248
+ sourceType: string;
249
+ tasksCreated: number;
250
+ tasksUpdated: number;
251
+ };
252
+ results: {
253
+ reason: string;
254
+ recommendation: {
255
+ priority: number;
256
+ action: string;
257
+ details: string;
258
+ timing: string;
259
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
260
+ confidence?: number | undefined;
261
+ materials?: {
262
+ name: string;
263
+ unit: string;
264
+ quantity: number;
265
+ inventoryItemId?: string | undefined;
266
+ totalCost?: number | undefined;
267
+ costPerUnit?: number | undefined;
268
+ availability?: string | undefined;
269
+ }[] | undefined;
270
+ applicationMethod?: string | undefined;
271
+ expectedOutcome?: string | undefined;
272
+ preventiveMeasures?: string[] | undefined;
273
+ estimatedTime?: string | undefined;
274
+ riskLevel?: string | undefined;
275
+ };
276
+ outcome: "error" | "created" | "updated" | "skipped";
277
+ taskId?: string | undefined;
278
+ }[];
279
+ taskReview?: any;
280
+ }>>;
281
+ errorMessage: z.ZodNullable<z.ZodString>;
282
+ completedAt: z.ZodNullable<z.ZodDate>;
283
+ } & {
284
+ createdAt: z.ZodString;
285
+ updatedAt: z.ZodString;
286
+ }, "strip", z.ZodTypeAny, {
287
+ status: "completed" | "in_progress" | "failed";
288
+ createdAt: string;
289
+ updatedAt: string;
290
+ farmId: string;
291
+ fieldId: string;
292
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
293
+ workflowType: "recommendation_to_task";
294
+ triggerEvent: string;
295
+ triggerId: string;
296
+ agentResults: {
297
+ summary: {
298
+ skipped: number;
299
+ sourceType: string;
300
+ tasksCreated: number;
301
+ tasksUpdated: number;
302
+ };
303
+ results: {
304
+ reason: string;
305
+ recommendation: {
306
+ priority: number;
307
+ action: string;
308
+ details: string;
309
+ timing: string;
310
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
311
+ confidence?: number | undefined;
312
+ materials?: {
313
+ name: string;
314
+ unit: string;
315
+ quantity: number;
316
+ inventoryItemId?: string | undefined;
317
+ totalCost?: number | undefined;
318
+ costPerUnit?: number | undefined;
319
+ availability?: string | undefined;
320
+ }[] | undefined;
321
+ applicationMethod?: string | undefined;
322
+ expectedOutcome?: string | undefined;
323
+ preventiveMeasures?: string[] | undefined;
324
+ estimatedTime?: string | undefined;
325
+ riskLevel?: string | undefined;
326
+ };
327
+ outcome: "error" | "created" | "updated" | "skipped";
328
+ taskId?: string | undefined;
329
+ }[];
330
+ taskReview?: any;
331
+ } | null;
332
+ errorMessage: string | null;
333
+ completedAt: Date | null;
334
+ }, {
335
+ status: "completed" | "in_progress" | "failed";
336
+ createdAt: string;
337
+ updatedAt: string;
338
+ farmId: string;
339
+ fieldId: string;
340
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
341
+ workflowType: "recommendation_to_task";
342
+ triggerEvent: string;
343
+ triggerId: string;
344
+ agentResults: {
345
+ summary: {
346
+ skipped: number;
347
+ sourceType: string;
348
+ tasksCreated: number;
349
+ tasksUpdated: number;
350
+ };
351
+ results: {
352
+ reason: string;
353
+ recommendation: {
354
+ priority: number;
355
+ action: string;
356
+ details: string;
357
+ timing: string;
358
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
359
+ confidence?: number | undefined;
360
+ materials?: {
361
+ name: string;
362
+ unit: string;
363
+ quantity: number;
364
+ inventoryItemId?: string | undefined;
365
+ totalCost?: number | undefined;
366
+ costPerUnit?: number | undefined;
367
+ availability?: string | undefined;
368
+ }[] | undefined;
369
+ applicationMethod?: string | undefined;
370
+ expectedOutcome?: string | undefined;
371
+ preventiveMeasures?: string[] | undefined;
372
+ estimatedTime?: string | undefined;
373
+ riskLevel?: string | undefined;
374
+ };
375
+ outcome: "error" | "created" | "updated" | "skipped";
376
+ taskId?: string | undefined;
377
+ }[];
378
+ taskReview?: any;
379
+ } | null;
380
+ errorMessage: string | null;
381
+ completedAt: Date | null;
382
+ }>;
383
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
384
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
385
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
386
+ }, "strip", z.ZodTypeAny, {
387
+ type: string;
388
+ id: string;
389
+ attributes: {
390
+ status: "completed" | "in_progress" | "failed";
391
+ createdAt: string;
392
+ updatedAt: string;
393
+ farmId: string;
394
+ fieldId: string;
395
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
396
+ workflowType: "recommendation_to_task";
397
+ triggerEvent: string;
398
+ triggerId: string;
399
+ agentResults: {
400
+ summary: {
401
+ skipped: number;
402
+ sourceType: string;
403
+ tasksCreated: number;
404
+ tasksUpdated: number;
405
+ };
406
+ results: {
407
+ reason: string;
408
+ recommendation: {
409
+ priority: number;
410
+ action: string;
411
+ details: string;
412
+ timing: string;
413
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
414
+ confidence?: number | undefined;
415
+ materials?: {
416
+ name: string;
417
+ unit: string;
418
+ quantity: number;
419
+ inventoryItemId?: string | undefined;
420
+ totalCost?: number | undefined;
421
+ costPerUnit?: number | undefined;
422
+ availability?: string | undefined;
423
+ }[] | undefined;
424
+ applicationMethod?: string | undefined;
425
+ expectedOutcome?: string | undefined;
426
+ preventiveMeasures?: string[] | undefined;
427
+ estimatedTime?: string | undefined;
428
+ riskLevel?: string | undefined;
429
+ };
430
+ outcome: "error" | "created" | "updated" | "skipped";
431
+ taskId?: string | undefined;
432
+ }[];
433
+ taskReview?: any;
434
+ } | null;
435
+ errorMessage: string | null;
436
+ completedAt: Date | null;
437
+ };
438
+ relationships?: Record<string, unknown> | undefined;
439
+ links?: Record<string, string> | undefined;
440
+ meta?: Record<string, unknown> | undefined;
441
+ }, {
442
+ type: string;
443
+ id: string;
444
+ attributes: {
445
+ status: "completed" | "in_progress" | "failed";
446
+ createdAt: string;
447
+ updatedAt: string;
448
+ farmId: string;
449
+ fieldId: string;
450
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
451
+ workflowType: "recommendation_to_task";
452
+ triggerEvent: string;
453
+ triggerId: string;
454
+ agentResults: {
455
+ summary: {
456
+ skipped: number;
457
+ sourceType: string;
458
+ tasksCreated: number;
459
+ tasksUpdated: number;
460
+ };
461
+ results: {
462
+ reason: string;
463
+ recommendation: {
464
+ priority: number;
465
+ action: string;
466
+ details: string;
467
+ timing: string;
468
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
469
+ confidence?: number | undefined;
470
+ materials?: {
471
+ name: string;
472
+ unit: string;
473
+ quantity: number;
474
+ inventoryItemId?: string | undefined;
475
+ totalCost?: number | undefined;
476
+ costPerUnit?: number | undefined;
477
+ availability?: string | undefined;
478
+ }[] | undefined;
479
+ applicationMethod?: string | undefined;
480
+ expectedOutcome?: string | undefined;
481
+ preventiveMeasures?: string[] | undefined;
482
+ estimatedTime?: string | undefined;
483
+ riskLevel?: string | undefined;
484
+ };
485
+ outcome: "error" | "created" | "updated" | "skipped";
486
+ taskId?: string | undefined;
487
+ }[];
488
+ taskReview?: any;
489
+ } | null;
490
+ errorMessage: string | null;
491
+ completedAt: Date | null;
492
+ };
493
+ relationships?: Record<string, unknown> | undefined;
494
+ links?: Record<string, string> | undefined;
495
+ meta?: Record<string, unknown> | undefined;
496
+ }>, "many">;
497
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
498
+ type: z.ZodString;
499
+ id: z.ZodString;
500
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
501
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
502
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
503
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
504
+ }, "strip", z.ZodTypeAny, {
505
+ type: string;
506
+ id: string;
507
+ attributes?: Record<string, unknown> | undefined;
508
+ relationships?: Record<string, unknown> | undefined;
509
+ links?: Record<string, string> | undefined;
510
+ meta?: Record<string, unknown> | undefined;
511
+ }, {
512
+ type: string;
513
+ id: string;
514
+ attributes?: Record<string, unknown> | undefined;
515
+ relationships?: Record<string, unknown> | undefined;
516
+ links?: Record<string, string> | undefined;
517
+ meta?: Record<string, unknown> | undefined;
518
+ }>, "many">>;
519
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
520
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
521
+ }, "strip", z.ZodTypeAny, {
522
+ data: {
523
+ type: string;
524
+ id: string;
525
+ attributes: {
526
+ status: "completed" | "in_progress" | "failed";
527
+ createdAt: string;
528
+ updatedAt: string;
529
+ farmId: string;
530
+ fieldId: string;
531
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
532
+ workflowType: "recommendation_to_task";
533
+ triggerEvent: string;
534
+ triggerId: string;
535
+ agentResults: {
536
+ summary: {
537
+ skipped: number;
538
+ sourceType: string;
539
+ tasksCreated: number;
540
+ tasksUpdated: number;
541
+ };
542
+ results: {
543
+ reason: string;
544
+ recommendation: {
545
+ priority: number;
546
+ action: string;
547
+ details: string;
548
+ timing: string;
549
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
550
+ confidence?: number | undefined;
551
+ materials?: {
552
+ name: string;
553
+ unit: string;
554
+ quantity: number;
555
+ inventoryItemId?: string | undefined;
556
+ totalCost?: number | undefined;
557
+ costPerUnit?: number | undefined;
558
+ availability?: string | undefined;
559
+ }[] | undefined;
560
+ applicationMethod?: string | undefined;
561
+ expectedOutcome?: string | undefined;
562
+ preventiveMeasures?: string[] | undefined;
563
+ estimatedTime?: string | undefined;
564
+ riskLevel?: string | undefined;
565
+ };
566
+ outcome: "error" | "created" | "updated" | "skipped";
567
+ taskId?: string | undefined;
568
+ }[];
569
+ taskReview?: any;
570
+ } | null;
571
+ errorMessage: string | null;
572
+ completedAt: Date | null;
573
+ };
574
+ relationships?: Record<string, unknown> | undefined;
575
+ links?: Record<string, string> | undefined;
576
+ meta?: Record<string, unknown> | undefined;
577
+ }[];
578
+ links?: Record<string, string> | undefined;
579
+ meta?: Record<string, unknown> | undefined;
580
+ included?: {
581
+ type: string;
582
+ id: string;
583
+ attributes?: Record<string, unknown> | undefined;
584
+ relationships?: Record<string, unknown> | undefined;
585
+ links?: Record<string, string> | undefined;
586
+ meta?: Record<string, unknown> | undefined;
587
+ }[] | undefined;
588
+ }, {
589
+ data: {
590
+ type: string;
591
+ id: string;
592
+ attributes: {
593
+ status: "completed" | "in_progress" | "failed";
594
+ createdAt: string;
595
+ updatedAt: string;
596
+ farmId: string;
597
+ fieldId: string;
598
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
599
+ workflowType: "recommendation_to_task";
600
+ triggerEvent: string;
601
+ triggerId: string;
602
+ agentResults: {
603
+ summary: {
604
+ skipped: number;
605
+ sourceType: string;
606
+ tasksCreated: number;
607
+ tasksUpdated: number;
608
+ };
609
+ results: {
610
+ reason: string;
611
+ recommendation: {
612
+ priority: number;
613
+ action: string;
614
+ details: string;
615
+ timing: string;
616
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
617
+ confidence?: number | undefined;
618
+ materials?: {
619
+ name: string;
620
+ unit: string;
621
+ quantity: number;
622
+ inventoryItemId?: string | undefined;
623
+ totalCost?: number | undefined;
624
+ costPerUnit?: number | undefined;
625
+ availability?: string | undefined;
626
+ }[] | undefined;
627
+ applicationMethod?: string | undefined;
628
+ expectedOutcome?: string | undefined;
629
+ preventiveMeasures?: string[] | undefined;
630
+ estimatedTime?: string | undefined;
631
+ riskLevel?: string | undefined;
632
+ };
633
+ outcome: "error" | "created" | "updated" | "skipped";
634
+ taskId?: string | undefined;
635
+ }[];
636
+ taskReview?: any;
637
+ } | null;
638
+ errorMessage: string | null;
639
+ completedAt: Date | null;
640
+ };
641
+ relationships?: Record<string, unknown> | undefined;
642
+ links?: Record<string, string> | undefined;
643
+ meta?: Record<string, unknown> | undefined;
644
+ }[];
645
+ links?: Record<string, string> | undefined;
646
+ meta?: Record<string, unknown> | undefined;
647
+ included?: {
648
+ type: string;
649
+ id: string;
650
+ attributes?: Record<string, unknown> | undefined;
651
+ relationships?: Record<string, unknown> | undefined;
652
+ links?: Record<string, string> | undefined;
653
+ meta?: Record<string, unknown> | undefined;
654
+ }[] | undefined;
655
+ }>;
656
+ 400: z.ZodObject<{
657
+ errors: z.ZodArray<z.ZodObject<{
658
+ status: z.ZodString;
659
+ code: z.ZodString;
660
+ title: z.ZodString;
661
+ detail: z.ZodString;
662
+ }, "strip", z.ZodTypeAny, {
663
+ status: string;
664
+ code: string;
665
+ title: string;
666
+ detail: string;
667
+ }, {
668
+ status: string;
669
+ code: string;
670
+ title: string;
671
+ detail: string;
672
+ }>, "many">;
673
+ }, "strip", z.ZodTypeAny, {
674
+ errors: {
675
+ status: string;
676
+ code: string;
677
+ title: string;
678
+ detail: string;
679
+ }[];
680
+ }, {
681
+ errors: {
682
+ status: string;
683
+ code: string;
684
+ title: string;
685
+ detail: string;
686
+ }[];
687
+ }>;
688
+ };
689
+ };
690
+ getWorkflow: {
691
+ summary: "Get agent workflow details";
692
+ method: "GET";
693
+ path: "/agent-workflows/:id";
694
+ responses: {
695
+ 200: z.ZodObject<{
696
+ data: z.ZodObject<{
697
+ type: z.ZodLiteral<string>;
698
+ id: z.ZodString;
699
+ attributes: z.ZodObject<{
700
+ workflowType: z.ZodLiteral<"recommendation_to_task">;
701
+ triggerEvent: z.ZodString;
702
+ triggerId: z.ZodString;
703
+ fieldId: z.ZodString;
704
+ farmId: z.ZodString;
705
+ status: z.ZodEnum<["in_progress", "completed", "failed"]>;
706
+ outcome: z.ZodNullable<z.ZodEnum<["task_created", "task_updated", "no_action_needed", "error"]>>;
707
+ agentResults: z.ZodNullable<z.ZodObject<{
708
+ summary: z.ZodObject<{
709
+ sourceType: z.ZodString;
710
+ tasksCreated: z.ZodNumber;
711
+ tasksUpdated: z.ZodNumber;
712
+ skipped: z.ZodNumber;
713
+ }, "strip", z.ZodTypeAny, {
714
+ skipped: number;
715
+ sourceType: string;
716
+ tasksCreated: number;
717
+ tasksUpdated: number;
718
+ }, {
719
+ skipped: number;
720
+ sourceType: string;
721
+ tasksCreated: number;
722
+ tasksUpdated: number;
723
+ }>;
724
+ results: z.ZodArray<z.ZodObject<{
725
+ recommendation: z.ZodObject<{
726
+ priority: z.ZodNumber;
727
+ action: z.ZodString;
728
+ details: z.ZodString;
729
+ timing: z.ZodString;
730
+ severity: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
731
+ confidence: z.ZodOptional<z.ZodNumber>;
732
+ materials: z.ZodOptional<z.ZodArray<z.ZodObject<{
733
+ inventoryItemId: z.ZodOptional<z.ZodString>;
734
+ name: z.ZodString;
735
+ quantity: z.ZodNumber;
736
+ unit: z.ZodString;
737
+ costPerUnit: z.ZodOptional<z.ZodNumber>;
738
+ totalCost: z.ZodOptional<z.ZodNumber>;
739
+ availability: z.ZodOptional<z.ZodString>;
740
+ }, "strip", z.ZodTypeAny, {
741
+ name: string;
742
+ unit: string;
743
+ quantity: number;
744
+ inventoryItemId?: string | undefined;
745
+ totalCost?: number | undefined;
746
+ costPerUnit?: number | undefined;
747
+ availability?: string | undefined;
748
+ }, {
749
+ name: string;
750
+ unit: string;
751
+ quantity: number;
752
+ inventoryItemId?: string | undefined;
753
+ totalCost?: number | undefined;
754
+ costPerUnit?: number | undefined;
755
+ availability?: string | undefined;
756
+ }>, "many">>;
757
+ applicationMethod: z.ZodOptional<z.ZodString>;
758
+ expectedOutcome: z.ZodOptional<z.ZodString>;
759
+ preventiveMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
760
+ estimatedTime: z.ZodOptional<z.ZodString>;
761
+ riskLevel: z.ZodOptional<z.ZodString>;
762
+ }, "strip", z.ZodTypeAny, {
763
+ priority: number;
764
+ action: string;
765
+ details: string;
766
+ timing: string;
767
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
768
+ confidence?: number | undefined;
769
+ materials?: {
770
+ name: string;
771
+ unit: string;
772
+ quantity: number;
773
+ inventoryItemId?: string | undefined;
774
+ totalCost?: number | undefined;
775
+ costPerUnit?: number | undefined;
776
+ availability?: string | undefined;
777
+ }[] | undefined;
778
+ applicationMethod?: string | undefined;
779
+ expectedOutcome?: string | undefined;
780
+ preventiveMeasures?: string[] | undefined;
781
+ estimatedTime?: string | undefined;
782
+ riskLevel?: string | undefined;
783
+ }, {
784
+ priority: number;
785
+ action: string;
786
+ details: string;
787
+ timing: string;
788
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
789
+ confidence?: number | undefined;
790
+ materials?: {
791
+ name: string;
792
+ unit: string;
793
+ quantity: number;
794
+ inventoryItemId?: string | undefined;
795
+ totalCost?: number | undefined;
796
+ costPerUnit?: number | undefined;
797
+ availability?: string | undefined;
798
+ }[] | undefined;
799
+ applicationMethod?: string | undefined;
800
+ expectedOutcome?: string | undefined;
801
+ preventiveMeasures?: string[] | undefined;
802
+ estimatedTime?: string | undefined;
803
+ riskLevel?: string | undefined;
804
+ }>;
805
+ outcome: z.ZodEnum<["created", "updated", "skipped", "error"]>;
806
+ taskId: z.ZodOptional<z.ZodString>;
807
+ reason: z.ZodString;
808
+ }, "strip", z.ZodTypeAny, {
809
+ reason: string;
810
+ recommendation: {
811
+ priority: number;
812
+ action: string;
813
+ details: string;
814
+ timing: string;
815
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
816
+ confidence?: number | undefined;
817
+ materials?: {
818
+ name: string;
819
+ unit: string;
820
+ quantity: number;
821
+ inventoryItemId?: string | undefined;
822
+ totalCost?: number | undefined;
823
+ costPerUnit?: number | undefined;
824
+ availability?: string | undefined;
825
+ }[] | undefined;
826
+ applicationMethod?: string | undefined;
827
+ expectedOutcome?: string | undefined;
828
+ preventiveMeasures?: string[] | undefined;
829
+ estimatedTime?: string | undefined;
830
+ riskLevel?: string | undefined;
831
+ };
832
+ outcome: "error" | "created" | "updated" | "skipped";
833
+ taskId?: string | undefined;
834
+ }, {
835
+ reason: string;
836
+ recommendation: {
837
+ priority: number;
838
+ action: string;
839
+ details: string;
840
+ timing: string;
841
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
842
+ confidence?: number | undefined;
843
+ materials?: {
844
+ name: string;
845
+ unit: string;
846
+ quantity: number;
847
+ inventoryItemId?: string | undefined;
848
+ totalCost?: number | undefined;
849
+ costPerUnit?: number | undefined;
850
+ availability?: string | undefined;
851
+ }[] | undefined;
852
+ applicationMethod?: string | undefined;
853
+ expectedOutcome?: string | undefined;
854
+ preventiveMeasures?: string[] | undefined;
855
+ estimatedTime?: string | undefined;
856
+ riskLevel?: string | undefined;
857
+ };
858
+ outcome: "error" | "created" | "updated" | "skipped";
859
+ taskId?: string | undefined;
860
+ }>, "many">;
861
+ taskReview: z.ZodOptional<z.ZodAny>;
862
+ }, "strip", z.ZodTypeAny, {
863
+ summary: {
864
+ skipped: number;
865
+ sourceType: string;
866
+ tasksCreated: number;
867
+ tasksUpdated: number;
868
+ };
869
+ results: {
870
+ reason: string;
871
+ recommendation: {
872
+ priority: number;
873
+ action: string;
874
+ details: string;
875
+ timing: string;
876
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
877
+ confidence?: number | undefined;
878
+ materials?: {
879
+ name: string;
880
+ unit: string;
881
+ quantity: number;
882
+ inventoryItemId?: string | undefined;
883
+ totalCost?: number | undefined;
884
+ costPerUnit?: number | undefined;
885
+ availability?: string | undefined;
886
+ }[] | undefined;
887
+ applicationMethod?: string | undefined;
888
+ expectedOutcome?: string | undefined;
889
+ preventiveMeasures?: string[] | undefined;
890
+ estimatedTime?: string | undefined;
891
+ riskLevel?: string | undefined;
892
+ };
893
+ outcome: "error" | "created" | "updated" | "skipped";
894
+ taskId?: string | undefined;
895
+ }[];
896
+ taskReview?: any;
897
+ }, {
898
+ summary: {
899
+ skipped: number;
900
+ sourceType: string;
901
+ tasksCreated: number;
902
+ tasksUpdated: number;
903
+ };
904
+ results: {
905
+ reason: string;
906
+ recommendation: {
907
+ priority: number;
908
+ action: string;
909
+ details: string;
910
+ timing: string;
911
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
912
+ confidence?: number | undefined;
913
+ materials?: {
914
+ name: string;
915
+ unit: string;
916
+ quantity: number;
917
+ inventoryItemId?: string | undefined;
918
+ totalCost?: number | undefined;
919
+ costPerUnit?: number | undefined;
920
+ availability?: string | undefined;
921
+ }[] | undefined;
922
+ applicationMethod?: string | undefined;
923
+ expectedOutcome?: string | undefined;
924
+ preventiveMeasures?: string[] | undefined;
925
+ estimatedTime?: string | undefined;
926
+ riskLevel?: string | undefined;
927
+ };
928
+ outcome: "error" | "created" | "updated" | "skipped";
929
+ taskId?: string | undefined;
930
+ }[];
931
+ taskReview?: any;
932
+ }>>;
933
+ errorMessage: z.ZodNullable<z.ZodString>;
934
+ completedAt: z.ZodNullable<z.ZodDate>;
935
+ } & {
936
+ createdAt: z.ZodString;
937
+ updatedAt: z.ZodString;
938
+ }, "strip", z.ZodTypeAny, {
939
+ status: "completed" | "in_progress" | "failed";
940
+ createdAt: string;
941
+ updatedAt: string;
942
+ farmId: string;
943
+ fieldId: string;
944
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
945
+ workflowType: "recommendation_to_task";
946
+ triggerEvent: string;
947
+ triggerId: string;
948
+ agentResults: {
949
+ summary: {
950
+ skipped: number;
951
+ sourceType: string;
952
+ tasksCreated: number;
953
+ tasksUpdated: number;
954
+ };
955
+ results: {
956
+ reason: string;
957
+ recommendation: {
958
+ priority: number;
959
+ action: string;
960
+ details: string;
961
+ timing: string;
962
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
963
+ confidence?: number | undefined;
964
+ materials?: {
965
+ name: string;
966
+ unit: string;
967
+ quantity: number;
968
+ inventoryItemId?: string | undefined;
969
+ totalCost?: number | undefined;
970
+ costPerUnit?: number | undefined;
971
+ availability?: string | undefined;
972
+ }[] | undefined;
973
+ applicationMethod?: string | undefined;
974
+ expectedOutcome?: string | undefined;
975
+ preventiveMeasures?: string[] | undefined;
976
+ estimatedTime?: string | undefined;
977
+ riskLevel?: string | undefined;
978
+ };
979
+ outcome: "error" | "created" | "updated" | "skipped";
980
+ taskId?: string | undefined;
981
+ }[];
982
+ taskReview?: any;
983
+ } | null;
984
+ errorMessage: string | null;
985
+ completedAt: Date | null;
986
+ }, {
987
+ status: "completed" | "in_progress" | "failed";
988
+ createdAt: string;
989
+ updatedAt: string;
990
+ farmId: string;
991
+ fieldId: string;
992
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
993
+ workflowType: "recommendation_to_task";
994
+ triggerEvent: string;
995
+ triggerId: string;
996
+ agentResults: {
997
+ summary: {
998
+ skipped: number;
999
+ sourceType: string;
1000
+ tasksCreated: number;
1001
+ tasksUpdated: number;
1002
+ };
1003
+ results: {
1004
+ reason: string;
1005
+ recommendation: {
1006
+ priority: number;
1007
+ action: string;
1008
+ details: string;
1009
+ timing: string;
1010
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1011
+ confidence?: number | undefined;
1012
+ materials?: {
1013
+ name: string;
1014
+ unit: string;
1015
+ quantity: number;
1016
+ inventoryItemId?: string | undefined;
1017
+ totalCost?: number | undefined;
1018
+ costPerUnit?: number | undefined;
1019
+ availability?: string | undefined;
1020
+ }[] | undefined;
1021
+ applicationMethod?: string | undefined;
1022
+ expectedOutcome?: string | undefined;
1023
+ preventiveMeasures?: string[] | undefined;
1024
+ estimatedTime?: string | undefined;
1025
+ riskLevel?: string | undefined;
1026
+ };
1027
+ outcome: "error" | "created" | "updated" | "skipped";
1028
+ taskId?: string | undefined;
1029
+ }[];
1030
+ taskReview?: any;
1031
+ } | null;
1032
+ errorMessage: string | null;
1033
+ completedAt: Date | null;
1034
+ }>;
1035
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1036
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1037
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1038
+ }, "strip", z.ZodTypeAny, {
1039
+ type: string;
1040
+ id: string;
1041
+ attributes: {
1042
+ status: "completed" | "in_progress" | "failed";
1043
+ createdAt: string;
1044
+ updatedAt: string;
1045
+ farmId: string;
1046
+ fieldId: string;
1047
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
1048
+ workflowType: "recommendation_to_task";
1049
+ triggerEvent: string;
1050
+ triggerId: string;
1051
+ agentResults: {
1052
+ summary: {
1053
+ skipped: number;
1054
+ sourceType: string;
1055
+ tasksCreated: number;
1056
+ tasksUpdated: number;
1057
+ };
1058
+ results: {
1059
+ reason: string;
1060
+ recommendation: {
1061
+ priority: number;
1062
+ action: string;
1063
+ details: string;
1064
+ timing: string;
1065
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1066
+ confidence?: number | undefined;
1067
+ materials?: {
1068
+ name: string;
1069
+ unit: string;
1070
+ quantity: number;
1071
+ inventoryItemId?: string | undefined;
1072
+ totalCost?: number | undefined;
1073
+ costPerUnit?: number | undefined;
1074
+ availability?: string | undefined;
1075
+ }[] | undefined;
1076
+ applicationMethod?: string | undefined;
1077
+ expectedOutcome?: string | undefined;
1078
+ preventiveMeasures?: string[] | undefined;
1079
+ estimatedTime?: string | undefined;
1080
+ riskLevel?: string | undefined;
1081
+ };
1082
+ outcome: "error" | "created" | "updated" | "skipped";
1083
+ taskId?: string | undefined;
1084
+ }[];
1085
+ taskReview?: any;
1086
+ } | null;
1087
+ errorMessage: string | null;
1088
+ completedAt: Date | null;
1089
+ };
1090
+ relationships?: Record<string, unknown> | undefined;
1091
+ links?: Record<string, string> | undefined;
1092
+ meta?: Record<string, unknown> | undefined;
1093
+ }, {
1094
+ type: string;
1095
+ id: string;
1096
+ attributes: {
1097
+ status: "completed" | "in_progress" | "failed";
1098
+ createdAt: string;
1099
+ updatedAt: string;
1100
+ farmId: string;
1101
+ fieldId: string;
1102
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
1103
+ workflowType: "recommendation_to_task";
1104
+ triggerEvent: string;
1105
+ triggerId: string;
1106
+ agentResults: {
1107
+ summary: {
1108
+ skipped: number;
1109
+ sourceType: string;
1110
+ tasksCreated: number;
1111
+ tasksUpdated: number;
1112
+ };
1113
+ results: {
1114
+ reason: string;
1115
+ recommendation: {
1116
+ priority: number;
1117
+ action: string;
1118
+ details: string;
1119
+ timing: string;
1120
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1121
+ confidence?: number | undefined;
1122
+ materials?: {
1123
+ name: string;
1124
+ unit: string;
1125
+ quantity: number;
1126
+ inventoryItemId?: string | undefined;
1127
+ totalCost?: number | undefined;
1128
+ costPerUnit?: number | undefined;
1129
+ availability?: string | undefined;
1130
+ }[] | undefined;
1131
+ applicationMethod?: string | undefined;
1132
+ expectedOutcome?: string | undefined;
1133
+ preventiveMeasures?: string[] | undefined;
1134
+ estimatedTime?: string | undefined;
1135
+ riskLevel?: string | undefined;
1136
+ };
1137
+ outcome: "error" | "created" | "updated" | "skipped";
1138
+ taskId?: string | undefined;
1139
+ }[];
1140
+ taskReview?: any;
1141
+ } | null;
1142
+ errorMessage: string | null;
1143
+ completedAt: Date | null;
1144
+ };
1145
+ relationships?: Record<string, unknown> | undefined;
1146
+ links?: Record<string, string> | undefined;
1147
+ meta?: Record<string, unknown> | undefined;
1148
+ }>;
1149
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
1150
+ type: z.ZodString;
1151
+ id: z.ZodString;
1152
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1153
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1154
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1155
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1156
+ }, "strip", z.ZodTypeAny, {
1157
+ type: string;
1158
+ id: string;
1159
+ attributes?: Record<string, unknown> | undefined;
1160
+ relationships?: Record<string, unknown> | undefined;
1161
+ links?: Record<string, string> | undefined;
1162
+ meta?: Record<string, unknown> | undefined;
1163
+ }, {
1164
+ type: string;
1165
+ id: string;
1166
+ attributes?: Record<string, unknown> | undefined;
1167
+ relationships?: Record<string, unknown> | undefined;
1168
+ links?: Record<string, string> | undefined;
1169
+ meta?: Record<string, unknown> | undefined;
1170
+ }>, "many">>;
1171
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1172
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1173
+ }, "strip", z.ZodTypeAny, {
1174
+ data: {
1175
+ type: string;
1176
+ id: string;
1177
+ attributes: {
1178
+ status: "completed" | "in_progress" | "failed";
1179
+ createdAt: string;
1180
+ updatedAt: string;
1181
+ farmId: string;
1182
+ fieldId: string;
1183
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
1184
+ workflowType: "recommendation_to_task";
1185
+ triggerEvent: string;
1186
+ triggerId: string;
1187
+ agentResults: {
1188
+ summary: {
1189
+ skipped: number;
1190
+ sourceType: string;
1191
+ tasksCreated: number;
1192
+ tasksUpdated: number;
1193
+ };
1194
+ results: {
1195
+ reason: string;
1196
+ recommendation: {
1197
+ priority: number;
1198
+ action: string;
1199
+ details: string;
1200
+ timing: string;
1201
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1202
+ confidence?: number | undefined;
1203
+ materials?: {
1204
+ name: string;
1205
+ unit: string;
1206
+ quantity: number;
1207
+ inventoryItemId?: string | undefined;
1208
+ totalCost?: number | undefined;
1209
+ costPerUnit?: number | undefined;
1210
+ availability?: string | undefined;
1211
+ }[] | undefined;
1212
+ applicationMethod?: string | undefined;
1213
+ expectedOutcome?: string | undefined;
1214
+ preventiveMeasures?: string[] | undefined;
1215
+ estimatedTime?: string | undefined;
1216
+ riskLevel?: string | undefined;
1217
+ };
1218
+ outcome: "error" | "created" | "updated" | "skipped";
1219
+ taskId?: string | undefined;
1220
+ }[];
1221
+ taskReview?: any;
1222
+ } | null;
1223
+ errorMessage: string | null;
1224
+ completedAt: Date | null;
1225
+ };
1226
+ relationships?: Record<string, unknown> | undefined;
1227
+ links?: Record<string, string> | undefined;
1228
+ meta?: Record<string, unknown> | undefined;
1229
+ };
1230
+ links?: Record<string, string> | undefined;
1231
+ meta?: Record<string, unknown> | undefined;
1232
+ included?: {
1233
+ type: string;
1234
+ id: string;
1235
+ attributes?: Record<string, unknown> | undefined;
1236
+ relationships?: Record<string, unknown> | undefined;
1237
+ links?: Record<string, string> | undefined;
1238
+ meta?: Record<string, unknown> | undefined;
1239
+ }[] | undefined;
1240
+ }, {
1241
+ data: {
1242
+ type: string;
1243
+ id: string;
1244
+ attributes: {
1245
+ status: "completed" | "in_progress" | "failed";
1246
+ createdAt: string;
1247
+ updatedAt: string;
1248
+ farmId: string;
1249
+ fieldId: string;
1250
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
1251
+ workflowType: "recommendation_to_task";
1252
+ triggerEvent: string;
1253
+ triggerId: string;
1254
+ agentResults: {
1255
+ summary: {
1256
+ skipped: number;
1257
+ sourceType: string;
1258
+ tasksCreated: number;
1259
+ tasksUpdated: number;
1260
+ };
1261
+ results: {
1262
+ reason: string;
1263
+ recommendation: {
1264
+ priority: number;
1265
+ action: string;
1266
+ details: string;
1267
+ timing: string;
1268
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1269
+ confidence?: number | undefined;
1270
+ materials?: {
1271
+ name: string;
1272
+ unit: string;
1273
+ quantity: number;
1274
+ inventoryItemId?: string | undefined;
1275
+ totalCost?: number | undefined;
1276
+ costPerUnit?: number | undefined;
1277
+ availability?: string | undefined;
1278
+ }[] | undefined;
1279
+ applicationMethod?: string | undefined;
1280
+ expectedOutcome?: string | undefined;
1281
+ preventiveMeasures?: string[] | undefined;
1282
+ estimatedTime?: string | undefined;
1283
+ riskLevel?: string | undefined;
1284
+ };
1285
+ outcome: "error" | "created" | "updated" | "skipped";
1286
+ taskId?: string | undefined;
1287
+ }[];
1288
+ taskReview?: any;
1289
+ } | null;
1290
+ errorMessage: string | null;
1291
+ completedAt: Date | null;
1292
+ };
1293
+ relationships?: Record<string, unknown> | undefined;
1294
+ links?: Record<string, string> | undefined;
1295
+ meta?: Record<string, unknown> | undefined;
1296
+ };
1297
+ links?: Record<string, string> | undefined;
1298
+ meta?: Record<string, unknown> | undefined;
1299
+ included?: {
1300
+ type: string;
1301
+ id: string;
1302
+ attributes?: Record<string, unknown> | undefined;
1303
+ relationships?: Record<string, unknown> | undefined;
1304
+ links?: Record<string, string> | undefined;
1305
+ meta?: Record<string, unknown> | undefined;
1306
+ }[] | undefined;
1307
+ }>;
1308
+ 404: z.ZodObject<{
1309
+ errors: z.ZodArray<z.ZodObject<{
1310
+ status: z.ZodLiteral<"404">;
1311
+ code: z.ZodString;
1312
+ title: z.ZodString;
1313
+ detail: z.ZodString;
1314
+ }, "strip", z.ZodTypeAny, {
1315
+ status: "404";
1316
+ code: string;
1317
+ title: string;
1318
+ detail: string;
1319
+ }, {
1320
+ status: "404";
1321
+ code: string;
1322
+ title: string;
1323
+ detail: string;
1324
+ }>, "many">;
1325
+ }, "strip", z.ZodTypeAny, {
1326
+ errors: {
1327
+ status: "404";
1328
+ code: string;
1329
+ title: string;
1330
+ detail: string;
1331
+ }[];
1332
+ }, {
1333
+ errors: {
1334
+ status: "404";
1335
+ code: string;
1336
+ title: string;
1337
+ detail: string;
1338
+ }[];
1339
+ }>;
1340
+ };
1341
+ };
1342
+ getWorkflowsByFarm: {
1343
+ query: z.ZodObject<{
1344
+ status: z.ZodOptional<z.ZodEnum<["in_progress", "completed", "failed"]>>;
1345
+ limit: z.ZodDefault<z.ZodNumber>;
1346
+ offset: z.ZodDefault<z.ZodNumber>;
1347
+ }, "strip", z.ZodTypeAny, {
1348
+ limit: number;
1349
+ offset: number;
1350
+ status?: "completed" | "in_progress" | "failed" | undefined;
1351
+ }, {
1352
+ status?: "completed" | "in_progress" | "failed" | undefined;
1353
+ limit?: number | undefined;
1354
+ offset?: number | undefined;
1355
+ }>;
1356
+ summary: "Get all workflows for a farm";
1357
+ method: "GET";
1358
+ path: "/farms/:farmId/agent-workflows";
1359
+ responses: {
1360
+ 200: z.ZodObject<{
1361
+ data: z.ZodArray<z.ZodObject<{
1362
+ type: z.ZodLiteral<string>;
1363
+ id: z.ZodString;
1364
+ attributes: z.ZodObject<{
1365
+ workflowType: z.ZodLiteral<"recommendation_to_task">;
1366
+ triggerEvent: z.ZodString;
1367
+ triggerId: z.ZodString;
1368
+ fieldId: z.ZodString;
1369
+ farmId: z.ZodString;
1370
+ status: z.ZodEnum<["in_progress", "completed", "failed"]>;
1371
+ outcome: z.ZodNullable<z.ZodEnum<["task_created", "task_updated", "no_action_needed", "error"]>>;
1372
+ agentResults: z.ZodNullable<z.ZodObject<{
1373
+ summary: z.ZodObject<{
1374
+ sourceType: z.ZodString;
1375
+ tasksCreated: z.ZodNumber;
1376
+ tasksUpdated: z.ZodNumber;
1377
+ skipped: z.ZodNumber;
1378
+ }, "strip", z.ZodTypeAny, {
1379
+ skipped: number;
1380
+ sourceType: string;
1381
+ tasksCreated: number;
1382
+ tasksUpdated: number;
1383
+ }, {
1384
+ skipped: number;
1385
+ sourceType: string;
1386
+ tasksCreated: number;
1387
+ tasksUpdated: number;
1388
+ }>;
1389
+ results: z.ZodArray<z.ZodObject<{
1390
+ recommendation: z.ZodObject<{
1391
+ priority: z.ZodNumber;
1392
+ action: z.ZodString;
1393
+ details: z.ZodString;
1394
+ timing: z.ZodString;
1395
+ severity: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
1396
+ confidence: z.ZodOptional<z.ZodNumber>;
1397
+ materials: z.ZodOptional<z.ZodArray<z.ZodObject<{
1398
+ inventoryItemId: z.ZodOptional<z.ZodString>;
1399
+ name: z.ZodString;
1400
+ quantity: z.ZodNumber;
1401
+ unit: z.ZodString;
1402
+ costPerUnit: z.ZodOptional<z.ZodNumber>;
1403
+ totalCost: z.ZodOptional<z.ZodNumber>;
1404
+ availability: z.ZodOptional<z.ZodString>;
1405
+ }, "strip", z.ZodTypeAny, {
1406
+ name: string;
1407
+ unit: string;
1408
+ quantity: number;
1409
+ inventoryItemId?: string | undefined;
1410
+ totalCost?: number | undefined;
1411
+ costPerUnit?: number | undefined;
1412
+ availability?: string | undefined;
1413
+ }, {
1414
+ name: string;
1415
+ unit: string;
1416
+ quantity: number;
1417
+ inventoryItemId?: string | undefined;
1418
+ totalCost?: number | undefined;
1419
+ costPerUnit?: number | undefined;
1420
+ availability?: string | undefined;
1421
+ }>, "many">>;
1422
+ applicationMethod: z.ZodOptional<z.ZodString>;
1423
+ expectedOutcome: z.ZodOptional<z.ZodString>;
1424
+ preventiveMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1425
+ estimatedTime: z.ZodOptional<z.ZodString>;
1426
+ riskLevel: z.ZodOptional<z.ZodString>;
1427
+ }, "strip", z.ZodTypeAny, {
1428
+ priority: number;
1429
+ action: string;
1430
+ details: string;
1431
+ timing: string;
1432
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1433
+ confidence?: number | undefined;
1434
+ materials?: {
1435
+ name: string;
1436
+ unit: string;
1437
+ quantity: number;
1438
+ inventoryItemId?: string | undefined;
1439
+ totalCost?: number | undefined;
1440
+ costPerUnit?: number | undefined;
1441
+ availability?: string | undefined;
1442
+ }[] | undefined;
1443
+ applicationMethod?: string | undefined;
1444
+ expectedOutcome?: string | undefined;
1445
+ preventiveMeasures?: string[] | undefined;
1446
+ estimatedTime?: string | undefined;
1447
+ riskLevel?: string | undefined;
1448
+ }, {
1449
+ priority: number;
1450
+ action: string;
1451
+ details: string;
1452
+ timing: string;
1453
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1454
+ confidence?: number | undefined;
1455
+ materials?: {
1456
+ name: string;
1457
+ unit: string;
1458
+ quantity: number;
1459
+ inventoryItemId?: string | undefined;
1460
+ totalCost?: number | undefined;
1461
+ costPerUnit?: number | undefined;
1462
+ availability?: string | undefined;
1463
+ }[] | undefined;
1464
+ applicationMethod?: string | undefined;
1465
+ expectedOutcome?: string | undefined;
1466
+ preventiveMeasures?: string[] | undefined;
1467
+ estimatedTime?: string | undefined;
1468
+ riskLevel?: string | undefined;
1469
+ }>;
1470
+ outcome: z.ZodEnum<["created", "updated", "skipped", "error"]>;
1471
+ taskId: z.ZodOptional<z.ZodString>;
1472
+ reason: z.ZodString;
1473
+ }, "strip", z.ZodTypeAny, {
1474
+ reason: string;
1475
+ recommendation: {
1476
+ priority: number;
1477
+ action: string;
1478
+ details: string;
1479
+ timing: string;
1480
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1481
+ confidence?: number | undefined;
1482
+ materials?: {
1483
+ name: string;
1484
+ unit: string;
1485
+ quantity: number;
1486
+ inventoryItemId?: string | undefined;
1487
+ totalCost?: number | undefined;
1488
+ costPerUnit?: number | undefined;
1489
+ availability?: string | undefined;
1490
+ }[] | undefined;
1491
+ applicationMethod?: string | undefined;
1492
+ expectedOutcome?: string | undefined;
1493
+ preventiveMeasures?: string[] | undefined;
1494
+ estimatedTime?: string | undefined;
1495
+ riskLevel?: string | undefined;
1496
+ };
1497
+ outcome: "error" | "created" | "updated" | "skipped";
1498
+ taskId?: string | undefined;
1499
+ }, {
1500
+ reason: string;
1501
+ recommendation: {
1502
+ priority: number;
1503
+ action: string;
1504
+ details: string;
1505
+ timing: string;
1506
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1507
+ confidence?: number | undefined;
1508
+ materials?: {
1509
+ name: string;
1510
+ unit: string;
1511
+ quantity: number;
1512
+ inventoryItemId?: string | undefined;
1513
+ totalCost?: number | undefined;
1514
+ costPerUnit?: number | undefined;
1515
+ availability?: string | undefined;
1516
+ }[] | undefined;
1517
+ applicationMethod?: string | undefined;
1518
+ expectedOutcome?: string | undefined;
1519
+ preventiveMeasures?: string[] | undefined;
1520
+ estimatedTime?: string | undefined;
1521
+ riskLevel?: string | undefined;
1522
+ };
1523
+ outcome: "error" | "created" | "updated" | "skipped";
1524
+ taskId?: string | undefined;
1525
+ }>, "many">;
1526
+ taskReview: z.ZodOptional<z.ZodAny>;
1527
+ }, "strip", z.ZodTypeAny, {
1528
+ summary: {
1529
+ skipped: number;
1530
+ sourceType: string;
1531
+ tasksCreated: number;
1532
+ tasksUpdated: number;
1533
+ };
1534
+ results: {
1535
+ reason: string;
1536
+ recommendation: {
1537
+ priority: number;
1538
+ action: string;
1539
+ details: string;
1540
+ timing: string;
1541
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1542
+ confidence?: number | undefined;
1543
+ materials?: {
1544
+ name: string;
1545
+ unit: string;
1546
+ quantity: number;
1547
+ inventoryItemId?: string | undefined;
1548
+ totalCost?: number | undefined;
1549
+ costPerUnit?: number | undefined;
1550
+ availability?: string | undefined;
1551
+ }[] | undefined;
1552
+ applicationMethod?: string | undefined;
1553
+ expectedOutcome?: string | undefined;
1554
+ preventiveMeasures?: string[] | undefined;
1555
+ estimatedTime?: string | undefined;
1556
+ riskLevel?: string | undefined;
1557
+ };
1558
+ outcome: "error" | "created" | "updated" | "skipped";
1559
+ taskId?: string | undefined;
1560
+ }[];
1561
+ taskReview?: any;
1562
+ }, {
1563
+ summary: {
1564
+ skipped: number;
1565
+ sourceType: string;
1566
+ tasksCreated: number;
1567
+ tasksUpdated: number;
1568
+ };
1569
+ results: {
1570
+ reason: string;
1571
+ recommendation: {
1572
+ priority: number;
1573
+ action: string;
1574
+ details: string;
1575
+ timing: string;
1576
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1577
+ confidence?: number | undefined;
1578
+ materials?: {
1579
+ name: string;
1580
+ unit: string;
1581
+ quantity: number;
1582
+ inventoryItemId?: string | undefined;
1583
+ totalCost?: number | undefined;
1584
+ costPerUnit?: number | undefined;
1585
+ availability?: string | undefined;
1586
+ }[] | undefined;
1587
+ applicationMethod?: string | undefined;
1588
+ expectedOutcome?: string | undefined;
1589
+ preventiveMeasures?: string[] | undefined;
1590
+ estimatedTime?: string | undefined;
1591
+ riskLevel?: string | undefined;
1592
+ };
1593
+ outcome: "error" | "created" | "updated" | "skipped";
1594
+ taskId?: string | undefined;
1595
+ }[];
1596
+ taskReview?: any;
1597
+ }>>;
1598
+ errorMessage: z.ZodNullable<z.ZodString>;
1599
+ completedAt: z.ZodNullable<z.ZodDate>;
1600
+ } & {
1601
+ createdAt: z.ZodString;
1602
+ updatedAt: z.ZodString;
1603
+ }, "strip", z.ZodTypeAny, {
1604
+ status: "completed" | "in_progress" | "failed";
1605
+ createdAt: string;
1606
+ updatedAt: string;
1607
+ farmId: string;
1608
+ fieldId: string;
1609
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
1610
+ workflowType: "recommendation_to_task";
1611
+ triggerEvent: string;
1612
+ triggerId: string;
1613
+ agentResults: {
1614
+ summary: {
1615
+ skipped: number;
1616
+ sourceType: string;
1617
+ tasksCreated: number;
1618
+ tasksUpdated: number;
1619
+ };
1620
+ results: {
1621
+ reason: string;
1622
+ recommendation: {
1623
+ priority: number;
1624
+ action: string;
1625
+ details: string;
1626
+ timing: string;
1627
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1628
+ confidence?: number | undefined;
1629
+ materials?: {
1630
+ name: string;
1631
+ unit: string;
1632
+ quantity: number;
1633
+ inventoryItemId?: string | undefined;
1634
+ totalCost?: number | undefined;
1635
+ costPerUnit?: number | undefined;
1636
+ availability?: string | undefined;
1637
+ }[] | undefined;
1638
+ applicationMethod?: string | undefined;
1639
+ expectedOutcome?: string | undefined;
1640
+ preventiveMeasures?: string[] | undefined;
1641
+ estimatedTime?: string | undefined;
1642
+ riskLevel?: string | undefined;
1643
+ };
1644
+ outcome: "error" | "created" | "updated" | "skipped";
1645
+ taskId?: string | undefined;
1646
+ }[];
1647
+ taskReview?: any;
1648
+ } | null;
1649
+ errorMessage: string | null;
1650
+ completedAt: Date | null;
1651
+ }, {
1652
+ status: "completed" | "in_progress" | "failed";
1653
+ createdAt: string;
1654
+ updatedAt: string;
1655
+ farmId: string;
1656
+ fieldId: string;
1657
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
1658
+ workflowType: "recommendation_to_task";
1659
+ triggerEvent: string;
1660
+ triggerId: string;
1661
+ agentResults: {
1662
+ summary: {
1663
+ skipped: number;
1664
+ sourceType: string;
1665
+ tasksCreated: number;
1666
+ tasksUpdated: number;
1667
+ };
1668
+ results: {
1669
+ reason: string;
1670
+ recommendation: {
1671
+ priority: number;
1672
+ action: string;
1673
+ details: string;
1674
+ timing: string;
1675
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1676
+ confidence?: number | undefined;
1677
+ materials?: {
1678
+ name: string;
1679
+ unit: string;
1680
+ quantity: number;
1681
+ inventoryItemId?: string | undefined;
1682
+ totalCost?: number | undefined;
1683
+ costPerUnit?: number | undefined;
1684
+ availability?: string | undefined;
1685
+ }[] | undefined;
1686
+ applicationMethod?: string | undefined;
1687
+ expectedOutcome?: string | undefined;
1688
+ preventiveMeasures?: string[] | undefined;
1689
+ estimatedTime?: string | undefined;
1690
+ riskLevel?: string | undefined;
1691
+ };
1692
+ outcome: "error" | "created" | "updated" | "skipped";
1693
+ taskId?: string | undefined;
1694
+ }[];
1695
+ taskReview?: any;
1696
+ } | null;
1697
+ errorMessage: string | null;
1698
+ completedAt: Date | null;
1699
+ }>;
1700
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1701
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1702
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1703
+ }, "strip", z.ZodTypeAny, {
1704
+ type: string;
1705
+ id: string;
1706
+ attributes: {
1707
+ status: "completed" | "in_progress" | "failed";
1708
+ createdAt: string;
1709
+ updatedAt: string;
1710
+ farmId: string;
1711
+ fieldId: string;
1712
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
1713
+ workflowType: "recommendation_to_task";
1714
+ triggerEvent: string;
1715
+ triggerId: string;
1716
+ agentResults: {
1717
+ summary: {
1718
+ skipped: number;
1719
+ sourceType: string;
1720
+ tasksCreated: number;
1721
+ tasksUpdated: number;
1722
+ };
1723
+ results: {
1724
+ reason: string;
1725
+ recommendation: {
1726
+ priority: number;
1727
+ action: string;
1728
+ details: string;
1729
+ timing: string;
1730
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1731
+ confidence?: number | undefined;
1732
+ materials?: {
1733
+ name: string;
1734
+ unit: string;
1735
+ quantity: number;
1736
+ inventoryItemId?: string | undefined;
1737
+ totalCost?: number | undefined;
1738
+ costPerUnit?: number | undefined;
1739
+ availability?: string | undefined;
1740
+ }[] | undefined;
1741
+ applicationMethod?: string | undefined;
1742
+ expectedOutcome?: string | undefined;
1743
+ preventiveMeasures?: string[] | undefined;
1744
+ estimatedTime?: string | undefined;
1745
+ riskLevel?: string | undefined;
1746
+ };
1747
+ outcome: "error" | "created" | "updated" | "skipped";
1748
+ taskId?: string | undefined;
1749
+ }[];
1750
+ taskReview?: any;
1751
+ } | null;
1752
+ errorMessage: string | null;
1753
+ completedAt: Date | null;
1754
+ };
1755
+ relationships?: Record<string, unknown> | undefined;
1756
+ links?: Record<string, string> | undefined;
1757
+ meta?: Record<string, unknown> | undefined;
1758
+ }, {
1759
+ type: string;
1760
+ id: string;
1761
+ attributes: {
1762
+ status: "completed" | "in_progress" | "failed";
1763
+ createdAt: string;
1764
+ updatedAt: string;
1765
+ farmId: string;
1766
+ fieldId: string;
1767
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
1768
+ workflowType: "recommendation_to_task";
1769
+ triggerEvent: string;
1770
+ triggerId: string;
1771
+ agentResults: {
1772
+ summary: {
1773
+ skipped: number;
1774
+ sourceType: string;
1775
+ tasksCreated: number;
1776
+ tasksUpdated: number;
1777
+ };
1778
+ results: {
1779
+ reason: string;
1780
+ recommendation: {
1781
+ priority: number;
1782
+ action: string;
1783
+ details: string;
1784
+ timing: string;
1785
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1786
+ confidence?: number | undefined;
1787
+ materials?: {
1788
+ name: string;
1789
+ unit: string;
1790
+ quantity: number;
1791
+ inventoryItemId?: string | undefined;
1792
+ totalCost?: number | undefined;
1793
+ costPerUnit?: number | undefined;
1794
+ availability?: string | undefined;
1795
+ }[] | undefined;
1796
+ applicationMethod?: string | undefined;
1797
+ expectedOutcome?: string | undefined;
1798
+ preventiveMeasures?: string[] | undefined;
1799
+ estimatedTime?: string | undefined;
1800
+ riskLevel?: string | undefined;
1801
+ };
1802
+ outcome: "error" | "created" | "updated" | "skipped";
1803
+ taskId?: string | undefined;
1804
+ }[];
1805
+ taskReview?: any;
1806
+ } | null;
1807
+ errorMessage: string | null;
1808
+ completedAt: Date | null;
1809
+ };
1810
+ relationships?: Record<string, unknown> | undefined;
1811
+ links?: Record<string, string> | undefined;
1812
+ meta?: Record<string, unknown> | undefined;
1813
+ }>, "many">;
1814
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
1815
+ type: z.ZodString;
1816
+ id: z.ZodString;
1817
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1818
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1819
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1820
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1821
+ }, "strip", z.ZodTypeAny, {
1822
+ type: string;
1823
+ id: string;
1824
+ attributes?: Record<string, unknown> | undefined;
1825
+ relationships?: Record<string, unknown> | undefined;
1826
+ links?: Record<string, string> | undefined;
1827
+ meta?: Record<string, unknown> | undefined;
1828
+ }, {
1829
+ type: string;
1830
+ id: string;
1831
+ attributes?: Record<string, unknown> | undefined;
1832
+ relationships?: Record<string, unknown> | undefined;
1833
+ links?: Record<string, string> | undefined;
1834
+ meta?: Record<string, unknown> | undefined;
1835
+ }>, "many">>;
1836
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1837
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1838
+ }, "strip", z.ZodTypeAny, {
1839
+ data: {
1840
+ type: string;
1841
+ id: string;
1842
+ attributes: {
1843
+ status: "completed" | "in_progress" | "failed";
1844
+ createdAt: string;
1845
+ updatedAt: string;
1846
+ farmId: string;
1847
+ fieldId: string;
1848
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
1849
+ workflowType: "recommendation_to_task";
1850
+ triggerEvent: string;
1851
+ triggerId: string;
1852
+ agentResults: {
1853
+ summary: {
1854
+ skipped: number;
1855
+ sourceType: string;
1856
+ tasksCreated: number;
1857
+ tasksUpdated: number;
1858
+ };
1859
+ results: {
1860
+ reason: string;
1861
+ recommendation: {
1862
+ priority: number;
1863
+ action: string;
1864
+ details: string;
1865
+ timing: string;
1866
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1867
+ confidence?: number | undefined;
1868
+ materials?: {
1869
+ name: string;
1870
+ unit: string;
1871
+ quantity: number;
1872
+ inventoryItemId?: string | undefined;
1873
+ totalCost?: number | undefined;
1874
+ costPerUnit?: number | undefined;
1875
+ availability?: string | undefined;
1876
+ }[] | undefined;
1877
+ applicationMethod?: string | undefined;
1878
+ expectedOutcome?: string | undefined;
1879
+ preventiveMeasures?: string[] | undefined;
1880
+ estimatedTime?: string | undefined;
1881
+ riskLevel?: string | undefined;
1882
+ };
1883
+ outcome: "error" | "created" | "updated" | "skipped";
1884
+ taskId?: string | undefined;
1885
+ }[];
1886
+ taskReview?: any;
1887
+ } | null;
1888
+ errorMessage: string | null;
1889
+ completedAt: Date | null;
1890
+ };
1891
+ relationships?: Record<string, unknown> | undefined;
1892
+ links?: Record<string, string> | undefined;
1893
+ meta?: Record<string, unknown> | undefined;
1894
+ }[];
1895
+ links?: Record<string, string> | undefined;
1896
+ meta?: Record<string, unknown> | undefined;
1897
+ included?: {
1898
+ type: string;
1899
+ id: string;
1900
+ attributes?: Record<string, unknown> | undefined;
1901
+ relationships?: Record<string, unknown> | undefined;
1902
+ links?: Record<string, string> | undefined;
1903
+ meta?: Record<string, unknown> | undefined;
1904
+ }[] | undefined;
1905
+ }, {
1906
+ data: {
1907
+ type: string;
1908
+ id: string;
1909
+ attributes: {
1910
+ status: "completed" | "in_progress" | "failed";
1911
+ createdAt: string;
1912
+ updatedAt: string;
1913
+ farmId: string;
1914
+ fieldId: string;
1915
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
1916
+ workflowType: "recommendation_to_task";
1917
+ triggerEvent: string;
1918
+ triggerId: string;
1919
+ agentResults: {
1920
+ summary: {
1921
+ skipped: number;
1922
+ sourceType: string;
1923
+ tasksCreated: number;
1924
+ tasksUpdated: number;
1925
+ };
1926
+ results: {
1927
+ reason: string;
1928
+ recommendation: {
1929
+ priority: number;
1930
+ action: string;
1931
+ details: string;
1932
+ timing: string;
1933
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
1934
+ confidence?: number | undefined;
1935
+ materials?: {
1936
+ name: string;
1937
+ unit: string;
1938
+ quantity: number;
1939
+ inventoryItemId?: string | undefined;
1940
+ totalCost?: number | undefined;
1941
+ costPerUnit?: number | undefined;
1942
+ availability?: string | undefined;
1943
+ }[] | undefined;
1944
+ applicationMethod?: string | undefined;
1945
+ expectedOutcome?: string | undefined;
1946
+ preventiveMeasures?: string[] | undefined;
1947
+ estimatedTime?: string | undefined;
1948
+ riskLevel?: string | undefined;
1949
+ };
1950
+ outcome: "error" | "created" | "updated" | "skipped";
1951
+ taskId?: string | undefined;
1952
+ }[];
1953
+ taskReview?: any;
1954
+ } | null;
1955
+ errorMessage: string | null;
1956
+ completedAt: Date | null;
1957
+ };
1958
+ relationships?: Record<string, unknown> | undefined;
1959
+ links?: Record<string, string> | undefined;
1960
+ meta?: Record<string, unknown> | undefined;
1961
+ }[];
1962
+ links?: Record<string, string> | undefined;
1963
+ meta?: Record<string, unknown> | undefined;
1964
+ included?: {
1965
+ type: string;
1966
+ id: string;
1967
+ attributes?: Record<string, unknown> | undefined;
1968
+ relationships?: Record<string, unknown> | undefined;
1969
+ links?: Record<string, string> | undefined;
1970
+ meta?: Record<string, unknown> | undefined;
1971
+ }[] | undefined;
1972
+ }>;
1973
+ 404: z.ZodObject<{
1974
+ errors: z.ZodArray<z.ZodObject<{
1975
+ status: z.ZodLiteral<"404">;
1976
+ code: z.ZodString;
1977
+ title: z.ZodString;
1978
+ detail: z.ZodString;
1979
+ }, "strip", z.ZodTypeAny, {
1980
+ status: "404";
1981
+ code: string;
1982
+ title: string;
1983
+ detail: string;
1984
+ }, {
1985
+ status: "404";
1986
+ code: string;
1987
+ title: string;
1988
+ detail: string;
1989
+ }>, "many">;
1990
+ }, "strip", z.ZodTypeAny, {
1991
+ errors: {
1992
+ status: "404";
1993
+ code: string;
1994
+ title: string;
1995
+ detail: string;
1996
+ }[];
1997
+ }, {
1998
+ errors: {
1999
+ status: "404";
2000
+ code: string;
2001
+ title: string;
2002
+ detail: string;
2003
+ }[];
2004
+ }>;
2005
+ };
2006
+ };
2007
+ getWorkflowsByField: {
2008
+ query: z.ZodObject<{
2009
+ status: z.ZodOptional<z.ZodEnum<["in_progress", "completed", "failed"]>>;
2010
+ limit: z.ZodDefault<z.ZodNumber>;
2011
+ offset: z.ZodDefault<z.ZodNumber>;
2012
+ }, "strip", z.ZodTypeAny, {
2013
+ limit: number;
2014
+ offset: number;
2015
+ status?: "completed" | "in_progress" | "failed" | undefined;
2016
+ }, {
2017
+ status?: "completed" | "in_progress" | "failed" | undefined;
2018
+ limit?: number | undefined;
2019
+ offset?: number | undefined;
2020
+ }>;
2021
+ summary: "Get all workflows for a field";
2022
+ method: "GET";
2023
+ path: "/fields/:fieldId/agent-workflows";
2024
+ responses: {
2025
+ 200: z.ZodObject<{
2026
+ data: z.ZodArray<z.ZodObject<{
2027
+ type: z.ZodLiteral<string>;
2028
+ id: z.ZodString;
2029
+ attributes: z.ZodObject<{
2030
+ workflowType: z.ZodLiteral<"recommendation_to_task">;
2031
+ triggerEvent: z.ZodString;
2032
+ triggerId: z.ZodString;
2033
+ fieldId: z.ZodString;
2034
+ farmId: z.ZodString;
2035
+ status: z.ZodEnum<["in_progress", "completed", "failed"]>;
2036
+ outcome: z.ZodNullable<z.ZodEnum<["task_created", "task_updated", "no_action_needed", "error"]>>;
2037
+ agentResults: z.ZodNullable<z.ZodObject<{
2038
+ summary: z.ZodObject<{
2039
+ sourceType: z.ZodString;
2040
+ tasksCreated: z.ZodNumber;
2041
+ tasksUpdated: z.ZodNumber;
2042
+ skipped: z.ZodNumber;
2043
+ }, "strip", z.ZodTypeAny, {
2044
+ skipped: number;
2045
+ sourceType: string;
2046
+ tasksCreated: number;
2047
+ tasksUpdated: number;
2048
+ }, {
2049
+ skipped: number;
2050
+ sourceType: string;
2051
+ tasksCreated: number;
2052
+ tasksUpdated: number;
2053
+ }>;
2054
+ results: z.ZodArray<z.ZodObject<{
2055
+ recommendation: z.ZodObject<{
2056
+ priority: z.ZodNumber;
2057
+ action: z.ZodString;
2058
+ details: z.ZodString;
2059
+ timing: z.ZodString;
2060
+ severity: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
2061
+ confidence: z.ZodOptional<z.ZodNumber>;
2062
+ materials: z.ZodOptional<z.ZodArray<z.ZodObject<{
2063
+ inventoryItemId: z.ZodOptional<z.ZodString>;
2064
+ name: z.ZodString;
2065
+ quantity: z.ZodNumber;
2066
+ unit: z.ZodString;
2067
+ costPerUnit: z.ZodOptional<z.ZodNumber>;
2068
+ totalCost: z.ZodOptional<z.ZodNumber>;
2069
+ availability: z.ZodOptional<z.ZodString>;
2070
+ }, "strip", z.ZodTypeAny, {
2071
+ name: string;
2072
+ unit: string;
2073
+ quantity: number;
2074
+ inventoryItemId?: string | undefined;
2075
+ totalCost?: number | undefined;
2076
+ costPerUnit?: number | undefined;
2077
+ availability?: string | undefined;
2078
+ }, {
2079
+ name: string;
2080
+ unit: string;
2081
+ quantity: number;
2082
+ inventoryItemId?: string | undefined;
2083
+ totalCost?: number | undefined;
2084
+ costPerUnit?: number | undefined;
2085
+ availability?: string | undefined;
2086
+ }>, "many">>;
2087
+ applicationMethod: z.ZodOptional<z.ZodString>;
2088
+ expectedOutcome: z.ZodOptional<z.ZodString>;
2089
+ preventiveMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2090
+ estimatedTime: z.ZodOptional<z.ZodString>;
2091
+ riskLevel: z.ZodOptional<z.ZodString>;
2092
+ }, "strip", z.ZodTypeAny, {
2093
+ priority: number;
2094
+ action: string;
2095
+ details: string;
2096
+ timing: string;
2097
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2098
+ confidence?: number | undefined;
2099
+ materials?: {
2100
+ name: string;
2101
+ unit: string;
2102
+ quantity: number;
2103
+ inventoryItemId?: string | undefined;
2104
+ totalCost?: number | undefined;
2105
+ costPerUnit?: number | undefined;
2106
+ availability?: string | undefined;
2107
+ }[] | undefined;
2108
+ applicationMethod?: string | undefined;
2109
+ expectedOutcome?: string | undefined;
2110
+ preventiveMeasures?: string[] | undefined;
2111
+ estimatedTime?: string | undefined;
2112
+ riskLevel?: string | undefined;
2113
+ }, {
2114
+ priority: number;
2115
+ action: string;
2116
+ details: string;
2117
+ timing: string;
2118
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2119
+ confidence?: number | undefined;
2120
+ materials?: {
2121
+ name: string;
2122
+ unit: string;
2123
+ quantity: number;
2124
+ inventoryItemId?: string | undefined;
2125
+ totalCost?: number | undefined;
2126
+ costPerUnit?: number | undefined;
2127
+ availability?: string | undefined;
2128
+ }[] | undefined;
2129
+ applicationMethod?: string | undefined;
2130
+ expectedOutcome?: string | undefined;
2131
+ preventiveMeasures?: string[] | undefined;
2132
+ estimatedTime?: string | undefined;
2133
+ riskLevel?: string | undefined;
2134
+ }>;
2135
+ outcome: z.ZodEnum<["created", "updated", "skipped", "error"]>;
2136
+ taskId: z.ZodOptional<z.ZodString>;
2137
+ reason: z.ZodString;
2138
+ }, "strip", z.ZodTypeAny, {
2139
+ reason: string;
2140
+ recommendation: {
2141
+ priority: number;
2142
+ action: string;
2143
+ details: string;
2144
+ timing: string;
2145
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2146
+ confidence?: number | undefined;
2147
+ materials?: {
2148
+ name: string;
2149
+ unit: string;
2150
+ quantity: number;
2151
+ inventoryItemId?: string | undefined;
2152
+ totalCost?: number | undefined;
2153
+ costPerUnit?: number | undefined;
2154
+ availability?: string | undefined;
2155
+ }[] | undefined;
2156
+ applicationMethod?: string | undefined;
2157
+ expectedOutcome?: string | undefined;
2158
+ preventiveMeasures?: string[] | undefined;
2159
+ estimatedTime?: string | undefined;
2160
+ riskLevel?: string | undefined;
2161
+ };
2162
+ outcome: "error" | "created" | "updated" | "skipped";
2163
+ taskId?: string | undefined;
2164
+ }, {
2165
+ reason: string;
2166
+ recommendation: {
2167
+ priority: number;
2168
+ action: string;
2169
+ details: string;
2170
+ timing: string;
2171
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2172
+ confidence?: number | undefined;
2173
+ materials?: {
2174
+ name: string;
2175
+ unit: string;
2176
+ quantity: number;
2177
+ inventoryItemId?: string | undefined;
2178
+ totalCost?: number | undefined;
2179
+ costPerUnit?: number | undefined;
2180
+ availability?: string | undefined;
2181
+ }[] | undefined;
2182
+ applicationMethod?: string | undefined;
2183
+ expectedOutcome?: string | undefined;
2184
+ preventiveMeasures?: string[] | undefined;
2185
+ estimatedTime?: string | undefined;
2186
+ riskLevel?: string | undefined;
2187
+ };
2188
+ outcome: "error" | "created" | "updated" | "skipped";
2189
+ taskId?: string | undefined;
2190
+ }>, "many">;
2191
+ taskReview: z.ZodOptional<z.ZodAny>;
2192
+ }, "strip", z.ZodTypeAny, {
2193
+ summary: {
2194
+ skipped: number;
2195
+ sourceType: string;
2196
+ tasksCreated: number;
2197
+ tasksUpdated: number;
2198
+ };
2199
+ results: {
2200
+ reason: string;
2201
+ recommendation: {
2202
+ priority: number;
2203
+ action: string;
2204
+ details: string;
2205
+ timing: string;
2206
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2207
+ confidence?: number | undefined;
2208
+ materials?: {
2209
+ name: string;
2210
+ unit: string;
2211
+ quantity: number;
2212
+ inventoryItemId?: string | undefined;
2213
+ totalCost?: number | undefined;
2214
+ costPerUnit?: number | undefined;
2215
+ availability?: string | undefined;
2216
+ }[] | undefined;
2217
+ applicationMethod?: string | undefined;
2218
+ expectedOutcome?: string | undefined;
2219
+ preventiveMeasures?: string[] | undefined;
2220
+ estimatedTime?: string | undefined;
2221
+ riskLevel?: string | undefined;
2222
+ };
2223
+ outcome: "error" | "created" | "updated" | "skipped";
2224
+ taskId?: string | undefined;
2225
+ }[];
2226
+ taskReview?: any;
2227
+ }, {
2228
+ summary: {
2229
+ skipped: number;
2230
+ sourceType: string;
2231
+ tasksCreated: number;
2232
+ tasksUpdated: number;
2233
+ };
2234
+ results: {
2235
+ reason: string;
2236
+ recommendation: {
2237
+ priority: number;
2238
+ action: string;
2239
+ details: string;
2240
+ timing: string;
2241
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2242
+ confidence?: number | undefined;
2243
+ materials?: {
2244
+ name: string;
2245
+ unit: string;
2246
+ quantity: number;
2247
+ inventoryItemId?: string | undefined;
2248
+ totalCost?: number | undefined;
2249
+ costPerUnit?: number | undefined;
2250
+ availability?: string | undefined;
2251
+ }[] | undefined;
2252
+ applicationMethod?: string | undefined;
2253
+ expectedOutcome?: string | undefined;
2254
+ preventiveMeasures?: string[] | undefined;
2255
+ estimatedTime?: string | undefined;
2256
+ riskLevel?: string | undefined;
2257
+ };
2258
+ outcome: "error" | "created" | "updated" | "skipped";
2259
+ taskId?: string | undefined;
2260
+ }[];
2261
+ taskReview?: any;
2262
+ }>>;
2263
+ errorMessage: z.ZodNullable<z.ZodString>;
2264
+ completedAt: z.ZodNullable<z.ZodDate>;
2265
+ } & {
2266
+ createdAt: z.ZodString;
2267
+ updatedAt: z.ZodString;
2268
+ }, "strip", z.ZodTypeAny, {
2269
+ status: "completed" | "in_progress" | "failed";
2270
+ createdAt: string;
2271
+ updatedAt: string;
2272
+ farmId: string;
2273
+ fieldId: string;
2274
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
2275
+ workflowType: "recommendation_to_task";
2276
+ triggerEvent: string;
2277
+ triggerId: string;
2278
+ agentResults: {
2279
+ summary: {
2280
+ skipped: number;
2281
+ sourceType: string;
2282
+ tasksCreated: number;
2283
+ tasksUpdated: number;
2284
+ };
2285
+ results: {
2286
+ reason: string;
2287
+ recommendation: {
2288
+ priority: number;
2289
+ action: string;
2290
+ details: string;
2291
+ timing: string;
2292
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2293
+ confidence?: number | undefined;
2294
+ materials?: {
2295
+ name: string;
2296
+ unit: string;
2297
+ quantity: number;
2298
+ inventoryItemId?: string | undefined;
2299
+ totalCost?: number | undefined;
2300
+ costPerUnit?: number | undefined;
2301
+ availability?: string | undefined;
2302
+ }[] | undefined;
2303
+ applicationMethod?: string | undefined;
2304
+ expectedOutcome?: string | undefined;
2305
+ preventiveMeasures?: string[] | undefined;
2306
+ estimatedTime?: string | undefined;
2307
+ riskLevel?: string | undefined;
2308
+ };
2309
+ outcome: "error" | "created" | "updated" | "skipped";
2310
+ taskId?: string | undefined;
2311
+ }[];
2312
+ taskReview?: any;
2313
+ } | null;
2314
+ errorMessage: string | null;
2315
+ completedAt: Date | null;
2316
+ }, {
2317
+ status: "completed" | "in_progress" | "failed";
2318
+ createdAt: string;
2319
+ updatedAt: string;
2320
+ farmId: string;
2321
+ fieldId: string;
2322
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
2323
+ workflowType: "recommendation_to_task";
2324
+ triggerEvent: string;
2325
+ triggerId: string;
2326
+ agentResults: {
2327
+ summary: {
2328
+ skipped: number;
2329
+ sourceType: string;
2330
+ tasksCreated: number;
2331
+ tasksUpdated: number;
2332
+ };
2333
+ results: {
2334
+ reason: string;
2335
+ recommendation: {
2336
+ priority: number;
2337
+ action: string;
2338
+ details: string;
2339
+ timing: string;
2340
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2341
+ confidence?: number | undefined;
2342
+ materials?: {
2343
+ name: string;
2344
+ unit: string;
2345
+ quantity: number;
2346
+ inventoryItemId?: string | undefined;
2347
+ totalCost?: number | undefined;
2348
+ costPerUnit?: number | undefined;
2349
+ availability?: string | undefined;
2350
+ }[] | undefined;
2351
+ applicationMethod?: string | undefined;
2352
+ expectedOutcome?: string | undefined;
2353
+ preventiveMeasures?: string[] | undefined;
2354
+ estimatedTime?: string | undefined;
2355
+ riskLevel?: string | undefined;
2356
+ };
2357
+ outcome: "error" | "created" | "updated" | "skipped";
2358
+ taskId?: string | undefined;
2359
+ }[];
2360
+ taskReview?: any;
2361
+ } | null;
2362
+ errorMessage: string | null;
2363
+ completedAt: Date | null;
2364
+ }>;
2365
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2366
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2367
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2368
+ }, "strip", z.ZodTypeAny, {
2369
+ type: string;
2370
+ id: string;
2371
+ attributes: {
2372
+ status: "completed" | "in_progress" | "failed";
2373
+ createdAt: string;
2374
+ updatedAt: string;
2375
+ farmId: string;
2376
+ fieldId: string;
2377
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
2378
+ workflowType: "recommendation_to_task";
2379
+ triggerEvent: string;
2380
+ triggerId: string;
2381
+ agentResults: {
2382
+ summary: {
2383
+ skipped: number;
2384
+ sourceType: string;
2385
+ tasksCreated: number;
2386
+ tasksUpdated: number;
2387
+ };
2388
+ results: {
2389
+ reason: string;
2390
+ recommendation: {
2391
+ priority: number;
2392
+ action: string;
2393
+ details: string;
2394
+ timing: string;
2395
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2396
+ confidence?: number | undefined;
2397
+ materials?: {
2398
+ name: string;
2399
+ unit: string;
2400
+ quantity: number;
2401
+ inventoryItemId?: string | undefined;
2402
+ totalCost?: number | undefined;
2403
+ costPerUnit?: number | undefined;
2404
+ availability?: string | undefined;
2405
+ }[] | undefined;
2406
+ applicationMethod?: string | undefined;
2407
+ expectedOutcome?: string | undefined;
2408
+ preventiveMeasures?: string[] | undefined;
2409
+ estimatedTime?: string | undefined;
2410
+ riskLevel?: string | undefined;
2411
+ };
2412
+ outcome: "error" | "created" | "updated" | "skipped";
2413
+ taskId?: string | undefined;
2414
+ }[];
2415
+ taskReview?: any;
2416
+ } | null;
2417
+ errorMessage: string | null;
2418
+ completedAt: Date | null;
2419
+ };
2420
+ relationships?: Record<string, unknown> | undefined;
2421
+ links?: Record<string, string> | undefined;
2422
+ meta?: Record<string, unknown> | undefined;
2423
+ }, {
2424
+ type: string;
2425
+ id: string;
2426
+ attributes: {
2427
+ status: "completed" | "in_progress" | "failed";
2428
+ createdAt: string;
2429
+ updatedAt: string;
2430
+ farmId: string;
2431
+ fieldId: string;
2432
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
2433
+ workflowType: "recommendation_to_task";
2434
+ triggerEvent: string;
2435
+ triggerId: string;
2436
+ agentResults: {
2437
+ summary: {
2438
+ skipped: number;
2439
+ sourceType: string;
2440
+ tasksCreated: number;
2441
+ tasksUpdated: number;
2442
+ };
2443
+ results: {
2444
+ reason: string;
2445
+ recommendation: {
2446
+ priority: number;
2447
+ action: string;
2448
+ details: string;
2449
+ timing: string;
2450
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2451
+ confidence?: number | undefined;
2452
+ materials?: {
2453
+ name: string;
2454
+ unit: string;
2455
+ quantity: number;
2456
+ inventoryItemId?: string | undefined;
2457
+ totalCost?: number | undefined;
2458
+ costPerUnit?: number | undefined;
2459
+ availability?: string | undefined;
2460
+ }[] | undefined;
2461
+ applicationMethod?: string | undefined;
2462
+ expectedOutcome?: string | undefined;
2463
+ preventiveMeasures?: string[] | undefined;
2464
+ estimatedTime?: string | undefined;
2465
+ riskLevel?: string | undefined;
2466
+ };
2467
+ outcome: "error" | "created" | "updated" | "skipped";
2468
+ taskId?: string | undefined;
2469
+ }[];
2470
+ taskReview?: any;
2471
+ } | null;
2472
+ errorMessage: string | null;
2473
+ completedAt: Date | null;
2474
+ };
2475
+ relationships?: Record<string, unknown> | undefined;
2476
+ links?: Record<string, string> | undefined;
2477
+ meta?: Record<string, unknown> | undefined;
2478
+ }>, "many">;
2479
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
2480
+ type: z.ZodString;
2481
+ id: z.ZodString;
2482
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2483
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2484
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2485
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2486
+ }, "strip", z.ZodTypeAny, {
2487
+ type: string;
2488
+ id: string;
2489
+ attributes?: Record<string, unknown> | undefined;
2490
+ relationships?: Record<string, unknown> | undefined;
2491
+ links?: Record<string, string> | undefined;
2492
+ meta?: Record<string, unknown> | undefined;
2493
+ }, {
2494
+ type: string;
2495
+ id: string;
2496
+ attributes?: Record<string, unknown> | undefined;
2497
+ relationships?: Record<string, unknown> | undefined;
2498
+ links?: Record<string, string> | undefined;
2499
+ meta?: Record<string, unknown> | undefined;
2500
+ }>, "many">>;
2501
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2502
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2503
+ }, "strip", z.ZodTypeAny, {
2504
+ data: {
2505
+ type: string;
2506
+ id: string;
2507
+ attributes: {
2508
+ status: "completed" | "in_progress" | "failed";
2509
+ createdAt: string;
2510
+ updatedAt: string;
2511
+ farmId: string;
2512
+ fieldId: string;
2513
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
2514
+ workflowType: "recommendation_to_task";
2515
+ triggerEvent: string;
2516
+ triggerId: string;
2517
+ agentResults: {
2518
+ summary: {
2519
+ skipped: number;
2520
+ sourceType: string;
2521
+ tasksCreated: number;
2522
+ tasksUpdated: number;
2523
+ };
2524
+ results: {
2525
+ reason: string;
2526
+ recommendation: {
2527
+ priority: number;
2528
+ action: string;
2529
+ details: string;
2530
+ timing: string;
2531
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2532
+ confidence?: number | undefined;
2533
+ materials?: {
2534
+ name: string;
2535
+ unit: string;
2536
+ quantity: number;
2537
+ inventoryItemId?: string | undefined;
2538
+ totalCost?: number | undefined;
2539
+ costPerUnit?: number | undefined;
2540
+ availability?: string | undefined;
2541
+ }[] | undefined;
2542
+ applicationMethod?: string | undefined;
2543
+ expectedOutcome?: string | undefined;
2544
+ preventiveMeasures?: string[] | undefined;
2545
+ estimatedTime?: string | undefined;
2546
+ riskLevel?: string | undefined;
2547
+ };
2548
+ outcome: "error" | "created" | "updated" | "skipped";
2549
+ taskId?: string | undefined;
2550
+ }[];
2551
+ taskReview?: any;
2552
+ } | null;
2553
+ errorMessage: string | null;
2554
+ completedAt: Date | null;
2555
+ };
2556
+ relationships?: Record<string, unknown> | undefined;
2557
+ links?: Record<string, string> | undefined;
2558
+ meta?: Record<string, unknown> | undefined;
2559
+ }[];
2560
+ links?: Record<string, string> | undefined;
2561
+ meta?: Record<string, unknown> | undefined;
2562
+ included?: {
2563
+ type: string;
2564
+ id: string;
2565
+ attributes?: Record<string, unknown> | undefined;
2566
+ relationships?: Record<string, unknown> | undefined;
2567
+ links?: Record<string, string> | undefined;
2568
+ meta?: Record<string, unknown> | undefined;
2569
+ }[] | undefined;
2570
+ }, {
2571
+ data: {
2572
+ type: string;
2573
+ id: string;
2574
+ attributes: {
2575
+ status: "completed" | "in_progress" | "failed";
2576
+ createdAt: string;
2577
+ updatedAt: string;
2578
+ farmId: string;
2579
+ fieldId: string;
2580
+ outcome: "task_created" | "task_updated" | "no_action_needed" | "error" | null;
2581
+ workflowType: "recommendation_to_task";
2582
+ triggerEvent: string;
2583
+ triggerId: string;
2584
+ agentResults: {
2585
+ summary: {
2586
+ skipped: number;
2587
+ sourceType: string;
2588
+ tasksCreated: number;
2589
+ tasksUpdated: number;
2590
+ };
2591
+ results: {
2592
+ reason: string;
2593
+ recommendation: {
2594
+ priority: number;
2595
+ action: string;
2596
+ details: string;
2597
+ timing: string;
2598
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
2599
+ confidence?: number | undefined;
2600
+ materials?: {
2601
+ name: string;
2602
+ unit: string;
2603
+ quantity: number;
2604
+ inventoryItemId?: string | undefined;
2605
+ totalCost?: number | undefined;
2606
+ costPerUnit?: number | undefined;
2607
+ availability?: string | undefined;
2608
+ }[] | undefined;
2609
+ applicationMethod?: string | undefined;
2610
+ expectedOutcome?: string | undefined;
2611
+ preventiveMeasures?: string[] | undefined;
2612
+ estimatedTime?: string | undefined;
2613
+ riskLevel?: string | undefined;
2614
+ };
2615
+ outcome: "error" | "created" | "updated" | "skipped";
2616
+ taskId?: string | undefined;
2617
+ }[];
2618
+ taskReview?: any;
2619
+ } | null;
2620
+ errorMessage: string | null;
2621
+ completedAt: Date | null;
2622
+ };
2623
+ relationships?: Record<string, unknown> | undefined;
2624
+ links?: Record<string, string> | undefined;
2625
+ meta?: Record<string, unknown> | undefined;
2626
+ }[];
2627
+ links?: Record<string, string> | undefined;
2628
+ meta?: Record<string, unknown> | undefined;
2629
+ included?: {
2630
+ type: string;
2631
+ id: string;
2632
+ attributes?: Record<string, unknown> | undefined;
2633
+ relationships?: Record<string, unknown> | undefined;
2634
+ links?: Record<string, string> | undefined;
2635
+ meta?: Record<string, unknown> | undefined;
2636
+ }[] | undefined;
2637
+ }>;
2638
+ 404: z.ZodObject<{
2639
+ errors: z.ZodArray<z.ZodObject<{
2640
+ status: z.ZodLiteral<"404">;
2641
+ code: z.ZodString;
2642
+ title: z.ZodString;
2643
+ detail: z.ZodString;
2644
+ }, "strip", z.ZodTypeAny, {
2645
+ status: "404";
2646
+ code: string;
2647
+ title: string;
2648
+ detail: string;
2649
+ }, {
2650
+ status: "404";
2651
+ code: string;
2652
+ title: string;
2653
+ detail: string;
2654
+ }>, "many">;
2655
+ }, "strip", z.ZodTypeAny, {
2656
+ errors: {
2657
+ status: "404";
2658
+ code: string;
2659
+ title: string;
2660
+ detail: string;
2661
+ }[];
2662
+ }, {
2663
+ errors: {
2664
+ status: "404";
2665
+ code: string;
2666
+ title: string;
2667
+ detail: string;
2668
+ }[];
2669
+ }>;
2670
+ };
2671
+ };
2672
+ getWorkflowStats: {
2673
+ query: z.ZodObject<{
2674
+ farmId: z.ZodOptional<z.ZodString>;
2675
+ startDate: z.ZodOptional<z.ZodString>;
2676
+ endDate: z.ZodOptional<z.ZodString>;
2677
+ }, "strip", z.ZodTypeAny, {
2678
+ farmId?: string | undefined;
2679
+ startDate?: string | undefined;
2680
+ endDate?: string | undefined;
2681
+ }, {
2682
+ farmId?: string | undefined;
2683
+ startDate?: string | undefined;
2684
+ endDate?: string | undefined;
2685
+ }>;
2686
+ summary: "Get agent workflow statistics and analytics";
2687
+ method: "GET";
2688
+ path: "/agent-workflows/stats";
2689
+ responses: {
2690
+ 200: z.ZodObject<{
2691
+ data: z.ZodObject<{
2692
+ overall: z.ZodObject<{
2693
+ totalWorkflows: z.ZodNumber;
2694
+ successRate: z.ZodNumber;
2695
+ avgProcessingTime: z.ZodNumber;
2696
+ tasksCreated: z.ZodNumber;
2697
+ tasksUpdated: z.ZodNumber;
2698
+ skipped: z.ZodNumber;
2699
+ }, "strip", z.ZodTypeAny, {
2700
+ skipped: number;
2701
+ tasksCreated: number;
2702
+ tasksUpdated: number;
2703
+ totalWorkflows: number;
2704
+ successRate: number;
2705
+ avgProcessingTime: number;
2706
+ }, {
2707
+ skipped: number;
2708
+ tasksCreated: number;
2709
+ tasksUpdated: number;
2710
+ totalWorkflows: number;
2711
+ successRate: number;
2712
+ avgProcessingTime: number;
2713
+ }>;
2714
+ bySource: z.ZodRecord<z.ZodString, z.ZodObject<{
2715
+ workflows: z.ZodNumber;
2716
+ tasksCreated: z.ZodNumber;
2717
+ tasksUpdated: z.ZodNumber;
2718
+ skipped: z.ZodNumber;
2719
+ skipRate: z.ZodNumber;
2720
+ avgConfidence: z.ZodOptional<z.ZodNumber>;
2721
+ }, "strip", z.ZodTypeAny, {
2722
+ skipped: number;
2723
+ tasksCreated: number;
2724
+ tasksUpdated: number;
2725
+ workflows: number;
2726
+ skipRate: number;
2727
+ avgConfidence?: number | undefined;
2728
+ }, {
2729
+ skipped: number;
2730
+ tasksCreated: number;
2731
+ tasksUpdated: number;
2732
+ workflows: number;
2733
+ skipRate: number;
2734
+ avgConfidence?: number | undefined;
2735
+ }>>;
2736
+ deduplication: z.ZodObject<{
2737
+ exactMatches: z.ZodNumber;
2738
+ semanticMatches: z.ZodNumber;
2739
+ categoryMatches: z.ZodNumber;
2740
+ crossSourceMatches: z.ZodNumber;
2741
+ avgSimilarityScore: z.ZodNumber;
2742
+ }, "strip", z.ZodTypeAny, {
2743
+ exactMatches: number;
2744
+ semanticMatches: number;
2745
+ categoryMatches: number;
2746
+ crossSourceMatches: number;
2747
+ avgSimilarityScore: number;
2748
+ }, {
2749
+ exactMatches: number;
2750
+ semanticMatches: number;
2751
+ categoryMatches: number;
2752
+ crossSourceMatches: number;
2753
+ avgSimilarityScore: number;
2754
+ }>;
2755
+ outcomes: z.ZodObject<{
2756
+ tasksCompleted: z.ZodNumber;
2757
+ tasksPending: z.ZodNumber;
2758
+ tasksInProgress: z.ZodNumber;
2759
+ completionRate: z.ZodNumber;
2760
+ }, "strip", z.ZodTypeAny, {
2761
+ tasksCompleted: number;
2762
+ tasksPending: number;
2763
+ tasksInProgress: number;
2764
+ completionRate: number;
2765
+ }, {
2766
+ tasksCompleted: number;
2767
+ tasksPending: number;
2768
+ tasksInProgress: number;
2769
+ completionRate: number;
2770
+ }>;
2771
+ }, "strip", z.ZodTypeAny, {
2772
+ overall: {
2773
+ skipped: number;
2774
+ tasksCreated: number;
2775
+ tasksUpdated: number;
2776
+ totalWorkflows: number;
2777
+ successRate: number;
2778
+ avgProcessingTime: number;
2779
+ };
2780
+ bySource: Record<string, {
2781
+ skipped: number;
2782
+ tasksCreated: number;
2783
+ tasksUpdated: number;
2784
+ workflows: number;
2785
+ skipRate: number;
2786
+ avgConfidence?: number | undefined;
2787
+ }>;
2788
+ deduplication: {
2789
+ exactMatches: number;
2790
+ semanticMatches: number;
2791
+ categoryMatches: number;
2792
+ crossSourceMatches: number;
2793
+ avgSimilarityScore: number;
2794
+ };
2795
+ outcomes: {
2796
+ tasksCompleted: number;
2797
+ tasksPending: number;
2798
+ tasksInProgress: number;
2799
+ completionRate: number;
2800
+ };
2801
+ }, {
2802
+ overall: {
2803
+ skipped: number;
2804
+ tasksCreated: number;
2805
+ tasksUpdated: number;
2806
+ totalWorkflows: number;
2807
+ successRate: number;
2808
+ avgProcessingTime: number;
2809
+ };
2810
+ bySource: Record<string, {
2811
+ skipped: number;
2812
+ tasksCreated: number;
2813
+ tasksUpdated: number;
2814
+ workflows: number;
2815
+ skipRate: number;
2816
+ avgConfidence?: number | undefined;
2817
+ }>;
2818
+ deduplication: {
2819
+ exactMatches: number;
2820
+ semanticMatches: number;
2821
+ categoryMatches: number;
2822
+ crossSourceMatches: number;
2823
+ avgSimilarityScore: number;
2824
+ };
2825
+ outcomes: {
2826
+ tasksCompleted: number;
2827
+ tasksPending: number;
2828
+ tasksInProgress: number;
2829
+ completionRate: number;
2830
+ };
2831
+ }>;
2832
+ }, "strip", z.ZodTypeAny, {
2833
+ data: {
2834
+ overall: {
2835
+ skipped: number;
2836
+ tasksCreated: number;
2837
+ tasksUpdated: number;
2838
+ totalWorkflows: number;
2839
+ successRate: number;
2840
+ avgProcessingTime: number;
2841
+ };
2842
+ bySource: Record<string, {
2843
+ skipped: number;
2844
+ tasksCreated: number;
2845
+ tasksUpdated: number;
2846
+ workflows: number;
2847
+ skipRate: number;
2848
+ avgConfidence?: number | undefined;
2849
+ }>;
2850
+ deduplication: {
2851
+ exactMatches: number;
2852
+ semanticMatches: number;
2853
+ categoryMatches: number;
2854
+ crossSourceMatches: number;
2855
+ avgSimilarityScore: number;
2856
+ };
2857
+ outcomes: {
2858
+ tasksCompleted: number;
2859
+ tasksPending: number;
2860
+ tasksInProgress: number;
2861
+ completionRate: number;
2862
+ };
2863
+ };
2864
+ }, {
2865
+ data: {
2866
+ overall: {
2867
+ skipped: number;
2868
+ tasksCreated: number;
2869
+ tasksUpdated: number;
2870
+ totalWorkflows: number;
2871
+ successRate: number;
2872
+ avgProcessingTime: number;
2873
+ };
2874
+ bySource: Record<string, {
2875
+ skipped: number;
2876
+ tasksCreated: number;
2877
+ tasksUpdated: number;
2878
+ workflows: number;
2879
+ skipRate: number;
2880
+ avgConfidence?: number | undefined;
2881
+ }>;
2882
+ deduplication: {
2883
+ exactMatches: number;
2884
+ semanticMatches: number;
2885
+ categoryMatches: number;
2886
+ crossSourceMatches: number;
2887
+ avgSimilarityScore: number;
2888
+ };
2889
+ outcomes: {
2890
+ tasksCompleted: number;
2891
+ tasksPending: number;
2892
+ tasksInProgress: number;
2893
+ completionRate: number;
2894
+ };
2895
+ };
2896
+ }>;
2897
+ };
2898
+ };
2899
+ };
2900
+ //# sourceMappingURL=agent-workflows.routes.d.ts.map