syntax = "proto3"; package controlplane.v1; import "google/protobuf/timestamp.proto"; service ControlPlaneService { rpc Catalog(CatalogRequest) returns (CatalogResponse); rpc Query(QueryRequest) returns (QueryResponse); rpc History(HistoryRequest) returns (HistoryResponse); rpc Command(CommandRequest) returns (CommandResponse); rpc Watch(WatchRequest) returns (stream WatchResponse); } message ResourceDescriptor { string kind = 1; string title = 2; string schema_json = 3; repeated string commands = 4; // ApplyMode is "live", "restart-required", or "domain-managed". string apply_mode = 5; // QueryService and command_service identify an existing domain API when // the resource is not stored as a generic JSON document. string query_service = 6; string command_service = 7; // DefaultsJson is the factory value a client can restore this resource to. // Empty when the resource has no shipped default. string defaults_json = 8; } message CatalogRequest {} message CatalogResponse { repeated ResourceDescriptor resources = 1; } message Resource { string kind = 1; int64 version = 2; bytes value_json = 3; google.protobuf.Timestamp updated_at = 4; string org_id = 5; } // Every request that names a resource acts in one org's copy of it: the org // the State Store derives from the caller's principal, else the default org. message QueryRequest { string kind = 1; reserved 2; reserved "org_id"; } message QueryResponse { Resource resource = 1; } // Revision is one entry of a resource's audit trail: the value that version // held, and who changed it from where. message Revision { int64 version = 1; bytes value_json = 2; string actor = 3; string source = 4; string request_id = 5; google.protobuf.Timestamp at = 6; } message HistoryRequest { string kind = 1; // Limit caps the revisions returned, newest first. Zero means the server's // own default. int32 limit = 2; reserved 3; reserved "org_id"; } message HistoryResponse { repeated Revision revisions = 1; } // Removed: the field-level Audit RPC and its AuditEntry, AuditRequest and // AuditResponse messages. The unified org-scoped feed in state/v1/audit.proto // supersedes them. The State Store and every client ship from this repository // together, so this is a deliberate break with no compatibility window; the // numbers stay unassigned rather than being reused for another meaning. message CommandRequest { string kind = 1; string command = 2; bytes value_json = 3; int64 expected_version = 4; string request_id = 5; // Actor and source are supplied by a trusted service adapter, never copied // from browser/request JSON. string actor = 6; string source = 7; reserved 8; reserved "org_id"; } message CommandResponse { Resource resource = 1; } message WatchRequest { string kind = 1; int64 after_version = 2; reserved 3; reserved "org_id"; } message WatchResponse { Resource resource = 1; string error = 2; }