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
//! This is the underlying protocol which Crosis uses to interface with [Replit]'s
//! containers.
//! 
//! Protocol is the protobuf-based interface which defines how data is sent and
//! received from a Replit container. All data that is exchanged uses the same
//! [Command] structure; instead, the [body] of the [Command] is what changes to
//! fit the necessary sent/received data structure.
//! 
//! ## Example
//! ```rust
//! // get protocol from crosis
//! use crosis::protocol;
//! 
//! // create a command
//! let command = protocol::Command {
//!   // channel and session act as namespaces (0 being global)
//!   channel: 0,
//!   session: 0,
//!   // can be used to identify a response message/event ("" being no ref)
//!   r#ref: String::new(),
//!   // the command you want to send (example command)
//!   body: Some(protocol::command::Body::Ping(protocol::Ping {}))
//! };
//! 
//! // do stuff with command
//! ```
//! 
//! ## Notes
//! If you want to use the Protocol by itself - without the higher-level
//! Crosis API - you can use `default-features = false` in `Cargo.toml`.
//! 
//! This implementaion uses [prost] for encoding and decoding protobuf data.
//! 
//! [Replit]: https://repl.it
//! [Command]: ./struct.Command.html
//! [body]: ./struct.Command.html#structfield.body
//! [prost]: https://crates.io/crates/prost

#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Command {
  /// channel and session act as namespaces with 0 being global.
  /// both session and channel must match for a client to receive a command.
  #[prost(int32, tag="1")]
  pub channel: i32,
  /// < 0 : all user sessions except abs(id)
  ///   0 : all user sessions
  ///   1 : internal message to conman
  /// > 1 : user session with given id
  #[prost(int32, tag="2")]
  pub session: i32,
  #[prost(string, tag="1000")]
  pub r#ref: std::string::String,
  /// global messages
  /// these should always be on channel 0
  #[prost(oneof="command::Body", tags="3, 4, 5, 6, 9, 10, 11, 16, 17, 20, 21, 22, 23, 24, 26, 27, 28, 30, 31, 41, 32, 33, 34, 36, 39, 35, 37, 38, 40, 42, 43, 44, 70, 71, 90, 91, 92, 100, 120, 121, 122, 123, 130, 150, 151, 152, 153, 200, 201, 202, 205, 206, 220, 221, 222, 223, 224, 225, 226, 251, 230, 231, 232, 233, 235, 240, 256, 257, 260, 261, 262, 270, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 310, 311, 312, 330, 331, 332, 335, 340, 350, 351, 360, 361, 362, 363, 364, 365, 366")]
  pub body: ::std::option::Option<command::Body>,
}
pub mod command {
  /// global messages
  /// these should always be on channel 0
  #[derive(Clone, PartialEq, ::prost::Oneof)]
  pub enum Body {
    #[prost(message, tag="3")]
    OpenChan(super::OpenChannel),
    #[prost(message, tag="4")]
    OpenChanRes(super::OpenChannelRes),
    #[prost(message, tag="5")]
    CloseChan(super::CloseChannel),
    #[prost(message, tag="6")]
    CloseChanRes(super::CloseChannelRes),
    #[prost(message, tag="9")]
    ContainerState(super::ContainerState),
    #[prost(message, tag="10")]
    PortOpen(super::PortOpen),
    #[prost(message, tag="11")]
    Toast(super::Toast),
    // service specific messages
    
    #[prost(message, tag="16")]
    RunMain(super::RunMain),
    #[prost(message, tag="17")]
    Clear(super::Clear),
    #[prost(string, tag="20")]
    Eval(std::string::String),
    #[prost(string, tag="21")]
    Result(std::string::String),
    #[prost(string, tag="22")]
    Input(std::string::String),
    #[prost(string, tag="23")]
    Output(std::string::String),
    #[prost(string, tag="24")]
    Error(std::string::String),
    #[prost(message, tag="26")]
    SaneTerm(super::SaneTerm),
    #[prost(message, tag="27")]
    ResizeTerm(super::ResizeTerm),
    #[prost(enumeration="super::State", tag="28")]
    State(i32),
    #[prost(message, tag="30")]
    Ok(super::Ok),
    #[prost(message, tag="31")]
    Persist(super::File),
    #[prost(message, tag="41")]
    PersistMirror(super::File),
    #[prost(message, tag="32")]
    Write(super::File),
    #[prost(message, tag="33")]
    Remove(super::File),
    #[prost(message, tag="34")]
    Move(super::Move),
    #[prost(message, tag="36")]
    TryRemove(super::File),
    #[prost(message, tag="39")]
    Mkdir(super::File),
    #[prost(message, tag="35")]
    Read(super::File),
    #[prost(message, tag="37")]
    Readdir(super::File),
    #[prost(message, tag="38")]
    Files(super::Files),
    #[prost(message, tag="40")]
    File(super::File),
    #[prost(message, tag="42")]
    CheckChanges(super::CheckChanges),
    #[prost(message, tag="43")]
    ChangedFiles(super::Files),
    #[prost(message, tag="44")]
    LintResults(super::LintResults),
    #[prost(message, tag="70")]
    RunContainedTest(super::ContainedTest),
    #[prost(message, tag="71")]
    TestResult(super::TestResult),
    #[prost(string, tag="90")]
    DebuggerStart(std::string::String),
    #[prost(message, tag="91")]
    DebuggerStep(super::RunMain),
    #[prost(message, tag="92")]
    DebuggerStatus(super::DebugStatus),
    #[prost(message, tag="100")]
    EnsurePackages(super::EnsurePackages),
    #[prost(message, tag="120")]
    Ping(super::Ping),
    #[prost(message, tag="121")]
    Pong(super::Pong),
    #[prost(message, tag="122")]
    Hello(super::Hello),
    #[prost(message, tag="123")]
    Goodbye(super::Goodbye),
    #[prost(message, tag="130")]
    Hint(super::Hint),
    #[prost(message, tag="150")]
    Connect(super::Connect),
    #[prost(message, tag="151")]
    Send(super::Send),
    #[prost(message, tag="152")]
    Recv(super::Recv),
    #[prost(message, tag="153")]
    Disconnect(super::Disconnect),
    #[prost(message, tag="200")]
    FileAuthReq(super::FileAuthReq),
    #[prost(message, tag="201")]
    FileAuthRes(super::FileAuthRes),
    #[prost(message, tag="202")]
    MutliFileAuthRes(super::MultiFileAuthRes),
    #[prost(message, tag="205")]
    ListObjects(super::ListObjects),
    #[prost(message, tag="206")]
    ListObjectsResp(super::ListObjectsResp),
    #[prost(message, tag="220")]
    Ot(super::OtPacket),
    #[prost(message, tag="221")]
    Otstatus(super::OtStatus),
    #[prost(message, tag="222")]
    OtLinkFile(super::OtLinkFile),
    #[prost(message, tag="223")]
    OtNewCursor(super::OtCursor),
    #[prost(message, tag="224")]
    OtDeleteCursor(super::OtCursor),
    #[prost(message, tag="225")]
    OtFetchRequest(super::OtFetchRequest),
    #[prost(message, tag="226")]
    OtFetchResponse(super::OtFetchResponse),
    #[prost(message, tag="251")]
    Flush(super::Flush),
    #[prost(message, tag="230")]
    Debug(super::Debug),
    #[prost(message, tag="231")]
    StartVcr(super::StartVcr),
    #[prost(message, tag="232")]
    ReadVcr(super::ReadVcr),
    #[prost(message, tag="233")]
    VcrLog(super::VcrLog),
    #[prost(message, tag="235")]
    Auth(super::Auth),
    #[prost(message, tag="240")]
    ExecInfo(super::ExecInfo),
    #[prost(message, tag="256")]
    SubscribeFile(super::SubscribeFile),
    #[prost(message, tag="257")]
    FileEvent(super::FileEvent),
    #[prost(message, tag="260")]
    Roster(super::Roster),
    #[prost(message, tag="261")]
    Join(super::User),
    #[prost(message, tag="262")]
    Part(super::User),
    #[prost(message, tag="270")]
    Exec(super::Exec),
    #[prost(message, tag="280")]
    PackageSearch(super::PackageSearch),
    #[prost(message, tag="281")]
    PackageSearchResp(super::PackageSearchResp),
    #[prost(message, tag="282")]
    PackageInfo(super::PackageInfo),
    #[prost(message, tag="283")]
    PackageInfoResp(super::PackageInfoResp),
    #[prost(message, tag="284")]
    PackageAdd(super::PackageAdd),
    #[prost(message, tag="285")]
    PackageRemove(super::PackageRemove),
    #[prost(message, tag="286")]
    PackageInstall(super::PackageInstall),
    #[prost(message, tag="287")]
    PackageListSpecfile(super::PackageListSpecfile),
    #[prost(message, tag="288")]
    PackageListSpecfileResp(super::PackageListSpecfileResp),
    #[prost(message, tag="289")]
    PackageCacheSave(super::PackageCacheSave),
    #[prost(message, tag="310")]
    ChatMessage(super::ChatMessage),
    #[prost(message, tag="311")]
    ChatTyping(super::ChatTyping),
    #[prost(message, tag="312")]
    ChatScrollback(super::ChatScrollback),
    #[prost(message, tag="330")]
    FsSnapshot(super::FsSnapshot),
    #[prost(message, tag="331")]
    FsTakeLock(super::FsLock),
    #[prost(message, tag="332")]
    FsReleaseLock(super::FsLock),
    #[prost(bool, tag="335")]
    HasCap(bool),
    /// used to configure pid1 at runtime
    #[prost(message, tag="340")]
    Pid1Config(super::Pid1Config),
    #[prost(message, tag="350")]
    Metrics(super::Metrics),
    #[prost(message, tag="351")]
    BootStatus(super::BootStatus),
    /// metadata store
    #[prost(message, tag="360")]
    ReadMeta(super::ReadMeta),
    #[prost(message, tag="361")]
    WriteMeta(super::WriteMeta),
    #[prost(message, tag="362")]
    AppendMeta(super::AppendMeta),
    /// audio
    #[prost(message, tag="363")]
    Audio(super::Audio),
    #[prost(message, tag="364")]
    PprofRequest(super::PprofRequest),
    #[prost(message, tag="365")]
    PprofResponse(super::PprofResponse),
    #[prost(message, tag="366")]
    Audio2(super::Audio2),
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Audio {
  #[prost(int32, repeated, tag="1")]
  pub data: ::std::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Audio2 {
  #[prost(sint32, repeated, tag="1")]
  pub data: ::std::vec::Vec<i32>,
  #[prost(int64, tag="2")]
  pub samples: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadMeta {
  #[prost(string, tag="1")]
  pub key: std::string::String,
  #[prost(bool, tag="2")]
  pub exists: bool,
  #[prost(bytes, tag="3")]
  pub data: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteMeta {
  #[prost(string, tag="1")]
  pub key: std::string::String,
  #[prost(bytes, tag="2")]
  pub data: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppendMeta {
  #[prost(string, tag="1")]
  pub key: std::string::String,
  #[prost(bytes, tag="2")]
  pub data: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BootStatus {
  #[prost(enumeration="boot_status::Stage", tag="1")]
  pub stage: i32,
  /// progress/total is context dependant. Most stages have no progress info,
  /// this is sent as 0/0 (the default value).
  #[prost(uint32, tag="2")]
  pub progress: u32,
  #[prost(uint32, tag="3")]
  pub total: u32,
}
pub mod boot_status {
  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
  #[repr(i32)]
  pub enum Stage {
    Handshake = 0,
    Acquiring = 3,
    Complete = 4,
    Proxy = 5,
    PullFiles = 6,
    LoadBlock = 7,
    Retry = 8,
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Pid1Config {
  #[prost(string, tag="1")]
  pub cwd: std::string::String,
  #[prost(string, tag="2")]
  pub language: std::string::String,
  #[prost(map="string, string", tag="3")]
  pub env: ::std::collections::HashMap<std::string::String, std::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FsLock {
  #[prost(string, tag="1")]
  pub name: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FsSnapshot {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeFile {
  #[prost(message, repeated, tag="1")]
  pub files: ::std::vec::Vec<File>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileEvent {
  #[prost(message, optional, tag="1")]
  pub file: ::std::option::Option<File>,
  /// when the Op is a Move dest is set to the destination of the move.
  #[prost(message, optional, tag="3")]
  pub dest: ::std::option::Option<File>,
  #[prost(enumeration="file_event::Op", tag="2")]
  pub op: i32,
}
pub mod file_event {
  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
  #[repr(i32)]
  pub enum Op {
    Create = 0,
    Move = 1,
    Remove = 2,
    Modify = 3,
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Flush {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OtLinkFile {
  #[prost(message, optional, tag="1")]
  pub file: ::std::option::Option<File>,
  #[prost(bool, tag="2")]
  pub high_consistency: bool,
  #[prost(bool, tag="3")]
  pub use_mod_time: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Auth {
  #[prost(string, tag="1")]
  pub token: std::string::String,
  #[prost(string, tag="2")]
  pub container_id: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VcrEntry {
  #[prost(uint64, tag="1")]
  pub timestamp: u64,
  #[prost(enumeration="vcr_entry::Direction", tag="2")]
  pub direction: i32,
  #[prost(message, optional, tag="3")]
  pub command: ::std::option::Option<Command>,
  #[prost(string, tag="4")]
  pub uid: std::string::String,
}
pub mod vcr_entry {
  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
  #[repr(i32)]
  pub enum Direction {
    In = 0,
    Out = 1,
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartVcr {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadVcr {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VcrLog {
  #[prost(message, repeated, tag="1")]
  pub log: ::std::vec::Vec<VcrEntry>,
  #[prost(message, optional, tag="2")]
  pub logfile: ::std::option::Option<File>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecInfo {
  #[prost(string, repeated, tag="1")]
  pub command: ::std::vec::Vec<std::string::String>,
  #[prost(string, tag="2")]
  pub reason: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Debug {
  #[prost(string, tag="1")]
  pub text: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileAuthReq {
  #[prost(message, optional, tag="1")]
  pub file: ::std::option::Option<File>,
  #[prost(enumeration="FileAuthMethod", tag="2")]
  pub method: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiFileAuthRes {
  #[prost(message, optional, tag="1")]
  pub put: ::std::option::Option<FileAuthRes>,
  #[prost(message, optional, tag="2")]
  pub del: ::std::option::Option<FileAuthRes>,
  #[prost(message, optional, tag="3")]
  pub get: ::std::option::Option<FileAuthRes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileAuthRes {
  #[prost(message, optional, tag="1")]
  pub file: ::std::option::Option<File>,
  #[prost(string, tag="2")]
  pub url: std::string::String,
  #[prost(enumeration="FileAuthMethod", tag="3")]
  pub method: i32,
  #[prost(int64, tag="4")]
  pub expire: i64,
  #[prost(string, tag="5")]
  pub error: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListObjects {
  #[prost(string, tag="1")]
  pub prefix: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListObjectsResp {
  #[prost(string, repeated, tag="1")]
  pub objects: ::std::vec::Vec<std::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Disconnect {
  #[prost(string, tag="1")]
  pub error: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Send {
  #[prost(bytes, tag="1")]
  pub buff: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Recv {
  #[prost(bytes, tag="1")]
  pub buff: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Connect {
  #[prost(string, tag="1")]
  pub proto: std::string::String,
  #[prost(string, tag="2")]
  pub addr: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Hint {
  #[prost(string, tag="1")]
  pub text: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Ping {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Pong {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Hello {
  #[prost(uint32, tag="1")]
  pub userid: u32,
  #[prost(string, tag="2")]
  pub username: std::string::String,
  #[prost(string, tag="3")]
  pub token: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Goodbye {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckChanges {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnsurePackages {
  #[prost(bool, tag="1")]
  pub install: bool,
  #[prost(message, optional, tag="2")]
  pub file: ::std::option::Option<File>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Start {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DebugStatus {
  #[prost(bool, tag="1")]
  pub done: bool,
  #[prost(message, repeated, tag="2")]
  pub stack: ::std::vec::Vec<StackFrame>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StackFrame {
  #[prost(string, tag="1")]
  pub function: std::string::String,
  #[prost(uint32, tag="2")]
  pub line: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContainedTest {
  #[prost(message, optional, tag="1")]
  pub suite: ::std::option::Option<File>,
  #[prost(message, repeated, tag="2")]
  pub project: ::std::vec::Vec<File>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TestResult {
  #[prost(bool, tag="1")]
  pub passed: bool,
  #[prost(string, tag="2")]
  pub stderr: std::string::String,
  #[prost(message, repeated, tag="3")]
  pub fails: ::std::vec::Vec<TestFailure>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TestFailure {
  #[prost(string, tag="1")]
  pub name: std::string::String,
  #[prost(string, tag="2")]
  pub trace: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResizeTerm {
  #[prost(uint32, tag="1")]
  pub rows: u32,
  #[prost(uint32, tag="2")]
  pub cols: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SaneTerm {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LintResults {
  #[prost(message, repeated, tag="1")]
  pub results: ::std::vec::Vec<LintResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LintResult {
  #[prost(string, tag="1")]
  pub text: std::string::String,
  #[prost(int32, tag="2")]
  pub row: i32,
  #[prost(int32, tag="3")]
  pub column: i32,
  #[prost(string, tag="4")]
  pub r#type: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Ok {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Move {
  #[prost(string, tag="1")]
  pub old_path: std::string::String,
  #[prost(string, tag="2")]
  pub new_path: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Files {
  #[prost(message, repeated, tag="1")]
  pub files: ::std::vec::Vec<File>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct File {
  #[prost(string, tag="1")]
  pub path: std::string::String,
  #[prost(enumeration="file::Type", tag="2")]
  pub r#type: i32,
  #[prost(bytes, tag="3")]
  pub content: std::vec::Vec<u8>,
}
pub mod file {
  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
  #[repr(i32)]
  pub enum Type {
    Regular = 0,
    Directory = 1,
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Clear {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Toast {
  #[prost(string, tag="1")]
  pub text: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunMain {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenChannel {
  #[prost(string, tag="1")]
  pub service: std::string::String,
  #[prost(string, tag="2")]
  pub name: std::string::String,
  #[prost(enumeration="open_channel::Action", tag="3")]
  pub action: i32,
  #[prost(int32, tag="4")]
  pub id: i32,
}
pub mod open_channel {
  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
  #[repr(i32)]
  pub enum Action {
    Create = 0,
    Attach = 1,
    AttachOrCreate = 2,
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenChannelRes {
  #[prost(int32, tag="1")]
  pub id: i32,
  #[prost(enumeration="open_channel_res::State", tag="2")]
  pub state: i32,
  #[prost(string, tag="3")]
  pub error: std::string::String,
}
pub mod open_channel_res {
  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
  #[repr(i32)]
  pub enum State {
    Created = 0,
    Attached = 1,
    Error = 2,
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloseChannel {
  #[prost(int32, tag="1")]
  pub id: i32,
  #[prost(enumeration="close_channel::Action", tag="2")]
  pub action: i32,
}
pub mod close_channel {
  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
  #[repr(i32)]
  pub enum Action {
    Disconnect = 0,
    TryClose = 1,
    Close = 2,
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloseChannelRes {
  #[prost(int32, tag="1")]
  pub id: i32,
  #[prost(enumeration="close_channel_res::Status", tag="2")]
  pub status: i32,
}
pub mod close_channel_res {
  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
  #[repr(i32)]
  pub enum Status {
    Disconnect = 0,
    Close = 1,
    Nothing = 2,
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContainerState {
  #[prost(enumeration="container_state::State", tag="1")]
  pub state: i32,
}
pub mod container_state {
  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
  #[repr(i32)]
  pub enum State {
    Sleep = 0,
    Ready = 1,
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PortOpen {
  #[prost(bool, tag="1")]
  pub forwarded: bool,
  #[prost(uint32, tag="2")]
  pub port: u32,
  #[prost(string, tag="3")]
  pub address: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OtFetchRequest {
  #[prost(uint32, tag="1")]
  pub version_from: u32,
  #[prost(uint32, tag="2")]
  pub version_to: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OtFetchResponse {
  #[prost(message, repeated, tag="1")]
  pub packets: ::std::vec::Vec<OtPacket>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OtPacket {
  #[prost(uint32, tag="1")]
  pub version: u32,
  #[prost(message, repeated, tag="2")]
  pub ops: ::std::vec::Vec<OtRuneTransformOp>,
  #[prost(uint32, tag="3")]
  pub crc32: u32,
  #[prost(message, optional, tag="4")]
  pub committed: ::std::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OtRuneTransformOp {
  #[prost(oneof="ot_rune_transform_op::Op", tags="1, 2, 3")]
  pub op: ::std::option::Option<ot_rune_transform_op::Op>,
}
pub mod ot_rune_transform_op {
  #[derive(Clone, PartialEq, ::prost::Oneof)]
  pub enum Op {
    #[prost(uint32, tag="1")]
    Skip(u32),
    #[prost(uint32, tag="2")]
    Delete(u32),
    #[prost(string, tag="3")]
    Insert(std::string::String),
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OtStatus {
  #[prost(string, tag="1")]
  pub contents: std::string::String,
  #[prost(uint32, tag="2")]
  pub version: u32,
  #[prost(message, optional, tag="3")]
  pub linked_file: ::std::option::Option<File>,
  #[prost(message, repeated, tag="4")]
  pub cursors: ::std::vec::Vec<OtCursor>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OtCursor {
  #[prost(uint32, tag="1")]
  pub position: u32,
  #[prost(uint32, tag="2")]
  pub selection_start: u32,
  #[prost(uint32, tag="3")]
  pub selection_end: u32,
  #[prost(message, optional, tag="4")]
  pub user: ::std::option::Option<User>,
  #[prost(string, tag="5")]
  pub id: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChatMessage {
  #[prost(string, tag="1")]
  pub username: std::string::String,
  #[prost(string, tag="2")]
  pub text: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChatTyping {
  #[prost(string, tag="1")]
  pub username: std::string::String,
  #[prost(bool, tag="2")]
  pub typing: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct User {
  #[prost(uint32, tag="1")]
  pub id: u32,
  #[prost(string, tag="2")]
  pub name: std::string::String,
  #[prost(string, repeated, tag="3")]
  pub roles: ::std::vec::Vec<std::string::String>,
  #[prost(int32, tag="4")]
  pub session: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Roster {
  #[prost(message, repeated, tag="1")]
  pub user: ::std::vec::Vec<User>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Exec {
  #[prost(string, repeated, tag="1")]
  pub args: ::std::vec::Vec<std::string::String>,
  #[prost(map="string, string", tag="2")]
  pub env: ::std::collections::HashMap<std::string::String, std::string::String>,
  #[prost(bool, tag="3")]
  pub blocking: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Package {
  /// Used always.
  #[prost(string, tag="1")]
  pub name: std::string::String,
  /// Used only for add and remove.
  #[prost(string, tag="2")]
  pub spec: std::string::String,
  /// Used only for search and info.
  #[prost(string, tag="10")]
  pub description: std::string::String,
  #[prost(string, tag="11")]
  pub version: std::string::String,
  #[prost(string, tag="12")]
  pub homepage_url: std::string::String,
  #[prost(string, tag="13")]
  pub documentation_url: std::string::String,
  #[prost(string, tag="14")]
  pub source_code_url: std::string::String,
  #[prost(string, tag="15")]
  pub bug_tracker_url: std::string::String,
  #[prost(string, tag="16")]
  pub author: std::string::String,
  #[prost(string, tag="17")]
  pub license: std::string::String,
  #[prost(message, repeated, tag="18")]
  pub dependencies: ::std::vec::Vec<Package>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageSearch {
  #[prost(string, tag="1")]
  pub query: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageSearchResp {
  #[prost(message, repeated, tag="1")]
  pub results: ::std::vec::Vec<Package>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageInfo {
  #[prost(message, optional, tag="1")]
  pub pkg: ::std::option::Option<Package>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageInfoResp {
  #[prost(message, optional, tag="1")]
  pub pkg: ::std::option::Option<Package>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageAdd {
  #[prost(message, repeated, tag="1")]
  pub pkgs: ::std::vec::Vec<Package>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageRemove {
  #[prost(message, repeated, tag="1")]
  pub pkgs: ::std::vec::Vec<Package>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageInstall {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageListSpecfile {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageListSpecfileResp {
  #[prost(message, repeated, tag="1")]
  pub pkgs: ::std::vec::Vec<Package>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageCacheSave {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChatScrollback {
  #[prost(message, repeated, tag="1")]
  pub scrollback: ::std::vec::Vec<ChatMessage>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Metrics {
  #[prost(bytes, repeated, tag="1")]
  pub prometheus_metric_families: ::std::vec::Vec<std::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PprofRequest {
  #[prost(string, tag="1")]
  pub id: std::string::String,
  #[prost(oneof="pprof_request::Body", tags="2, 3, 4, 5, 6")]
  pub body: ::std::option::Option<pprof_request::Body>,
}
pub mod pprof_request {
  #[derive(Clone, PartialEq, ::prost::Oneof)]
  pub enum Body {
    #[prost(message, tag="2")]
    PprofCpuProfileRequest(super::PprofCpuProfileRequest),
    #[prost(message, tag="3")]
    PprofHeapProfileRequest(super::PprofHeapProfileRequest),
    #[prost(message, tag="4")]
    PprofAllocsProfileRequest(super::PprofAllocsProfileRequest),
    #[prost(message, tag="5")]
    PprofBlockProfileRequest(super::PprofBlockProfileRequest),
    #[prost(message, tag="6")]
    PprofMutexProfileRequest(super::PprofMutexProfileRequest),
  }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PprofAllocsProfileRequest {
  #[prost(bool, tag="1")]
  pub debug: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PprofBlockProfileRequest {
  #[prost(bool, tag="1")]
  pub debug: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PprofCpuProfileRequest {
  #[prost(int64, tag="1")]
  pub seconds: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PprofHeapProfileRequest {
  #[prost(bool, tag="1")]
  pub gc: bool,
  #[prost(bool, tag="2")]
  pub debug: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PprofMutexProfileRequest {
  #[prost(bool, tag="1")]
  pub debug: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PprofResponse {
  #[prost(string, tag="1")]
  pub id: std::string::String,
  #[prost(bytes, tag="2")]
  pub profile: std::vec::Vec<u8>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FileAuthMethod {
  Get = 0,
  Head = 1,
  Put = 2,
  Delete = 3,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
  Stopped = 0,
  Running = 1,
}