syntax = "proto3";

package avp;

// --- Enums ---

enum PayloadType {
  HIDDEN_STATE = 0;
  KV_CACHE = 1;
  EMBEDDING = 2;
}

enum CommunicationMode {
  LATENT = 0;
  JSON_MODE = 1;  // "JSON" is reserved in some protobuf implementations
}

enum DataType {
  FLOAT32 = 0;
  FLOAT16 = 1;
  BFLOAT16 = 2;
  INT8 = 3;
}

// --- v0.2.0 Metadata ---

// Metadata embedded in every AVP v0.2.0 message, serialized via Protocol Buffers.
message Metadata {
  // Identity
  string session_id = 1;
  string source_agent_id = 2;
  string target_agent_id = 3;
  string model_id = 4;

  // Model structure
  uint32 hidden_dim = 5;
  uint32 num_layers = 6;

  // Payload info
  PayloadType payload_type = 7;
  DataType dtype = 8;
  repeated uint32 tensor_shape = 9;

  // Communication
  CommunicationMode mode = 10;
  optional string compression = 11;
  string avp_map_id = 13;

  // Extensible
  map<string, string> extra = 14;

}

// --- Responses ---

// Response returned by the /avp/v2/transmit endpoint.
message TransmitResponse {
  bool success = 1;
  optional string message = 2;
  optional string request_id = 3;
  map<string, string> extra = 4;
}
