// Copyright 2024 AI Redefined Inc. <dev+cogment@ai-r.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package cogment_lab;

import "ndarray.proto";
import "spaces.proto";


message EnvironmentSpecs {
  string implementation = 1;
  bool turn_based = 2;
  int32 num_players = 3;
  spaces.Space observation_space = 4;
  spaces.Space action_space = 5;
  string web_components_file = 6;
}

message AgentSpecs {
  spaces.Space observation_space = 1;
  spaces.Space action_space = 2;
}

message Value {
  oneof value_type {
    string string_value = 1;
    int32 int_value = 2;
    float float_value = 3;
  }
}
message EnvironmentConfig {
  string run_id = 1;
  bool render = 2;
  int32 render_width = 3;
  uint32 seed = 4;
  bool flatten = 5;
  map<string, Value> reset_args = 6;
}

message HFHubModel {
    string repo_id = 1;
    string filename = 2;
}

message AgentConfig {
  string run_id = 1;
  AgentSpecs agent_specs = 2;
  uint32 seed = 3;
  string model_id = 4;
  int32 model_iteration = 5;
  int32 model_update_frequency = 6;
}

message TrialConfig {
}

message Observation {
  nd_array.Array value = 1;
  bool active = 2;
  bool alive = 3;
  optional bytes rendered_frame = 4;
}

message PlayerAction {
  nd_array.Array value = 1;
}
