Move quixos protocol to repository root
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package quixos.orch;
|
||||
|
||||
import "camino/api.proto";
|
||||
import "quixos/package.proto";
|
||||
import "quixos/refs.proto";
|
||||
|
||||
service OrchestratorRuntime {
|
||||
rpc InvokeFunction(InvokeFunctionRequest) returns (InvokeFunctionResponse);
|
||||
rpc ListPackageDescriptors(ListPackageDescriptorsRequest) returns (ListPackageDescriptorsResponse);
|
||||
rpc ListPackageRuntimes(ListPackageRuntimesRequest) returns (ListPackageRuntimesResponse);
|
||||
rpc ListActivations(ListActivationsRequest) returns (ListActivationsResponse);
|
||||
rpc CloseActivation(CloseActivationRequest) returns (CloseActivationResponse);
|
||||
}
|
||||
|
||||
message InvokeFunctionRequest {
|
||||
quixos.FunctionRef function = 1;
|
||||
string object_id = 2;
|
||||
map<string, camino.Value> input = 3;
|
||||
}
|
||||
|
||||
message InvokeFunctionResponse {
|
||||
string invocation_id = 1;
|
||||
Activation activation = 2;
|
||||
bool ok = 3;
|
||||
camino.Value result = 4;
|
||||
string error = 5;
|
||||
}
|
||||
|
||||
message ListActivationsRequest {}
|
||||
|
||||
message ListPackageDescriptorsRequest {}
|
||||
|
||||
message ListPackageDescriptorsResponse {
|
||||
repeated quixos.PackageDescriptor descriptors = 1;
|
||||
}
|
||||
|
||||
message ListPackageRuntimesRequest {}
|
||||
|
||||
message ListPackageRuntimesResponse {
|
||||
repeated PackageRuntimeStatus runtimes = 1;
|
||||
}
|
||||
|
||||
message ListActivationsResponse {
|
||||
repeated Activation activations = 1;
|
||||
}
|
||||
|
||||
message CloseActivationRequest {
|
||||
string activation_id = 1;
|
||||
string reason = 2;
|
||||
}
|
||||
|
||||
message CloseActivationResponse {
|
||||
Activation activation = 1;
|
||||
}
|
||||
|
||||
message Activation {
|
||||
string activation_id = 1;
|
||||
quixos.FunctionRef function = 2;
|
||||
string object_id = 3;
|
||||
string state = 4;
|
||||
uint32 demand = 5;
|
||||
string opened_at = 6;
|
||||
string last_used_at = 7;
|
||||
string idle_deadline_at = 8;
|
||||
string closed_at = 9;
|
||||
string close_reason = 10;
|
||||
}
|
||||
|
||||
message PackageRuntimeStatus {
|
||||
string runtime_key = 1;
|
||||
string package_namespace = 2;
|
||||
string package_name = 3;
|
||||
uint32 descriptor_version = 4;
|
||||
string source_repo = 5;
|
||||
string server_installable = 6;
|
||||
string source_path = 7;
|
||||
string server_path = 8;
|
||||
uint32 pid = 9;
|
||||
string state = 10;
|
||||
string started_at = 11;
|
||||
string last_handshake_at = 12;
|
||||
string runtime_protocol_version = 13;
|
||||
uint32 advertised_function_count = 14;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package quixos;
|
||||
|
||||
import "camino/schema.proto";
|
||||
import "quixos/refs.proto";
|
||||
|
||||
message PackageRef {
|
||||
string package_namespace = 1;
|
||||
string package_name = 2;
|
||||
uint32 descriptor_version = 3;
|
||||
string version_ref = 4;
|
||||
}
|
||||
|
||||
message PackageDescriptor {
|
||||
string package_namespace = 1;
|
||||
string package_name = 2;
|
||||
uint32 descriptor_version = 3;
|
||||
uint32 interface_compatible_back_to = 4;
|
||||
uint32 runner_compatible_back_to = 5;
|
||||
string source_repo = 6;
|
||||
string source_ref = 7;
|
||||
string resolved_source_ref = 8;
|
||||
string server_installable = 9;
|
||||
string runtime_protocol_version = 10;
|
||||
repeated ClassExport class_exports = 11;
|
||||
repeated FunctionExport function_exports = 12;
|
||||
repeated ComponentExport component_exports = 13;
|
||||
repeated SidecarExport sidecar_exports = 14;
|
||||
repeated PackageDependency dependencies = 15;
|
||||
}
|
||||
|
||||
enum FunctionCapabilityKind {
|
||||
FUNCTION_CAPABILITY_KIND_UNSPECIFIED = 0;
|
||||
METHOD = 1;
|
||||
FIELD_RESOLVER = 2;
|
||||
MIGRATION = 3;
|
||||
}
|
||||
|
||||
message ClassExport {
|
||||
camino.SymbolRef class_id = 1;
|
||||
string source_file = 2;
|
||||
}
|
||||
|
||||
message FunctionExport {
|
||||
FunctionRef function = 1;
|
||||
string input_type = 2;
|
||||
string output_type = 3;
|
||||
uint32 interface_version = 4;
|
||||
uint32 interface_compatible_back_to = 5;
|
||||
FunctionCapabilityKind capability_kind = 6;
|
||||
}
|
||||
|
||||
message ComponentExport {
|
||||
string symbol = 1;
|
||||
string props_type = 2;
|
||||
repeated camino.SymbolRef supported_classes = 3;
|
||||
}
|
||||
|
||||
message SidecarExport {
|
||||
string symbol = 1;
|
||||
string side_effect_mode = 2;
|
||||
}
|
||||
|
||||
message PackageDependency {
|
||||
PackageRef package = 1;
|
||||
uint32 interface_compatible_back_to = 2;
|
||||
bool refactor_required = 3;
|
||||
string compatibility_note = 4;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package quixos;
|
||||
|
||||
message FunctionRef {
|
||||
string package_namespace = 1;
|
||||
string package_name = 2;
|
||||
string symbol = 3;
|
||||
string version_ref = 4;
|
||||
string operation = 5;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package quixos.runtime;
|
||||
|
||||
import "camino/api.proto";
|
||||
import "quixos/refs.proto";
|
||||
|
||||
service PackageRuntime {
|
||||
rpc Handshake(HandshakeRequest) returns (HandshakeResponse);
|
||||
rpc Invoke(InvokeRequest) returns (InvokeResponse);
|
||||
}
|
||||
|
||||
message HandshakeRequest {
|
||||
string orch_protocol_version = 1;
|
||||
}
|
||||
|
||||
message HandshakeResponse {
|
||||
string package_namespace = 1;
|
||||
string package_name = 2;
|
||||
string runtime_protocol_version = 3;
|
||||
repeated quixos.FunctionRef functions = 4;
|
||||
}
|
||||
|
||||
message InvokeRequest {
|
||||
string invocation_id = 1;
|
||||
quixos.FunctionRef function = 2;
|
||||
string object_id = 3;
|
||||
map<string, camino.Value> input = 4;
|
||||
}
|
||||
|
||||
message InvokeResponse {
|
||||
bool ok = 1;
|
||||
camino.Value result = 2;
|
||||
string error = 3;
|
||||
}
|
||||
Reference in New Issue
Block a user