syntax = "proto3";
package angzarr;
option go_package = "github.com/angzarr/angzarr/proto/angzarr";
option java_package = "dev.angzarr";
option java_multiple_files = true;
option csharp_namespace = "Angzarr";
option ruby_package = "Angzarr";

import "angzarr/types.proto";
import "google/protobuf/empty.proto";

// ProjectorService: client logic that projects events to read models
// client logic doesn't care about sync - coordinator decides
service ProjectorService {
  // Self-description: component type, subscribed domains, handled event types
  rpc GetDescriptor (GetDescriptorRequest) returns (ComponentDescriptor);
  rpc Handle (EventBook) returns (Projection);
}

// ProjectorCoordinatorService: orchestrates projection processing
service ProjectorCoordinatorService {
  // Sync processing - returns projection based on sync_mode
  rpc HandleSync (SyncEventBook) returns (Projection);
  // Async processing - fire and forget
  rpc Handle (EventBook) returns (google.protobuf.Empty);
  // Speculative processing - returns projection without side effects
  rpc HandleSpeculative (EventBook) returns (Projection);
}
