@deepintel-ltd/farmpro-contracts 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/routes/agents.routes.d.ts +520 -0
- package/dist/routes/agents.routes.d.ts.map +1 -0
- package/dist/routes/agents.routes.js +36 -0
- package/dist/routes/field-monitoring.routes.d.ts +405 -0
- package/dist/routes/field-monitoring.routes.d.ts.map +1 -0
- package/dist/routes/field-monitoring.routes.js +93 -0
- package/dist/routes/index.d.ts +6 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +4 -0
- package/dist/schemas/agents.schemas.d.ts +352 -0
- package/dist/schemas/agents.schemas.d.ts.map +1 -0
- package/dist/schemas/agents.schemas.js +42 -0
- package/dist/schemas/categories.schemas.js +1 -1
- package/dist/schemas/field-monitoring.schemas.d.ts +216 -0
- package/dist/schemas/field-monitoring.schemas.d.ts.map +1 -0
- package/dist/schemas/field-monitoring.schemas.js +92 -0
- package/package.json +1 -1
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Agents schemas - JSON:API compliant
|
|
4
|
+
*/
|
|
5
|
+
export declare const messageRoleSchema: z.ZodEnum<["user", "assistant"]>;
|
|
6
|
+
export declare const conversationMessageSchema: z.ZodObject<{
|
|
7
|
+
role: z.ZodEnum<["user", "assistant"]>;
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
role: "user" | "assistant";
|
|
11
|
+
content: string;
|
|
12
|
+
}, {
|
|
13
|
+
role: "user" | "assistant";
|
|
14
|
+
content: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const toolCallResultSchema: z.ZodObject<{
|
|
17
|
+
tool: z.ZodString;
|
|
18
|
+
result: z.ZodUnknown;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
tool: string;
|
|
21
|
+
result?: unknown;
|
|
22
|
+
}, {
|
|
23
|
+
tool: string;
|
|
24
|
+
result?: unknown;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const chatRequestAttributesSchema: z.ZodObject<{
|
|
27
|
+
message: z.ZodString;
|
|
28
|
+
farmId: z.ZodOptional<z.ZodString>;
|
|
29
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
30
|
+
conversationHistory: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31
|
+
role: z.ZodEnum<["user", "assistant"]>;
|
|
32
|
+
content: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
role: "user" | "assistant";
|
|
35
|
+
content: string;
|
|
36
|
+
}, {
|
|
37
|
+
role: "user" | "assistant";
|
|
38
|
+
content: string;
|
|
39
|
+
}>, "many">>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
message: string;
|
|
42
|
+
farmId?: string | undefined;
|
|
43
|
+
conversationId?: string | undefined;
|
|
44
|
+
conversationHistory?: {
|
|
45
|
+
role: "user" | "assistant";
|
|
46
|
+
content: string;
|
|
47
|
+
}[] | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
message: string;
|
|
50
|
+
farmId?: string | undefined;
|
|
51
|
+
conversationId?: string | undefined;
|
|
52
|
+
conversationHistory?: {
|
|
53
|
+
role: "user" | "assistant";
|
|
54
|
+
content: string;
|
|
55
|
+
}[] | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const chatRequestSchema: z.ZodObject<{
|
|
58
|
+
type: z.ZodLiteral<"agent-chat-requests">;
|
|
59
|
+
attributes: z.ZodObject<{
|
|
60
|
+
message: z.ZodString;
|
|
61
|
+
farmId: z.ZodOptional<z.ZodString>;
|
|
62
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
63
|
+
conversationHistory: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
64
|
+
role: z.ZodEnum<["user", "assistant"]>;
|
|
65
|
+
content: z.ZodString;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
role: "user" | "assistant";
|
|
68
|
+
content: string;
|
|
69
|
+
}, {
|
|
70
|
+
role: "user" | "assistant";
|
|
71
|
+
content: string;
|
|
72
|
+
}>, "many">>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
message: string;
|
|
75
|
+
farmId?: string | undefined;
|
|
76
|
+
conversationId?: string | undefined;
|
|
77
|
+
conversationHistory?: {
|
|
78
|
+
role: "user" | "assistant";
|
|
79
|
+
content: string;
|
|
80
|
+
}[] | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
message: string;
|
|
83
|
+
farmId?: string | undefined;
|
|
84
|
+
conversationId?: string | undefined;
|
|
85
|
+
conversationHistory?: {
|
|
86
|
+
role: "user" | "assistant";
|
|
87
|
+
content: string;
|
|
88
|
+
}[] | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
type: "agent-chat-requests";
|
|
92
|
+
attributes: {
|
|
93
|
+
message: string;
|
|
94
|
+
farmId?: string | undefined;
|
|
95
|
+
conversationId?: string | undefined;
|
|
96
|
+
conversationHistory?: {
|
|
97
|
+
role: "user" | "assistant";
|
|
98
|
+
content: string;
|
|
99
|
+
}[] | undefined;
|
|
100
|
+
};
|
|
101
|
+
}, {
|
|
102
|
+
type: "agent-chat-requests";
|
|
103
|
+
attributes: {
|
|
104
|
+
message: string;
|
|
105
|
+
farmId?: string | undefined;
|
|
106
|
+
conversationId?: string | undefined;
|
|
107
|
+
conversationHistory?: {
|
|
108
|
+
role: "user" | "assistant";
|
|
109
|
+
content: string;
|
|
110
|
+
}[] | undefined;
|
|
111
|
+
};
|
|
112
|
+
}>;
|
|
113
|
+
export declare const agentChatResponseAttributesSchema: z.ZodObject<{
|
|
114
|
+
response: z.ZodString;
|
|
115
|
+
toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
116
|
+
tool: z.ZodString;
|
|
117
|
+
result: z.ZodUnknown;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
tool: string;
|
|
120
|
+
result?: unknown;
|
|
121
|
+
}, {
|
|
122
|
+
tool: string;
|
|
123
|
+
result?: unknown;
|
|
124
|
+
}>, "many">>;
|
|
125
|
+
conversationId: z.ZodString;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
conversationId: string;
|
|
128
|
+
response: string;
|
|
129
|
+
toolCalls?: {
|
|
130
|
+
tool: string;
|
|
131
|
+
result?: unknown;
|
|
132
|
+
}[] | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
conversationId: string;
|
|
135
|
+
response: string;
|
|
136
|
+
toolCalls?: {
|
|
137
|
+
tool: string;
|
|
138
|
+
result?: unknown;
|
|
139
|
+
}[] | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
export declare const agentChatResponseResourceSchema: z.ZodObject<{
|
|
142
|
+
type: z.ZodLiteral<string>;
|
|
143
|
+
id: z.ZodString;
|
|
144
|
+
attributes: z.ZodObject<{
|
|
145
|
+
response: z.ZodString;
|
|
146
|
+
toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
147
|
+
tool: z.ZodString;
|
|
148
|
+
result: z.ZodUnknown;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
tool: string;
|
|
151
|
+
result?: unknown;
|
|
152
|
+
}, {
|
|
153
|
+
tool: string;
|
|
154
|
+
result?: unknown;
|
|
155
|
+
}>, "many">>;
|
|
156
|
+
conversationId: z.ZodString;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
conversationId: string;
|
|
159
|
+
response: string;
|
|
160
|
+
toolCalls?: {
|
|
161
|
+
tool: string;
|
|
162
|
+
result?: unknown;
|
|
163
|
+
}[] | undefined;
|
|
164
|
+
}, {
|
|
165
|
+
conversationId: string;
|
|
166
|
+
response: string;
|
|
167
|
+
toolCalls?: {
|
|
168
|
+
tool: string;
|
|
169
|
+
result?: unknown;
|
|
170
|
+
}[] | undefined;
|
|
171
|
+
}>;
|
|
172
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
173
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
174
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
175
|
+
}, "strip", z.ZodTypeAny, {
|
|
176
|
+
type: string;
|
|
177
|
+
id: string;
|
|
178
|
+
attributes: {
|
|
179
|
+
conversationId: string;
|
|
180
|
+
response: string;
|
|
181
|
+
toolCalls?: {
|
|
182
|
+
tool: string;
|
|
183
|
+
result?: unknown;
|
|
184
|
+
}[] | undefined;
|
|
185
|
+
};
|
|
186
|
+
relationships?: Record<string, unknown> | undefined;
|
|
187
|
+
links?: Record<string, string> | undefined;
|
|
188
|
+
meta?: Record<string, unknown> | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
type: string;
|
|
191
|
+
id: string;
|
|
192
|
+
attributes: {
|
|
193
|
+
conversationId: string;
|
|
194
|
+
response: string;
|
|
195
|
+
toolCalls?: {
|
|
196
|
+
tool: string;
|
|
197
|
+
result?: unknown;
|
|
198
|
+
}[] | undefined;
|
|
199
|
+
};
|
|
200
|
+
relationships?: Record<string, unknown> | undefined;
|
|
201
|
+
links?: Record<string, string> | undefined;
|
|
202
|
+
meta?: Record<string, unknown> | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
export declare const agentChatResponseSchema: z.ZodObject<{
|
|
205
|
+
data: z.ZodObject<{
|
|
206
|
+
type: z.ZodLiteral<string>;
|
|
207
|
+
id: z.ZodString;
|
|
208
|
+
attributes: z.ZodObject<{
|
|
209
|
+
response: z.ZodString;
|
|
210
|
+
toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
211
|
+
tool: z.ZodString;
|
|
212
|
+
result: z.ZodUnknown;
|
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
tool: string;
|
|
215
|
+
result?: unknown;
|
|
216
|
+
}, {
|
|
217
|
+
tool: string;
|
|
218
|
+
result?: unknown;
|
|
219
|
+
}>, "many">>;
|
|
220
|
+
conversationId: z.ZodString;
|
|
221
|
+
}, "strip", z.ZodTypeAny, {
|
|
222
|
+
conversationId: string;
|
|
223
|
+
response: string;
|
|
224
|
+
toolCalls?: {
|
|
225
|
+
tool: string;
|
|
226
|
+
result?: unknown;
|
|
227
|
+
}[] | undefined;
|
|
228
|
+
}, {
|
|
229
|
+
conversationId: string;
|
|
230
|
+
response: string;
|
|
231
|
+
toolCalls?: {
|
|
232
|
+
tool: string;
|
|
233
|
+
result?: unknown;
|
|
234
|
+
}[] | undefined;
|
|
235
|
+
}>;
|
|
236
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
237
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
238
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
239
|
+
}, "strip", z.ZodTypeAny, {
|
|
240
|
+
type: string;
|
|
241
|
+
id: string;
|
|
242
|
+
attributes: {
|
|
243
|
+
conversationId: string;
|
|
244
|
+
response: string;
|
|
245
|
+
toolCalls?: {
|
|
246
|
+
tool: string;
|
|
247
|
+
result?: unknown;
|
|
248
|
+
}[] | undefined;
|
|
249
|
+
};
|
|
250
|
+
relationships?: Record<string, unknown> | undefined;
|
|
251
|
+
links?: Record<string, string> | undefined;
|
|
252
|
+
meta?: Record<string, unknown> | undefined;
|
|
253
|
+
}, {
|
|
254
|
+
type: string;
|
|
255
|
+
id: string;
|
|
256
|
+
attributes: {
|
|
257
|
+
conversationId: string;
|
|
258
|
+
response: string;
|
|
259
|
+
toolCalls?: {
|
|
260
|
+
tool: string;
|
|
261
|
+
result?: unknown;
|
|
262
|
+
}[] | undefined;
|
|
263
|
+
};
|
|
264
|
+
relationships?: Record<string, unknown> | undefined;
|
|
265
|
+
links?: Record<string, string> | undefined;
|
|
266
|
+
meta?: Record<string, unknown> | undefined;
|
|
267
|
+
}>;
|
|
268
|
+
included: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
269
|
+
type: z.ZodString;
|
|
270
|
+
id: z.ZodString;
|
|
271
|
+
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
272
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
273
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
274
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
275
|
+
}, "strip", z.ZodTypeAny, {
|
|
276
|
+
type: string;
|
|
277
|
+
id: string;
|
|
278
|
+
attributes?: Record<string, unknown> | undefined;
|
|
279
|
+
relationships?: Record<string, unknown> | undefined;
|
|
280
|
+
links?: Record<string, string> | undefined;
|
|
281
|
+
meta?: Record<string, unknown> | undefined;
|
|
282
|
+
}, {
|
|
283
|
+
type: string;
|
|
284
|
+
id: string;
|
|
285
|
+
attributes?: Record<string, unknown> | undefined;
|
|
286
|
+
relationships?: Record<string, unknown> | undefined;
|
|
287
|
+
links?: Record<string, string> | undefined;
|
|
288
|
+
meta?: Record<string, unknown> | undefined;
|
|
289
|
+
}>, "many">>;
|
|
290
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
291
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
292
|
+
}, "strip", z.ZodTypeAny, {
|
|
293
|
+
data: {
|
|
294
|
+
type: string;
|
|
295
|
+
id: string;
|
|
296
|
+
attributes: {
|
|
297
|
+
conversationId: string;
|
|
298
|
+
response: string;
|
|
299
|
+
toolCalls?: {
|
|
300
|
+
tool: string;
|
|
301
|
+
result?: unknown;
|
|
302
|
+
}[] | undefined;
|
|
303
|
+
};
|
|
304
|
+
relationships?: Record<string, unknown> | undefined;
|
|
305
|
+
links?: Record<string, string> | undefined;
|
|
306
|
+
meta?: Record<string, unknown> | undefined;
|
|
307
|
+
};
|
|
308
|
+
links?: Record<string, string> | undefined;
|
|
309
|
+
meta?: Record<string, unknown> | undefined;
|
|
310
|
+
included?: {
|
|
311
|
+
type: string;
|
|
312
|
+
id: string;
|
|
313
|
+
attributes?: Record<string, unknown> | undefined;
|
|
314
|
+
relationships?: Record<string, unknown> | undefined;
|
|
315
|
+
links?: Record<string, string> | undefined;
|
|
316
|
+
meta?: Record<string, unknown> | undefined;
|
|
317
|
+
}[] | undefined;
|
|
318
|
+
}, {
|
|
319
|
+
data: {
|
|
320
|
+
type: string;
|
|
321
|
+
id: string;
|
|
322
|
+
attributes: {
|
|
323
|
+
conversationId: string;
|
|
324
|
+
response: string;
|
|
325
|
+
toolCalls?: {
|
|
326
|
+
tool: string;
|
|
327
|
+
result?: unknown;
|
|
328
|
+
}[] | undefined;
|
|
329
|
+
};
|
|
330
|
+
relationships?: Record<string, unknown> | undefined;
|
|
331
|
+
links?: Record<string, string> | undefined;
|
|
332
|
+
meta?: Record<string, unknown> | undefined;
|
|
333
|
+
};
|
|
334
|
+
links?: Record<string, string> | undefined;
|
|
335
|
+
meta?: Record<string, unknown> | undefined;
|
|
336
|
+
included?: {
|
|
337
|
+
type: string;
|
|
338
|
+
id: string;
|
|
339
|
+
attributes?: Record<string, unknown> | undefined;
|
|
340
|
+
relationships?: Record<string, unknown> | undefined;
|
|
341
|
+
links?: Record<string, string> | undefined;
|
|
342
|
+
meta?: Record<string, unknown> | undefined;
|
|
343
|
+
}[] | undefined;
|
|
344
|
+
}>;
|
|
345
|
+
export type MessageRole = z.infer<typeof messageRoleSchema>;
|
|
346
|
+
export type ConversationMessage = z.infer<typeof conversationMessageSchema>;
|
|
347
|
+
export type ToolCallResult = z.infer<typeof toolCallResultSchema>;
|
|
348
|
+
export type ChatRequestAttributes = z.infer<typeof chatRequestAttributesSchema>;
|
|
349
|
+
export type ChatRequestInput = z.infer<typeof chatRequestSchema>;
|
|
350
|
+
export type AgentChatResponseAttributes = z.infer<typeof agentChatResponseAttributesSchema>;
|
|
351
|
+
export type AgentChatResponse = z.infer<typeof agentChatResponseSchema>;
|
|
352
|
+
//# sourceMappingURL=agents.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/agents.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AAGH,eAAO,MAAM,iBAAiB,kCAAgC,CAAC;AAG/D,eAAO,MAAM,yBAAyB;;;;;;;;;EAGpC,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAGH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKtC,CAAC;AAGH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG5B,CAAC;AAGH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI5C,CAAC;AAGH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG3C,CAAC;AAGF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEnC,CAAC;AAGF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.agentChatResponseSchema = exports.agentChatResponseResourceSchema = exports.agentChatResponseAttributesSchema = exports.chatRequestSchema = exports.chatRequestAttributesSchema = exports.toolCallResultSchema = exports.conversationMessageSchema = exports.messageRoleSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_schemas_1 = require("./common.schemas");
|
|
6
|
+
/**
|
|
7
|
+
* Agents schemas - JSON:API compliant
|
|
8
|
+
*/
|
|
9
|
+
// Conversation message role enum
|
|
10
|
+
exports.messageRoleSchema = zod_1.z.enum(['user', 'assistant']);
|
|
11
|
+
// Conversation message schema
|
|
12
|
+
exports.conversationMessageSchema = zod_1.z.object({
|
|
13
|
+
role: exports.messageRoleSchema,
|
|
14
|
+
content: zod_1.z.string().min(1),
|
|
15
|
+
});
|
|
16
|
+
// Tool call result schema
|
|
17
|
+
exports.toolCallResultSchema = zod_1.z.object({
|
|
18
|
+
tool: zod_1.z.string(),
|
|
19
|
+
result: zod_1.z.unknown(), // Tool results can be any shape
|
|
20
|
+
});
|
|
21
|
+
// Chat request attributes schema
|
|
22
|
+
exports.chatRequestAttributesSchema = zod_1.z.object({
|
|
23
|
+
message: zod_1.z.string().min(1).max(5000),
|
|
24
|
+
farmId: zod_1.z.string().uuid().optional(),
|
|
25
|
+
conversationId: zod_1.z.string().uuid().optional(), // Continue existing conversation
|
|
26
|
+
conversationHistory: zod_1.z.array(exports.conversationMessageSchema).optional(),
|
|
27
|
+
});
|
|
28
|
+
// Chat request input (JSON:API format)
|
|
29
|
+
exports.chatRequestSchema = zod_1.z.object({
|
|
30
|
+
type: zod_1.z.literal('agent-chat-requests'),
|
|
31
|
+
attributes: exports.chatRequestAttributesSchema,
|
|
32
|
+
});
|
|
33
|
+
// Agent chat response attributes schema
|
|
34
|
+
exports.agentChatResponseAttributesSchema = zod_1.z.object({
|
|
35
|
+
response: zod_1.z.string(),
|
|
36
|
+
toolCalls: zod_1.z.array(exports.toolCallResultSchema).optional(),
|
|
37
|
+
conversationId: zod_1.z.string().uuid(), // Return conversation ID for continuing
|
|
38
|
+
});
|
|
39
|
+
// Agent chat response resource (JSON:API resource object)
|
|
40
|
+
exports.agentChatResponseResourceSchema = (0, common_schemas_1.createJsonApiResourceSchema)('agent-chat-responses', exports.agentChatResponseAttributesSchema);
|
|
41
|
+
// Agent chat response (JSON:API single response)
|
|
42
|
+
exports.agentChatResponseSchema = (0, common_schemas_1.jsonApiSingleResponseSchema)(exports.agentChatResponseResourceSchema);
|
|
@@ -43,5 +43,5 @@ exports.categoryListResponseSchema = (0, common_schemas_1.jsonApiCollectionRespo
|
|
|
43
43
|
// Get categories query parameters
|
|
44
44
|
exports.getCategoriesQuerySchema = zod_1.z.object({
|
|
45
45
|
farmId: zod_1.z.string().uuid().optional(),
|
|
46
|
-
includeDefaults: zod_1.z.boolean().optional().default(true),
|
|
46
|
+
includeDefaults: zod_1.z.coerce.boolean().optional().default(true),
|
|
47
47
|
});
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const fieldMonitoringSummarySchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
fieldId: z.ZodString;
|
|
5
|
+
fieldName: z.ZodString;
|
|
6
|
+
latestDate: z.ZodString;
|
|
7
|
+
currentNDVI: z.ZodNullable<z.ZodNumber>;
|
|
8
|
+
currentNDWI: z.ZodNullable<z.ZodNumber>;
|
|
9
|
+
currentEVI: z.ZodNullable<z.ZodNumber>;
|
|
10
|
+
currentCropHealth: z.ZodNullable<z.ZodEnum<["poor", "fair", "good", "excellent"]>>;
|
|
11
|
+
currentWaterStress: z.ZodNullable<z.ZodEnum<["none", "low", "medium", "high"]>>;
|
|
12
|
+
overallStatus: z.ZodEnum<["ok", "warning", "critical"]>;
|
|
13
|
+
activeAlertCount: z.ZodNumber;
|
|
14
|
+
lastAlertDate: z.ZodNullable<z.ZodString>;
|
|
15
|
+
dataQuality: z.ZodNullable<z.ZodEnum<["excellent", "good", "fair", "poor"]>>;
|
|
16
|
+
cloudCover: z.ZodNullable<z.ZodNumber>;
|
|
17
|
+
lastProcessedAt: z.ZodString;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
id: string;
|
|
20
|
+
fieldId: string;
|
|
21
|
+
fieldName: string;
|
|
22
|
+
latestDate: string;
|
|
23
|
+
currentNDVI: number | null;
|
|
24
|
+
currentNDWI: number | null;
|
|
25
|
+
currentEVI: number | null;
|
|
26
|
+
currentCropHealth: "poor" | "fair" | "good" | "excellent" | null;
|
|
27
|
+
currentWaterStress: "high" | "medium" | "low" | "none" | null;
|
|
28
|
+
overallStatus: "ok" | "critical" | "warning";
|
|
29
|
+
activeAlertCount: number;
|
|
30
|
+
lastAlertDate: string | null;
|
|
31
|
+
dataQuality: "poor" | "fair" | "good" | "excellent" | null;
|
|
32
|
+
cloudCover: number | null;
|
|
33
|
+
lastProcessedAt: string;
|
|
34
|
+
}, {
|
|
35
|
+
id: string;
|
|
36
|
+
fieldId: string;
|
|
37
|
+
fieldName: string;
|
|
38
|
+
latestDate: string;
|
|
39
|
+
currentNDVI: number | null;
|
|
40
|
+
currentNDWI: number | null;
|
|
41
|
+
currentEVI: number | null;
|
|
42
|
+
currentCropHealth: "poor" | "fair" | "good" | "excellent" | null;
|
|
43
|
+
currentWaterStress: "high" | "medium" | "low" | "none" | null;
|
|
44
|
+
overallStatus: "ok" | "critical" | "warning";
|
|
45
|
+
activeAlertCount: number;
|
|
46
|
+
lastAlertDate: string | null;
|
|
47
|
+
dataQuality: "poor" | "fair" | "good" | "excellent" | null;
|
|
48
|
+
cloudCover: number | null;
|
|
49
|
+
lastProcessedAt: string;
|
|
50
|
+
}>;
|
|
51
|
+
export type FieldMonitoringSummary = z.infer<typeof fieldMonitoringSummarySchema>;
|
|
52
|
+
export declare const ndviTrendDataPointSchema: z.ZodObject<{
|
|
53
|
+
time: z.ZodString;
|
|
54
|
+
ndvi: z.ZodNumber;
|
|
55
|
+
cloudCover: z.ZodNumber;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
time: string;
|
|
58
|
+
ndvi: number;
|
|
59
|
+
cloudCover: number;
|
|
60
|
+
}, {
|
|
61
|
+
time: string;
|
|
62
|
+
ndvi: number;
|
|
63
|
+
cloudCover: number;
|
|
64
|
+
}>;
|
|
65
|
+
export type NDVITrendDataPoint = z.infer<typeof ndviTrendDataPointSchema>;
|
|
66
|
+
export declare const weeklyNDVIStatsSchema: z.ZodObject<{
|
|
67
|
+
week: z.ZodString;
|
|
68
|
+
avgNdvi: z.ZodNumber;
|
|
69
|
+
maxNdvi: z.ZodNumber;
|
|
70
|
+
minNdvi: z.ZodNumber;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
week: string;
|
|
73
|
+
avgNdvi: number;
|
|
74
|
+
maxNdvi: number;
|
|
75
|
+
minNdvi: number;
|
|
76
|
+
}, {
|
|
77
|
+
week: string;
|
|
78
|
+
avgNdvi: number;
|
|
79
|
+
maxNdvi: number;
|
|
80
|
+
minNdvi: number;
|
|
81
|
+
}>;
|
|
82
|
+
export type WeeklyNDVIStats = z.infer<typeof weeklyNDVIStatsSchema>;
|
|
83
|
+
export declare const fieldAlertSchema: z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
fieldId: z.ZodString;
|
|
86
|
+
fieldName: z.ZodOptional<z.ZodString>;
|
|
87
|
+
type: z.ZodString;
|
|
88
|
+
severity: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
89
|
+
title: z.ZodString;
|
|
90
|
+
message: z.ZodString;
|
|
91
|
+
recommendation: z.ZodNullable<z.ZodString>;
|
|
92
|
+
status: z.ZodEnum<["active", "acknowledged", "resolved"]>;
|
|
93
|
+
acknowledgedAt: z.ZodNullable<z.ZodString>;
|
|
94
|
+
acknowledgedBy: z.ZodNullable<z.ZodString>;
|
|
95
|
+
resolvedAt: z.ZodNullable<z.ZodString>;
|
|
96
|
+
confidence: z.ZodNullable<z.ZodNumber>;
|
|
97
|
+
generatedBy: z.ZodString;
|
|
98
|
+
createdAt: z.ZodString;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
type: string;
|
|
101
|
+
status: "active" | "acknowledged" | "resolved";
|
|
102
|
+
message: string;
|
|
103
|
+
id: string;
|
|
104
|
+
title: string;
|
|
105
|
+
createdAt: string;
|
|
106
|
+
fieldId: string;
|
|
107
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
108
|
+
recommendation: string | null;
|
|
109
|
+
acknowledgedAt: string | null;
|
|
110
|
+
acknowledgedBy: string | null;
|
|
111
|
+
resolvedAt: string | null;
|
|
112
|
+
confidence: number | null;
|
|
113
|
+
generatedBy: string;
|
|
114
|
+
fieldName?: string | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
type: string;
|
|
117
|
+
status: "active" | "acknowledged" | "resolved";
|
|
118
|
+
message: string;
|
|
119
|
+
id: string;
|
|
120
|
+
title: string;
|
|
121
|
+
createdAt: string;
|
|
122
|
+
fieldId: string;
|
|
123
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
124
|
+
recommendation: string | null;
|
|
125
|
+
acknowledgedAt: string | null;
|
|
126
|
+
acknowledgedBy: string | null;
|
|
127
|
+
resolvedAt: string | null;
|
|
128
|
+
confidence: number | null;
|
|
129
|
+
generatedBy: string;
|
|
130
|
+
fieldName?: string | undefined;
|
|
131
|
+
}>;
|
|
132
|
+
export type FieldAlert = z.infer<typeof fieldAlertSchema>;
|
|
133
|
+
export declare const fieldComparisonSchema: z.ZodObject<{
|
|
134
|
+
fieldId: z.ZodString;
|
|
135
|
+
fieldName: z.ZodString;
|
|
136
|
+
avgNDVI: z.ZodNumber;
|
|
137
|
+
avgHealthScore: z.ZodNumber;
|
|
138
|
+
rank: z.ZodNumber;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
fieldId: string;
|
|
141
|
+
fieldName: string;
|
|
142
|
+
avgNDVI: number;
|
|
143
|
+
avgHealthScore: number;
|
|
144
|
+
rank: number;
|
|
145
|
+
}, {
|
|
146
|
+
fieldId: string;
|
|
147
|
+
fieldName: string;
|
|
148
|
+
avgNDVI: number;
|
|
149
|
+
avgHealthScore: number;
|
|
150
|
+
rank: number;
|
|
151
|
+
}>;
|
|
152
|
+
export type FieldComparison = z.infer<typeof fieldComparisonSchema>;
|
|
153
|
+
export declare const farmMonitoringStatsSchema: z.ZodObject<{
|
|
154
|
+
totalFields: z.ZodNumber;
|
|
155
|
+
healthyFields: z.ZodNumber;
|
|
156
|
+
warningFields: z.ZodNumber;
|
|
157
|
+
criticalFields: z.ZodNumber;
|
|
158
|
+
avgNDVI: z.ZodNumber;
|
|
159
|
+
totalActiveAlerts: z.ZodNumber;
|
|
160
|
+
}, "strip", z.ZodTypeAny, {
|
|
161
|
+
avgNDVI: number;
|
|
162
|
+
totalFields: number;
|
|
163
|
+
healthyFields: number;
|
|
164
|
+
warningFields: number;
|
|
165
|
+
criticalFields: number;
|
|
166
|
+
totalActiveAlerts: number;
|
|
167
|
+
}, {
|
|
168
|
+
avgNDVI: number;
|
|
169
|
+
totalFields: number;
|
|
170
|
+
healthyFields: number;
|
|
171
|
+
warningFields: number;
|
|
172
|
+
criticalFields: number;
|
|
173
|
+
totalActiveAlerts: number;
|
|
174
|
+
}>;
|
|
175
|
+
export type FarmMonitoringStats = z.infer<typeof farmMonitoringStatsSchema>;
|
|
176
|
+
export declare const ndviTrendQuerySchema: z.ZodObject<{
|
|
177
|
+
startDate: z.ZodString;
|
|
178
|
+
endDate: z.ZodString;
|
|
179
|
+
interval: z.ZodDefault<z.ZodEnum<["daily", "weekly"]>>;
|
|
180
|
+
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
startDate: string;
|
|
182
|
+
endDate: string;
|
|
183
|
+
interval: "daily" | "weekly";
|
|
184
|
+
}, {
|
|
185
|
+
startDate: string;
|
|
186
|
+
endDate: string;
|
|
187
|
+
interval?: "daily" | "weekly" | undefined;
|
|
188
|
+
}>;
|
|
189
|
+
export declare const alertsQuerySchema: z.ZodObject<{
|
|
190
|
+
status: z.ZodOptional<z.ZodEnum<["active", "acknowledged", "resolved"]>>;
|
|
191
|
+
}, "strip", z.ZodTypeAny, {
|
|
192
|
+
status?: "active" | "acknowledged" | "resolved" | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
status?: "active" | "acknowledged" | "resolved" | undefined;
|
|
195
|
+
}>;
|
|
196
|
+
export declare const triggerAnalysisResponseSchema: z.ZodObject<{
|
|
197
|
+
message: z.ZodString;
|
|
198
|
+
jobId: z.ZodString;
|
|
199
|
+
}, "strip", z.ZodTypeAny, {
|
|
200
|
+
message: string;
|
|
201
|
+
jobId: string;
|
|
202
|
+
}, {
|
|
203
|
+
message: string;
|
|
204
|
+
jobId: string;
|
|
205
|
+
}>;
|
|
206
|
+
export declare const fieldMonitoringErrorResponseSchema: z.ZodObject<{
|
|
207
|
+
message: z.ZodString;
|
|
208
|
+
code: z.ZodOptional<z.ZodString>;
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
210
|
+
message: string;
|
|
211
|
+
code?: string | undefined;
|
|
212
|
+
}, {
|
|
213
|
+
message: string;
|
|
214
|
+
code?: string | undefined;
|
|
215
|
+
}>;
|
|
216
|
+
//# sourceMappingURL=field-monitoring.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-monitoring.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/field-monitoring.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAGF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAInC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAG1E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAKhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAGpE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAG1D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAGpE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAG5E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;EAE5B,CAAC;AAGH,eAAO,MAAM,6BAA6B;;;;;;;;;EAGxC,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;EAG7C,CAAC"}
|