monty-proto 1.0.0

A secure, snapshotable Python sandbox written in Rust.
Documentation
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
// @generated by `make generate-proto` from proto/monty/v1/monty.proto — DO NOT EDIT.
#![allow(clippy::allow_attributes, clippy::pedantic, clippy::use_self, clippy::absolute_paths, missing_docs)]
// This file is @generated by prost-build.
/// Empty placeholder for valueless oneof arms. Defined locally (rather than
/// importing google.protobuf.Empty) so non-Rust decoders need nothing beyond
/// this single file.
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Unit {}
/// One node of an `Arena`. Leaf arms carry the value; container arms carry
/// the indexes of their children.
///
/// `repr` and `cycle` are OUTPUT-ONLY: the child may emit them (e.g. inside a
/// `Complete` value) but rejects them as inputs.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct MontyNode {
    #[prost(
        oneof = "monty_node::Kind",
        tags = "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"
    )]
    pub kind: ::core::option::Option<monty_node::Kind>,
}
/// Nested message and enum types in `MontyNode`.
pub mod monty_node {
    #[derive(Clone, PartialEq, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Kind {
        #[prost(message, tag = "1")]
        Ellipsis(super::Unit),
        #[prost(message, tag = "2")]
        None(super::Unit),
        #[prost(message, tag = "3")]
        NotImplemented(super::Unit),
        #[prost(bool, tag = "4")]
        Boolean(bool),
        /// Python int fitting in 64 bits.
        #[prost(sint64, tag = "5")]
        Int(i64),
        /// Python int wider than 64 bits.
        #[prost(message, tag = "6")]
        Bigint(super::BigInt),
        #[prost(double, tag = "7")]
        Float(f64),
        #[prost(string, tag = "8")]
        Str(crate::budgeted_prost::alloc::string::String),
        #[prost(bytes, tag = "9")]
        Bytes(crate::budgeted_prost::alloc::vec::Vec<u8>),
        /// A uuid.UUID value. Declared so the tag is settled, but NOT YET
        /// IMPLEMENTED: monty has no uuid module, so neither end produces or
        /// accepts this arm (conversion to a domain node rejects it).
        #[prost(message, tag = "10")]
        Uuid(super::Uuid),
        #[prost(message, tag = "11")]
        List(crate::WireIndexes),
        #[prost(message, tag = "12")]
        Tuple(crate::WireIndexes),
        #[prost(message, tag = "13")]
        NamedTuple(crate::WireNamedTuple),
        #[prost(message, tag = "14")]
        Dict(crate::WireNodePairs),
        #[prost(message, tag = "15")]
        Set(crate::WireIndexes),
        #[prost(message, tag = "16")]
        FrozenSet(crate::WireIndexes),
        #[prost(message, tag = "17")]
        Date(super::Date),
        #[prost(message, tag = "18")]
        Time(super::Time),
        #[prost(message, tag = "19")]
        Datetime(super::DateTime),
        #[prost(message, tag = "20")]
        Timedelta(super::TimeDelta),
        #[prost(message, tag = "21")]
        Timezone(super::TimeZone),
        /// A simple exception VALUE (no traceback) — e.g. an exception stored in a
        /// variable. Errors that terminate execution use `RaisedException` instead.
        #[prost(message, tag = "22")]
        Exception(super::Exception),
        /// A Python type object — builtin, sandbox class, or host class. A class
        /// is a node of its own, shared by every instance of it in the arena.
        #[prost(message, tag = "23")]
        Type(super::Type),
        #[prost(message, tag = "24")]
        ClassInstance(super::ClassInstanceNode),
        #[prost(message, tag = "25")]
        Function(super::Function),
        /// A builtin function, named by its Python name, e.g. "len", "print".
        #[prost(string, tag = "26")]
        BuiltinFunction(crate::budgeted_prost::alloc::string::String),
        /// A pathlib.Path value (always a virtual POSIX path, never a host path).
        #[prost(string, tag = "27")]
        Path(crate::budgeted_prost::alloc::string::String),
        #[prost(message, tag = "28")]
        FileHandle(super::FileHandle),
        /// OUTPUT-ONLY fallback: repr() of a value with no other representation.
        #[prost(string, tag = "29")]
        Repr(crate::budgeted_prost::alloc::string::String),
        /// OUTPUT-ONLY: a reference back to a container enclosing this node, as
        /// the placeholder its repr shows ("\[...\]", "(...)", "{...}" or "...").
        #[prost(string, tag = "30")]
        Cycle(crate::budgeted_prost::alloc::string::String),
    }
}
/// One key/value entry as node indexes. Used for dicts, attrs and kwargs:
/// proto maps cannot have message keys and do not preserve order, while
/// Python dicts allow arbitrary hashable keys and are insertion-ordered.
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct NodePair {
    #[prost(uint32, tag = "1")]
    pub key: u32,
    #[prost(uint32, tag = "2")]
    pub value: u32,
}
/// Arbitrary-precision integer as sign + big-endian magnitude. Exact and O(n);
/// JS decode is `(negative ? -1n : 1n) * BigInt('0x' + hex(magnitude))`.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct BigInt {
    #[prost(bool, tag = "1")]
    pub negative: bool,
    #[prost(bytes = "vec", tag = "2")]
    pub magnitude: crate::budgeted_prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Date {
    /// Gregorian year in 1..=9999.
    #[prost(int32, tag = "1")]
    pub year: i32,
    /// 1..=12.
    #[prost(uint32, tag = "2")]
    pub month: u32,
    #[prost(uint32, tag = "3")]
    pub day: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct DateTime {
    #[prost(int32, tag = "1")]
    pub year: i32,
    #[prost(uint32, tag = "2")]
    pub month: u32,
    #[prost(uint32, tag = "3")]
    pub day: u32,
    #[prost(uint32, tag = "4")]
    pub hour: u32,
    #[prost(uint32, tag = "5")]
    pub minute: u32,
    #[prost(uint32, tag = "6")]
    pub second: u32,
    /// 0..=999999.
    #[prost(uint32, tag = "7")]
    pub microsecond: u32,
    /// Fixed UTC offset for aware datetimes; absent for naive values.
    #[prost(int32, optional, tag = "8")]
    pub offset_seconds: ::core::option::Option<i32>,
    /// Optional timezone name; only valid when offset_seconds is set.
    #[prost(string, optional, tag = "9")]
    pub timezone_name: ::core::option::Option<
        crate::budgeted_prost::alloc::string::String,
    >,
}
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Time {
    /// 0..=23.
    #[prost(uint32, tag = "1")]
    pub hour: u32,
    /// 0..=59.
    #[prost(uint32, tag = "2")]
    pub minute: u32,
    /// 0..=59.
    #[prost(uint32, tag = "3")]
    pub second: u32,
    /// 0..=999999.
    #[prost(uint32, tag = "4")]
    pub microsecond: u32,
    /// Fixed UTC offset for aware times; absent for naive values.
    #[prost(int32, optional, tag = "5")]
    pub offset_seconds: ::core::option::Option<i32>,
    /// Optional timezone name; only valid when offset_seconds is set.
    #[prost(string, optional, tag = "6")]
    pub timezone_name: ::core::option::Option<
        crate::budgeted_prost::alloc::string::String,
    >,
    /// Disambiguates a repeated wall clock, 0 or 1. Carried so a time does not
    /// silently lose the flag crossing the boundary; monty never interprets it.
    #[prost(uint32, tag = "7")]
    pub fold: u32,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct TimeDelta {
    #[prost(int32, tag = "1")]
    pub days: i32,
    /// Normalized to 0..86400.
    #[prost(int32, tag = "2")]
    pub seconds: i32,
    /// Normalized to 0..1000000.
    #[prost(int32, tag = "3")]
    pub microseconds: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct TimeZone {
    #[prost(int32, tag = "1")]
    pub offset_seconds: i32,
    #[prost(string, optional, tag = "2")]
    pub name: ::core::option::Option<crate::budgeted_prost::alloc::string::String>,
}
/// A simple exception value: type name (e.g. "ValueError") + optional single
/// string argument.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Exception {
    #[prost(string, tag = "1")]
    pub exc_type: crate::budgeted_prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub arg: ::core::option::Option<crate::budgeted_prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct FileHandle {
    /// Virtual (sandbox) path — never a host path.
    #[prost(string, tag = "1")]
    pub path: crate::budgeted_prost::alloc::string::String,
    /// Canonical Python open() mode string: one of r, rb, r+, rb+, w, wb, w+,
    /// wb+, a, ab, a+, ab+.
    #[prost(string, tag = "2")]
    pub mode: crate::budgeted_prost::alloc::string::String,
    /// Char index (text mode) or byte index (binary mode).
    #[prost(uint64, tag = "3")]
    pub position: u64,
}
/// A 16-byte UUID (uuid4). Exactly 16 bytes; validated on decode. Class and
/// instance ids are generated by whichever side defined the object, so they never
/// encode a memory address and cannot be reused the way CPython reuses `id()`.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Uuid {
    #[prost(bytes = "vec", tag = "1")]
    pub data: crate::budgeted_prost::alloc::vec::Vec<u8>,
}
/// A Python type object crossing the sandbox boundary.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Type {
    /// Python-visible name: builtin Display name ("int", "datetime.datetime")
    /// or class name ("Point").
    #[prost(string, tag = "1")]
    pub name: crate::budgeted_prost::alloc::string::String,
    /// Identity of the class; absent iff origin == TYPE_ORIGIN_BUILTIN.
    #[prost(message, optional, tag = "2")]
    pub id: ::core::option::Option<Uuid>,
    /// Where the type was defined (builtin, sandbox, or host).
    #[prost(enumeration = "TypeOrigin", tag = "3")]
    pub origin: i32,
    /// Whether `dataclasses.is_dataclass` is true for the class.
    #[prost(bool, tag = "4")]
    pub is_dataclass: bool,
    /// Class attributes sent eagerly with the type object (class constants, per
    /// the sending wrapper's policy), as `(name, value)` node indexes. The
    /// sandbox keeps one type object per class id: a non-empty set replaces its
    /// attrs, an empty set leaves them unchanged. The worker never sends attrs
    /// for a sandbox class.
    #[prost(message, optional, tag = "5")]
    pub attrs: ::core::option::Option<crate::WireNodePairs>,
}
/// A class instance crossing the sandbox boundary. Host-backed instances route
/// method calls and lazy attribute lookups back to the real object by uuid
/// (`FunctionCall.object_id` / `NameLookup.object_id`); sandbox-defined
/// instances carry a worker-generated uuid instead.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct ClassInstanceNode {
    /// Index of the instance's class: a `type` node with origin SANDBOX or HOST
    /// (never BUILTIN), shared by every instance of the class in the arena.
    #[prost(uint32, tag = "1")]
    pub class_type: u32,
    /// Identity of the instance, generated by whichever side defined it.
    #[prost(message, optional, tag = "2")]
    pub instance_id: ::core::option::Option<Uuid>,
    /// Eagerly-sent attributes as `(name, value)` node indexes, in order.
    #[prost(message, optional, tag = "3")]
    pub attrs: ::core::option::Option<crate::WireNodePairs>,
}
/// An external (host-provided) function value, usually supplied by the parent
/// in response to a `NameLookup` event.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Function {
    #[prost(string, tag = "1")]
    pub name: crate::budgeted_prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub docstring: ::core::option::Option<crate::budgeted_prost::alloc::string::String>,
}
/// A raised Python exception with its traceback. Mirrors monty's
/// `MontyException`.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct RaisedException {
    /// Exception type name, e.g. "ValueError", "json.JSONDecodeError".
    #[prost(string, tag = "1")]
    pub exc_type: crate::budgeted_prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub message: ::core::option::Option<crate::budgeted_prost::alloc::string::String>,
    /// Outermost frame first, matching Python traceback order.
    #[prost(message, repeated, tag = "3")]
    pub traceback: crate::budgeted_prost::alloc::vec::Vec<StackFrame>,
    /// Structured payload for exception types that carry more than a message;
    /// absent for most exceptions. Mirrors monty's `ExcData`.
    #[prost(message, optional, tag = "4")]
    pub data: ::core::option::Option<ExcData>,
}
/// Structured exception payload, mirroring monty's `ExcData` enum. Future
/// exception types that carry more than a message (e.g. OSError's errno)
/// get new oneof arms with fresh tags. An absent/empty kind means "no
/// payload" (`ExcData::None`).
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct ExcData {
    #[prost(oneof = "exc_data::Kind", tags = "1, 2")]
    pub kind: ::core::option::Option<exc_data::Kind>,
}
/// Nested message and enum types in `ExcData`.
pub mod exc_data {
    #[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Kind {
        #[prost(message, tag = "1")]
        Unicode(super::UnicodeErrorData),
        #[prost(message, tag = "2")]
        Json(super::JsonErrorData),
    }
}
/// CPython's UnicodeDecodeError/UnicodeEncodeError constructor fields
/// (encoding, object, start, end, reason), letting hosts rebuild the real
/// exception instead of a message-only fallback. Mirrors monty's
/// `UnicodeErrorData`.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct UnicodeErrorData {
    /// Codec name as CPython reports it, e.g. "utf-8".
    #[prost(string, tag = "1")]
    pub encoding: crate::budgeted_prost::alloc::string::String,
    /// Failing range: byte offsets for decode errors, character indices for
    /// encode errors. `end` is exclusive.
    #[prost(uint64, tag = "4")]
    pub start: u64,
    #[prost(uint64, tag = "5")]
    pub end: u64,
    /// CPython's reason wording, e.g. "ordinal not in range(128)".
    #[prost(string, tag = "6")]
    pub reason: crate::budgeted_prost::alloc::string::String,
    /// The input that failed: bytes for decode errors, str for encode errors.
    #[prost(oneof = "unicode_error_data::Object", tags = "2, 3")]
    pub object: ::core::option::Option<unicode_error_data::Object>,
}
/// Nested message and enum types in `UnicodeErrorData`.
pub mod unicode_error_data {
    /// The input that failed: bytes for decode errors, str for encode errors.
    #[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Object {
        #[prost(bytes, tag = "2")]
        ObjectBytes(crate::budgeted_prost::alloc::vec::Vec<u8>),
        #[prost(string, tag = "3")]
        ObjectStr(crate::budgeted_prost::alloc::string::String),
    }
}
/// CPython's json.JSONDecodeError attribute fields (msg, doc, pos, lineno,
/// colno), letting hosts rebuild the real exception instead of a message-only
/// fallback. Mirrors monty's `JsonErrorData`.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct JsonErrorData {
    /// Bare error message, without the ": line N column M (char K)" suffix.
    #[prost(string, tag = "1")]
    pub msg: crate::budgeted_prost::alloc::string::String,
    /// The document being parsed; absent when larger than the sender's size cap
    /// or when bytes input is not valid UTF-8.
    #[prost(string, optional, tag = "2")]
    pub doc: ::core::option::Option<crate::budgeted_prost::alloc::string::String>,
    /// Character index of the error in `doc`.
    #[prost(uint64, tag = "3")]
    pub pos: u64,
    /// 1-based line and column of the error.
    #[prost(uint64, tag = "4")]
    pub lineno: u64,
    #[prost(uint64, tag = "5")]
    pub colno: u64,
}
/// 1-based line/column source position (columns count characters, not bytes).
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct CodeLoc {
    #[prost(uint32, tag = "1")]
    pub line: u32,
    #[prost(uint32, tag = "2")]
    pub column: u32,
}
/// Where the expression that suspended execution is in the source. `filename`
/// names the source as a traceback frame does: `<python-input-N>` for the
/// session's N-th feed, or `<string>` inside an `eval()` / `exec()` string.
/// `start` and `end` are UTF-8 byte offsets into that source, `end` exclusive.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct SourceRange {
    #[prost(string, tag = "1")]
    pub filename: crate::budgeted_prost::alloc::string::String,
    #[prost(uint32, tag = "2")]
    pub start: u32,
    #[prost(uint32, tag = "3")]
    pub end: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct StackFrame {
    #[prost(string, tag = "1")]
    pub filename: crate::budgeted_prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub start: ::core::option::Option<CodeLoc>,
    #[prost(message, optional, tag = "3")]
    pub end: ::core::option::Option<CodeLoc>,
    /// Function name; absent for module-level code (rendered as "<module>").
    #[prost(string, optional, tag = "4")]
    pub frame_name: ::core::option::Option<crate::budgeted_prost::alloc::string::String>,
    /// Source line shown in the traceback preview.
    #[prost(string, optional, tag = "5")]
    pub preview_line: ::core::option::Option<
        crate::budgeted_prost::alloc::string::String,
    >,
    /// Suppress the `~~~` caret markers for this frame.
    #[prost(bool, tag = "6")]
    pub hide_caret: bool,
    /// Suppress the `, in <name>` suffix (SyntaxError style).
    #[prost(bool, tag = "7")]
    pub hide_frame_name: bool,
}
/// Sandbox resource limits. Absent fields are unlimited except recursion depth
/// and `max_suspensions`, which both default to 1000. The parent enforces
/// `max_suspensions`; the child only retains it for dumps and echoes it on
/// `ChildEvent`.
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct ResourceLimits {
    #[prost(uint64, optional, tag = "2")]
    pub max_memory_bytes: ::core::option::Option<u64>,
    #[prost(uint64, optional, tag = "3")]
    pub gc_interval: ::core::option::Option<u64>,
    #[prost(uint64, optional, tag = "4")]
    pub max_recursion_depth: ::core::option::Option<u64>,
    #[prost(uint64, optional, tag = "5")]
    pub max_suspensions: ::core::option::Option<u64>,
    /// Per-feed and per-turn execution budgets on one clock: the feed budget
    /// resets at each feed, the turn budget at each feed and each resume.
    #[prost(uint64, optional, tag = "6")]
    pub max_feed_duration_micros: ::core::option::Option<u64>,
    #[prost(uint64, optional, tag = "7")]
    pub max_turn_duration_micros: ::core::option::Option<u64>,
    /// Cumulative budget for system sleeps, enforced by the parent.
    #[prost(uint64, optional, tag = "8")]
    pub max_total_sleep_micros: ::core::option::Option<u64>,
}
/// Mirrors monty's `OsPolicy`: the clock, zone, sleep, process clock and
/// initial randomness a session gets, and which of those it asks the host for.
/// Each unset arm means that field's default.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct OsPolicy {
    /// The zone naive `datetime.now()` and `date.today()` read in, and that
    /// `astimezone()`, `%Z` and the `time` constants report. Absent = UTC.
    #[prost(message, optional, tag = "4")]
    pub timezone: ::core::option::Option<SandboxTimeZone>,
    /// What `time.sleep()` and `asyncio.sleep()` do.
    /// Absent (or with no arm set) = system sleep with the default maximum.
    #[prost(message, optional, tag = "5")]
    pub sleep: ::core::option::Option<SleepMode>,
    /// The instant `date.today()`, `datetime.now()` and `time.time()` read.
    #[prost(oneof = "os_policy::Datetime", tags = "1, 2, 3")]
    pub datetime: ::core::option::Option<os_policy::Datetime>,
    /// Where an unseeded `random` generator gets its first state.
    #[prost(oneof = "os_policy::RandomStart", tags = "6, 7, 8")]
    pub random_start: ::core::option::Option<os_policy::RandomStart>,
    /// What `time.process_time()` and `time.thread_time()` report.
    /// Absent (or with no arm set) = zero.
    #[prost(oneof = "os_policy::ProcessTime", tags = "9, 10")]
    pub process_time: ::core::option::Option<os_policy::ProcessTime>,
}
/// Nested message and enum types in `OsPolicy`.
pub mod os_policy {
    /// The instant `date.today()`, `datetime.now()` and `time.time()` read.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Datetime {
        /// The child's clock.
        #[prost(message, tag = "1")]
        System(super::Unit),
        /// Suspend to the parent's OS handler.
        #[prost(message, tag = "2")]
        CallHost(super::Unit),
        /// One frozen instant, for reproducible runs.
        #[prost(message, tag = "3")]
        Fixed(super::FixedDateTime),
    }
    /// Where an unseeded `random` generator gets its first state.
    #[derive(Clone, PartialEq, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum RandomStart {
        /// From the child's own OS entropy.
        #[prost(message, tag = "6")]
        RandomSystem(super::Unit),
        /// Suspend the first draw with an `os.urandom` call for 2496 bytes.
        #[prost(message, tag = "7")]
        RandomCallHost(super::Unit),
        /// As `random.seed(seed)` would, for reproducible runs.
        #[prost(message, tag = "8")]
        Seed(super::RandomSeed),
    }
    /// What `time.process_time()` and `time.thread_time()` report.
    /// Absent (or with no arm set) = zero.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum ProcessTime {
        /// Always 0.0, so elapsed execution time is not observable in the sandbox.
        #[prost(message, tag = "9")]
        Zero(super::Unit),
        /// The session's accumulated execution time.
        #[prost(message, tag = "10")]
        Elapsed(super::Unit),
    }
}
/// Mirrors monty's `SandboxTimeZone`.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct SandboxTimeZone {
    #[prost(oneof = "sandbox_time_zone::Zone", tags = "1, 2, 3")]
    pub zone: ::core::option::Option<sandbox_time_zone::Zone>,
}
/// Nested message and enum types in `SandboxTimeZone`.
pub mod sandbox_time_zone {
    #[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Zone {
        /// UTC, the default.
        #[prost(message, tag = "1")]
        Utc(super::Unit),
        /// An IANA zone name (`Europe/London`), resolved from the child's tz database.
        #[prost(string, tag = "2")]
        Named(crate::budgeted_prost::alloc::string::String),
        /// A fixed offset from UTC, with a name if it has one.
        #[prost(message, tag = "3")]
        Fixed(super::TimeZone),
    }
}
/// Mirrors monty's `SleepMode`.
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct SleepMode {
    #[prost(oneof = "sleep_mode::Mode", tags = "1, 2, 3")]
    pub mode: ::core::option::Option<sleep_mode::Mode>,
}
/// Nested message and enum types in `SleepMode`.
pub mod sleep_mode {
    #[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Mode {
        /// The parent waits without invoking its OS handler.
        #[prost(message, tag = "1")]
        System(super::SystemSleep),
        /// Suspend to the parent, which performs the wait.
        #[prost(message, tag = "2")]
        CallHost(super::Unit),
        /// Return at once without waiting.
        #[prost(message, tag = "3")]
        Zero(super::Unit),
    }
}
/// A sleep capped by the child and performed by the parent.
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct SystemSleep {
    /// Longest wait one call performs; longer sleeps are cut short. Absent = 10s.
    #[prost(uint64, optional, tag = "1")]
    pub max_micros: ::core::option::Option<u64>,
}
/// A frozen clock reading.
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct FixedDateTime {
    /// Seconds since the Unix epoch, UTC.
    #[prost(int64, tag = "1")]
    pub unix_seconds: i64,
    /// 0..=999999; anything larger is rejected.
    #[prost(uint32, tag = "2")]
    pub microsecond: u32,
}
/// A `random.seed()` argument: the types CPython accepts.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct RandomSeed {
    #[prost(oneof = "random_seed::Value", tags = "1, 2, 3, 4")]
    pub value: ::core::option::Option<random_seed::Value>,
}
/// Nested message and enum types in `RandomSeed`.
pub mod random_seed {
    #[derive(Clone, PartialEq, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Value {
        /// Arbitrary-size two's-complement little-endian bytes (`BigInt::to_signed_bytes_le`).
        #[prost(bytes, tag = "1")]
        Int(crate::budgeted_prost::alloc::vec::Vec<u8>),
        /// Must be finite.
        #[prost(double, tag = "2")]
        Float(f64),
        #[prost(string, tag = "3")]
        Str(crate::budgeted_prost::alloc::string::String),
        #[prost(bytes, tag = "4")]
        Bytes(crate::budgeted_prost::alloc::vec::Vec<u8>),
    }
}
/// Outcome of an external function / OS call, decided by the parent. Mirrors
/// monty's `ExtFunctionResult`, plus `not_handled` (which only the child can
/// resolve, against its suspended call).
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct ExtFunctionResult {
    #[prost(oneof = "ext_function_result::Kind", tags = "1, 2, 3, 4, 5")]
    pub kind: ::core::option::Option<ext_function_result::Kind>,
}
/// Nested message and enum types in `ExtFunctionResult`.
pub mod ext_function_result {
    #[derive(Clone, PartialEq, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Kind {
        /// The call returned this value: an index into the carrying message's
        /// `values` arena.
        #[prost(uint32, tag = "1")]
        ReturnValue(u32),
        /// The call raised this exception.
        #[prost(message, tag = "2")]
        Error(super::RaisedException),
        /// The call is asynchronous: register an external future for `call_id`
        /// (the id from the suspension event) and keep executing other tasks.
        #[prost(uint32, tag = "3")]
        Future(u32),
        /// No handler exists for this name — the child raises NameError.
        #[prost(string, tag = "4")]
        NotFound(crate::budgeted_prost::alloc::string::String),
        /// No handler accepted this OS call — the child raises the call's own
        /// no-handler default (PermissionError naming the path for filesystem
        /// calls, RuntimeError for the rest). Only valid answering an `OsCall`
        /// suspension; the child computes it from its retained call payload.
        #[prost(message, tag = "5")]
        NotHandled(super::Unit),
    }
}
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct FutureResult {
    #[prost(uint32, tag = "1")]
    pub call_id: u32,
    #[prost(message, optional, tag = "2")]
    pub result: ::core::option::Option<ExtFunctionResult>,
}
/// A named input: `value` indexes the carrying message's `values` arena.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct NamedRef {
    #[prost(string, tag = "1")]
    pub name: crate::budgeted_prost::alloc::string::String,
    #[prost(uint32, tag = "2")]
    pub value: u32,
}
/// Tags 1-19 are reserved for `kind` arms and the message-level fields start
/// at 20, mirroring `ChildEvent` — a oneof shares its field-number space with
/// the enclosing message, so a new arm never has to jump the numbering. The
/// same caveats apply: arms past 15 cost a two-byte key, and a forwarding
/// server mirrors this numbering to classify frames without decoding them, so
/// adding an arm degrades to "opaque" while renumbering one would misroute.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct ParentRequest {
    /// W3C `traceparent` identifying the caller's span, so a child that exports
    /// its own telemetry can attach its spans to the trace the request came
    /// from. Purely additive context: the child's execution of the request must
    /// not depend on it, and it is absent whenever the parent is not tracing.
    #[prost(string, optional, tag = "20")]
    pub trace_parent: ::core::option::Option<
        crate::budgeted_prost::alloc::string::String,
    >,
    #[prost(oneof = "parent_request::Kind", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11")]
    pub kind: ::core::option::Option<parent_request::Kind>,
}
/// Nested message and enum types in `ParentRequest`.
pub mod parent_request {
    #[derive(Clone, PartialEq, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Kind {
        #[prost(message, tag = "1")]
        Configure(super::Configure),
        #[prost(message, tag = "2")]
        InstallDependencies(super::InstallDependencies),
        #[prost(message, tag = "3")]
        Feed(super::Feed),
        #[prost(message, tag = "4")]
        ResumeCall(super::ResumeCall),
        #[prost(message, tag = "5")]
        ResumeNameLookup(super::ResumeNameLookup),
        #[prost(message, tag = "6")]
        ResumeFutures(super::ResumeFutures),
        #[prost(message, tag = "7")]
        Dump(super::Dump),
        #[prost(message, tag = "8")]
        Load(super::Load),
        #[prost(message, tag = "9")]
        Reset(super::Reset),
        #[prost(message, tag = "10")]
        Shutdown(super::Shutdown),
        #[prost(message, tag = "11")]
        AbortFeed(super::AbortFeed),
    }
}
/// Configures the REPL session this child will serve until `Reset`, sent once
/// when the worker is checked out. The session's repl is materialized lazily on
/// the first `Feed` (or restored by `Load`), so a checked-out-but-unfed
/// worker can still be initialized by `Load` instead. Valid only when the
/// worker has no session yet.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Configure {
    #[prost(string, tag = "1")]
    pub script_name: crate::budgeted_prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub limits: ::core::option::Option<ResourceLimits>,
    /// Type-check each fed snippet before executing it.
    #[prost(bool, tag = "3")]
    pub type_check: bool,
    /// Optional stub file contents used by type checking.
    #[prost(string, optional, tag = "4")]
    pub type_check_stubs: ::core::option::Option<
        crate::budgeted_prost::alloc::string::String,
    >,
    /// The parent's monty package version (e.g. "0.0.18"). INFORMATIONAL ONLY —
    /// it is never checked, only reported (in telemetry, and when diagnosing a
    /// rejected `protocol_version`). Parent and child may run different package
    /// versions as long as their protocol versions are compatible.
    #[prost(string, tag = "5")]
    pub monty_version: crate::budgeted_prost::alloc::string::String,
    /// Introspected `assert` failure messages (see limitations/assert.md).
    /// Absent = on with the default 120-byte operand-repr truncation; 0 disables
    /// annotations; any other value retains that many bytes per operand before
    /// any ellipsis, cutting on a character boundary.
    #[prost(uint32, optional, tag = "6")]
    pub assert_message_annotations: ::core::option::Option<u32>,
    /// How the child renders the diagnostics carried by `TypingError`. The
    /// structured diagnostics borrow the type checker's database and so cannot
    /// cross the wire — the parent picks the format up front and the child
    /// renders it. Ignored when `type_check` is false.
    #[prost(enumeration = "TypeCheckFormat", tag = "7")]
    pub type_check_format: i32,
    /// Render typing diagnostics with ANSI colour escapes. Only `FULL` and
    /// `CONCISE` carry colour; the machine-readable formats ignore it.
    #[prost(bool, tag = "8")]
    pub type_check_color: bool,
    /// Version of the wire schema the parent speaks. The child rejects the
    /// session with a `FatalError` naming its own supported range when this
    /// falls outside it, so a parent deployed separately from its worker (over
    /// a websocket, say) learns what to downgrade to without a handshake.
    ///
    /// 0 means the parent declared nothing — either it predates this field or it
    /// is not a monty parent — and is always rejected. The protocol has no
    /// in-band negotiation, so an undeclared peer cannot be assumed compatible.
    #[prost(uint32, tag = "9")]
    pub protocol_version: u32,
    /// How long the child may hold buffered `print()` output before emitting it
    /// as a `Print` event, in milliseconds. Absent means the child's default
    /// (`DEFAULT_PRINT_FLUSH_INTERVAL`). 0 disables the timer and restores line
    /// buffering — one event per completed line, as before this field existed —
    /// for a host that wants each `print()` delivered on its own.
    ///
    /// Output is always flushed before a turn-ending event whatever this says, so
    /// the field trades streaming latency for event volume and nothing else.
    #[prost(uint32, optional, tag = "10")]
    pub print_flush_interval_ms: ::core::option::Option<u32>,
    /// Absent = `OsPolicy::default()`: the child's clock in UTC and its entropy,
    /// with parent-serviced sleeps capped at 10s. `Load` restores the dump's settings.
    #[prost(message, optional, tag = "11")]
    pub os_policy: ::core::option::Option<OsPolicy>,
    /// Relay-only: whether a serving relay may store the session. Children ignore
    /// it.
    #[prost(enumeration = "Persistence", tag = "12")]
    pub persistence: i32,
}
/// Executes one snippet against the session. Turn ends with `Complete`,
/// `Error`, `TypingError`, or a suspension event.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Feed {
    #[prost(string, tag = "1")]
    pub code: crate::budgeted_prost::alloc::string::String,
    /// Inputs, each an index into `values`; one arena, so an object passed
    /// under two names is one sandbox object.
    #[prost(message, repeated, tag = "2")]
    pub inputs: crate::budgeted_prost::alloc::vec::Vec<NamedRef>,
    #[prost(message, optional, tag = "3")]
    pub values: ::core::option::Option<crate::WireArena>,
    /// Skip type checking for this feed even when the session enables it.
    #[prost(bool, tag = "4")]
    pub skip_type_check: bool,
    /// Absolute virtual working directory to switch the session to before the
    /// feed, resolved by the parent (an explicit choice, or the first mount on
    /// the session's first feed). Empty keeps the session's current directory.
    #[prost(string, tag = "5")]
    pub cwd: crate::budgeted_prost::alloc::string::String,
}
/// Ends a pending suspension by raising `exception` uncatchably at its site.
/// The session returns ready in an `Error` event. Hosts use this to stop a feed,
/// including when `max_suspensions` is exceeded.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct AbortFeed {
    #[prost(message, optional, tag = "1")]
    pub exception: ::core::option::Option<RaisedException>,
}
/// Answers a `FunctionCall` or `OsCall` suspension. `call_id` must match the
/// suspension event.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct ResumeCall {
    #[prost(uint32, tag = "1")]
    pub call_id: u32,
    #[prost(message, optional, tag = "2")]
    pub result: ::core::option::Option<ExtFunctionResult>,
    /// The arena `result.return_value` indexes.
    #[prost(message, optional, tag = "3")]
    pub values: ::core::option::Option<crate::WireArena>,
}
/// Answers a `NameLookup` suspension.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct ResumeNameLookup {
    /// The arena `value` indexes.
    #[prost(message, optional, tag = "1")]
    pub values: ::core::option::Option<crate::WireArena>,
    #[prost(oneof = "resume_name_lookup::Kind", tags = "2, 3, 4")]
    pub kind: ::core::option::Option<resume_name_lookup::Kind>,
}
/// Nested message and enum types in `ResumeNameLookup`.
pub mod resume_name_lookup {
    #[derive(Clone, PartialEq, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Kind {
        /// The name resolves to this value: an index into `values`.
        #[prost(uint32, tag = "2")]
        Value(u32),
        /// The name is undefined — the child raises NameError (AttributeError for
        /// a lazy attribute lookup).
        #[prost(message, tag = "3")]
        Undefined(super::Unit),
        /// Resolving the name raised on the parent — the child raises this
        /// exception where the lookup suspended, bypassing hasattr()/getattr()
        /// defaults.
        #[prost(message, tag = "4")]
        Error(super::RaisedException),
    }
}
/// Answers a `ResolveFutures` suspension with results for some or all pending
/// call ids.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct ResumeFutures {
    /// Also answers an eager FunctionCall with exactly one result matching its
    /// call_id. The worker creates a settled awaitable before continuing.
    #[prost(message, repeated, tag = "1")]
    pub results: crate::budgeted_prost::alloc::vec::Vec<FutureResult>,
    /// The arena every `return_value` indexes.
    #[prost(message, optional, tag = "2")]
    pub values: ::core::option::Option<crate::WireArena>,
}
/// Requests an opaque serialized snapshot of the current session state
/// (idle or suspended). The session stays usable afterwards. The byte payload
/// format is at the discretion of the remote (e.g. it may be an ID or a full dump
/// of state). A relay without session storage answers `Error` and the session
/// carries on.
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Dump {}
/// Restores state produced by `Dump`. Valid only from no session. If
/// the restored state was suspended, the child re-emits the suspension event so
/// the parent learns the resume point; otherwise it replies `Ok`. A relay
/// without session storage answers `Error` and the session carries on.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Load {
    /// Either:
    /// - Dump bytes, or
    /// - A previously named session ID from `ChildEvent::session_id`
    #[prost(bytes = "vec", tag = "1")]
    pub state: crate::budgeted_prost::alloc::vec::Vec<u8>,
}
/// Ends the checkout: the child drops all session state and returns to the
/// no-session state, ready for the next `Configure` or `Load`.
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Reset {}
/// The child replies `Ok` and exits cleanly.
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Shutdown {}
/// Installs third-party Python packages into the session before further feeds,
/// using `uv pip install --python <venv-python>` against the worker's session
/// virtualenv. Only the
/// embedded-CPython worker honors this; the Monty sandbox child rejects it with
/// an `Error` (it has no host interpreter to install for). Repeatable between
/// feeds. Turn ends with `Ok` on success or `Error` (carrying uv's stderr) on
/// failure. Valid only once a session exists (after `Configure`).
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct InstallDependencies {
    /// PEP 508 requirement strings, e.g. "httpx>=0.27", "numpy". An empty list is
    /// a no-op that replies `Ok`.
    #[prost(string, repeated, tag = "1")]
    pub requirements: crate::budgeted_prost::alloc::vec::Vec<
        crate::budgeted_prost::alloc::string::String,
    >,
}
/// A oneof shares its field-number space with the enclosing message, so tags
/// 1-19 are reserved by convention for `kind` arms and the message-level
/// fields start at 20 — a new arm then never has to jump the numbering. Note
/// arms past 15 cost a two-byte key instead of one, which forwarding servers
/// (which walk only field keys, on every frame) pay per event. Such a server
/// mirrors this numbering to classify frames without decoding them; it treats
/// a tag it does not know as opaque, so adding an arm degrades rather than
/// misroutes, but renumbering an existing one would break it.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct ChildEvent {
    /// Cumulative execution time consumed by the session's sandbox code, in
    /// microseconds. The in-sandbox clock runs only while the interpreter is
    /// executing bytecode — never while suspended waiting on the parent or idle
    /// between feeds — and survives Dump/Load. Set on every turn-ending event
    /// while a session exists (zero on Print events and outside a session) so
    /// the parent can report how much sandbox time a session has used without
    /// keeping a second clock. Bounds nothing: the budgets are per-feed and
    /// per-turn.
    #[prost(uint64, tag = "20")]
    pub total_execution_micros: u64,
    /// Echoes the parent-enforced budget so a host restoring an opaque dump can
    /// recover it.
    #[prost(uint64, optional, tag = "22")]
    pub max_suspensions: ::core::option::Option<u64>,
    /// Execution time consumed by the feed in progress, in microseconds — the
    /// `total_execution_micros` clock restarted at the feed that is running.
    /// Lets the parent backstop `max_feed_duration_micros` without tracking feed
    /// boundaries against a clock it cannot see. Zero outside a session.
    #[prost(uint64, tag = "24")]
    pub feed_execution_micros: u64,
    /// The session's `max_feed_duration` and `max_turn_duration` limits in
    /// microseconds, when configured. Reported so a parent that restored a
    /// session via `Load` (where the limits travel inside the opaque state
    /// bytes) still learns its budgets.
    #[prost(uint64, optional, tag = "25")]
    pub max_feed_duration_micros: ::core::option::Option<u64>,
    #[prost(uint64, optional, tag = "26")]
    pub max_turn_duration_micros: ::core::option::Option<u64>,
    /// Parent-enforced sleep budget, also reported on `Load`.
    #[prost(uint64, optional, tag = "27")]
    pub max_total_sleep_micros: ::core::option::Option<u64>,
    /// The session's script name, surfaced on a `Load` reply so a parent that
    /// restored a session (whose script name, like the limits above, travels
    /// inside the opaque dump bytes) learns it without parsing the dump. Set only
    /// on a successful `Load` reply; unset on all other events.
    #[prost(string, optional, tag = "23")]
    pub restored_script_name: ::core::option::Option<
        crate::budgeted_prost::alloc::string::String,
    >,
    /// The session this connection now holds, set only by a remote that stores
    /// sessions, on its first reply to `Configure` or `Load` whatever that
    /// reply's kind. Unset for ephemeral sessions or for remotes that don't
    /// support persistence.
    #[prost(bytes = "vec", optional, tag = "28")]
    pub session_id: ::core::option::Option<crate::budgeted_prost::alloc::vec::Vec<u8>>,
    #[prost(oneof = "child_event::Kind", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12")]
    pub kind: ::core::option::Option<child_event::Kind>,
}
/// Nested message and enum types in `ChildEvent`.
pub mod child_event {
    #[derive(Clone, PartialEq, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Kind {
        #[prost(message, tag = "1")]
        Print(super::Print),
        #[prost(message, tag = "2")]
        FunctionCall(crate::WireFunctionCall),
        #[prost(message, tag = "3")]
        OsCall(super::OsCall),
        #[prost(message, tag = "4")]
        NameLookup(super::NameLookup),
        #[prost(message, tag = "5")]
        ResolveFutures(super::ResolveFutures),
        #[prost(message, tag = "6")]
        Complete(super::Complete),
        #[prost(message, tag = "7")]
        Error(super::Error),
        #[prost(message, tag = "8")]
        TypingError(super::TypingError),
        #[prost(message, tag = "9")]
        DumpResult(super::DumpResult),
        #[prost(message, tag = "10")]
        Ok(super::Ok),
        #[prost(message, tag = "11")]
        FatalError(super::FatalError),
        #[prost(message, tag = "12")]
        Shutdown(super::ShutdownDump),
    }
}
/// One run of print() output on a single stream, as one `Print` event may
/// carry several.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct PrintSegment {
    #[prost(enumeration = "PrintStream", tag = "1")]
    pub stream: i32,
    #[prost(string, tag = "2")]
    pub text: crate::budgeted_prost::alloc::string::String,
}
/// Streamed sandbox print() output. Zero or more of these precede each
/// turn-ending event, and each carries the runs the worker had buffered, in
/// the order the sandbox produced them — so output alternating between the
/// streams batches into one event without losing that order.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Print {
    #[prost(message, repeated, tag = "1")]
    pub segments: crate::budgeted_prost::alloc::vec::Vec<PrintSegment>,
}
/// Suspension: the sandbox performed an OS operation, surfaced for the parent
/// to service (e.g. from a mount) or answer with `ResumeCall`. One typed arm
/// per call; every path is a virtual POSIX sandbox path, never a host path.
/// Some calls have typed result expectations (e.g. `open` must return a
/// file_handle); a mismatched result becomes a Python-level error inside the
/// sandbox.
///
/// A parent with no handler should answer `ResumeCall` with
/// `ExtFunctionResult.not_handled`: the child raises the call's own default
/// (PermissionError naming the path for filesystem calls, RuntimeError for
/// the rest — monty's `OsFunctionCall::on_no_handler`).
///
/// Tags 2-49 are reserved for `call` arms and the other message-level fields
/// start at 50, as in `ChildEvent`, so a new call never has to jump the numbering.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct OsCall {
    #[prost(uint32, tag = "1")]
    pub call_id: u32,
    /// The arena any value-typed argument (`Getenv.default`) indexes.
    #[prost(message, optional, tag = "50")]
    pub values: ::core::option::Option<crate::WireArena>,
    /// As on `FunctionCall`: the parent may await a coroutine and answer with
    /// `ResumeFutures` for `call_id`. Only ever set on `async_sleep`, the one
    /// call a future may answer at all.
    #[prost(bool, tag = "51")]
    pub allow_eager_await: bool,
    /// Where the call expression is in the source; absent as on `FunctionCall`.
    #[prost(message, optional, tag = "52")]
    pub position: ::core::option::Option<SourceRange>,
    #[prost(
        oneof = "os_call::Call",
        tags = "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"
    )]
    pub call: ::core::option::Option<os_call::Call>,
}
/// Nested message and enum types in `OsCall`.
pub mod os_call {
    #[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub struct TextWrite {
        #[prost(string, tag = "1")]
        pub path: crate::budgeted_prost::alloc::string::String,
        #[prost(string, tag = "2")]
        pub data: crate::budgeted_prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub struct BytesWrite {
        #[prost(string, tag = "1")]
        pub path: crate::budgeted_prost::alloc::string::String,
        #[prost(bytes = "vec", tag = "2")]
        pub data: crate::budgeted_prost::alloc::vec::Vec<u8>,
    }
    #[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub struct Open {
        #[prost(string, tag = "1")]
        pub path: crate::budgeted_prost::alloc::string::String,
        /// Canonical open() mode string, same set as `FileHandle.mode`.
        #[prost(string, tag = "2")]
        pub mode: crate::budgeted_prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub struct Mkdir {
        #[prost(string, tag = "1")]
        pub path: crate::budgeted_prost::alloc::string::String,
        #[prost(bool, tag = "2")]
        pub parents: bool,
        #[prost(bool, tag = "3")]
        pub exist_ok: bool,
    }
    #[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub struct Rename {
        #[prost(string, tag = "1")]
        pub src: crate::budgeted_prost::alloc::string::String,
        #[prost(string, tag = "2")]
        pub dst: crate::budgeted_prost::alloc::string::String,
    }
    /// os.getenv(key, default) — `default` may be any Python value: an index
    /// into the enclosing `OsCall.values`.
    #[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub struct Getenv {
        #[prost(string, tag = "1")]
        pub key: crate::budgeted_prost::alloc::string::String,
        #[prost(uint32, tag = "2")]
        pub default: u32,
    }
    /// A `time`-module clock read. `caller` names the Python function that asked
    /// (`time.time`, `time.monotonic`, ...), so a parent may answer them
    /// differently; they all share the `time.time` call name.
    #[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub struct TimeCall {
        #[prost(string, tag = "1")]
        pub caller: crate::budgeted_prost::alloc::string::String,
    }
    /// datetime.now(tz) — the VM validates the argument to None-or-timezone
    /// before suspending, so the wire carries a typed TimeZone rather than an
    /// arbitrary MontyObject.
    #[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub struct DateTimeNow {
        /// Fixed-offset timezone for an aware result; absent for a naive one.
        #[prost(message, optional, tag = "1")]
        pub tz: ::core::option::Option<super::TimeZone>,
    }
    /// os.urandom(size) — the byte count the sandbox validated; unsigned so
    /// a negative count cannot be expressed on the wire.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub struct Urandom {
        #[prost(uint64, tag = "1")]
        pub size: u64,
    }
    /// time.sleep(seconds) — the parent waits, then answers (the sandbox
    /// evaluates the call to None whatever the answer carried). Answering with a
    /// future is refused: the call is a block by definition.
    #[derive(Clone, Copy, PartialEq, crate::budgeted_prost::Message)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub struct Sleep {
        /// How long to wait. Always finite, non-negative, and small enough to be a
        /// duration of nanoseconds in an int64; a frame breaking that is rejected.
        #[prost(double, tag = "1")]
        pub seconds: f64,
    }
    /// asyncio.sleep(delay) — the awaitable form. A parent running an event
    /// loop should answer `ExtFunctionResult.future` and resolve it once the
    /// delay elapses, so the sandbox's other tasks keep running; answering
    /// directly is equivalent to a wait that blocks them. The answer's value is
    /// ignored: the sandbox keeps the `result` argument itself and produces it
    /// from the `await`.
    #[derive(Clone, Copy, PartialEq, crate::budgeted_prost::Message)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub struct AsyncSleep {
        /// How long to wait, under the same constraints as `Sleep.seconds`.
        #[prost(double, tag = "1")]
        pub delay: f64,
    }
    #[derive(Clone, PartialEq, crate::budgeted_prost::Oneof)]
    #[prost(prost_path = "crate::budgeted_prost")]
    pub enum Call {
        /// ---- FS read / check / remove — the string is the virtual path -------
        ///
        /// Path.exists
        #[prost(string, tag = "2")]
        Exists(crate::budgeted_prost::alloc::string::String),
        /// Path.is_file
        #[prost(string, tag = "3")]
        IsFile(crate::budgeted_prost::alloc::string::String),
        /// Path.is_dir
        #[prost(string, tag = "4")]
        IsDir(crate::budgeted_prost::alloc::string::String),
        /// Path.is_symlink
        #[prost(string, tag = "5")]
        IsSymlink(crate::budgeted_prost::alloc::string::String),
        /// Path.read_text
        #[prost(string, tag = "6")]
        ReadText(crate::budgeted_prost::alloc::string::String),
        /// Path.read_bytes
        #[prost(string, tag = "7")]
        ReadBytes(crate::budgeted_prost::alloc::string::String),
        /// Path.stat
        #[prost(string, tag = "8")]
        Stat(crate::budgeted_prost::alloc::string::String),
        /// Path.iterdir
        #[prost(string, tag = "9")]
        Iterdir(crate::budgeted_prost::alloc::string::String),
        /// Path.resolve
        #[prost(string, tag = "10")]
        Resolve(crate::budgeted_prost::alloc::string::String),
        /// Path.absolute
        #[prost(string, tag = "11")]
        Absolute(crate::budgeted_prost::alloc::string::String),
        /// Path.unlink
        #[prost(string, tag = "12")]
        Unlink(crate::budgeted_prost::alloc::string::String),
        /// Path.rmdir
        #[prost(string, tag = "13")]
        Rmdir(crate::budgeted_prost::alloc::string::String),
        /// ---- FS write / mutate -----------------------------------------------
        ///
        /// Path.write_text (truncating)
        #[prost(message, tag = "14")]
        WriteText(TextWrite),
        /// Path.append_text
        #[prost(message, tag = "15")]
        AppendText(TextWrite),
        /// Path.write_bytes (truncating)
        #[prost(message, tag = "16")]
        WriteBytes(BytesWrite),
        /// Path.append_bytes
        #[prost(message, tag = "17")]
        AppendBytes(BytesWrite),
        #[prost(message, tag = "18")]
        Open(Open),
        #[prost(message, tag = "19")]
        Mkdir(Mkdir),
        #[prost(message, tag = "20")]
        Rename(Rename),
        /// ---- Non-FS ----------------------------------------------------------
        ///
        /// os.getenv
        #[prost(message, tag = "21")]
        Getenv(Getenv),
        /// the os.environ snapshot
        #[prost(message, tag = "22")]
        GetEnviron(super::Unit),
        /// date.today()
        #[prost(message, tag = "23")]
        DateToday(super::Unit),
        /// datetime.now(tz) — the timezone argument (absent for a naive result).
        #[prost(message, tag = "24")]
        DateTimeNow(DateTimeNow),
        /// os.urandom(size), also how `random` seeds an unseeded generator.
        #[prost(message, tag = "25")]
        Urandom(Urandom),
        /// time.time() and the other time-module clock reads
        #[prost(message, tag = "26")]
        Time(TimeCall),
        /// time.sleep(seconds) under `call_host`: the handler waits
        #[prost(message, tag = "27")]
        Sleep(Sleep),
        /// asyncio.sleep(delay) under `call_host`
        #[prost(message, tag = "28")]
        AsyncSleep(AsyncSleep),
        /// System sleeps: capped by the child, charged to `max_total_sleep` and
        /// waited out by the parent without invoking its OS handler.
        #[prost(message, tag = "29")]
        SystemSleep(Sleep),
        #[prost(message, tag = "30")]
        AsyncSystemSleep(AsyncSleep),
    }
}
/// Suspension: the sandbox read an undefined name — typically probing whether
/// the parent provides an external function — or, when `object_id` is set, a
/// lazy attribute lookup on a host-backed object. Answer with
/// `ResumeNameLookup`; for attribute lookups an `undefined` answer raises
/// AttributeError (not NameError) inside the sandbox.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct NameLookup {
    #[prost(string, tag = "1")]
    pub name: crate::budgeted_prost::alloc::string::String,
    /// Set for attribute lookups on a host-backed object — a class instance, or
    /// a class type (a lazy class attribute): the uuid of the receiver.
    #[prost(message, optional, tag = "2")]
    pub object_id: ::core::option::Option<Uuid>,
    /// Where the name (or attribute access) is in the source; absent as on
    /// `FunctionCall`.
    #[prost(message, optional, tag = "3")]
    pub position: ::core::option::Option<SourceRange>,
}
/// Suspension: every sandbox task is blocked on external futures previously
/// registered via `ExtFunctionResult.future`. Answer with `ResumeFutures`.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct ResolveFutures {
    #[prost(uint32, repeated, tag = "1")]
    pub pending_call_ids: crate::budgeted_prost::alloc::vec::Vec<u32>,
    /// Where the main task's blocked `await` is in the source; absent as on
    /// `FunctionCall`.
    #[prost(message, optional, tag = "2")]
    pub position: ::core::option::Option<SourceRange>,
}
/// Turn end: the snippet completed with this value. The session is ready for
/// the next `Feed`.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Complete {
    /// Index of the result in `values`.
    #[prost(uint32, tag = "1")]
    pub value: u32,
    #[prost(message, optional, tag = "2")]
    pub values: ::core::option::Option<crate::WireArena>,
}
/// Turn end: the snippet (or request) failed with a Python exception. The
/// session survives — prior globals remain available to later feeds.
#[derive(Clone, PartialEq, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Error {
    #[prost(message, optional, tag = "1")]
    pub exception: ::core::option::Option<RaisedException>,
}
/// Turn end: type checking rejected the fed snippet (only when the session
/// was created with type_check). The snippet was not executed; the session
/// survives.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct TypingError {
    /// Diagnostics rendered in the session's `TypeCheckFormat`.
    #[prost(string, tag = "1")]
    pub diagnostics: crate::budgeted_prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct DumpResult {
    /// Opaque versioned snapshot; see `Dump`.
    #[prost(bytes = "vec", tag = "1")]
    pub state: crate::budgeted_prost::alloc::vec::Vec<u8>,
}
/// Generic acknowledgement for Configure / Load (idle) / Reset / Shutdown.
#[derive(Clone, Copy, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct Ok {}
/// The child hit an unrecoverable error (frame desync, panic, unsupported
/// protocol version) and exits immediately after writing this. A child that
/// exits WITHOUT a FatalError crashed hard (segfault, abort, kill) — parents
/// must treat EOF as a crash.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct FatalError {
    #[prost(string, tag = "1")]
    pub message: crate::budgeted_prost::alloc::string::String,
}
/// Turn end: the serving relay (monty-server, never a child) is shutting down
/// and did NOT run the request it is replying to. Sent only in reply to an
/// in-flight request, so the client is always reading when it arrives.
///
/// Every other server policy action (idle/session/turn timeout, capacity) is
/// just a dropped connection, which the client already classifies as a dead
/// worker — only shutdown needs a message, because only shutdown has state to
/// hand back.
#[derive(Clone, PartialEq, Eq, Hash, crate::budgeted_prost::Message)]
#[prost(prost_path = "crate::budgeted_prost")]
pub struct ShutdownDump {
    /// What `Load` restores the session from on a fresh connection: the ID a
    /// relay with session storage parked it under. Absent when there is nothing
    /// to load: no session yet, an ephemeral session, a relay without storage, or
    /// a park that failed.
    #[prost(bytes = "vec", optional, tag = "1")]
    pub dump: ::core::option::Option<crate::budgeted_prost::alloc::vec::Vec<u8>>,
}
/// Where a `Type` comes from — drives id presence and input validation.
#[derive(
    Clone,
    Copy,
    Debug,
    PartialEq,
    Eq,
    Hash,
    PartialOrd,
    Ord,
    crate::budgeted_prost::Enumeration
)]
#[prost(prost_path = "crate::budgeted_prost")]
#[repr(i32)]
pub enum TypeOrigin {
    /// Rejected on decode.
    Unspecified = 0,
    /// `name` must parse as a known builtin type name ("int", "ValueError");
    /// valid as an execution input. `id` must be absent. Kept distinct from
    /// SANDBOX so a sandbox class shadowing a builtin name ("int") cannot be
    /// confused with the builtin type.
    Builtin = 1,
    /// A sandbox-defined class; `id` required. Accepted by the decoder but
    /// rejected as an execution input (the class binding cannot be
    /// reconstructed host-side).
    Sandbox = 2,
    /// A host-defined class; `id` required.
    Host = 3,
}
impl TypeOrigin {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "TYPE_ORIGIN_UNSPECIFIED",
            Self::Builtin => "TYPE_ORIGIN_BUILTIN",
            Self::Sandbox => "TYPE_ORIGIN_SANDBOX",
            Self::Host => "TYPE_ORIGIN_HOST",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TYPE_ORIGIN_UNSPECIFIED" => Some(Self::Unspecified),
            "TYPE_ORIGIN_BUILTIN" => Some(Self::Builtin),
            "TYPE_ORIGIN_SANDBOX" => Some(Self::Sandbox),
            "TYPE_ORIGIN_HOST" => Some(Self::Host),
            _ => None,
        }
    }
}
/// How a serving relay treats the session's state; children ignore it.
#[derive(
    Clone,
    Copy,
    Debug,
    PartialEq,
    Eq,
    Hash,
    PartialOrd,
    Ord,
    crate::budgeted_prost::Enumeration
)]
#[prost(prost_path = "crate::budgeted_prost")]
#[repr(i32)]
pub enum Persistence {
    /// The relay's default.
    Unspecified = 0,
    /// Never stored by the relay on its own: no session ID and never parked.
    Ephemeral = 1,
    /// Parked on idle, drain or disconnect, and loadable by its session ID.
    Stored = 2,
}
impl Persistence {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "PERSISTENCE_UNSPECIFIED",
            Self::Ephemeral => "PERSISTENCE_EPHEMERAL",
            Self::Stored => "PERSISTENCE_STORED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PERSISTENCE_UNSPECIFIED" => Some(Self::Unspecified),
            "PERSISTENCE_EPHEMERAL" => Some(Self::Ephemeral),
            "PERSISTENCE_STORED" => Some(Self::Stored),
            _ => None,
        }
    }
}
/// Rendering of the typing diagnostics a `TypingError` carries; mirrors ty's
/// `DiagnosticFormat`.
#[derive(
    Clone,
    Copy,
    Debug,
    PartialEq,
    Eq,
    Hash,
    PartialOrd,
    Ord,
    crate::budgeted_prost::Enumeration
)]
#[prost(prost_path = "crate::budgeted_prost")]
#[repr(i32)]
pub enum TypeCheckFormat {
    /// Unset by an older parent — the child renders `FULL`.
    Unspecified = 0,
    Full = 1,
    Concise = 2,
    Azure = 3,
    Json = 4,
    JsonLines = 5,
    Rdjson = 6,
    Pylint = 7,
    Gitlab = 8,
    Github = 9,
}
impl TypeCheckFormat {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "TYPE_CHECK_FORMAT_UNSPECIFIED",
            Self::Full => "TYPE_CHECK_FORMAT_FULL",
            Self::Concise => "TYPE_CHECK_FORMAT_CONCISE",
            Self::Azure => "TYPE_CHECK_FORMAT_AZURE",
            Self::Json => "TYPE_CHECK_FORMAT_JSON",
            Self::JsonLines => "TYPE_CHECK_FORMAT_JSON_LINES",
            Self::Rdjson => "TYPE_CHECK_FORMAT_RDJSON",
            Self::Pylint => "TYPE_CHECK_FORMAT_PYLINT",
            Self::Gitlab => "TYPE_CHECK_FORMAT_GITLAB",
            Self::Github => "TYPE_CHECK_FORMAT_GITHUB",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TYPE_CHECK_FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
            "TYPE_CHECK_FORMAT_FULL" => Some(Self::Full),
            "TYPE_CHECK_FORMAT_CONCISE" => Some(Self::Concise),
            "TYPE_CHECK_FORMAT_AZURE" => Some(Self::Azure),
            "TYPE_CHECK_FORMAT_JSON" => Some(Self::Json),
            "TYPE_CHECK_FORMAT_JSON_LINES" => Some(Self::JsonLines),
            "TYPE_CHECK_FORMAT_RDJSON" => Some(Self::Rdjson),
            "TYPE_CHECK_FORMAT_PYLINT" => Some(Self::Pylint),
            "TYPE_CHECK_FORMAT_GITLAB" => Some(Self::Gitlab),
            "TYPE_CHECK_FORMAT_GITHUB" => Some(Self::Github),
            _ => None,
        }
    }
}
#[derive(
    Clone,
    Copy,
    Debug,
    PartialEq,
    Eq,
    Hash,
    PartialOrd,
    Ord,
    crate::budgeted_prost::Enumeration
)]
#[prost(prost_path = "crate::budgeted_prost")]
#[repr(i32)]
pub enum PrintStream {
    Unspecified = 0,
    Stdout = 1,
    Stderr = 2,
}
impl PrintStream {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "PRINT_STREAM_UNSPECIFIED",
            Self::Stdout => "PRINT_STREAM_STDOUT",
            Self::Stderr => "PRINT_STREAM_STDERR",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PRINT_STREAM_UNSPECIFIED" => Some(Self::Unspecified),
            "PRINT_STREAM_STDOUT" => Some(Self::Stdout),
            "PRINT_STREAM_STDERR" => Some(Self::Stderr),
            _ => None,
        }
    }
}