@adecore/agent-contracts 0.24.2 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat.d.ts +214 -0
- package/dist/chat.js +22 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/protocol.d.ts +120 -0
- package/package.json +2 -2
- package/src/chat.ts +26 -1
- package/src/index.ts +4 -0
package/dist/chat.d.ts
CHANGED
|
@@ -517,6 +517,19 @@ export declare const ChatUiLinkReadingSchema: z.ZodObject<{
|
|
|
517
517
|
reason: z.ZodOptional<z.ZodString>;
|
|
518
518
|
}, z.core.$strip>;
|
|
519
519
|
export type ChatUiLinkReading = z.infer<typeof ChatUiLinkReadingSchema>;
|
|
520
|
+
export declare const ChatUiPlaceReadingSchema: z.ZodObject<{
|
|
521
|
+
state: z.ZodEnum<{
|
|
522
|
+
found: "found";
|
|
523
|
+
missing: "missing";
|
|
524
|
+
}>;
|
|
525
|
+
address: z.ZodString;
|
|
526
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
527
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
528
|
+
label: z.ZodOptional<z.ZodString>;
|
|
529
|
+
code: z.ZodOptional<z.ZodString>;
|
|
530
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
531
|
+
}, z.core.$strip>;
|
|
532
|
+
export type ChatUiPlaceReading = z.infer<typeof ChatUiPlaceReadingSchema>;
|
|
520
533
|
export declare const ChatUiQueryStateSchema: z.ZodObject<{
|
|
521
534
|
authorChatId: z.ZodString;
|
|
522
535
|
blocks: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -563,6 +576,18 @@ export declare const ChatUiQueryStateSchema: z.ZodObject<{
|
|
|
563
576
|
code: z.ZodOptional<z.ZodString>;
|
|
564
577
|
reason: z.ZodOptional<z.ZodString>;
|
|
565
578
|
}, z.core.$strip>>>;
|
|
579
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
580
|
+
state: z.ZodEnum<{
|
|
581
|
+
found: "found";
|
|
582
|
+
missing: "missing";
|
|
583
|
+
}>;
|
|
584
|
+
address: z.ZodString;
|
|
585
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
586
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
587
|
+
label: z.ZodOptional<z.ZodString>;
|
|
588
|
+
code: z.ZodOptional<z.ZodString>;
|
|
589
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
590
|
+
}, z.core.$strip>>>;
|
|
566
591
|
}, z.core.$strip>>;
|
|
567
592
|
}, z.core.$strip>;
|
|
568
593
|
export type ChatUiQueryState = z.infer<typeof ChatUiQueryStateSchema>;
|
|
@@ -631,6 +656,18 @@ export declare const ChatAssistantItemSchema: z.ZodObject<{
|
|
|
631
656
|
code: z.ZodOptional<z.ZodString>;
|
|
632
657
|
reason: z.ZodOptional<z.ZodString>;
|
|
633
658
|
}, z.core.$strip>>>;
|
|
659
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
660
|
+
state: z.ZodEnum<{
|
|
661
|
+
found: "found";
|
|
662
|
+
missing: "missing";
|
|
663
|
+
}>;
|
|
664
|
+
address: z.ZodString;
|
|
665
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
666
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
667
|
+
label: z.ZodOptional<z.ZodString>;
|
|
668
|
+
code: z.ZodOptional<z.ZodString>;
|
|
669
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
670
|
+
}, z.core.$strip>>>;
|
|
634
671
|
}, z.core.$strip>>;
|
|
635
672
|
}, z.core.$strip>>;
|
|
636
673
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -982,6 +1019,15 @@ export declare function abortedByMachine(turn: {
|
|
|
982
1019
|
level?: string;
|
|
983
1020
|
text?: string;
|
|
984
1021
|
}[]): boolean;
|
|
1022
|
+
export declare const ENDED_NOTE_PREFIX = "ended-";
|
|
1023
|
+
export declare function abortedByEnd(turn: {
|
|
1024
|
+
id: string;
|
|
1025
|
+
state: string;
|
|
1026
|
+
}, items: readonly {
|
|
1027
|
+
id: string;
|
|
1028
|
+
kind: string;
|
|
1029
|
+
turnId: string | null;
|
|
1030
|
+
}[]): boolean;
|
|
985
1031
|
export declare const WAITING_NOTE_PREFIX = "waiting-";
|
|
986
1032
|
export declare const ChatNoteItemSchema: z.ZodObject<{
|
|
987
1033
|
id: z.ZodString;
|
|
@@ -1100,6 +1146,18 @@ export declare const ChatItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1100
1146
|
code: z.ZodOptional<z.ZodString>;
|
|
1101
1147
|
reason: z.ZodOptional<z.ZodString>;
|
|
1102
1148
|
}, z.core.$strip>>>;
|
|
1149
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1150
|
+
state: z.ZodEnum<{
|
|
1151
|
+
found: "found";
|
|
1152
|
+
missing: "missing";
|
|
1153
|
+
}>;
|
|
1154
|
+
address: z.ZodString;
|
|
1155
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
1156
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
1157
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1158
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1159
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1160
|
+
}, z.core.$strip>>>;
|
|
1103
1161
|
}, z.core.$strip>>;
|
|
1104
1162
|
}, z.core.$strip>>;
|
|
1105
1163
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -1438,6 +1496,18 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1438
1496
|
code: z.ZodOptional<z.ZodString>;
|
|
1439
1497
|
reason: z.ZodOptional<z.ZodString>;
|
|
1440
1498
|
}, z.core.$strip>>>;
|
|
1499
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1500
|
+
state: z.ZodEnum<{
|
|
1501
|
+
found: "found";
|
|
1502
|
+
missing: "missing";
|
|
1503
|
+
}>;
|
|
1504
|
+
address: z.ZodString;
|
|
1505
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
1506
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
1507
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1508
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1509
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1510
|
+
}, z.core.$strip>>>;
|
|
1441
1511
|
}, z.core.$strip>>;
|
|
1442
1512
|
}, z.core.$strip>>;
|
|
1443
1513
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -1718,6 +1788,18 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1718
1788
|
code: z.ZodOptional<z.ZodString>;
|
|
1719
1789
|
reason: z.ZodOptional<z.ZodString>;
|
|
1720
1790
|
}, z.core.$strip>>>;
|
|
1791
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1792
|
+
state: z.ZodEnum<{
|
|
1793
|
+
found: "found";
|
|
1794
|
+
missing: "missing";
|
|
1795
|
+
}>;
|
|
1796
|
+
address: z.ZodString;
|
|
1797
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
1798
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
1799
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1800
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1801
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1802
|
+
}, z.core.$strip>>>;
|
|
1721
1803
|
}, z.core.$strip>>;
|
|
1722
1804
|
}, z.core.$strip>>;
|
|
1723
1805
|
textLength: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2158,6 +2240,18 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2158
2240
|
code: z.ZodOptional<z.ZodString>;
|
|
2159
2241
|
reason: z.ZodOptional<z.ZodString>;
|
|
2160
2242
|
}, z.core.$strip>>>;
|
|
2243
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2244
|
+
state: z.ZodEnum<{
|
|
2245
|
+
found: "found";
|
|
2246
|
+
missing: "missing";
|
|
2247
|
+
}>;
|
|
2248
|
+
address: z.ZodString;
|
|
2249
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
2250
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
2251
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2252
|
+
code: z.ZodOptional<z.ZodString>;
|
|
2253
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
2254
|
+
}, z.core.$strip>>>;
|
|
2161
2255
|
}, z.core.$strip>>;
|
|
2162
2256
|
}, z.core.$strip>>;
|
|
2163
2257
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -2489,6 +2583,18 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
|
|
|
2489
2583
|
code: z.ZodOptional<z.ZodString>;
|
|
2490
2584
|
reason: z.ZodOptional<z.ZodString>;
|
|
2491
2585
|
}, z.core.$strip>>>;
|
|
2586
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2587
|
+
state: z.ZodEnum<{
|
|
2588
|
+
found: "found";
|
|
2589
|
+
missing: "missing";
|
|
2590
|
+
}>;
|
|
2591
|
+
address: z.ZodString;
|
|
2592
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
2593
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
2594
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2595
|
+
code: z.ZodOptional<z.ZodString>;
|
|
2596
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
2597
|
+
}, z.core.$strip>>>;
|
|
2492
2598
|
}, z.core.$strip>>;
|
|
2493
2599
|
}, z.core.$strip>>;
|
|
2494
2600
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -2769,6 +2875,18 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
|
|
|
2769
2875
|
code: z.ZodOptional<z.ZodString>;
|
|
2770
2876
|
reason: z.ZodOptional<z.ZodString>;
|
|
2771
2877
|
}, z.core.$strip>>>;
|
|
2878
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2879
|
+
state: z.ZodEnum<{
|
|
2880
|
+
found: "found";
|
|
2881
|
+
missing: "missing";
|
|
2882
|
+
}>;
|
|
2883
|
+
address: z.ZodString;
|
|
2884
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
2885
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
2886
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2887
|
+
code: z.ZodOptional<z.ZodString>;
|
|
2888
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
2889
|
+
}, z.core.$strip>>>;
|
|
2772
2890
|
}, z.core.$strip>>;
|
|
2773
2891
|
}, z.core.$strip>>;
|
|
2774
2892
|
textLength: z.ZodOptional<z.ZodNumber>;
|
|
@@ -3209,6 +3327,18 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
|
|
|
3209
3327
|
code: z.ZodOptional<z.ZodString>;
|
|
3210
3328
|
reason: z.ZodOptional<z.ZodString>;
|
|
3211
3329
|
}, z.core.$strip>>>;
|
|
3330
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3331
|
+
state: z.ZodEnum<{
|
|
3332
|
+
found: "found";
|
|
3333
|
+
missing: "missing";
|
|
3334
|
+
}>;
|
|
3335
|
+
address: z.ZodString;
|
|
3336
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
3337
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
3338
|
+
label: z.ZodOptional<z.ZodString>;
|
|
3339
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3340
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
3341
|
+
}, z.core.$strip>>>;
|
|
3212
3342
|
}, z.core.$strip>>;
|
|
3213
3343
|
}, z.core.$strip>>;
|
|
3214
3344
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -3640,6 +3770,18 @@ export declare const ChatHistoryResultSchema: z.ZodObject<{
|
|
|
3640
3770
|
code: z.ZodOptional<z.ZodString>;
|
|
3641
3771
|
reason: z.ZodOptional<z.ZodString>;
|
|
3642
3772
|
}, z.core.$strip>>>;
|
|
3773
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3774
|
+
state: z.ZodEnum<{
|
|
3775
|
+
found: "found";
|
|
3776
|
+
missing: "missing";
|
|
3777
|
+
}>;
|
|
3778
|
+
address: z.ZodString;
|
|
3779
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
3780
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
3781
|
+
label: z.ZodOptional<z.ZodString>;
|
|
3782
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3783
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
3784
|
+
}, z.core.$strip>>>;
|
|
3643
3785
|
}, z.core.$strip>>;
|
|
3644
3786
|
}, z.core.$strip>>;
|
|
3645
3787
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -4014,6 +4156,18 @@ export declare const ChatSubagentResultSchema: z.ZodObject<{
|
|
|
4014
4156
|
code: z.ZodOptional<z.ZodString>;
|
|
4015
4157
|
reason: z.ZodOptional<z.ZodString>;
|
|
4016
4158
|
}, z.core.$strip>>>;
|
|
4159
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4160
|
+
state: z.ZodEnum<{
|
|
4161
|
+
found: "found";
|
|
4162
|
+
missing: "missing";
|
|
4163
|
+
}>;
|
|
4164
|
+
address: z.ZodString;
|
|
4165
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
4166
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
4167
|
+
label: z.ZodOptional<z.ZodString>;
|
|
4168
|
+
code: z.ZodOptional<z.ZodString>;
|
|
4169
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
4170
|
+
}, z.core.$strip>>>;
|
|
4017
4171
|
}, z.core.$strip>>;
|
|
4018
4172
|
}, z.core.$strip>>;
|
|
4019
4173
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -4846,6 +5000,18 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
4846
5000
|
code: z.ZodOptional<z.ZodString>;
|
|
4847
5001
|
reason: z.ZodOptional<z.ZodString>;
|
|
4848
5002
|
}, z.core.$strip>>>;
|
|
5003
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5004
|
+
state: z.ZodEnum<{
|
|
5005
|
+
found: "found";
|
|
5006
|
+
missing: "missing";
|
|
5007
|
+
}>;
|
|
5008
|
+
address: z.ZodString;
|
|
5009
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
5010
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
5011
|
+
label: z.ZodOptional<z.ZodString>;
|
|
5012
|
+
code: z.ZodOptional<z.ZodString>;
|
|
5013
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
5014
|
+
}, z.core.$strip>>>;
|
|
4849
5015
|
}, z.core.$strip>>;
|
|
4850
5016
|
}, z.core.$strip>>;
|
|
4851
5017
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -5175,6 +5341,18 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
5175
5341
|
code: z.ZodOptional<z.ZodString>;
|
|
5176
5342
|
reason: z.ZodOptional<z.ZodString>;
|
|
5177
5343
|
}, z.core.$strip>>>;
|
|
5344
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5345
|
+
state: z.ZodEnum<{
|
|
5346
|
+
found: "found";
|
|
5347
|
+
missing: "missing";
|
|
5348
|
+
}>;
|
|
5349
|
+
address: z.ZodString;
|
|
5350
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
5351
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
5352
|
+
label: z.ZodOptional<z.ZodString>;
|
|
5353
|
+
code: z.ZodOptional<z.ZodString>;
|
|
5354
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
5355
|
+
}, z.core.$strip>>>;
|
|
5178
5356
|
}, z.core.$strip>>;
|
|
5179
5357
|
}, z.core.$strip>>;
|
|
5180
5358
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -5503,6 +5681,18 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
5503
5681
|
code: z.ZodOptional<z.ZodString>;
|
|
5504
5682
|
reason: z.ZodOptional<z.ZodString>;
|
|
5505
5683
|
}, z.core.$strip>>>;
|
|
5684
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5685
|
+
state: z.ZodEnum<{
|
|
5686
|
+
found: "found";
|
|
5687
|
+
missing: "missing";
|
|
5688
|
+
}>;
|
|
5689
|
+
address: z.ZodString;
|
|
5690
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
5691
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
5692
|
+
label: z.ZodOptional<z.ZodString>;
|
|
5693
|
+
code: z.ZodOptional<z.ZodString>;
|
|
5694
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
5695
|
+
}, z.core.$strip>>>;
|
|
5506
5696
|
}, z.core.$strip>>;
|
|
5507
5697
|
}, z.core.$strip>>;
|
|
5508
5698
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -5783,6 +5973,18 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
5783
5973
|
code: z.ZodOptional<z.ZodString>;
|
|
5784
5974
|
reason: z.ZodOptional<z.ZodString>;
|
|
5785
5975
|
}, z.core.$strip>>>;
|
|
5976
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5977
|
+
state: z.ZodEnum<{
|
|
5978
|
+
found: "found";
|
|
5979
|
+
missing: "missing";
|
|
5980
|
+
}>;
|
|
5981
|
+
address: z.ZodString;
|
|
5982
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
5983
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
5984
|
+
label: z.ZodOptional<z.ZodString>;
|
|
5985
|
+
code: z.ZodOptional<z.ZodString>;
|
|
5986
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
5987
|
+
}, z.core.$strip>>>;
|
|
5786
5988
|
}, z.core.$strip>>;
|
|
5787
5989
|
}, z.core.$strip>>;
|
|
5788
5990
|
textLength: z.ZodOptional<z.ZodNumber>;
|
|
@@ -6223,6 +6425,18 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
6223
6425
|
code: z.ZodOptional<z.ZodString>;
|
|
6224
6426
|
reason: z.ZodOptional<z.ZodString>;
|
|
6225
6427
|
}, z.core.$strip>>>;
|
|
6428
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
6429
|
+
state: z.ZodEnum<{
|
|
6430
|
+
found: "found";
|
|
6431
|
+
missing: "missing";
|
|
6432
|
+
}>;
|
|
6433
|
+
address: z.ZodString;
|
|
6434
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
6435
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
6436
|
+
label: z.ZodOptional<z.ZodString>;
|
|
6437
|
+
code: z.ZodOptional<z.ZodString>;
|
|
6438
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
6439
|
+
}, z.core.$strip>>>;
|
|
6226
6440
|
}, z.core.$strip>>;
|
|
6227
6441
|
}, z.core.$strip>>;
|
|
6228
6442
|
phase: z.ZodOptional<z.ZodString>;
|
package/dist/chat.js
CHANGED
|
@@ -297,6 +297,19 @@ export const ChatUiQueryReadingSchema = z.object({
|
|
|
297
297
|
reason: z.string().optional()
|
|
298
298
|
});
|
|
299
299
|
export const ChatUiLinkReadingSchema = UiLinkResolutionSchema;
|
|
300
|
+
// `state` is a frozen set, like a link's: native clients validate these payloads whole.
|
|
301
|
+
export const ChatUiPlaceReadingSchema = z.object({
|
|
302
|
+
state: z.enum(['found', 'missing']),
|
|
303
|
+
// The address as it was looked up (trimmed), which a reader compares with the address a node has now: a node id alone moves with a reordered Each.
|
|
304
|
+
address: z.string(),
|
|
305
|
+
lat: z.number().min(-90).max(90).optional(),
|
|
306
|
+
lon: z.number().min(-180).max(180).optional(),
|
|
307
|
+
// What the host called the point it found, such as the street and town.
|
|
308
|
+
label: z.string().optional(),
|
|
309
|
+
// A code that names the reason across versions; open, so a new one fails nobody.
|
|
310
|
+
code: z.string().optional(),
|
|
311
|
+
reason: z.string().optional()
|
|
312
|
+
});
|
|
300
313
|
// The writer's captured access stays on the daemon; a record from before that still parses and drops it.
|
|
301
314
|
export const ChatUiQueryStateSchema = z.object({
|
|
302
315
|
authorChatId: z.string(),
|
|
@@ -304,7 +317,9 @@ export const ChatUiQueryStateSchema = z.object({
|
|
|
304
317
|
revision: z.string(),
|
|
305
318
|
readings: z.record(z.string(), ChatUiQueryReadingSchema),
|
|
306
319
|
fallback: z.string(),
|
|
307
|
-
links: z.record(z.string(), ChatUiLinkReadingSchema).optional()
|
|
320
|
+
links: z.record(z.string(), ChatUiLinkReadingSchema).optional(),
|
|
321
|
+
// The points looked up for the places of a block that named an address, by node id.
|
|
322
|
+
places: z.record(z.string(), ChatUiPlaceReadingSchema).optional()
|
|
308
323
|
}))
|
|
309
324
|
});
|
|
310
325
|
export const ChatAssistantItemSchema = z.object({
|
|
@@ -532,6 +547,12 @@ export function abortedByMachine(turn, items) {
|
|
|
532
547
|
return (turn.state === 'aborted' &&
|
|
533
548
|
items.some((item) => item.kind === 'note' && item.turnId === turn.id && item.level === 'warning' && item.text?.startsWith(NOT_RESUMED_PREFIX) === true));
|
|
534
549
|
}
|
|
550
|
+
/* The id prefix of the note a host leaves in a turn it ended because the agent that opened the chat was stopped. */
|
|
551
|
+
export const ENDED_NOTE_PREFIX = 'ended-';
|
|
552
|
+
/* Whether the host ended this aborted turn along with its chat, which no person stopped and a person did not ask to be sent on. */
|
|
553
|
+
export function abortedByEnd(turn, items) {
|
|
554
|
+
return turn.state === 'aborted' && items.some((item) => item.kind === 'note' && item.turnId === turn.id && item.id.startsWith(ENDED_NOTE_PREFIX));
|
|
555
|
+
}
|
|
535
556
|
/* The id prefix of the note a host leaves in a parent about a child that waits on a request. */
|
|
536
557
|
export const WAITING_NOTE_PREFIX = 'waiting-';
|
|
537
558
|
export const ChatNoteItemSchema = z.object({
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AgentKindSchema, type AgentKind, AgentStatusSchema, type AgentStatus, SUGGESTED_TITLE_LIMIT, SuggestedTitleSchema, AgentRequestSchema, type AgentRequest, AgentInfoSchema, type AgentInfo, SessionStatusEventSchema, type SessionStatusEvent, AgentResumePayloadSchema, type AgentResumePayload, ApprovalChoiceSchema, type ApprovalChoice, ApprovalRequestSchema, type ApprovalRequest, SessionApprovalsEventSchema, type SessionApprovalsEvent, ApprovalAnswerPayloadSchema, type ApprovalAnswerPayload, ApprovalAnswerResultSchema, type ApprovalAnswerResult, ApprovalPreferencePayloadSchema, type ApprovalPreferencePayload } from './agent.ts';
|
|
2
|
-
export { ChatIdSchema, type ChatId, ChatContextBreakdownSchema, type ChatContextBreakdown, ChatUsageSchema, type ChatUsage, CHAT_ATTACHMENTS_MAX_BYTES, CHAT_ATTACHMENT_MAX_BYTES, CHAT_ATTACHMENTS_MAX_COUNT, attachmentBytes, attachmentImageMime, ChatAttachmentUploadSchema, type ChatAttachmentUpload, ChatAttachmentUploadsSchema, ChatAttachmentSchema, type ChatAttachment, ChatUiChoiceOriginSchema, type ChatUiChoiceOrigin, ChatUiAnswerSchema, type ChatUiAnswer, ChatQuoteSourceSchema, type ChatQuoteSource, ChatQueuedMessageSchema, type ChatQueuedMessage, ChatBackgroundTaskSchema, type ChatBackgroundTask, ChatTurnLimitSchema, type ChatTurnLimit, ChatGoalStatusSchema, type ChatGoalStatus, ChatGoalSchema, type ChatGoal, ChatQuestionSchema, type ChatQuestion, ChatRequestKindSchema, type ChatRequestKind, CHAT_REQUEST_LIMITS, ChatRequestApprovalSchema, type ChatRequestApproval, ChatRequestSummarySchema, type ChatRequestSummary, ChatInfoSchema, type ChatInfo, ChatSkillSourceSchema, type ChatSkillSource, ChatSkillSchema, type ChatSkill, SkillsListPayloadSchema, type SkillsListPayload, SkillsListResultSchema, type SkillsListResult, ChatUserItemSchema, ChatUiQueryReadingSchema, type ChatUiQueryReading, ChatUiLinkReadingSchema, type ChatUiLinkReading, ChatUiQueryStateSchema, type ChatUiQueryState, ChatAssistantItemSchema, ChatThinkingItemSchema, ChatToolStateSchema, type ChatToolState, ChatToolProgressSchema, type ChatToolProgress, ChatFileChangeSchema, type ChatFileChange, ChatSubagentStatusSchema, type ChatSubagentStatus, ChatWorkflowPhaseSchema, type ChatWorkflowPhase, ChatWorkflowAgentSchema, type ChatWorkflowAgent, ChatWorkflowSchema, type ChatWorkflow, workflowAgentRef, workflowAgentIdOf, ChatToolItemSchema, ChatSubagentUsageSchema, type ChatSubagentUsage, HOST_TASK_ORIGIN, ChatSubagentItemSchema, ChatApprovalDecisionSchema, type ChatApprovalDecision, ChatApprovalItemSchema, ChatQuestionItemSchema, ChatCheckpointFileSchema, type ChatCheckpointFile, ChatCheckpointDiffSchema, type ChatCheckpointDiff, ChatTurnItemSchema, notResumedNote, abortedByMachine, WAITING_NOTE_PREFIX, ChatNoteItemSchema, ChatCompactionItemSchema, ChatItemSchema, type ChatItem, type ChatUserItem, type ChatAssistantItem, type ChatThinkingItem, type ChatToolItem, type ChatSubagentItem, type ChatApprovalItem, type ChatQuestionItem, type ChatTurnItem, type ChatNoteItem, type ChatCompactionItem, ChatEventSchema, type ChatEvent, ChatEventEnvelopeSchema, type ChatEventEnvelope, ChatCreatePayloadSchema, type ChatCreatePayload, ChatConfigurePayloadSchema, type ChatConfigurePayload, ChatPreferencesPayloadSchema, type ChatPreferencesPayload, ChatTargetPayloadSchema, type ChatTargetPayload, ChatClearPayloadSchema, type ChatClearPayload, ChatCancelPayloadSchema, type ChatCancelPayload, ChatAttachPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryPageSchema, ChatHistoryResultSchema, type ChatHistoryResult, ChatSubagentPayloadSchema, type ChatSubagentPayload, ChatStopSubagentPayloadSchema, type ChatStopSubagentPayload, ChatGoalActionSchema, type ChatGoalAction, ChatGoalPayloadSchema, type ChatGoalPayload, ChatStopTaskPayloadSchema, type ChatStopTaskPayload, ChatSubagentPageSchema, ChatSubagentSourceSchema, type ChatSubagentSource, ChatSubagentResultSchema, type ChatSubagentResult, ChatStatusEventSchema, type ChatStatusEvent, ChatSubagentChangedEventSchema, type ChatSubagentChangedEvent, CHAT_BOOKMARK_LIMITS, ChatBookmarkSchema, type ChatBookmark, ChatBookmarksSchema, ChatAddBookmarkPayloadSchema, type ChatAddBookmarkPayload, ChatRenameBookmarkPayloadSchema, type ChatRenameBookmarkPayload, ChatRemoveBookmarkPayloadSchema, type ChatRemoveBookmarkPayload, ChatBookmarksResultSchema, type ChatBookmarksResult, ChatBookmarksEventSchema, type ChatBookmarksEvent, ChatRemoveVisualPayloadSchema, type ChatRemoveVisualPayload, ChatVisualsResultSchema, type ChatVisualsResult, ChatVisualsEventSchema, type ChatVisualsEvent, ChatAttachResultSchema, type ChatAttachResult, ChatDeliverySchema, type ChatDelivery, ChatSendPayloadSchema, type ChatSendPayload, ChatSendResultSchema, type ChatSendResult, ChatUiChoicePayloadSchema, type ChatUiChoicePayload, ChatUiQueryPayloadSchema, type ChatUiQueryPayload, ChatUiLinkPayloadSchema, type ChatUiLinkPayload, ChatQueuePayloadSchema, type ChatQueuePayload, ChatUnqueueResultSchema, type ChatUnqueueResult, ChatApprovePayloadSchema, type ChatApprovePayload, ChatDismissPayloadSchema, type ChatDismissPayload, ChatAnswerPayloadSchema, type ChatAnswerPayload, ChatTurnDiffPayloadSchema, type ChatTurnDiffPayload, ChatTurnDiffResultSchema, type ChatTurnDiffResult, CHAT_FORK_TITLE_MAX, ChatForkPayloadSchema, type ChatForkPayload, ChatForkResultSchema, type ChatForkResult, ChatContinueOnPayloadSchema, type ChatContinueOnPayload, ChatContinueOnResultSchema, type ChatContinueOnResult, ChatSummarizePayloadSchema, type ChatSummarizePayload, ChatSummarizeResultSchema, type ChatSummarizeResult, ChatForkInfoPayloadSchema, type ChatForkInfoPayload, ChatForkInfoResultSchema, type ChatForkInfoResult, ChatListResultSchema, type ChatListResult, GeneratedImageInputSchema, type GeneratedImageInput, generatedImageAttachment } from './chat.ts';
|
|
2
|
+
export { ChatIdSchema, type ChatId, ChatContextBreakdownSchema, type ChatContextBreakdown, ChatUsageSchema, type ChatUsage, CHAT_ATTACHMENTS_MAX_BYTES, CHAT_ATTACHMENT_MAX_BYTES, CHAT_ATTACHMENTS_MAX_COUNT, attachmentBytes, attachmentImageMime, ChatAttachmentUploadSchema, type ChatAttachmentUpload, ChatAttachmentUploadsSchema, ChatAttachmentSchema, type ChatAttachment, ChatUiChoiceOriginSchema, type ChatUiChoiceOrigin, ChatUiAnswerSchema, type ChatUiAnswer, ChatQuoteSourceSchema, type ChatQuoteSource, ChatQueuedMessageSchema, type ChatQueuedMessage, ChatBackgroundTaskSchema, type ChatBackgroundTask, ChatTurnLimitSchema, type ChatTurnLimit, ChatGoalStatusSchema, type ChatGoalStatus, ChatGoalSchema, type ChatGoal, ChatQuestionSchema, type ChatQuestion, ChatRequestKindSchema, type ChatRequestKind, CHAT_REQUEST_LIMITS, ChatRequestApprovalSchema, type ChatRequestApproval, ChatRequestSummarySchema, type ChatRequestSummary, ChatInfoSchema, type ChatInfo, ChatSkillSourceSchema, type ChatSkillSource, ChatSkillSchema, type ChatSkill, SkillsListPayloadSchema, type SkillsListPayload, SkillsListResultSchema, type SkillsListResult, ChatUserItemSchema, ChatUiQueryReadingSchema, type ChatUiQueryReading, ChatUiLinkReadingSchema, type ChatUiLinkReading, ChatUiPlaceReadingSchema, type ChatUiPlaceReading, ChatUiQueryStateSchema, type ChatUiQueryState, ChatAssistantItemSchema, ChatThinkingItemSchema, ChatToolStateSchema, type ChatToolState, ChatToolProgressSchema, type ChatToolProgress, ChatFileChangeSchema, type ChatFileChange, ChatSubagentStatusSchema, type ChatSubagentStatus, ChatWorkflowPhaseSchema, type ChatWorkflowPhase, ChatWorkflowAgentSchema, type ChatWorkflowAgent, ChatWorkflowSchema, type ChatWorkflow, workflowAgentRef, workflowAgentIdOf, ChatToolItemSchema, ChatSubagentUsageSchema, type ChatSubagentUsage, HOST_TASK_ORIGIN, ChatSubagentItemSchema, ChatApprovalDecisionSchema, type ChatApprovalDecision, ChatApprovalItemSchema, ChatQuestionItemSchema, ChatCheckpointFileSchema, type ChatCheckpointFile, ChatCheckpointDiffSchema, type ChatCheckpointDiff, ChatTurnItemSchema, notResumedNote, abortedByMachine, ENDED_NOTE_PREFIX, abortedByEnd, WAITING_NOTE_PREFIX, ChatNoteItemSchema, ChatCompactionItemSchema, ChatItemSchema, type ChatItem, type ChatUserItem, type ChatAssistantItem, type ChatThinkingItem, type ChatToolItem, type ChatSubagentItem, type ChatApprovalItem, type ChatQuestionItem, type ChatTurnItem, type ChatNoteItem, type ChatCompactionItem, ChatEventSchema, type ChatEvent, ChatEventEnvelopeSchema, type ChatEventEnvelope, ChatCreatePayloadSchema, type ChatCreatePayload, ChatConfigurePayloadSchema, type ChatConfigurePayload, ChatPreferencesPayloadSchema, type ChatPreferencesPayload, ChatTargetPayloadSchema, type ChatTargetPayload, ChatClearPayloadSchema, type ChatClearPayload, ChatCancelPayloadSchema, type ChatCancelPayload, ChatAttachPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryPageSchema, ChatHistoryResultSchema, type ChatHistoryResult, ChatSubagentPayloadSchema, type ChatSubagentPayload, ChatStopSubagentPayloadSchema, type ChatStopSubagentPayload, ChatGoalActionSchema, type ChatGoalAction, ChatGoalPayloadSchema, type ChatGoalPayload, ChatStopTaskPayloadSchema, type ChatStopTaskPayload, ChatSubagentPageSchema, ChatSubagentSourceSchema, type ChatSubagentSource, ChatSubagentResultSchema, type ChatSubagentResult, ChatStatusEventSchema, type ChatStatusEvent, ChatSubagentChangedEventSchema, type ChatSubagentChangedEvent, CHAT_BOOKMARK_LIMITS, ChatBookmarkSchema, type ChatBookmark, ChatBookmarksSchema, ChatAddBookmarkPayloadSchema, type ChatAddBookmarkPayload, ChatRenameBookmarkPayloadSchema, type ChatRenameBookmarkPayload, ChatRemoveBookmarkPayloadSchema, type ChatRemoveBookmarkPayload, ChatBookmarksResultSchema, type ChatBookmarksResult, ChatBookmarksEventSchema, type ChatBookmarksEvent, ChatRemoveVisualPayloadSchema, type ChatRemoveVisualPayload, ChatVisualsResultSchema, type ChatVisualsResult, ChatVisualsEventSchema, type ChatVisualsEvent, ChatAttachResultSchema, type ChatAttachResult, ChatDeliverySchema, type ChatDelivery, ChatSendPayloadSchema, type ChatSendPayload, ChatSendResultSchema, type ChatSendResult, ChatUiChoicePayloadSchema, type ChatUiChoicePayload, ChatUiQueryPayloadSchema, type ChatUiQueryPayload, ChatUiLinkPayloadSchema, type ChatUiLinkPayload, ChatQueuePayloadSchema, type ChatQueuePayload, ChatUnqueueResultSchema, type ChatUnqueueResult, ChatApprovePayloadSchema, type ChatApprovePayload, ChatDismissPayloadSchema, type ChatDismissPayload, ChatAnswerPayloadSchema, type ChatAnswerPayload, ChatTurnDiffPayloadSchema, type ChatTurnDiffPayload, ChatTurnDiffResultSchema, type ChatTurnDiffResult, CHAT_FORK_TITLE_MAX, ChatForkPayloadSchema, type ChatForkPayload, ChatForkResultSchema, type ChatForkResult, ChatContinueOnPayloadSchema, type ChatContinueOnPayload, ChatContinueOnResultSchema, type ChatContinueOnResult, ChatSummarizePayloadSchema, type ChatSummarizePayload, ChatSummarizeResultSchema, type ChatSummarizeResult, ChatForkInfoPayloadSchema, type ChatForkInfoPayload, ChatForkInfoResultSchema, type ChatForkInfoResult, ChatListResultSchema, type ChatListResult, GeneratedImageInputSchema, type GeneratedImageInput, generatedImageAttachment } from './chat.ts';
|
|
3
3
|
export { ErrorSchema, type WireError, RequestSchema, type Request, ReplyOkSchema, type ReplyOk, ReplyErrorSchema, type ReplyError, ReplySchema, type Reply, EventSchema, type Event, ServerFrameSchema, type ServerFrame, type ParseResult, parseRequest, parseServerFrame } from './envelope.ts';
|
|
4
4
|
export { SessionIdSchema, type SessionId } from './ids.ts';
|
|
5
5
|
export { ModelOptionChoiceSchema, type ModelOptionChoice, ModelOptionDescriptorSchema, type ModelOptionDescriptor, ModelInfoSchema, type ModelInfo, ModelSelectionSchema, type ModelSelection, ModelCatalogProfileSchema, type ModelCatalogProfile, ModelCatalogEntrySchema, type ModelCatalogEntry, ModelCatalogDataSchema, type ModelCatalogData, RuntimeModeSchema, type RuntimeMode, ProviderCapabilitiesSchema, type ProviderCapabilities, ProviderInfoSchema, type ProviderInfo, ProviderListResultSchema, type ProviderListResult, resumeCommandFor } from './model.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Public API: exports.test.ts snapshots this list, so a name added or dropped here is an API change.
|
|
2
2
|
export { AgentKindSchema, AgentStatusSchema, SUGGESTED_TITLE_LIMIT, SuggestedTitleSchema, AgentRequestSchema, AgentInfoSchema, SessionStatusEventSchema, AgentResumePayloadSchema, ApprovalChoiceSchema, ApprovalRequestSchema, SessionApprovalsEventSchema, ApprovalAnswerPayloadSchema, ApprovalAnswerResultSchema, ApprovalPreferencePayloadSchema } from './agent.js';
|
|
3
|
-
export { ChatIdSchema, ChatContextBreakdownSchema, ChatUsageSchema, CHAT_ATTACHMENTS_MAX_BYTES, CHAT_ATTACHMENT_MAX_BYTES, CHAT_ATTACHMENTS_MAX_COUNT, attachmentBytes, attachmentImageMime, ChatAttachmentUploadSchema, ChatAttachmentUploadsSchema, ChatAttachmentSchema, ChatUiChoiceOriginSchema, ChatUiAnswerSchema, ChatQuoteSourceSchema, ChatQueuedMessageSchema, ChatBackgroundTaskSchema, ChatTurnLimitSchema, ChatGoalStatusSchema, ChatGoalSchema, ChatQuestionSchema, ChatRequestKindSchema, CHAT_REQUEST_LIMITS, ChatRequestApprovalSchema, ChatRequestSummarySchema, ChatInfoSchema, ChatSkillSourceSchema, ChatSkillSchema, SkillsListPayloadSchema, SkillsListResultSchema, ChatUserItemSchema, ChatUiQueryReadingSchema, ChatUiLinkReadingSchema, ChatUiQueryStateSchema, ChatAssistantItemSchema, ChatThinkingItemSchema, ChatToolStateSchema, ChatToolProgressSchema, ChatFileChangeSchema, ChatSubagentStatusSchema, ChatWorkflowPhaseSchema, ChatWorkflowAgentSchema, ChatWorkflowSchema, workflowAgentRef, workflowAgentIdOf, ChatToolItemSchema, ChatSubagentUsageSchema, HOST_TASK_ORIGIN, ChatSubagentItemSchema, ChatApprovalDecisionSchema, ChatApprovalItemSchema, ChatQuestionItemSchema, ChatCheckpointFileSchema, ChatCheckpointDiffSchema, ChatTurnItemSchema, notResumedNote, abortedByMachine, WAITING_NOTE_PREFIX, ChatNoteItemSchema, ChatCompactionItemSchema, ChatItemSchema, ChatEventSchema, ChatEventEnvelopeSchema, ChatCreatePayloadSchema, ChatConfigurePayloadSchema, ChatPreferencesPayloadSchema, ChatTargetPayloadSchema, ChatClearPayloadSchema, ChatCancelPayloadSchema, ChatAttachPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryPageSchema, ChatHistoryResultSchema, ChatSubagentPayloadSchema, ChatStopSubagentPayloadSchema, ChatGoalActionSchema, ChatGoalPayloadSchema, ChatStopTaskPayloadSchema, ChatSubagentPageSchema, ChatSubagentSourceSchema, ChatSubagentResultSchema, ChatStatusEventSchema, ChatSubagentChangedEventSchema, CHAT_BOOKMARK_LIMITS, ChatBookmarkSchema, ChatBookmarksSchema, ChatAddBookmarkPayloadSchema, ChatRenameBookmarkPayloadSchema, ChatRemoveBookmarkPayloadSchema, ChatBookmarksResultSchema, ChatBookmarksEventSchema, ChatRemoveVisualPayloadSchema, ChatVisualsResultSchema, ChatVisualsEventSchema, ChatAttachResultSchema, ChatDeliverySchema, ChatSendPayloadSchema, ChatSendResultSchema, ChatUiChoicePayloadSchema, ChatUiQueryPayloadSchema, ChatUiLinkPayloadSchema, ChatQueuePayloadSchema, ChatUnqueueResultSchema, ChatApprovePayloadSchema, ChatDismissPayloadSchema, ChatAnswerPayloadSchema, ChatTurnDiffPayloadSchema, ChatTurnDiffResultSchema, CHAT_FORK_TITLE_MAX, ChatForkPayloadSchema, ChatForkResultSchema, ChatContinueOnPayloadSchema, ChatContinueOnResultSchema, ChatSummarizePayloadSchema, ChatSummarizeResultSchema, ChatForkInfoPayloadSchema, ChatForkInfoResultSchema, ChatListResultSchema, GeneratedImageInputSchema, generatedImageAttachment } from './chat.js';
|
|
3
|
+
export { ChatIdSchema, ChatContextBreakdownSchema, ChatUsageSchema, CHAT_ATTACHMENTS_MAX_BYTES, CHAT_ATTACHMENT_MAX_BYTES, CHAT_ATTACHMENTS_MAX_COUNT, attachmentBytes, attachmentImageMime, ChatAttachmentUploadSchema, ChatAttachmentUploadsSchema, ChatAttachmentSchema, ChatUiChoiceOriginSchema, ChatUiAnswerSchema, ChatQuoteSourceSchema, ChatQueuedMessageSchema, ChatBackgroundTaskSchema, ChatTurnLimitSchema, ChatGoalStatusSchema, ChatGoalSchema, ChatQuestionSchema, ChatRequestKindSchema, CHAT_REQUEST_LIMITS, ChatRequestApprovalSchema, ChatRequestSummarySchema, ChatInfoSchema, ChatSkillSourceSchema, ChatSkillSchema, SkillsListPayloadSchema, SkillsListResultSchema, ChatUserItemSchema, ChatUiQueryReadingSchema, ChatUiLinkReadingSchema, ChatUiPlaceReadingSchema, ChatUiQueryStateSchema, ChatAssistantItemSchema, ChatThinkingItemSchema, ChatToolStateSchema, ChatToolProgressSchema, ChatFileChangeSchema, ChatSubagentStatusSchema, ChatWorkflowPhaseSchema, ChatWorkflowAgentSchema, ChatWorkflowSchema, workflowAgentRef, workflowAgentIdOf, ChatToolItemSchema, ChatSubagentUsageSchema, HOST_TASK_ORIGIN, ChatSubagentItemSchema, ChatApprovalDecisionSchema, ChatApprovalItemSchema, ChatQuestionItemSchema, ChatCheckpointFileSchema, ChatCheckpointDiffSchema, ChatTurnItemSchema, notResumedNote, abortedByMachine, ENDED_NOTE_PREFIX, abortedByEnd, WAITING_NOTE_PREFIX, ChatNoteItemSchema, ChatCompactionItemSchema, ChatItemSchema, ChatEventSchema, ChatEventEnvelopeSchema, ChatCreatePayloadSchema, ChatConfigurePayloadSchema, ChatPreferencesPayloadSchema, ChatTargetPayloadSchema, ChatClearPayloadSchema, ChatCancelPayloadSchema, ChatAttachPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryPageSchema, ChatHistoryResultSchema, ChatSubagentPayloadSchema, ChatStopSubagentPayloadSchema, ChatGoalActionSchema, ChatGoalPayloadSchema, ChatStopTaskPayloadSchema, ChatSubagentPageSchema, ChatSubagentSourceSchema, ChatSubagentResultSchema, ChatStatusEventSchema, ChatSubagentChangedEventSchema, CHAT_BOOKMARK_LIMITS, ChatBookmarkSchema, ChatBookmarksSchema, ChatAddBookmarkPayloadSchema, ChatRenameBookmarkPayloadSchema, ChatRemoveBookmarkPayloadSchema, ChatBookmarksResultSchema, ChatBookmarksEventSchema, ChatRemoveVisualPayloadSchema, ChatVisualsResultSchema, ChatVisualsEventSchema, ChatAttachResultSchema, ChatDeliverySchema, ChatSendPayloadSchema, ChatSendResultSchema, ChatUiChoicePayloadSchema, ChatUiQueryPayloadSchema, ChatUiLinkPayloadSchema, ChatQueuePayloadSchema, ChatUnqueueResultSchema, ChatApprovePayloadSchema, ChatDismissPayloadSchema, ChatAnswerPayloadSchema, ChatTurnDiffPayloadSchema, ChatTurnDiffResultSchema, CHAT_FORK_TITLE_MAX, ChatForkPayloadSchema, ChatForkResultSchema, ChatContinueOnPayloadSchema, ChatContinueOnResultSchema, ChatSummarizePayloadSchema, ChatSummarizeResultSchema, ChatForkInfoPayloadSchema, ChatForkInfoResultSchema, ChatListResultSchema, GeneratedImageInputSchema, generatedImageAttachment } from './chat.js';
|
|
4
4
|
export { ErrorSchema, RequestSchema, ReplyOkSchema, ReplyErrorSchema, ReplySchema, EventSchema, ServerFrameSchema, parseRequest, parseServerFrame } from './envelope.js';
|
|
5
5
|
export { SessionIdSchema } from './ids.js';
|
|
6
6
|
export { ModelOptionChoiceSchema, ModelOptionDescriptorSchema, ModelInfoSchema, ModelSelectionSchema, ModelCatalogProfileSchema, ModelCatalogEntrySchema, ModelCatalogDataSchema, RuntimeModeSchema, ProviderCapabilitiesSchema, ProviderInfoSchema, ProviderListResultSchema, resumeCommandFor } from './model.js';
|
package/dist/protocol.d.ts
CHANGED
|
@@ -298,6 +298,18 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
298
298
|
code: z.ZodOptional<z.ZodString>;
|
|
299
299
|
reason: z.ZodOptional<z.ZodString>;
|
|
300
300
|
}, z.core.$strip>>>;
|
|
301
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
302
|
+
state: z.ZodEnum<{
|
|
303
|
+
found: "found";
|
|
304
|
+
missing: "missing";
|
|
305
|
+
}>;
|
|
306
|
+
address: z.ZodString;
|
|
307
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
308
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
309
|
+
label: z.ZodOptional<z.ZodString>;
|
|
310
|
+
code: z.ZodOptional<z.ZodString>;
|
|
311
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
312
|
+
}, z.core.$strip>>>;
|
|
301
313
|
}, z.core.$strip>>;
|
|
302
314
|
}, z.core.$strip>>;
|
|
303
315
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -804,6 +816,18 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
804
816
|
code: z.ZodOptional<z.ZodString>;
|
|
805
817
|
reason: z.ZodOptional<z.ZodString>;
|
|
806
818
|
}, z.core.$strip>>>;
|
|
819
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
820
|
+
state: z.ZodEnum<{
|
|
821
|
+
found: "found";
|
|
822
|
+
missing: "missing";
|
|
823
|
+
}>;
|
|
824
|
+
address: z.ZodString;
|
|
825
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
826
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
827
|
+
label: z.ZodOptional<z.ZodString>;
|
|
828
|
+
code: z.ZodOptional<z.ZodString>;
|
|
829
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
830
|
+
}, z.core.$strip>>>;
|
|
807
831
|
}, z.core.$strip>>;
|
|
808
832
|
}, z.core.$strip>>;
|
|
809
833
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -1133,6 +1157,18 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
1133
1157
|
code: z.ZodOptional<z.ZodString>;
|
|
1134
1158
|
reason: z.ZodOptional<z.ZodString>;
|
|
1135
1159
|
}, z.core.$strip>>>;
|
|
1160
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1161
|
+
state: z.ZodEnum<{
|
|
1162
|
+
found: "found";
|
|
1163
|
+
missing: "missing";
|
|
1164
|
+
}>;
|
|
1165
|
+
address: z.ZodString;
|
|
1166
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
1167
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
1168
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1169
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1170
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1171
|
+
}, z.core.$strip>>>;
|
|
1136
1172
|
}, z.core.$strip>>;
|
|
1137
1173
|
}, z.core.$strip>>;
|
|
1138
1174
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -1461,6 +1497,18 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
1461
1497
|
code: z.ZodOptional<z.ZodString>;
|
|
1462
1498
|
reason: z.ZodOptional<z.ZodString>;
|
|
1463
1499
|
}, z.core.$strip>>>;
|
|
1500
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1501
|
+
state: z.ZodEnum<{
|
|
1502
|
+
found: "found";
|
|
1503
|
+
missing: "missing";
|
|
1504
|
+
}>;
|
|
1505
|
+
address: z.ZodString;
|
|
1506
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
1507
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
1508
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1509
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1510
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1511
|
+
}, z.core.$strip>>>;
|
|
1464
1512
|
}, z.core.$strip>>;
|
|
1465
1513
|
}, z.core.$strip>>;
|
|
1466
1514
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -1741,6 +1789,18 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
1741
1789
|
code: z.ZodOptional<z.ZodString>;
|
|
1742
1790
|
reason: z.ZodOptional<z.ZodString>;
|
|
1743
1791
|
}, z.core.$strip>>>;
|
|
1792
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1793
|
+
state: z.ZodEnum<{
|
|
1794
|
+
found: "found";
|
|
1795
|
+
missing: "missing";
|
|
1796
|
+
}>;
|
|
1797
|
+
address: z.ZodString;
|
|
1798
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
1799
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
1800
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1801
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1802
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1803
|
+
}, z.core.$strip>>>;
|
|
1744
1804
|
}, z.core.$strip>>;
|
|
1745
1805
|
}, z.core.$strip>>;
|
|
1746
1806
|
textLength: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2181,6 +2241,18 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
2181
2241
|
code: z.ZodOptional<z.ZodString>;
|
|
2182
2242
|
reason: z.ZodOptional<z.ZodString>;
|
|
2183
2243
|
}, z.core.$strip>>>;
|
|
2244
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2245
|
+
state: z.ZodEnum<{
|
|
2246
|
+
found: "found";
|
|
2247
|
+
missing: "missing";
|
|
2248
|
+
}>;
|
|
2249
|
+
address: z.ZodString;
|
|
2250
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
2251
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
2252
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2253
|
+
code: z.ZodOptional<z.ZodString>;
|
|
2254
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
2255
|
+
}, z.core.$strip>>>;
|
|
2184
2256
|
}, z.core.$strip>>;
|
|
2185
2257
|
}, z.core.$strip>>;
|
|
2186
2258
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -3426,6 +3498,18 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
3426
3498
|
code: z.ZodOptional<z.ZodString>;
|
|
3427
3499
|
reason: z.ZodOptional<z.ZodString>;
|
|
3428
3500
|
}, z.core.$strip>>>;
|
|
3501
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3502
|
+
state: z.ZodEnum<{
|
|
3503
|
+
found: "found";
|
|
3504
|
+
missing: "missing";
|
|
3505
|
+
}>;
|
|
3506
|
+
address: z.ZodString;
|
|
3507
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
3508
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
3509
|
+
label: z.ZodOptional<z.ZodString>;
|
|
3510
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3511
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
3512
|
+
}, z.core.$strip>>>;
|
|
3429
3513
|
}, z.core.$strip>>;
|
|
3430
3514
|
}, z.core.$strip>>;
|
|
3431
3515
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -4650,6 +4734,18 @@ export declare const AGENT_EVENT_SCHEMAS: {
|
|
|
4650
4734
|
code: z.ZodOptional<z.ZodString>;
|
|
4651
4735
|
reason: z.ZodOptional<z.ZodString>;
|
|
4652
4736
|
}, z.core.$strip>>>;
|
|
4737
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4738
|
+
state: z.ZodEnum<{
|
|
4739
|
+
found: "found";
|
|
4740
|
+
missing: "missing";
|
|
4741
|
+
}>;
|
|
4742
|
+
address: z.ZodString;
|
|
4743
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
4744
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
4745
|
+
label: z.ZodOptional<z.ZodString>;
|
|
4746
|
+
code: z.ZodOptional<z.ZodString>;
|
|
4747
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
4748
|
+
}, z.core.$strip>>>;
|
|
4653
4749
|
}, z.core.$strip>>;
|
|
4654
4750
|
}, z.core.$strip>>;
|
|
4655
4751
|
phase: z.ZodOptional<z.ZodString>;
|
|
@@ -4930,6 +5026,18 @@ export declare const AGENT_EVENT_SCHEMAS: {
|
|
|
4930
5026
|
code: z.ZodOptional<z.ZodString>;
|
|
4931
5027
|
reason: z.ZodOptional<z.ZodString>;
|
|
4932
5028
|
}, z.core.$strip>>>;
|
|
5029
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5030
|
+
state: z.ZodEnum<{
|
|
5031
|
+
found: "found";
|
|
5032
|
+
missing: "missing";
|
|
5033
|
+
}>;
|
|
5034
|
+
address: z.ZodString;
|
|
5035
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
5036
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
5037
|
+
label: z.ZodOptional<z.ZodString>;
|
|
5038
|
+
code: z.ZodOptional<z.ZodString>;
|
|
5039
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
5040
|
+
}, z.core.$strip>>>;
|
|
4933
5041
|
}, z.core.$strip>>;
|
|
4934
5042
|
}, z.core.$strip>>;
|
|
4935
5043
|
textLength: z.ZodOptional<z.ZodNumber>;
|
|
@@ -5370,6 +5478,18 @@ export declare const AGENT_EVENT_SCHEMAS: {
|
|
|
5370
5478
|
code: z.ZodOptional<z.ZodString>;
|
|
5371
5479
|
reason: z.ZodOptional<z.ZodString>;
|
|
5372
5480
|
}, z.core.$strip>>>;
|
|
5481
|
+
places: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5482
|
+
state: z.ZodEnum<{
|
|
5483
|
+
found: "found";
|
|
5484
|
+
missing: "missing";
|
|
5485
|
+
}>;
|
|
5486
|
+
address: z.ZodString;
|
|
5487
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
5488
|
+
lon: z.ZodOptional<z.ZodNumber>;
|
|
5489
|
+
label: z.ZodOptional<z.ZodString>;
|
|
5490
|
+
code: z.ZodOptional<z.ZodString>;
|
|
5491
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
5492
|
+
}, z.core.$strip>>>;
|
|
5373
5493
|
}, z.core.$strip>>;
|
|
5374
5494
|
}, z.core.$strip>>;
|
|
5375
5495
|
phase: z.ZodOptional<z.ZodString>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/agent-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.1",
|
|
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.25.1",
|
|
90
90
|
"zod": "^4.6.5"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
package/src/chat.ts
CHANGED
|
@@ -356,6 +356,21 @@ export type ChatUiQueryReading = z.infer<typeof ChatUiQueryReadingSchema>;
|
|
|
356
356
|
export const ChatUiLinkReadingSchema = UiLinkResolutionSchema;
|
|
357
357
|
export type ChatUiLinkReading = z.infer<typeof ChatUiLinkReadingSchema>;
|
|
358
358
|
|
|
359
|
+
// `state` is a frozen set, like a link's: native clients validate these payloads whole.
|
|
360
|
+
export const ChatUiPlaceReadingSchema = z.object({
|
|
361
|
+
state: z.enum(['found', 'missing']),
|
|
362
|
+
// The address as it was looked up (trimmed), which a reader compares with the address a node has now: a node id alone moves with a reordered Each.
|
|
363
|
+
address: z.string(),
|
|
364
|
+
lat: z.number().min(-90).max(90).optional(),
|
|
365
|
+
lon: z.number().min(-180).max(180).optional(),
|
|
366
|
+
// What the host called the point it found, such as the street and town.
|
|
367
|
+
label: z.string().optional(),
|
|
368
|
+
// A code that names the reason across versions; open, so a new one fails nobody.
|
|
369
|
+
code: z.string().optional(),
|
|
370
|
+
reason: z.string().optional()
|
|
371
|
+
});
|
|
372
|
+
export type ChatUiPlaceReading = z.infer<typeof ChatUiPlaceReadingSchema>;
|
|
373
|
+
|
|
359
374
|
// The writer's captured access stays on the daemon; a record from before that still parses and drops it.
|
|
360
375
|
export const ChatUiQueryStateSchema = z.object({
|
|
361
376
|
authorChatId: z.string(),
|
|
@@ -365,7 +380,9 @@ export const ChatUiQueryStateSchema = z.object({
|
|
|
365
380
|
revision: z.string(),
|
|
366
381
|
readings: z.record(z.string(), ChatUiQueryReadingSchema),
|
|
367
382
|
fallback: z.string(),
|
|
368
|
-
links: z.record(z.string(), ChatUiLinkReadingSchema).optional()
|
|
383
|
+
links: z.record(z.string(), ChatUiLinkReadingSchema).optional(),
|
|
384
|
+
// The points looked up for the places of a block that named an address, by node id.
|
|
385
|
+
places: z.record(z.string(), ChatUiPlaceReadingSchema).optional()
|
|
369
386
|
})
|
|
370
387
|
)
|
|
371
388
|
});
|
|
@@ -637,6 +654,14 @@ export function abortedByMachine(
|
|
|
637
654
|
);
|
|
638
655
|
}
|
|
639
656
|
|
|
657
|
+
/* The id prefix of the note a host leaves in a turn it ended because the agent that opened the chat was stopped. */
|
|
658
|
+
export const ENDED_NOTE_PREFIX = 'ended-';
|
|
659
|
+
|
|
660
|
+
/* Whether the host ended this aborted turn along with its chat, which no person stopped and a person did not ask to be sent on. */
|
|
661
|
+
export function abortedByEnd(turn: { id: string; state: string }, items: readonly { id: string; kind: string; turnId: string | null }[]): boolean {
|
|
662
|
+
return turn.state === 'aborted' && items.some((item) => item.kind === 'note' && item.turnId === turn.id && item.id.startsWith(ENDED_NOTE_PREFIX));
|
|
663
|
+
}
|
|
664
|
+
|
|
640
665
|
/* The id prefix of the note a host leaves in a parent about a child that waits on a request. */
|
|
641
666
|
export const WAITING_NOTE_PREFIX = 'waiting-';
|
|
642
667
|
|
package/src/index.ts
CHANGED
|
@@ -84,6 +84,8 @@ export {
|
|
|
84
84
|
type ChatUiQueryReading,
|
|
85
85
|
ChatUiLinkReadingSchema,
|
|
86
86
|
type ChatUiLinkReading,
|
|
87
|
+
ChatUiPlaceReadingSchema,
|
|
88
|
+
type ChatUiPlaceReading,
|
|
87
89
|
ChatUiQueryStateSchema,
|
|
88
90
|
type ChatUiQueryState,
|
|
89
91
|
ChatAssistantItemSchema,
|
|
@@ -120,6 +122,8 @@ export {
|
|
|
120
122
|
ChatTurnItemSchema,
|
|
121
123
|
notResumedNote,
|
|
122
124
|
abortedByMachine,
|
|
125
|
+
ENDED_NOTE_PREFIX,
|
|
126
|
+
abortedByEnd,
|
|
123
127
|
WAITING_NOTE_PREFIX,
|
|
124
128
|
ChatNoteItemSchema,
|
|
125
129
|
ChatCompactionItemSchema,
|