2018-05-22 14:10:13 -04:00
|
|
|
syntax = "proto2";
|
2018-05-14 00:31:48 -04:00
|
|
|
package main;
|
|
|
|
|
2018-05-21 22:07:40 -04:00
|
|
|
message BaseMsg {
|
2018-05-22 14:10:13 -04:00
|
|
|
optional string channel = 1;
|
|
|
|
optional bytes payload = 2;
|
2018-05-21 22:07:40 -04:00
|
|
|
}
|
|
|
|
|
2018-05-14 00:31:48 -04:00
|
|
|
message Msg {
|
2018-05-22 14:10:13 -04:00
|
|
|
optional string error = 1;
|
2018-05-25 15:24:24 -04:00
|
|
|
|
|
|
|
enum Command {
|
|
|
|
ERROR = 1;
|
|
|
|
START = 2;
|
|
|
|
SOURCE_CODE_FETCH_RES = 3;
|
|
|
|
ONEOF = 100;
|
2018-05-15 04:39:03 -04:00
|
|
|
}
|
2018-05-25 15:24:24 -04:00
|
|
|
optional Command command = 2 [ default = ONEOF ];
|
2018-05-15 04:39:03 -04:00
|
|
|
|
2018-05-25 15:24:24 -04:00
|
|
|
// We avoid creating a message for each command (and use oneof or any types)
|
|
|
|
// In order to reduce code in the size of the generated javascript
|
|
|
|
// "msg.pb.js". It seems that each new message adds 20k and we want to
|
|
|
|
// potentially add many hundreds of commands. Therefore we just prefix command
|
|
|
|
// arguments by their name.
|
2018-05-15 04:39:03 -04:00
|
|
|
|
2018-05-25 15:24:24 -04:00
|
|
|
// Start
|
|
|
|
optional string start_cwd = 10;
|
|
|
|
repeated string start_argv = 11;
|
|
|
|
optional bool start_debug_flag = 12;
|
|
|
|
optional string start_main_js = 13; // The contents of dist/main.js
|
|
|
|
optional string start_main_map = 14; // The contents of dist/main.map
|
2018-05-17 09:47:09 -04:00
|
|
|
|
2018-05-25 15:24:24 -04:00
|
|
|
// SOURCE_CODE_FETCH_RES
|
2018-05-19 04:47:40 -04:00
|
|
|
// 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.
|
2018-05-25 15:24:24 -04:00
|
|
|
optional string source_code_fetch_res_module_name = 30;
|
|
|
|
optional string source_code_fetch_res_filename = 31;
|
|
|
|
optional string source_code_fetch_res_source_code = 32;
|
|
|
|
optional string source_code_fetch_res_output_code =
|
|
|
|
33; // Non-empty only if cached.
|
|
|
|
|
|
|
|
oneof payload {
|
|
|
|
SourceCodeFetchMsg source_code_fetch = 100;
|
|
|
|
SourceCodeCacheMsg source_code_cache = 102;
|
|
|
|
ExitMsg exit = 103;
|
|
|
|
TimerStartMsg timer_start = 104;
|
|
|
|
TimerReadyMsg timer_ready = 105;
|
|
|
|
TimerClearMsg timer_clear = 106;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message SourceCodeFetchMsg {
|
|
|
|
optional string module_specifier = 1;
|
|
|
|
optional string containing_file = 2;
|
2018-05-17 09:47:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
message SourceCodeCacheMsg {
|
2018-05-22 14:10:13 -04:00
|
|
|
optional string filename = 1;
|
|
|
|
optional string source_code = 2;
|
|
|
|
optional string output_code = 3;
|
2018-05-15 04:39:03 -04:00
|
|
|
}
|
2018-05-17 21:02:06 -04:00
|
|
|
|
2018-05-22 14:10:13 -04:00
|
|
|
message ExitMsg { optional int32 code = 1; }
|
2018-05-18 11:49:28 -04:00
|
|
|
|
|
|
|
message TimerStartMsg {
|
2018-05-22 14:10:13 -04:00
|
|
|
optional int32 id = 1;
|
|
|
|
optional bool interval = 2;
|
|
|
|
optional int32 duration = 3; // In milliseconds.
|
2018-05-18 11:49:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
message TimerReadyMsg {
|
2018-05-22 14:10:13 -04:00
|
|
|
optional int32 id = 1;
|
|
|
|
optional bool done = 2;
|
2018-05-18 11:49:28 -04:00
|
|
|
}
|
2018-05-23 23:23:41 +04:30
|
|
|
|
|
|
|
message TimerClearMsg { optional int32 id = 1; }
|