/*  Copyright (C) 2012-2024 by László Nagy
    This file is part of Bear.

    Bear is a tool to generate compilation database for clang tooling.

    Bear is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Bear is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

syntax = "proto3";

package rpc;

// This represents the executed command itself. Describes all the
// context that the caller was given. And these are the those parameters
// which are essential for re-run the command.
message Execution {
    string executable = 1;
    repeated string arguments = 2;
    string working_dir = 3;
    map<string, string> environment = 4;
}

// This represents a (remote) supervisor process to set up program execution.
//
// A supervisor process executes a single program in the hope that it can
// get information about the state of the child process. But to decide what
// is the right strategy to intercept the relevant events from the child
// process is done in the external supervisor process.
//
// This interface describes a remote service which can be queried for how to
// execute the child program. Can resolve the executable name or update the
// environment variables.
service Supervisor {

    // Resolve the execution for future child process.
    rpc Resolve (ResolveRequest) returns (ResolveResponse) {
    }
}

message ResolveRequest {
    Execution execution = 1;
}

message ResolveResponse {
    Execution execution = 1;
}
