// Common types shared across v2 services.
//
// Philosophy: Use usize (uint64) for all indices per Rust convention.

syntax = "proto3";
package reovim.v2;

// Buffer position (0-indexed).
message Position {
  uint64 line = 1;
  uint64 column = 2;
}

// Buffer identifier.
message BufferId {
  uint64 id = 1;
}

// Window identifier.
message WindowId {
  uint64 id = 1;
}

// Client identifier.
message ClientId {
  uint64 id = 1;
}

// Selection range in a buffer.
message Selection {
  Position start = 1;
  Position end = 2;
}

// Window rectangle (position and size).
message WindowRect {
  uint64 x = 1;
  uint64 y = 2;
  uint64 width = 3;
  uint64 height = 4;
}

// Generic result status.
message Status {
  bool ok = 1;
  optional string error = 2;
}

// Tab page information (#401).
// Used in both LayoutChangedPayload (notification) and GetLayoutResponse (state).
message TabPageInfo {
  uint64 tab_id = 1;
  string label = 2;
  bool active = 3;
}
