github-copilot-sdk 1.0.29-preview.2

Rust SDK for programmatic control of the GitHub Copilot CLI via JSON-RPC.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
//! Auto-generated from api.schema.json — do not edit manually.

#![allow(clippy::large_enum_variant)]
#![allow(deprecated)]
#![allow(dead_code)]
#![allow(unused_imports)]
#![allow(rustdoc::invalid_html_tags)]

use std::collections::HashMap;

pub(crate) use lifecycle_diagnostics::LifecycleDiagnosticEvent;
use serde::{Deserialize, Serialize};
pub use session_events::{
    AbortReason, AgentModelPolicy, AssistedApprovalAssessment, AutoTier, BlockedPermissionAction,
    ContextTier, IndexedSearchState, ManagedPermissionsContext, ManagedSettingsResolvedSource,
    McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerMetadata, McpServerSource,
    McpServerStatus, McpSkillOrigin, ModelChangeSource, ModelProviderKind, ModelProviderRef,
    OmittedBinaryOmittedReason, PermissionDecisionSource, PermissionMode, PermissionPromptRequest,
    PermissionRule, PolicyHelperCapabilities, PolicyHelperFailure, ProviderQuotaState,
    ReasoningSummary, RemediationAction, SessionLimitsConfig, SessionMode, ShutdownType,
    SkillSource, TaskBlocker, TaskCompletionOutcome, UsageGetMetricsResult,
    UserToolSessionApproval, Verbosity,
};

use crate::generated::{lifecycle_diagnostics, session_events};
use crate::types::{RequestId, SessionEvent, SessionId};

/// Endpoint URLs from the raw Copilot `/copilot_internal/v2/token` user-response passthrough.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CopilotUserResponseEndpoints {
    /// Copilot API endpoint URL.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub api: Option<String>,
    /// Experimental-service endpoint URL.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub exp: Option<String>,
    /// Origin-tracker endpoint URL.
    #[serde(rename = "origin-tracker", skip_serializing_if = "Option::is_none")]
    pub origin_tracker: Option<String>,
    /// Copilot proxy endpoint URL.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub proxy: Option<String>,
    /// Copilot telemetry endpoint URL.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub telemetry: Option<String>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CopilotUserResponseEnterpriseListItem {
    /// JavaScript-safe numeric database ID of the enterprise.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
}

/// Chat quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CopilotUserResponseQuotaSnapshotsChat {
    /// Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub entitlement: Option<f64>,
    /// Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets.
    #[serde(rename = "has_quota", skip_serializing_if = "Option::is_none")]
    pub has_quota: Option<bool>,
    /// Count of additional pay-per-request usage consumed this period beyond the entitlement.
    #[serde(rename = "overage_count", skip_serializing_if = "Option::is_none")]
    pub overage_count: Option<f64>,
    /// Whether usage may continue at pay-per-request rates once the entitlement is exhausted.
    #[serde(rename = "overage_permitted", skip_serializing_if = "Option::is_none")]
    pub overage_permitted: Option<bool>,
    /// Percentage of the entitlement remaining at the snapshot timestamp.
    #[serde(rename = "percent_remaining", skip_serializing_if = "Option::is_none")]
    pub percent_remaining: Option<f64>,
    /// Identifier of the quota bucket this snapshot describes.
    #[serde(rename = "quota_id", skip_serializing_if = "Option::is_none")]
    pub quota_id: Option<String>,
    /// Amount of quota remaining at the snapshot timestamp.
    #[serde(rename = "quota_remaining", skip_serializing_if = "Option::is_none")]
    pub quota_remaining: Option<f64>,
    /// Unix epoch time, in seconds, when this quota next resets.
    #[serde(rename = "quota_reset_at", skip_serializing_if = "Option::is_none")]
    pub quota_reset_at: Option<f64>,
    /// Remaining entitlement/quota amount at the snapshot timestamp.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub remaining: Option<f64>,
    /// UTC timestamp when this snapshot was captured.
    #[serde(rename = "timestamp_utc", skip_serializing_if = "Option::is_none")]
    pub timestamp_utc: Option<String>,
    /// Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count.
    #[serde(
        rename = "token_based_billing",
        skip_serializing_if = "Option::is_none"
    )]
    pub token_based_billing: Option<bool>,
    /// Whether the entitlement for this category is unlimited.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unlimited: Option<bool>,
}

/// Completions quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CopilotUserResponseQuotaSnapshotsCompletions {
    /// Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub entitlement: Option<f64>,
    /// Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets.
    #[serde(rename = "has_quota", skip_serializing_if = "Option::is_none")]
    pub has_quota: Option<bool>,
    /// Count of additional pay-per-request usage consumed this period beyond the entitlement.
    #[serde(rename = "overage_count", skip_serializing_if = "Option::is_none")]
    pub overage_count: Option<f64>,
    /// Whether usage may continue at pay-per-request rates once the entitlement is exhausted.
    #[serde(rename = "overage_permitted", skip_serializing_if = "Option::is_none")]
    pub overage_permitted: Option<bool>,
    /// Percentage of the entitlement remaining at the snapshot timestamp.
    #[serde(rename = "percent_remaining", skip_serializing_if = "Option::is_none")]
    pub percent_remaining: Option<f64>,
    /// Identifier of the quota bucket this snapshot describes.
    #[serde(rename = "quota_id", skip_serializing_if = "Option::is_none")]
    pub quota_id: Option<String>,
    /// Amount of quota remaining at the snapshot timestamp.
    #[serde(rename = "quota_remaining", skip_serializing_if = "Option::is_none")]
    pub quota_remaining: Option<f64>,
    /// Unix epoch time, in seconds, when this quota next resets.
    #[serde(rename = "quota_reset_at", skip_serializing_if = "Option::is_none")]
    pub quota_reset_at: Option<f64>,
    /// Remaining entitlement/quota amount at the snapshot timestamp.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub remaining: Option<f64>,
    /// UTC timestamp when this snapshot was captured.
    #[serde(rename = "timestamp_utc", skip_serializing_if = "Option::is_none")]
    pub timestamp_utc: Option<String>,
    /// Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count.
    #[serde(
        rename = "token_based_billing",
        skip_serializing_if = "Option::is_none"
    )]
    pub token_based_billing: Option<bool>,
    /// Whether the entitlement for this category is unlimited.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unlimited: Option<bool>,
}

/// Premium-interactions quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CopilotUserResponseQuotaSnapshotsPremiumInteractions {
    /// Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub entitlement: Option<f64>,
    /// Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets.
    #[serde(rename = "has_quota", skip_serializing_if = "Option::is_none")]
    pub has_quota: Option<bool>,
    /// Count of additional pay-per-request usage consumed this period beyond the entitlement.
    #[serde(rename = "overage_count", skip_serializing_if = "Option::is_none")]
    pub overage_count: Option<f64>,
    /// Whether usage may continue at pay-per-request rates once the entitlement is exhausted.
    #[serde(rename = "overage_permitted", skip_serializing_if = "Option::is_none")]
    pub overage_permitted: Option<bool>,
    /// Percentage of the entitlement remaining at the snapshot timestamp.
    #[serde(rename = "percent_remaining", skip_serializing_if = "Option::is_none")]
    pub percent_remaining: Option<f64>,
    /// Identifier of the quota bucket this snapshot describes.
    #[serde(rename = "quota_id", skip_serializing_if = "Option::is_none")]
    pub quota_id: Option<String>,
    /// Amount of quota remaining at the snapshot timestamp.
    #[serde(rename = "quota_remaining", skip_serializing_if = "Option::is_none")]
    pub quota_remaining: Option<f64>,
    /// Unix epoch time, in seconds, when this quota next resets.
    #[serde(rename = "quota_reset_at", skip_serializing_if = "Option::is_none")]
    pub quota_reset_at: Option<f64>,
    /// Remaining entitlement/quota amount at the snapshot timestamp.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub remaining: Option<f64>,
    /// UTC timestamp when this snapshot was captured.
    #[serde(rename = "timestamp_utc", skip_serializing_if = "Option::is_none")]
    pub timestamp_utc: Option<String>,
    /// Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count.
    #[serde(
        rename = "token_based_billing",
        skip_serializing_if = "Option::is_none"
    )]
    pub token_based_billing: Option<bool>,
    /// Whether the entitlement for this category is unlimited.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unlimited: Option<bool>,
}

/// Quota snapshot map from the raw Copilot user-response passthrough, with chat, completions, premium-interactions, and other entries.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CopilotUserResponseQuotaSnapshots {
    /// Chat quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub chat: Option<CopilotUserResponseQuotaSnapshotsChat>,
    /// Completions quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub completions: Option<CopilotUserResponseQuotaSnapshotsCompletions>,
    /// Premium-interactions quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields.
    #[serde(
        rename = "premium_interactions",
        skip_serializing_if = "Option::is_none"
    )]
    pub premium_interactions: Option<CopilotUserResponseQuotaSnapshotsPremiumInteractions>,
}

/// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CopilotUserResponse {
    /// Copilot access SKU identifier (e.g. `free_limited_copilot`, `copilot_for_business_seat_quota`) used to gate model and feature access.
    #[serde(rename = "access_type_sku", skip_serializing_if = "Option::is_none")]
    pub access_type_sku: Option<String>,
    /// Opaque analytics tracking identifier for the user, forwarded from the Copilot API.
    #[serde(
        rename = "analytics_tracking_id",
        skip_serializing_if = "Option::is_none"
    )]
    pub analytics_tracking_id: Option<String>,
    /// Date the Copilot seat was assigned to the user, if applicable.
    #[serde(rename = "assigned_date", skip_serializing_if = "Option::is_none")]
    pub assigned_date: Option<serde_json::Value>,
    /// Whether the user is eligible to sign up for the free/limited Copilot tier.
    #[serde(
        rename = "can_signup_for_limited",
        skip_serializing_if = "Option::is_none"
    )]
    pub can_signup_for_limited: Option<bool>,
    /// Whether the user is able to upgrade their Copilot plan.
    #[serde(rename = "can_upgrade_plan", skip_serializing_if = "Option::is_none")]
    pub can_upgrade_plan: Option<bool>,
    /// Whether Copilot chat is enabled for the user.
    #[serde(rename = "chat_enabled", skip_serializing_if = "Option::is_none")]
    pub chat_enabled: Option<bool>,
    /// Whether CLI remote control is enabled for the user.
    #[serde(
        rename = "cli_remote_control_enabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub cli_remote_control_enabled: Option<bool>,
    /// Whether cloud session storage is enabled for the user.
    #[serde(
        rename = "cloud_session_storage_enabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub cloud_session_storage_enabled: Option<bool>,
    /// Whether the Codex agent is enabled for the user.
    #[serde(
        rename = "codex_agent_enabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub codex_agent_enabled: Option<bool>,
    /// Copilot plan name for the user (e.g. `individual`, `business`, `enterprise`).
    #[serde(rename = "copilot_plan", skip_serializing_if = "Option::is_none")]
    pub copilot_plan: Option<String>,
    /// Whether `.copilotignore` content-exclusion support is enabled for the user.
    #[serde(
        rename = "copilotignore_enabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub copilotignore_enabled: Option<bool>,
    /// Endpoint URLs from the raw Copilot `/copilot_internal/v2/token` user-response passthrough.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub endpoints: Option<CopilotUserResponseEndpoints>,
    /// Enterprises that provide the user's Copilot license; malformed entries are normalized to null or ID-less shapes.
    #[serde(rename = "enterprise_list", skip_serializing_if = "Option::is_none")]
    pub enterprise_list: Option<Vec<Option<CopilotUserResponseEnterpriseListItem>>>,
    /// Whether MCP (Model Context Protocol) support is enabled for the user.
    #[serde(rename = "is_mcp_enabled", skip_serializing_if = "Option::is_none")]
    pub is_mcp_enabled: Option<serde_json::Value>,
    /// Whether the user is a GitHub/Microsoft staff member.
    #[serde(rename = "is_staff", skip_serializing_if = "Option::is_none")]
    pub is_staff: Option<bool>,
    /// Per-category quota allotments for free/limited-tier users, keyed by quota category.
    #[serde(
        rename = "limited_user_quotas",
        skip_serializing_if = "Option::is_none"
    )]
    pub limited_user_quotas: Option<HashMap<String, f64>>,
    /// Date the free/limited-tier user's quotas next reset, as a raw string from the Copilot API.
    #[serde(
        rename = "limited_user_reset_date",
        skip_serializing_if = "Option::is_none"
    )]
    pub limited_user_reset_date: Option<String>,
    /// GitHub login of the authenticated user.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub login: Option<String>,
    /// Per-category monthly quota allotments, keyed by quota category.
    #[serde(rename = "monthly_quotas", skip_serializing_if = "Option::is_none")]
    pub monthly_quotas: Option<HashMap<String, f64>>,
    /// Organizations the user belongs to, each with an optional ID, login, and display name.
    #[serde(rename = "organization_list", skip_serializing_if = "Option::is_none")]
    pub organization_list: Option<serde_json::Value>,
    /// Logins of the organizations the user belongs to.
    #[serde(
        rename = "organization_login_list",
        skip_serializing_if = "Option::is_none"
    )]
    pub organization_login_list: Option<Vec<String>>,
    /// Date the user's usage quota next resets, as a raw string from the Copilot API; see `quota_reset_date_utc` for the UTC-normalized value.
    #[serde(rename = "quota_reset_date", skip_serializing_if = "Option::is_none")]
    pub quota_reset_date: Option<String>,
    /// UTC-normalized form of `quota_reset_date` (the date the user's usage quota next resets).
    #[serde(
        rename = "quota_reset_date_utc",
        skip_serializing_if = "Option::is_none"
    )]
    pub quota_reset_date_utc: Option<String>,
    /// Quota snapshot map from the raw Copilot user-response passthrough, with chat, completions, premium-interactions, and other entries.
    #[serde(rename = "quota_snapshots", skip_serializing_if = "Option::is_none")]
    pub quota_snapshots: Option<CopilotUserResponseQuotaSnapshots>,
    /// Whether the user's telemetry is subject to restricted-data handling.
    #[serde(
        rename = "restricted_telemetry",
        skip_serializing_if = "Option::is_none"
    )]
    pub restricted_telemetry: Option<bool>,
    /// Raw passthrough of the Copilot API `te` flag for the user (an opaque server-side eligibility signal surfaced in telemetry); not otherwise interpreted by the runtime.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub te: Option<bool>,
    /// Whether the account is on usage-based (token/AI-credit) billing rather than a fixed premium-request quota.
    #[serde(
        rename = "token_based_billing",
        skip_serializing_if = "Option::is_none"
    )]
    pub token_based_billing: Option<bool>,
}

/// Authentication-info input variant for GitHub-internal HMAC auth, carrying the public GitHub host and HMAC secret.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HMACAuthInfo {
    /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub copilot_user: Option<CopilotUserResponse>,
    /// HMAC secret used to sign requests.
    pub hmac: String,
    /// Authentication host. HMAC auth always targets the public GitHub host.
    pub host: HMACAuthInfoHost,
    /// HMAC-based authentication used by GitHub-internal services.
    pub r#type: HMACAuthInfoType,
}

/// Authentication-info input variant for a token sourced from an environment variable, with host, optional login, token, and env var name.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EnvAuthInfo {
    /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub copilot_user: Option<CopilotUserResponse>,
    /// Name of the environment variable the token was sourced from.
    pub env_var: String,
    /// Authentication host (e.g. https://github.com or a GHES host).
    pub host: String,
    /// User login associated with the token. Undefined for server-to-server tokens (those starting with `ghs_`).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub login: Option<String>,
    /// The token value itself. Treat as a secret.
    pub token: String,
    /// Personal access token (PAT) or server-to-server token sourced from an environment variable.
    pub r#type: EnvAuthInfoType,
}

/// Authentication-info input variant for SDK-configured token authentication, carrying host and the secret token value.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TokenAuthInfo {
    /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub copilot_user: Option<CopilotUserResponse>,
    /// Authentication host.
    pub host: String,
    /// Opaque native GitHub credential registration backing this token identity, when applicable.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub registration_id: Option<String>,
    /// The token value itself. Treat as a secret.
    pub token: String,
    /// SDK-side token authentication; the host configured the token directly via the SDK.
    pub r#type: TokenAuthInfoType,
}

/// Authentication-info variant backed by an SDK GitHub token callback. It carries routing metadata but never a plaintext token.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TokenProviderAuthInfo {
    /// Snapshot of the authenticated user's Copilot subscription info, if known.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub copilot_user: Option<CopilotUserResponse>,
    /// Authentication host.
    pub host: String,
    /// Opaque SDK callback registration identifier.
    pub registration_id: String,
    /// SDK callback-backed GitHub token authentication.
    pub r#type: TokenProviderAuthInfoType,
}

/// Authentication-info variant for direct Copilot API token auth sourced from environment variables, with public GitHub host.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CopilotApiTokenAuthInfo {
    /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub copilot_user: Option<CopilotUserResponse>,
    /// Authentication host (always the public GitHub host).
    pub host: CopilotApiTokenAuthInfoHost,
    /// Direct Copilot API authentication via the `GITHUB_COPILOT_API_TOKEN` + `COPILOT_API_URL` environment-variable pair. The token itself is read from the environment by the runtime, not carried in this struct.
    pub r#type: CopilotApiTokenAuthInfoType,
}

/// Authentication-info variant for OAuth user auth, with host and login; the token remains in the runtime secret store.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct UserAuthInfo {
    /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub copilot_user: Option<CopilotUserResponse>,
    /// Authentication host.
    pub host: String,
    /// OAuth user login.
    pub login: String,
    /// OAuth user authentication. The token itself is held in the runtime's secret token store (keyed by host+login) and is NOT carried in this struct.
    pub r#type: UserAuthInfoType,
}

/// An interactive account whose model provider owns its credentials. It carries no GitHub credential.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AccountAuthInfo {
    /// Host coordinate owned by the account's model provider.
    pub host: String,
    /// Login identifying the provider-owned account.
    pub login: String,
    /// Provider-owned account authentication.
    pub r#type: AccountAuthInfoType,
}

/// Authentication-info input variant for GitHub CLI credentials, carrying host, login, and the `gh auth token` value.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GhCliAuthInfo {
    /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub copilot_user: Option<CopilotUserResponse>,
    /// Authentication host.
    pub host: String,
    /// User login as reported by `gh auth status`.
    pub login: String,
    /// The token returned by `gh auth token`. Treat as a secret.
    pub token: String,
    /// Authentication via the `gh` CLI's saved credentials.
    pub r#type: GhCliAuthInfoType,
}

/// Authentication-info input variant for API-key authentication to a non-GitHub LLM provider, carrying the secret `apiKey` and host.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApiKeyAuthInfo {
    /// The API key. Treat as a secret.
    pub api_key: String,
    /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub copilot_user: Option<CopilotUserResponse>,
    /// Authentication host.
    pub host: String,
    /// API-key authentication for non-GitHub LLM providers (e.g. when running BYOM-style).
    pub r#type: ApiKeyAuthInfoType,
}

/// Credential-free authentication identity safe to expose to hosts and user interfaces.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AuthIdentity {
    /// Snapshot of the authenticated user's Copilot subscription info, if known
    #[serde(skip_serializing_if = "Option::is_none")]
    pub copilot_user: Option<CopilotUserResponse>,
    /// Name of the environment variable that supplied the credential, when applicable
    #[serde(skip_serializing_if = "Option::is_none")]
    pub env_var: Option<String>,
    /// Authentication host
    pub host: String,
    /// Authenticated login, when available
    #[serde(skip_serializing_if = "Option::is_none")]
    pub login: Option<String>,
    /// Opaque SDK GitHub credential registration backing this identity. Routing metadata only; never a credential.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub registration_id: Option<String>,
    /// Authentication type
    pub r#type: AuthInfoType,
}

/// Agent metadata, including identifiers, display details, source, tools, model, models, reasoning effort, MCP servers, skills, and file path.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AgentInfo {
    /// Description of the agent's purpose
    pub description: String,
    /// Whether model-driven invocation is disabled for this agent.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub disable_model_invocation: Option<bool>,
    /// Human-readable display name
    pub display_name: String,
    /// Declarative hook actions keyed by event name, executed only while this agent is active.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hooks: Option<HashMap<String, Vec<serde_json::Value>>>,
    /// Stable identifier for selection. For most agents this is the same as `name`; for plugin/builtin agents it may differ. Always populated; defaults to `name` when no distinct id was assigned.
    pub id: String,
    /// MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema.
    ///
    /// <div class="warning">
    ///
    /// **Experimental.** This type is part of an experimental wire-protocol surface
    /// and may change or be removed in future SDK or CLI releases.
    ///
    /// </div>
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mcp_servers: Option<HashMap<String, serde_json::Value>>,
    /// Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub model: Option<String>,
    /// Whether authored models are preferences or required constraints.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub model_policy: Option<AgentModelPolicy>,
    /// Authored preferred model ids for this agent, in priority order. Runtime model selection chooses the first available model; omitted means no authored preference.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub models: Option<Vec<String>>,
    /// Name of the agent. Use `id` as the stable selection identifier.
    pub name: String,
    /// Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// Authored base prompt for the agent. Runtime prompt assembly may add dynamic context at invocation time. Omitted from `session.agent.list` unless `includePrompt` is true.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub prompt: Option<String>,
    /// Authored reasoning effort for this agent. Applied on selection to models that support it; omitted means no authored preference.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reasoning_effort: Option<String>,
    /// Skill names preloaded into this agent's context. Omitted means none.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub skills: Option<Vec<String>>,
    /// Where the agent definition was loaded from
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source: Option<AgentInfoSource>,
    /// Allowed tool names for this agent. Empty array means none; omitted means inherit defaults.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tools: Option<Vec<String>>,
    /// Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub user_invocable: Option<bool>,
}

/// Pointer to a GitHub repository.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GitHubRepoRef {
    /// Numeric GitHub repository id
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    /// Repository name (without owner)
    pub name: String,
    /// Repository owner login (user or organization)
    pub owner: String,
}

/// A provider offered for interactive login.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ProviderDescriptor {
    /// Whether this provider is currently available to sign in with.
    pub available: bool,
    /// The neutral provider kind.
    pub kind: LoginProviderKind,
    /// Human-readable menu label, owned by the runtime so every consumer renders identical text.
    pub label: String,
}

/// A credential-free account choice after sign-in.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AuthLoginAccount {
    /// Host coordinate owned by the selected account's provider.
    pub host: String,
    /// Provider kind that owns this account choice.
    pub kind: AccountKind,
    /// Human-readable login for the account choice.
    pub login: String,
    /// Opaque identifier supplied to the next login step to select this account.
    pub selection_id: String,
}

///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AuthLoginStepOpenUrl {
    /// Login flow step variant discriminator.
    pub kind: AuthLoginStepOpenUrlKind,
    /// Authorize URL the consumer should open in a browser (consumer-driven browser-open).
    pub url: String,
}

///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AuthLoginStepInputRequired {
    /// Login flow step variant discriminator.
    pub kind: AuthLoginStepInputRequiredKind,
    /// Prompt for the value the provider needs; the consumer supplies it as advance input (e.g. a GitHub Enterprise Cloud host, *.ghe.com).
    pub prompt: String,
}

///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AuthLoginStepAwaiting {
    /// Login flow step variant discriminator.
    pub kind: AuthLoginStepAwaitingKind,
}

///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AuthLoginStepNeedsInteraction {
    /// Login flow step variant discriminator.
    pub kind: AuthLoginStepNeedsInteractionKind,
}

/// Result of an interactive login flow. Pending consent or account selection is not terminal.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AuthLoginResultDto {
    /// Available accounts when sign-in is awaiting account selection, ordered with Microsoft 365 first.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub accounts: Option<Vec<AuthLoginAccount>>,
    /// Host that was signed in, when completed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub host: Option<String>,
    /// Login that was signed in, when completed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub login: Option<String>,
    /// Current disposition of the login, including pending user decisions.
    pub status: AuthLoginResultStatus,
}

///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AuthLoginStepCompleted {
    /// Login flow step variant discriminator.
    pub kind: AuthLoginStepCompletedKind,
    /// Login result. When status is needs-plaintext-consent or needs-account-selection, advance with the user's decision to continue.
    pub result: AuthLoginResultDto,
}

///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AuthLoginStepError {
    /// Login flow step variant discriminator.
    pub kind: AuthLoginStepErrorKind,
    /// Human-readable failure message.
    pub message: String,
}

/// Validation error from an authentication attempt.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AuthValidationError {
    /// Optional message returned by GitHub
    #[serde(skip_serializing_if = "Option::is_none")]
    pub github_message: Option<String>,
    /// Authentication validation error message
    pub message: String,
}

/// Current per-window credit limit and consumption for an autopilot objective.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AutopilotObjectiveCreditLimit {
    /// Configured AI-credit cap, when one is set.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub credits: Option<f64>,
    /// Window consumption in fractional AI credits, for display.
    pub credits_used: f64,
    /// Exact window consumption in non-negative integer nano-AIU, encoded as a decimal string.
    pub credits_used_nano_aiu: String,
}

/// Public, persistence-independent projection of an autopilot objective.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AutopilotObjectiveState {
    /// Optional summary recorded when the objective completed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub completion_summary: Option<String>,
    /// Exact lifetime AI-credit consumption in non-negative integer nano-AIU, encoded as a decimal string.
    pub credit_count_nano_aiu: String,
    /// Current per-window consumption and optional cap, when a credit-tracking window is present.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub credit_limit: Option<AutopilotObjectiveCreditLimit>,
    /// Session-local objective identifier.
    pub id: i64,
    /// User-provided objective text.
    pub objective: String,
    /// Optional reason the objective is paused.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pause_reason: Option<String>,
    /// Current normalized lifecycle status.
    pub status: AutopilotObjectiveStatus,
    /// Number of objective turns started.
    pub turn_count: i64,
}

///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AutopilotOptions {
    /// Enable runtime-owned automatic continuation while in Autopilot mode. Defaults to true for SDK sessions; does not change the session mode.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub continuation_enabled: Option<bool>,
    /// Maximum automatic continuations outside an active objective. Zero allows none; defaults to five. Omitted values preserve the current limit on update or warm resume.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_continues: Option<i64>,
}

/// Server-driven promotion for an Auto routing preference. It can be announced before it starts.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AutoTierBillingPromo {
    /// Percentage discount (0-100) while the promotion is active. Absent or 0 means the promotion is an announcement only: do not present a discount.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub discount_percent: Option<f64>,
    /// UTC ISO 8601 timestamp marking when the promotion ends. Absent means open-ended. The runtime omits promotions that have already ended.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ends_at: Option<String>,
    /// Stable identifier for the promotion campaign.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Human-readable promotion message. Does not include the start or end timestamps.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// Whether the service asked hosts to give this promotion a prominent surface, such as a banner. Absent means the service expressed no preference, so hosts should apply their own default rather than read it as `false`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub show_banner: Option<bool>,
    /// UTC ISO 8601 timestamp marking when the promotion starts. The service can announce a promotion before it starts, so do not present the discount as active before this time. Absent means it has already started.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub starts_at: Option<String>,
}

/// Billing information for a server-advertised routing preference.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AutoTierBilling {
    /// Promotion the service attached to this preference, if any.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub promo: Option<AutoTierBillingPromo>,
}

/// Availability of a server-advertised routing preference.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AutoTierStatus {
    /// Whether the provider permits selecting this preference.
    pub enabled: bool,
    /// Human-readable explanation of availability.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// Whether hosts should list this preference in a picker. Absent means visible. A hidden preference can still be requested explicitly through the SDK.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub picker_visible: Option<bool>,
    /// Extensible machine-readable unavailability reason.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reason: Option<String>,
}

/// A server-advertised routing preference. Identifiers and execution types are extensible.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AutoTierDescriptor {
    /// Billing information for this preference, such as an announced or active promotion.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub billing: Option<AutoTierBilling>,
    /// Description displayed beside the preference.
    pub description: String,
    /// Human-readable label, not a routing identifier.
    pub display_name: String,
    /// Runtime-owned managed Fusion tier represented by this execution descriptor, if any.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub fusion_tier: Option<String>,
    /// Opaque routing identifier transmitted unchanged to the provider.
    pub id: String,
    /// Current account-specific availability.
    pub status: AutoTierStatus,
    /// Execution kind; supported preferences use `auto` or the runtime's `fusion` modes.
    pub r#type: String,
}

/// Account-bound discovery metadata for the virtual `auto` model.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AutoTierMetadata {
    /// Provider-default preference, used only when no explicit preference exists.
    pub default_tier: String,
    /// Provider that supplied this metadata, when the catalog is provider-attributed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provider_id: Option<String>,
    /// Routing preferences in the server's presentation order.
    pub tiers: Vec<AutoTierDescriptor>,
}

/// A well-known model in the runtime's built-in catalog.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BuiltInModelCatalogEntry {
    /// Well-known runtime model ID suitable for provider or provider-model metadata. This is not necessarily the provider-facing deployment or model name and does not indicate CAPI entitlement or provider availability.
    pub id: String,
}

/// Canvas action that the agent or host can invoke. To discover the input schema for a particular action, call the list_canvas_capabilities tool.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CanvasAction {
    /// Description of the action
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// JSON Schema for the action input
    #[serde(skip_serializing_if = "Option::is_none")]
    pub input_schema: Option<serde_json::Value>,
    /// Action name exposed by the canvas provider
    pub name: String,
}

/// Canvas available in the current session.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DiscoveredCanvas {
    /// Actions the agent or host may invoke on an open instance
    #[serde(skip_serializing_if = "Option::is_none")]
    pub actions: Option<Vec<CanvasAction>>,
    /// Provider-local canvas identifier
    pub canvas_id: String,
    /// Short, single-sentence description shown to the agent in canvas catalogs.
    pub description: String,
    /// Human-readable canvas name
    pub display_name: String,
    /// Owning provider identifier
    pub extension_id: String,
    /// Owning extension display name, when available
    #[serde(skip_serializing_if = "Option::is_none")]
    pub extension_name: Option<String>,
    /// Host-local PNG path for the canvas icon, when supplied
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icon: Option<String>,
    /// JSON Schema for canvas open input
    #[serde(skip_serializing_if = "Option::is_none")]
    pub input_schema: Option<serde_json::Value>,
}

/// Open canvas instance snapshot.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct OpenCanvasInstance {
    /// Provider-local canvas identifier
    pub canvas_id: String,
    /// Owning provider identifier
    pub extension_id: String,
    /// Owning extension display name, when available
    #[serde(skip_serializing_if = "Option::is_none")]
    pub extension_name: Option<String>,
    /// Host-local PNG path for the canvas icon, when supplied
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icon: Option<String>,
    /// Input supplied when the instance was opened
    #[serde(skip_serializing_if = "Option::is_none")]
    pub input: Option<serde_json::Value>,
    /// Stable caller-supplied canvas instance identifier
    pub instance_id: String,
    /// Provider-supplied status text
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Rendered title
    #[serde(skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// URL for web-rendered canvases
    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
}

/// Options scoped to the built-in CAPI (Copilot API) provider.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CapiSessionOptions {
    /// Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. `fast` is an integrator-only latency preset, not a first-party GitHub Copilot product preference.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub auto_tier: Option<AutoTier>,
    /// Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enable_web_socket_responses: Option<bool>,
}

/// An optional catalog authentication exchange did not establish the caller's identity. Anonymous search remains supported; this refusal is reserved for an operation that cannot continue after the attempted exchange. It is distinct from `policy-rejected` and from a network failure, and the reason identifies the recovery action.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogAuthenticationRequiredError {
    /// Discriminator: the caller is not authenticated
    pub kind: CatalogAuthenticationRequiredErrorKind,
    /// Human-readable explanation, safe to surface. Never contains a credential or token, nor a query, URL, handle, or secret.
    pub message: String,
    /// Why authentication failed. Only an expired credential justifies attempting a silent refresh; an absent or rejected credential requires sign-in.
    pub reason: CatalogAuthenticationRequiredReason,
}

/// The protocol version and capability set a caller requires, supplied on every catalog request so negotiation cannot be skipped by omission.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogClientContract {
    /// SDK protocol version the caller was generated against. A caller below the runtime's minimum supported version is refused rather than served a partial result.
    pub protocol_version: i64,
    /// Wire features the caller requires the runtime to understand. Identifiers are bounded but extensible so a newer caller can negotiate with an older runtime. Requiring an unknown feature yields a typed refusal listing what is understood, never a partial grant. A grant does not promise that a deployment has enabled the operation; typed unavailable results report that separately.
    pub required_capabilities: Vec<String>,
}

/// An upstream catalog response broke the wire contract. Most importantly, every result must carry exactly one of a URL or embedded data: a result carrying both, or neither, is refused here rather than being guessed at.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogContractViolationError {
    /// Discriminator: the upstream response broke the contract
    pub kind: CatalogContractViolationErrorKind,
    /// Human-readable explanation, safe to surface. Never echoes response content, nor a query, URL, handle, or secret.
    pub message: String,
    /// Which rule the response broke.
    pub reason: CatalogContractViolationReason,
}

/// The protocol version and capability set the runtime actually honoured for a successful catalog operation.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogNegotiatedContract {
    /// Wire features the runtime understood for this operation. Includes the five original catalog capabilities and only explicitly requested supported additions, in supported order without duplicates. Capabilities that introduce new success-union variants or operations are therefore included only when explicitly required, preserving older protocol-v3 clients. Always a superset of the caller's required features, because any shortfall is a refusal instead. Operation availability remains a separate typed result.
    pub granted_capabilities: Vec<CatalogCapability>,
    /// Protocol version of the runtime that served the request.
    pub runtime_protocol_version: i64,
}

/// The request was rejected because a bounded field fell outside its permitted range or a required field was unusable. Pagination may also be rejected by the authority after a continuation request; repeat the search without page.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogInvalidRequestError {
    /// Which request field was rejected.
    pub field: CatalogInvalidRequestField,
    /// Discriminator: the request itself was invalid
    pub kind: CatalogInvalidRequestErrorKind,
    /// Human-readable explanation, safe to surface. Never echoes the offending value, nor a query, URL, handle, or secret.
    pub message: String,
}

/// A card could not be parsed or did not satisfy its declared media type's schema.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogMalformedCardError {
    /// Discriminator: the card was malformed
    pub kind: CatalogMalformedCardErrorKind,
    /// Media type the card was interpreted as, when it declared one this runtime recognises.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub media_type: Option<CatalogMediaType>,
    /// Human-readable explanation, safe to surface. Never echoes card content, nor a query, URL, handle, or secret.
    pub message: String,
    /// How the card failed validation.
    pub reason: CatalogMalformedCardReason,
}

/// The caller's protocol version or required capabilities cannot be honoured. Returned instead of a partial or ambiguous success.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogNegotiationRefusedError {
    /// Discriminator: capability or protocol-version negotiation failed
    pub kind: CatalogNegotiationRefusedErrorKind,
    /// Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret.
    pub message: String,
    /// Lowest caller protocol version this runtime will serve.
    pub minimum_supported_protocol_version: i64,
    /// Whether the version or the capability set was the problem.
    pub reason: CatalogNegotiationRefusedReason,
    /// Protocol version of the runtime that refused the request.
    pub runtime_protocol_version: i64,
    /// Capabilities this runtime can safely advertise to this caller. The complete five-capability protocol-3 legacy set is always present; every capability added after that baseline appears only when the caller required it, so an older closed-enum decoder can still consume a refusal. This list does not imply that every deployment has enabled every operation.
    pub supported_capabilities: Vec<String>,
    /// The subset of the caller's bounded extensible capability identifiers this runtime cannot honour.
    pub unsupported_capabilities: Vec<String>,
}

/// The runtime could not reach the catalog authority or retrieve a card. Covers being offline as well as transport-level failure.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogNetworkFailureError {
    /// Discriminator: the network operation failed
    pub kind: CatalogNetworkFailureErrorKind,
    /// Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret.
    pub message: String,
    /// Categorised failure, low cardinality so it can be aggregated without carrying a URL.
    pub reason: CatalogNetworkFailureReason,
    /// Bounded cooldown in seconds before another catalog request should be attempted, when the authority supplied a numeric Retry-After value or the runtime applied its documented fallback.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub retry_after_seconds: Option<i32>,
    /// HTTP status code, when the failure was a rejected response.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status_code: Option<i32>,
}

/// Registry or enterprise policy refused the operation.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogPolicyRejectedError {
    /// Discriminator: policy refused the operation
    pub kind: CatalogPolicyRejectedErrorKind,
    /// Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret.
    pub message: String,
    /// Which authority produced the decision.
    pub source: McpPlanPolicySource,
}

/// Catalogue identity retained from a bound candidate or plan at installation time.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct InstallationCatalogueIdentity {
    /// Catalogue description retained at install planning time.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Human display name retained from the catalogue candidate.
    pub display_name: String,
    /// HTTPS URL of the resource's icon on raw.githubusercontent.com, retained from the catalogue
    /// candidate. Untrusted external content: load it without credentials. Omitted when the
    /// candidate had none.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icon_url: Option<String>,
    /// Catalogue item URL when supplied by the authority.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub item_url: Option<String>,
    /// Catalogue publisher retained at install planning time.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub publisher: Option<String>,
    /// Authority resource identifier when supplied by the catalogue.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resource_id: Option<String>,
    /// Catalogue authority/source string that supplied the candidate.
    pub source: String,
    /// Catalogue trust observation retained at install planning time.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub trust_at_install: Option<serde_json::Value>,
    /// Catalogue version retained at install planning time.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// One reviewed Skill file.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SkillInstallationFileReview {
    /// SHA-256 digest of the exact file bytes.
    pub digest: String,
    /// Whether the file is installed with executable permissions.
    pub executable: bool,
    /// Declared media type for the file.
    pub media_type: String,
    /// Relative file path within the Skill root.
    pub path: String,
    /// Exact reviewed file size in bytes.
    pub size_bytes: i64,
}

/// Source identity retained from Agent Finder and the pinned GitHub descriptor.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SkillInstallationSource {
    /// Digest of the descriptor's bundle manifest.
    pub bundle_digest: String,
    /// Agent Finder materialisation revision identifier.
    pub catalog_revision_id: String,
    /// Digest of the canonical materialisation descriptor.
    pub descriptor_digest: String,
    /// Repository full name, for example owner/name.
    pub repository: String,
    /// GitHub repository database identifier.
    pub repository_id: String,
    /// Agent Finder resource identifier.
    pub resource_id: String,
    /// Pinned Git commit revision.
    pub revision: String,
    /// Root path within the pinned repository.
    pub root: String,
}

/// A user-facing personal Skill installation location without absolute host paths.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SkillInstallationLocation {
    /// Diagnostics-only absolute host path. Hosts must not display it by default.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub diagnostics_absolute_path: Option<String>,
    /// Safe display label, for example ~/.copilot/skills/run-checks.
    pub display_label: String,
    /// Path relative to the Copilot home.
    pub relative_path: String,
    /// Installation scope. Agent Finder Skills are installed in the user's personal Copilot home.
    pub scope: SkillInstallationScope,
}

/// Review for installing a verified Skill.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SkillInstallationReviewInstall {
    /// Exact reviewed Skill installation action.
    pub action: SkillInstallationReviewInstallAction,
    /// Catalogue identity retained from the bound candidate before consent.
    pub catalogue: InstallationCatalogueIdentity,
    /// Skill description from SKILL.md when present.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Complete verified SKILL.md content. Planning refuses with review-too-large
    /// when this exceeds 262144 UTF-8 bytes; it is never truncated.
    pub entrypoint_content: String,
    /// Relative path of the verified Skill entrypoint.
    pub entrypoint_path: String,
    /// Reviewed files and digests.
    pub files: Vec<SkillInstallationFileReview>,
    /// Installing never grants immediate use; the Skill is written disabled.
    pub installs_disabled: bool,
    /// Skill invocation name from SKILL.md.
    pub name: String,
    /// Exact verified source identity.
    pub source: SkillInstallationSource,
    /// Exact user-scope target location without an absolute host path.
    pub target: SkillInstallationLocation,
    /// Total reviewed payload size in bytes.
    pub total_bytes: i64,
}

/// Durable verified Skill ownership summary.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SkillInstallationSummary {
    /// Catalogue identity retained at install time.
    pub catalogue: InstallationCatalogueIdentity,
    /// Persisted enablement requested for this installation.
    pub configured_enabled: bool,
    /// Exact durable installation receipt identity.
    pub installation_id: String,
    /// ISO 8601 wall-clock installation time.
    pub installed_at: String,
    /// Skill invocation name.
    pub name: String,
    /// Operation that installed this Skill.
    pub operation_id: String,
    /// Ownership state observed from files and receipts.
    pub ownership_state: SkillInstallationOwnershipState,
    /// Bound-session load observation.
    pub session_state: SkillInstallationSessionState,
    /// Exact retained verified source identity.
    pub source: SkillInstallationSource,
    /// User-facing installation location without an absolute host path.
    pub target: SkillInstallationLocation,
}

/// Review for uninstalling an owned verified Skill.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SkillInstallationReviewUninstall {
    /// Exact reviewed Skill installation action.
    pub action: SkillInstallationReviewUninstallAction,
    /// Catalogue identity retained at install time.
    pub catalogue: InstallationCatalogueIdentity,
    /// Files recorded by the installation receipt.
    pub files: Vec<SkillInstallationFileReview>,
    /// Whether current files differ from the receipt. Apply refuses drift.
    pub files_modified: bool,
    /// Owned installation being removed.
    pub installation: SkillInstallationSummary,
    /// Total receipt-owned payload size in bytes.
    pub total_bytes: i64,
}

/// A computed Skill install plan. Nothing has been applied.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SkillInstallPlan {
    /// Original wall-clock expiry as an ISO 8601 timestamp.
    pub expires_at: String,
    /// Original operation identifier returned before confirmation.
    pub operation_id: String,
    /// One-use plan handle, bound to the original candidate authority.
    pub plan_handle: String,
    /// Safe review to present before applying the plan.
    pub review: SkillInstallationReview,
}

/// One reviewed plugin file.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PluginInstallationFileReview {
    /// SHA-256 digest of the exact file bytes.
    pub digest: String,
    /// Whether the file is installed with executable permissions.
    pub executable: bool,
    /// Declared media type for the file.
    pub media_type: String,
    /// Relative file path within the plugin root.
    pub path: String,
    /// Exact reviewed file size in bytes.
    pub size_bytes: i64,
}

/// One MCP server a reviewed plugin declares.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PluginInstallationMcpServerReview {
    /// Host of a remote server's URL.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub host: Option<String>,
    /// Server name as the plugin declares it.
    pub name: String,
    /// `remote` for an HTTP or SSE server, `local` for a command the plugin runs.
    pub transport: PluginInstallationMcpTransport,
}

/// Source identity retained from Agent Finder and the pinned GitHub descriptor.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PluginInstallationSource {
    /// Digest of the descriptor's bundle manifest.
    pub bundle_digest: String,
    /// Agent Finder materialisation revision identifier.
    pub catalog_revision_id: String,
    /// Digest of the canonical materialisation descriptor.
    pub descriptor_digest: String,
    /// Repository full name, for example owner/name.
    pub repository: String,
    /// GitHub repository database identifier.
    pub repository_id: String,
    /// Agent Finder resource identifier.
    pub resource_id: String,
    /// Pinned Git commit revision.
    pub revision: String,
    /// Plugin root within the pinned repository. Empty for the repository root.
    pub root: String,
}

/// Where a plugin is installed, without an absolute host path.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PluginInstallationLocation {
    /// Safe display label, for example ~/.copilot/installed-plugins/_direct/owner--repo--plugins-work-hub.
    pub display_label: String,
    /// Path relative to the Copilot home, under installed-plugins/_direct like any direct plugin install.
    pub relative_path: String,
}

/// Review for installing a verified Agent Plugin.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PluginInstallPlanReview {
    /// Exact reviewed Agent Plugin installation action.
    pub action: PluginInstallPlanReviewAction,
    /// Catalogue identity retained from the bound candidate, or verified data for a reference.
    pub catalogue: InstallationCatalogueIdentity,
    /// Manifest description when present.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Reviewed files and digests.
    pub files: Vec<PluginInstallationFileReview>,
    /// Installing never grants immediate use; the plugin is registered disabled.
    pub installs_disabled: bool,
    /// Complete verified manifest content. Planning refuses with review-too-large
    /// when this exceeds 262144 UTF-8 bytes; it is never truncated.
    pub manifest_content: String,
    /// Relative path of the verified plugin manifest.
    pub manifest_path: String,
    /// MCP servers the verified files declare, exactly as an install of these files loads
    /// them. Omitted when the plugin declares none.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mcp_servers: Option<Vec<PluginInstallationMcpServerReview>>,
    /// Installed plugin name, derived from the verified manifest exactly as a direct install derives it.
    pub name: String,
    /// Exact verified source identity.
    pub source: PluginInstallationSource,
    /// Exact install location without an absolute host path.
    pub target: PluginInstallationLocation,
    /// Total reviewed payload size in bytes.
    pub total_bytes: i64,
    /// Manifest version when present.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// A computed Agent Plugin install plan. Nothing has been applied.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PluginInstallPlan {
    /// Original wall-clock expiry as an ISO 8601 timestamp.
    pub expires_at: String,
    /// Original operation identifier returned before confirmation.
    pub operation_id: String,
    /// One-use plan handle, bound to the original authority.
    pub plan_handle: String,
    /// Safe review to present before applying the plan.
    pub review: PluginInstallPlanReview,
}

/// Retrieval was refused by the runtime's hardened fetch boundary before any request left the process, or before a redirect was followed.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogUnsafeRetrievalError {
    /// Discriminator: retrieval was refused as unsafe
    pub kind: CatalogUnsafeRetrievalErrorKind,
    /// Human-readable explanation, safe to surface. Never contains the refused URL, nor a query, handle, or secret.
    pub message: String,
    /// Which control refused the retrieval, low cardinality so it can be aggregated without carrying a URL.
    pub reason: CatalogUnsafeRetrievalReason,
}

/// The operation is not available on this runtime. Distinct from a network failure: nothing was attempted.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogUnavailableError {
    /// Discriminator: the operation is not available
    pub kind: CatalogUnavailableErrorKind,
    /// Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret.
    pub message: String,
    /// Why the operation is unavailable.
    pub reason: CatalogUnavailableReason,
}

/// Authority-reported navigation metadata, returned only to callers requiring catalog-search-pagination and only when a supported token is present. Tokenless first-page and continuation responses omit this object; no counts are inferred from candidates. The opaque token may be retained for previous or numbered navigation even when hasNextPage is false.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogSearchPagination {
    /// One-based page returned by the authority.
    pub current_page: i32,
    /// Whether the authority token advertises a valid next target within the navigation window. Not inferred from token presence, truncated, or currentPage being less than pageCount.
    pub has_next_page: bool,
    /// Navigation window ceiling ceil(1000 / pageSize), not the number of existing pages. Legal targets must not exceed this ceiling or the token's signed pageCount.
    pub max_page: i32,
    /// Backend-reported page count, which may exceed maxPage. Present pagination metadata always describes a multi-page result; zero- and single-page responses omit pagination. Navigation targets must also be within the signed pageCount carried by the supplied token.
    pub page_count: i64,
    /// Page size bound to the search, equal to the effective request limit.
    pub page_size: i32,
    /// Opaque pagination token. Session-bound search returns an expiring runtime-owned reference retaining the exact private authority token, original search and authority. Legacy unbound search returns the authority token unchanged, without a runtime-created expiry. Only the runtime unwraps tokens or changes targetPage; SDK consumers must not decode, modify or log them.
    pub token: String,
    /// Backend-reported count for this response, not the number of returned candidates. Its relationship to the full query result set is unknown.
    pub total_count: i64,
    /// The relationship of totalCount to the complete query result set is unknown; neither exactness nor a lower-bound guarantee is implied.
    pub total_count_relation: CatalogSearchTotalCountRelation,
}

/// A literal choice the command input accepts, with a human-facing description
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SlashCommandInputChoice {
    /// Human-readable description shown alongside the choice
    pub description: String,
    /// The literal choice value (e.g. 'on', 'off', 'show')
    pub name: String,
}

/// Optional unstructured input hint
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SlashCommandInput {
    /// Optional literal choices the input accepts, each with a human-facing description; clients may render these as selectable options
    #[serde(skip_serializing_if = "Option::is_none")]
    pub choices: Option<Vec<SlashCommandInputChoice>>,
    /// Optional completion hint for the input (e.g. 'directory' for filesystem path completion)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub completion: Option<SlashCommandInputCompletion>,
    /// Hint to display when command input has not been provided
    pub hint: String,
    /// When true, clients should pass the full text after the command name as a single argument rather than splitting on whitespace
    #[serde(skip_serializing_if = "Option::is_none")]
    pub preserve_multiline_input: Option<bool>,
    /// When true, the command requires non-empty input; clients should render the input hint as required
    #[serde(skip_serializing_if = "Option::is_none")]
    pub required: Option<bool>,
}

/// Slash-command metadata with name, aliases, description, kind, input hint, execution allowance, and schedulability.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SlashCommandInfo {
    /// Canonical aliases without leading slashes
    #[serde(skip_serializing_if = "Option::is_none")]
    pub aliases: Option<Vec<String>>,
    /// Whether the command may run while an agent turn is active
    pub allow_during_agent_execution: bool,
    /// Human-readable command description
    pub description: String,
    /// Whether the command is experimental
    #[serde(skip_serializing_if = "Option::is_none")]
    pub experimental: Option<bool>,
    /// Optional unstructured input hint
    #[serde(skip_serializing_if = "Option::is_none")]
    pub input: Option<SlashCommandInput>,
    /// Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command
    pub kind: SlashCommandKind,
    /// Canonical command name without a leading slash
    pub name: String,
    /// Whether the command may be the target of `/every` / `/after` schedules. Resolution happens at every tick, so only set this when the command is safe to re-invoke and produces an agent prompt.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub schedulable: Option<bool>,
}

/// A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` (UTF-16 code units) in the composer with `insertText`; when the range is absent, the active token around the cursor is replaced.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SessionCompletionItem {
    /// Text spliced into the composer when the item is accepted.
    pub insert_text: String,
    /// Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the host's display kind.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// Primary display label for the picker row. Falls back to `insertText` when absent.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    /// End (exclusive) of the replacement range in `text`, in UTF-16 code units.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub range_end: Option<i64>,
    /// Start of the replacement range in `text`, in UTF-16 code units.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub range_start: Option<i64>,
}

/// Repository associated with the connected remote session.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ConnectedRemoteSessionMetadataRepository {
    /// Branch associated with the remote session.
    pub branch: String,
    /// Repository name.
    pub name: String,
    /// Repository owner or organization login.
    pub owner: String,
}

/// Metadata for a connected remote session.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ConnectedRemoteSessionMetadata {
    /// Neutral SDK discriminator for the connected remote session kind.
    pub kind: ConnectedRemoteSessionMetadataKind,
    /// Last session update time as an ISO 8601 string.
    pub modified_time: String,
    /// Optional friendly session name.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Pull request number associated with the session.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pull_request_number: Option<i64>,
    /// Repository associated with the connected remote session.
    pub repository: ConnectedRemoteSessionMetadataRepository,
    /// Original remote resource identifier.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resource_id: Option<String>,
    /// SDK session ID for the connected remote session.
    pub session_id: SessionId,
    /// Remote session staleness deadline as an ISO 8601 string.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub stale_at: Option<String>,
    /// Session start time as an ISO 8601 string.
    pub start_time: String,
    /// Remote session state returned by the backing service.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub state: Option<String>,
    /// Optional session summary.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub summary: Option<String>,
}

/// Account-targeted authorization update required by the Connector service. The account ID is an opaque host routing identifier; no credential is included.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ConnectorAuthorizationRequirement {
    /// Exact opaque account selection that made the Connector request.
    pub account_id: String,
    /// Stable OAuth scope the selected account must grant.
    pub scope: ConnectorAuthorizationScope,
}

/// Credential-free Connector catalog entry.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ConnectorCatalogEntry {
    /// Untrusted service description, when present.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Untrusted display label from the service.
    pub display_name: String,
    /// Optional catalog logo.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub logo: Option<String>,
    /// Canonical Connector name used by lifecycle methods.
    pub name: String,
    /// Optional catalog release tag.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub release_tag: Option<String>,
    /// Opaque stable runtime IDs currently projected into the session for this Connector.
    pub runtime_server_ids: Vec<String>,
    /// Current authoritative service connection state.
    pub status: ConnectorCatalogStatus,
    /// Optional catalog tier.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tier: Option<String>,
}

/// Validated Connector catalog snapshot cached by the session.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ConnectorCatalogResult {
    /// Validated catalog entries in service order.
    pub connectors: Vec<ConnectorCatalogEntry>,
    /// Unix epoch milliseconds when this snapshot was accepted.
    pub refreshed_at_ms: i64,
    /// Monotonically increasing session-local catalog revision.
    pub revision: i64,
}

/// Live status of one session-owned MCP projection.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ConnectorRuntimeStatus {
    /// Canonical Connector name that owns this server.
    pub connector_name: String,
    /// Opaque runtime server ID.
    pub runtime_server_id: String,
    /// Current live MCP host status.
    pub status: ConnectorMcpStatus,
}

/// Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ConnectorStatus {
    /// Opaque account selection pinned to this session, when one has been selected.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    /// Connector API contract version.
    pub api_version: i64,
    /// Exact selected account and stable scope requiring an authorization update, when proven by the Connector service.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub authorization_requirement: Option<ConnectorAuthorizationRequirement>,
    /// Current feature and session availability.
    pub availability: ConnectorAvailability,
    /// Latest validated catalog snapshot, when available.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub catalog: Option<ConnectorCatalogResult>,
    /// Number of active opaque connection continuations.
    pub pending_connections: i64,
    /// Live MCP status for every Connector-owned runtime server.
    pub runtime_servers: Vec<ConnectorRuntimeStatus>,
}

/// Content-exclusion decision for one requested path.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ContentExclusionPathCheck {
    /// Whether the session's complete content-exclusion policy excludes the path.
    pub excluded: bool,
    /// The path supplied by the caller.
    pub path: String,
}

/// A single large message currently in context.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ContextHeaviestMessage {
    /// Stable identifier for this message within the snapshot.
    pub id: String,
    /// Human-readable source label, e.g. `tool: bash` or `skill: tmux`. Presentation-only.
    pub label: String,
    /// Role of the chat message (`user`, `assistant`, or `tool`).
    pub role: String,
    /// Token count currently in context for this individual message.
    pub tokens: i64,
}

/// The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CurrentModel {
    /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub activating_auto_tier: Option<AutoTier>,
    /// Auto preference currently committed for the session. This can remain available while another model is selected so a later switch to `auto` can reuse it.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub auto_tier: Option<AutoTier>,
    /// Context tier for models that support multiple context-window sizes.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub context_tier: Option<ContextTier>,
    /// Currently active model identifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub model_id: Option<String>,
    /// Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pending_auto_tier: Option<AutoTier>,
    /// Captured base model to restore when leaving plan mode. Omitted outside plan mode or when no plan override has captured a base model. Persistent agent model requirements apply to this model rather than the temporary plan model.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub plan_base_model_id: Option<String>,
    /// Provider of planBaseModelId, when that saved selection is provider-qualified.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub plan_base_provider_id: Option<String>,
    /// Provider selected for this model. Together with modelId, identifies a catalog entry even when providers serve the same model. Omitted for unattributed legacy selections.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provider_id: Option<String>,
    /// Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reasoning_effort: Option<String>,
}

/// A file included in the session debug bundle.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DebugCollectLogsCollectedEntry {
    /// Relative path of the file in the staged bundle/archive.
    pub bundle_path: String,
    /// Redacted output size in bytes.
    pub size_bytes: i64,
    /// Source category for this entry.
    pub source: DebugCollectLogsSource,
}

/// An optional debug bundle entry that could not be included.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DebugCollectLogsSkippedEntry {
    /// Relative path requested for this bundle entry.
    pub bundle_path: String,
    /// Server-local source path that could not be read.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// Reason the entry was skipped.
    pub reason: String,
}

/// MCP-specific detail for a source-discriminated diagnostic entry.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpDiagnosticDetails {
    /// Fresh identifier for the MCP connection attempt, including failed starts.
    pub connection_id: String,
    /// Serialized diagnostic detail. Protocol and HTTP records use JSON when detail is present.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub data: Option<String>,
    /// Protocol-frame direction when kind is protocol.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub direction: Option<McpDiagnosticDirection>,
    /// Diagnostic record category.
    pub kind: McpDiagnosticKind,
    /// Configured MCP server name.
    pub server_name: String,
}

/// MCP diagnostic source configuration.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpDiagnosticSourceConfiguration {
    /// Threshold to apply to MCP diagnostic producers in this session.
    pub level: DiagnosticLogLevel,
}

/// Typed diagnostic source configuration. At least one source is required by diagnostics configuration methods.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DiagnosticSourcesConfiguration {
    /// MCP diagnostic capture threshold. Omit to leave the current threshold unchanged.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mcp: Option<McpDiagnosticSourceConfiguration>,
}

/// Installed plugin that contributes a discovered extension.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DiscoveredExtensionPlugin {
    /// Installed plugin name
    pub name: String,
}

/// Discovered extension metadata and persistent enablement state.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DiscoveredExtension {
    /// Whether this extension's persistent per-ID preference is enabled
    pub enabled: bool,
    /// Source-qualified ID accepted by both server and session extension enablement methods
    pub id: String,
    /// Human-readable extension name
    pub name: String,
    /// Absolute path to the extension entry module, suitable for revealing it in a file manager
    pub path: String,
    /// Containing plugin metadata for plugin-contributed extensions
    #[serde(skip_serializing_if = "Option::is_none")]
    pub plugin: Option<DiscoveredExtensionPlugin>,
    /// Discovery source
    pub source: DiscoveredExtensionSource,
}

/// Vision-specific limits
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelCapabilitiesLimitsVision {
    /// Maximum image size in bytes
    #[serde(rename = "max_prompt_image_size")]
    pub max_prompt_image_size: i64,
    /// Maximum number of images per prompt
    #[serde(rename = "max_prompt_images")]
    pub max_prompt_images: i64,
    /// MIME types the model accepts
    #[serde(rename = "supported_media_types")]
    pub supported_media_types: Vec<String>,
}

/// Token limits for prompts, outputs, and context window
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelCapabilitiesLimits {
    /// Maximum total context window size in tokens
    #[serde(
        rename = "max_context_window_tokens",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_context_window_tokens: Option<i64>,
    /// Maximum number of output/completion tokens
    #[serde(rename = "max_output_tokens", skip_serializing_if = "Option::is_none")]
    pub max_output_tokens: Option<i64>,
    /// Maximum number of prompt/input tokens
    #[serde(rename = "max_prompt_tokens", skip_serializing_if = "Option::is_none")]
    pub max_prompt_tokens: Option<i64>,
    /// Vision-specific limits
    #[serde(skip_serializing_if = "Option::is_none")]
    pub vision: Option<ModelCapabilitiesLimitsVision>,
}

/// Feature flags indicating what the model supports
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelCapabilitiesSupports {
    /// Resolved Anthropic adaptive-thinking capability — unsupported / optional / required / adaptive_only. 'required' models reject thinking.type='enabled' with HTTP 400 but still accept 'disabled' (e.g. opus-4.7/4.8/5, sonnet-5); 'adaptive_only' models accept nothing but 'adaptive' (e.g. fable, mythos).
    #[serde(rename = "adaptive_thinking", skip_serializing_if = "Option::is_none")]
    pub adaptive_thinking: Option<AdaptiveThinkingSupport>,
    /// Whether this model supports reasoning effort configuration
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reasoning_effort: Option<bool>,
    /// Whether the model supports provider-native thinking. Independent of configurable reasoning effort; omission means unknown.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub thinking: Option<bool>,
    /// Whether this model supports canonical tool calling
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tool_calls: Option<bool>,
    /// Whether this model supports vision/image input
    #[serde(skip_serializing_if = "Option::is_none")]
    pub vision: Option<bool>,
}

/// Model capabilities and limits
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelCapabilities {
    /// Token limits for prompts, outputs, and context window
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limits: Option<ModelCapabilitiesLimits>,
    /// Feature flags indicating what the model supports
    #[serde(skip_serializing_if = "Option::is_none")]
    pub supports: Option<ModelCapabilitiesSupports>,
}

/// Provider-reported model artifact metadata.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelArtifactDetails {
    /// Provider-reported model architecture.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub architecture: Option<String>,
    /// Provider-reported model families.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub families: Option<Vec<String>>,
    /// Primary model family.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub family: Option<String>,
    /// Artifact format, such as `gguf`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub format: Option<String>,
    /// Provider-reported parameter count label.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub parameter_size: Option<String>,
    /// Provider-reported quantization label.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub quantization: Option<String>,
    /// Provider-reported tokenizer.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tokenizer: Option<String>,
}

/// Attribution for the adapter that produced a provider row.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelProviderProvenance {
    /// Stable opaque adapter identity from the effective catalog. Treat this as a whole identifier, not a parseable owner or kind.
    pub adapter_id: String,
    /// Human-readable contributor name, not the adapter display name.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub owner_display_name: Option<String>,
    /// Stable contributor identifier when the adapter has an owner outside the runtime. Independent of the contribution mechanism and not a routing key.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub owner_id: Option<String>,
    /// Descriptive provider family that produced this row; not a routing key.
    pub provider_kind: String,
    /// Kind of component that supplied the adapter.
    pub source: ModelProviderProvenanceSource,
}

/// A non-fatal provider observation warning.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelProviderWarning {
    /// Machine-readable warning code.
    pub code: String,
    /// Human-readable warning message.
    pub message: String,
}

/// A model offered for agent conversations. Missing capability metadata does not disqualify a candidate. Models known to be incompatible, such as embedding-only models, are excluded by the adapter.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DiscoveredModel {
    /// Provider-reported model capabilities. Omitted capability fields are unknown; explicit false values are preserved.
    pub capabilities: ModelCapabilities,
    /// Provider-reported model artifact details.
    pub details: ModelArtifactDetails,
    /// Provider-reported artifact digest.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub digest: Option<String>,
    /// Provider-native model identifier.
    pub id: String,
    /// Provider-reported last-modified timestamp.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub modified_at: Option<String>,
    /// Provider-reported display name.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Attribution for the adapter that produced this model row.
    pub provenance: ModelProviderProvenance,
    /// Provider-reported artifact size in bytes.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub size_bytes: Option<i64>,
    /// Non-fatal warnings encountered while enriching this model.
    pub warnings: Vec<ModelProviderWarning>,
}

/// Typed provider-operation outcome. Use the code for control flow and the optional message for display.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelProviderOperationOutcome {
    /// Machine-readable operation outcome.
    pub code: ModelProviderOperationOutcomeCode,
    /// Human-readable detail for non-success outcomes.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
}

/// An executable extension entry with runtime-verified plugin provenance.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EligiblePluginExtensionEntry {
    /// Runtime-discovered extension identifier.
    pub id: String,
    /// Absolute executable module path discovered under an eligible plugin root.
    pub module_path: String,
}

/// Discovered extension metadata, including source-qualified ID, name, discovery source, status, and optional process ID.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Extension {
    /// Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper', 'plugin:my-plugin:my-ext')
    pub id: String,
    /// Extension name (directory name)
    pub name: String,
    /// Process ID if the extension is running
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pid: Option<i64>,
    /// Discovery source: project (.github/extensions/), user (~/.copilot/extensions/), plugin (installed plugin), or session (session-state/`<id>`/extensions/)
    pub source: ExtensionSource,
    /// Current status: running, disabled, failed, or starting
    pub status: ExtensionStatus,
}

/// Binary result returned by a tool for the model
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExternalToolTextResultForLlmBinaryResultsForLlm {
    /// Base64-encoded binary data
    pub data: String,
    /// Human-readable description of the binary data
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Optional metadata from the producing tool.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<HashMap<String, serde_json::Value>>,
    /// MIME type of the binary data
    pub mime_type: String,
    /// Binary result type discriminator. Use "image" for images and "resource" for other binary data.
    pub r#type: ExternalToolTextResultForLlmBinaryResultsForLlmType,
}

/// Installed plugin record from global state, with marketplace, version, install time, enabled state, cache path, and source.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct InstalledPlugin {
    /// Path where the plugin is cached locally
    #[serde(rename = "cache_path", skip_serializing_if = "Option::is_none")]
    pub cache_path: Option<String>,
    /// Whether the plugin is currently enabled
    pub enabled: bool,
    /// Installation timestamp
    #[serde(rename = "installed_at")]
    pub installed_at: String,
    /// Absolute path of the marketplace directory a live plugin was resolved from. Present only on live, never-persisted records — those synthesized at session start for a directory/local marketplace, whose cache_path points at the real plugin directory on disk rather than a copy under the installed-plugins cache. Its presence is what marks a record as live, and no record carrying it is ever written to the persisted installedPlugins key.
    #[serde(rename = "installed_from", skip_serializing_if = "Option::is_none")]
    pub installed_from: Option<String>,
    /// Installation-time marketplace or direct source, independent of mutable marketplace aliases. Local paths are absolute. Absent for older installs; reinstall to record provenance.
    #[serde(rename = "installed_source", skip_serializing_if = "Option::is_none")]
    pub installed_source: Option<serde_json::Value>,
    /// Marketplace the plugin came from (empty string for direct repo installs)
    pub marketplace: String,
    /// Plugin name
    pub name: String,
    /// Source for direct repo installs (when marketplace is empty)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source: Option<serde_json::Value>,
    /// Per-plugin source fingerprint (a SHA-256 hash of the plugin's catalog source spec plus its resolved source subtree — NOT a Git commit SHA) captured at marketplace install/update time. Auto-update compares it against the freshly recomputed fingerprint to detect a content change that does not bump the version. Absent for pre-existing installs and for direct (non-marketplace) installs.
    #[serde(rename = "source_sha", skip_serializing_if = "Option::is_none")]
    pub source_sha: Option<String>,
    /// Version installed (if available)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// Post-compaction context window usage breakdown
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HistoryCompactContextWindow {
    /// Token count from non-system messages (user, assistant, tool)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub conversation_tokens: Option<i64>,
    /// Current total tokens in the context window (system + conversation + tool definitions)
    pub current_tokens: i64,
    /// Current number of messages in the conversation
    pub messages_length: i64,
    /// Token count from system message(s)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub system_tokens: Option<i64>,
    /// Maximum token count for the model's context window
    pub token_limit: i64,
    /// Token count from tool definitions
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tool_definitions_tokens: Option<i64>,
}

/// A root user turn that the session can rewind to.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HistoryRewindPoint {
    /// Whether at least one file in this turn or a later turn can be restored.
    pub can_restore_files: bool,
    /// ID of the user.message event that begins the discarded suffix.
    pub event_id: String,
    /// Number of unique files in this turn and all later turns that have captured changes.
    pub file_count: i64,
    /// Whether this turn was an automatically injected autopilot continuation.
    pub is_autopilot_continuation: bool,
    /// Lines added by this turn's captured file changes.
    pub lines_added: i64,
    /// Lines removed by this turn's captured file changes.
    pub lines_removed: i64,
    /// ISO timestamp of the user turn.
    pub timestamp: String,
    /// Whether this turn itself captured any file changes.
    pub turn_changed_files: bool,
    /// User-visible message text for the turn.
    pub user_message: String,
}

/// A file that a conversation-and-files rewind would restore.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HistoryRewindFilePreview {
    /// Aggregate change made across the discarded turns.
    pub change_type: HistoryRewindChangeType,
    /// Lines added across the discarded turns.
    pub lines_added: i64,
    /// Lines removed across the discarded turns.
    pub lines_removed: i64,
    /// Absolute path of the captured file.
    pub path: String,
}

/// A captured file that rewind intentionally left unchanged.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HistorySkippedFileRestore {
    /// Absolute path of the skipped file.
    pub path: String,
    /// Reason the file was not restored.
    pub reason: HistoryFileRestoreSkipReason,
}

/// The GitHub repository and commit an installed plugin is pinned to.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct InstalledPluginVerifiedSource {
    /// GitHub repository in `owner/repo` form.
    pub repository: String,
    /// Full 40-character hexadecimal commit SHA the plugin is pinned to.
    pub revision: String,
}

/// Information about an installed plugin tracked in global state.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct InstalledPluginInfo {
    /// Description from the manifest of the installed copy. Present only for a direct install pinned to one GitHub commit, such as a verified install from GitHub.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Opaque, stable hash identifying a direct (non-marketplace) install source. Present only for direct repo / URL / local installs; absent for marketplace plugins. Same source yields the same id; distinct sources never collide.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub direct_source_id: Option<String>,
    /// Whether the plugin is currently enabled for new sessions
    pub enabled: bool,
    /// HTTPS URL of the plugin's icon on raw.githubusercontent.com, retained from the catalogue entry it was installed from. Untrusted external content: load it without credentials. Present only for a direct install pinned to one GitHub commit whose catalogue entry had an icon.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icon_url: Option<String>,
    /// Whether the managed desired plugin currently has an installed or live record. Set to false for a managed desired entry retained in the listing after installation or reconciliation failed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub installed: Option<bool>,
    /// Absolute path of the marketplace directory a live plugin was resolved from. Present only on live, never-persisted records — a plugin belonging to a directory/local marketplace, which is loaded from its real directory on every pass instead of a copy under the installed-plugins cache. Its presence is what marks a listed plugin as live: such a plugin is always present on disk, so `enabled` is its only meaningful state and it is never "not installed".
    #[serde(skip_serializing_if = "Option::is_none")]
    pub installed_from: Option<String>,
    /// Whether enterprise managed settings control this plugin's enabled state.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub managed: Option<bool>,
    /// The enabled state required by enterprise managed settings, when this plugin spec is managed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub managed_desired_enabled: Option<bool>,
    /// Marketplace the plugin came from. Empty string ("") for direct repo / URL / local installs.
    pub marketplace: String,
    /// Plugin name
    pub name: String,
    /// Runtime-reported plugin provenance. Currently set to "builtin" only for plugins registered through the trusted host built-in boundary; absent for installed, marketplace, direct, and live plugins.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source: Option<String>,
    /// The GitHub repository and commit a direct install is pinned to, from its install record. Present only for a direct install pinned to one GitHub commit, such as a verified install from GitHub; absent for marketplace, local and unpinned installs.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub verified_source: Option<InstalledPluginVerifiedSource>,
    /// Installed version (when reported by the plugin manifest)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// Loaded instruction source for a session, including path, content, category, location, applicability, and optional description.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct InstructionSource {
    /// Glob pattern(s) from frontmatter — when set, this instruction applies only to matching files
    #[serde(skip_serializing_if = "Option::is_none")]
    pub apply_to: Option<Vec<String>>,
    /// Raw content of the instruction file
    pub content: String,
    /// When true, this source starts disabled and must be toggled on by the user
    #[serde(skip_serializing_if = "Option::is_none")]
    pub default_disabled: Option<bool>,
    /// Short description (body after frontmatter) for use in instruction tables
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Unique identifier for this source (used for toggling)
    pub id: String,
    /// Human-readable label
    pub label: String,
    /// Where this source lives — used for UI grouping
    pub location: InstructionSourceLocation,
    /// The project path this source was discovered from. Only set by sessionless discovery for repository, working-directory, and project-scoped plugin sources, where it disambiguates sources across multiple workspace roots. The session-scoped getSources leaves it unset.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub project_path: Option<String>,
    /// File path relative to repo or absolute for home
    pub source_path: String,
    /// Category of instruction source — used for merge logic
    pub r#type: InstructionSourceType,
}

/// Plugin entry advertised by a marketplace.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MarketplacePluginInfo {
    /// Short description from the marketplace catalog, when present
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Plugin name as listed in the marketplace catalog
    pub name: String,
}

/// Registered marketplace summary.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MarketplaceInfo {
    /// Whether the managed marketplace currently resolved into the runtime marketplace registry. Set to false when the desired managed entry is retained for governance visibility after loading or reconciliation failed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub available: Option<bool>,
    /// True when this is a default marketplace shipped with the runtime. Defaults are not removable.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub is_default: Option<bool>,
    /// Whether enterprise managed settings provide and control this marketplace entry.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub managed: Option<bool>,
    /// Marketplace name (matches the @marketplace suffix in plugin specs)
    pub name: String,
    /// Human-readable description of where the marketplace data is fetched from (e.g. "GitHub: owner/repo").
    pub source: String,
}

/// Per-marketplace refresh result, including marketplace name, success flag, and optional failure error.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MarketplaceRefreshEntry {
    /// Error message (failure only)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// Marketplace name that was refreshed
    pub name: String,
    /// Whether the refresh succeeded
    pub success: bool,
}

/// MCP server allowed by policy, with server name and optional PII-free explanatory note.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpAllowedServer {
    /// Allowed server name
    pub name: String,
    /// PII-free note explaining why the server was allowed
    #[serde(skip_serializing_if = "Option::is_none")]
    pub redacted_note: Option<String>,
}

/// Capability negotiation snapshot
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpAppsDiagnoseCapability {
    /// Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers
    pub advertised: bool,
    /// Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on
    pub feature_flag_enabled: bool,
    /// Whether the session has the `mcp-apps` capability
    pub session_has_mcp_apps: bool,
}

/// What the server returned for this session
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpAppsDiagnoseServer {
    /// Whether the named server is currently connected
    pub connected: bool,
    /// Up to 5 tool names with `_meta.ui` for quick inspection
    pub sample_tool_names: Vec<String>,
    /// Total tools returned by the server's tools/list
    pub tool_count: f64,
    /// Tools whose `_meta.ui` is populated (resourceUri and/or visibility set)
    pub tools_with_ui_meta: f64,
}

/// Current host context
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpAppsHostContextDetails {
    /// Display modes the host supports
    #[serde(skip_serializing_if = "Option::is_none")]
    pub available_display_modes: Option<Vec<McpAppsHostContextDetailsAvailableDisplayMode>>,
    /// Current display mode (SEP-1865)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub display_mode: Option<McpAppsHostContextDetailsDisplayMode>,
    /// BCP-47 locale, e.g. 'en-US'
    #[serde(skip_serializing_if = "Option::is_none")]
    pub locale: Option<String>,
    /// Platform type for responsive design
    #[serde(skip_serializing_if = "Option::is_none")]
    pub platform: Option<McpAppsHostContextDetailsPlatform>,
    /// UI theme preference per SEP-1865
    #[serde(skip_serializing_if = "Option::is_none")]
    pub theme: Option<McpAppsHostContextDetailsTheme>,
    /// IANA timezone, e.g. 'America/New_York'
    #[serde(skip_serializing_if = "Option::is_none")]
    pub time_zone: Option<String>,
    /// Host application identifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub user_agent: Option<String>,
}

/// MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource metadata.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpAppsResourceContent {
    /// Resource-level metadata (CSP, permissions, etc.)
    #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
    pub meta: Option<HashMap<String, serde_json::Value>>,
    /// Base64-encoded binary content
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blob: Option<String>,
    /// MIME type of the content
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mime_type: Option<String>,
    /// Text content (e.g. HTML)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    /// The resource URI (typically ui://...)
    pub uri: String,
}

/// Observational state for a matching already materialized MCP server.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpConfiguredServerState {
    /// Observed connection error, when the materialized server failed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// Observed connection status. This is not a configuration or readiness guarantee.
    pub status: McpServerStatus,
    /// Whether the server's current connection has loaded its tool list (from tools/list or a cached snapshot). A connected server without loaded tools is still loading them; the change is signalled by session.mcp_server_tools_loaded. Absent when the runtime does not report it.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tools_loaded: Option<bool>,
}

/// Effective MCP configuration entry. Configuration enablement is distinct from the optional live observation.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpConfiguredServer {
    /// Human-readable display name supplied by configuration.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub display_name: Option<String>,
    /// Whether this configured server is enabled after session configuration and policy filtering.
    pub enabled: bool,
    /// Observed state from an already materialized matching server. Omitted when no live graph has this configured server; it never determines configuration enablement.
    pub live: McpConfiguredServerState,
    /// Server name (config key)
    pub name: String,
    /// Configuration provenance: user, workspace, plugin, builtin, or managed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source: Option<McpServerSource>,
    /// Plugin name that provided this server, when source is plugin.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source_plugin: Option<String>,
    /// Plugin version that provided this server, when source is plugin.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source_plugin_version: Option<String>,
}

/// MCP server whose connection attempt failed.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpFailedServer {
    /// The captured connection failure detail.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// The config key of the server that failed to connect.
    pub name: String,
}

/// MCP server filtered by policy, with name, reason, and optional redacted reason.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpFilteredServer {
    /// Deprecated. This field is no longer populated.
    #[doc(hidden)]
    #[deprecated]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enterprise_name: Option<String>,
    /// Filtered server name
    pub name: String,
    /// Human-readable filter reason
    pub reason: String,
    /// PII-free filter reason
    #[serde(skip_serializing_if = "Option::is_none")]
    pub redacted_reason: Option<String>,
}

/// Recorded MCP server connection failure.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpServerFailureInfo {
    /// Failure message produced when the MCP server connection failed.
    pub message: String,
    /// epoch-ms timestamp at which the failure was recorded.
    pub timestamp: i64,
}

/// Recorded MCP server pending-auth state.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpServerNeedsAuthInfo {
    /// epoch-ms timestamp at which the server signalled it needs authentication.
    pub timestamp: i64,
}

/// Host-level state, omitted when no MCP host is initialized.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpHostState {
    /// Names of currently-connected MCP clients.
    pub clients: Vec<String>,
    /// Configured servers that are explicitly disabled.
    pub disabled_servers: Vec<String>,
    /// Map of server name to recorded connection failure.
    pub failed_servers: HashMap<String, McpServerFailureInfo>,
    /// Configured servers filtered out by MCP server policy.
    pub filtered_servers: Vec<String>,
    /// Whether third-party MCP servers are policy-enabled for this session.
    pub mcp3p_enabled: bool,
    /// Map of server name to recorded pending-auth state.
    pub needs_auth_servers: HashMap<String, McpServerNeedsAuthInfo>,
    /// Names of servers with in-flight connection attempts.
    pub pending_connections: Vec<String>,
}

/// Normalized MCP Apps discovery metadata from a tool's `_meta.ui` block.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpToolUi {
    /// URI of the tool's MCP App resource, typically a `ui://` resource identifier. Use `session.mcp.resources.read` to fetch its HTML and resource metadata.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resource_uri: Option<String>,
    /// Tool visibility advertised by the server. When absent, MCP Apps defaults apply.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub visibility: Option<Vec<McpToolUiVisibility>>,
}

/// MCP tool metadata with tool name, optional description, and normalized MCP Apps discovery metadata.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpTools {
    /// Tool description, when provided.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Tool name.
    pub name: String,
    /// Normalized MCP Apps discovery metadata. An empty object indicates that a valid `_meta.ui` block was present without recognized fields.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ui: Option<McpToolUi>,
}

/// An argument accepted by an MCP prompt.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpPromptArgument {
    /// Argument-level metadata
    #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
    pub meta: Option<HashMap<String, serde_json::Value>>,
    /// Server-provided non-standard argument fields
    #[serde(skip_serializing_if = "Option::is_none")]
    pub additional_properties: Option<HashMap<String, serde_json::Value>>,
    /// Description of the argument
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Name of the argument
    pub name: String,
    /// Whether the argument is required; omission is distinct from false
    #[serde(skip_serializing_if = "Option::is_none")]
    pub required: Option<bool>,
}

/// An MCP prompt icon with standard size hints and preserved non-standard fields.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpPromptIcon {
    /// Server-provided non-standard icon fields
    #[serde(skip_serializing_if = "Option::is_none")]
    pub additional_properties: Option<HashMap<String, serde_json::Value>>,
    /// Icon MIME type, when known
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mime_type: Option<String>,
    /// Icon sizes, such as `48x48` or `any`
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sizes: Option<Vec<String>>,
    /// Icon URI
    pub src: String,
    /// Theme hint for this icon
    #[serde(skip_serializing_if = "Option::is_none")]
    pub theme: Option<String>,
}

/// An MCP prompt descriptor. Server-provided non-standard fields are exposed under `additionalProperties`.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpPrompt {
    /// Prompt-level metadata
    #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
    pub meta: Option<HashMap<String, serde_json::Value>>,
    /// Server-provided non-standard descriptor fields
    #[serde(skip_serializing_if = "Option::is_none")]
    pub additional_properties: Option<HashMap<String, serde_json::Value>>,
    /// Arguments accepted by the prompt
    #[serde(skip_serializing_if = "Option::is_none")]
    pub arguments: Option<Vec<McpPromptArgument>>,
    /// Description of what this prompt provides
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Icons associated with this prompt
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icons: Option<Vec<McpPromptIcon>>,
    /// The programmatic name of the prompt
    pub name: String,
    /// Human-readable display title
    #[serde(skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
}

/// An MCP prompt message with opaque JSON content preserved without flattening or content-type filtering.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpPromptMessage {
    /// Message-level metadata
    #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
    pub meta: Option<HashMap<String, serde_json::Value>>,
    /// Server-provided non-standard message fields
    #[serde(skip_serializing_if = "Option::is_none")]
    pub additional_properties: Option<HashMap<String, serde_json::Value>>,
    /// The original MCP content block, including nested metadata and unfamiliar content types
    pub content: serde_json::Value,
    /// The role of the message sender
    pub role: McpPromptRole,
}

/// Standard MCP resource annotations plus preserved non-standard annotation fields.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpResourceAnnotations {
    /// Server-provided non-standard annotation fields preserved from the MCP response
    #[serde(skip_serializing_if = "Option::is_none")]
    pub additional_properties: Option<HashMap<String, serde_json::Value>>,
    /// Intended audience roles for this resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub audience: Option<Vec<String>>,
    /// Last-modified timestamp hint
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_modified: Option<String>,
    /// Priority hint for model/client use
    #[serde(skip_serializing_if = "Option::is_none")]
    pub priority: Option<f64>,
}

/// A resource icon descriptor plus preserved non-standard icon fields.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpResourceIcon {
    /// Server-provided non-standard icon fields preserved from the MCP response
    #[serde(skip_serializing_if = "Option::is_none")]
    pub additional_properties: Option<HashMap<String, serde_json::Value>>,
    /// Icon MIME type, when known
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mime_type: Option<String>,
    /// Icon sizes hint
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sizes: Option<String>,
    /// Icon URI
    pub src: String,
    /// Theme hint for this icon
    #[serde(skip_serializing_if = "Option::is_none")]
    pub theme: Option<String>,
}

/// An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, MIME type, size, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpResource {
    /// Resource-level metadata
    #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
    pub meta: Option<HashMap<String, serde_json::Value>>,
    /// Server-provided non-standard descriptor fields preserved from the MCP response
    #[serde(skip_serializing_if = "Option::is_none")]
    pub additional_properties: Option<HashMap<String, serde_json::Value>>,
    /// Model/client annotations associated with this resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub annotations: Option<McpResourceAnnotations>,
    /// Optional description of what this resource represents
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Icons associated with this resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icons: Option<Vec<McpResourceIcon>>,
    /// MIME type of the resource, if known
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mime_type: Option<String>,
    /// The programmatic name of the resource
    pub name: String,
    /// Resource size in bytes, when known
    #[serde(skip_serializing_if = "Option::is_none")]
    pub size: Option<i64>,
    /// Optional human-readable display title
    #[serde(skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// The resource URI (e.g. ui://... or file:///...)
    pub uri: String,
}

/// MCP resource content with URI, optional MIME type, text or base64 blob, and resource metadata.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpResourceContent {
    /// Resource-level metadata (CSP, permissions, etc.)
    #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
    pub meta: Option<HashMap<String, serde_json::Value>>,
    /// Base64-encoded binary content
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blob: Option<String>,
    /// MIME type of the content
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mime_type: Option<String>,
    /// Text content (e.g. HTML)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    /// The resource URI
    pub uri: String,
}

/// An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, name, and optional title, description, MIME type, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpResourceTemplate {
    /// Resource-template-level metadata
    #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
    pub meta: Option<HashMap<String, serde_json::Value>>,
    /// Server-provided non-standard descriptor fields preserved from the MCP response
    #[serde(skip_serializing_if = "Option::is_none")]
    pub additional_properties: Option<HashMap<String, serde_json::Value>>,
    /// Model/client annotations associated with this template
    #[serde(skip_serializing_if = "Option::is_none")]
    pub annotations: Option<McpResourceAnnotations>,
    /// Optional description of what this template is for
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Icons associated with resources matching this template
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icons: Option<Vec<McpResourceIcon>>,
    /// MIME type for resources matching this template, if uniform
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mime_type: Option<String>,
    /// The programmatic name of the resource template
    pub name: String,
    /// Optional human-readable display title
    #[serde(skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// An RFC 6570 URI template for constructing resource URIs
    pub uri_template: String,
}

/// Owned installation that a listed MCP server's live configuration came from.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpServerOwnership {
    /// Stable installation identifier from the owned installation receipt.
    pub installation_id: String,
}

/// MCP server status entry, including config source/plugin source and any connection error.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct McpServer {
    /// Human-readable display name supplied by a managed server catalog.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub display_name: Option<String>,
    /// Error message if the server failed to connect
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// Server name (config key)
    pub name: String,
    /// Owned installation this entry's live configuration came from. Absent for manual, workspace, plugin, builtin and same-name servers, and on runtimes without owned installations.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub owned: Option<McpServerOwnership>,
    /// Server-advertised metadata for a connected server. Omitted when no live connection metadata is available, including while pending or when failed, disabled, stopped, or not configured.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub server_metadata: Option<McpServerMetadata>,
    /// Configuration source: user, workspace, plugin, builtin, or managed
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source: Option<McpServerSource>,
    /// Plugin name that provided this server, when source is plugin.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source_plugin: Option<String>,
    /// Plugin version that provided this server, when source is plugin.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source_plugin_version: Option<String>,
    /// Connection status: connected, failed, needs-auth, pending, disabled, stopped, or not_configured
    pub status: McpServerStatus,
    /// Configured URL for an HTTP/SSE server, regardless of configuration source. Omitted for local and in-memory servers.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
}

/// Active server-driven promotion for a model, including its discount and optional expiry.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelBillingPromo {
    /// Percentage discount (0-100) applied while the promotion is active. May be fractional.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub discount_percent: Option<f64>,
    /// UTC ISO 8601 timestamp marking when the promotion ends. Optional: an open-ended promotion omits this field. When present, the API only surfaces a promo whose expiry parses and is in the future, so consumers should treat a past value as expired.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ends_at: Option<String>,
    /// Stable identifier for the promotion campaign.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Human-readable promotion message. Does not include the expiry timestamp; consumers may format endsAt and append it when present.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// Whether the service asked hosts to give this promotion a prominent surface, such as a dedicated banner, in addition to listing it with the model. `true` requests that surface and `false` asks for the model list only. Absent means the service expressed no preference — for example a response that predates the field — so hosts should apply their own default rather than read it as `false`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub show_banner: Option<bool>,
}

/// Long context tier pricing (available for models with extended context windows)
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelBillingTokenPricesLongContext {
    /// Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens
    #[doc(hidden)]
    #[deprecated]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cache_price: Option<f64>,
    /// AI Credits cost per billing batch of cached (read) tokens
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cache_read_price: Option<f64>,
    /// AI Credits cost per billing batch of 1-hour cache-write (cache creation) tokens.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cache_write1h_price: Option<f64>,
    /// AI Credits cost per billing batch of cache-write (cache creation) tokens.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cache_write_price: Option<f64>,
    /// Use maxPromptTokens instead. Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens.
    #[doc(hidden)]
    #[deprecated]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub context_max: Option<i64>,
    /// AI Credits cost per billing batch of input tokens
    #[serde(skip_serializing_if = "Option::is_none")]
    pub input_price: Option<f64>,
    /// Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_prompt_tokens: Option<i64>,
    /// AI Credits cost per billing batch of output tokens
    #[serde(skip_serializing_if = "Option::is_none")]
    pub output_price: Option<f64>,
}

/// Token-level pricing information for this model
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelBillingTokenPrices {
    /// Number of tokens per standard billing batch
    #[serde(skip_serializing_if = "Option::is_none")]
    pub batch_size: Option<i64>,
    /// Use cacheReadPrice when available. Cost per billing batch of cached tokens in the unit reported by models.listTokenPriceUnits.
    #[doc(hidden)]
    #[deprecated]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cache_price: Option<f64>,
    /// AI Credits cost per billing batch of cached (read) tokens
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cache_read_price: Option<f64>,
    /// AI Credits cost per billing batch of 1-hour cache-write (cache creation) tokens.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cache_write1h_price: Option<f64>,
    /// AI Credits cost per billing batch of cache-write (cache creation) tokens.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cache_write_price: Option<f64>,
    /// Use maxPromptTokens instead. Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens.
    #[doc(hidden)]
    #[deprecated]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub context_max: Option<i64>,
    /// Cost per billing batch of input tokens. The unit is reported by models.listTokenPriceUnits.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub input_price: Option<f64>,
    /// Long context tier pricing (available for models with extended context windows)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub long_context: Option<ModelBillingTokenPricesLongContext>,
    /// Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_prompt_tokens: Option<i64>,
    /// Cost per billing batch of output tokens. The unit is reported by models.listTokenPriceUnits.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub output_price: Option<f64>,
}

/// Billing information
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelBilling {
    /// Whole-number percentage discount (0-100) applied to usage billed through this model. Populated for the synthetic `auto` model, where requests routed by auto-mode are billed at a reduced rate; absent for concrete models.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub discount_percent: Option<i32>,
    /// Billing cost multiplier relative to the base rate
    #[serde(skip_serializing_if = "Option::is_none")]
    pub multiplier: Option<f64>,
    /// Active server-driven promotion for this model, if any. Present when the model is being promoted with a discount, which may be time-boxed or open-ended.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub promo: Option<ModelBillingPromo>,
    /// Token-level pricing information for this model
    #[serde(skip_serializing_if = "Option::is_none")]
    pub token_prices: Option<ModelBillingTokenPrices>,
}

/// A service-published message about a model, carrying a stable machine-readable code alongside human-readable text.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelMessage {
    /// Stable machine-readable identifier for the message, such as `client_version_deprecated`. Hosts can key custom presentation off this; unrecognized codes should fall back to displaying `message`.
    pub code: String,
    /// Human-readable message text intended for display to the user.
    pub message: String,
}

/// Policy state (if applicable)
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelPolicy {
    /// Current policy state for this model
    pub state: ModelPolicyState,
    /// Usage terms or conditions for this model
    #[serde(skip_serializing_if = "Option::is_none")]
    pub terms: Option<String>,
}

/// Service-published warning text that hosts should display when presenting a model.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelWarningText {
    /// Data-retention warning for the model. The text may contain Markdown links and should be rendered as Markdown when supported.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub data_retention: Option<String>,
}

/// Copilot model metadata, including identifier, display name, capabilities, policy, billing, reasoning efforts, and picker categories.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Model {
    /// Billing information
    #[serde(skip_serializing_if = "Option::is_none")]
    pub billing: Option<ModelBilling>,
    /// Model capabilities and limits
    pub capabilities: ModelCapabilities,
    /// Default reasoning effort level (only present if model supports reasoning effort)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub default_reasoning_effort: Option<String>,
    /// Model identifier (e.g., "claude-sonnet-4.5")
    pub id: String,
    /// Informational notices the service published for this model, such as an upcoming change or a recommended alternative. Present only when the service published at least one notice. Hosts should surface these without implying anything is wrong with the model.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub info_messages: Option<Vec<ModelMessage>>,
    /// Provider-supplied model metadata. Keys and JSON-compatible values are preserved unchanged. This is factual metadata published by the model provider; it carries no picker or UX semantics.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<HashMap<String, serde_json::Value>>,
    /// Model capability category for grouping in the model picker
    #[serde(skip_serializing_if = "Option::is_none")]
    pub model_picker_category: Option<ModelPickerCategory>,
    /// Relative cost tier for token-based billing users
    #[serde(skip_serializing_if = "Option::is_none")]
    pub model_picker_price_category: Option<ModelPickerPriceCategory>,
    /// Display name
    pub name: String,
    /// Policy state (if applicable)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub policy: Option<ModelPolicy>,
    /// The native model provider that produced this model, as a neutral reference (opaque id, human-readable label, and provider kind). Preserved by `session.model.list` and `server.models.list` when supplied by the catalog producer; omitted for unattributed and configured BYOK models. This identifies the model source, not an account or agent harness.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provider: Option<ModelProviderRef>,
    /// Context-window tiers this model offers, when the provider advertises them independently of tiered token pricing. Copilot models carry their tiers in `billing.tokenPrices`; a provider that has no pricing to publish (an agent host reached over AHP, for example) declares them here instead, so the model picker can still offer the tier toggle.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub supported_context_tiers: Option<Vec<String>>,
    /// Supported reasoning effort levels (only present if model supports reasoning effort)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub supported_reasoning_efforts: Option<Vec<String>>,
    /// Model vendor as the Copilot API reports it, for example "Anthropic" or "Azure OpenAI". Open vocabulary, passed through unchanged. It can name the vendor that serves the model instead of the one that built it, or a label that is not a vendor, such as "Experimental". Absent when the Copilot API reports no vendor.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub vendor: Option<String>,
    /// Warnings the service published for this model, such as a deprecated client version. Present only when the service published at least one warning. The model remains usable; hosts should surface these as advisory rather than blocking.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub warning_messages: Option<Vec<ModelMessage>>,
    /// Warning text the service requires hosts to surface for this model. Present only when the service published at least one warning.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub warning_text: Option<ModelWarningText>,
}

/// Vision-specific limits
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelCapabilitiesOverrideLimitsVision {
    /// Maximum image size in bytes
    #[serde(
        rename = "max_prompt_image_size",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_prompt_image_size: Option<i64>,
    /// Maximum number of images per prompt
    #[serde(rename = "max_prompt_images", skip_serializing_if = "Option::is_none")]
    pub max_prompt_images: Option<i64>,
    /// MIME types the model accepts
    #[serde(
        rename = "supported_media_types",
        skip_serializing_if = "Option::is_none"
    )]
    pub supported_media_types: Option<Vec<String>>,
}

/// Token limits for prompts, outputs, and context window
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelCapabilitiesOverrideLimits {
    /// Maximum total context window size in tokens
    #[serde(
        rename = "max_context_window_tokens",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_context_window_tokens: Option<i64>,
    /// Maximum number of output/completion tokens
    #[serde(rename = "max_output_tokens", skip_serializing_if = "Option::is_none")]
    pub max_output_tokens: Option<i64>,
    /// Maximum number of prompt/input tokens
    #[serde(rename = "max_prompt_tokens", skip_serializing_if = "Option::is_none")]
    pub max_prompt_tokens: Option<i64>,
    /// Vision-specific limits
    #[serde(skip_serializing_if = "Option::is_none")]
    pub vision: Option<ModelCapabilitiesOverrideLimitsVision>,
}

/// Feature flags indicating what the model supports
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelCapabilitiesOverrideSupports {
    /// Resolved Anthropic adaptive-thinking capability — unsupported / optional / required / adaptive_only. 'required' models reject thinking.type='enabled' with HTTP 400 but still accept 'disabled' (e.g. opus-4.7/4.8/5, sonnet-5); 'adaptive_only' models accept nothing but 'adaptive' (e.g. fable, mythos).
    #[serde(rename = "adaptive_thinking", skip_serializing_if = "Option::is_none")]
    pub adaptive_thinking: Option<AdaptiveThinkingSupport>,
    /// Whether this model supports reasoning effort configuration
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reasoning_effort: Option<bool>,
    /// Whether this model supports canonical tool calling
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tool_calls: Option<bool>,
    /// Whether this model supports vision/image input
    #[serde(skip_serializing_if = "Option::is_none")]
    pub vision: Option<bool>,
}

/// Optional capability overrides (vision, tool_calls, reasoning, etc.).
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelCapabilitiesOverride {
    /// Token limits for prompts, outputs, and context window
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limits: Option<ModelCapabilitiesOverrideLimits>,
    /// Feature flags indicating what the model supports
    #[serde(skip_serializing_if = "Option::is_none")]
    pub supports: Option<ModelCapabilitiesOverrideSupports>,
}

/// Filesystem and environment context used to resolve model-picker settings.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelPickerSettingsContext {
    /// Optional Copilot configuration directory containing persisted settings.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub config_dir: Option<String>,
    /// Environment variables consulted while resolving model-picker settings.
    pub environment: serde_json::Value,
    /// User home directory used when resolving persisted settings.
    pub home_directory: String,
}

/// Adapter-declared policy that tells clients whether discovery may run automatically.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelProviderAutomaticDiscoveryPolicy {
    /// Whether automatic discovery is allowed, limited to configured providers, or explicit-only.
    pub mode: ModelProviderAutomaticDiscoveryMode,
    /// Maximum network scope used by this adapter during discovery.
    pub network_scope: ModelProviderDiscoveryNetworkScope,
    /// True when discovery requires non-null caller input. Omission or null is rejected before adapter execution. When false, omitted or null input selects adapter defaults without schema validation.
    pub requires_input: bool,
    /// True when the adapter must be enabled by a trusted owner, such as a trusted extension, before automatic discovery may run.
    pub requires_trust: bool,
}

/// An operation supported by a model-provider adapter.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelProviderAdapterOperationDescriptor {
    /// Optional self-contained JSON Schema Draft 7 for non-null discovery input. Only supported on discover. No external references are resolved. Omitted or null input selects defaults when requiresInput is false. Without a schema, the adapter validates supplied input.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub input_schema: Option<serde_json::Value>,
    /// Supported operation name: `discover`, `getStatus`, or `models.list`. Unknown names and duplicate declarations are rejected.
    pub name: String,
}

/// Contributor attribution, independent of routing identity and authorization.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelProviderAttribution {
    /// Human-readable contributor name, not the adapter display name.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub owner_display_name: Option<String>,
    /// Stable contributor identifier. Required and nonblank for extension and custom sources; optional for built-in and configured sources. Does not grant authority.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub owner_id: Option<String>,
    /// Kind of component that supplied the adapter. Attribution does not confer authority.
    pub source: ModelProviderProvenanceSource,
}

/// A normalized model-provider adapter in the session's effective catalog.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelProviderAdapterDescriptor {
    /// Stable opaque identity for routing to this adapter. Unique in the effective catalog, independent of live registration generations.
    pub adapter_id: String,
    /// Adapter-declared policy for passive and automatic discovery.
    pub automatic_discovery: ModelProviderAutomaticDiscoveryPolicy,
    /// Human-readable provider name.
    pub display_name: String,
    /// Operations supported by this provider adapter.
    pub operations: Vec<ModelProviderAdapterOperationDescriptor>,
    /// Attribution for the adapter itself.
    pub provenance: ModelProviderAttribution,
    /// Descriptive provider family, such as `ollama`. Different adapters may have the same family; use adapterId for routing.
    pub provider_kind: String,
}

/// A BYOK model definition referencing a named provider.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ProviderModelConfig {
    /// Optional capability overrides (vision, tool_calls, reasoning, etc.).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub capabilities: Option<ModelCapabilitiesOverride>,
    /// Provider-local model id, unique within its provider. The session-wide selection id (shown in the model list and passed to switchTo) is the provider-qualified `provider/id`.
    pub id: String,
    /// Maximum context window tokens for the model.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_context_window_tokens: Option<i64>,
    /// Maximum output tokens for the model.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_output_tokens: Option<i64>,
    /// Maximum prompt/input tokens for the model.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_prompt_tokens: Option<i64>,
    /// Provider-published model metadata, preserved verbatim as the public Model.metadata object.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<HashMap<String, serde_json::Value>>,
    /// Well-known base model id used for behavior/capability/config lookup. Defaults to `id`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub model_id: Option<String>,
    /// Display name for model pickers. Defaults to the provider-qualified selection id (`provider/id`).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Name of the configured provider that serves this model.
    pub provider: String,
    /// System-message configuration used when the runtime builds the standard prompt for this provider-qualified model, including general-purpose subagents. It uses the same object hierarchy as session-level systemMessage configuration, except transform actions are rejected because the current callback protocol is not model-scoped. When present, it overrides the session-wide configuration on those prompt paths. Selected custom-agent and specialized-subagent prompts remain authoritative.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub system_message: Option<serde_json::Value>,
    /// The model name sent to the provider API for inference. Defaults to `id`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub wire_model: Option<String>,
}

/// Azure-specific provider options.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ProviderConfigAzure {
    /// API version. When set, uses the versioned deployment route. When omitted, uses the GA versionless v1 route.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub api_version: Option<String>,
}

/// External SDK input for a named custom model provider. Ingested by the native protocol boundary before host dispatch.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct NamedProviderConfig {
    /// Static API key used to authenticate provider requests.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub api_key: Option<String>,
    /// Azure authentication configuration for the provider.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub azure: Option<ProviderConfigAzure>,
    /// Base URL for provider API requests.
    pub base_url: String,
    /// Static bearer token used to authenticate provider requests.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bearer_token: Option<String>,
    /// Whether the host supplies bearer tokens dynamically.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub has_bearer_token_provider: Option<bool>,
    /// Additional HTTP headers included with provider requests.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub headers: Option<HashMap<String, String>>,
    /// The product serving the provider's models, reported in telemetry as `model_provider`. Besides telemetry, `azure_openai` makes OpenAI Responses requests omit explicit `prompt_cache_breakpoint` markers, which limit cross-turn cache reuse on Azure.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub model_provider: Option<ProviderConfigModelProvider>,
    /// Unique provider name used to qualify model selection IDs.
    pub name: String,
    /// Transport used to communicate with the provider.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub transport: Option<ProviderConfigTransport>,
    /// Provider protocol family.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub r#type: Option<ProviderConfigType>,
    /// Wire API used to communicate with the provider.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub wire_api: Option<ProviderConfigWireApi>,
}

/// Serializable reference to a discovered provider instance.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelProviderInstanceReference {
    /// Stable opaque identity of the adapter that owns this reference. Must be present in the target session's effective catalog.
    pub adapter_id: String,
    /// Stable instance identifier derived by the provider adapter, such as `ollama:{normalizedEndpoint}`.
    pub id: String,
    /// Absolute provider management URI. The adapter validates normalization, supported schemes, and permission to access it against its bound configuration; a reference does not grant authority.
    pub management_endpoint: String,
    /// Descriptive provider family. Must match the selected adapter; not a routing key.
    pub provider_kind: String,
}

/// A normalized model-provider instance discovered by the runtime.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelProviderInstance {
    /// Human-readable instance name.
    pub display_name: String,
    /// Inference API endpoint when the provider exposes one separately from its management endpoint.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub inference_endpoint: Option<String>,
    /// Transport to use for inference against this instance.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub inference_transport: Option<ProviderEndpointTransport>,
    /// Provider family to use for inference against this instance.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub inference_type: Option<ProviderEndpointType>,
    /// Wire API to use for inference against this instance, when required by the provider family.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub inference_wire_api: Option<ProviderEndpointWireApi>,
    /// Attribution for the adapter that produced this instance.
    pub provenance: ModelProviderProvenance,
    /// Self-contained reference for subsequent provider operations.
    pub reference: ModelProviderInstanceReference,
}

///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ModelSwitchConfirmation {
    /// Current conversation token count before switching models.
    pub current_tokens: f64,
    /// Effective prompt-token limit with the target model's long_context tier, present only when that tier can fit the conversation and managed policy permits it. Resubmit the switch with contextTier set to long_context to avoid compaction.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub long_context_limit: Option<f64>,
    /// Target model token limit used by the compaction preflight.
    pub target_limit: f64,
    /// Display name of the model that requires compaction confirmation.
    pub target_model_display_name: String,
}

/// External tool call of the session or one of its sub-agents that is still waiting for session.tools.handlePendingToolCall.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PendingExternalToolRequest {
    /// Sub-agent instance identifier (the envelope agentId of its events) of the agent that issued the call; absent for calls issued by the root agent
    #[serde(skip_serializing_if = "Option::is_none")]
    pub agent_id: Option<String>,
    /// Arguments to pass to the external tool
    #[serde(skip_serializing_if = "Option::is_none")]
    pub arguments: Option<serde_json::Value>,
    /// Stable identity of the provider that offered the tool, for hosts that route extension-owned tools by provider
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provider_id: Option<String>,
    /// Request ID to pass to session.tools.handlePendingToolCall
    pub request_id: RequestId,
    /// Tool call ID assigned to this external tool invocation
    pub tool_call_id: String,
    /// Name of the external tool to invoke
    pub tool_name: String,
}

/// Pending permission prompt reconstructed from event history, with request ID and user-facing prompt details.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PendingPermissionRequest {
    /// Canonical runtime-owned Assisted Permissions assessment captured on the originating permission request. Absent for historical events.
    ///
    /// <div class="warning">
    ///
    /// **Experimental.** This type is part of an experimental wire-protocol surface
    /// and may change or be removed in future SDK or CLI releases.
    ///
    /// </div>
    #[serde(skip_serializing_if = "Option::is_none")]
    pub assisted_approval_assessment: Option<AssistedApprovalAssessment>,
    /// Permission-recovery episode that authorized this request to surface for interactive attention
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recovery_episode_id: Option<String>,
    /// The user-facing permission prompt details (commands, write, read, mcp, url, memory, custom-tool, path, hook)
    pub request: PermissionPromptRequest,
    /// Unique identifier for the pending permission request
    pub request_id: RequestId,
}

/// Optional informational context describing how and where the permission decision was made. This does not affect permission behavior.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PermissionDecisionContext {
    /// Disposition of the permission request as observed by the responding client.
    pub outcome: PermissionDecisionOutcome,
    /// Whether the responding client could ask a user interactively, was running headlessly, or had no response path. Omit when the client cannot determine this authoritatively.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub response_capability: Option<PermissionResponseCapability>,
    /// Controlled reason or actor responsible for the response.
    pub source: PermissionDecisionSource,
    /// Client surface that submitted the response.
    pub surface: PermissionDecisionSurface,
    /// Optional user-authored explanation of this decision, independent of approval scope. Collected only in restricted telemetry for accepted human responses to Assisted Permissions prompts. Never persisted in session history, sent to the agent or judge, or used to create approval rules. Existing rejection feedback is separate.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub user_feedback: Option<String>,
}

/// A single todo row read from the session SQL `todos` table. All fields are optional because the SQL schema is best-effort and the agent may not have populated every column.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PlanSqlTodosRow {
    /// Todo creation time, as stored by the session SQL schema's `datetime('now')` default: `YYYY-MM-DD HH:MM:SS` in UTC. Lets clients attribute todos to the work item that created them (e.g. scoping a goal's progress to the todos it produced) rather than to the whole session.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// Todo description.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Todo identifier.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Todo status.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Todo title.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
}

/// A single dependency edge read from the session SQL `todo_deps` table, indicating that one todo must complete before another.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PlanSqlTodoDependency {
    /// ID of the todo it depends on.
    pub depends_on: String,
    /// ID of the todo that has the dependency.
    pub todo_id: String,
}

/// Session plugin metadata, with name, marketplace, optional version, and enabled state.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Plugin {
    /// Opaque stable identity for a direct plugin source.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub direct_source_id: Option<String>,
    /// Whether the plugin is currently enabled
    pub enabled: bool,
    /// Whether this managed desired plugin has an installed or live record.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub installed: Option<bool>,
    /// Absolute marketplace directory for a live plugin.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub installed_from: Option<String>,
    /// Whether enterprise managed settings control this plugin.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub managed: Option<bool>,
    /// Enabled state required by enterprise managed settings.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub managed_desired_enabled: Option<bool>,
    /// Marketplace the plugin came from
    pub marketplace: String,
    /// Plugin name
    pub name: String,
    /// Runtime plugin provenance, such as "builtin".
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source: Option<String>,
    /// Installed version
    #[serde(skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// Opt into native CAPI image generation.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ProtocolImageGenerationOptions {
    /// Disabled by default for SDK sessions. CAPI model access and permissions still apply.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// Experimental. Save each generated or edited image under the session-state
    /// directory's `images` folder and add a `saved_to: <path>` line per image to
    /// the tool result the model sees. Defaults to true; set false to opt out.
    /// Subagents follow their
    /// parent's value unless they set their own. A failed save still returns the
    /// image, without `saved_to`. Sessions without a local session-state
    /// directory, such as those using a session filesystem provider, never save.
    /// Re-supply after a cold resume. Does not enable image generation.
    /// This option may change or be removed in a future release.
    ///
    /// <div class="warning">
    ///
    /// **Experimental.** This type is part of an experimental wire-protocol surface
    /// and may change or be removed in future SDK or CLI releases.
    ///
    /// </div>
    #[serde(skip_serializing_if = "Option::is_none")]
    pub save_to_disk: Option<bool>,
    /// Experimental. Request a visible "Made with AI" label on generated and edited images.
    /// This option may change or be removed in a future release.
    /// Overrides the user's imageGenerationWatermark preference for this session;
    /// otherwise that preference applies, defaulting to false. Re-supply after a
    /// cold resume. Does not enable image generation or enforce enterprise policy.
    ///
    /// <div class="warning">
    ///
    /// **Experimental.** This type is part of an experimental wire-protocol surface
    /// and may change or be removed in future SDK or CLI releases.
    ///
    /// </div>
    #[serde(skip_serializing_if = "Option::is_none")]
    pub watermark: Option<bool>,
}

/// Short-lived, rotating credential the caller must send on every request, in addition to `apiKey` if one is present. Omitted when the endpoint does not require one.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ProviderSessionToken {
    /// When the token expires, if known. Callers should refresh by calling `getEndpoint` again before this time, or reactively on any 401/403 response from `baseUrl`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub expires_at: Option<String>,
    /// HTTP header name the token must be sent under.
    pub header: String,
    /// The model the token is bound to, when applicable. When set, the token is only valid for requests against this model.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub model: Option<String>,
    /// The short-lived token value.
    pub token: String,
}

/// User-facing pending queue entry, with kind and display text for a queued message, slash command, or model change.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct QueuePendingItems {
    /// Agent mode stored on this queued entry, as stamped when it was enqueued. Items without an explicit mode report interactive. This is not necessarily the mode that will constrain the turn: a plan or autopilot session applies its own write gate, continuation loop and permission posture to every drained item regardless of the mode stored here.
    pub agent_mode: SendAgentMode,
    /// Human-readable text to display for this queue entry in the UI
    pub display_text: String,
    /// Stable opaque id for the canonical queued item. Batch rows share one id.
    pub id: String,
    /// Whether this item is a queued user message or a queued slash command / model change
    pub kind: QueuePendingItemsKind,
    /// Stable identity of the queued user message. Present for message rows and absent for slash commands and model changes.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub message_id: Option<String>,
    /// Optional source tag associated with this pending queue entry. This is an open string, not authenticated authorship. In particular, `user` does not prove that a person typed the message. If the source is absent or unrecognized, consumers must not infer human or agent authorship and should handle the entry neutrally. Consumers should tolerate future source values.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source: Option<String>,
}

/// A pending session quota warning, consumed once by takeWarnings.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct QuotaWarningProjection {
    /// User-facing warning text.
    pub message: String,
    /// Related account or upgrade link.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Existing warning category.
    pub warning_type: String,
}

/// Credential-injection capability flags applied while the sandbox is enabled. For the same capability independent of sandboxing, and matched to the credential's GitHub host, see `shell.credentials`; the two are additive.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxConfigAuth {
    /// Whether to authenticate sandboxed gh through the local masking proxy. The child receives a fake GH_TOKEN; its real value is substituted only at github.com, api.github.com and uploads.github.com (github.com because gh repo clone authenticates git through gh auth git-credential). The repository's GitHub account takes precedence over the Copilot login. Default: false (opt-in).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub gh: Option<bool>,
    /// Whether to authenticate sandboxed HTTPS git through the local masking proxy. The child receives a fake `http.<url>.extraheader`; the real Authorization header is substituted only at its original HTTPS host, port, and repository path scope. github.com uses the Copilot token; other forges use credentials resolved from the user's own helper on the host. Default: false (opt-in).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub git: Option<bool>,
}

/// Destinations authorized to receive one masked environment credential.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxMaskedEnvVar {
    /// Nonempty list of HTTPS injection hostnames or *.example.com patterns. Bare * is not accepted. These grants never override the sandbox network policy. Values in plaintext HTTP requests, URLs, bodies, encoded credentials, and signed requests are not substituted.
    pub inject_hosts: Vec<String>,
}

/// Whole-value environment credential masking for sandboxed children.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxCredentialsConfig {
    /// Environment variable names and their HTTPS injection destinations. Absent variables stay absent. No real values or sentinels are stored in this map.
    pub env_vars: HashMap<String, SandboxMaskedEnvVar>,
}

/// macOS seatbelt experimental options.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxConfigUserPolicyExperimentalSeatbelt {
    /// Whether the macOS seatbelt profile may access the keychain.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub keychain_access: Option<bool>,
}

/// Platform-specific experimental policy fields.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxConfigUserPolicyExperimental {
    /// macOS seatbelt experimental options.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub seatbelt: Option<SandboxConfigUserPolicyExperimentalSeatbelt>,
}

/// Filesystem rules to merge into the base policy.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxConfigUserPolicyFilesystem {
    /// Paths explicitly denied.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub denied_paths: Option<Vec<String>>,
    /// Paths granted read-only access.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub readonly_paths: Option<Vec<String>>,
    /// Paths granted read/write access.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub readwrite_paths: Option<Vec<String>>,
}

/// HTTP proxy configuration for sandboxed traffic.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxConfigUserPolicyNetworkProxy {
    /// Optional password for proxy authentication, combined with the URL at spawn time. The persisted value may be a literal password, a `${secret:…}` reference resolved from the OS keychain, or a `${VAR}`/`$VAR` environment reference; it is resolved just before the sandboxed process routes through the proxy. The /sandbox dialog stores a real password in the OS keychain and persists only a `${secret:…}` placeholder (never plaintext in settings.json); the field is masked in the dialog and redacted by /settings show.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub password: Option<String>,
    /// Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted; an explicit port must be between 1 and 65535. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is.
    pub url: String,
    /// Optional username for proxy authentication. Combined with the URL (and `password`) into `user:pass@host` when the sandboxed process routes through the proxy.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub username: Option<String>,
}

/// Network rules to merge into the base policy.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxConfigUserPolicyNetwork {
    /// Hosts allowed through the built-in sandbox proxy. A non-empty list denies unmatched hosts; an absent or empty list allows all hosts not blocked. Supports exact hostnames, IP addresses, and *.example.com for strict subdomains. Host rules do not override the outbound or local-network toggles.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub allowed_hosts: Option<Vec<String>>,
    /// Whether traffic to local/loopback addresses is allowed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub allow_local_network: Option<bool>,
    /// Whether outbound network traffic is allowed at all.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub allow_outbound: Option<bool>,
    /// Hosts denied by the built-in sandbox proxy. Deny rules take precedence over allowedHosts. A domain also denies all its subdomains. IP addresses match exactly; *.example.com matches strict subdomains, and * denies every host.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blocked_hosts: Option<Vec<String>>,
    /// HTTP(S) proxy for sandboxed traffic. This is the built-in local proxy's upstream: every sandboxed command reaches it through a loopback listener, so credentials stay in the runtime and never reach the child. On Windows the sandbox also needs local network access, because it reaches that listener over host loopback. Configure credentials in the separate username/password fields. The transient local listener URL is never persisted.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub proxy: Option<SandboxConfigUserPolicyNetworkProxy>,
}

/// macOS seatbelt-specific options.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxConfigUserPolicySeatbelt {
    /// Whether the macOS seatbelt profile may access the keychain.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub keychain_access: Option<bool>,
}

/// User-managed sandbox policy fragment merged into the auto-discovered base policy.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxConfigUserPolicy {
    /// Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is absent.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub experimental: Option<SandboxConfigUserPolicyExperimental>,
    /// Filesystem rules to merge into the base policy.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub filesystem: Option<SandboxConfigUserPolicyFilesystem>,
    /// Network rules to merge into the base policy.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub network: Option<SandboxConfigUserPolicyNetwork>,
    /// macOS seatbelt options to merge into the base policy.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub seatbelt: Option<SandboxConfigUserPolicySeatbelt>,
}

/// Resolved sandbox configuration.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxConfig {
    /// Whether to auto-add the current working directory to readwritePaths. Default: true.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub add_current_working_directory: Option<bool>,
    /// Whether the agent may request that an individual command run outside the sandbox, which the host then approves or denies through the usual permission flow. A host capability flag rather than part of the policy: it is stripped from the effective spawn policy and only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this object: omitting it offers no bypass. Default: false (opt-in).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub allow_bypass: Option<bool>,
    /// Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub allow_dev_tool_access: Option<bool>,
    /// Credential-injection capability flags.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub auth: Option<SandboxConfigAuth>,
    /// Opt-in whole-value environment masking for sandboxed shell, MCP, and LSP children. Configured names get random sentinels; the local proxy substitutes them only in HTTPS request headers at their injection hosts. Approved bypasses skip masking and the sandbox proxy, so bypassed shells may receive the real environment values. Disabled or explicitly opted-out routes are not protected. No credential values are stored in this configuration.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub credentials: Option<SandboxCredentialsConfig>,
    /// Whether sandboxing is enabled for the session.
    pub enabled: bool,
    /// The `sandboxExtensions` counterpart of `managedMcpRoutingLocked`.
    #[doc(hidden)]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub(crate) managed_extensions_routing_locked: Option<bool>,
    /// The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`.
    #[doc(hidden)]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub(crate) managed_lsp_routing_locked: Option<bool>,
    /// Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at the administrator instead of a setting the next managed merge would override, and it is ignored when comparing two configs for change. Only the managed merge may set it; a caller-supplied value is stripped.
    #[doc(hidden)]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub(crate) managed_mcp_routing_locked: Option<bool>,
    /// Whether extension processes the session launches are confined by the sandbox. Only an explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sandbox_extensions: Option<bool>,
    /// Whether language servers the session launches are confined by the sandbox. Only an explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sandbox_lsp_servers: Option<bool>,
    /// Whether MCP servers the session launches are confined by the sandbox. Only an explicit `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and `enabled` are always read together. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sandbox_mcp_servers: Option<bool>,
    /// User-managed sandbox policy fragment merged into the auto-discovered base policy.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub user_policy: Option<SandboxConfigUserPolicy>,
}

/// A possible secret-bearing environment variable and optional locally suggested HTTPS injection hosts. This is a draft for user review, not an active grant.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SandboxCredentialSuggestion {
    /// Environment variable name. The secret value is never returned.
    pub name: String,
    /// HTTPS hostnames suggested by a local known-provider mapping. An empty list requires the user to supply injection hosts before adding a masking entry. These suggestions do not allow network access.
    pub suggested_inject_hosts: Vec<String>,
}

/// Scheduled prompt entry with ID, timing (`intervalMs`, `cron`, or `at`), prompt text, recurrence, and next run time.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ScheduleEntry {
    /// Absolute fire time (epoch milliseconds) for a one-shot calendar schedule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub at: Option<i64>,
    /// 5-field cron expression for a recurring calendar schedule, evaluated in `tz`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cron: Option<String>,
    /// Display-only label for the prompt as shown in the UI (e.g. `/skill-name` for a skill-invocation schedule). The actual enqueued prompt is `prompt`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub display_prompt: Option<String>,
    /// Sequential id assigned by the runtime within the session. Stable across resumes (rebuilt from the event log).
    pub id: i64,
    /// Interval between scheduled ticks, in milliseconds (relative-interval schedules).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub interval_ms: Option<i64>,
    /// ISO 8601 timestamp when the next tick is scheduled to fire.
    pub next_run_at: String,
    /// Prompt text that gets enqueued on every tick.
    pub prompt: String,
    /// Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`).
    pub recurring: bool,
    /// True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub self_paced: Option<bool>,
    /// IANA timezone the `cron` expression is evaluated in.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tz: Option<String>,
}

/// Server-side skill metadata, including name, description, source, enabled/invocable state, path, project path, and argument hint.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ServerSkill {
    /// Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field
    #[serde(skip_serializing_if = "Option::is_none")]
    pub argument_hint: Option<String>,
    /// Canonical slash command name used to invoke the skill, without the leading '/'
    #[serde(skip_serializing_if = "Option::is_none")]
    pub command_name: Option<String>,
    /// Description of what the skill does
    pub description: String,
    /// Whether the skill is currently enabled (based on global config)
    pub enabled: bool,
    /// Unique identifier for the skill
    pub name: String,
    /// Absolute path to the skill file
    #[serde(skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// The project path this skill belongs to (only for project/inherited skills)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub project_path: Option<String>,
    /// Source location type (e.g., project, personal-copilot, plugin, builtin)
    pub source: SkillSource,
    /// Whether the skill can be invoked by the user as a slash command
    pub user_invocable: bool,
}

/// Command-scoped GitHub credential injection for the shell commands an agent runs.
///
/// Each channel is opt-in and independent, and injection is scoped to the individual command
/// spawn: the credential is resolved from the session's *current* authentication at every spawn
/// and reaches only spawns whose script actually invokes `git` or `gh`. Because nothing is
/// retained between spawns, replacing the session credential (`session.gitHubAuth.setCredentials`)
/// changes what the next spawned command presents — which seeding a credential into the runtime
/// process's own environment cannot do, since a child's environment is fixed at `exec`.
///
/// The credential is matched to the host it authenticates to, so a github.com credential is never
/// presented to a GitHub Enterprise host and vice versa. Where a channel cannot express that
/// boundary it injects nothing rather than crossing it -- see `gh` below.
///
/// This is independent of `sandboxConfig`: it is a decision about which identity the agent
/// presents, not about what the agent may touch, and it works on every platform whether or not
/// an OS sandboxing backend is available. `sandboxConfig.auth` remains the sandbox-scoped
/// spelling and is additive with this one.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ShellCredentials {
    /// Whether to authenticate the agent's `gh` commands as the session's GitHub credential, by
    /// exporting `GH_TOKEN` to a spawn that runs `gh`. Any inherited `gh` credential is removed from
    /// spawns that do not, so the credential stays command-scoped.
    ///
    /// Applies to a github.com credential only. `gh` picks its credential variable from the host a
    /// command targets rather than the one the credential belongs to, and the command can choose that
    /// target, so `GH_ENTERPRISE_TOKEN` would offer a single-tenant enterprise credential to every
    /// other enterprise host. A session whose credential is enterprise-scoped therefore runs `gh`
    /// unauthenticated; its `git` commands are unaffected, because `http.<host>.extraheader` is scoped
    /// to one host by construction. Default: false (opt-in).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub gh: Option<bool>,
    /// Whether to authenticate the agent's `git` commands as the session's GitHub credential, by
    /// injecting an `http.<host>.extraheader` (plus `insteadOf` rewrites so SSH-spelled remotes for
    /// that host use the authenticated HTTPS transport). Applied only to a spawn that runs a
    /// remote-contacting `git` subcommand. Default: false (opt-in).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub git: Option<bool>,
}

/// A host-provided script sourced before each built-in shell command when its shell target matches the active shell.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ShellInitScript {
    /// Path to the script to source.
    pub path: String,
    /// Built-in shell that may source this script.
    pub shell: ShellInitScriptShell,
}

/// Per-session settings for built-in shell tools.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ShellOptions {
    /// Command-scoped GitHub credential injection for shell commands.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub credentials: Option<ShellCredentials>,
    /// Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub init_profile: Option<ShellInitProfile>,
    /// Ordered host-provided script paths sourced before each built-in shell command when the
    /// entry's shell target matches the active shell. Use these for rc files, environment setup scripts,
    /// or other custom scripts. A script that returns a nonzero status is reported, and later scripts
    /// and the user command continue while the shell remains running. Because scripts are sourced into
    /// the command shell, `exit`, `exec`, failures under `set -e`, or other shell-terminating behavior
    /// can prevent continuation. Script standard output is preserved; Bash script stderr is discarded,
    /// PowerShell exception messages are replaced, and runtime-generated failure notices omit
    /// configured script paths. When sandboxing is enabled, each script must already be readable under
    /// the active sandbox filesystem policy. Pass an empty array to clear the list.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub init_scripts: Option<Vec<ShellInitScript>>,
    /// Flags passed to the active built-in shell process on startup, replacing its default flags.
    /// When omitted, the built-in Bash shell uses `--norc --noprofile`,
    /// and the built-in PowerShell shell uses `-NoProfile -NoLogo`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub process_flags: Option<Vec<String>>,
}

/// Skill metadata available to a session, with name, description, source, enabled/invocable state, path, plugin, and argument hint.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Skill {
    /// Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field
    #[serde(skip_serializing_if = "Option::is_none")]
    pub argument_hint: Option<String>,
    /// Canonical slash command name used to invoke the skill, without the leading '/'
    #[serde(skip_serializing_if = "Option::is_none")]
    pub command_name: Option<String>,
    /// Original frontmatter name for an MCP skill, for display only. Use name for identity and enable/disable operations.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub declared_name: Option<String>,
    /// Description of what the skill does
    pub description: String,
    /// Whether the skill is currently enabled
    pub enabled: bool,
    /// MCP server and skill resource address when source is 'mcp'. Contains no activation grants or internal verification metadata.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mcp_origin: Option<McpSkillOrigin>,
    /// Unique identifier for the skill
    pub name: String,
    /// Absolute path to the skill file
    #[serde(skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// Name of the plugin that provides the skill, when source is 'plugin'
    #[serde(skip_serializing_if = "Option::is_none")]
    pub plugin_name: Option<String>,
    /// Source location type (e.g., project, personal-copilot, plugin, builtin)
    pub source: SkillSource,
    /// Whether the skill can be invoked by the user as a slash command
    pub user_invocable: bool,
}

/// Skill invocation record with name, path, content, allowed tools, and turn number.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SkillsInvokedSkill {
    /// Tools that should be auto-approved when this skill is active, captured at invocation time
    #[serde(skip_serializing_if = "Option::is_none")]
    pub allowed_tools: Option<Vec<String>>,
    /// Exact invocation arguments when recorded, retained separately from the reusable skill body
    #[serde(skip_serializing_if = "Option::is_none")]
    pub arguments: Option<String>,
    /// Full content of the skill file
    pub content: String,
    /// Whether model invocation was disabled when this skill was invoked
    #[serde(skip_serializing_if = "Option::is_none")]
    pub disable_model_invocation: Option<bool>,
    /// Turn number when the skill was invoked
    pub invoked_at_turn: i64,
    /// Unique identifier for the skill
    pub name: String,
    /// Path to the SKILL.md file, or an empty string for an SDK-provided skill without a filesystem identity
    pub path: String,
}

/// Subagent model, reasoning effort, context tier, and auto-invocation settings
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SubagentSettingsEntry {
    /// Whether this agent's runtime-defined proactive invocation prompting is enabled, if supported. Currently consumed by the built-in rubber-duck agent.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub auto_invoke: Option<bool>,
    /// Context tier override for matching subagents
    #[serde(skip_serializing_if = "Option::is_none")]
    pub context_tier: Option<SubagentSettingsEntryContextTier>,
    /// Reasoning effort override for matching subagents
    #[serde(skip_serializing_if = "Option::is_none")]
    pub effort_level: Option<String>,
    /// Model override for matching subagents
    #[serde(skip_serializing_if = "Option::is_none")]
    pub model: Option<String>,
    /// Whether the configured model strategy is preferred or required
    #[serde(skip_serializing_if = "Option::is_none")]
    pub model_policy: Option<AgentModelPolicy>,
    /// Provider identifier for the configured model override
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provider_id: Option<String>,
}

/// Configured per-agent subagent overrides
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SubagentSettingsConfig {
    /// Per-agent settings keyed by subagent agent_type
    #[serde(skip_serializing_if = "Option::is_none")]
    pub agents: Option<HashMap<String, SubagentSettingsEntry>>,
    /// Configured opt-in for subagent context management tools; applied from persisted settings when the session starts
    #[serde(skip_serializing_if = "Option::is_none")]
    pub context_management_tools: Option<bool>,
    /// Names of subagents the user has turned off; they cannot be dispatched
    #[serde(skip_serializing_if = "Option::is_none")]
    pub disabled_subagents: Option<Vec<String>>,
    /// Maximum number of subagents that can run concurrently; applies to usage-based billing users only
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_concurrency: Option<i32>,
    /// Maximum subagent nesting depth; applies to usage-based billing users only
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_depth: Option<i32>,
}

/// Requested and resolved context configuration observed when a direct workflow agent launched.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowAgentContextObservation {
    /// Full context-window capacity resolved for the initialized child session.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_context_window_tokens: Option<i64>,
    /// Effective prompt-token input budget resolved for the initialized child session.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub prompt_token_limit: Option<i64>,
    /// Context-tier override explicitly supplied by the workflow call.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub requested_tier: Option<ContextTier>,
    /// Effective context-tier identifier reported by the initialized child session. Native sessions currently report `default` or `long_context`; remote participants may report another supported identifier.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resolved_tier: Option<String>,
}

/// Requested and resolved model observations for a direct workflow agent.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowAgentModelObservation {
    /// Non-empty model override explicitly supplied by the workflow call.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub requested: Option<String>,
    /// Concrete model reported by the initialized child session.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resolved: Option<String>,
}

/// Requested and resolved reasoning-effort observations for a direct workflow agent.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowAgentReasoningEffortObservation {
    /// Non-empty reasoning-effort override explicitly supplied by the workflow call.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub requested: Option<String>,
    /// Effective reasoning effort reported by the initialized child session.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resolved: Option<String>,
}

/// Prompt-safe durable identity and live status for a direct workflow agent.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowAgentSummary {
    /// Accumulated active agent time in milliseconds.
    pub active_ms: i64,
    /// Prompt-safe live activity text.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub activity: Option<String>,
    /// Stable direct-agent identifier.
    pub agent_id: String,
    /// Registered agent type.
    pub agent_type: String,
    /// Epoch milliseconds when the agent completed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub completed_at: Option<i64>,
    /// Known AI-credit spend, in nano-AIU, produced by this direct agent and its descendants. Omitted for historical agents when unattributed charges prevent a known zero.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub consumed_nano_aiu: Option<i64>,
    /// Requested and resolved context observations, when available.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub context: Option<WorkflowAgentContextObservation>,
    /// Friendly, non-unique name intended for display
    #[serde(skip_serializing_if = "Option::is_none")]
    pub display_name: Option<String>,
    /// Friendly, non-unique name intended for display
    pub label: String,
    /// Requested and resolved model observations, when available.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub model: Option<WorkflowAgentModelObservation>,
    /// Phase identifier active when the agent was launched, or null.
    pub phase_id: Option<String>,
    /// Requested and resolved reasoning-effort observations, when available.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reasoning_effort: Option<WorkflowAgentReasoningEffortObservation>,
    /// Deprecated compatibility alias for model.requested.
    #[doc(hidden)]
    #[deprecated]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub requested_model: Option<String>,
    /// Deprecated compatibility alias for model.resolved.
    #[doc(hidden)]
    #[deprecated]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resolved_model: Option<String>,
    /// Owning workflow run identifier.
    pub run_id: String,
    /// Epoch milliseconds when the agent started.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub started_at: Option<i64>,
    /// Current durable or live agent status.
    pub status: String,
    /// Tool-call identifier that launched the agent.
    pub tool_call_id: String,
}

/// Current workflow phase identity.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowCurrentPhase {
    /// Current phase identifier.
    pub id: String,
    /// Zero-based declared phase ordinal, or null for an undeclared phase.
    pub ordinal: Option<i64>,
}

/// Declared or approved workflow resource ceilings.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowDeclaredLimits {
    /// Maximum AI credits consumed by subagents and descendants.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_ai_credits: Option<f64>,
    /// Maximum concurrently active subagents.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_concurrent_subagents: Option<i64>,
    /// Maximum total subagents spawned by the run.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_total_subagents: Option<i64>,
    /// Maximum accumulated active execution time in seconds.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub timeout_seconds: Option<f64>,
}

/// Durable workflow resource consumption.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowRunConsumed {
    /// Accumulated active execution time in milliseconds.
    pub active_ms: i64,
    /// AI usage consumed by the run in nano-AIU.
    pub nano_aiu: i64,
    /// Total subagents spawned by the run.
    pub subagents: i64,
}

/// Prompt-safe terminal workflow outcome.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowRunTerminal {
    /// Human-readable terminal error.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// Machine-readable terminal failure.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub failure: Option<serde_json::Value>,
    /// Pause initiator metadata, or null when the run did not pause.
    pub pause_info: Option<serde_json::Value>,
    /// Human-readable terminal reason.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reason: Option<String>,
    /// Prompt-safe preview of the completed result.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub result_preview: Option<String>,
}

/// Durable workflow run summary with read-time live overlays.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowRunSummary {
    /// Epoch milliseconds when the current active segment started, or null while inactive.
    pub active_segment_started_at: Option<i64>,
    /// Approved effective resource ceilings, or null until approved.
    pub approved: Option<WorkflowDeclaredLimits>,
    /// Whether the durable run state currently passes runtime resume eligibility checks.
    pub can_resume: bool,
    /// Epoch milliseconds when the run completed, or null while nonterminal.
    pub completed_at: Option<i64>,
    /// Durable resource consumption.
    pub consumed: WorkflowRunConsumed,
    /// Epoch milliseconds when the run was created.
    pub created_at: i64,
    /// Current phase identity, or null before any phase is entered.
    pub current_phase: Option<WorkflowCurrentPhase>,
    /// Resource ceilings declared by the workflow.
    pub declared_limits: WorkflowDeclaredLimits,
    /// Number of phases declared by the workflow.
    pub declared_phase_count: i64,
    /// Human-readable workflow description.
    pub description: String,
    /// Number of direct workflow agents currently live.
    pub live_agent_count: i64,
    /// Epoch milliseconds when this live-overlay snapshot was observed.
    pub observed_at: i64,
    /// Monotonic durable run revision.
    pub revision: i64,
    /// Workflow run identifier.
    pub run_id: String,
    /// Epoch milliseconds when execution first started, or null before start.
    pub started_at: Option<i64>,
    /// Current workflow run status.
    pub status: WorkflowRunStatus,
    /// Terminal run outcome, or null while nonterminal.
    pub terminal: Option<WorkflowRunTerminal>,
    /// Total direct workflow agents spawned across all attempts.
    pub total_spawned_agent_count: i64,
    /// Epoch milliseconds when the durable run was last updated.
    pub updated_at: i64,
    /// Registered workflow name.
    pub workflow_name: String,
}

/// Durable lifecycle and timing for one workflow phase.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowPhaseObservation {
    /// Completed active time accumulated by this phase in milliseconds.
    pub accumulated_active_ms: i64,
    /// Epoch milliseconds when this phase completed; for a skipped phase, the synthetic skip timestamp (equal to `startedAt`).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub completed_at: Option<i64>,
    /// Current live active time for this phase in milliseconds.
    pub current_active_ms: i64,
    /// Optional human-readable phase detail.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub detail: Option<String>,
    /// Number of times execution entered this phase.
    pub entry_count: i64,
    /// Phase identifier.
    pub id: String,
    /// Most recent run attempt that entered this phase, or `0` if the phase has never been entered.
    pub last_entered_run_attempt: i64,
    /// Direct agents in this phase that are currently live.
    pub live_agent_count: i64,
    /// Zero-based declared phase ordinal, or null for an undeclared phase.
    pub ordinal: Option<i64>,
    /// Epoch milliseconds when this phase first started; for a skipped phase, the synthetic skip timestamp (equal to `completedAt`).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub started_at: Option<i64>,
    /// Derived lifecycle state of the phase.
    pub status: WorkflowPhaseStatus,
    /// Human-readable phase title.
    pub title: String,
    /// Total direct agents associated with this phase.
    pub total_agent_count: i64,
}

/// One durable workflow progress record.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowProgressLine {
    /// Resume attempt that emitted this record.
    pub attempt: i64,
    /// Progress record kind.
    pub kind: WorkflowLogLineKind,
    /// Phase active when the record was emitted, or null before any phase.
    pub phase_id: Option<String>,
    /// Epoch milliseconds when the record was persisted.
    pub recorded_at: i64,
    /// Global monotonic sequence number within the run.
    pub seq: i64,
    /// Prompt-safe progress text.
    pub text: String,
}

/// A bidirectional page of workflow progress.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowProgressPage {
    /// Whether progress records newer than this page exist.
    pub has_more_newer: bool,
    /// Whether progress records older than this page exist.
    pub has_more_older: bool,
    /// Newest sequence number in this page, or null when empty.
    pub newest_seq: Option<i64>,
    /// Oldest sequence number in this page, or null when empty.
    pub oldest_seq: Option<i64>,
    /// Progress records in sequence order.
    pub records: Vec<WorkflowProgressLine>,
    /// Run revision reflected by this page.
    pub revision: i64,
}

/// Complete current or terminal workflow run envelope.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkflowRunResult {
    /// One-based execution attempt represented by this envelope. Absent before the first attempt starts or when returned by an older runtime.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub attempt: Option<i64>,
    /// Error message for an errored run.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// Machine-readable failure details for a halted or errored run.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub failure: Option<serde_json::Value>,
    /// Structured pause initiator metadata for a paused attempt.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pause_info: Option<serde_json::Value>,
    /// Reason for a halted or cancelled run.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reason: Option<String>,
    /// Completed workflow result.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub result: Option<serde_json::Value>,
    /// Workflow run identifier.
    pub run_id: String,
    /// Partial journal and progress snapshot for a halted, cancelled, or errored run.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub snapshot: Option<serde_json::Value>,
    /// Current or terminal workflow run status.
    pub status: WorkflowRunStatus,
}

/// Complete text used to generate one session diff. These are display contents, with the same text decoding as the patch, not a file-restore contract.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkspaceDiffContents {
    /// Complete current text read when computing the diff. Omitted for a deleted file; an empty string represents an existing empty file.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub after: Option<String>,
    /// Complete text before the session first changed the file. Omitted when the file did not exist; an empty string represents an existing empty file.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub before: Option<String>,
}

/// A single changed file and its unified diff.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkspaceDiffFileChange {
    /// Type of change represented by this file diff.
    pub change_type: WorkspaceDiffFileChangeType,
    /// Full text used for this patch, only when includeContents was requested for session mode. Omitted for binary, oversized or unavailable contents, and for fallback results. Read isFallback and isTruncated before treating an absent value as a missing file.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub contents: Option<WorkspaceDiffContents>,
    /// Unified diff content for the file. Empty when the diff was truncated.
    pub diff: String,
    /// Whether the diff content was omitted because it exceeded the per-file size limit.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub is_truncated: Option<bool>,
    /// Original file path for renamed files.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub old_path: Option<String>,
    /// Path to the changed file, relative to the workspace root when the file lives under it. A file changed outside the workspace root keeps a `../`-relative path, or an absolute path when no relative path exists (for example a different Windows drive).
    pub path: String,
}

/// Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkspacesCheckpoints {
    /// Filename of the checkpoint within the workspace checkpoints directory
    pub filename: String,
    /// Checkpoint number assigned by the workspace manager
    pub number: i64,
    /// Human-readable checkpoint title
    pub title: String,
}

/// MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
pub type McpExecuteSamplingResult = HashMap<String, serde_json::Value>;

/// Authentication host. HMAC auth always targets the public GitHub host.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum HMACAuthInfoHost {
    #[serde(rename = "https://github.com")]
    #[default]
    HttpsGitHubCom,
}

/// HMAC-based authentication used by GitHub-internal services.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum HMACAuthInfoType {
    #[serde(rename = "hmac")]
    #[default]
    Hmac,
}

/// Personal access token (PAT) or server-to-server token sourced from an environment variable.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum EnvAuthInfoType {
    #[serde(rename = "env")]
    #[default]
    Env,
}

/// SDK-side token authentication; the host configured the token directly via the SDK.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum TokenAuthInfoType {
    #[serde(rename = "token")]
    #[default]
    Token,
}

/// SDK callback-backed GitHub token authentication.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum TokenProviderAuthInfoType {
    #[serde(rename = "token-provider")]
    #[default]
    TokenProvider,
}

/// Authentication host (always the public GitHub host).
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CopilotApiTokenAuthInfoHost {
    #[serde(rename = "https://github.com")]
    #[default]
    HttpsGitHubCom,
}

/// Direct Copilot API authentication via the `GITHUB_COPILOT_API_TOKEN` + `COPILOT_API_URL` environment-variable pair. The token itself is read from the environment by the runtime, not carried in this struct.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CopilotApiTokenAuthInfoType {
    #[serde(rename = "copilot-api-token")]
    #[default]
    CopilotApiToken,
}

/// OAuth user authentication. The token itself is held in the runtime's secret token store (keyed by host+login) and is NOT carried in this struct.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum UserAuthInfoType {
    #[serde(rename = "user")]
    #[default]
    User,
}

/// Provider-owned account authentication.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AccountAuthInfoType {
    #[serde(rename = "account")]
    #[default]
    Account,
}

/// Authentication via the `gh` CLI's saved credentials.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum GhCliAuthInfoType {
    #[serde(rename = "gh-cli")]
    #[default]
    GhCli,
}

/// API-key authentication for non-GitHub LLM providers (e.g. when running BYOM-style).
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ApiKeyAuthInfoType {
    #[serde(rename = "api-key")]
    #[default]
    ApiKey,
}

/// Authentication credentials accepted only at native protocol ingress. Runtime outputs use credential-free `AuthIdentity` metadata.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AuthInfo {
    Hmac(HMACAuthInfo),
    Env(EnvAuthInfo),
    Token(TokenAuthInfo),
    TokenProvider(TokenProviderAuthInfo),
    CopilotApiToken(CopilotApiTokenAuthInfo),
    User(UserAuthInfo),
    Account(AccountAuthInfo),
    GhCli(GhCliAuthInfo),
    ApiKey(ApiKeyAuthInfo),
}

/// Authentication type
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AuthInfoType {
    /// Authentication provided by a GitHub App HMAC credential.
    #[serde(rename = "hmac")]
    Hmac,
    /// Authentication resolved from environment-provided credentials.
    #[serde(rename = "env")]
    Env,
    /// Authentication from an interactive user sign-in.
    #[serde(rename = "user")]
    User,
    /// Authentication from a selected provider-owned account, without a GitHub credential.
    #[serde(rename = "account")]
    Account,
    /// Authentication delegated to the GitHub CLI.
    #[serde(rename = "gh-cli")]
    GhCli,
    /// Authentication from an API key credential.
    #[serde(rename = "api-key")]
    ApiKey,
    /// Authentication from a GitHub token.
    #[serde(rename = "token")]
    Token,
    /// Authentication from an SDK GitHub token callback.
    #[serde(rename = "token-provider")]
    TokenProvider,
    /// Authentication from a Copilot API token.
    #[serde(rename = "copilot-api-token")]
    CopilotApiToken,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// The provider kind stamped on a signed-in account.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AccountKind {
    /// An OAuth github.com account.
    #[serde(rename = "githubDotCom")]
    GitHubDotCom,
    /// A GitHub Enterprise Cloud account — a GitHub account on a non-github.com host, e.g. *.ghe.com.
    #[serde(rename = "proxima")]
    Proxima,
    /// A GitHub (EMU) account derived from a base Entra identity.
    #[serde(rename = "entraEmu")]
    EntraEmu,
    /// A base Microsoft Entra identity.
    #[serde(rename = "entra")]
    Entra,
    /// A Microsoft 365 Copilot (Loki) inference account derived from the same base Entra identity as an EMU account; its bearer is a Loki-scoped inference token consumed through the model-provider path, not the GitHub switcher.
    #[serde(rename = "loki")]
    Loki,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// A provider a consumer may interactively sign in with.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum LoginProviderKind {
    /// OAuth github.com sign-in via the browser (web loopback + PKCE).
    #[serde(rename = "githubDotCom")]
    GitHubDotCom,
    /// A GitHub Enterprise Cloud account — a GitHub account on a non-github.com host, e.g. *.ghe.com; the host is supplied interactively through the neutral input-required step.
    #[serde(rename = "proxima")]
    Proxima,
    /// Microsoft Entra sign-in that derives a GitHub (EMU) credential.
    #[serde(rename = "entra")]
    Entra,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Resolved Anthropic adaptive-thinking capability for a model.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AdaptiveThinkingSupport {
    /// The model does not accept thinking.type='adaptive'
    #[serde(rename = "unsupported")]
    Unsupported,
    /// The model accepts adaptive thinking but also accepts thinking.type='enabled'
    #[serde(rename = "optional")]
    Optional,
    /// The model defaults to adaptive thinking and rejects thinking.type='enabled' with HTTP 400, but still accepts thinking.type='disabled' (e.g. opus-4.7/4.8/5, sonnet-5)
    #[serde(rename = "required")]
    Required,
    /// The model accepts only thinking.type='adaptive'; 'enabled', 'disabled', and an omitted thinking block all fail with HTTP 400 (e.g. fable, mythos)
    #[serde(rename = "adaptive_only")]
    AdaptiveOnly,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Where the agent definition was loaded from
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AgentInfoSource {
    /// Agent loaded from the user's personal agent configuration.
    #[serde(rename = "user")]
    User,
    /// Agent loaded from the current project's repository configuration.
    #[serde(rename = "project")]
    Project,
    /// Agent inherited from a parent project or workspace.
    #[serde(rename = "inherited")]
    Inherited,
    /// Agent provided by a remote runtime or service.
    #[serde(rename = "remote")]
    Remote,
    /// Agent contributed by an installed plugin.
    #[serde(rename = "plugin")]
    Plugin,
    /// Agent built into the Copilot runtime.
    #[serde(rename = "builtin")]
    Builtin,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Login flow step variant discriminator.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AuthLoginStepOpenUrlKind {
    #[serde(rename = "open-url")]
    #[default]
    OpenUrl,
}

/// Login flow step variant discriminator.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AuthLoginStepInputRequiredKind {
    #[serde(rename = "input-required")]
    #[default]
    InputRequired,
}

/// Login flow step variant discriminator.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AuthLoginStepAwaitingKind {
    #[serde(rename = "awaiting")]
    #[default]
    Awaiting,
}

/// Login flow step variant discriminator.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AuthLoginStepNeedsInteractionKind {
    #[serde(rename = "needs-interaction")]
    #[default]
    NeedsInteraction,
}

/// Login flow step variant discriminator.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AuthLoginStepCompletedKind {
    #[serde(rename = "completed")]
    #[default]
    Completed,
}

/// Disposition of a login attempt, including pending user decisions.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AuthLoginResultStatus {
    /// The credential was persisted and the selected account is signed in.
    #[serde(rename = "completed")]
    Completed,
    /// Persistence needs explicit consent to store the token in plaintext.
    #[serde(rename = "needs-plaintext-consent")]
    NeedsPlaintextConsent,
    /// Credentials are saved; select an account using a returned selectionId as advance input to complete sign-in.
    #[serde(rename = "needs-account-selection")]
    NeedsAccountSelection,
    /// The user declined plaintext persistence.
    #[serde(rename = "declined")]
    Declined,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Login flow step variant discriminator.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AuthLoginStepErrorKind {
    #[serde(rename = "error")]
    #[default]
    Error,
}

/// One step in an interactive login flow. The consumer acts on the step and calls advance to proceed. Browser-open is encoded as two distinct steps by design: `open-url` is CONSUMER-driven (the provider surfaces the authorize URL and the consumer opens it — github.com/GHEC web), while `needs-interaction` is PROVIDER-driven (the provider opens the browser or broker UI itself and does not surface a URL — Entra).
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AuthLoginStep {
    OpenUrl(AuthLoginStepOpenUrl),
    InputRequired(AuthLoginStepInputRequired),
    Awaiting(AuthLoginStepAwaiting),
    NeedsInteraction(AuthLoginStepNeedsInteraction),
    Completed(AuthLoginStepCompleted),
    Error(AuthLoginStepError),
}

/// Outcome of applying the session-idle Autopilot continuation policy.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AutopilotEvaluateIdleContinuationOutcome {
    /// The policy admitted and scheduled another Autopilot turn.
    #[serde(rename = "continued")]
    Continued,
    /// No Autopilot continuation was scheduled after the policy was applied.
    #[serde(rename = "stopped")]
    Stopped,
    /// The session was not eligible for an Autopilot continuation.
    #[serde(rename = "notApplicable")]
    NotApplicable,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Current normalized autopilot objective lifecycle status.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AutopilotObjectiveStatus {
    /// The objective is actively running.
    #[serde(rename = "active")]
    Active,
    /// The objective is paused and may be resumed.
    #[serde(rename = "paused")]
    Paused,
    /// The objective completed.
    #[serde(rename = "completed")]
    Completed,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Discriminator: the caller is not authenticated
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogAuthenticationRequiredErrorKind {
    #[serde(rename = "authentication-required")]
    #[default]
    AuthenticationRequired,
}

/// Why the catalog authority did not accept the caller's identity
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogAuthenticationRequiredReason {
    /// No credential was presented, so there is nothing to refresh and the caller must sign in.
    #[serde(rename = "no-credential")]
    NoCredential,
    /// A credential was presented and its lifetime has elapsed. A silent refresh is worth attempting before prompting anyone.
    #[serde(rename = "credential-expired")]
    CredentialExpired,
    /// A credential was presented and the authority refused it, for example because it was revoked, malformed, or issued for another audience. Refreshing the same rejected credential is not useful; the caller must sign in again.
    #[serde(rename = "credential-rejected")]
    CredentialRejected,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// JSON MCP card media type accepted for install planning
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpServerCardMediaType {
    /// The current MCP server card media type.
    #[serde(rename = "application/mcp-server-card+json")]
    ApplicationMcpServerCardJson,
    /// The legacy MCP server card media type, accepted for compatibility.
    #[serde(rename = "application/mcp-server+json")]
    ApplicationMcpServerJson,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// A wire feature a caller can require of the catalog surface, negotiated per request. A grant means the runtime understands the feature's contract, not that the deployment has enabled the operation; typed unavailable results report availability separately.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogCapability {
    /// Understands the current `application/mcp-server-card+json` media type.
    #[serde(rename = "mcp-server-card")]
    McpServerCard,
    /// Understands the legacy `application/mcp-server+json` media type.
    #[serde(rename = "legacy-mcp-server-card")]
    LegacyMcpServerCard,
    /// Understands `application/ai-skill` candidates as discovery-only and typed non-installable.
    #[serde(rename = "ai-skill-discovery")]
    AiSkillDiscovery,
    /// Understands opt-in `application/vnd.github.copilot-plugin` candidates and their typed identity, version, source, and compatibility fields.
    #[serde(rename = "agent-plugin-discovery")]
    AgentPluginDiscovery,
    /// Extends agent-plugin-discovery to Claude plugin (`application/vnd.anthropic.claude-plugin+json`) and portable Agent Plugin (`application/agent-plugin+json`) candidates, each reporting its format as its media type. Requires agent-plugin-discovery; without it, plugin searches return only Copilot plugins.
    #[serde(rename = "agent-plugin-formats")]
    AgentPluginFormats,
    /// Understands side-effect-free MCP install-plan requests, results, and plan handles; `planning-unavailable` separately reports that planning is not enabled.
    #[serde(rename = "mcp-install-planning")]
    McpInstallPlanning,
    /// Understands plans that enumerate every eligible transport rather than a single preferred one.
    #[serde(rename = "multiple-transport-choice")]
    MultipleTransportChoice,
    /// Understands explicit numbered navigation and authority-reported pagination metadata with opaque tokens. Advertised and granted only when requested.
    #[serde(rename = "catalog-search-pagination")]
    CatalogSearchPagination,
    /// Understands versioned candidate trust snapshots. Protocol-3 callers must require this capability before the runtime adds the optional snapshot field.
    #[serde(rename = "trust-snapshot")]
    TrustSnapshot,
    /// Understands exact candidate selection through model-safe opaque references and host-only candidate-handle hand-off.
    #[serde(rename = "catalog-selection")]
    CatalogSelection,
    /// Requires an eligible credential for the selected GitHub.com account before search egress and prohibits client-side anonymous retry, including after HTTP 401 or 403. The credential is scoped to the fixed catalog authority without redirect forwarding. Neither a grant nor successful response proves that the authority accepted the identity or selected a particular backend. Preserve this requirement on every page and retry; callers omitting it retain optional authentication.
    #[serde(rename = "catalog-search-credential-required")]
    CatalogSearchCredentialRequired,
    /// Captures the exact existing native session, account, host and connection for authenticated catalogue search, selection and planning. Requires catalog-search-credential-required; does not grant installation or create a session.
    #[serde(rename = "catalog-search-session-bound")]
    CatalogSearchSessionBound,
    /// Understands effect-free preparation, exact human-confirmed apply and owned removal for fully resolved personal remote MCP choices without supplied inputs or configured secrets. Advertised only when the real producer and lower owned admission are linked; requires original connection and bound session authority for new work.
    #[serde(rename = "mcp-confirmed-remote-installation")]
    McpConfirmedRemoteInstallation,
    /// Extends mcp-confirmed-remote-installation to declared non-secret header and URL values and receipt-owned header secrets for personal remote MCP choices. Requires mcp-confirmed-remote-installation and bound session authority. Secret values are written only to the reviewed backend after confirmation and are never returned; package and stdio choices remain unsupported. Advertised only when owned secret effects and owned secret activation are linked.
    #[serde(rename = "mcp-configured-remote-installation")]
    McpConfiguredRemoteInstallation,
    /// Understands verified Agent Finder Skill install, uninstall, recovery and installation-scoped enablement APIs. Advertised only by runtimes with the Skill installation engine linked; acquisition may still be refused as feature-disabled per selected session.
    #[serde(rename = "skill-confirmed-installation")]
    SkillConfirmedInstallation,
    /// Understands `installability`, the reviewable `installPlan` and the optional materialisation `handle` on Agent Plugin candidates, and the verified Agent Plugin installation APIs plugins.planInstall and plugins.applyInstall, and Agent Plugin plans from catalog.planInstallFromReference. Requires agent-plugin-discovery; without it, plugin candidates are unchanged. Advertised only by runtimes with the plugin installer linked; acquisition may still be refused as feature-disabled per selected session.
    #[serde(rename = "agent-plugin-confirmed-installation")]
    AgentPluginConfirmedInstallation,
    /// Understands catalog.planInstallFromReference, which plans installing whatever resource an Agent Finder materialisation reference pins. It plans only kinds whose installation capability the caller also requires: skill-confirmed-installation for Skills, agent-plugin-confirmed-installation for Agent Plugins. Advertised only by runtimes with the Skill installation engine linked.
    #[serde(rename = "catalog-reference-installation")]
    CatalogReferenceInstallation,
    /// Understands catalog.getSavedFeed and catalog.getGeneratedFeed, which retrieve a saved or generated feed with entries projected exactly like catalog.search candidates. Requires catalog-search-credential-required; add catalog-search-session-bound to bind the retrieval to a selected session.
    #[serde(rename = "catalog-feeds")]
    CatalogFeeds,
    /// Understands the optional `categories` filter on catalog.search, which the runtime forwards to the catalog authority. Required to send the filter, so an older runtime refuses the request instead of silently returning unfiltered results.
    #[serde(rename = "catalog-search-categories")]
    CatalogSearchCategories,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Discriminator: the upstream response broke the contract
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogContractViolationErrorKind {
    #[serde(rename = "contract-violation")]
    #[default]
    ContractViolation,
}

/// Which wire-contract rule an upstream response broke
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogContractViolationReason {
    /// A result carried both a URL and embedded data, when exactly one is permitted.
    #[serde(rename = "both-url-and-data")]
    BothUrlAndData,
    /// A result carried neither a URL nor embedded data, when exactly one is required.
    #[serde(rename = "neither-url-nor-data")]
    NeitherUrlNorData,
    /// Two results claimed the same collision key: normalised identity for existing kinds, or normalised identity and declared version for Agent Plugins.
    #[serde(rename = "duplicate-identity")]
    DuplicateIdentity,
    /// A result declared no media type, or one this contract does not model.
    #[serde(rename = "unknown-media-type")]
    UnknownMediaType,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Which request field was rejected locally or by the catalog authority
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogInvalidRequestField {
    /// The selected existing attached session was missing, malformed or unavailable.
    #[serde(rename = "policySessionId")]
    PolicySessionId,
    /// The search query was empty or longer than permitted.
    #[serde(rename = "query")]
    Query,
    /// The requested result count fell outside its permitted range.
    #[serde(rename = "limit")]
    Limit,
    /// The requested candidate kinds were empty or contained a duplicate.
    #[serde(rename = "kinds")]
    Kinds,
    /// The negotiation block was missing or malformed.
    #[serde(rename = "contract")]
    Contract,
    /// The plan source was missing or malformed.
    #[serde(rename = "source")]
    Source,
    /// The supplied card was missing its media type, URL, or data.
    #[serde(rename = "card")]
    Card,
    /// The requested configuration scope is not one this runtime writes.
    #[serde(rename = "scope")]
    Scope,
    /// The pagination token or target was invalid, or the authority rejected the continuation. Repeat the search without page.
    #[serde(rename = "page")]
    Page,
    /// The locally owned session identifier was missing or malformed.
    #[serde(rename = "sessionId")]
    SessionId,
    /// The opaque selection reference was missing or malformed.
    #[serde(rename = "selectionRef")]
    SelectionRef,
    /// The terminal selection outcome was missing or unsupported.
    #[serde(rename = "outcome")]
    Outcome,
    /// The saved feed ID, or the generated feed strategy or key, was missing or malformed.
    #[serde(rename = "feed")]
    Feed,
    /// The trust tier filter was empty, repeated a tier or named an unknown tier.
    #[serde(rename = "trustTiers")]
    TrustTiers,
    /// The category filter was empty, too long, repeated a category or contained a value that is not a lowercase slug.
    #[serde(rename = "categories")]
    Categories,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Discriminator: the request itself was invalid
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogInvalidRequestErrorKind {
    #[serde(rename = "invalid-request")]
    #[default]
    InvalidRequest,
}

/// Discriminator: the card was malformed
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogMalformedCardErrorKind {
    #[serde(rename = "malformed-card")]
    #[default]
    MalformedCard,
}

/// Media type a catalog card is interpreted as
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogMediaType {
    /// The current MCP server card media type.
    #[serde(rename = "application/mcp-server-card+json")]
    ApplicationMcpServerCardJson,
    /// The legacy MCP server card media type, accepted for compatibility.
    #[serde(rename = "application/mcp-server+json")]
    ApplicationMcpServerJson,
    /// An AI skill card. Representable and searchable, but typed non-installable.
    #[serde(rename = "application/ai-skill")]
    ApplicationAiSkill,
    /// An inert Agent Plugin descriptor.
    #[serde(rename = "application/vnd.github.copilot-plugin")]
    ApplicationVndGitHubCopilotPlugin,
    /// An inert Claude plugin descriptor, surfaced only under the agent-plugin-formats capability.
    #[serde(rename = "application/vnd.anthropic.claude-plugin+json")]
    ApplicationVndAnthropicClaudePluginJson,
    /// An inert portable Agent Plugin descriptor, surfaced only under the agent-plugin-formats capability.
    #[serde(rename = "application/agent-plugin+json")]
    ApplicationAgentPluginJson,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// How a card failed validation
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogMalformedCardReason {
    /// The document is not well-formed JSON.
    #[serde(rename = "invalid-json")]
    InvalidJson,
    /// The document does not satisfy its media type's schema.
    #[serde(rename = "schema-violation")]
    SchemaViolation,
    /// The declared media type is not one this runtime understands.
    #[serde(rename = "unsupported-media-type")]
    UnsupportedMediaType,
    /// A field the media type requires is absent.
    #[serde(rename = "missing-required-field")]
    MissingRequiredField,
    /// The document exceeded the permitted size.
    #[serde(rename = "size-limit-exceeded")]
    SizeLimitExceeded,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Discriminator: capability or protocol-version negotiation failed
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogNegotiationRefusedErrorKind {
    #[serde(rename = "negotiation-refused")]
    #[default]
    NegotiationRefused,
}

/// Why capability and protocol-version negotiation refused a caller
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogNegotiationRefusedReason {
    /// The caller's protocol version is below the lowest this runtime serves.
    #[serde(rename = "unsupported-protocol-version")]
    UnsupportedProtocolVersion,
    /// The caller requires at least one capability this runtime cannot honour.
    #[serde(rename = "unsupported-capability")]
    UnsupportedCapability,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Discriminator: the network operation failed
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogNetworkFailureErrorKind {
    #[serde(rename = "network-failure")]
    #[default]
    NetworkFailure,
}

/// Categorised network failure, low cardinality so it can be aggregated without carrying a URL
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogNetworkFailureReason {
    /// No network is available, so nothing was attempted.
    #[serde(rename = "offline")]
    Offline,
    /// The authority's name could not be resolved.
    #[serde(rename = "dns")]
    Dns,
    /// The request exceeded its time budget.
    #[serde(rename = "timeout")]
    Timeout,
    /// The TLS handshake or certificate validation failed.
    #[serde(rename = "tls")]
    Tls,
    /// The connection was refused or reset.
    #[serde(rename = "connection-refused")]
    ConnectionRefused,
    /// The configured proxy returned 407 and requires authentication.
    #[serde(rename = "proxy-authentication-required")]
    ProxyAuthenticationRequired,
    /// The authority rate-limited requests and supplied or implied a bounded cooldown.
    #[serde(rename = "rate-limited")]
    RateLimited,
    /// The authority returned a transient 5xx response.
    #[serde(rename = "service-unavailable")]
    ServiceUnavailable,
    /// The authority returned another status the runtime treats as a failure.
    #[serde(rename = "http-status")]
    HttpStatus,
    /// The response exceeded the permitted size.
    #[serde(rename = "response-too-large")]
    ResponseTooLarge,
    /// A redirect was refused by the runtime's redirect policy.
    #[serde(rename = "redirect-rejected")]
    RedirectRejected,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Discriminator: policy refused the operation
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogPolicyRejectedErrorKind {
    #[serde(rename = "policy-rejected")]
    #[default]
    PolicyRejected,
}

/// Which authority produced a policy decision
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpPlanPolicySource {
    /// No policy applied, so the server is permitted by default.
    #[serde(rename = "none")]
    None,
    /// An enterprise allowlist evaluated the server.
    #[serde(rename = "enterprise-allowlist")]
    EnterpriseAllowlist,
    /// The registry the card came from evaluated the server.
    #[serde(rename = "registry-policy")]
    RegistryPolicy,
    /// Local trust settings evaluated the server.
    #[serde(rename = "local-trust")]
    LocalTrust,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Exact reviewed Skill installation action.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum SkillInstallationReviewInstallAction {
    #[serde(rename = "install")]
    #[default]
    Install,
}

///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum SkillInstallationScope {
    /// The user's personal Copilot home.
    #[serde(rename = "personal")]
    Personal,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Exact reviewed Skill installation action.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum SkillInstallationReviewUninstallAction {
    #[serde(rename = "uninstall")]
    #[default]
    Uninstall,
}

/// Owned Skill state observed from files and receipts.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum SkillInstallationOwnershipState {
    /// Owned files and receipt evidence match.
    #[serde(rename = "intact")]
    Intact,
    /// Owned files no longer match the receipt.
    #[serde(rename = "modified")]
    Modified,
    /// Ownership evidence requires recovery before mutation.
    #[serde(rename = "recovery-required")]
    RecoveryRequired,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Bound-session observation after reconciling persisted enablement.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum SkillInstallationSessionState {
    /// The selected session has loaded this Skill and it is enabled.
    #[serde(rename = "loaded-enabled")]
    LoadedEnabled,
    /// The selected session has loaded this Skill or settings and it is disabled.
    #[serde(rename = "loaded-disabled")]
    LoadedDisabled,
    /// The selected session has not loaded Skills after the latest change.
    #[serde(rename = "not-loaded")]
    NotLoaded,
    /// The selected session could not be inspected.
    #[serde(rename = "unknown")]
    UnknownValue,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Safe verified Skill review fields. No raw credential, candidate handle or plan handle.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SkillInstallationReview {
    Install(SkillInstallationReviewInstall),
    Uninstall(SkillInstallationReviewUninstall),
}

/// Exact reviewed Agent Plugin installation action.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum PluginInstallPlanReviewAction {
    #[serde(rename = "install")]
    #[default]
    Install,
}

/// How a reviewed plugin's MCP server is reached.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum PluginInstallationMcpTransport {
    /// An HTTP or SSE server reached over the network, which may ask the user to sign in.
    #[serde(rename = "remote")]
    Remote,
    /// A command the plugin runs on this machine.
    #[serde(rename = "local")]
    Local,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Discriminator: retrieval was refused as unsafe
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogUnsafeRetrievalErrorKind {
    #[serde(rename = "unsafe-retrieval")]
    #[default]
    UnsafeRetrieval,
}

/// Which hardened-fetch control refused a retrieval
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogUnsafeRetrievalReason {
    /// The URL used a scheme the runtime refuses to fetch.
    #[serde(rename = "blocked-scheme")]
    BlockedScheme,
    /// The URL embedded credentials.
    #[serde(rename = "credentials-in-url")]
    CredentialsInUrl,
    /// The URL resolved to a loopback, private, link-local, or cloud metadata address.
    #[serde(rename = "blocked-address")]
    BlockedAddress,
    /// A redirect target resolved to a blocked address.
    #[serde(rename = "redirect-to-blocked-address")]
    RedirectToBlockedAddress,
    /// The configured proxy policy refused the request.
    #[serde(rename = "proxy-rejected")]
    ProxyRejected,
    /// The authority is not permitted for card retrieval.
    #[serde(rename = "host-not-permitted")]
    HostNotPermitted,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Discriminator: the operation is not available
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogUnavailableErrorKind {
    #[serde(rename = "unavailable")]
    #[default]
    Unavailable,
}

/// Why a catalog operation is not available on this runtime
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogUnavailableReason {
    /// Bounded search is not wired up on this runtime build.
    #[serde(rename = "search-unavailable")]
    SearchUnavailable,
    /// Install planning is not wired up on this runtime build.
    #[serde(rename = "planning-unavailable")]
    PlanningUnavailable,
    /// Exact candidate selection is not available in this session or runtime.
    #[serde(rename = "selection-unavailable")]
    SelectionUnavailable,
    /// No catalog authority is configured for this runtime.
    #[serde(rename = "authority-not-configured")]
    AuthorityNotConfigured,
    /// The surface is disabled by policy on this runtime.
    #[serde(rename = "disabled-by-policy")]
    DisabledByPolicy,
    /// The requested saved feed, or generated feed strategy or key, does not exist.
    #[serde(rename = "feed-not-found")]
    FeedNotFound,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Relationship of the backend-reported count to the complete query result set.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CatalogSearchTotalCountRelation {
    /// No exact/full-query or lower-bound guarantee is available.
    #[serde(rename = "unknown")]
    UnknownValue,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Optional completion hint for the input (e.g. 'directory' for filesystem path completion)
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum SlashCommandInputCompletion {
    /// Input should complete filesystem directories.
    #[serde(rename = "directory")]
    Directory,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum SlashCommandKind {
    /// Command implemented by the runtime.
    #[serde(rename = "builtin")]
    Builtin,
    /// Command backed by a skill.
    #[serde(rename = "skill")]
    Skill,
    /// Command registered by an SDK client or extension.
    #[serde(rename = "client")]
    Client,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Neutral SDK discriminator for the connected remote session kind.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ConnectedRemoteSessionMetadataKind {
    /// Remote CLI session.
    #[serde(rename = "remote-session")]
    RemoteSession,
    /// GitHub Copilot coding agent session.
    #[serde(rename = "coding-agent")]
    CodingAgent,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Stable OAuth scope whose absence prevents Connector management.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ConnectorAuthorizationScope {
    /// Allows Copilot to manage Connector connections and use their tools.
    #[serde(rename = "write_plugin_gateway_connections")]
    WritePluginGatewayConnections,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Availability of the EXPERIMENTAL session connector API.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ConnectorAvailability {
    /// The resolved Connector feature is enabled and Connector requests are permitted.
    #[serde(rename = "enabled")]
    Enabled,
    /// The resolved Connector feature is off. No Connector service request is made while disabled.
    #[serde(rename = "disabled")]
    Disabled,
    /// The session has no eligible host-owned GitHub account or does not support local Connector projection.
    #[serde(rename = "unavailable")]
    Unavailable,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Authoritative service connection state for one Connector.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ConnectorCatalogStatus {
    /// The Connector is available but not connected.
    #[serde(rename = "not_connected")]
    NotConnected,
    /// The Connector service is still completing connection or consent.
    #[serde(rename = "pending")]
    Pending,
    /// The Connector is connected and may contribute MCP servers.
    #[serde(rename = "connected")]
    Connected,
    /// The Connector service reports an unusable connection.
    #[serde(rename = "error")]
    Error,
    /// The service returned a future or unrecognized state.
    #[serde(rename = "unknown")]
    UnknownValue,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Live MCP status of one Connector-owned runtime server.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ConnectorMcpStatus {
    /// The server is connected and its tools are available.
    #[serde(rename = "connected")]
    Connected,
    /// The server connection is still being established.
    #[serde(rename = "pending")]
    Pending,
    /// The server requires refreshed GitHub authorization.
    #[serde(rename = "needs_auth")]
    NeedsAuth,
    /// The server failed to connect or initialize.
    #[serde(rename = "failed")]
    Failed,
    /// The server is intentionally stopped, including when managed policy blocks it.
    #[serde(rename = "stopped")]
    Stopped,
    /// The server is configured but explicitly disabled.
    #[serde(rename = "disabled")]
    Disabled,
    /// The Connector currently has no live server configuration.
    #[serde(rename = "not_configured")]
    NotConfigured,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Source category for a collected debug bundle entry.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum DebugCollectLogsSource {
    /// Session event log.
    #[serde(rename = "events")]
    Events,
    /// Process log for the session.
    #[serde(rename = "process-log")]
    ProcessLog,
    /// Interactive shell log for the session.
    #[serde(rename = "shell-log")]
    ShellLog,
    /// Caller-provided diagnostic entry.
    #[serde(rename = "additional")]
    Additional,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Destination kind that was written.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum DebugCollectLogsResultKind {
    /// A .tgz archive was written.
    #[serde(rename = "archive")]
    Archive,
    /// A directory containing the collected files was written.
    #[serde(rename = "directory")]
    Directory,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Whether the supplied diagnostic cursor remained within the retained buffer window.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum DiagnosticCursorStatus {
    /// The cursor is valid for the current retained window.
    #[serde(rename = "ok")]
    Ok,
    /// The cursor no longer addresses retained records; reading resumes at the oldest retained record.
    #[serde(rename = "expired")]
    Expired,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Direction of an observed MCP protocol frame.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpDiagnosticDirection {
    /// Frame emitted by the Copilot MCP client.
    #[serde(rename = "client-to-server")]
    ClientToServer,
    /// Frame received from the MCP server.
    #[serde(rename = "server-to-client")]
    ServerToClient,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Category for an MCP diagnostic record.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpDiagnosticKind {
    /// Connection lifecycle transition or failure.
    #[serde(rename = "lifecycle")]
    Lifecycle,
    /// JSON-RPC protocol frame.
    #[serde(rename = "protocol")]
    Protocol,
    /// HTTP request or response metadata.
    #[serde(rename = "http")]
    Http,
    /// Local MCP server standard-error output.
    #[serde(rename = "stderr")]
    Stderr,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Severity of an emitted diagnostic record.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum DiagnosticSeverity {
    /// Failure that prevented or interrupted communication.
    #[serde(rename = "error")]
    Error,
    /// A recoverable warning or server standard-error output.
    #[serde(rename = "warning")]
    Warning,
    /// Lifecycle transition.
    #[serde(rename = "info")]
    Info,
    /// Protocol-frame or launch diagnostic.
    #[serde(rename = "debug")]
    Debug,
    /// HTTP metadata diagnostic.
    #[serde(rename = "trace")]
    Trace,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Session-scoped diagnostic threshold. Capture is disabled by default and is never persisted with the session.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum DiagnosticLogLevel {
    /// Disable capture and clear retained diagnostics.
    #[serde(rename = "off")]
    Off,
    /// Capture failures only.
    #[serde(rename = "error")]
    Error,
    /// Capture failures, warnings, and stderr.
    #[serde(rename = "warning")]
    Warning,
    /// Capture lifecycle diagnostics.
    #[serde(rename = "info")]
    Info,
    /// Capture protocol frames and launch diagnostics.
    #[serde(rename = "debug")]
    Debug,
    /// Capture HTTP metadata in addition to debug diagnostics.
    #[serde(rename = "trace")]
    Trace,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Persisted extension discovery source
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum DiscoveredExtensionSource {
    /// Extension discovered from the user's extensions directory.
    #[serde(rename = "user")]
    User,
    /// Extension contributed by an installed plugin.
    #[serde(rename = "plugin")]
    Plugin,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Effective extension loading and agent-management mode
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum DiscoveredExtensionMode {
    /// Extensions are not loaded.
    #[serde(rename = "disabled")]
    Disabled,
    /// Extensions are loaded, but the agent cannot create, reload, or manage them.
    #[serde(rename = "load_only")]
    LoadOnly,
    /// Extensions are loaded and the agent can create, reload, and manage them.
    #[serde(rename = "load_and_augment")]
    LoadAndAugment,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Kind of component that supplied a provider adapter or row. Attribution does not confer authority.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModelProviderProvenanceSource {
    /// Built into the runtime.
    #[serde(rename = "builtIn")]
    BuiltIn,
    /// Derived from existing user configuration.
    #[serde(rename = "configured")]
    Configured,
    /// Supplied by an extension.
    #[serde(rename = "extension")]
    Extension,
    /// Supplied by another trusted contributor.
    #[serde(rename = "custom")]
    Custom,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Typed outcome for a provider operation.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModelProviderOperationOutcomeCode {
    /// The operation completed successfully; an empty inventory is valid.
    #[serde(rename = "success")]
    Success,
    /// The provider or instance is absent during discovery, status, or model listing. Distinct from a successful empty inventory.
    #[serde(rename = "absent")]
    Absent,
    /// The provider is configured or expected but could not be reached.
    #[serde(rename = "unreachable")]
    Unreachable,
    /// The operation failed for a reason other than absence or reachability.
    #[serde(rename = "failed")]
    Failed,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Direction to page through the session's persisted event history. 'forward' pages from the cursor toward newer events; 'backward' returns the newest window first (tail-first) and pages toward older events. Events within a returned batch are always chronological (oldest-to-newest), even for a backward read.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum EventsReadDirection {
    /// Page from the cursor toward newer events (default).
    #[serde(rename = "forward")]
    Forward,
    /// Tail-first: return the newest events and page toward older events.
    #[serde(rename = "backward")]
    Backward,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Cursor status: 'ok' means the read succeeded against the requested history; 'expired' means the requested continuation is unavailable. Recovery is endpoint-specific: session.eventLog.read returns a boundary window of remaining active history that may overlap prior pages, while sessions.readPersistedEvents returns an empty terminal page and never switches journal generations. An expired persisted read is not successful completion; a complete persisted snapshot requires cursorStatus 'ok' and hasMore false.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum EventsCursorStatus {
    /// The read succeeded against the requested history.
    #[serde(rename = "ok")]
    Ok,
    /// The requested continuation is unavailable; see the endpoint's recovery semantics.
    #[serde(rename = "expired")]
    Expired,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Discovery source: project (.github/extensions/), user (~/.copilot/extensions/), plugin (installed plugin), or session (session-state/<id>/extensions/)
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ExtensionSource {
    /// Extension discovered from the current project's .github/extensions directory.
    #[serde(rename = "project")]
    Project,
    /// Extension discovered from the user's ~/.copilot/extensions directory.
    #[serde(rename = "user")]
    User,
    /// Extension contributed by an installed plugin.
    #[serde(rename = "plugin")]
    Plugin,
    /// Extension discovered from the current session's state directory (loaded only for this session).
    #[serde(rename = "session")]
    Session,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Current status: running, disabled, failed, or starting
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ExtensionStatus {
    /// The extension process is running.
    #[serde(rename = "running")]
    Running,
    /// The extension is installed but disabled.
    #[serde(rename = "disabled")]
    Disabled,
    /// The extension failed to start or crashed.
    #[serde(rename = "failed")]
    Failed,
    /// The extension process is starting.
    #[serde(rename = "starting")]
    Starting,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Runtime-derived standalone extension eligibility.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum StandaloneExtensionAdmission {
    /// Policy is resolved and permits standalone extensions.
    #[serde(rename = "allowed")]
    Allowed,
    /// Standalone extensions are prohibited; eligible plugin extensions remain governed by existing plugin controls.
    #[serde(rename = "plugin_only")]
    PluginOnly,
    /// Managed policy is unresolved; standalone extensions must not execute.
    #[serde(rename = "pending")]
    Pending,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Binary result type discriminator. Use "image" for images and "resource" for other binary data.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ExternalToolTextResultForLlmBinaryResultsForLlmType {
    /// Binary image data.
    #[serde(rename = "image")]
    Image,
    /// Other binary resource data.
    #[serde(rename = "resource")]
    Resource,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Reason a captured file was not restored.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum HistoryFileRestoreSkipReason {
    /// The file changed after Copilot's last captured write.
    #[serde(rename = "user-modified")]
    UserModified,
    /// A faithful preimage was not captured.
    #[serde(rename = "skipped-capture")]
    SkippedCapture,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Reason a rewind read (rewind points, file-restore preview, or session diff) could not be answered from the session's file-change captures.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum HistoryRewindUnavailableReason {
    /// The session did not opt into file-change tracking before its first turn.
    #[serde(rename = "file-change-tracking-disabled")]
    FileChangeTrackingDisabled,
    /// The session still has work that may mutate files or history. Transient: the same request succeeds once the session settles, so callers should retry rather than treat it as a failure.
    #[serde(rename = "session-busy")]
    SessionBusy,
    /// Remote-backed rewind routing is not supported.
    #[serde(rename = "unsupported-remote-session")]
    UnsupportedRemoteSession,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Aggregate file change represented by a rewind preview.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum HistoryRewindChangeType {
    /// The discarded turns created the file.
    #[serde(rename = "created")]
    Created,
    /// The discarded turns deleted the file.
    #[serde(rename = "deleted")]
    Deleted,
    /// The discarded turns modified the file.
    #[serde(rename = "modified")]
    Modified,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Outcome of a rewind request.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum HistoryRewindOutcome {
    /// The requested rewind completed; reachable in either mode.
    #[serde(rename = "success")]
    Success,
    /// The session still has work that may mutate files or history; reachable in either mode.
    #[serde(rename = "session-busy")]
    SessionBusy,
    /// A conversation-and-files rewind was requested for a session that did not enable capture; conversation-only rewinds never produce this.
    #[serde(rename = "file-change-tracking-disabled")]
    FileChangeTrackingDisabled,
    /// Remote-backed rewind routing is not supported; reachable in either mode.
    #[serde(rename = "unsupported-remote-session")]
    UnsupportedRemoteSession,
    /// File restore failed and all applied file changes were rolled back; only conversation-and-files rewinds produce this.
    #[serde(rename = "files-rolled-back")]
    FilesRolledBack,
    /// File restore failed and its rollback could not fully restore the pre-rewind state; only conversation-and-files rewinds produce this.
    #[serde(rename = "rollback-incomplete")]
    RollbackIncomplete,
    /// Conversation truncation failed. In conversation-and-files mode any files that were restored are left in place because conversation history cannot be un-truncated; in conversation-only mode no files are restored. Consult restoredFiles for what, if anything, was applied.
    #[serde(rename = "truncation-failed")]
    TruncationFailed,
    /// The conversation was rewound (and, in conversation-and-files mode, captured files were restored), but persisted checkpoints could not be cleaned up; reachable in either mode.
    #[serde(rename = "checkpoint-cleanup-failed")]
    CheckpointCleanupFailed,
    /// Files and conversation were rewound, but obsolete file snapshots could not be removed; only conversation-and-files rewinds produce this.
    #[serde(rename = "snapshot-prune-failed")]
    SnapshotPruneFailed,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Where this source lives — used for UI grouping
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum InstructionSourceLocation {
    /// Instructions live in user-level configuration.
    #[serde(rename = "user")]
    User,
    /// Instructions live in repository-level configuration.
    #[serde(rename = "repository")]
    Repository,
    /// Instructions live under the current working directory.
    #[serde(rename = "working-directory")]
    WorkingDirectory,
    /// Instructions live in plugin-provided configuration.
    #[serde(rename = "plugin")]
    Plugin,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Category of instruction source — used for merge logic
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum InstructionSourceType {
    /// Instructions loaded from the user's home configuration.
    #[serde(rename = "home")]
    Home,
    /// Instructions loaded from repository-scoped files.
    #[serde(rename = "repo")]
    Repo,
    /// Instructions loaded from model-specific files.
    #[serde(rename = "model")]
    Model,
    /// Instructions loaded from VS Code instruction files.
    #[serde(rename = "vscode")]
    Vscode,
    /// Instructions discovered from nested agent files.
    #[serde(rename = "nested-agents")]
    NestedAgents,
    /// Instructions inherited from child instruction files.
    #[serde(rename = "child-instructions")]
    ChildInstructions,
    /// Instructions supplied by an installed plugin.
    #[serde(rename = "plugin")]
    Plugin,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpAppsHostContextDetailsAvailableDisplayMode {
    /// Rendered inline within the host conversation surface
    #[serde(rename = "inline")]
    Inline,
    /// Rendered as a fullscreen overlay
    #[serde(rename = "fullscreen")]
    Fullscreen,
    /// Rendered as a picture-in-picture floating panel
    #[serde(rename = "pip")]
    Pip,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Current display mode (SEP-1865)
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpAppsHostContextDetailsDisplayMode {
    /// Rendered inline within the host conversation surface
    #[serde(rename = "inline")]
    Inline,
    /// Rendered as a fullscreen overlay
    #[serde(rename = "fullscreen")]
    Fullscreen,
    /// Rendered as a picture-in-picture floating panel
    #[serde(rename = "pip")]
    Pip,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Platform type for responsive design
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpAppsHostContextDetailsPlatform {
    /// Host runs in a web browser
    #[serde(rename = "web")]
    Web,
    /// Host runs as a desktop application
    #[serde(rename = "desktop")]
    Desktop,
    /// Host runs on a mobile device
    #[serde(rename = "mobile")]
    Mobile,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// UI theme preference per SEP-1865
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpAppsHostContextDetailsTheme {
    /// Light UI theme
    #[serde(rename = "light")]
    Light,
    /// Dark UI theme
    #[serde(rename = "dark")]
    Dark,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Consumer allowed to call an MCP tool.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpToolUiVisibility {
    /// The model may call the tool.
    #[serde(rename = "model")]
    Model,
    /// An MCP App view may call the tool.
    #[serde(rename = "app")]
    App,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Outcome of starting the original prepared owned login.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpOwnedOauthLoginStatus {
    /// The original requester may open the returned authorisation URL.
    #[serde(rename = "awaiting-browser")]
    AwaitingBrowser,
    /// Cached credentials were accepted and the original server finished reconnecting.
    #[serde(rename = "connected")]
    Connected,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// The sender role of an MCP prompt message.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpPromptRole {
    /// A message from the user.
    #[serde(rename = "user")]
    User,
    /// A message from the assistant.
    #[serde(rename = "assistant")]
    Assistant,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpSamplingExecutionAction {
    /// The sampling inference completed and produced a result.
    #[serde(rename = "success")]
    Success,
    /// The sampling inference failed or was rejected.
    #[serde(rename = "failure")]
    Failure,
    /// The sampling inference was cancelled before completion.
    #[serde(rename = "cancelled")]
    Cancelled,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// How environment-variable values supplied to MCP servers are resolved. "direct" passes literal string values; "indirect" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to "direct".
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum McpSetEnvValueModeDetails {
    /// Treat MCP server environment values as literal strings.
    #[serde(rename = "direct")]
    Direct,
    /// Treat MCP server environment values as host-side references to resolve before launch.
    #[serde(rename = "indirect")]
    Indirect,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum OptionsUpdateToolFilterPrecedence {
    /// If availableTools is set, it is the only constraint that applies (excludedTools is ignored). Preserves CLI / pre-existing client behavior. Default.
    #[serde(rename = "available")]
    Available,
    /// A tool is enabled if and only if it matches the allowlist (or the allowlist is unset) AND it does not match the denylist. Makes 'all except X' expressible by combining the two lists.
    #[serde(rename = "excluded")]
    Excluded,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Hosting platform type of the repository
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum SessionWorkingDirectoryContextHostType {
    /// The working directory repository is hosted on GitHub.
    #[serde(rename = "github")]
    GitHub,
    /// The working directory repository is hosted on Azure DevOps.
    #[serde(rename = "ado")]
    Ado,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Model capability category for grouping in the model picker
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModelPickerCategory {
    /// Lightweight model category optimized for faster, lower-cost interactions.
    #[serde(rename = "lightweight")]
    Lightweight,
    /// Versatile model category suitable for a broad range of tasks.
    #[serde(rename = "versatile")]
    Versatile,
    /// Powerful model category optimized for complex tasks.
    #[serde(rename = "powerful")]
    Powerful,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Relative cost tier for token-based billing users
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModelPickerPriceCategory {
    /// Lowest relative token cost tier.
    #[serde(rename = "low")]
    Low,
    /// Medium relative token cost tier.
    #[serde(rename = "medium")]
    Medium,
    /// High relative token cost tier.
    #[serde(rename = "high")]
    High,
    /// Highest relative token cost tier.
    #[serde(rename = "very_high")]
    VeryHigh,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Current policy state for this model
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModelPolicyState {
    /// The model is enabled by policy.
    #[serde(rename = "enabled")]
    Enabled,
    /// The model is disabled by policy.
    #[serde(rename = "disabled")]
    Disabled,
    /// No explicit policy is configured for the model.
    #[serde(rename = "unconfigured")]
    Unconfigured,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// When the runtime may run an adapter without an explicit user action.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModelProviderAutomaticDiscoveryMode {
    /// The adapter declares that automatic discovery is safe when the other policy fields are satisfied.
    #[serde(rename = "automatic")]
    Automatic,
    /// The adapter may refresh instances the user already configured, but must not scan for new instances automatically.
    #[serde(rename = "configuredOnly")]
    ConfiguredOnly,
    /// The adapter must run only after an explicit user action.
    #[serde(rename = "explicit")]
    Explicit,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Network reach an adapter may use during discovery.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModelProviderDiscoveryNetworkScope {
    /// Discovery does not contact a network service.
    #[serde(rename = "none")]
    None,
    /// Discovery is limited to loopback addresses on the local machine.
    #[serde(rename = "loopbackOnly")]
    LoopbackOnly,
    /// Discovery contacts only endpoints the user already configured.
    #[serde(rename = "configuredEndpointOnly")]
    ConfiguredEndpointOnly,
    /// Discovery may scan or contact the local network.
    #[serde(rename = "localNetwork")]
    LocalNetwork,
    /// Discovery may contact remote internet services.
    #[serde(rename = "internet")]
    Internet,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Whether a planned configuration entry is new or already present in the session registry.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModelProviderConfigurationDisposition {
    /// No matching entry is registered; the caller should add the entry.
    #[serde(rename = "create")]
    Create,
    /// An equivalent entry is already registered; the caller should reuse it rather than adding a duplicate.
    #[serde(rename = "alreadyConfigured")]
    AlreadyConfigured,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// The product serving the model, reported in telemetry as `model_provider`.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ProviderConfigModelProvider {
    /// OpenAI API.
    #[serde(rename = "openai")]
    Openai,
    /// Anthropic API.
    #[serde(rename = "anthropic")]
    Anthropic,
    /// Azure OpenAI Service.
    #[serde(rename = "azure_openai")]
    AzureOpenai,
    /// Ollama.
    #[serde(rename = "ollama")]
    Ollama,
    /// LM Studio.
    #[serde(rename = "lm_studio")]
    LmStudio,
    /// Foundry Local.
    #[serde(rename = "foundry_local")]
    FoundryLocal,
    /// llama.cpp server.
    #[serde(rename = "llama_cpp")]
    LlamaCpp,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Provider transport. Defaults to "http".
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ProviderConfigTransport {
    /// HTTP request/streaming transport.
    #[serde(rename = "http")]
    Http,
    /// WebSocket transport.
    #[serde(rename = "websockets")]
    Websockets,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ProviderConfigType {
    /// Generic OpenAI-compatible API.
    #[serde(rename = "openai")]
    Openai,
    /// Azure OpenAI Service endpoint.
    #[serde(rename = "azure")]
    Azure,
    /// Anthropic API endpoint.
    #[serde(rename = "anthropic")]
    Anthropic,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Wire API format (openai/azure only). Defaults to "completions".
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ProviderConfigWireApi {
    /// OpenAI Chat Completions wire format.
    #[serde(rename = "completions")]
    Completions,
    /// OpenAI Responses API wire format.
    #[serde(rename = "responses")]
    Responses,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Transport to be used for provider requests.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ProviderEndpointTransport {
    /// HTTP request/streaming transport.
    #[serde(rename = "http")]
    Http,
    /// WebSocket transport.
    #[serde(rename = "websockets")]
    Websockets,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Provider family. Matches the `type` field of a BYOK provider config.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ProviderEndpointType {
    /// OpenAI-compatible endpoint (use the OpenAI client library).
    #[serde(rename = "openai")]
    Openai,
    /// Azure OpenAI endpoint (use the OpenAI client library with the Azure base URL).
    #[serde(rename = "azure")]
    Azure,
    /// Anthropic endpoint (use the Anthropic client library).
    #[serde(rename = "anthropic")]
    Anthropic,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Wire API to be used, when required for the provider type.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ProviderEndpointWireApi {
    /// Classic chat-completions request shape.
    #[serde(rename = "completions")]
    Completions,
    /// Newer responses request shape.
    #[serde(rename = "responses")]
    Responses,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Whether the requested preference was already effective or was accepted for later transactional activation.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModelSwitchAutoTierStatus {
    /// The requested preference is already effective. No activation is pending for it, although this request may have cancelled an earlier unclaimed preference reported in `supersededAutoTier`.
    #[serde(rename = "unchanged")]
    Unchanged,
    /// The request was accepted but has not committed. A later user turn using the `auto` model must mint and validate the replacement before it becomes effective.
    #[serde(rename = "pending")]
    Pending,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Disposition of a permission request as observed by the responding client.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum PermissionDecisionOutcome {
    /// The request was approved automatically without a new human decision.
    #[serde(rename = "auto_approved")]
    AutoApproved,
    /// The request was denied without an interactive user decision; source records why.
    #[serde(rename = "autopilot_denied")]
    AutopilotDenied,
    /// The response came from an interactive user prompt.
    #[serde(rename = "prompted_user")]
    PromptedUser,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Response capability available to the client when it settled a permission request.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum PermissionResponseCapability {
    /// The client could ask a user for this decision.
    #[serde(rename = "interactive")]
    Interactive,
    /// The client could return an automated response but could not ask a user.
    #[serde(rename = "headless")]
    Headless,
    /// The client had no response path available.
    #[serde(rename = "none")]
    None,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Client surface that submitted a permission response.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum PermissionDecisionSurface {
    /// The interactive Copilot CLI terminal UI.
    #[serde(rename = "tui")]
    Tui,
    /// The non-interactive Copilot CLI prompt mode.
    #[serde(rename = "prompt_mode")]
    PromptMode,
    /// The Copilot App client.
    #[serde(rename = "copilot_app")]
    CopilotApp,
    /// An Agent Client Protocol host.
    #[serde(rename = "acp")]
    Acp,
    /// A generic Copilot SDK client.
    #[serde(rename = "sdk")]
    Sdk,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Where completed plugin content was staged before atomic promotion.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum PluginInstallStagingMode {
    /// A sibling of the installed-plugins root, outside the recursively watched tree.
    #[serde(rename = "external")]
    External,
    /// A sibling of the destination plugin directory, used when external staging is unavailable.
    #[serde(rename = "destination_sibling")]
    DestinationSibling,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// The UI mode the agent was in when this message was sent. Defaults to the session's current mode.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum SendAgentMode {
    /// The agent is responding interactively to the user.
    #[serde(rename = "interactive")]
    Interactive,
    /// The agent is preparing a plan before making changes.
    #[serde(rename = "plan")]
    Plan,
    /// The agent is working autonomously toward task completion.
    #[serde(rename = "autopilot")]
    Autopilot,
    /// The agent is in shell-focused UI mode.
    #[serde(rename = "shell")]
    Shell,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Whether this item is a queued user message or a queued slash command / model change
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum QueuePendingItemsKind {
    /// A queued user message.
    #[serde(rename = "message")]
    Message,
    /// A queued slash command or model-change command.
    #[serde(rename = "command")]
    Command,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// One atomic settings mutation.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) enum SettingsEditOperation {
    /// Set one scalar value.
    #[serde(rename = "set")]
    Set,
    /// Add one string to a list, unless present.
    #[serde(rename = "add-item")]
    AddItem,
    /// Remove one string from a list, unless absent.
    #[serde(rename = "remove-item")]
    RemoveItem,
    /// Remove the setting without supplying a value.
    #[serde(rename = "remove")]
    Remove,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Repository host type, if known
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum WorkspaceSummaryHostType {
    /// Workspace summary repository is hosted on GitHub.
    #[serde(rename = "github")]
    GitHub,
    /// Workspace summary repository is hosted on Azure DevOps.
    #[serde(rename = "ado")]
    Ado,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ShellInitProfile {
    /// Disable automatic non-interactive profile loading. Explicit initScripts still run.
    #[serde(rename = "none")]
    None,
    /// Allow automatic non-interactive profile loading when supported. Explicit initScripts still run.
    #[serde(rename = "non-interactive")]
    NonInteractive,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Supported built-in shells for initialization scripts.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum ShellInitScriptShell {
    /// Source the script in the built-in Bash shell on macOS and Linux.
    #[serde(rename = "bash")]
    Bash,
    /// Source the script in the built-in PowerShell shell on Windows.
    #[serde(rename = "powershell")]
    Powershell,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Sharing status for a synced session. "repo" makes the session visible to anyone with read access to the repository; "unshared" restricts it to the creator and collaborators.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum SessionVisibilityStatus {
    /// The session is visible to repository readers.
    #[serde(rename = "repo")]
    Repo,
    /// The session is restricted to its creator and collaborators.
    #[serde(rename = "unshared")]
    Unshared,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Whether one atomic settings edit changed a file.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) enum SettingsEditStatus {
    /// The edit changed the setting and was stored.
    #[serde(rename = "changed")]
    Changed,
    /// The setting already had the requested state.
    #[serde(rename = "unchanged")]
    Unchanged,
    /// The existing settings file could not be edited safely; nothing was written.
    #[serde(rename = "invalid")]
    Invalid,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Context tier override for matching subagents
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum SubagentSettingsEntryContextTier {
    /// Inherit the parent session's effective context tier at dispatch time.
    #[serde(rename = "inherit")]
    Inherit,
    /// Use the model's default context window.
    #[serde(rename = "default")]
    Default,
    /// Pin the subagent to the long-context tier when supported.
    #[serde(rename = "long_context")]
    LongContext,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// The user's response: accept (submitted), decline (rejected), or cancel (dismissed)
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum UIElicitationResponseAction {
    /// The user submitted the requested form values.
    #[serde(rename = "accept")]
    Accept,
    /// The user explicitly declined to provide the requested input.
    #[serde(rename = "decline")]
    Decline,
    /// The user dismissed the elicitation request.
    #[serde(rename = "cancel")]
    Cancel,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Current or terminal state of a workflow run.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum WorkflowRunStatus {
    /// The run was minted and is awaiting approval.
    #[serde(rename = "pending")]
    Pending,
    /// The run is executing.
    #[serde(rename = "running")]
    Running,
    /// The run completed successfully.
    #[serde(rename = "completed")]
    Completed,
    /// The run was interrupted while resource budget remained.
    #[serde(rename = "halted")]
    Halted,
    /// The current attempt stopped intentionally and the run may be resumed.
    #[serde(rename = "paused")]
    Paused,
    /// The run was cancelled before completion.
    #[serde(rename = "cancelled")]
    Cancelled,
    /// The workflow body failed or reached a cumulative resource ceiling.
    #[serde(rename = "error")]
    Error,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Kind of workflow progress line.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum WorkflowLogLineKind {
    /// A narrator log line.
    #[serde(rename = "log")]
    Log,
    /// A named workflow phase marker.
    #[serde(rename = "phase")]
    Phase,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Action the runtime selected for a durable workflow pause checkpoint.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum WorkflowPauseCheckpointAction {
    /// The checkpoint was committed by a prior paused attempt, so execution may continue.
    #[serde(rename = "continue")]
    Continue,
    /// This attempt claimed the checkpoint and must cooperatively stop.
    #[serde(rename = "pause")]
    Pause,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Derived lifecycle state of a workflow phase.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum WorkflowPhaseStatus {
    /// The phase has not been entered yet.
    #[serde(rename = "pending")]
    Pending,
    /// The phase is currently entered and accumulating active time.
    #[serde(rename = "active")]
    Active,
    /// The phase was entered and has since been closed.
    #[serde(rename = "completed")]
    Completed,
    /// The phase was never entered because a later phase was entered or the run reached a terminal state.
    #[serde(rename = "skipped")]
    Skipped,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Type of change represented by this file diff.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum WorkspaceDiffFileChangeType {
    /// The file was added.
    #[serde(rename = "added")]
    Added,
    /// The file was modified.
    #[serde(rename = "modified")]
    Modified,
    /// The file was deleted.
    #[serde(rename = "deleted")]
    Deleted,
    /// The file was renamed.
    #[serde(rename = "renamed")]
    Renamed,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Diff mode requested by the client.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum WorkspaceDiffMode {
    /// Return staged, unstaged, and untracked working tree changes.
    #[serde(rename = "unstaged")]
    Unstaged,
    /// Return changes compared with the default branch.
    #[serde(rename = "branch")]
    Branch,
    /// Return the cumulative diff of files Copilot changed this session (used in non-git workspaces).
    #[serde(rename = "session")]
    Session,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}

/// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration.
///
/// <div class="warning">
///
/// **Experimental.** This type is part of an experimental wire-protocol surface
/// and may change or be removed in future SDK or CLI releases.
///
/// </div>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum WorkspacesWorkspaceDetailsHostType {
    /// Workspace repository is hosted on GitHub.
    #[serde(rename = "github")]
    GitHub,
    /// Workspace repository is hosted on Azure DevOps.
    #[serde(rename = "ado")]
    Ado,
    /// Unknown variant for forward compatibility.
    #[default]
    #[serde(other)]
    Unknown,
}