@adecore/agent-contracts 0.37.2 → 0.38.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/chat.d.ts +27 -0
- package/dist/chat.js +7 -3
- package/dist/protocol.d.ts +21 -0
- package/package.json +2 -2
- package/src/chat.ts +7 -3
package/dist/chat.d.ts
CHANGED
|
@@ -113,6 +113,7 @@ export declare const ChatQueuedMessageSchema: z.ZodObject<{
|
|
|
113
113
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
114
114
|
itemId: z.ZodString;
|
|
115
115
|
}, z.core.$strip>>;
|
|
116
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
116
117
|
}, z.core.$strip>;
|
|
117
118
|
export type ChatQueuedMessage = z.infer<typeof ChatQueuedMessageSchema>;
|
|
118
119
|
export declare const ChatBackgroundTaskSchema: z.ZodObject<{
|
|
@@ -308,6 +309,7 @@ export declare const ChatInfoSchema: z.ZodObject<{
|
|
|
308
309
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
309
310
|
itemId: z.ZodString;
|
|
310
311
|
}, z.core.$strip>>;
|
|
312
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
311
313
|
}, z.core.$strip>>>;
|
|
312
314
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
313
315
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -471,6 +473,7 @@ export declare const ChatUserItemSchema: z.ZodObject<{
|
|
|
471
473
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
472
474
|
itemId: z.ZodString;
|
|
473
475
|
}, z.core.$strip>>;
|
|
476
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
474
477
|
}, z.core.$strip>;
|
|
475
478
|
export declare const ChatUiQueryReadingSchema: z.ZodObject<{
|
|
476
479
|
state: z.ZodEnum<{
|
|
@@ -1091,6 +1094,7 @@ export declare const ChatItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1091
1094
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
1092
1095
|
itemId: z.ZodString;
|
|
1093
1096
|
}, z.core.$strip>>;
|
|
1097
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1094
1098
|
}, z.core.$strip>, z.ZodObject<{
|
|
1095
1099
|
id: z.ZodString;
|
|
1096
1100
|
createdAt: z.ZodNumber;
|
|
@@ -1446,6 +1450,7 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1446
1450
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
1447
1451
|
itemId: z.ZodString;
|
|
1448
1452
|
}, z.core.$strip>>;
|
|
1453
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1449
1454
|
}, z.core.$strip>, z.ZodObject<{
|
|
1450
1455
|
id: z.ZodString;
|
|
1451
1456
|
createdAt: z.ZodNumber;
|
|
@@ -1890,6 +1895,7 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1890
1895
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
1891
1896
|
itemId: z.ZodString;
|
|
1892
1897
|
}, z.core.$strip>>;
|
|
1898
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1893
1899
|
}, z.core.$strip>>>;
|
|
1894
1900
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
1895
1901
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -2056,6 +2062,7 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2056
2062
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
2057
2063
|
itemId: z.ZodString;
|
|
2058
2064
|
}, z.core.$strip>>;
|
|
2065
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2059
2066
|
}, z.core.$strip>>>;
|
|
2060
2067
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
2061
2068
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -2186,6 +2193,7 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2186
2193
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
2187
2194
|
itemId: z.ZodString;
|
|
2188
2195
|
}, z.core.$strip>>;
|
|
2196
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2189
2197
|
}, z.core.$strip>, z.ZodObject<{
|
|
2190
2198
|
id: z.ZodString;
|
|
2191
2199
|
createdAt: z.ZodNumber;
|
|
@@ -2533,6 +2541,7 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
|
|
|
2533
2541
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
2534
2542
|
itemId: z.ZodString;
|
|
2535
2543
|
}, z.core.$strip>>;
|
|
2544
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2536
2545
|
}, z.core.$strip>, z.ZodObject<{
|
|
2537
2546
|
id: z.ZodString;
|
|
2538
2547
|
createdAt: z.ZodNumber;
|
|
@@ -2977,6 +2986,7 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
|
|
|
2977
2986
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
2978
2987
|
itemId: z.ZodString;
|
|
2979
2988
|
}, z.core.$strip>>;
|
|
2989
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2980
2990
|
}, z.core.$strip>>>;
|
|
2981
2991
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
2982
2992
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -3143,6 +3153,7 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
|
|
|
3143
3153
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
3144
3154
|
itemId: z.ZodString;
|
|
3145
3155
|
}, z.core.$strip>>;
|
|
3156
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3146
3157
|
}, z.core.$strip>>>;
|
|
3147
3158
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
3148
3159
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -3273,6 +3284,7 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
|
|
|
3273
3284
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
3274
3285
|
itemId: z.ZodString;
|
|
3275
3286
|
}, z.core.$strip>>;
|
|
3287
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3276
3288
|
}, z.core.$strip>, z.ZodObject<{
|
|
3277
3289
|
id: z.ZodString;
|
|
3278
3290
|
createdAt: z.ZodNumber;
|
|
@@ -3702,6 +3714,7 @@ export declare const ChatHistoryResultSchema: z.ZodObject<{
|
|
|
3702
3714
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
3703
3715
|
itemId: z.ZodString;
|
|
3704
3716
|
}, z.core.$strip>>;
|
|
3717
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3705
3718
|
}, z.core.$strip>, z.ZodObject<{
|
|
3706
3719
|
id: z.ZodString;
|
|
3707
3720
|
createdAt: z.ZodNumber;
|
|
@@ -4092,6 +4105,7 @@ export declare const ChatSubagentResultSchema: z.ZodObject<{
|
|
|
4092
4105
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
4093
4106
|
itemId: z.ZodString;
|
|
4094
4107
|
}, z.core.$strip>>;
|
|
4108
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4095
4109
|
}, z.core.$strip>, z.ZodObject<{
|
|
4096
4110
|
id: z.ZodString;
|
|
4097
4111
|
createdAt: z.ZodNumber;
|
|
@@ -4532,6 +4546,7 @@ export declare const ChatStatusEventSchema: z.ZodObject<{
|
|
|
4532
4546
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
4533
4547
|
itemId: z.ZodString;
|
|
4534
4548
|
}, z.core.$strip>>;
|
|
4549
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4535
4550
|
}, z.core.$strip>>>;
|
|
4536
4551
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
4537
4552
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -4796,6 +4811,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
4796
4811
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
4797
4812
|
itemId: z.ZodString;
|
|
4798
4813
|
}, z.core.$strip>>;
|
|
4814
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4799
4815
|
}, z.core.$strip>>>;
|
|
4800
4816
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
4801
4817
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -4926,6 +4942,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
4926
4942
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
4927
4943
|
itemId: z.ZodString;
|
|
4928
4944
|
}, z.core.$strip>>;
|
|
4945
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4929
4946
|
}, z.core.$strip>, z.ZodObject<{
|
|
4930
4947
|
id: z.ZodString;
|
|
4931
4948
|
createdAt: z.ZodNumber;
|
|
@@ -5271,6 +5288,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
5271
5288
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
5272
5289
|
itemId: z.ZodString;
|
|
5273
5290
|
}, z.core.$strip>>;
|
|
5291
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5274
5292
|
}, z.core.$strip>, z.ZodObject<{
|
|
5275
5293
|
id: z.ZodString;
|
|
5276
5294
|
createdAt: z.ZodNumber;
|
|
@@ -5615,6 +5633,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
5615
5633
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
5616
5634
|
itemId: z.ZodString;
|
|
5617
5635
|
}, z.core.$strip>>;
|
|
5636
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5618
5637
|
}, z.core.$strip>, z.ZodObject<{
|
|
5619
5638
|
id: z.ZodString;
|
|
5620
5639
|
createdAt: z.ZodNumber;
|
|
@@ -6059,6 +6078,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
6059
6078
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
6060
6079
|
itemId: z.ZodString;
|
|
6061
6080
|
}, z.core.$strip>>;
|
|
6081
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6062
6082
|
}, z.core.$strip>>>;
|
|
6063
6083
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
6064
6084
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -6225,6 +6245,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
6225
6245
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
6226
6246
|
itemId: z.ZodString;
|
|
6227
6247
|
}, z.core.$strip>>;
|
|
6248
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6228
6249
|
}, z.core.$strip>>>;
|
|
6229
6250
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
6230
6251
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -6355,6 +6376,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
6355
6376
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
6356
6377
|
itemId: z.ZodString;
|
|
6357
6378
|
}, z.core.$strip>>;
|
|
6379
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6358
6380
|
}, z.core.$strip>, z.ZodObject<{
|
|
6359
6381
|
id: z.ZodString;
|
|
6360
6382
|
createdAt: z.ZodNumber;
|
|
@@ -6748,6 +6770,7 @@ export declare const ChatSendPayloadSchema: z.ZodObject<{
|
|
|
6748
6770
|
mime: z.ZodString;
|
|
6749
6771
|
data: z.ZodString;
|
|
6750
6772
|
}, z.core.$strip>>>;
|
|
6773
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6751
6774
|
}, z.core.$strip>;
|
|
6752
6775
|
export type ChatSendPayload = z.infer<typeof ChatSendPayloadSchema>;
|
|
6753
6776
|
export declare const ChatSendResultSchema: z.ZodObject<{
|
|
@@ -6821,6 +6844,7 @@ export declare const ChatUnqueueResultSchema: z.ZodObject<{
|
|
|
6821
6844
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
6822
6845
|
itemId: z.ZodString;
|
|
6823
6846
|
}, z.core.$strip>>;
|
|
6847
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6824
6848
|
}, z.core.$strip>>;
|
|
6825
6849
|
}, z.core.$strip>;
|
|
6826
6850
|
export type ChatUnqueueResult = z.infer<typeof ChatUnqueueResultSchema>;
|
|
@@ -6958,6 +6982,7 @@ export declare const ChatForkResultSchema: z.ZodObject<{
|
|
|
6958
6982
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
6959
6983
|
itemId: z.ZodString;
|
|
6960
6984
|
}, z.core.$strip>>;
|
|
6985
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6961
6986
|
}, z.core.$strip>>>;
|
|
6962
6987
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
6963
6988
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -7155,6 +7180,7 @@ export declare const ChatContinueOnResultSchema: z.ZodObject<{
|
|
|
7155
7180
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
7156
7181
|
itemId: z.ZodString;
|
|
7157
7182
|
}, z.core.$strip>>;
|
|
7183
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7158
7184
|
}, z.core.$strip>>>;
|
|
7159
7185
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
7160
7186
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -7366,6 +7392,7 @@ export declare const ChatListResultSchema: z.ZodObject<{
|
|
|
7366
7392
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
7367
7393
|
itemId: z.ZodString;
|
|
7368
7394
|
}, z.core.$strip>>;
|
|
7395
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7369
7396
|
}, z.core.$strip>>>;
|
|
7370
7397
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
7371
7398
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
package/dist/chat.js
CHANGED
|
@@ -121,7 +121,8 @@ export const ChatQueuedMessageSchema = z.object({
|
|
|
121
121
|
attachments: z.array(ChatAttachmentSchema).optional(),
|
|
122
122
|
createdAt: z.number(),
|
|
123
123
|
uiChoice: ChatUiChoiceOriginSchema.optional(),
|
|
124
|
-
quoteSource: ChatQuoteSourceSchema.optional()
|
|
124
|
+
quoteSource: ChatQuoteSourceSchema.optional(),
|
|
125
|
+
references: z.array(z.string()).optional()
|
|
125
126
|
});
|
|
126
127
|
// A command or a monitor the CLI keeps running beside its turns, until it ends or its process does.
|
|
127
128
|
export const ChatBackgroundTaskSchema = z.object({
|
|
@@ -288,7 +289,9 @@ export const ChatUserItemSchema = z.object({
|
|
|
288
289
|
attachments: z.array(ChatAttachmentSchema).optional(),
|
|
289
290
|
uiChoice: ChatUiChoiceOriginSchema.optional(),
|
|
290
291
|
// The reply the quote at the head of the text was taken from; absent when it names none or the reply is gone.
|
|
291
|
-
quoteSource: ChatQuoteSourceSchema.optional()
|
|
292
|
+
quoteSource: ChatQuoteSourceSchema.optional(),
|
|
293
|
+
// Views and nodes the person picked with `#`, by id; like `chats`, the agent reads them itself.
|
|
294
|
+
references: z.array(z.string()).optional()
|
|
292
295
|
});
|
|
293
296
|
// `state` is a frozen set: native clients validate these payloads whole, so a new state would fail them.
|
|
294
297
|
export const ChatUiQueryReadingSchema = z.object({
|
|
@@ -790,7 +793,8 @@ export const ChatSendPayloadSchema = z
|
|
|
790
793
|
skills: z.array(z.string().min(1)).max(16).optional(),
|
|
791
794
|
chats: z.array(ChatIdSchema).max(16).optional(),
|
|
792
795
|
quoteSource: ChatQuoteSourceSchema.optional(),
|
|
793
|
-
attachments: ChatAttachmentUploadsSchema.optional()
|
|
796
|
+
attachments: ChatAttachmentUploadsSchema.optional(),
|
|
797
|
+
references: z.array(z.string().min(1)).max(16).optional()
|
|
794
798
|
})
|
|
795
799
|
.refine((payload) => payload.text.trim() !== '' || (payload.attachments?.length ?? 0) > 0, { message: 'A message needs text or an attachment' });
|
|
796
800
|
// Daemons before completion follow-ups omit `turnId`; keeping it optional lets newer clients finish the send.
|
package/dist/protocol.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
85
85
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
86
86
|
itemId: z.ZodString;
|
|
87
87
|
}, z.core.$strip>>;
|
|
88
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
89
|
}, z.core.$strip>>>;
|
|
89
90
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
90
91
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -223,6 +224,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
223
224
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
224
225
|
itemId: z.ZodString;
|
|
225
226
|
}, z.core.$strip>>;
|
|
227
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
226
228
|
}, z.core.$strip>, z.ZodObject<{
|
|
227
229
|
id: z.ZodString;
|
|
228
230
|
createdAt: z.ZodNumber;
|
|
@@ -611,6 +613,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
611
613
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
612
614
|
itemId: z.ZodString;
|
|
613
615
|
}, z.core.$strip>>;
|
|
616
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
614
617
|
}, z.core.$strip>>>;
|
|
615
618
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
616
619
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -741,6 +744,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
741
744
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
742
745
|
itemId: z.ZodString;
|
|
743
746
|
}, z.core.$strip>>;
|
|
747
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
744
748
|
}, z.core.$strip>, z.ZodObject<{
|
|
745
749
|
id: z.ZodString;
|
|
746
750
|
createdAt: z.ZodNumber;
|
|
@@ -1086,6 +1090,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
1086
1090
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
1087
1091
|
itemId: z.ZodString;
|
|
1088
1092
|
}, z.core.$strip>>;
|
|
1093
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1089
1094
|
}, z.core.$strip>, z.ZodObject<{
|
|
1090
1095
|
id: z.ZodString;
|
|
1091
1096
|
createdAt: z.ZodNumber;
|
|
@@ -1430,6 +1435,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
1430
1435
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
1431
1436
|
itemId: z.ZodString;
|
|
1432
1437
|
}, z.core.$strip>>;
|
|
1438
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1433
1439
|
}, z.core.$strip>, z.ZodObject<{
|
|
1434
1440
|
id: z.ZodString;
|
|
1435
1441
|
createdAt: z.ZodNumber;
|
|
@@ -1874,6 +1880,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
1874
1880
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
1875
1881
|
itemId: z.ZodString;
|
|
1876
1882
|
}, z.core.$strip>>;
|
|
1883
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1877
1884
|
}, z.core.$strip>>>;
|
|
1878
1885
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
1879
1886
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -2040,6 +2047,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
2040
2047
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
2041
2048
|
itemId: z.ZodString;
|
|
2042
2049
|
}, z.core.$strip>>;
|
|
2050
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2043
2051
|
}, z.core.$strip>>>;
|
|
2044
2052
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
2045
2053
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -2170,6 +2178,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
2170
2178
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
2171
2179
|
itemId: z.ZodString;
|
|
2172
2180
|
}, z.core.$strip>>;
|
|
2181
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2173
2182
|
}, z.core.$strip>, z.ZodObject<{
|
|
2174
2183
|
id: z.ZodString;
|
|
2175
2184
|
createdAt: z.ZodNumber;
|
|
@@ -2565,6 +2574,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
2565
2574
|
mime: z.ZodString;
|
|
2566
2575
|
data: z.ZodString;
|
|
2567
2576
|
}, z.core.$strip>>>;
|
|
2577
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2568
2578
|
}, z.core.$strip>;
|
|
2569
2579
|
readonly result: z.ZodObject<{
|
|
2570
2580
|
queued: z.ZodBoolean;
|
|
@@ -2685,6 +2695,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
2685
2695
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
2686
2696
|
itemId: z.ZodString;
|
|
2687
2697
|
}, z.core.$strip>>;
|
|
2698
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2688
2699
|
}, z.core.$strip>>;
|
|
2689
2700
|
}, z.core.$strip>;
|
|
2690
2701
|
};
|
|
@@ -2812,6 +2823,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
2812
2823
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
2813
2824
|
itemId: z.ZodString;
|
|
2814
2825
|
}, z.core.$strip>>;
|
|
2826
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2815
2827
|
}, z.core.$strip>>>;
|
|
2816
2828
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
2817
2829
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -3058,6 +3070,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
3058
3070
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
3059
3071
|
itemId: z.ZodString;
|
|
3060
3072
|
}, z.core.$strip>>;
|
|
3073
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3061
3074
|
}, z.core.$strip>>>;
|
|
3062
3075
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
3063
3076
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -3255,6 +3268,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
3255
3268
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
3256
3269
|
itemId: z.ZodString;
|
|
3257
3270
|
}, z.core.$strip>>;
|
|
3271
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3258
3272
|
}, z.core.$strip>>>;
|
|
3259
3273
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
3260
3274
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -3440,6 +3454,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
3440
3454
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
3441
3455
|
itemId: z.ZodString;
|
|
3442
3456
|
}, z.core.$strip>>;
|
|
3457
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3443
3458
|
}, z.core.$strip>, z.ZodObject<{
|
|
3444
3459
|
id: z.ZodString;
|
|
3445
3460
|
createdAt: z.ZodNumber;
|
|
@@ -4552,6 +4567,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
4552
4567
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
4553
4568
|
itemId: z.ZodString;
|
|
4554
4569
|
}, z.core.$strip>>;
|
|
4570
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4555
4571
|
}, z.core.$strip>>>;
|
|
4556
4572
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
4557
4573
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -4690,6 +4706,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
|
|
|
4690
4706
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
4691
4707
|
itemId: z.ZodString;
|
|
4692
4708
|
}, z.core.$strip>>;
|
|
4709
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4693
4710
|
}, z.core.$strip>, z.ZodObject<{
|
|
4694
4711
|
id: z.ZodString;
|
|
4695
4712
|
createdAt: z.ZodNumber;
|
|
@@ -5134,6 +5151,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
|
|
|
5134
5151
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
5135
5152
|
itemId: z.ZodString;
|
|
5136
5153
|
}, z.core.$strip>>;
|
|
5154
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5137
5155
|
}, z.core.$strip>>>;
|
|
5138
5156
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
5139
5157
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -5300,6 +5318,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
|
|
|
5300
5318
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
5301
5319
|
itemId: z.ZodString;
|
|
5302
5320
|
}, z.core.$strip>>;
|
|
5321
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5303
5322
|
}, z.core.$strip>>>;
|
|
5304
5323
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
5305
5324
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -5430,6 +5449,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
|
|
|
5430
5449
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
5431
5450
|
itemId: z.ZodString;
|
|
5432
5451
|
}, z.core.$strip>>;
|
|
5452
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5433
5453
|
}, z.core.$strip>, z.ZodObject<{
|
|
5434
5454
|
id: z.ZodString;
|
|
5435
5455
|
createdAt: z.ZodNumber;
|
|
@@ -5810,6 +5830,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
|
|
|
5810
5830
|
quoteSource: z.ZodOptional<z.ZodObject<{
|
|
5811
5831
|
itemId: z.ZodString;
|
|
5812
5832
|
}, z.core.$strip>>;
|
|
5833
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5813
5834
|
}, z.core.$strip>>>;
|
|
5814
5835
|
queuePaused: z.ZodOptional<z.ZodBoolean>;
|
|
5815
5836
|
background: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/agent-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Schemas and port contracts for agent chats, provider accounts, models and usage.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"test": "bun --conditions=source test"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@adecore/intelligent-ui": "0.
|
|
89
|
+
"@adecore/intelligent-ui": "0.38.0",
|
|
90
90
|
"zod": "^4.6.5"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
package/src/chat.ts
CHANGED
|
@@ -145,7 +145,8 @@ export const ChatQueuedMessageSchema = z.object({
|
|
|
145
145
|
attachments: z.array(ChatAttachmentSchema).optional(),
|
|
146
146
|
createdAt: z.number(),
|
|
147
147
|
uiChoice: ChatUiChoiceOriginSchema.optional(),
|
|
148
|
-
quoteSource: ChatQuoteSourceSchema.optional()
|
|
148
|
+
quoteSource: ChatQuoteSourceSchema.optional(),
|
|
149
|
+
references: z.array(z.string()).optional()
|
|
149
150
|
});
|
|
150
151
|
export type ChatQueuedMessage = z.infer<typeof ChatQueuedMessageSchema>;
|
|
151
152
|
|
|
@@ -342,7 +343,9 @@ export const ChatUserItemSchema = z.object({
|
|
|
342
343
|
attachments: z.array(ChatAttachmentSchema).optional(),
|
|
343
344
|
uiChoice: ChatUiChoiceOriginSchema.optional(),
|
|
344
345
|
// The reply the quote at the head of the text was taken from; absent when it names none or the reply is gone.
|
|
345
|
-
quoteSource: ChatQuoteSourceSchema.optional()
|
|
346
|
+
quoteSource: ChatQuoteSourceSchema.optional(),
|
|
347
|
+
// Views and nodes the person picked with `#`, by id; like `chats`, the agent reads them itself.
|
|
348
|
+
references: z.array(z.string()).optional()
|
|
346
349
|
});
|
|
347
350
|
|
|
348
351
|
// `state` is a frozen set: native clients validate these payloads whole, so a new state would fail them.
|
|
@@ -979,7 +982,8 @@ export const ChatSendPayloadSchema = z
|
|
|
979
982
|
skills: z.array(z.string().min(1)).max(16).optional(),
|
|
980
983
|
chats: z.array(ChatIdSchema).max(16).optional(),
|
|
981
984
|
quoteSource: ChatQuoteSourceSchema.optional(),
|
|
982
|
-
attachments: ChatAttachmentUploadsSchema.optional()
|
|
985
|
+
attachments: ChatAttachmentUploadsSchema.optional(),
|
|
986
|
+
references: z.array(z.string().min(1)).max(16).optional()
|
|
983
987
|
})
|
|
984
988
|
.refine((payload) => payload.text.trim() !== '' || (payload.attachments?.length ?? 0) > 0, { message: 'A message needs text or an attachment' });
|
|
985
989
|
export type ChatSendPayload = z.infer<typeof ChatSendPayloadSchema>;
|