Move quixos protocol to repository root

This commit is contained in:
Timothy J. Aveni
2026-07-12 12:55:03 -07:00
commit 63a3d99588
23 changed files with 3769 additions and 0 deletions
+184
View File
@@ -0,0 +1,184 @@
syntax = "proto3";
package camino;
import "camino/schema.proto";
import "quixos/refs.proto";
service CaminoService {
rpc RegisterSchema(RegisterSchemaRequest) returns (RegisterSchemaResponse);
rpc ListClasses(ListClassesRequest) returns (ListClassesResponse);
rpc CreateObject(CreateObjectRequest) returns (CreateObjectResponse);
rpc GetObject(GetObjectRequest) returns (GetObjectResponse);
rpc SetField(SetFieldRequest) returns (SetFieldResponse);
rpc AddEdge(AddEdgeRequest) returns (AddEdgeResponse);
rpc ListEdges(ListEdgesRequest) returns (ListEdgesResponse);
rpc RemoveEdge(RemoveEdgeRequest) returns (RemoveEdgeResponse);
rpc ListOps(ListOpsRequest) returns (ListOpsResponse);
rpc WatchObject(WatchObjectRequest) returns (stream WatchObjectEvent);
}
message RegisterSchemaRequest {
string source_file = 1;
}
message RegisterSchemaResponse {
repeated string class_ids = 1;
repeated ClassSchema classes = 2;
}
message ListClassesRequest {}
message RegisteredClass {
string id = 1;
ClassSchema schema = 2;
}
message ListClassesResponse {
repeated RegisteredClass classes = 1;
}
message NullValue {}
message ObjectValue {
map<string, Value> fields = 1;
}
message ListValue {
repeated Value values = 1;
}
message RefValue {
string object_id = 1;
}
message CrdtValue {
string type = 1;
string encoding = 2;
bytes payload = 3;
}
message Value {
oneof kind {
NullValue null_value = 1;
bool bool_value = 2;
double number_value = 3;
string string_value = 4;
string integer_value = 5;
bytes bytes_value = 6;
ObjectValue object_value = 7;
ListValue list_value = 8;
RefValue ref_value = 9;
CrdtValue crdt_value = 10;
}
}
message CreateObjectRequest {
string class_id = 1;
map<string, Value> fields = 2;
}
message CreateObjectResponse {
CaminoObject object = 1;
}
message GetObjectRequest {
string object_id = 1;
}
message GetObjectResponse {
CaminoObject object = 1;
}
message SetFieldRequest {
string object_id = 1;
string field_name = 2;
Value value = 3;
}
message SetFieldResponse {
CaminoObject object = 1;
}
message AddEdgeRequest {
string from_object_id = 1;
string source_field = 2;
string to_object_id = 3;
map<string, Value> fields = 4;
optional int32 ordinal = 5;
}
message AddEdgeResponse {
CaminoEdge edge = 1;
}
message ListEdgesRequest {
string object_id = 1;
}
message ListEdgesResponse {
repeated CaminoEdge edges = 1;
}
message RemoveEdgeRequest {
string edge_id = 1;
}
message RemoveEdgeResponse {
string edge_id = 1;
}
message ListOpsRequest {
string object_id = 1;
}
message ListOpsResponse {
repeated CaminoOp ops = 1;
}
message WatchObjectRequest {
string object_id = 1;
string after_op_id = 2;
bool include_snapshot = 3;
}
message WatchObjectEvent {
string object_id = 1;
CaminoObject snapshot = 2;
CaminoOp op = 3;
}
message CaminoObject {
string id = 1;
string class_id = 2;
uint32 schema_version = 3;
string created_at = 4;
string updated_at = 5;
map<string, Value> fields = 6;
map<string, uint64> field_revisions = 7;
map<string, string> field_conflicts = 8;
}
message CaminoEdge {
string id = 1;
string edge_type_id = 2;
string from_object_id = 3;
string to_object_id = 4;
string source_field = 5;
string cardinality = 6;
string inverse = 7;
map<string, Value> fields = 8;
optional int32 ordinal = 9;
string created_at = 10;
string updated_at = 11;
}
message CaminoOp {
string id = 1;
string object_id = 2;
string op_kind = 3;
Value payload = 4;
string actor = 5;
quixos.FunctionRef function_ref = 6;
string created_at = 7;
}
+52
View File
@@ -0,0 +1,52 @@
syntax = "proto3";
package camino;
import "google/protobuf/descriptor.proto";
import "camino/schema.proto";
import "quixos/refs.proto";
extend google.protobuf.FileOptions {
string schema_namespace = 51000;
string schema_version = 51001;
}
extend google.protobuf.MessageOptions {
ClassOptions class = 51010;
repeated MethodOptions method = 51011;
repeated MigrationOptions migration = 51012;
}
extend google.protobuf.FieldOptions {
ConflictStrategy conflict = 51020;
EdgeOptions edge = 51021;
FieldStorage field_storage = 51022;
FieldOps field_ops = 51023;
}
extend google.protobuf.MethodOptions {
quixos.FunctionRef impl = 51030;
}
message ClassOptions {
uint32 version = 1;
SymbolRef id = 2;
}
message EdgeOptions {
SymbolRef id = 1;
SymbolRef target = 2;
Cardinality cardinality = 3;
string inverse = 4;
}
message MethodOptions {
string name = 1;
quixos.FunctionRef function = 2;
}
message MigrationOptions {
uint32 from_version = 1;
uint32 to_version = 2;
quixos.FunctionRef function = 3;
}
+155
View File
@@ -0,0 +1,155 @@
syntax = "proto3";
package camino;
import "quixos/refs.proto";
message SymbolRef {
string namespace = 1;
string name = 2;
string version = 3;
string hash = 4;
}
enum ConflictStrategy {
CONFLICT_STRATEGY_UNSPECIFIED = 0;
REPLACE = 1;
PRESERVE_CONFLICTS = 2;
CRDT = 3;
}
enum Cardinality {
CARDINALITY_UNSPECIFIED = 0;
OPTIONAL_ONE = 1;
EXACTLY_ONE = 2;
MANY = 3;
MANY_UNIQUE = 4;
MANY_ORDERED = 5;
}
enum DocRefStrength {
DOC_REF_STRENGTH_UNSPECIFIED = 0;
SOFT_REF = 1;
PROJECTED_EDGE = 2;
}
enum FieldStorageKind {
FIELD_STORAGE_KIND_UNSPECIFIED = 0;
STORED = 1;
DERIVED = 2;
LAZY = 3;
EXTERNAL = 4;
}
message Ref {
string object_id = 1;
}
message CustomField {}
message WatchStartResult {
string watch_id = 1;
}
message WatchStopRequest {
string watch_id = 1;
}
message WatchStopResult {}
message CrdtText {
bytes payload = 1;
}
message CrdtRichText {
bytes payload = 1;
}
message CrdtJson {
bytes payload = 1;
}
message ClassSchema {
SymbolRef id = 1;
uint32 version = 2;
repeated FieldSchema fields = 3;
repeated EdgeSchema edges = 4;
repeated MethodSchema methods = 5;
repeated MigrationSpec migrations = 6;
string source_file = 7;
string proto_message = 8;
repeated OperationServiceSchema operation_services = 9;
}
message FieldSchema {
string name = 1;
uint32 tag = 2;
TypeRef type = 3;
ConflictStrategy conflict = 4;
bool repeated = 5;
bool optional = 6;
FieldStorage storage = 7;
FieldOps ops = 8;
}
message FieldStorage {
FieldStorageKind kind = 1;
quixos.FunctionRef resolver = 2;
bool cache = 3;
}
message TypeRef {
string proto_type = 1;
SymbolRef symbol = 2;
}
enum FieldImplementation {
FIELD_IMPLEMENTATION_UNSPECIFIED = 0;
SERVICE = 1;
}
message FieldOps {
FieldImplementation implementation = 1;
string service = 2;
}
message EdgeSchema {
SymbolRef id = 1;
string source_field = 2;
SymbolRef from_class = 3;
SymbolRef to_class = 4;
Cardinality cardinality = 5;
string inverse = 6;
repeated FieldSchema fields = 7;
}
message MethodSchema {
string name = 1;
quixos.FunctionRef function = 2;
}
message MigrationSpec {
uint32 from_version = 1;
uint32 to_version = 2;
quixos.FunctionRef function = 3;
}
message OperationSchema {
string name = 1;
TypeRef input_type = 2;
TypeRef output_type = 3;
quixos.FunctionRef function = 4;
}
message OperationServiceSchema {
string name = 1;
string full_name = 2;
repeated OperationSchema operations = 3;
}
message DocRefDeclaration {
string local_name = 1;
SymbolRef type = 2;
SymbolRef target_class = 3;
DocRefStrength strength = 4;
}