summaryrefslogtreecommitdiff
path: root/msg.proto
blob: 081b2df8cbcb91d797cdd8f8cb3646d25b2cdabe (plain)
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
syntax = "proto2";
package main;

message BaseMsg {
  optional string channel = 1;
  optional bytes payload = 2;
}

message Msg {
  optional string error = 1;
  oneof payload {
    StartMsg start = 10;
    SourceCodeFetchMsg source_code_fetch = 11;
    SourceCodeFetchResMsg source_code_fetch_res = 12;
    SourceCodeCacheMsg source_code_cache = 13;
    ExitMsg exit = 14;
    TimerStartMsg timer_start = 15;
    TimerReadyMsg timer_ready = 16;
  }
}

message StartMsg {
  optional string cwd = 1;
  repeated string argv = 2;
  optional bool debug_flag = 3;
  optional string main_js = 4;  // The contents of dist/main.js
  optional string main_map = 5; // The contents of dist/main.map
}

message SourceCodeFetchMsg {
  optional string module_specifier = 1;
  optional string containing_file = 2;
}

message SourceCodeFetchResMsg {
  // If it's a non-http module, moduleName and filename will be the same.
  // For http modules, moduleName is its resolved http URL, and filename
  // is the location of the locally downloaded source code.
  optional string moduleName = 1;
  optional string filename = 2;
  optional string source_code = 3;
  optional string output_code = 4; // Non-empty only if cached.
}

message SourceCodeCacheMsg {
  optional string filename = 1;
  optional string source_code = 2;
  optional string output_code = 3;
}

message ExitMsg { optional int32 code = 1; }

message TimerStartMsg {
  optional int32 id = 1;
  optional bool interval = 2;
  optional int32 duration = 3; // In milliseconds.
}

message TimerReadyMsg {
  optional int32 id = 1;
  optional bool done = 2;
}