@agent-relay/api-types 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/agent.d.ts +259 -0
- package/dist/schemas/agent.d.ts.map +1 -0
- package/dist/schemas/agent.js +102 -0
- package/dist/schemas/agent.js.map +1 -0
- package/dist/schemas/api.d.ts +290 -0
- package/dist/schemas/api.d.ts.map +1 -0
- package/dist/schemas/api.js +162 -0
- package/dist/schemas/api.js.map +1 -0
- package/dist/schemas/decision.d.ts +230 -0
- package/dist/schemas/decision.d.ts.map +1 -0
- package/dist/schemas/decision.js +104 -0
- package/dist/schemas/decision.js.map +1 -0
- package/dist/schemas/fleet.d.ts +615 -0
- package/dist/schemas/fleet.d.ts.map +1 -0
- package/dist/schemas/fleet.js +71 -0
- package/dist/schemas/fleet.js.map +1 -0
- package/dist/schemas/history.d.ts +180 -0
- package/dist/schemas/history.d.ts.map +1 -0
- package/dist/schemas/history.js +72 -0
- package/dist/schemas/history.js.map +1 -0
- package/dist/schemas/index.d.ts +14 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +22 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/message.d.ts +456 -0
- package/dist/schemas/message.d.ts.map +1 -0
- package/dist/schemas/message.js +88 -0
- package/dist/schemas/message.js.map +1 -0
- package/dist/schemas/session.d.ts +60 -0
- package/dist/schemas/session.d.ts.map +1 -0
- package/dist/schemas/session.js +36 -0
- package/dist/schemas/session.js.map +1 -0
- package/dist/schemas/task.d.ts +111 -0
- package/dist/schemas/task.d.ts.map +1 -0
- package/dist/schemas/task.js +64 -0
- package/dist/schemas/task.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message Schemas
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for message-related types used across the dashboard and API.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Message status enum
|
|
9
|
+
*/
|
|
10
|
+
export declare const MessageStatusSchema: z.ZodEnum<["unread", "read", "acked", "sending", "failed"]>;
|
|
11
|
+
export type MessageStatus = z.infer<typeof MessageStatusSchema>;
|
|
12
|
+
/**
|
|
13
|
+
* Attachment schema - files/images attached to messages
|
|
14
|
+
*/
|
|
15
|
+
export declare const AttachmentSchema: z.ZodObject<{
|
|
16
|
+
/** Unique identifier for the attachment */
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
/** Original filename */
|
|
19
|
+
filename: z.ZodString;
|
|
20
|
+
/** MIME type (e.g., 'image/png', 'image/jpeg') */
|
|
21
|
+
mimeType: z.ZodString;
|
|
22
|
+
/** Size in bytes */
|
|
23
|
+
size: z.ZodNumber;
|
|
24
|
+
/** URL to access the attachment */
|
|
25
|
+
url: z.ZodString;
|
|
26
|
+
/** Absolute file path for agents to read the file directly */
|
|
27
|
+
filePath: z.ZodOptional<z.ZodString>;
|
|
28
|
+
/** Width for images */
|
|
29
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
/** Height for images */
|
|
31
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
/** Base64-encoded data (for inline display, optional) */
|
|
33
|
+
data: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
id: string;
|
|
36
|
+
filename: string;
|
|
37
|
+
mimeType: string;
|
|
38
|
+
size: number;
|
|
39
|
+
url: string;
|
|
40
|
+
filePath?: string | undefined;
|
|
41
|
+
width?: number | undefined;
|
|
42
|
+
height?: number | undefined;
|
|
43
|
+
data?: string | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
id: string;
|
|
46
|
+
filename: string;
|
|
47
|
+
mimeType: string;
|
|
48
|
+
size: number;
|
|
49
|
+
url: string;
|
|
50
|
+
filePath?: string | undefined;
|
|
51
|
+
width?: number | undefined;
|
|
52
|
+
height?: number | undefined;
|
|
53
|
+
data?: string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
export type Attachment = z.infer<typeof AttachmentSchema>;
|
|
56
|
+
/**
|
|
57
|
+
* Thread metadata schema
|
|
58
|
+
*/
|
|
59
|
+
export declare const ThreadMetadataSchema: z.ZodObject<{
|
|
60
|
+
id: z.ZodString;
|
|
61
|
+
rootMessage: z.ZodString;
|
|
62
|
+
participantCount: z.ZodNumber;
|
|
63
|
+
messageCount: z.ZodNumber;
|
|
64
|
+
lastActivityAt: z.ZodString;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
messageCount: number;
|
|
67
|
+
id: string;
|
|
68
|
+
rootMessage: string;
|
|
69
|
+
participantCount: number;
|
|
70
|
+
lastActivityAt: string;
|
|
71
|
+
}, {
|
|
72
|
+
messageCount: number;
|
|
73
|
+
id: string;
|
|
74
|
+
rootMessage: string;
|
|
75
|
+
participantCount: number;
|
|
76
|
+
lastActivityAt: string;
|
|
77
|
+
}>;
|
|
78
|
+
export type ThreadMetadata = z.infer<typeof ThreadMetadataSchema>;
|
|
79
|
+
/**
|
|
80
|
+
* Message schema
|
|
81
|
+
*/
|
|
82
|
+
export declare const MessageSchema: z.ZodObject<{
|
|
83
|
+
/** Unique message ID */
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
/** Sender agent name */
|
|
86
|
+
from: z.ZodString;
|
|
87
|
+
/** Recipient agent name or '*' for broadcast */
|
|
88
|
+
to: z.ZodString;
|
|
89
|
+
/** Message content */
|
|
90
|
+
content: z.ZodString;
|
|
91
|
+
/** Timestamp (ISO string) */
|
|
92
|
+
timestamp: z.ZodString;
|
|
93
|
+
/** Optional thread ID for threading */
|
|
94
|
+
thread: z.ZodOptional<z.ZodString>;
|
|
95
|
+
/** Whether this is a broadcast message */
|
|
96
|
+
isBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
+
/** Whether the message has been read */
|
|
98
|
+
isRead: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
+
/** Number of replies in thread */
|
|
100
|
+
replyCount: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
/** Thread summary metadata */
|
|
102
|
+
threadSummary: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
rootMessage: z.ZodString;
|
|
105
|
+
participantCount: z.ZodNumber;
|
|
106
|
+
messageCount: z.ZodNumber;
|
|
107
|
+
lastActivityAt: z.ZodString;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
messageCount: number;
|
|
110
|
+
id: string;
|
|
111
|
+
rootMessage: string;
|
|
112
|
+
participantCount: number;
|
|
113
|
+
lastActivityAt: string;
|
|
114
|
+
}, {
|
|
115
|
+
messageCount: number;
|
|
116
|
+
id: string;
|
|
117
|
+
rootMessage: string;
|
|
118
|
+
participantCount: number;
|
|
119
|
+
lastActivityAt: string;
|
|
120
|
+
}>>;
|
|
121
|
+
/** Message delivery status */
|
|
122
|
+
status: z.ZodOptional<z.ZodEnum<["unread", "read", "acked", "sending", "failed"]>>;
|
|
123
|
+
/** Attached files/images */
|
|
124
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
125
|
+
/** Unique identifier for the attachment */
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
/** Original filename */
|
|
128
|
+
filename: z.ZodString;
|
|
129
|
+
/** MIME type (e.g., 'image/png', 'image/jpeg') */
|
|
130
|
+
mimeType: z.ZodString;
|
|
131
|
+
/** Size in bytes */
|
|
132
|
+
size: z.ZodNumber;
|
|
133
|
+
/** URL to access the attachment */
|
|
134
|
+
url: z.ZodString;
|
|
135
|
+
/** Absolute file path for agents to read the file directly */
|
|
136
|
+
filePath: z.ZodOptional<z.ZodString>;
|
|
137
|
+
/** Width for images */
|
|
138
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
/** Height for images */
|
|
140
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
/** Base64-encoded data (for inline display, optional) */
|
|
142
|
+
data: z.ZodOptional<z.ZodString>;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
id: string;
|
|
145
|
+
filename: string;
|
|
146
|
+
mimeType: string;
|
|
147
|
+
size: number;
|
|
148
|
+
url: string;
|
|
149
|
+
filePath?: string | undefined;
|
|
150
|
+
width?: number | undefined;
|
|
151
|
+
height?: number | undefined;
|
|
152
|
+
data?: string | undefined;
|
|
153
|
+
}, {
|
|
154
|
+
id: string;
|
|
155
|
+
filename: string;
|
|
156
|
+
mimeType: string;
|
|
157
|
+
size: number;
|
|
158
|
+
url: string;
|
|
159
|
+
filePath?: string | undefined;
|
|
160
|
+
width?: number | undefined;
|
|
161
|
+
height?: number | undefined;
|
|
162
|
+
data?: string | undefined;
|
|
163
|
+
}>, "many">>;
|
|
164
|
+
/** Channel context for routing */
|
|
165
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
166
|
+
}, "strip", z.ZodTypeAny, {
|
|
167
|
+
id: string;
|
|
168
|
+
from: string;
|
|
169
|
+
to: string;
|
|
170
|
+
content: string;
|
|
171
|
+
timestamp: string;
|
|
172
|
+
status?: "unread" | "read" | "acked" | "sending" | "failed" | undefined;
|
|
173
|
+
thread?: string | undefined;
|
|
174
|
+
isBroadcast?: boolean | undefined;
|
|
175
|
+
isRead?: boolean | undefined;
|
|
176
|
+
replyCount?: number | undefined;
|
|
177
|
+
threadSummary?: {
|
|
178
|
+
messageCount: number;
|
|
179
|
+
id: string;
|
|
180
|
+
rootMessage: string;
|
|
181
|
+
participantCount: number;
|
|
182
|
+
lastActivityAt: string;
|
|
183
|
+
} | undefined;
|
|
184
|
+
attachments?: {
|
|
185
|
+
id: string;
|
|
186
|
+
filename: string;
|
|
187
|
+
mimeType: string;
|
|
188
|
+
size: number;
|
|
189
|
+
url: string;
|
|
190
|
+
filePath?: string | undefined;
|
|
191
|
+
width?: number | undefined;
|
|
192
|
+
height?: number | undefined;
|
|
193
|
+
data?: string | undefined;
|
|
194
|
+
}[] | undefined;
|
|
195
|
+
channel?: string | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
id: string;
|
|
198
|
+
from: string;
|
|
199
|
+
to: string;
|
|
200
|
+
content: string;
|
|
201
|
+
timestamp: string;
|
|
202
|
+
status?: "unread" | "read" | "acked" | "sending" | "failed" | undefined;
|
|
203
|
+
thread?: string | undefined;
|
|
204
|
+
isBroadcast?: boolean | undefined;
|
|
205
|
+
isRead?: boolean | undefined;
|
|
206
|
+
replyCount?: number | undefined;
|
|
207
|
+
threadSummary?: {
|
|
208
|
+
messageCount: number;
|
|
209
|
+
id: string;
|
|
210
|
+
rootMessage: string;
|
|
211
|
+
participantCount: number;
|
|
212
|
+
lastActivityAt: string;
|
|
213
|
+
} | undefined;
|
|
214
|
+
attachments?: {
|
|
215
|
+
id: string;
|
|
216
|
+
filename: string;
|
|
217
|
+
mimeType: string;
|
|
218
|
+
size: number;
|
|
219
|
+
url: string;
|
|
220
|
+
filePath?: string | undefined;
|
|
221
|
+
width?: number | undefined;
|
|
222
|
+
height?: number | undefined;
|
|
223
|
+
data?: string | undefined;
|
|
224
|
+
}[] | undefined;
|
|
225
|
+
channel?: string | undefined;
|
|
226
|
+
}>;
|
|
227
|
+
export type Message = z.infer<typeof MessageSchema>;
|
|
228
|
+
/**
|
|
229
|
+
* Thread schema - collection of messages
|
|
230
|
+
*/
|
|
231
|
+
export declare const ThreadSchema: z.ZodObject<{
|
|
232
|
+
/** Thread ID */
|
|
233
|
+
id: z.ZodString;
|
|
234
|
+
/** Messages in the thread */
|
|
235
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
236
|
+
/** Unique message ID */
|
|
237
|
+
id: z.ZodString;
|
|
238
|
+
/** Sender agent name */
|
|
239
|
+
from: z.ZodString;
|
|
240
|
+
/** Recipient agent name or '*' for broadcast */
|
|
241
|
+
to: z.ZodString;
|
|
242
|
+
/** Message content */
|
|
243
|
+
content: z.ZodString;
|
|
244
|
+
/** Timestamp (ISO string) */
|
|
245
|
+
timestamp: z.ZodString;
|
|
246
|
+
/** Optional thread ID for threading */
|
|
247
|
+
thread: z.ZodOptional<z.ZodString>;
|
|
248
|
+
/** Whether this is a broadcast message */
|
|
249
|
+
isBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
250
|
+
/** Whether the message has been read */
|
|
251
|
+
isRead: z.ZodOptional<z.ZodBoolean>;
|
|
252
|
+
/** Number of replies in thread */
|
|
253
|
+
replyCount: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
/** Thread summary metadata */
|
|
255
|
+
threadSummary: z.ZodOptional<z.ZodObject<{
|
|
256
|
+
id: z.ZodString;
|
|
257
|
+
rootMessage: z.ZodString;
|
|
258
|
+
participantCount: z.ZodNumber;
|
|
259
|
+
messageCount: z.ZodNumber;
|
|
260
|
+
lastActivityAt: z.ZodString;
|
|
261
|
+
}, "strip", z.ZodTypeAny, {
|
|
262
|
+
messageCount: number;
|
|
263
|
+
id: string;
|
|
264
|
+
rootMessage: string;
|
|
265
|
+
participantCount: number;
|
|
266
|
+
lastActivityAt: string;
|
|
267
|
+
}, {
|
|
268
|
+
messageCount: number;
|
|
269
|
+
id: string;
|
|
270
|
+
rootMessage: string;
|
|
271
|
+
participantCount: number;
|
|
272
|
+
lastActivityAt: string;
|
|
273
|
+
}>>;
|
|
274
|
+
/** Message delivery status */
|
|
275
|
+
status: z.ZodOptional<z.ZodEnum<["unread", "read", "acked", "sending", "failed"]>>;
|
|
276
|
+
/** Attached files/images */
|
|
277
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
278
|
+
/** Unique identifier for the attachment */
|
|
279
|
+
id: z.ZodString;
|
|
280
|
+
/** Original filename */
|
|
281
|
+
filename: z.ZodString;
|
|
282
|
+
/** MIME type (e.g., 'image/png', 'image/jpeg') */
|
|
283
|
+
mimeType: z.ZodString;
|
|
284
|
+
/** Size in bytes */
|
|
285
|
+
size: z.ZodNumber;
|
|
286
|
+
/** URL to access the attachment */
|
|
287
|
+
url: z.ZodString;
|
|
288
|
+
/** Absolute file path for agents to read the file directly */
|
|
289
|
+
filePath: z.ZodOptional<z.ZodString>;
|
|
290
|
+
/** Width for images */
|
|
291
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
292
|
+
/** Height for images */
|
|
293
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
294
|
+
/** Base64-encoded data (for inline display, optional) */
|
|
295
|
+
data: z.ZodOptional<z.ZodString>;
|
|
296
|
+
}, "strip", z.ZodTypeAny, {
|
|
297
|
+
id: string;
|
|
298
|
+
filename: string;
|
|
299
|
+
mimeType: string;
|
|
300
|
+
size: number;
|
|
301
|
+
url: string;
|
|
302
|
+
filePath?: string | undefined;
|
|
303
|
+
width?: number | undefined;
|
|
304
|
+
height?: number | undefined;
|
|
305
|
+
data?: string | undefined;
|
|
306
|
+
}, {
|
|
307
|
+
id: string;
|
|
308
|
+
filename: string;
|
|
309
|
+
mimeType: string;
|
|
310
|
+
size: number;
|
|
311
|
+
url: string;
|
|
312
|
+
filePath?: string | undefined;
|
|
313
|
+
width?: number | undefined;
|
|
314
|
+
height?: number | undefined;
|
|
315
|
+
data?: string | undefined;
|
|
316
|
+
}>, "many">>;
|
|
317
|
+
/** Channel context for routing */
|
|
318
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
319
|
+
}, "strip", z.ZodTypeAny, {
|
|
320
|
+
id: string;
|
|
321
|
+
from: string;
|
|
322
|
+
to: string;
|
|
323
|
+
content: string;
|
|
324
|
+
timestamp: string;
|
|
325
|
+
status?: "unread" | "read" | "acked" | "sending" | "failed" | undefined;
|
|
326
|
+
thread?: string | undefined;
|
|
327
|
+
isBroadcast?: boolean | undefined;
|
|
328
|
+
isRead?: boolean | undefined;
|
|
329
|
+
replyCount?: number | undefined;
|
|
330
|
+
threadSummary?: {
|
|
331
|
+
messageCount: number;
|
|
332
|
+
id: string;
|
|
333
|
+
rootMessage: string;
|
|
334
|
+
participantCount: number;
|
|
335
|
+
lastActivityAt: string;
|
|
336
|
+
} | undefined;
|
|
337
|
+
attachments?: {
|
|
338
|
+
id: string;
|
|
339
|
+
filename: string;
|
|
340
|
+
mimeType: string;
|
|
341
|
+
size: number;
|
|
342
|
+
url: string;
|
|
343
|
+
filePath?: string | undefined;
|
|
344
|
+
width?: number | undefined;
|
|
345
|
+
height?: number | undefined;
|
|
346
|
+
data?: string | undefined;
|
|
347
|
+
}[] | undefined;
|
|
348
|
+
channel?: string | undefined;
|
|
349
|
+
}, {
|
|
350
|
+
id: string;
|
|
351
|
+
from: string;
|
|
352
|
+
to: string;
|
|
353
|
+
content: string;
|
|
354
|
+
timestamp: string;
|
|
355
|
+
status?: "unread" | "read" | "acked" | "sending" | "failed" | undefined;
|
|
356
|
+
thread?: string | undefined;
|
|
357
|
+
isBroadcast?: boolean | undefined;
|
|
358
|
+
isRead?: boolean | undefined;
|
|
359
|
+
replyCount?: number | undefined;
|
|
360
|
+
threadSummary?: {
|
|
361
|
+
messageCount: number;
|
|
362
|
+
id: string;
|
|
363
|
+
rootMessage: string;
|
|
364
|
+
participantCount: number;
|
|
365
|
+
lastActivityAt: string;
|
|
366
|
+
} | undefined;
|
|
367
|
+
attachments?: {
|
|
368
|
+
id: string;
|
|
369
|
+
filename: string;
|
|
370
|
+
mimeType: string;
|
|
371
|
+
size: number;
|
|
372
|
+
url: string;
|
|
373
|
+
filePath?: string | undefined;
|
|
374
|
+
width?: number | undefined;
|
|
375
|
+
height?: number | undefined;
|
|
376
|
+
data?: string | undefined;
|
|
377
|
+
}[] | undefined;
|
|
378
|
+
channel?: string | undefined;
|
|
379
|
+
}>, "many">;
|
|
380
|
+
/** Participant agent names */
|
|
381
|
+
participants: z.ZodArray<z.ZodString, "many">;
|
|
382
|
+
/** Last activity timestamp */
|
|
383
|
+
lastActivity: z.ZodString;
|
|
384
|
+
}, "strip", z.ZodTypeAny, {
|
|
385
|
+
id: string;
|
|
386
|
+
messages: {
|
|
387
|
+
id: string;
|
|
388
|
+
from: string;
|
|
389
|
+
to: string;
|
|
390
|
+
content: string;
|
|
391
|
+
timestamp: string;
|
|
392
|
+
status?: "unread" | "read" | "acked" | "sending" | "failed" | undefined;
|
|
393
|
+
thread?: string | undefined;
|
|
394
|
+
isBroadcast?: boolean | undefined;
|
|
395
|
+
isRead?: boolean | undefined;
|
|
396
|
+
replyCount?: number | undefined;
|
|
397
|
+
threadSummary?: {
|
|
398
|
+
messageCount: number;
|
|
399
|
+
id: string;
|
|
400
|
+
rootMessage: string;
|
|
401
|
+
participantCount: number;
|
|
402
|
+
lastActivityAt: string;
|
|
403
|
+
} | undefined;
|
|
404
|
+
attachments?: {
|
|
405
|
+
id: string;
|
|
406
|
+
filename: string;
|
|
407
|
+
mimeType: string;
|
|
408
|
+
size: number;
|
|
409
|
+
url: string;
|
|
410
|
+
filePath?: string | undefined;
|
|
411
|
+
width?: number | undefined;
|
|
412
|
+
height?: number | undefined;
|
|
413
|
+
data?: string | undefined;
|
|
414
|
+
}[] | undefined;
|
|
415
|
+
channel?: string | undefined;
|
|
416
|
+
}[];
|
|
417
|
+
participants: string[];
|
|
418
|
+
lastActivity: string;
|
|
419
|
+
}, {
|
|
420
|
+
id: string;
|
|
421
|
+
messages: {
|
|
422
|
+
id: string;
|
|
423
|
+
from: string;
|
|
424
|
+
to: string;
|
|
425
|
+
content: string;
|
|
426
|
+
timestamp: string;
|
|
427
|
+
status?: "unread" | "read" | "acked" | "sending" | "failed" | undefined;
|
|
428
|
+
thread?: string | undefined;
|
|
429
|
+
isBroadcast?: boolean | undefined;
|
|
430
|
+
isRead?: boolean | undefined;
|
|
431
|
+
replyCount?: number | undefined;
|
|
432
|
+
threadSummary?: {
|
|
433
|
+
messageCount: number;
|
|
434
|
+
id: string;
|
|
435
|
+
rootMessage: string;
|
|
436
|
+
participantCount: number;
|
|
437
|
+
lastActivityAt: string;
|
|
438
|
+
} | undefined;
|
|
439
|
+
attachments?: {
|
|
440
|
+
id: string;
|
|
441
|
+
filename: string;
|
|
442
|
+
mimeType: string;
|
|
443
|
+
size: number;
|
|
444
|
+
url: string;
|
|
445
|
+
filePath?: string | undefined;
|
|
446
|
+
width?: number | undefined;
|
|
447
|
+
height?: number | undefined;
|
|
448
|
+
data?: string | undefined;
|
|
449
|
+
}[] | undefined;
|
|
450
|
+
channel?: string | undefined;
|
|
451
|
+
}[];
|
|
452
|
+
participants: string[];
|
|
453
|
+
lastActivity: string;
|
|
454
|
+
}>;
|
|
455
|
+
export type Thread = z.infer<typeof ThreadSchema>;
|
|
456
|
+
//# sourceMappingURL=message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/schemas/message.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,mBAAmB,6DAA2D,CAAC;AAC5F,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B,2CAA2C;;IAE3C,wBAAwB;;IAExB,kDAAkD;;IAElD,oBAAoB;;IAEpB,mCAAmC;;IAEnC,8DAA8D;;IAE9D,uBAAuB;;IAEvB,wBAAwB;;IAExB,yDAAyD;;;;;;;;;;;;;;;;;;;;;;EAEzD,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;EAM/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB,wBAAwB;;IAExB,wBAAwB;;IAExB,gDAA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MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message Schemas
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for message-related types used across the dashboard and API.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Message status enum
|
|
9
|
+
*/
|
|
10
|
+
export const MessageStatusSchema = z.enum(['unread', 'read', 'acked', 'sending', 'failed']);
|
|
11
|
+
/**
|
|
12
|
+
* Attachment schema - files/images attached to messages
|
|
13
|
+
*/
|
|
14
|
+
export const AttachmentSchema = z.object({
|
|
15
|
+
/** Unique identifier for the attachment */
|
|
16
|
+
id: z.string(),
|
|
17
|
+
/** Original filename */
|
|
18
|
+
filename: z.string(),
|
|
19
|
+
/** MIME type (e.g., 'image/png', 'image/jpeg') */
|
|
20
|
+
mimeType: z.string(),
|
|
21
|
+
/** Size in bytes */
|
|
22
|
+
size: z.number(),
|
|
23
|
+
/** URL to access the attachment */
|
|
24
|
+
url: z.string(),
|
|
25
|
+
/** Absolute file path for agents to read the file directly */
|
|
26
|
+
filePath: z.string().optional(),
|
|
27
|
+
/** Width for images */
|
|
28
|
+
width: z.number().optional(),
|
|
29
|
+
/** Height for images */
|
|
30
|
+
height: z.number().optional(),
|
|
31
|
+
/** Base64-encoded data (for inline display, optional) */
|
|
32
|
+
data: z.string().optional(),
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Thread metadata schema
|
|
36
|
+
*/
|
|
37
|
+
export const ThreadMetadataSchema = z.object({
|
|
38
|
+
id: z.string(),
|
|
39
|
+
rootMessage: z.string(),
|
|
40
|
+
participantCount: z.number(),
|
|
41
|
+
messageCount: z.number(),
|
|
42
|
+
lastActivityAt: z.string(),
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Message schema
|
|
46
|
+
*/
|
|
47
|
+
export const MessageSchema = z.object({
|
|
48
|
+
/** Unique message ID */
|
|
49
|
+
id: z.string(),
|
|
50
|
+
/** Sender agent name */
|
|
51
|
+
from: z.string(),
|
|
52
|
+
/** Recipient agent name or '*' for broadcast */
|
|
53
|
+
to: z.string(),
|
|
54
|
+
/** Message content */
|
|
55
|
+
content: z.string(),
|
|
56
|
+
/** Timestamp (ISO string) */
|
|
57
|
+
timestamp: z.string(),
|
|
58
|
+
/** Optional thread ID for threading */
|
|
59
|
+
thread: z.string().optional(),
|
|
60
|
+
/** Whether this is a broadcast message */
|
|
61
|
+
isBroadcast: z.boolean().optional(),
|
|
62
|
+
/** Whether the message has been read */
|
|
63
|
+
isRead: z.boolean().optional(),
|
|
64
|
+
/** Number of replies in thread */
|
|
65
|
+
replyCount: z.number().optional(),
|
|
66
|
+
/** Thread summary metadata */
|
|
67
|
+
threadSummary: ThreadMetadataSchema.optional(),
|
|
68
|
+
/** Message delivery status */
|
|
69
|
+
status: MessageStatusSchema.optional(),
|
|
70
|
+
/** Attached files/images */
|
|
71
|
+
attachments: z.array(AttachmentSchema).optional(),
|
|
72
|
+
/** Channel context for routing */
|
|
73
|
+
channel: z.string().optional(),
|
|
74
|
+
});
|
|
75
|
+
/**
|
|
76
|
+
* Thread schema - collection of messages
|
|
77
|
+
*/
|
|
78
|
+
export const ThreadSchema = z.object({
|
|
79
|
+
/** Thread ID */
|
|
80
|
+
id: z.string(),
|
|
81
|
+
/** Messages in the thread */
|
|
82
|
+
messages: z.array(MessageSchema),
|
|
83
|
+
/** Participant agent names */
|
|
84
|
+
participants: z.array(z.string()),
|
|
85
|
+
/** Last activity timestamp */
|
|
86
|
+
lastActivity: z.string(),
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/schemas/message.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,C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,EAAE;CACzB,CAAC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Schemas
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for session-related types used across the dashboard and API.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Session closed by enum
|
|
9
|
+
*/
|
|
10
|
+
export declare const SessionClosedBySchema: z.ZodEnum<["agent", "disconnect", "error"]>;
|
|
11
|
+
export type SessionClosedBy = z.infer<typeof SessionClosedBySchema>;
|
|
12
|
+
/**
|
|
13
|
+
* Session schema - represents an agent session
|
|
14
|
+
*/
|
|
15
|
+
export declare const SessionSchema: z.ZodObject<{
|
|
16
|
+
/** Unique session ID */
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
/** Agent name for this session */
|
|
19
|
+
agentName: z.ZodString;
|
|
20
|
+
/** CLI type used (claude, codex, gemini, etc.) */
|
|
21
|
+
cli: z.ZodOptional<z.ZodString>;
|
|
22
|
+
/** Session start timestamp (ISO string) */
|
|
23
|
+
startedAt: z.ZodString;
|
|
24
|
+
/** Session end timestamp (ISO string) */
|
|
25
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
26
|
+
/** Human-readable duration string */
|
|
27
|
+
duration: z.ZodOptional<z.ZodString>;
|
|
28
|
+
/** Total messages in session */
|
|
29
|
+
messageCount: z.ZodNumber;
|
|
30
|
+
/** Session summary text */
|
|
31
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
32
|
+
/** Whether session is currently active */
|
|
33
|
+
isActive: z.ZodBoolean;
|
|
34
|
+
/** How the session was closed */
|
|
35
|
+
closedBy: z.ZodOptional<z.ZodEnum<["agent", "disconnect", "error"]>>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
messageCount: number;
|
|
38
|
+
agentName: string;
|
|
39
|
+
id: string;
|
|
40
|
+
startedAt: string;
|
|
41
|
+
isActive: boolean;
|
|
42
|
+
cli?: string | undefined;
|
|
43
|
+
endedAt?: string | undefined;
|
|
44
|
+
duration?: string | undefined;
|
|
45
|
+
summary?: string | undefined;
|
|
46
|
+
closedBy?: "agent" | "disconnect" | "error" | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
messageCount: number;
|
|
49
|
+
agentName: string;
|
|
50
|
+
id: string;
|
|
51
|
+
startedAt: string;
|
|
52
|
+
isActive: boolean;
|
|
53
|
+
cli?: string | undefined;
|
|
54
|
+
endedAt?: string | undefined;
|
|
55
|
+
duration?: string | undefined;
|
|
56
|
+
summary?: string | undefined;
|
|
57
|
+
closedBy?: "agent" | "disconnect" | "error" | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
export type Session = z.infer<typeof SessionSchema>;
|
|
60
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/schemas/session.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,qBAAqB,6CAA2C,CAAC;AAC9E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB,wBAAwB;;IAExB,kCAAkC;;IAElC,kDAAkD;;IAElD,2CAA2C;;IAE3C,yCAAyC;;IAEzC,qCAAqC;;IAErC,gCAAgC;;IAEhC,2BAA2B;;IAE3B,0CAA0C;;IAE1C,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;EAEjC,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Schemas
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for session-related types used across the dashboard and API.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Session closed by enum
|
|
9
|
+
*/
|
|
10
|
+
export const SessionClosedBySchema = z.enum(['agent', 'disconnect', 'error']);
|
|
11
|
+
/**
|
|
12
|
+
* Session schema - represents an agent session
|
|
13
|
+
*/
|
|
14
|
+
export const SessionSchema = z.object({
|
|
15
|
+
/** Unique session ID */
|
|
16
|
+
id: z.string(),
|
|
17
|
+
/** Agent name for this session */
|
|
18
|
+
agentName: z.string(),
|
|
19
|
+
/** CLI type used (claude, codex, gemini, etc.) */
|
|
20
|
+
cli: z.string().optional(),
|
|
21
|
+
/** Session start timestamp (ISO string) */
|
|
22
|
+
startedAt: z.string(),
|
|
23
|
+
/** Session end timestamp (ISO string) */
|
|
24
|
+
endedAt: z.string().optional(),
|
|
25
|
+
/** Human-readable duration string */
|
|
26
|
+
duration: z.string().optional(),
|
|
27
|
+
/** Total messages in session */
|
|
28
|
+
messageCount: z.number(),
|
|
29
|
+
/** Session summary text */
|
|
30
|
+
summary: z.string().optional(),
|
|
31
|
+
/** Whether session is currently active */
|
|
32
|
+
isActive: z.boolean(),
|
|
33
|
+
/** How the session was closed */
|
|
34
|
+
closedBy: SessionClosedBySchema.optional(),
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/schemas/session.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;AAG9E;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,wBAAwB;IACxB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,kCAAkC;IAClC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,kDAAkD;IAClD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,2CAA2C;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,yCAAyC;IACzC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,qCAAqC;IACrC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,gCAAgC;IAChC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,2BAA2B;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,0CAA0C;IAC1C,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,iCAAiC;IACjC,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC"}
|