darkbio-wire 0.9.0

Encrypted protocol between Ark and host
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
// This file is @generated by prost-build.
/// HostToArk represents a message sent from the host to the Ark via the USB
/// connection. It embeds all possible message types to keep the protocol simple.
///
/// Every message carries an id and is either a request, its id chosen by the
/// host, or the host's response to a request of the Ark, echoing the Ark's id.
/// To avoid id collisions, hosts allocate odd ids and Arks even ones, so a
/// receiver can tell a response from a request by the parity of the id alone.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HostToArk {
    /// Enveloping fields, reserved range 0x001-0x0ff
    ///
    /// Request identifier, the host's own or responded to
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// Error encountered while serving the Ark's request (if any)
    #[prost(message, optional, tag = "2")]
    pub err: ::core::option::Option<Error>,
    /// Body of the message, a request of the host or its response to a request of
    /// the Ark. The tags are grouped by area, each area with its own range.
    #[prost(
        oneof = "host_to_ark::Content",
        tags = "256, 257, 258, 259, 260, 513, 514, 515, 516, 517, 769, 770, 771, 772, 773, 774, 1025, 1026, 1027, 1281, 1282, 1283, 1284, 1285, 1286, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1793, 4096"
    )]
    pub content: ::core::option::Option<host_to_ark::Content>,
}
/// Nested message and enum types in `HostToArk`.
pub mod host_to_ark {
    /// Body of the message, a request of the host or its response to a request of
    /// the Ark. The tags are grouped by area, each area with its own range.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Content {
        /// Installs the signed device attestation at manufacturing
        #[prost(message, tag = "256")]
        Onboard(super::OnboardingRequest),
        /// Fetches the hardware and firmware versions
        #[prost(message, tag = "257")]
        DeviceInfo(super::DeviceInfoRequest),
        /// Starts a cloud sync with the attested cloud keys
        #[prost(message, tag = "258")]
        CloudSyncStart(super::CloudSyncStartRequest),
        /// Finishes a cloud sync with the signed server time
        #[prost(message, tag = "259")]
        CloudSyncFinish(super::CloudSyncFinishRequest),
        /// Requests a proof of the device's genuinity
        #[prost(message, tag = "260")]
        GenuinityProof(super::GenuinityProofRequest),
        /// Prepares an update, aborting any in progress
        #[prost(message, tag = "513")]
        FirmwareUpdatePrep(super::FirmwareUpdatePrepRequest),
        /// Initiates a prepared update with the sealed firmware key
        #[prost(message, tag = "514")]
        FirmwareUpdateInit(super::FirmwareUpdateInitRequest),
        /// Appends a chunk of the firmware archive
        #[prost(message, tag = "515")]
        FirmwareUpdateUpload(super::FirmwareUpdateUploadRequest),
        /// Decrypts and verifies the uploaded firmware
        #[prost(message, tag = "516")]
        FirmwareUpdateVerify(super::FirmwareUpdateVerifyRequest),
        /// Installs the verified firmware and reboots
        #[prost(message, tag = "517")]
        FirmwareUpdateInstall(super::FirmwareUpdateInstallRequest),
        /// Asks the Ark to authorize a pairing rendezvous
        #[prost(message, tag = "769")]
        PairingAuth(super::PairingAuthRequest),
        /// Injects the companion app's identity, relayed by the cloud
        #[prost(message, tag = "770")]
        PairingSetAppId(super::PairingSetAppIdentityRequest),
        /// Injects the companion app's storage key material
        #[prost(message, tag = "771")]
        PairingSetAppStorage(super::PairingSetAppStorageRequest),
        /// Confirms the app received the Ark's key material
        #[prost(message, tag = "772")]
        PairingAckArkStorage(super::PairingAckArkStorageRequest),
        /// Waits for the user to accept the pairing
        #[prost(message, tag = "773")]
        PairingAccept(super::PairingAcceptanceRequest),
        /// Waits for the Ark to finish pairing maintenance
        #[prost(message, tag = "774")]
        PairingComplete(super::PairingCompletionRequest),
        /// Asks the Ark to authorize joining the app relay
        #[prost(message, tag = "1025")]
        RelayJoin(super::RelayJoinRequest),
        /// Opaque request from the companion app to the Ark
        #[prost(message, tag = "1026")]
        RelayReq(super::RelayAppToArkRequest),
        /// Opaque response from the companion app to an Ark request
        #[prost(message, tag = "1027")]
        RelayRes(super::RelayAppToArkResponse),
        /// Starts the unlock, confirmed through the app
        #[prost(message, tag = "1281")]
        Unlock(super::UnlockRequest),
        /// Begins a chunked upload of an app to execute
        #[prost(message, tag = "1282")]
        ExecUploadStart(super::ExecutionUploadStartRequest),
        /// Appends a chunk to a pending app upload
        #[prost(message, tag = "1283")]
        ExecUploadChunk(super::ExecutionUploadChunkRequest),
        /// Runs an uploaded app, confirmed through the app
        #[prost(message, tag = "1284")]
        ExecSched(super::ExecutionScheduleRequest),
        /// Checks on a running app
        #[prost(message, tag = "1285")]
        ExecStatus(super::ExecutionStatusRequest),
        /// Cancels an app run or a pending upload
        #[prost(message, tag = "1286")]
        ExecCancel(super::ExecutionCancelRequest),
        /// Lists the state of every data slot
        #[prost(message, tag = "1537")]
        SlotList(super::SlotListRequest),
        /// Resets a slot to empty whatever its state
        #[prost(message, tag = "1538")]
        SlotRepair(super::SlotRepairRequest),
        /// Removes the contents of a filled slot
        #[prost(message, tag = "1539")]
        SlotDelete(super::SlotDeleteRequest),
        /// Asks the Ark to identify a file from its first chunk
        #[prost(message, tag = "1540")]
        SlotIdentify(super::SlotIdentifyRequest),
        /// Starts uploading a file into a slot
        #[prost(message, tag = "1541")]
        SlotUploadStart(super::SlotUploadStartRequest),
        /// Appends a chunk to a pending slot upload
        #[prost(message, tag = "1542")]
        SlotUploadChunk(super::SlotUploadChunkRequest),
        /// Aborts a pending slot upload
        #[prost(message, tag = "1543")]
        SlotUploadCancel(super::SlotUploadCancelRequest),
        /// Marks an upload complete and polls its processing
        #[prost(message, tag = "1544")]
        SlotUploadProcess(super::SlotUploadProcessRequest),
        /// Maps every path an app can read, from the dataset view
        #[prost(message, tag = "1793")]
        DatasetPaths(super::DatasetPathsRequest),
        /// Unreleased messages served by development firmware only, carried opaquely
        /// so the public protocol is untouched while they are still under development.
        /// Their schema is private and production Arks refuse the envelope.
        #[prost(bytes, tag = "4096")]
        Develop(::prost::alloc::vec::Vec<u8>),
    }
}
/// ArkToHost represents a message sent from the Ark to the host via the USB
/// connection. It embeds all possible message types to keep the protocol simple.
///
/// Every message carries an id and is either a request, its id chosen by the
/// Ark, or the Ark's response to a request of the host, echoing the host's id.
/// To avoid id collisions, hosts allocate odd ids and Arks even ones, so a
/// receiver can tell a response from a request by the parity of the id alone.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArkToHost {
    /// Enveloping fields, reserved range 0x001-0x0ff
    ///
    /// Request identifier, responded to or the Ark's own
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// Error encountered while serving the host's request (if any)
    #[prost(message, optional, tag = "2")]
    pub err: ::core::option::Option<Error>,
    /// Body of the message, a response of the Ark to a request of the host or a
    /// request of its own. The tags are grouped by area, each area with its own range.
    #[prost(
        oneof = "ark_to_host::Content",
        tags = "256, 257, 258, 259, 260, 513, 514, 515, 516, 517, 769, 770, 771, 772, 773, 774, 1025, 1026, 1027, 1028, 1281, 1282, 1283, 1284, 1285, 1286, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1793, 4096"
    )]
    pub content: ::core::option::Option<ark_to_host::Content>,
}
/// Nested message and enum types in `ArkToHost`.
pub mod ark_to_host {
    /// Body of the message, a response of the Ark to a request of the host or a
    /// request of its own. The tags are grouped by area, each area with its own range.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Content {
        /// Acknowledges the onboarding
        #[prost(message, tag = "256")]
        Onboard(super::OnboardingResponse),
        /// Hardware and firmware versions of the Ark
        #[prost(message, tag = "257")]
        DeviceInfo(super::DeviceInfoResponse),
        /// Challenge for the cloud to sign along its time
        #[prost(message, tag = "258")]
        CloudSyncStart(super::CloudSyncStartResponse),
        /// Timestamp the Ark accepted from the cloud
        #[prost(message, tag = "259")]
        CloudSyncFinish(super::CloudSyncFinishResponse),
        /// Encrypted proof of the Ark's genuinity for the cloud
        #[prost(message, tag = "260")]
        GenuinityProof(super::GenuinityProofResponse),
        /// Ephemeral key to receive the firmware key with, sealed for the cloud
        #[prost(message, tag = "513")]
        FirmwareUpdatePrep(super::FirmwareUpdatePrepResponse),
        /// Acknowledges the initiated update
        #[prost(message, tag = "514")]
        FirmwareUpdateInit(super::FirmwareUpdateInitResponse),
        /// Acknowledges the appended firmware chunk
        #[prost(message, tag = "515")]
        FirmwareUpdateUpload(super::FirmwareUpdateUploadResponse),
        /// Acknowledges the verified firmware
        #[prost(message, tag = "516")]
        FirmwareUpdateVerify(super::FirmwareUpdateVerifyResponse),
        /// Acknowledges the installed firmware
        #[prost(message, tag = "517")]
        FirmwareUpdateInstall(super::FirmwareUpdateInstallResponse),
        /// Signed authorization for the cloud to open a rendezvous
        #[prost(message, tag = "769")]
        PairingAuth(super::PairingAuthResponse),
        /// Acknowledges the accepted app identity
        #[prost(message, tag = "770")]
        PairingSetAppId(super::PairingSetAppIdentityResponse),
        /// Ark device infos and key material, sealed for the app
        #[prost(message, tag = "771")]
        PairingSetAppStorage(super::PairingSetAppStorageResponse),
        /// Acknowledges the app's receipt of the Ark's keys
        #[prost(message, tag = "772")]
        PairingAckArkStorage(super::PairingAckArkStorageResponse),
        /// Signed confirmation that the user accepted the pairing
        #[prost(message, tag = "773")]
        PairingAccept(super::PairingAcceptanceResponse),
        /// Signed confirmation that the Ark finished pairing
        #[prost(message, tag = "774")]
        PairingComplete(super::PairingCompletionResponse),
        /// Signed authorization for the cloud to join the relay
        #[prost(message, tag = "1025")]
        RelayJoin(super::RelayJoinResponse),
        /// Opaque request from the Ark to the companion app
        #[prost(message, tag = "1026")]
        RelayReq(super::RelayArkToAppRequest),
        /// Opaque response from the Ark to an app request
        #[prost(message, tag = "1027")]
        RelayRes(super::RelayArkToAppResponse),
        /// Protocol violation found in an app response, for debugging
        #[prost(message, tag = "1028")]
        RelayFail(super::RelayAppToArkFailure),
        /// Acknowledges the completed unlock
        #[prost(message, tag = "1281")]
        Unlock(super::UnlockResponse),
        /// Task id for the chunk, schedule and cancel messages
        #[prost(message, tag = "1282")]
        ExecUploadStart(super::ExecutionUploadStartResponse),
        /// Acknowledges the appended app chunk
        #[prost(message, tag = "1283")]
        ExecUploadChunk(super::ExecutionUploadChunkResponse),
        /// Acknowledges the authorized and started execution
        #[prost(message, tag = "1284")]
        ExecSched(super::ExecutionScheduleResponse),
        /// Whether the app still runs, with its result once done
        #[prost(message, tag = "1285")]
        ExecStatus(super::ExecutionStatusResponse),
        /// Acknowledges the cancelled run or upload
        #[prost(message, tag = "1286")]
        ExecCancel(super::ExecutionCancelResponse),
        /// Current state of every data slot
        #[prost(message, tag = "1537")]
        SlotList(super::SlotListResponse),
        /// Acknowledges the reset slot
        #[prost(message, tag = "1538")]
        SlotRepair(super::SlotRepairResponse),
        /// Acknowledges the deleted slot
        #[prost(message, tag = "1539")]
        SlotDelete(super::SlotDeleteResponse),
        /// Identification of the file's first chunk
        #[prost(message, tag = "1540")]
        SlotIdentify(super::SlotIdentifyResponse),
        /// Session id of the approved upload
        #[prost(message, tag = "1541")]
        SlotUploadStart(super::SlotUploadStartResponse),
        /// Acknowledges the appended slot chunk
        #[prost(message, tag = "1542")]
        SlotUploadChunk(super::SlotUploadChunkResponse),
        /// Acknowledges the aborted upload
        #[prost(message, tag = "1543")]
        SlotUploadCancel(super::SlotUploadCancelResponse),
        /// Processing progress of the completed upload
        #[prost(message, tag = "1544")]
        SlotUploadProcess(super::SlotUploadProcessResponse),
        /// Generated README.md of the dataset view
        #[prost(message, tag = "1793")]
        DatasetPaths(super::DatasetPathsResponse),
        /// Unreleased messages emitted by development firmware only, in response to
        /// a develop request, carried opaquely so the public protocol is untouched
        /// while they are still under development. Their schema is private.
        #[prost(bytes, tag = "4096")]
        Develop(::prost::alloc::vec::Vec<u8>),
    }
}
/// Error is sent along a response to a failed request.
///
/// Codes 0x00 through 0xff (inclusive) are reserved for protocol-wide errors.
/// Codes 0x100 and above are defined by the request type and may be reused
/// with different meanings for different requests. The message text is human,
/// readable error, not a stable code.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Error {
    /// Error code for programmatic interpretation
    #[prost(uint64, tag = "1")]
    pub code: u64,
    /// Error message for user interfacing
    #[prost(string, tag = "2")]
    pub msg: ::prost::alloc::string::String,
}
/// OnboardingRequest is a vendor utility to onboard an Ark. Currently it contains
/// the signed device genuinity attestation (certificate).
///
/// Note, as this method is only used during initial device setup, there is no API
/// compatibility guarantee, it will evolve with the factory tooling.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OnboardingRequest {
    /// Signed device genuinity attestation (CWT) to install
    #[prost(bytes = "vec", tag = "1")]
    pub device_attestation: ::prost::alloc::vec::Vec<u8>,
}
/// OnboardingResponse is the acknowledgement of the onboarding.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OnboardingResponse {}
/// DeviceInfoRequest is sent by the host to fetch the Ark's device stats.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeviceInfoRequest {}
/// DeviceInfoResponse returns various hardware and software version information.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeviceInfoResponse {
    /// Ark device version (defines the major features)
    #[prost(uint32, tag = "1")]
    pub version_id: u32,
    /// Ark device version label (as known by the device)
    #[prost(string, tag = "2")]
    pub version_str: ::prost::alloc::string::String,
    /// Ark device revision (defines the minor differences)
    #[prost(uint32, tag = "3")]
    pub revision_id: u32,
    /// Ark device revision label (as known by the device)
    #[prost(string, tag = "4")]
    pub revision_str: ::prost::alloc::string::String,
    /// Current firmware version (X.Y.Z-commit)
    #[prost(string, tag = "7")]
    pub firmware_version: ::prost::alloc::string::String,
    /// Current firmware publish unix timestamp
    #[prost(uint64, tag = "8")]
    pub firmware_publish: u64,
    /// Whether a cloud identity was accepted since boot
    #[prost(bool, tag = "9")]
    pub cloud_synced: bool,
    /// Current device clock unix timestamp, set by the cloud sync
    #[prost(uint64, tag = "10")]
    pub cloud_clock: u64,
    /// Whether the Ark is paired with a companion app (user data initialized)
    #[prost(bool, tag = "11")]
    pub paired: bool,
    /// Whether the user data storage is open (false if unpaired)
    #[prost(bool, tag = "12")]
    pub unlocked: bool,
}
/// CloudSyncStartRequest requests the device to start a synchronization procedure
/// against the cloud servers to establish the current time as well as the currently
/// active cloud identity.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CloudSyncStartRequest {
    /// Post-quantum CWT attestation for the server signing (xDSA) key
    #[prost(bytes = "vec", tag = "1")]
    pub signer: ::prost::alloc::vec::Vec<u8>,
    /// Post-quantum CWT attestation for the server encryption (xHPKE) key
    #[prost(bytes = "vec", tag = "2")]
    pub crypto: ::prost::alloc::vec::Vec<u8>,
}
/// CloudSyncStartResponse is an initiation of a cloud sync from the device, authed
/// to the requested cloud identity.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CloudSyncStartResponse {
    /// Random nonce to avoid malicious host machines setting bad times
    #[prost(bytes = "vec", tag = "1")]
    pub challenge: ::prost::alloc::vec::Vec<u8>,
}
/// CloudSyncFinishRequest is the completion of a previously initiated cloud sync
/// procedure, this time being signed by a single identity currently used by the
/// cloud.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CloudSyncFinishRequest {
    /// Unix timestamp from the server in milliseconds
    #[prost(uint64, tag = "1")]
    pub unixmilli: u64,
    /// SignAt[Cloud]["cloudsync-v1"][unixmilli/1000](CBOR(challenge))
    #[prost(bytes = "vec", tag = "2")]
    pub signature: ::prost::alloc::vec::Vec<u8>,
}
/// CloudSyncFinishResponse is the acknowledgement whether the device accepted the
/// cloud sync from the server or rejected for some reason.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CloudSyncFinishResponse {
    /// Timestamp that was accepted and set
    #[prost(uint64, tag = "1")]
    pub accepted: u64,
}
/// GenuinityProofRequest requests the device to generate a cryptographic proof of
/// its own authenticity.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GenuinityProofRequest {}
/// GenuinityProofResponse is the device genuinity proof, an encrypted signature
/// of the device.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GenuinityProofResponse {
    /// Seal[Ark->Cloud]["genuinity-v1"][null](null)
    #[prost(bytes = "vec", tag = "1")]
    pub proof: ::prost::alloc::vec::Vec<u8>,
}
/// FirmwareUpdatePrepRequest prepares a firmware update procedure. If any previous
/// update procedure was in progress, it is aborted.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirmwareUpdatePrepRequest {
    /// Version string to update to
    #[prost(string, tag = "1")]
    pub version: ::prost::alloc::string::String,
    /// SHA256 hash of the (encrypted) firmware archive
    #[prost(bytes = "vec", tag = "2")]
    pub sha256: ::prost::alloc::vec::Vec<u8>,
    /// Number of bytes (progress purposes, ignored otherwise)
    #[prost(uint64, tag = "3")]
    pub bytes: u64,
}
/// FirmwareUpdatePrepResponse confirms whether a new firmware update process was
/// started, or if the request was rejected and why.
///
/// If it was accepted, a new ephemeral encryption identity is generated by the Ark
/// to receive the firmware access key to; and sent along with the firmware infos.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirmwareUpdatePrepResponse {
    /// Seal[Ark->Cloud]["firmware-v1"][\[version, sha256\]](temp-key)
    #[prost(bytes = "vec", tag = "1")]
    pub auth: ::prost::alloc::vec::Vec<u8>,
}
/// FirmwareUpdateInitRequest initiates a previously prepared firmware update
/// procedure by providing the authenticated and encrypted firmware key.
///
/// Note, if the initiation is rejected, the entire update process is torn down.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirmwareUpdateInitRequest {
    /// Seal[Cloud->temp-key]["firmware-v1"][\[version, sha256\]](sym-key)
    #[prost(bytes = "vec", tag = "1")]
    pub access: ::prost::alloc::vec::Vec<u8>,
}
/// FirmwareUpdateInitResponse confirms whether a new firmware update process
/// was started, or if the request was rejected and why.
///
/// Note, if the init is rejected, the entire update process is torn down.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirmwareUpdateInitResponse {}
/// FirmwareUpdateUploadRequest requests appending a new chunk of data to the
/// currently pending firmware upload process.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirmwareUpdateUploadRequest {
    /// Chunk of firmware blob to append (reasonably capped)
    #[prost(bytes = "vec", tag = "1")]
    pub chunk: ::prost::alloc::vec::Vec<u8>,
}
/// FirmwareUpdateUploadResponse is the response whether the requested chunk was
/// accepted or rejected.
///
/// Note, if the upload is rejected, the entire update process is torn down.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirmwareUpdateUploadResponse {}
/// FirmwareUpdateVerifyRequest requests decrypting the uploaded firmware and
/// verifying its contents, preparing for the last step of actually installing
/// the firmware update.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirmwareUpdateVerifyRequest {}
/// FirmwareUpdateVerifyResponse is the response whether the firmware just uploaded
/// passed all verifications and is ready for application.
///
/// Note, if the verification is rejected, the entire update process is torn down.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirmwareUpdateVerifyResponse {}
/// FirmwareUpdateInstallRequest requests the currently pending (but already
/// verified) firmware to be applied to disk. This message will cause the device
/// to reboot if applied successfully.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirmwareUpdateInstallRequest {}
/// FirmwareUpdateInstallResponse is the response whether the firmware was applied
/// successfully or not.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirmwareUpdateInstallResponse {}
/// PairingAuthRequest requests the initiation of a pairing.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingAuthRequest {}
/// PairingAuthResponse responds whether the device is in a state compatible with
/// pairing (i.e. reset) and if so, it signs an authorization for the server to open
/// a new rendezvous point; containing the xHPKE public key to use for encrypting
/// messages to this Ark after pairing.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingAuthResponse {
    /// Seal[Ark->Cloud]["pairing-v1"][null](pair-key)
    #[prost(bytes = "vec", tag = "1")]
    pub auth: ::prost::alloc::vec::Vec<u8>,
    /// Fingerprint of the pair-key to transmit to the app out-of-protocol
    #[prost(bytes = "vec", tag = "2")]
    pub fprint: ::prost::alloc::vec::Vec<u8>,
}
/// PairingSetAppIdentityRequest injects the companion app's identity, relayed
/// by the cloud.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingSetAppIdentityRequest {
    /// Seal[Cloud->App]["pairing-v1:identity"][\[ark_signer_id, ark_crypto_id\]](\[app_signer, app_crypto\])
    #[prost(bytes = "vec", tag = "1")]
    pub identity: ::prost::alloc::vec::Vec<u8>,
}
/// PairingSetAppIdentityResponse confirms whether the remote identity was
/// accepted by the Ark or not.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingSetAppIdentityResponse {}
/// PairingSetAppStorageRequest injects the app's storage key material into the
/// pairing flow.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingSetAppStorageRequest {
    /// Seal[App->Ark]["pairing-v1:storage"][\[ark_signer_id, ark_crypto_id, app_signer_id, app_crypto_id\]](\[app_keymat\])
    #[prost(bytes = "vec", tag = "1")]
    pub app_key: ::prost::alloc::vec::Vec<u8>,
}
/// PairingSetAppStorageResponse confirms whether the remote storage material
/// was accepted, and if so, bundles the ark device infos and ark key material.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingSetAppStorageResponse {
    /// Seal[Ark->App]["pairing-v1:storage"][\[ark_signer_id, ark_crypto_id, app_signer_id, app_crypto_id, app_keymat\]](\[hw_ver, hw_rev, fw_ver, fw_pub, ark_keymat\])
    #[prost(bytes = "vec", tag = "1")]
    pub ark_keys: ::prost::alloc::vec::Vec<u8>,
}
/// PairingAckArkStorageRequest confirms from the app that the Ark's key material
/// was received correctly.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingAckArkStorageRequest {
    /// Seal[App->Ark]["pairing-v1:storage"][\[ark_signer_id, ark_crypto_id, app_signer_id, app_crypto_id, ark_keymat\]](null)
    #[prost(bytes = "vec", tag = "1")]
    pub app_ack: ::prost::alloc::vec::Vec<u8>,
}
/// PairingAckArkStorageResponse confirms that the key ack was accepted.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingAckArkStorageResponse {}
/// PairingAcceptanceRequest is a blocking poller to wait until the user accepts
/// a pairing request or it times out.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingAcceptanceRequest {}
/// PairingAcceptanceResponse returns whether the user accepted the pairing or
/// if it timed out. At this point, the device still needs to format itself.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingAcceptanceResponse {
    /// Seal[Ark->Cloud]["pairing-v1:accept"][\[ark_signer_id, ark_crypto_id, app_signer_id, app_crypto_id\]](null)
    #[prost(bytes = "vec", tag = "1")]
    pub confirm: ::prost::alloc::vec::Vec<u8>,
}
/// PairingCompletionRequest is a blocking poller to wait until the device finishes
/// any pairing maintenance operation (e.g. encrypting itself).
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingCompletionRequest {}
/// PairingCompletionResponse returns whether the device finished preparing for
/// live operation.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PairingCompletionResponse {
    /// Seal[Ark->Cloud]["pairing-v1:complete"][\[ark_signer_id, ark_crypto_id, app_signer_id, app_crypto_id\]](null)
    #[prost(bytes = "vec", tag = "1")]
    pub confirm: ::prost::alloc::vec::Vec<u8>,
}
/// RelayJoinRequest requests authorization to join the communication relay with
/// the companion app.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RelayJoinRequest {}
/// RelayJoinResponse responds whether the device is in a state compatible with
/// relaying (i.e. paired) and if so, it signs an authorization for the server
/// to join the rendezvous point.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RelayJoinResponse {
    /// Seal[Ark->Cloud]["relaying-v1"][null](null)
    #[prost(bytes = "vec", tag = "1")]
    pub auth: ::prost::alloc::vec::Vec<u8>,
}
/// RelayAppToArkRequest is an opaque request from the companion app that the Ark may
/// respond to, or may flat out reject.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RelayAppToArkRequest {
    /// Application layer request ID from the app
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// Seal[App->Ark]["relaying-v1:request"][id](\[method, [params...]\]))
    #[prost(bytes = "vec", tag = "2")]
    pub req: ::prost::alloc::vec::Vec<u8>,
}
/// RelayArkToAppResponse is an opaque response from the Ark to the companion app to an
/// opaque request.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RelayArkToAppResponse {
    /// Application layer request ID from the app being responding to
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// Seal[Ark->App]["relaying-v1:response"][id](\[result, [err_code, err_str]\])
    #[prost(bytes = "vec", tag = "2")]
    pub res: ::prost::alloc::vec::Vec<u8>,
}
/// RelayAppToArkFailure is returned if a low level protocol violation is detected
/// when an app-to-ark response was processed.
///
/// This is not an actionable message, rather it's just a way to expose a protocol
/// failure / violation to the calling app for debugging purposes.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RelayAppToArkFailure {
    /// Reason for rejecting the response at the protocol level
    #[prost(string, tag = "1")]
    pub error: ::prost::alloc::string::String,
}
/// RelayArkToAppRequest is an opaque request from the Ark to the companion app, which
/// will generally be sent as an interim response to some other request, requiring
/// authorization from the app side.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RelayArkToAppRequest {
    /// Application layer request ID from the ark
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// Seal[Ark->App]["relaying-v1:request"][id](\[method, [params...]\])
    #[prost(bytes = "vec", tag = "2")]
    pub req: ::prost::alloc::vec::Vec<u8>,
}
/// RelayAppToArkResponse is an opaque response from the companion app to an opaque
/// Ark request. The ark will respond with the deferred response to the original
/// request.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RelayAppToArkResponse {
    /// Application layer request ID from the ark being responding to
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// Seal[App->Ark]["relaying-v1:response"][id](\[result, [err_code, err_str]\])
    #[prost(bytes = "vec", tag = "2")]
    pub res: ::prost::alloc::vec::Vec<u8>,
}
/// UnlockRequest requests the device to start the unlock procedure. This request
/// is async, potentially returning a response only after confirming with the app.
///
/// It will trigger sending a RelayArkToAppRequest with the request content:
///    - method: "unlock"
///    - params: \[\]
///
/// The request expects a RelayAppToArkResponse with the response content:
///
///    If approved:
///      - result = key: \[u8; 32\] // Shared secret from the pairing protocol
///      - err_code: 0
///      - err_str:  ""
///
///    If denied:
///      - result = key = \[0u8; 32\] // All zeroes (signals a denial)
///      - err_code: 0              // No error, deny is valid user choice
///      - err_str:  ""             // No error, deny is valid user choice
///
/// where:
///    - key: Symmetric key for accessing the storage partition
///
/// Note, relayed messages are encrypted and authenticated on the timestamp and
/// request/response id, so there's no need for further complications.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UnlockRequest {}
/// UnlockResponse contains whether the unlock was successfully executed.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UnlockResponse {}
/// ExecutionUploadStartRequest begins a chunked upload of a WASM binary to
/// execute. The declared size is used to pre-allocate the receive buffer and
/// to reject oversized uploads early; the actual bytes are sent via subsequent
/// ExecutionUploadChunkRequest messages.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionUploadStartRequest {
    /// Total binary size in bytes
    #[prost(uint64, tag = "1")]
    pub bytes: u64,
}
/// ExecutionUploadStartResponse contains the task id to use for subsequent
/// chunk, schedule and cancel messages.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionUploadStartResponse {
    /// Task id to stream chunks into
    #[prost(uint64, tag = "1")]
    pub taskid: u64,
}
/// ExecutionUploadChunkRequest appends a chunk of data to a pending upload.
/// Chunks must be appended in order and must not overrun the declared size.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionUploadChunkRequest {
    /// Task id to append to
    #[prost(uint64, tag = "1")]
    pub taskid: u64,
    /// Data chunk to append (reasonably capped)
    #[prost(bytes = "vec", tag = "2")]
    pub chunk: ::prost::alloc::vec::Vec<u8>,
}
/// ExecutionUploadChunkResponse is an empty ack of the chunk upload request.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionUploadChunkResponse {}
/// ExecutionScheduleRequest finalizes an upload and requests the device to
/// execute the uploaded 3rd party app. The upload must have been completed
/// (i.e. the sum of chunk sizes matches the declared size).
///
/// This request is async, potentially returning a response only after confirming
/// with the app.
///
/// It will trigger sending a RelayArkToAppRequest with the request content:
///    - method: "execute"
///    - params: \[task: string\]
///
/// The request expects a RelayAppToArkResponse with the response content:
///
///    If approved:
///      - result = approval = true  // CBOR boolean
///      - err_code: 0
///      - err_str:  ""
///
///    If denied:
///      - result = approval = false // CBOR boolean
///      - err_code: 0              // No error, deny is valid user choice
///      - err_str:  ""             // No error, deny is valid user choice
///
/// where:
///    - approval: Whether the user approved or denied the execution request
///
/// Note, relayed messages are encrypted and authenticated on the timestamp and
/// request/response id, so there's no need for further complications.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionScheduleRequest {
    /// Task id returned by ExecutionUploadStartResponse
    #[prost(uint64, tag = "1")]
    pub taskid: u64,
}
/// ExecutionScheduleResponse acks that the execution was authorized and the
/// task is now running. The host already holds the task id from the preceding
/// ExecutionUploadStartResponse.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionScheduleResponse {}
/// ExecutionCancelRequest cancels a previously started 3rd party app run or
/// an in-progress upload.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionCancelRequest {
    /// Task id to cancel
    #[prost(uint64, tag = "1")]
    pub taskid: u64,
}
/// ExecutionCancelResponse contains the data gathered during an app's execution.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionCancelResponse {}
/// ExecutionStatusRequest checks the execution status of a previously started
/// 3rd party app run.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionStatusRequest {
    /// Pending execution ID to check for updates
    #[prost(uint64, tag = "1")]
    pub taskid: u64,
}
/// ExecutionResultResponse contains the data gathered during an app's execution.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionResultResponse {
    /// Name of the executed app
    #[prost(string, tag = "2")]
    pub app_name: ::prost::alloc::string::String,
    /// Version of the executed app
    #[prost(string, tag = "3")]
    pub app_version: ::prost::alloc::string::String,
    /// Whether the task finished successfully
    #[prost(bool, tag = "4")]
    pub success: bool,
    /// Raw standard output of the app
    #[prost(bytes = "vec", tag = "5")]
    pub stdout: ::prost::alloc::vec::Vec<u8>,
    /// Raw standard error the app (only in develop mode)
    #[prost(bytes = "vec", tag = "6")]
    pub stderr: ::prost::alloc::vec::Vec<u8>,
}
/// ExecutionStatusResponse contains the status of a started 3rd party app
/// execution.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionStatusResponse {
    /// Whether the app is still running
    #[prost(bool, tag = "1")]
    pub pending: bool,
    /// The result of the execution
    #[prost(message, optional, tag = "2")]
    pub result: ::core::option::Option<ExecutionResultResponse>,
}
/// SlotDownload describes the public download the device advertises for a
/// reference slot, so a host can fetch it and stream it back in.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotDownload {
    /// Public download URL
    #[prost(string, tag = "1")]
    pub url: ::prost::alloc::string::String,
    /// Download size in bytes
    #[prost(uint64, tag = "2")]
    pub bytes: u64,
    /// Download SHA256 checksum
    #[prost(string, tag = "3")]
    pub sha256: ::prost::alloc::string::String,
}
/// SlotStatus describes the current state of a single slot on the device. The
/// data fields are generic so a host renders a kind it has never seen.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotStatus {
    /// Slot type
    #[prost(enumeration = "SlotKind", tag = "1")]
    pub kind: i32,
    /// Human-readable slot name
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    /// Detailed description of this slot
    #[prost(string, tag = "3")]
    pub desc: ::prost::alloc::string::String,
    /// Nature of the data (personal, reference)
    #[prost(enumeration = "SlotOrigin", tag = "4")]
    pub origin: i32,
    /// Whether the slot is empty, filled or damaged
    #[prost(enumeration = "SlotState", tag = "5")]
    pub state: i32,
    /// Why the slot is damaged, empty otherwise
    #[prost(string, tag = "6")]
    pub damage: ::prost::alloc::string::String,
    /// Slots that must be filled before this one is actionable
    #[prost(enumeration = "SlotKind", repeated, tag = "7")]
    pub deps: ::prost::alloc::vec::Vec<i32>,
    /// Bytes on disk for this slot (0 if empty)
    #[prost(uint64, tag = "8")]
    pub bytes: u64,
    /// Reference assembly the data is keyed to (e.g. "GRCh38.p14")
    #[prost(string, tag = "9")]
    pub build: ::prost::alloc::string::String,
    /// The dataset's own release, if it has one (e.g. dbSNP "157")
    #[prost(string, tag = "10")]
    pub version: ::prost::alloc::string::String,
    /// Advertised public download, absent if none
    #[prost(message, optional, tag = "11")]
    pub download: ::core::option::Option<SlotDownload>,
}
/// SlotListRequest requests the state of all slots on the device.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotListRequest {}
/// SlotListResponse contains the current state of every slot.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SlotListResponse {
    /// State of every slot, one entry per slot kind
    #[prost(message, repeated, tag = "1")]
    pub slots: ::prost::alloc::vec::Vec<SlotStatus>,
}
/// SlotRepairRequest resets a slot to empty regardless of its current state.
/// Unlike SlotDelete (which requires the slot to be filled), repair is a stateless
/// force cleanup that removes any leftover metadata and/or files on disk. It is
/// intended for recovering from corruption or half-written state after crashes.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotRepairRequest {
    /// Slot to repair (reset to empty)
    #[prost(enumeration = "SlotKind", tag = "1")]
    pub slot: i32,
}
/// SlotRepairResponse is an empty ack of the repair request.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotRepairResponse {}
/// SlotDeleteRequest removes the contents of a filled slot. The slot must be
/// in a healthy, filled state; corrupted or half-written slots must be cleaned
/// up via SlotRepair instead.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotDeleteRequest {
    /// Slot to delete
    #[prost(enumeration = "SlotKind", tag = "1")]
    pub slot: i32,
}
/// SlotDeleteResponse is an empty ack of the delete request.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotDeleteResponse {}
/// SlotIdentifyRequest sends an ephemeral file chunk to the Ark and asks it to
/// identify the file. Its purpose is to filter potentially huge files (e.g. a
/// 30GB compressed whole genome sequencing) before uploading them, and to
/// answer what a file is without uploading it at all.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotIdentifyRequest {
    /// File name to guess the contents of
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// File size to guess the contents of
    #[prost(uint64, tag = "2")]
    pub size: u64,
    /// First chunk of the file to guess the contents of
    #[prost(bytes = "vec", tag = "3")]
    pub chunk: ::prost::alloc::vec::Vec<u8>,
    /// Possible slots to interpret as (empty == any)
    #[prost(enumeration = "SlotKind", repeated, tag = "4")]
    pub kinds: ::prost::alloc::vec::Vec<i32>,
}
/// SlotIdentifyResponse contains the identification based on the chunk shared
/// in the request.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotIdentifyResponse {
    /// Identified slot type to use during upload
    #[prost(enumeration = "SlotKind", tag = "1")]
    pub kind: i32,
    /// Identification confidence level
    #[prost(enumeration = "SlotConfidence", tag = "2")]
    pub conf: i32,
    /// Short summary of the identified data
    #[prost(string, tag = "3")]
    pub summary: ::prost::alloc::string::String,
    /// Detailed description of the identified data
    #[prost(string, tag = "4")]
    pub details: ::prost::alloc::string::String,
    /// Reason why the file is rejected, empty otherwise
    #[prost(string, tag = "5")]
    pub rejection: ::prost::alloc::string::String,
}
/// SlotUploadStartRequest requests uploading a file into a slot of the given
/// kind (e.g. a whole genome variant call file).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotUploadStartRequest {
    /// Slot type requesting to upload
    #[prost(enumeration = "SlotKind", tag = "1")]
    pub kind: i32,
    /// File name to guess the contents of
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    /// File size to guess the contents of
    #[prost(uint64, tag = "3")]
    pub size: u64,
    /// First chunk of the file to guess the contents of
    #[prost(bytes = "vec", tag = "4")]
    pub chunk: ::prost::alloc::vec::Vec<u8>,
}
/// SlotUploadStartResponse contains a unique session id for an approved upload.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotUploadStartResponse {
    /// Session id for concurrent uploads (not recommended)
    #[prost(uint64, tag = "1")]
    pub session: u64,
}
/// SlotUploadChunkRequest contains a new chunk of data to append to a pending
/// upload session.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotUploadChunkRequest {
    /// Session id into which to append a new chunk
    #[prost(uint64, tag = "1")]
    pub session: u64,
    /// Data chunk to append (reasonably capped)
    #[prost(bytes = "vec", tag = "2")]
    pub chunk: ::prost::alloc::vec::Vec<u8>,
}
/// SlotUploadChunkResponse is an empty ack of the chunk upload request.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotUploadChunkResponse {}
/// SlotUploadCancelRequest contains an upload session id to abort.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotUploadCancelRequest {
    /// Session id to cancel
    #[prost(uint64, tag = "1")]
    pub session: u64,
}
/// SlotUploadCancelResponse is an empty ack of the cancellation request.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotUploadCancelResponse {}
/// SlotPhase names one step of a slot's processing pipeline.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotPhase {
    /// Short label for the phase
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Description of what the phase does
    #[prost(string, tag = "2")]
    pub desc: ::prost::alloc::string::String,
}
/// SlotUploadProcessRequest marks an upload session ready for processing and
/// requests a progress report to be sent back. May be called multiple times.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlotUploadProcessRequest {
    /// Session id to mark as completed
    #[prost(uint64, tag = "1")]
    pub session: u64,
}
/// SlotUploadProcessResponse acks the completion of a slot upload and also
/// contains the current processing progress.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SlotUploadProcessResponse {
    /// Unix timestamp when data processing started
    #[prost(uint64, tag = "1")]
    pub proc_start: u64,
    /// Every phase of the pipeline, in order
    #[prost(message, repeated, tag = "2")]
    pub phases: ::prost::alloc::vec::Vec<SlotPhase>,
    /// Current phase (1-indexed)
    #[prost(uint64, tag = "3")]
    pub phase_in: u64,
    /// Unix timestamp when the current phase started
    #[prost(uint64, tag = "4")]
    pub phase_start: u64,
    /// Approximate progress for this phase \[0-10000\]
    #[prost(uint64, tag = "5")]
    pub phase_progress: u64,
    /// Failure reason if processing failed, empty otherwise
    #[prost(string, tag = "6")]
    pub failure: ::prost::alloc::string::String,
}
/// DatasetPathsRequest requests the map of every path an app can read, the
/// dataset view the device derives from its slots, lenses included.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DatasetPathsRequest {}
/// DatasetPathsResponse contains the generated README.md of the dataset view,
/// the same file the Ark serves to apps at /v1/README.md: every path always,
/// absent ones marked with the slot that would make them appear. It describes
/// the tree only and never carries a value from the owner's data.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DatasetPathsResponse {
    /// Generated README.md of the dataset view
    #[prost(string, tag = "1")]
    pub readme: ::prost::alloc::string::String,
}
/// ReservedErrors names the assigned protocol-wide errors in the reserved range
/// 0x00 to 0xff (inclusive). No code in this range may be assigned a request
/// specific meaning. Assigned codes must not be repurposed.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ReservedErrors {
    /// A failure without a standardized reason. Zero does not indicate success;
    /// the presence of an Error in the response indicates failure.
    Unspecified = 0,
    /// The request's responder was released without providing an application reply.
    Unanswered = 1,
    /// The peer does not know this request. Emitted by the protocol layer itself
    /// when a request's content is not in its schema.
    Unknown = 2,
    /// The peer knows this request but never serves it in this build or role,
    /// firmware updates on an emulator or develop envelopes on production.
    Unsupported = 3,
    /// The peer serves this request but not in its current state, before cloud
    /// sync or pairing. It may once the state changes.
    Unavailable = 4,
    /// The peer serves this request but the owner refused the approval it asked
    /// for on the phone. The owner's choice, not a failure.
    Unauthorized = 5,
    /// The peer serves this request but the approval it asked for did not arrive
    /// before its window ran out, on the phone or at the button.
    Unconfirmed = 6,
}
impl ReservedErrors {
    /// 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 => "RESERVED_ERRORS_UNSPECIFIED",
            Self::Unanswered => "RESERVED_ERRORS_UNANSWERED",
            Self::Unknown => "RESERVED_ERRORS_UNKNOWN",
            Self::Unsupported => "RESERVED_ERRORS_UNSUPPORTED",
            Self::Unavailable => "RESERVED_ERRORS_UNAVAILABLE",
            Self::Unauthorized => "RESERVED_ERRORS_UNAUTHORIZED",
            Self::Unconfirmed => "RESERVED_ERRORS_UNCONFIRMED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "RESERVED_ERRORS_UNSPECIFIED" => Some(Self::Unspecified),
            "RESERVED_ERRORS_UNANSWERED" => Some(Self::Unanswered),
            "RESERVED_ERRORS_UNKNOWN" => Some(Self::Unknown),
            "RESERVED_ERRORS_UNSUPPORTED" => Some(Self::Unsupported),
            "RESERVED_ERRORS_UNAVAILABLE" => Some(Self::Unavailable),
            "RESERVED_ERRORS_UNAUTHORIZED" => Some(Self::Unauthorized),
            "RESERVED_ERRORS_UNCONFIRMED" => Some(Self::Unconfirmed),
            _ => None,
        }
    }
}
/// SlotKind identifies a slot on the device. Each value corresponds to a unique
/// data type that the device can store and manage.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SlotKind {
    /// Never sent, an unset kind
    SlotUnspecified = 0,
    /// Human reference genome assembly
    SlotReferenceGenome = 1,
    /// Gene-to-coordinate mapping database
    SlotGeneAnnotations = 2,
    /// User's SNP/indel variant calls
    SlotSnpIndelCalls = 3,
    /// Variant catalog (rsID-to-position), from dbSNP
    SlotVariantCatalog = 4,
}
impl SlotKind {
    /// 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::SlotUnspecified => "SLOT_UNSPECIFIED",
            Self::SlotReferenceGenome => "SLOT_REFERENCE_GENOME",
            Self::SlotGeneAnnotations => "SLOT_GENE_ANNOTATIONS",
            Self::SlotSnpIndelCalls => "SLOT_SNP_INDEL_CALLS",
            Self::SlotVariantCatalog => "SLOT_VARIANT_CATALOG",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SLOT_UNSPECIFIED" => Some(Self::SlotUnspecified),
            "SLOT_REFERENCE_GENOME" => Some(Self::SlotReferenceGenome),
            "SLOT_GENE_ANNOTATIONS" => Some(Self::SlotGeneAnnotations),
            "SLOT_SNP_INDEL_CALLS" => Some(Self::SlotSnpIndelCalls),
            "SLOT_VARIANT_CATALOG" => Some(Self::SlotVariantCatalog),
            _ => None,
        }
    }
}
/// SlotOrigin describes the nature of the data in a slot, determining what
/// actions are available to the user for filling it.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SlotOrigin {
    /// Never sent, an unset origin
    OriginUnspecified = 0,
    /// Unique to the user, uploaded by them
    OriginPersonal = 1,
    /// Standard reference data, downloaded from public sources
    OriginReference = 2,
}
impl SlotOrigin {
    /// 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::OriginUnspecified => "ORIGIN_UNSPECIFIED",
            Self::OriginPersonal => "ORIGIN_PERSONAL",
            Self::OriginReference => "ORIGIN_REFERENCE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORIGIN_UNSPECIFIED" => Some(Self::OriginUnspecified),
            "ORIGIN_PERSONAL" => Some(Self::OriginPersonal),
            "ORIGIN_REFERENCE" => Some(Self::OriginReference),
            _ => None,
        }
    }
}
/// SlotState describes whether a slot holds data and whether that data is sound.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SlotState {
    /// Never sent, an unset state
    StateUnspecified = 0,
    /// Nothing stored
    StateEmpty = 1,
    /// Data present and healthy
    StateFilled = 2,
    /// Files exist but the metadata is missing, corrupt or outdated
    StateDamaged = 3,
}
impl SlotState {
    /// 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::StateUnspecified => "STATE_UNSPECIFIED",
            Self::StateEmpty => "STATE_EMPTY",
            Self::StateFilled => "STATE_FILLED",
            Self::StateDamaged => "STATE_DAMAGED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "STATE_UNSPECIFIED" => Some(Self::StateUnspecified),
            "STATE_EMPTY" => Some(Self::StateEmpty),
            "STATE_FILLED" => Some(Self::StateFilled),
            "STATE_DAMAGED" => Some(Self::StateDamaged),
            _ => None,
        }
    }
}
/// SlotConfidence indicates how confident the device is in its identification
/// of a file, based on content, filename and size.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SlotConfidence {
    /// Never sent, an unset confidence
    ConfidenceUnspecified = 0,
    /// Filename/extension only, no content confirmation
    ConfidenceLow = 1,
    /// Format detected but slot type inferred from size/filename
    ConfidenceMid = 2,
    /// Magic bytes match and format-specific content confirmed
    ConfidenceHigh = 3,
}
impl SlotConfidence {
    /// 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::ConfidenceUnspecified => "CONFIDENCE_UNSPECIFIED",
            Self::ConfidenceLow => "CONFIDENCE_LOW",
            Self::ConfidenceMid => "CONFIDENCE_MID",
            Self::ConfidenceHigh => "CONFIDENCE_HIGH",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CONFIDENCE_UNSPECIFIED" => Some(Self::ConfidenceUnspecified),
            "CONFIDENCE_LOW" => Some(Self::ConfidenceLow),
            "CONFIDENCE_MID" => Some(Self::ConfidenceMid),
            "CONFIDENCE_HIGH" => Some(Self::ConfidenceHigh),
            _ => None,
        }
    }
}