syntax = "proto3";
package proto;

message Null {}

message Nil {}

message InitRunnerRequest {
    string apiUrl = 1;
    string token = 2;
    uint32 robot_server = 3;
    uint32 natsPort = 4;
    string robot_name = 5;
    bool send_crash = 6;
}

message RunRequest {
    string repoid = 1;
    string repository = 2;
    string namespace = 3;
    string version = 4;
}

message RobotNameResponse {
    string robot_name = 1;
}

message GetCapabilitiesResponse {
    uint64 capabilities = 1;
}

message AttachRequest {
    bytes config = 1;
}

message DetachRequest {
    string namespace = 1;
}

// Runner service
service Runner {
    rpc Init(InitRunnerRequest) returns (Null);
    rpc Run(RunRequest) returns (Null);
    rpc Clear(Null) returns (Null);
    rpc RobotName(Null) returns (RobotNameResponse);
    rpc GetCapabilities(Null) returns (GetCapabilitiesResponse);
}

service RobotHelper {}

// Debug service for attach/detach
service Debug {
    rpc Attach(AttachRequest) returns (Nil);
    rpc Detach(DetachRequest) returns (Nil);
}
