diff --git a/auth/grants.go b/auth/grants.go index e50e703ec..4fe7c57f5 100644 --- a/auth/grants.go +++ b/auth/grants.go @@ -581,6 +581,8 @@ type AgentGrant struct { Admin bool `json:"admin,omitempty"` // SimulationAdmin grants access to manage simulations and scenarios for evaluating agents. SimulationAdmin bool `json:"simulationAdmin,omitempty"` + // DatabaseAdmin grants access to a project's agent databases (AgentDB). + DatabaseAdmin bool `json:"databaseAdmin,omitempty"` } func (s *AgentGrant) Clone() *AgentGrant { @@ -600,6 +602,7 @@ func (s *AgentGrant) MarshalLogObject(e zapcore.ObjectEncoder) error { e.AddBool("Admin", s.Admin) e.AddBool("SimulationAdmin", s.SimulationAdmin) + e.AddBool("DatabaseAdmin", s.DatabaseAdmin) return nil } diff --git a/livekit/livekit_agent_simulation.twirp.go b/livekit/livekit_agent_simulation.twirp.go index ea1e91970..a49b0aa75 100644 --- a/livekit/livekit_agent_simulation.twirp.go +++ b/livekit/livekit_agent_simulation.twirp.go @@ -1897,7 +1897,7 @@ func (s *agentSimulationServer) serveCreateScenarioFromSessionProtobuf(ctx conte } func (s *agentSimulationServer) ServiceDescriptor() ([]byte, int) { - return twirpFileDescriptor9, 0 + return twirpFileDescriptor10, 0 } func (s *agentSimulationServer) ProtocGenTwirpVersion() string { @@ -1911,7 +1911,7 @@ func (s *agentSimulationServer) PathPrefix() string { return baseServicePath(s.pathPrefix, "livekit", "AgentSimulation") } -var twirpFileDescriptor9 = []byte{ +var twirpFileDescriptor10 = []byte{ // 3454 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xcd, 0x6f, 0x1b, 0x49, 0x76, 0x37, 0xbf, 0xc9, 0xc7, 0x4f, 0x95, 0x28, 0x89, 0xee, 0xb1, 0xc7, 0xb6, 0xbc, 0xde, 0x75, diff --git a/livekit/livekit_agentdb.pb.go b/livekit/livekit_agentdb.pb.go new file mode 100644 index 000000000..f488400ac --- /dev/null +++ b/livekit/livekit_agentdb.pb.go @@ -0,0 +1,2399 @@ +// Copyright 2026 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v7.35.1 +// source: livekit_agentdb.proto + +package livekit + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AgentDB_Wire_QueryLang int32 + +const ( + AgentDB_Wire_SQL AgentDB_Wire_QueryLang = 0 +) + +// Enum value maps for AgentDB_Wire_QueryLang. +var ( + AgentDB_Wire_QueryLang_name = map[int32]string{ + 0: "SQL", + } + AgentDB_Wire_QueryLang_value = map[string]int32{ + "SQL": 0, + } +) + +func (x AgentDB_Wire_QueryLang) Enum() *AgentDB_Wire_QueryLang { + p := new(AgentDB_Wire_QueryLang) + *p = x + return p +} + +func (x AgentDB_Wire_QueryLang) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AgentDB_Wire_QueryLang) Descriptor() protoreflect.EnumDescriptor { + return file_livekit_agentdb_proto_enumTypes[0].Descriptor() +} + +func (AgentDB_Wire_QueryLang) Type() protoreflect.EnumType { + return &file_livekit_agentdb_proto_enumTypes[0] +} + +func (x AgentDB_Wire_QueryLang) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AgentDB_Wire_QueryLang.Descriptor instead. +func (AgentDB_Wire_QueryLang) EnumDescriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 0} +} + +type AgentDB_Wire_ValueType int32 + +const ( + AgentDB_Wire_NULL AgentDB_Wire_ValueType = 0 + AgentDB_Wire_INT AgentDB_Wire_ValueType = 1 + AgentDB_Wire_DOUBLE AgentDB_Wire_ValueType = 2 + AgentDB_Wire_TEXT AgentDB_Wire_ValueType = 3 + AgentDB_Wire_BLOB AgentDB_Wire_ValueType = 4 +) + +// Enum value maps for AgentDB_Wire_ValueType. +var ( + AgentDB_Wire_ValueType_name = map[int32]string{ + 0: "NULL", + 1: "INT", + 2: "DOUBLE", + 3: "TEXT", + 4: "BLOB", + } + AgentDB_Wire_ValueType_value = map[string]int32{ + "NULL": 0, + "INT": 1, + "DOUBLE": 2, + "TEXT": 3, + "BLOB": 4, + } +) + +func (x AgentDB_Wire_ValueType) Enum() *AgentDB_Wire_ValueType { + p := new(AgentDB_Wire_ValueType) + *p = x + return p +} + +func (x AgentDB_Wire_ValueType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AgentDB_Wire_ValueType) Descriptor() protoreflect.EnumDescriptor { + return file_livekit_agentdb_proto_enumTypes[1].Descriptor() +} + +func (AgentDB_Wire_ValueType) Type() protoreflect.EnumType { + return &file_livekit_agentdb_proto_enumTypes[1] +} + +func (x AgentDB_Wire_ValueType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AgentDB_Wire_ValueType.Descriptor instead. +func (AgentDB_Wire_ValueType) EnumDescriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 1} +} + +// Nested so that names like Value and Ping need not be unique across the +// livekit package. `tip` throughout is the latest durable commit sequence. +type AgentDB struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB) Reset() { + *x = AgentDB{} + mi := &file_livekit_agentdb_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB) ProtoMessage() {} + +func (x *AgentDB) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB.ProtoReflect.Descriptor instead. +func (*AgentDB) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0} +} + +type AgentDB_CreateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Region string `protobuf:"bytes,1,opt,name=region,proto3" json:"region,omitempty"` + // Unset: never expires, and expires_at is then 0 everywhere. + // Otherwise clamped to the server cap, and never extended. + TtlSeconds int64 `protobuf:"varint,2,opt,name=ttl_seconds,json=ttlSeconds,proto3" json:"ttl_seconds,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_CreateRequest) Reset() { + *x = AgentDB_CreateRequest{} + mi := &file_livekit_agentdb_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_CreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_CreateRequest) ProtoMessage() {} + +func (x *AgentDB_CreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_CreateRequest.ProtoReflect.Descriptor instead. +func (*AgentDB_CreateRequest) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *AgentDB_CreateRequest) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *AgentDB_CreateRequest) GetTtlSeconds() int64 { + if x != nil { + return x.TtlSeconds + } + return 0 +} + +type AgentDB_CreateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + DatabaseId string `protobuf:"bytes,1,opt,name=database_id,json=databaseId,proto3" json:"database_id,omitempty"` // "DB_..." + ExpiresAt int64 `protobuf:"varint,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_CreateResponse) Reset() { + *x = AgentDB_CreateResponse{} + mi := &file_livekit_agentdb_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_CreateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_CreateResponse) ProtoMessage() {} + +func (x *AgentDB_CreateResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_CreateResponse.ProtoReflect.Descriptor instead. +func (*AgentDB_CreateResponse) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *AgentDB_CreateResponse) GetDatabaseId() string { + if x != nil { + return x.DatabaseId + } + return "" +} + +func (x *AgentDB_CreateResponse) GetExpiresAt() int64 { + if x != nil { + return x.ExpiresAt + } + return 0 +} + +type AgentDB_GetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + DatabaseId string `protobuf:"bytes,1,opt,name=database_id,json=databaseId,proto3" json:"database_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_GetRequest) Reset() { + *x = AgentDB_GetRequest{} + mi := &file_livekit_agentdb_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_GetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_GetRequest) ProtoMessage() {} + +func (x *AgentDB_GetRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_GetRequest.ProtoReflect.Descriptor instead. +func (*AgentDB_GetRequest) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *AgentDB_GetRequest) GetDatabaseId() string { + if x != nil { + return x.DatabaseId + } + return "" +} + +type AgentDB_ListRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // server-clamped + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_ListRequest) Reset() { + *x = AgentDB_ListRequest{} + mi := &file_livekit_agentdb_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_ListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_ListRequest) ProtoMessage() {} + +func (x *AgentDB_ListRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_ListRequest.ProtoReflect.Descriptor instead. +func (*AgentDB_ListRequest) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 3} +} + +func (x *AgentDB_ListRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *AgentDB_ListRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +type AgentDB_ListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Databases []*AgentDB_AgentDatabase `protobuf:"bytes,1,rep,name=databases,proto3" json:"databases,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // empty when exhausted + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_ListResponse) Reset() { + *x = AgentDB_ListResponse{} + mi := &file_livekit_agentdb_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_ListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_ListResponse) ProtoMessage() {} + +func (x *AgentDB_ListResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_ListResponse.ProtoReflect.Descriptor instead. +func (*AgentDB_ListResponse) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 4} +} + +func (x *AgentDB_ListResponse) GetDatabases() []*AgentDB_AgentDatabase { + if x != nil { + return x.Databases + } + return nil +} + +func (x *AgentDB_ListResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +// One database, as get and list both report it. +type AgentDB_AgentDatabase struct { + state protoimpl.MessageState `protogen:"open.v1"` + DatabaseId string `protobuf:"bytes,1,opt,name=database_id,json=databaseId,proto3" json:"database_id,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` + CreatedAt int64 `protobuf:"varint,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + ExpiresAt int64 `protobuf:"varint,4,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + Tip int64 `protobuf:"varint,5,opt,name=tip,proto3" json:"tip,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_AgentDatabase) Reset() { + *x = AgentDB_AgentDatabase{} + mi := &file_livekit_agentdb_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_AgentDatabase) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_AgentDatabase) ProtoMessage() {} + +func (x *AgentDB_AgentDatabase) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_AgentDatabase.ProtoReflect.Descriptor instead. +func (*AgentDB_AgentDatabase) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 5} +} + +func (x *AgentDB_AgentDatabase) GetDatabaseId() string { + if x != nil { + return x.DatabaseId + } + return "" +} + +func (x *AgentDB_AgentDatabase) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *AgentDB_AgentDatabase) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *AgentDB_AgentDatabase) GetExpiresAt() int64 { + if x != nil { + return x.ExpiresAt + } + return 0 +} + +func (x *AgentDB_AgentDatabase) GetTip() int64 { + if x != nil { + return x.Tip + } + return 0 +} + +type AgentDB_DeleteRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + DatabaseId string `protobuf:"bytes,1,opt,name=database_id,json=databaseId,proto3" json:"database_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_DeleteRequest) Reset() { + *x = AgentDB_DeleteRequest{} + mi := &file_livekit_agentdb_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_DeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_DeleteRequest) ProtoMessage() {} + +func (x *AgentDB_DeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_DeleteRequest.ProtoReflect.Descriptor instead. +func (*AgentDB_DeleteRequest) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 6} +} + +func (x *AgentDB_DeleteRequest) GetDatabaseId() string { + if x != nil { + return x.DatabaseId + } + return "" +} + +type AgentDB_DeleteResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_DeleteResponse) Reset() { + *x = AgentDB_DeleteResponse{} + mi := &file_livekit_agentdb_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_DeleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_DeleteResponse) ProtoMessage() {} + +func (x *AgentDB_DeleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_DeleteResponse.ProtoReflect.Descriptor instead. +func (*AgentDB_DeleteResponse) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 7} +} + +type AgentDB_DumpRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + DatabaseId string `protobuf:"bytes,1,opt,name=database_id,json=databaseId,proto3" json:"database_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_DumpRequest) Reset() { + *x = AgentDB_DumpRequest{} + mi := &file_livekit_agentdb_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_DumpRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_DumpRequest) ProtoMessage() {} + +func (x *AgentDB_DumpRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_DumpRequest.ProtoReflect.Descriptor instead. +func (*AgentDB_DumpRequest) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 8} +} + +func (x *AgentDB_DumpRequest) GetDatabaseId() string { + if x != nil { + return x.DatabaseId + } + return "" +} + +type AgentDB_DumpResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + DownloadUrl string `protobuf:"bytes,1,opt,name=download_url,json=downloadUrl,proto3" json:"download_url,omitempty"` // pre-authenticated object-storage URL + ExpiresAt int64 `protobuf:"varint,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` // of the URL, not the database + Tip int64 `protobuf:"varint,3,opt,name=tip,proto3" json:"tip,omitempty"` // what the dump is consistent at + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_DumpResponse) Reset() { + *x = AgentDB_DumpResponse{} + mi := &file_livekit_agentdb_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_DumpResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_DumpResponse) ProtoMessage() {} + +func (x *AgentDB_DumpResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_DumpResponse.ProtoReflect.Descriptor instead. +func (*AgentDB_DumpResponse) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 9} +} + +func (x *AgentDB_DumpResponse) GetDownloadUrl() string { + if x != nil { + return x.DownloadUrl + } + return "" +} + +func (x *AgentDB_DumpResponse) GetExpiresAt() int64 { + if x != nil { + return x.ExpiresAt + } + return 0 +} + +func (x *AgentDB_DumpResponse) GetTip() int64 { + if x != nil { + return x.Tip + } + return 0 +} + +// Data plane: one WebSocket per database, one message per frame, correlated +// by a client-chosen request_id. Result batches are paced by Credit, so the +// server never sends more un-consumed batches than granted. +type AgentDB_Wire struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire) Reset() { + *x = AgentDB_Wire{} + mi := &file_livekit_agentdb_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire) ProtoMessage() {} + +func (x *AgentDB_Wire) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10} +} + +type AgentDB_Wire_ClientMessage struct { + state protoimpl.MessageState `protogen:"open.v1"` + RequestId uint32 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // Types that are valid to be assigned to Message: + // + // *AgentDB_Wire_ClientMessage_Hello + // *AgentDB_Wire_ClientMessage_Exec + // *AgentDB_Wire_ClientMessage_Query + // *AgentDB_Wire_ClientMessage_Batch + // *AgentDB_Wire_ClientMessage_Begin + // *AgentDB_Wire_ClientMessage_Commit + // *AgentDB_Wire_ClientMessage_Rollback + // *AgentDB_Wire_ClientMessage_Cancel + // *AgentDB_Wire_ClientMessage_Credit + // *AgentDB_Wire_ClientMessage_Ping + Message isAgentDB_Wire_ClientMessage_Message `protobuf_oneof:"message"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_ClientMessage) Reset() { + *x = AgentDB_Wire_ClientMessage{} + mi := &file_livekit_agentdb_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_ClientMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_ClientMessage) ProtoMessage() {} + +func (x *AgentDB_Wire_ClientMessage) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_ClientMessage.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_ClientMessage) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 0} +} + +func (x *AgentDB_Wire_ClientMessage) GetRequestId() uint32 { + if x != nil { + return x.RequestId + } + return 0 +} + +func (x *AgentDB_Wire_ClientMessage) GetMessage() isAgentDB_Wire_ClientMessage_Message { + if x != nil { + return x.Message + } + return nil +} + +func (x *AgentDB_Wire_ClientMessage) GetHello() *AgentDB_Wire_Hello { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ClientMessage_Hello); ok { + return x.Hello + } + } + return nil +} + +func (x *AgentDB_Wire_ClientMessage) GetExec() *AgentDB_Wire_Statement { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ClientMessage_Exec); ok { + return x.Exec + } + } + return nil +} + +func (x *AgentDB_Wire_ClientMessage) GetQuery() *AgentDB_Wire_Statement { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ClientMessage_Query); ok { + return x.Query + } + } + return nil +} + +func (x *AgentDB_Wire_ClientMessage) GetBatch() *AgentDB_Wire_Batch { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ClientMessage_Batch); ok { + return x.Batch + } + } + return nil +} + +func (x *AgentDB_Wire_ClientMessage) GetBegin() *AgentDB_Wire_Begin { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ClientMessage_Begin); ok { + return x.Begin + } + } + return nil +} + +func (x *AgentDB_Wire_ClientMessage) GetCommit() *AgentDB_Wire_Commit { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ClientMessage_Commit); ok { + return x.Commit + } + } + return nil +} + +func (x *AgentDB_Wire_ClientMessage) GetRollback() *AgentDB_Wire_Rollback { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ClientMessage_Rollback); ok { + return x.Rollback + } + } + return nil +} + +func (x *AgentDB_Wire_ClientMessage) GetCancel() *AgentDB_Wire_Cancel { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ClientMessage_Cancel); ok { + return x.Cancel + } + } + return nil +} + +func (x *AgentDB_Wire_ClientMessage) GetCredit() *AgentDB_Wire_Credit { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ClientMessage_Credit); ok { + return x.Credit + } + } + return nil +} + +func (x *AgentDB_Wire_ClientMessage) GetPing() *AgentDB_Wire_Ping { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ClientMessage_Ping); ok { + return x.Ping + } + } + return nil +} + +type isAgentDB_Wire_ClientMessage_Message interface { + isAgentDB_Wire_ClientMessage_Message() +} + +type AgentDB_Wire_ClientMessage_Hello struct { + Hello *AgentDB_Wire_Hello `protobuf:"bytes,2,opt,name=hello,proto3,oneof"` // must be first on the socket +} + +type AgentDB_Wire_ClientMessage_Exec struct { + Exec *AgentDB_Wire_Statement `protobuf:"bytes,3,opt,name=exec,proto3,oneof"` // answers ExecResult +} + +type AgentDB_Wire_ClientMessage_Query struct { + Query *AgentDB_Wire_Statement `protobuf:"bytes,4,opt,name=query,proto3,oneof"` // answers Columns + ColumnBatch* + Done +} + +type AgentDB_Wire_ClientMessage_Batch struct { + Batch *AgentDB_Wire_Batch `protobuf:"bytes,5,opt,name=batch,proto3,oneof"` +} + +type AgentDB_Wire_ClientMessage_Begin struct { + Begin *AgentDB_Wire_Begin `protobuf:"bytes,6,opt,name=begin,proto3,oneof"` +} + +type AgentDB_Wire_ClientMessage_Commit struct { + Commit *AgentDB_Wire_Commit `protobuf:"bytes,7,opt,name=commit,proto3,oneof"` +} + +type AgentDB_Wire_ClientMessage_Rollback struct { + Rollback *AgentDB_Wire_Rollback `protobuf:"bytes,8,opt,name=rollback,proto3,oneof"` +} + +type AgentDB_Wire_ClientMessage_Cancel struct { + Cancel *AgentDB_Wire_Cancel `protobuf:"bytes,9,opt,name=cancel,proto3,oneof"` +} + +type AgentDB_Wire_ClientMessage_Credit struct { + Credit *AgentDB_Wire_Credit `protobuf:"bytes,10,opt,name=credit,proto3,oneof"` +} + +type AgentDB_Wire_ClientMessage_Ping struct { + Ping *AgentDB_Wire_Ping `protobuf:"bytes,11,opt,name=ping,proto3,oneof"` +} + +func (*AgentDB_Wire_ClientMessage_Hello) isAgentDB_Wire_ClientMessage_Message() {} + +func (*AgentDB_Wire_ClientMessage_Exec) isAgentDB_Wire_ClientMessage_Message() {} + +func (*AgentDB_Wire_ClientMessage_Query) isAgentDB_Wire_ClientMessage_Message() {} + +func (*AgentDB_Wire_ClientMessage_Batch) isAgentDB_Wire_ClientMessage_Message() {} + +func (*AgentDB_Wire_ClientMessage_Begin) isAgentDB_Wire_ClientMessage_Message() {} + +func (*AgentDB_Wire_ClientMessage_Commit) isAgentDB_Wire_ClientMessage_Message() {} + +func (*AgentDB_Wire_ClientMessage_Rollback) isAgentDB_Wire_ClientMessage_Message() {} + +func (*AgentDB_Wire_ClientMessage_Cancel) isAgentDB_Wire_ClientMessage_Message() {} + +func (*AgentDB_Wire_ClientMessage_Credit) isAgentDB_Wire_ClientMessage_Message() {} + +func (*AgentDB_Wire_ClientMessage_Ping) isAgentDB_Wire_ClientMessage_Message() {} + +type AgentDB_Wire_ServerMessage struct { + state protoimpl.MessageState `protogen:"open.v1"` + RequestId uint32 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // Types that are valid to be assigned to Message: + // + // *AgentDB_Wire_ServerMessage_HelloOk + // *AgentDB_Wire_ServerMessage_Columns + // *AgentDB_Wire_ServerMessage_ColumnBatch + // *AgentDB_Wire_ServerMessage_ExecResult + // *AgentDB_Wire_ServerMessage_Done + // *AgentDB_Wire_ServerMessage_Error + // *AgentDB_Wire_ServerMessage_Pong + Message isAgentDB_Wire_ServerMessage_Message `protobuf_oneof:"message"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_ServerMessage) Reset() { + *x = AgentDB_Wire_ServerMessage{} + mi := &file_livekit_agentdb_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_ServerMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_ServerMessage) ProtoMessage() {} + +func (x *AgentDB_Wire_ServerMessage) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_ServerMessage.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_ServerMessage) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 1} +} + +func (x *AgentDB_Wire_ServerMessage) GetRequestId() uint32 { + if x != nil { + return x.RequestId + } + return 0 +} + +func (x *AgentDB_Wire_ServerMessage) GetMessage() isAgentDB_Wire_ServerMessage_Message { + if x != nil { + return x.Message + } + return nil +} + +func (x *AgentDB_Wire_ServerMessage) GetHelloOk() *AgentDB_Wire_HelloOk { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ServerMessage_HelloOk); ok { + return x.HelloOk + } + } + return nil +} + +func (x *AgentDB_Wire_ServerMessage) GetColumns() *AgentDB_Wire_Columns { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ServerMessage_Columns); ok { + return x.Columns + } + } + return nil +} + +func (x *AgentDB_Wire_ServerMessage) GetColumnBatch() *AgentDB_Wire_ColumnBatch { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ServerMessage_ColumnBatch); ok { + return x.ColumnBatch + } + } + return nil +} + +func (x *AgentDB_Wire_ServerMessage) GetExecResult() *AgentDB_Wire_ExecResult { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ServerMessage_ExecResult); ok { + return x.ExecResult + } + } + return nil +} + +func (x *AgentDB_Wire_ServerMessage) GetDone() *AgentDB_Wire_Done { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ServerMessage_Done); ok { + return x.Done + } + } + return nil +} + +func (x *AgentDB_Wire_ServerMessage) GetError() *AgentDB_Wire_Error { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ServerMessage_Error); ok { + return x.Error + } + } + return nil +} + +func (x *AgentDB_Wire_ServerMessage) GetPong() *AgentDB_Wire_Pong { + if x != nil { + if x, ok := x.Message.(*AgentDB_Wire_ServerMessage_Pong); ok { + return x.Pong + } + } + return nil +} + +type isAgentDB_Wire_ServerMessage_Message interface { + isAgentDB_Wire_ServerMessage_Message() +} + +type AgentDB_Wire_ServerMessage_HelloOk struct { + HelloOk *AgentDB_Wire_HelloOk `protobuf:"bytes,2,opt,name=hello_ok,json=helloOk,proto3,oneof"` +} + +type AgentDB_Wire_ServerMessage_Columns struct { + Columns *AgentDB_Wire_Columns `protobuf:"bytes,3,opt,name=columns,proto3,oneof"` +} + +type AgentDB_Wire_ServerMessage_ColumnBatch struct { + ColumnBatch *AgentDB_Wire_ColumnBatch `protobuf:"bytes,4,opt,name=column_batch,json=columnBatch,proto3,oneof"` +} + +type AgentDB_Wire_ServerMessage_ExecResult struct { + ExecResult *AgentDB_Wire_ExecResult `protobuf:"bytes,5,opt,name=exec_result,json=execResult,proto3,oneof"` +} + +type AgentDB_Wire_ServerMessage_Done struct { + Done *AgentDB_Wire_Done `protobuf:"bytes,6,opt,name=done,proto3,oneof"` +} + +type AgentDB_Wire_ServerMessage_Error struct { + Error *AgentDB_Wire_Error `protobuf:"bytes,7,opt,name=error,proto3,oneof"` +} + +type AgentDB_Wire_ServerMessage_Pong struct { + Pong *AgentDB_Wire_Pong `protobuf:"bytes,8,opt,name=pong,proto3,oneof"` +} + +func (*AgentDB_Wire_ServerMessage_HelloOk) isAgentDB_Wire_ServerMessage_Message() {} + +func (*AgentDB_Wire_ServerMessage_Columns) isAgentDB_Wire_ServerMessage_Message() {} + +func (*AgentDB_Wire_ServerMessage_ColumnBatch) isAgentDB_Wire_ServerMessage_Message() {} + +func (*AgentDB_Wire_ServerMessage_ExecResult) isAgentDB_Wire_ServerMessage_Message() {} + +func (*AgentDB_Wire_ServerMessage_Done) isAgentDB_Wire_ServerMessage_Message() {} + +func (*AgentDB_Wire_ServerMessage_Error) isAgentDB_Wire_ServerMessage_Message() {} + +func (*AgentDB_Wire_ServerMessage_Pong) isAgentDB_Wire_ServerMessage_Message() {} + +// SQLite's five storage classes. +type AgentDB_Wire_Value struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Value: + // + // *AgentDB_Wire_Value_NullValue + // *AgentDB_Wire_Value_IntValue + // *AgentDB_Wire_Value_DoubleValue + // *AgentDB_Wire_Value_TextValue + // *AgentDB_Wire_Value_BlobValue + Value isAgentDB_Wire_Value_Value `protobuf_oneof:"value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Value) Reset() { + *x = AgentDB_Wire_Value{} + mi := &file_livekit_agentdb_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Value) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Value) ProtoMessage() {} + +func (x *AgentDB_Wire_Value) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Value.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Value) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 2} +} + +func (x *AgentDB_Wire_Value) GetValue() isAgentDB_Wire_Value_Value { + if x != nil { + return x.Value + } + return nil +} + +func (x *AgentDB_Wire_Value) GetNullValue() bool { + if x != nil { + if x, ok := x.Value.(*AgentDB_Wire_Value_NullValue); ok { + return x.NullValue + } + } + return false +} + +func (x *AgentDB_Wire_Value) GetIntValue() int64 { + if x != nil { + if x, ok := x.Value.(*AgentDB_Wire_Value_IntValue); ok { + return x.IntValue + } + } + return 0 +} + +func (x *AgentDB_Wire_Value) GetDoubleValue() float64 { + if x != nil { + if x, ok := x.Value.(*AgentDB_Wire_Value_DoubleValue); ok { + return x.DoubleValue + } + } + return 0 +} + +func (x *AgentDB_Wire_Value) GetTextValue() string { + if x != nil { + if x, ok := x.Value.(*AgentDB_Wire_Value_TextValue); ok { + return x.TextValue + } + } + return "" +} + +func (x *AgentDB_Wire_Value) GetBlobValue() []byte { + if x != nil { + if x, ok := x.Value.(*AgentDB_Wire_Value_BlobValue); ok { + return x.BlobValue + } + } + return nil +} + +type isAgentDB_Wire_Value_Value interface { + isAgentDB_Wire_Value_Value() +} + +type AgentDB_Wire_Value_NullValue struct { + NullValue bool `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,oneof"` // always true when set +} + +type AgentDB_Wire_Value_IntValue struct { + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` +} + +type AgentDB_Wire_Value_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,proto3,oneof"` +} + +type AgentDB_Wire_Value_TextValue struct { + TextValue string `protobuf:"bytes,4,opt,name=text_value,json=textValue,proto3,oneof"` +} + +type AgentDB_Wire_Value_BlobValue struct { + BlobValue []byte `protobuf:"bytes,5,opt,name=blob_value,json=blobValue,proto3,oneof"` +} + +func (*AgentDB_Wire_Value_NullValue) isAgentDB_Wire_Value_Value() {} + +func (*AgentDB_Wire_Value_IntValue) isAgentDB_Wire_Value_Value() {} + +func (*AgentDB_Wire_Value_DoubleValue) isAgentDB_Wire_Value_Value() {} + +func (*AgentDB_Wire_Value_TextValue) isAgentDB_Wire_Value_Value() {} + +func (*AgentDB_Wire_Value_BlobValue) isAgentDB_Wire_Value_Value() {} + +type AgentDB_Wire_Statement struct { + state protoimpl.MessageState `protogen:"open.v1"` + Sql string `protobuf:"bytes,1,opt,name=sql,proto3" json:"sql,omitempty"` + Params []*AgentDB_Wire_Value `protobuf:"bytes,2,rep,name=params,proto3" json:"params,omitempty"` // positional + Lang AgentDB_Wire_QueryLang `protobuf:"varint,3,opt,name=lang,proto3,enum=livekit.AgentDB_Wire_QueryLang" json:"lang,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Statement) Reset() { + *x = AgentDB_Wire_Statement{} + mi := &file_livekit_agentdb_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Statement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Statement) ProtoMessage() {} + +func (x *AgentDB_Wire_Statement) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Statement.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Statement) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 3} +} + +func (x *AgentDB_Wire_Statement) GetSql() string { + if x != nil { + return x.Sql + } + return "" +} + +func (x *AgentDB_Wire_Statement) GetParams() []*AgentDB_Wire_Value { + if x != nil { + return x.Params + } + return nil +} + +func (x *AgentDB_Wire_Statement) GetLang() AgentDB_Wire_QueryLang { + if x != nil { + return x.Lang + } + return AgentDB_Wire_SQL +} + +type AgentDB_Wire_Batch struct { + state protoimpl.MessageState `protogen:"open.v1"` + Statements []*AgentDB_Wire_Statement `protobuf:"bytes,1,rep,name=statements,proto3" json:"statements,omitempty"` // applied atomically, in order + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Batch) Reset() { + *x = AgentDB_Wire_Batch{} + mi := &file_livekit_agentdb_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Batch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Batch) ProtoMessage() {} + +func (x *AgentDB_Wire_Batch) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Batch.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Batch) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 4} +} + +func (x *AgentDB_Wire_Batch) GetStatements() []*AgentDB_Wire_Statement { + if x != nil { + return x.Statements + } + return nil +} + +type AgentDB_Wire_Begin struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Begin) Reset() { + *x = AgentDB_Wire_Begin{} + mi := &file_livekit_agentdb_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Begin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Begin) ProtoMessage() {} + +func (x *AgentDB_Wire_Begin) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Begin.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Begin) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 5} +} + +type AgentDB_Wire_Commit struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Commit) Reset() { + *x = AgentDB_Wire_Commit{} + mi := &file_livekit_agentdb_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Commit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Commit) ProtoMessage() {} + +func (x *AgentDB_Wire_Commit) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Commit.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Commit) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 6} +} + +type AgentDB_Wire_Rollback struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Rollback) Reset() { + *x = AgentDB_Wire_Rollback{} + mi := &file_livekit_agentdb_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Rollback) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Rollback) ProtoMessage() {} + +func (x *AgentDB_Wire_Rollback) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Rollback.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Rollback) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 7} +} + +type AgentDB_Wire_Cancel struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Cancel) Reset() { + *x = AgentDB_Wire_Cancel{} + mi := &file_livekit_agentdb_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Cancel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Cancel) ProtoMessage() {} + +func (x *AgentDB_Wire_Cancel) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Cancel.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Cancel) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 8} +} + +type AgentDB_Wire_Credit struct { + state protoimpl.MessageState `protogen:"open.v1"` + Batches uint32 `protobuf:"varint,1,opt,name=batches,proto3" json:"batches,omitempty"` // additional batches the client can absorb + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Credit) Reset() { + *x = AgentDB_Wire_Credit{} + mi := &file_livekit_agentdb_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Credit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Credit) ProtoMessage() {} + +func (x *AgentDB_Wire_Credit) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Credit.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Credit) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 9} +} + +func (x *AgentDB_Wire_Credit) GetBatches() uint32 { + if x != nil { + return x.Batches + } + return 0 +} + +type AgentDB_Wire_Ping struct { + state protoimpl.MessageState `protogen:"open.v1"` + TimestampMs int64 `protobuf:"varint,1,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Ping) Reset() { + *x = AgentDB_Wire_Ping{} + mi := &file_livekit_agentdb_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Ping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Ping) ProtoMessage() {} + +func (x *AgentDB_Wire_Ping) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Ping.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Ping) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 10} +} + +func (x *AgentDB_Wire_Ping) GetTimestampMs() int64 { + if x != nil { + return x.TimestampMs + } + return 0 +} + +type AgentDB_Wire_Pong struct { + state protoimpl.MessageState `protogen:"open.v1"` + LastPingTimestampMs int64 `protobuf:"varint,1,opt,name=last_ping_timestamp_ms,json=lastPingTimestampMs,proto3" json:"last_ping_timestamp_ms,omitempty"` + TimestampMs int64 `protobuf:"varint,2,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Pong) Reset() { + *x = AgentDB_Wire_Pong{} + mi := &file_livekit_agentdb_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Pong) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Pong) ProtoMessage() {} + +func (x *AgentDB_Wire_Pong) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Pong.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Pong) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 11} +} + +func (x *AgentDB_Wire_Pong) GetLastPingTimestampMs() int64 { + if x != nil { + return x.LastPingTimestampMs + } + return 0 +} + +func (x *AgentDB_Wire_Pong) GetTimestampMs() int64 { + if x != nil { + return x.TimestampMs + } + return 0 +} + +type AgentDB_Wire_Hello struct { + state protoimpl.MessageState `protogen:"open.v1"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + DatabaseId string `protobuf:"bytes,2,opt,name=database_id,json=databaseId,proto3" json:"database_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Hello) Reset() { + *x = AgentDB_Wire_Hello{} + mi := &file_livekit_agentdb_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Hello) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Hello) ProtoMessage() {} + +func (x *AgentDB_Wire_Hello) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Hello.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Hello) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 12} +} + +func (x *AgentDB_Wire_Hello) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *AgentDB_Wire_Hello) GetDatabaseId() string { + if x != nil { + return x.DatabaseId + } + return "" +} + +type AgentDB_Wire_HelloOk struct { + state protoimpl.MessageState `protogen:"open.v1"` + Tip int64 `protobuf:"varint,1,opt,name=tip,proto3" json:"tip,omitempty"` + PingIntervalMs uint32 `protobuf:"varint,2,opt,name=ping_interval_ms,json=pingIntervalMs,proto3" json:"ping_interval_ms,omitempty"` + PingTimeoutMs uint32 `protobuf:"varint,3,opt,name=ping_timeout_ms,json=pingTimeoutMs,proto3" json:"ping_timeout_ms,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_HelloOk) Reset() { + *x = AgentDB_Wire_HelloOk{} + mi := &file_livekit_agentdb_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_HelloOk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_HelloOk) ProtoMessage() {} + +func (x *AgentDB_Wire_HelloOk) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_HelloOk.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_HelloOk) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 13} +} + +func (x *AgentDB_Wire_HelloOk) GetTip() int64 { + if x != nil { + return x.Tip + } + return 0 +} + +func (x *AgentDB_Wire_HelloOk) GetPingIntervalMs() uint32 { + if x != nil { + return x.PingIntervalMs + } + return 0 +} + +func (x *AgentDB_Wire_HelloOk) GetPingTimeoutMs() uint32 { + if x != nil { + return x.PingTimeoutMs + } + return 0 +} + +type AgentDB_Wire_Columns struct { + state protoimpl.MessageState `protogen:"open.v1"` + Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Columns) Reset() { + *x = AgentDB_Wire_Columns{} + mi := &file_livekit_agentdb_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Columns) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Columns) ProtoMessage() {} + +func (x *AgentDB_Wire_Columns) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Columns.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Columns) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 14} +} + +func (x *AgentDB_Wire_Columns) GetNames() []string { + if x != nil { + return x.Names + } + return nil +} + +// Values are typed per row, as SQLite types them, so a column may mix +// classes: walk `types` and take the next entry from the matching array. Text +// and blobs are concatenated with one exclusive end offset each, so value i +// is data[ends[i-1]:ends[i]] with 0 implied before the first. A NULL occupies +// a tag only. +type AgentDB_Wire_Column struct { + state protoimpl.MessageState `protogen:"open.v1"` + Types []byte `protobuf:"bytes,1,opt,name=types,proto3" json:"types,omitempty"` // one ValueType per row + Ints []int64 `protobuf:"zigzag64,2,rep,packed,name=ints,proto3" json:"ints,omitempty"` + Doubles []float64 `protobuf:"fixed64,3,rep,packed,name=doubles,proto3" json:"doubles,omitempty"` + TextData []byte `protobuf:"bytes,4,opt,name=text_data,json=textData,proto3" json:"text_data,omitempty"` + TextEnds []uint32 `protobuf:"varint,5,rep,packed,name=text_ends,json=textEnds,proto3" json:"text_ends,omitempty"` + BlobData []byte `protobuf:"bytes,6,opt,name=blob_data,json=blobData,proto3" json:"blob_data,omitempty"` + BlobEnds []uint32 `protobuf:"varint,7,rep,packed,name=blob_ends,json=blobEnds,proto3" json:"blob_ends,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Column) Reset() { + *x = AgentDB_Wire_Column{} + mi := &file_livekit_agentdb_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Column) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Column) ProtoMessage() {} + +func (x *AgentDB_Wire_Column) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Column.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Column) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 15} +} + +func (x *AgentDB_Wire_Column) GetTypes() []byte { + if x != nil { + return x.Types + } + return nil +} + +func (x *AgentDB_Wire_Column) GetInts() []int64 { + if x != nil { + return x.Ints + } + return nil +} + +func (x *AgentDB_Wire_Column) GetDoubles() []float64 { + if x != nil { + return x.Doubles + } + return nil +} + +func (x *AgentDB_Wire_Column) GetTextData() []byte { + if x != nil { + return x.TextData + } + return nil +} + +func (x *AgentDB_Wire_Column) GetTextEnds() []uint32 { + if x != nil { + return x.TextEnds + } + return nil +} + +func (x *AgentDB_Wire_Column) GetBlobData() []byte { + if x != nil { + return x.BlobData + } + return nil +} + +func (x *AgentDB_Wire_Column) GetBlobEnds() []uint32 { + if x != nil { + return x.BlobEnds + } + return nil +} + +type AgentDB_Wire_ColumnBatch struct { + state protoimpl.MessageState `protogen:"open.v1"` + Columns []*AgentDB_Wire_Column `protobuf:"bytes,1,rep,name=columns,proto3" json:"columns,omitempty"` // one per name in Columns + Rows uint32 `protobuf:"varint,2,opt,name=rows,proto3" json:"rows,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_ColumnBatch) Reset() { + *x = AgentDB_Wire_ColumnBatch{} + mi := &file_livekit_agentdb_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_ColumnBatch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_ColumnBatch) ProtoMessage() {} + +func (x *AgentDB_Wire_ColumnBatch) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_ColumnBatch.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_ColumnBatch) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 16} +} + +func (x *AgentDB_Wire_ColumnBatch) GetColumns() []*AgentDB_Wire_Column { + if x != nil { + return x.Columns + } + return nil +} + +func (x *AgentDB_Wire_ColumnBatch) GetRows() uint32 { + if x != nil { + return x.Rows + } + return 0 +} + +type AgentDB_Wire_ExecResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + RowsAffected int64 `protobuf:"varint,1,opt,name=rows_affected,json=rowsAffected,proto3" json:"rows_affected,omitempty"` + LastInsertId int64 `protobuf:"varint,2,opt,name=last_insert_id,json=lastInsertId,proto3" json:"last_insert_id,omitempty"` + Tip int64 `protobuf:"varint,3,opt,name=tip,proto3" json:"tip,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_ExecResult) Reset() { + *x = AgentDB_Wire_ExecResult{} + mi := &file_livekit_agentdb_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_ExecResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_ExecResult) ProtoMessage() {} + +func (x *AgentDB_Wire_ExecResult) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_ExecResult.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_ExecResult) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 17} +} + +func (x *AgentDB_Wire_ExecResult) GetRowsAffected() int64 { + if x != nil { + return x.RowsAffected + } + return 0 +} + +func (x *AgentDB_Wire_ExecResult) GetLastInsertId() int64 { + if x != nil { + return x.LastInsertId + } + return 0 +} + +func (x *AgentDB_Wire_ExecResult) GetTip() int64 { + if x != nil { + return x.Tip + } + return 0 +} + +type AgentDB_Wire_Done struct { + state protoimpl.MessageState `protogen:"open.v1"` + Tip int64 `protobuf:"varint,1,opt,name=tip,proto3" json:"tip,omitempty"` // the snapshot the query ran at + TotalRows uint64 `protobuf:"varint,2,opt,name=total_rows,json=totalRows,proto3" json:"total_rows,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Done) Reset() { + *x = AgentDB_Wire_Done{} + mi := &file_livekit_agentdb_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Done) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Done) ProtoMessage() {} + +func (x *AgentDB_Wire_Done) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Done.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Done) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 18} +} + +func (x *AgentDB_Wire_Done) GetTip() int64 { + if x != nil { + return x.Tip + } + return 0 +} + +func (x *AgentDB_Wire_Done) GetTotalRows() uint64 { + if x != nil { + return x.TotalRows + } + return 0 +} + +type AgentDB_Wire_Error struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` // stable, machine-readable + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDB_Wire_Error) Reset() { + *x = AgentDB_Wire_Error{} + mi := &file_livekit_agentdb_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDB_Wire_Error) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDB_Wire_Error) ProtoMessage() {} + +func (x *AgentDB_Wire_Error) ProtoReflect() protoreflect.Message { + mi := &file_livekit_agentdb_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDB_Wire_Error.ProtoReflect.Descriptor instead. +func (*AgentDB_Wire_Error) Descriptor() ([]byte, []int) { + return file_livekit_agentdb_proto_rawDescGZIP(), []int{0, 10, 19} +} + +func (x *AgentDB_Wire_Error) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *AgentDB_Wire_Error) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_livekit_agentdb_proto protoreflect.FileDescriptor + +const file_livekit_agentdb_proto_rawDesc = "" + + "\n" + + "\x15livekit_agentdb.proto\x12\alivekit\"\xd8\x19\n" + + "\aAgentDB\x1aH\n" + + "\rCreateRequest\x12\x16\n" + + "\x06region\x18\x01 \x01(\tR\x06region\x12\x1f\n" + + "\vttl_seconds\x18\x02 \x01(\x03R\n" + + "ttlSeconds\x1aP\n" + + "\x0eCreateResponse\x12\x1f\n" + + "\vdatabase_id\x18\x01 \x01(\tR\n" + + "databaseId\x12\x1d\n" + + "\n" + + "expires_at\x18\x02 \x01(\x03R\texpiresAt\x1a-\n" + + "\n" + + "GetRequest\x12\x1f\n" + + "\vdatabase_id\x18\x01 \x01(\tR\n" + + "databaseId\x1aI\n" + + "\vListRequest\x12\x1b\n" + + "\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\x02 \x01(\tR\tpageToken\x1at\n" + + "\fListResponse\x12<\n" + + "\tdatabases\x18\x01 \x03(\v2\x1e.livekit.AgentDB.AgentDatabaseR\tdatabases\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\x1a\x98\x01\n" + + "\rAgentDatabase\x12\x1f\n" + + "\vdatabase_id\x18\x01 \x01(\tR\n" + + "databaseId\x12\x16\n" + + "\x06region\x18\x02 \x01(\tR\x06region\x12\x1d\n" + + "\n" + + "created_at\x18\x03 \x01(\x03R\tcreatedAt\x12\x1d\n" + + "\n" + + "expires_at\x18\x04 \x01(\x03R\texpiresAt\x12\x10\n" + + "\x03tip\x18\x05 \x01(\x03R\x03tip\x1a0\n" + + "\rDeleteRequest\x12\x1f\n" + + "\vdatabase_id\x18\x01 \x01(\tR\n" + + "databaseId\x1a\x10\n" + + "\x0eDeleteResponse\x1a.\n" + + "\vDumpRequest\x12\x1f\n" + + "\vdatabase_id\x18\x01 \x01(\tR\n" + + "databaseId\x1ab\n" + + "\fDumpResponse\x12!\n" + + "\fdownload_url\x18\x01 \x01(\tR\vdownloadUrl\x12\x1d\n" + + "\n" + + "expires_at\x18\x02 \x01(\x03R\texpiresAt\x12\x10\n" + + "\x03tip\x18\x03 \x01(\x03R\x03tip\x1a\xcd\x13\n" + + "\x04Wire\x1a\xe0\x04\n" + + "\rClientMessage\x12\x1d\n" + + "\n" + + "request_id\x18\x01 \x01(\rR\trequestId\x123\n" + + "\x05hello\x18\x02 \x01(\v2\x1b.livekit.AgentDB.Wire.HelloH\x00R\x05hello\x125\n" + + "\x04exec\x18\x03 \x01(\v2\x1f.livekit.AgentDB.Wire.StatementH\x00R\x04exec\x127\n" + + "\x05query\x18\x04 \x01(\v2\x1f.livekit.AgentDB.Wire.StatementH\x00R\x05query\x123\n" + + "\x05batch\x18\x05 \x01(\v2\x1b.livekit.AgentDB.Wire.BatchH\x00R\x05batch\x123\n" + + "\x05begin\x18\x06 \x01(\v2\x1b.livekit.AgentDB.Wire.BeginH\x00R\x05begin\x126\n" + + "\x06commit\x18\a \x01(\v2\x1c.livekit.AgentDB.Wire.CommitH\x00R\x06commit\x12<\n" + + "\brollback\x18\b \x01(\v2\x1e.livekit.AgentDB.Wire.RollbackH\x00R\brollback\x126\n" + + "\x06cancel\x18\t \x01(\v2\x1c.livekit.AgentDB.Wire.CancelH\x00R\x06cancel\x126\n" + + "\x06credit\x18\n" + + " \x01(\v2\x1c.livekit.AgentDB.Wire.CreditH\x00R\x06credit\x120\n" + + "\x04ping\x18\v \x01(\v2\x1a.livekit.AgentDB.Wire.PingH\x00R\x04pingB\t\n" + + "\amessage\x1a\xd6\x03\n" + + "\rServerMessage\x12\x1d\n" + + "\n" + + "request_id\x18\x01 \x01(\rR\trequestId\x12:\n" + + "\bhello_ok\x18\x02 \x01(\v2\x1d.livekit.AgentDB.Wire.HelloOkH\x00R\ahelloOk\x129\n" + + "\acolumns\x18\x03 \x01(\v2\x1d.livekit.AgentDB.Wire.ColumnsH\x00R\acolumns\x12F\n" + + "\fcolumn_batch\x18\x04 \x01(\v2!.livekit.AgentDB.Wire.ColumnBatchH\x00R\vcolumnBatch\x12C\n" + + "\vexec_result\x18\x05 \x01(\v2 .livekit.AgentDB.Wire.ExecResultH\x00R\n" + + "execResult\x120\n" + + "\x04done\x18\x06 \x01(\v2\x1a.livekit.AgentDB.Wire.DoneH\x00R\x04done\x123\n" + + "\x05error\x18\a \x01(\v2\x1b.livekit.AgentDB.Wire.ErrorH\x00R\x05error\x120\n" + + "\x04pong\x18\b \x01(\v2\x1a.livekit.AgentDB.Wire.PongH\x00R\x04pongB\t\n" + + "\amessage\x1a\xb7\x01\n" + + "\x05Value\x12\x1f\n" + + "\n" + + "null_value\x18\x01 \x01(\bH\x00R\tnullValue\x12\x1d\n" + + "\tint_value\x18\x02 \x01(\x03H\x00R\bintValue\x12#\n" + + "\fdouble_value\x18\x03 \x01(\x01H\x00R\vdoubleValue\x12\x1f\n" + + "\n" + + "text_value\x18\x04 \x01(\tH\x00R\ttextValue\x12\x1f\n" + + "\n" + + "blob_value\x18\x05 \x01(\fH\x00R\tblobValueB\a\n" + + "\x05value\x1a\x87\x01\n" + + "\tStatement\x12\x10\n" + + "\x03sql\x18\x01 \x01(\tR\x03sql\x123\n" + + "\x06params\x18\x02 \x03(\v2\x1b.livekit.AgentDB.Wire.ValueR\x06params\x123\n" + + "\x04lang\x18\x03 \x01(\x0e2\x1f.livekit.AgentDB.Wire.QueryLangR\x04lang\x1aH\n" + + "\x05Batch\x12?\n" + + "\n" + + "statements\x18\x01 \x03(\v2\x1f.livekit.AgentDB.Wire.StatementR\n" + + "statements\x1a\a\n" + + "\x05Begin\x1a\b\n" + + "\x06Commit\x1a\n" + + "\n" + + "\bRollback\x1a\b\n" + + "\x06Cancel\x1a\"\n" + + "\x06Credit\x12\x18\n" + + "\abatches\x18\x01 \x01(\rR\abatches\x1a)\n" + + "\x04Ping\x12!\n" + + "\ftimestamp_ms\x18\x01 \x01(\x03R\vtimestampMs\x1a^\n" + + "\x04Pong\x123\n" + + "\x16last_ping_timestamp_ms\x18\x01 \x01(\x03R\x13lastPingTimestampMs\x12!\n" + + "\ftimestamp_ms\x18\x02 \x01(\x03R\vtimestampMs\x1a>\n" + + "\x05Hello\x12\x14\n" + + "\x05token\x18\x01 \x01(\tR\x05token\x12\x1f\n" + + "\vdatabase_id\x18\x02 \x01(\tR\n" + + "databaseId\x1am\n" + + "\aHelloOk\x12\x10\n" + + "\x03tip\x18\x01 \x01(\x03R\x03tip\x12(\n" + + "\x10ping_interval_ms\x18\x02 \x01(\rR\x0epingIntervalMs\x12&\n" + + "\x0fping_timeout_ms\x18\x03 \x01(\rR\rpingTimeoutMs\x1a\x1f\n" + + "\aColumns\x12\x14\n" + + "\x05names\x18\x01 \x03(\tR\x05names\x1a\xc0\x01\n" + + "\x06Column\x12\x14\n" + + "\x05types\x18\x01 \x01(\fR\x05types\x12\x12\n" + + "\x04ints\x18\x02 \x03(\x12R\x04ints\x12\x18\n" + + "\adoubles\x18\x03 \x03(\x01R\adoubles\x12\x1b\n" + + "\ttext_data\x18\x04 \x01(\fR\btextData\x12\x1b\n" + + "\ttext_ends\x18\x05 \x03(\rR\btextEnds\x12\x1b\n" + + "\tblob_data\x18\x06 \x01(\fR\bblobData\x12\x1b\n" + + "\tblob_ends\x18\a \x03(\rR\bblobEnds\x1aY\n" + + "\vColumnBatch\x126\n" + + "\acolumns\x18\x01 \x03(\v2\x1c.livekit.AgentDB.Wire.ColumnR\acolumns\x12\x12\n" + + "\x04rows\x18\x02 \x01(\rR\x04rows\x1ai\n" + + "\n" + + "ExecResult\x12#\n" + + "\rrows_affected\x18\x01 \x01(\x03R\frowsAffected\x12$\n" + + "\x0elast_insert_id\x18\x02 \x01(\x03R\flastInsertId\x12\x10\n" + + "\x03tip\x18\x03 \x01(\x03R\x03tip\x1a7\n" + + "\x04Done\x12\x10\n" + + "\x03tip\x18\x01 \x01(\x03R\x03tip\x12\x1d\n" + + "\n" + + "total_rows\x18\x02 \x01(\x04R\ttotalRows\x1a5\n" + + "\x05Error\x12\x12\n" + + "\x04code\x18\x01 \x01(\tR\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"\x1a\n" + + "\tQueryLang\x12\a\n" + + "\x03SQL\x10\x00\"\x04\b\x01\x10\x01\">\n" + + "\tValueType\x12\b\n" + + "\x04NULL\x10\x00\x12\a\n" + + "\x03INT\x10\x01\x12\n" + + "\n" + + "\x06DOUBLE\x10\x02\x12\b\n" + + "\x04TEXT\x10\x03\x12\b\n" + + "\x04BLOB\x10\x042\x9d\x03\n" + + "\x0eAgentDBService\x12Q\n" + + "\x0eCreateDatabase\x12\x1e.livekit.AgentDB.CreateRequest\x1a\x1f.livekit.AgentDB.CreateResponse\x12J\n" + + "\vGetDatabase\x12\x1b.livekit.AgentDB.GetRequest\x1a\x1e.livekit.AgentDB.AgentDatabase\x12L\n" + + "\rListDatabases\x12\x1c.livekit.AgentDB.ListRequest\x1a\x1d.livekit.AgentDB.ListResponse\x12Q\n" + + "\x0eDeleteDatabase\x12\x1e.livekit.AgentDB.DeleteRequest\x1a\x1f.livekit.AgentDB.DeleteResponse\x12K\n" + + "\fDumpDatabase\x12\x1c.livekit.AgentDB.DumpRequest\x1a\x1d.livekit.AgentDB.DumpResponseBFZ#github.com/livekit/protocol/livekit\xaa\x02\rLiveKit.Proto\xea\x02\x0eLiveKit::Protob\x06proto3" + +var ( + file_livekit_agentdb_proto_rawDescOnce sync.Once + file_livekit_agentdb_proto_rawDescData []byte +) + +func file_livekit_agentdb_proto_rawDescGZIP() []byte { + file_livekit_agentdb_proto_rawDescOnce.Do(func() { + file_livekit_agentdb_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_livekit_agentdb_proto_rawDesc), len(file_livekit_agentdb_proto_rawDesc))) + }) + return file_livekit_agentdb_proto_rawDescData +} + +var file_livekit_agentdb_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_livekit_agentdb_proto_msgTypes = make([]protoimpl.MessageInfo, 32) +var file_livekit_agentdb_proto_goTypes = []any{ + (AgentDB_Wire_QueryLang)(0), // 0: livekit.AgentDB.Wire.QueryLang + (AgentDB_Wire_ValueType)(0), // 1: livekit.AgentDB.Wire.ValueType + (*AgentDB)(nil), // 2: livekit.AgentDB + (*AgentDB_CreateRequest)(nil), // 3: livekit.AgentDB.CreateRequest + (*AgentDB_CreateResponse)(nil), // 4: livekit.AgentDB.CreateResponse + (*AgentDB_GetRequest)(nil), // 5: livekit.AgentDB.GetRequest + (*AgentDB_ListRequest)(nil), // 6: livekit.AgentDB.ListRequest + (*AgentDB_ListResponse)(nil), // 7: livekit.AgentDB.ListResponse + (*AgentDB_AgentDatabase)(nil), // 8: livekit.AgentDB.AgentDatabase + (*AgentDB_DeleteRequest)(nil), // 9: livekit.AgentDB.DeleteRequest + (*AgentDB_DeleteResponse)(nil), // 10: livekit.AgentDB.DeleteResponse + (*AgentDB_DumpRequest)(nil), // 11: livekit.AgentDB.DumpRequest + (*AgentDB_DumpResponse)(nil), // 12: livekit.AgentDB.DumpResponse + (*AgentDB_Wire)(nil), // 13: livekit.AgentDB.Wire + (*AgentDB_Wire_ClientMessage)(nil), // 14: livekit.AgentDB.Wire.ClientMessage + (*AgentDB_Wire_ServerMessage)(nil), // 15: livekit.AgentDB.Wire.ServerMessage + (*AgentDB_Wire_Value)(nil), // 16: livekit.AgentDB.Wire.Value + (*AgentDB_Wire_Statement)(nil), // 17: livekit.AgentDB.Wire.Statement + (*AgentDB_Wire_Batch)(nil), // 18: livekit.AgentDB.Wire.Batch + (*AgentDB_Wire_Begin)(nil), // 19: livekit.AgentDB.Wire.Begin + (*AgentDB_Wire_Commit)(nil), // 20: livekit.AgentDB.Wire.Commit + (*AgentDB_Wire_Rollback)(nil), // 21: livekit.AgentDB.Wire.Rollback + (*AgentDB_Wire_Cancel)(nil), // 22: livekit.AgentDB.Wire.Cancel + (*AgentDB_Wire_Credit)(nil), // 23: livekit.AgentDB.Wire.Credit + (*AgentDB_Wire_Ping)(nil), // 24: livekit.AgentDB.Wire.Ping + (*AgentDB_Wire_Pong)(nil), // 25: livekit.AgentDB.Wire.Pong + (*AgentDB_Wire_Hello)(nil), // 26: livekit.AgentDB.Wire.Hello + (*AgentDB_Wire_HelloOk)(nil), // 27: livekit.AgentDB.Wire.HelloOk + (*AgentDB_Wire_Columns)(nil), // 28: livekit.AgentDB.Wire.Columns + (*AgentDB_Wire_Column)(nil), // 29: livekit.AgentDB.Wire.Column + (*AgentDB_Wire_ColumnBatch)(nil), // 30: livekit.AgentDB.Wire.ColumnBatch + (*AgentDB_Wire_ExecResult)(nil), // 31: livekit.AgentDB.Wire.ExecResult + (*AgentDB_Wire_Done)(nil), // 32: livekit.AgentDB.Wire.Done + (*AgentDB_Wire_Error)(nil), // 33: livekit.AgentDB.Wire.Error +} +var file_livekit_agentdb_proto_depIdxs = []int32{ + 8, // 0: livekit.AgentDB.ListResponse.databases:type_name -> livekit.AgentDB.AgentDatabase + 26, // 1: livekit.AgentDB.Wire.ClientMessage.hello:type_name -> livekit.AgentDB.Wire.Hello + 17, // 2: livekit.AgentDB.Wire.ClientMessage.exec:type_name -> livekit.AgentDB.Wire.Statement + 17, // 3: livekit.AgentDB.Wire.ClientMessage.query:type_name -> livekit.AgentDB.Wire.Statement + 18, // 4: livekit.AgentDB.Wire.ClientMessage.batch:type_name -> livekit.AgentDB.Wire.Batch + 19, // 5: livekit.AgentDB.Wire.ClientMessage.begin:type_name -> livekit.AgentDB.Wire.Begin + 20, // 6: livekit.AgentDB.Wire.ClientMessage.commit:type_name -> livekit.AgentDB.Wire.Commit + 21, // 7: livekit.AgentDB.Wire.ClientMessage.rollback:type_name -> livekit.AgentDB.Wire.Rollback + 22, // 8: livekit.AgentDB.Wire.ClientMessage.cancel:type_name -> livekit.AgentDB.Wire.Cancel + 23, // 9: livekit.AgentDB.Wire.ClientMessage.credit:type_name -> livekit.AgentDB.Wire.Credit + 24, // 10: livekit.AgentDB.Wire.ClientMessage.ping:type_name -> livekit.AgentDB.Wire.Ping + 27, // 11: livekit.AgentDB.Wire.ServerMessage.hello_ok:type_name -> livekit.AgentDB.Wire.HelloOk + 28, // 12: livekit.AgentDB.Wire.ServerMessage.columns:type_name -> livekit.AgentDB.Wire.Columns + 30, // 13: livekit.AgentDB.Wire.ServerMessage.column_batch:type_name -> livekit.AgentDB.Wire.ColumnBatch + 31, // 14: livekit.AgentDB.Wire.ServerMessage.exec_result:type_name -> livekit.AgentDB.Wire.ExecResult + 32, // 15: livekit.AgentDB.Wire.ServerMessage.done:type_name -> livekit.AgentDB.Wire.Done + 33, // 16: livekit.AgentDB.Wire.ServerMessage.error:type_name -> livekit.AgentDB.Wire.Error + 25, // 17: livekit.AgentDB.Wire.ServerMessage.pong:type_name -> livekit.AgentDB.Wire.Pong + 16, // 18: livekit.AgentDB.Wire.Statement.params:type_name -> livekit.AgentDB.Wire.Value + 0, // 19: livekit.AgentDB.Wire.Statement.lang:type_name -> livekit.AgentDB.Wire.QueryLang + 17, // 20: livekit.AgentDB.Wire.Batch.statements:type_name -> livekit.AgentDB.Wire.Statement + 29, // 21: livekit.AgentDB.Wire.ColumnBatch.columns:type_name -> livekit.AgentDB.Wire.Column + 3, // 22: livekit.AgentDBService.CreateDatabase:input_type -> livekit.AgentDB.CreateRequest + 5, // 23: livekit.AgentDBService.GetDatabase:input_type -> livekit.AgentDB.GetRequest + 6, // 24: livekit.AgentDBService.ListDatabases:input_type -> livekit.AgentDB.ListRequest + 9, // 25: livekit.AgentDBService.DeleteDatabase:input_type -> livekit.AgentDB.DeleteRequest + 11, // 26: livekit.AgentDBService.DumpDatabase:input_type -> livekit.AgentDB.DumpRequest + 4, // 27: livekit.AgentDBService.CreateDatabase:output_type -> livekit.AgentDB.CreateResponse + 8, // 28: livekit.AgentDBService.GetDatabase:output_type -> livekit.AgentDB.AgentDatabase + 7, // 29: livekit.AgentDBService.ListDatabases:output_type -> livekit.AgentDB.ListResponse + 10, // 30: livekit.AgentDBService.DeleteDatabase:output_type -> livekit.AgentDB.DeleteResponse + 12, // 31: livekit.AgentDBService.DumpDatabase:output_type -> livekit.AgentDB.DumpResponse + 27, // [27:32] is the sub-list for method output_type + 22, // [22:27] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name +} + +func init() { file_livekit_agentdb_proto_init() } +func file_livekit_agentdb_proto_init() { + if File_livekit_agentdb_proto != nil { + return + } + file_livekit_agentdb_proto_msgTypes[12].OneofWrappers = []any{ + (*AgentDB_Wire_ClientMessage_Hello)(nil), + (*AgentDB_Wire_ClientMessage_Exec)(nil), + (*AgentDB_Wire_ClientMessage_Query)(nil), + (*AgentDB_Wire_ClientMessage_Batch)(nil), + (*AgentDB_Wire_ClientMessage_Begin)(nil), + (*AgentDB_Wire_ClientMessage_Commit)(nil), + (*AgentDB_Wire_ClientMessage_Rollback)(nil), + (*AgentDB_Wire_ClientMessage_Cancel)(nil), + (*AgentDB_Wire_ClientMessage_Credit)(nil), + (*AgentDB_Wire_ClientMessage_Ping)(nil), + } + file_livekit_agentdb_proto_msgTypes[13].OneofWrappers = []any{ + (*AgentDB_Wire_ServerMessage_HelloOk)(nil), + (*AgentDB_Wire_ServerMessage_Columns)(nil), + (*AgentDB_Wire_ServerMessage_ColumnBatch)(nil), + (*AgentDB_Wire_ServerMessage_ExecResult)(nil), + (*AgentDB_Wire_ServerMessage_Done)(nil), + (*AgentDB_Wire_ServerMessage_Error)(nil), + (*AgentDB_Wire_ServerMessage_Pong)(nil), + } + file_livekit_agentdb_proto_msgTypes[14].OneofWrappers = []any{ + (*AgentDB_Wire_Value_NullValue)(nil), + (*AgentDB_Wire_Value_IntValue)(nil), + (*AgentDB_Wire_Value_DoubleValue)(nil), + (*AgentDB_Wire_Value_TextValue)(nil), + (*AgentDB_Wire_Value_BlobValue)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_livekit_agentdb_proto_rawDesc), len(file_livekit_agentdb_proto_rawDesc)), + NumEnums: 2, + NumMessages: 32, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_livekit_agentdb_proto_goTypes, + DependencyIndexes: file_livekit_agentdb_proto_depIdxs, + EnumInfos: file_livekit_agentdb_proto_enumTypes, + MessageInfos: file_livekit_agentdb_proto_msgTypes, + }.Build() + File_livekit_agentdb_proto = out.File + file_livekit_agentdb_proto_goTypes = nil + file_livekit_agentdb_proto_depIdxs = nil +} diff --git a/livekit/livekit_agentdb.twirp.go b/livekit/livekit_agentdb.twirp.go new file mode 100644 index 000000000..9c7625944 --- /dev/null +++ b/livekit/livekit_agentdb.twirp.go @@ -0,0 +1,1736 @@ +// Code generated by protoc-gen-twirp v8.1.3, DO NOT EDIT. +// source: livekit_agentdb.proto + +package livekit + +import context "context" +import fmt "fmt" +import http "net/http" +import io "io" +import json "encoding/json" +import strconv "strconv" +import strings "strings" + +import protojson "google.golang.org/protobuf/encoding/protojson" +import proto "google.golang.org/protobuf/proto" +import twirp "github.com/twitchtv/twirp" +import ctxsetters "github.com/twitchtv/twirp/ctxsetters" + +// Version compatibility assertion. +// If the constant is not defined in the package, that likely means +// the package needs to be updated to work with this generated code. +// See https://twitchtv.github.io/twirp/docs/version_matrix.html +const _ = twirp.TwirpPackageMinVersion_8_1_0 + +// ======================== +// AgentDBService Interface +// ======================== + +// AgentDBService is the lifecycle and export API for SQLite databases; queries +// run over the data plane below. The project comes from the access token. +type AgentDBService interface { + CreateDatabase(context.Context, *AgentDB_CreateRequest) (*AgentDB_CreateResponse, error) + + GetDatabase(context.Context, *AgentDB_GetRequest) (*AgentDB_AgentDatabase, error) + + ListDatabases(context.Context, *AgentDB_ListRequest) (*AgentDB_ListResponse, error) + + // Deletes the stored data, not just the metadata. + DeleteDatabase(context.Context, *AgentDB_DeleteRequest) (*AgentDB_DeleteResponse, error) + + // Exports a consistent SQLite file as a time-limited download URL. + DumpDatabase(context.Context, *AgentDB_DumpRequest) (*AgentDB_DumpResponse, error) +} + +// ============================== +// AgentDBService Protobuf Client +// ============================== + +type agentDBServiceProtobufClient struct { + client HTTPClient + urls [5]string + interceptor twirp.Interceptor + opts twirp.ClientOptions +} + +// NewAgentDBServiceProtobufClient creates a Protobuf client that implements the AgentDBService interface. +// It communicates using Protobuf and can be configured with a custom HTTPClient. +func NewAgentDBServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) AgentDBService { + if c, ok := client.(*http.Client); ok { + client = withoutRedirects(c) + } + + clientOpts := twirp.ClientOptions{} + for _, o := range opts { + o(&clientOpts) + } + + // Using ReadOpt allows backwards and forwards compatibility with new options in the future + literalURLs := false + _ = clientOpts.ReadOpt("literalURLs", &literalURLs) + var pathPrefix string + if ok := clientOpts.ReadOpt("pathPrefix", &pathPrefix); !ok { + pathPrefix = "/twirp" // default prefix + } + + // Build method URLs: []/./ + serviceURL := sanitizeBaseURL(baseURL) + serviceURL += baseServicePath(pathPrefix, "livekit", "AgentDBService") + urls := [5]string{ + serviceURL + "CreateDatabase", + serviceURL + "GetDatabase", + serviceURL + "ListDatabases", + serviceURL + "DeleteDatabase", + serviceURL + "DumpDatabase", + } + + return &agentDBServiceProtobufClient{ + client: client, + urls: urls, + interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...), + opts: clientOpts, + } +} + +func (c *agentDBServiceProtobufClient) CreateDatabase(ctx context.Context, in *AgentDB_CreateRequest) (*AgentDB_CreateResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "AgentDBService") + ctx = ctxsetters.WithMethodName(ctx, "CreateDatabase") + caller := c.callCreateDatabase + if c.interceptor != nil { + caller = func(ctx context.Context, req *AgentDB_CreateRequest) (*AgentDB_CreateResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_CreateRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_CreateRequest) when calling interceptor") + } + return c.callCreateDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_CreateResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_CreateResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *agentDBServiceProtobufClient) callCreateDatabase(ctx context.Context, in *AgentDB_CreateRequest) (*AgentDB_CreateResponse, error) { + out := new(AgentDB_CreateResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *agentDBServiceProtobufClient) GetDatabase(ctx context.Context, in *AgentDB_GetRequest) (*AgentDB_AgentDatabase, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "AgentDBService") + ctx = ctxsetters.WithMethodName(ctx, "GetDatabase") + caller := c.callGetDatabase + if c.interceptor != nil { + caller = func(ctx context.Context, req *AgentDB_GetRequest) (*AgentDB_AgentDatabase, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_GetRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_GetRequest) when calling interceptor") + } + return c.callGetDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_AgentDatabase) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_AgentDatabase) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *agentDBServiceProtobufClient) callGetDatabase(ctx context.Context, in *AgentDB_GetRequest) (*AgentDB_AgentDatabase, error) { + out := new(AgentDB_AgentDatabase) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *agentDBServiceProtobufClient) ListDatabases(ctx context.Context, in *AgentDB_ListRequest) (*AgentDB_ListResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "AgentDBService") + ctx = ctxsetters.WithMethodName(ctx, "ListDatabases") + caller := c.callListDatabases + if c.interceptor != nil { + caller = func(ctx context.Context, req *AgentDB_ListRequest) (*AgentDB_ListResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_ListRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_ListRequest) when calling interceptor") + } + return c.callListDatabases(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_ListResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_ListResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *agentDBServiceProtobufClient) callListDatabases(ctx context.Context, in *AgentDB_ListRequest) (*AgentDB_ListResponse, error) { + out := new(AgentDB_ListResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *agentDBServiceProtobufClient) DeleteDatabase(ctx context.Context, in *AgentDB_DeleteRequest) (*AgentDB_DeleteResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "AgentDBService") + ctx = ctxsetters.WithMethodName(ctx, "DeleteDatabase") + caller := c.callDeleteDatabase + if c.interceptor != nil { + caller = func(ctx context.Context, req *AgentDB_DeleteRequest) (*AgentDB_DeleteResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_DeleteRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_DeleteRequest) when calling interceptor") + } + return c.callDeleteDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_DeleteResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_DeleteResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *agentDBServiceProtobufClient) callDeleteDatabase(ctx context.Context, in *AgentDB_DeleteRequest) (*AgentDB_DeleteResponse, error) { + out := new(AgentDB_DeleteResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *agentDBServiceProtobufClient) DumpDatabase(ctx context.Context, in *AgentDB_DumpRequest) (*AgentDB_DumpResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "AgentDBService") + ctx = ctxsetters.WithMethodName(ctx, "DumpDatabase") + caller := c.callDumpDatabase + if c.interceptor != nil { + caller = func(ctx context.Context, req *AgentDB_DumpRequest) (*AgentDB_DumpResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_DumpRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_DumpRequest) when calling interceptor") + } + return c.callDumpDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_DumpResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_DumpResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *agentDBServiceProtobufClient) callDumpDatabase(ctx context.Context, in *AgentDB_DumpRequest) (*AgentDB_DumpResponse, error) { + out := new(AgentDB_DumpResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +// ========================== +// AgentDBService JSON Client +// ========================== + +type agentDBServiceJSONClient struct { + client HTTPClient + urls [5]string + interceptor twirp.Interceptor + opts twirp.ClientOptions +} + +// NewAgentDBServiceJSONClient creates a JSON client that implements the AgentDBService interface. +// It communicates using JSON and can be configured with a custom HTTPClient. +func NewAgentDBServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) AgentDBService { + if c, ok := client.(*http.Client); ok { + client = withoutRedirects(c) + } + + clientOpts := twirp.ClientOptions{} + for _, o := range opts { + o(&clientOpts) + } + + // Using ReadOpt allows backwards and forwards compatibility with new options in the future + literalURLs := false + _ = clientOpts.ReadOpt("literalURLs", &literalURLs) + var pathPrefix string + if ok := clientOpts.ReadOpt("pathPrefix", &pathPrefix); !ok { + pathPrefix = "/twirp" // default prefix + } + + // Build method URLs: []/./ + serviceURL := sanitizeBaseURL(baseURL) + serviceURL += baseServicePath(pathPrefix, "livekit", "AgentDBService") + urls := [5]string{ + serviceURL + "CreateDatabase", + serviceURL + "GetDatabase", + serviceURL + "ListDatabases", + serviceURL + "DeleteDatabase", + serviceURL + "DumpDatabase", + } + + return &agentDBServiceJSONClient{ + client: client, + urls: urls, + interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...), + opts: clientOpts, + } +} + +func (c *agentDBServiceJSONClient) CreateDatabase(ctx context.Context, in *AgentDB_CreateRequest) (*AgentDB_CreateResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "AgentDBService") + ctx = ctxsetters.WithMethodName(ctx, "CreateDatabase") + caller := c.callCreateDatabase + if c.interceptor != nil { + caller = func(ctx context.Context, req *AgentDB_CreateRequest) (*AgentDB_CreateResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_CreateRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_CreateRequest) when calling interceptor") + } + return c.callCreateDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_CreateResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_CreateResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *agentDBServiceJSONClient) callCreateDatabase(ctx context.Context, in *AgentDB_CreateRequest) (*AgentDB_CreateResponse, error) { + out := new(AgentDB_CreateResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *agentDBServiceJSONClient) GetDatabase(ctx context.Context, in *AgentDB_GetRequest) (*AgentDB_AgentDatabase, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "AgentDBService") + ctx = ctxsetters.WithMethodName(ctx, "GetDatabase") + caller := c.callGetDatabase + if c.interceptor != nil { + caller = func(ctx context.Context, req *AgentDB_GetRequest) (*AgentDB_AgentDatabase, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_GetRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_GetRequest) when calling interceptor") + } + return c.callGetDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_AgentDatabase) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_AgentDatabase) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *agentDBServiceJSONClient) callGetDatabase(ctx context.Context, in *AgentDB_GetRequest) (*AgentDB_AgentDatabase, error) { + out := new(AgentDB_AgentDatabase) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *agentDBServiceJSONClient) ListDatabases(ctx context.Context, in *AgentDB_ListRequest) (*AgentDB_ListResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "AgentDBService") + ctx = ctxsetters.WithMethodName(ctx, "ListDatabases") + caller := c.callListDatabases + if c.interceptor != nil { + caller = func(ctx context.Context, req *AgentDB_ListRequest) (*AgentDB_ListResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_ListRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_ListRequest) when calling interceptor") + } + return c.callListDatabases(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_ListResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_ListResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *agentDBServiceJSONClient) callListDatabases(ctx context.Context, in *AgentDB_ListRequest) (*AgentDB_ListResponse, error) { + out := new(AgentDB_ListResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *agentDBServiceJSONClient) DeleteDatabase(ctx context.Context, in *AgentDB_DeleteRequest) (*AgentDB_DeleteResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "AgentDBService") + ctx = ctxsetters.WithMethodName(ctx, "DeleteDatabase") + caller := c.callDeleteDatabase + if c.interceptor != nil { + caller = func(ctx context.Context, req *AgentDB_DeleteRequest) (*AgentDB_DeleteResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_DeleteRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_DeleteRequest) when calling interceptor") + } + return c.callDeleteDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_DeleteResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_DeleteResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *agentDBServiceJSONClient) callDeleteDatabase(ctx context.Context, in *AgentDB_DeleteRequest) (*AgentDB_DeleteResponse, error) { + out := new(AgentDB_DeleteResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *agentDBServiceJSONClient) DumpDatabase(ctx context.Context, in *AgentDB_DumpRequest) (*AgentDB_DumpResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "AgentDBService") + ctx = ctxsetters.WithMethodName(ctx, "DumpDatabase") + caller := c.callDumpDatabase + if c.interceptor != nil { + caller = func(ctx context.Context, req *AgentDB_DumpRequest) (*AgentDB_DumpResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_DumpRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_DumpRequest) when calling interceptor") + } + return c.callDumpDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_DumpResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_DumpResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *agentDBServiceJSONClient) callDumpDatabase(ctx context.Context, in *AgentDB_DumpRequest) (*AgentDB_DumpResponse, error) { + out := new(AgentDB_DumpResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +// ============================= +// AgentDBService Server Handler +// ============================= + +type agentDBServiceServer struct { + AgentDBService + interceptor twirp.Interceptor + hooks *twirp.ServerHooks + pathPrefix string // prefix for routing + jsonSkipDefaults bool // do not include unpopulated fields (default values) in the response + jsonCamelCase bool // JSON fields are serialized as lowerCamelCase rather than keeping the original proto names +} + +// NewAgentDBServiceServer builds a TwirpServer that can be used as an http.Handler to handle +// HTTP requests that are routed to the right method in the provided svc implementation. +// The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks). +func NewAgentDBServiceServer(svc AgentDBService, opts ...interface{}) TwirpServer { + serverOpts := newServerOpts(opts) + + // Using ReadOpt allows backwards and forwards compatibility with new options in the future + jsonSkipDefaults := false + _ = serverOpts.ReadOpt("jsonSkipDefaults", &jsonSkipDefaults) + jsonCamelCase := false + _ = serverOpts.ReadOpt("jsonCamelCase", &jsonCamelCase) + var pathPrefix string + if ok := serverOpts.ReadOpt("pathPrefix", &pathPrefix); !ok { + pathPrefix = "/twirp" // default prefix + } + + return &agentDBServiceServer{ + AgentDBService: svc, + hooks: serverOpts.Hooks, + interceptor: twirp.ChainInterceptors(serverOpts.Interceptors...), + pathPrefix: pathPrefix, + jsonSkipDefaults: jsonSkipDefaults, + jsonCamelCase: jsonCamelCase, + } +} + +// writeError writes an HTTP response with a valid Twirp error format, and triggers hooks. +// If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err) +func (s *agentDBServiceServer) writeError(ctx context.Context, resp http.ResponseWriter, err error) { + writeError(ctx, resp, err, s.hooks) +} + +// handleRequestBodyError is used to handle error when the twirp server cannot read request +func (s *agentDBServiceServer) handleRequestBodyError(ctx context.Context, resp http.ResponseWriter, msg string, err error) { + if context.Canceled == ctx.Err() { + s.writeError(ctx, resp, twirp.NewError(twirp.Canceled, "failed to read request: context canceled")) + return + } + if context.DeadlineExceeded == ctx.Err() { + s.writeError(ctx, resp, twirp.NewError(twirp.DeadlineExceeded, "failed to read request: deadline exceeded")) + return + } + s.writeError(ctx, resp, twirp.WrapError(malformedRequestError(msg), err)) +} + +// AgentDBServicePathPrefix is a convenience constant that may identify URL paths. +// Should be used with caution, it only matches routes generated by Twirp Go clients, +// with the default "/twirp" prefix and default CamelCase service and method names. +// More info: https://twitchtv.github.io/twirp/docs/routing.html +const AgentDBServicePathPrefix = "/twirp/livekit.AgentDBService/" + +func (s *agentDBServiceServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) { + ctx := req.Context() + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "AgentDBService") + ctx = ctxsetters.WithResponseWriter(ctx, resp) + + var err error + ctx, err = callRequestReceived(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + if req.Method != "POST" { + msg := fmt.Sprintf("unsupported method %q (only POST is allowed)", req.Method) + s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) + return + } + + // Verify path format: []/./ + prefix, pkgService, method := parseTwirpPath(req.URL.Path) + if pkgService != "livekit.AgentDBService" { + msg := fmt.Sprintf("no handler for path %q", req.URL.Path) + s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) + return + } + if prefix != s.pathPrefix { + msg := fmt.Sprintf("invalid path prefix %q, expected %q, on path %q", prefix, s.pathPrefix, req.URL.Path) + s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) + return + } + + switch method { + case "CreateDatabase": + s.serveCreateDatabase(ctx, resp, req) + return + case "GetDatabase": + s.serveGetDatabase(ctx, resp, req) + return + case "ListDatabases": + s.serveListDatabases(ctx, resp, req) + return + case "DeleteDatabase": + s.serveDeleteDatabase(ctx, resp, req) + return + case "DumpDatabase": + s.serveDumpDatabase(ctx, resp, req) + return + default: + msg := fmt.Sprintf("no handler for path %q", req.URL.Path) + s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) + return + } +} + +func (s *agentDBServiceServer) serveCreateDatabase(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveCreateDatabaseJSON(ctx, resp, req) + case "application/protobuf": + s.serveCreateDatabaseProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *agentDBServiceServer) serveCreateDatabaseJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreateDatabase") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(AgentDB_CreateRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.AgentDBService.CreateDatabase + if s.interceptor != nil { + handler = func(ctx context.Context, req *AgentDB_CreateRequest) (*AgentDB_CreateResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_CreateRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_CreateRequest) when calling interceptor") + } + return s.AgentDBService.CreateDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_CreateResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_CreateResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *AgentDB_CreateResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *AgentDB_CreateResponse and nil error while calling CreateDatabase. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *agentDBServiceServer) serveCreateDatabaseProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreateDatabase") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(AgentDB_CreateRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.AgentDBService.CreateDatabase + if s.interceptor != nil { + handler = func(ctx context.Context, req *AgentDB_CreateRequest) (*AgentDB_CreateResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_CreateRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_CreateRequest) when calling interceptor") + } + return s.AgentDBService.CreateDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_CreateResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_CreateResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *AgentDB_CreateResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *AgentDB_CreateResponse and nil error while calling CreateDatabase. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *agentDBServiceServer) serveGetDatabase(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveGetDatabaseJSON(ctx, resp, req) + case "application/protobuf": + s.serveGetDatabaseProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *agentDBServiceServer) serveGetDatabaseJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "GetDatabase") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(AgentDB_GetRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.AgentDBService.GetDatabase + if s.interceptor != nil { + handler = func(ctx context.Context, req *AgentDB_GetRequest) (*AgentDB_AgentDatabase, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_GetRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_GetRequest) when calling interceptor") + } + return s.AgentDBService.GetDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_AgentDatabase) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_AgentDatabase) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *AgentDB_AgentDatabase + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *AgentDB_AgentDatabase and nil error while calling GetDatabase. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *agentDBServiceServer) serveGetDatabaseProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "GetDatabase") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(AgentDB_GetRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.AgentDBService.GetDatabase + if s.interceptor != nil { + handler = func(ctx context.Context, req *AgentDB_GetRequest) (*AgentDB_AgentDatabase, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_GetRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_GetRequest) when calling interceptor") + } + return s.AgentDBService.GetDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_AgentDatabase) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_AgentDatabase) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *AgentDB_AgentDatabase + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *AgentDB_AgentDatabase and nil error while calling GetDatabase. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *agentDBServiceServer) serveListDatabases(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveListDatabasesJSON(ctx, resp, req) + case "application/protobuf": + s.serveListDatabasesProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *agentDBServiceServer) serveListDatabasesJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListDatabases") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(AgentDB_ListRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.AgentDBService.ListDatabases + if s.interceptor != nil { + handler = func(ctx context.Context, req *AgentDB_ListRequest) (*AgentDB_ListResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_ListRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_ListRequest) when calling interceptor") + } + return s.AgentDBService.ListDatabases(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_ListResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_ListResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *AgentDB_ListResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *AgentDB_ListResponse and nil error while calling ListDatabases. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *agentDBServiceServer) serveListDatabasesProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListDatabases") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(AgentDB_ListRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.AgentDBService.ListDatabases + if s.interceptor != nil { + handler = func(ctx context.Context, req *AgentDB_ListRequest) (*AgentDB_ListResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_ListRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_ListRequest) when calling interceptor") + } + return s.AgentDBService.ListDatabases(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_ListResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_ListResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *AgentDB_ListResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *AgentDB_ListResponse and nil error while calling ListDatabases. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *agentDBServiceServer) serveDeleteDatabase(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveDeleteDatabaseJSON(ctx, resp, req) + case "application/protobuf": + s.serveDeleteDatabaseProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *agentDBServiceServer) serveDeleteDatabaseJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DeleteDatabase") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(AgentDB_DeleteRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.AgentDBService.DeleteDatabase + if s.interceptor != nil { + handler = func(ctx context.Context, req *AgentDB_DeleteRequest) (*AgentDB_DeleteResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_DeleteRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_DeleteRequest) when calling interceptor") + } + return s.AgentDBService.DeleteDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_DeleteResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_DeleteResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *AgentDB_DeleteResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *AgentDB_DeleteResponse and nil error while calling DeleteDatabase. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *agentDBServiceServer) serveDeleteDatabaseProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DeleteDatabase") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(AgentDB_DeleteRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.AgentDBService.DeleteDatabase + if s.interceptor != nil { + handler = func(ctx context.Context, req *AgentDB_DeleteRequest) (*AgentDB_DeleteResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_DeleteRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_DeleteRequest) when calling interceptor") + } + return s.AgentDBService.DeleteDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_DeleteResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_DeleteResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *AgentDB_DeleteResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *AgentDB_DeleteResponse and nil error while calling DeleteDatabase. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *agentDBServiceServer) serveDumpDatabase(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveDumpDatabaseJSON(ctx, resp, req) + case "application/protobuf": + s.serveDumpDatabaseProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *agentDBServiceServer) serveDumpDatabaseJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DumpDatabase") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(AgentDB_DumpRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.AgentDBService.DumpDatabase + if s.interceptor != nil { + handler = func(ctx context.Context, req *AgentDB_DumpRequest) (*AgentDB_DumpResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_DumpRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_DumpRequest) when calling interceptor") + } + return s.AgentDBService.DumpDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_DumpResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_DumpResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *AgentDB_DumpResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *AgentDB_DumpResponse and nil error while calling DumpDatabase. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *agentDBServiceServer) serveDumpDatabaseProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DumpDatabase") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(AgentDB_DumpRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.AgentDBService.DumpDatabase + if s.interceptor != nil { + handler = func(ctx context.Context, req *AgentDB_DumpRequest) (*AgentDB_DumpResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*AgentDB_DumpRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*AgentDB_DumpRequest) when calling interceptor") + } + return s.AgentDBService.DumpDatabase(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*AgentDB_DumpResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*AgentDB_DumpResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *AgentDB_DumpResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *AgentDB_DumpResponse and nil error while calling DumpDatabase. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *agentDBServiceServer) ServiceDescriptor() ([]byte, int) { + return twirpFileDescriptor2, 0 +} + +func (s *agentDBServiceServer) ProtocGenTwirpVersion() string { + return "v8.1.3" +} + +// PathPrefix returns the base service path, in the form: "//./" +// that is everything in a Twirp route except for the . This can be used for routing, +// for example to identify the requests that are targeted to this service in a mux. +func (s *agentDBServiceServer) PathPrefix() string { + return baseServicePath(s.pathPrefix, "livekit", "AgentDBService") +} + +var twirpFileDescriptor2 = []byte{ + // 1513 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0xcb, 0x6e, 0xdb, 0x46, + 0x17, 0x96, 0x4c, 0xea, 0xc2, 0x23, 0xc9, 0xbf, 0x30, 0xf9, 0x1b, 0xa8, 0x4c, 0x1c, 0x3b, 0x4e, + 0x51, 0xb8, 0x8b, 0x3a, 0x81, 0x8d, 0x24, 0x68, 0x10, 0xa4, 0xb0, 0x6c, 0x27, 0x72, 0x23, 0x27, + 0xf6, 0xd8, 0xe9, 0x6d, 0x51, 0x82, 0x22, 0x27, 0x32, 0x61, 0x8a, 0x54, 0xc8, 0x91, 0xe3, 0xe4, + 0x05, 0xfa, 0x0a, 0xdd, 0xf4, 0x05, 0xfa, 0x02, 0xdd, 0xf6, 0x05, 0xba, 0x2d, 0xba, 0xec, 0xba, + 0x4f, 0x51, 0x9c, 0x33, 0x43, 0xca, 0x8e, 0x2e, 0xce, 0x8a, 0x33, 0x67, 0xbe, 0x6f, 0x2e, 0xe7, + 0x7c, 0x73, 0xe6, 0x10, 0x3e, 0x09, 0x83, 0x33, 0x71, 0x1a, 0x48, 0xc7, 0xed, 0x8b, 0x48, 0xfa, + 0xbd, 0xf5, 0x61, 0x12, 0xcb, 0x98, 0x55, 0xb4, 0x79, 0xf5, 0xef, 0x4f, 0xa1, 0xb2, 0x85, 0x43, + 0x3b, 0x6d, 0xbb, 0x03, 0x8d, 0xed, 0x44, 0xb8, 0x52, 0x70, 0xf1, 0x66, 0x24, 0x52, 0xc9, 0xae, + 0x43, 0x39, 0x11, 0xfd, 0x20, 0x8e, 0x5a, 0xc5, 0x95, 0xe2, 0x9a, 0xc5, 0x75, 0x8f, 0x2d, 0x43, + 0x4d, 0xca, 0xd0, 0x49, 0x85, 0x17, 0x47, 0x7e, 0xda, 0x5a, 0x58, 0x29, 0xae, 0x19, 0x1c, 0xa4, + 0x0c, 0x8f, 0x94, 0xc5, 0x3e, 0x80, 0xc5, 0x6c, 0xa6, 0x74, 0x18, 0x47, 0xa9, 0x40, 0x8a, 0xef, + 0x4a, 0xb7, 0xe7, 0xa6, 0xc2, 0x09, 0x7c, 0x3d, 0x1f, 0x64, 0xa6, 0x3d, 0x9f, 0x2d, 0x01, 0x88, + 0xf3, 0x61, 0x90, 0x88, 0xd4, 0x71, 0xa5, 0x9e, 0xd2, 0xd2, 0x96, 0x2d, 0x69, 0x7f, 0x09, 0xf0, + 0x4c, 0xc8, 0x6c, 0x63, 0x57, 0xcd, 0x66, 0xef, 0x41, 0xad, 0x1b, 0xa4, 0x39, 0xfe, 0x06, 0x58, + 0x43, 0xb7, 0x2f, 0x9c, 0x34, 0x78, 0x2f, 0x08, 0x5d, 0xe2, 0x55, 0x34, 0x1c, 0x05, 0xef, 0x05, + 0xae, 0x4c, 0x83, 0x32, 0x3e, 0x15, 0x11, 0xad, 0x6c, 0x71, 0x82, 0x1f, 0xa3, 0xc1, 0x96, 0x50, + 0x57, 0x53, 0xe9, 0x93, 0x3c, 0x06, 0x2b, 0x5b, 0x28, 0x6d, 0x15, 0x57, 0x8c, 0xb5, 0xda, 0xc6, + 0xad, 0x75, 0xed, 0xce, 0x75, 0xed, 0x4a, 0xfd, 0xd5, 0x30, 0x3e, 0x26, 0xb0, 0xcf, 0xe1, 0x7f, + 0x91, 0x38, 0x97, 0xce, 0xc4, 0x8a, 0x0d, 0x34, 0x1f, 0xe4, 0xab, 0xfe, 0x52, 0x84, 0xc6, 0xa5, + 0x49, 0xae, 0xf6, 0xe0, 0x38, 0x5a, 0x0b, 0x97, 0xa2, 0xb5, 0x04, 0xe0, 0x51, 0x30, 0x7c, 0xf4, + 0xac, 0xa1, 0x3c, 0xab, 0x2d, 0x5b, 0xf2, 0x03, 0xc7, 0x9b, 0x1f, 0x38, 0x9e, 0x35, 0xc1, 0x90, + 0xc1, 0xb0, 0x55, 0x22, 0x3b, 0x36, 0xed, 0x7b, 0xd0, 0xd8, 0x11, 0xa1, 0x18, 0xcb, 0xe4, 0xca, + 0x68, 0x34, 0x61, 0x31, 0x63, 0x28, 0x27, 0xda, 0xeb, 0x50, 0xdb, 0x19, 0x0d, 0x86, 0x1f, 0x3d, + 0x43, 0x0f, 0xea, 0x0a, 0xaf, 0x83, 0x70, 0x1b, 0xea, 0x7e, 0xfc, 0x36, 0x0a, 0x63, 0xd7, 0x77, + 0x46, 0x49, 0xa8, 0x19, 0xb5, 0xcc, 0xf6, 0x2a, 0x09, 0xaf, 0x10, 0x54, 0x76, 0x2e, 0x63, 0x7c, + 0xae, 0x3f, 0xaf, 0x81, 0xf9, 0x5d, 0x90, 0x08, 0xfb, 0x1f, 0x13, 0x1a, 0xdb, 0x61, 0x20, 0x22, + 0xb9, 0x2f, 0xd2, 0xd4, 0xed, 0x93, 0x44, 0x12, 0xb5, 0xd5, 0x6c, 0x7b, 0x0d, 0x6e, 0x69, 0xcb, + 0x9e, 0xcf, 0x36, 0xa1, 0x74, 0x22, 0xc2, 0x30, 0xa6, 0x55, 0x6a, 0x1b, 0x37, 0x26, 0xe4, 0x80, + 0xd3, 0xae, 0x77, 0x10, 0xd2, 0x29, 0x70, 0x85, 0x65, 0xf7, 0xc1, 0x14, 0xe7, 0xc2, 0xa3, 0x1d, + 0xd4, 0x36, 0x96, 0xa7, 0x73, 0x8e, 0xa4, 0x2b, 0xc5, 0x40, 0x44, 0xb2, 0x53, 0xe0, 0x04, 0x67, + 0x0f, 0xa1, 0xf4, 0x66, 0x24, 0x92, 0x77, 0x14, 0xa9, 0x8f, 0xe2, 0x29, 0x3c, 0x6e, 0xb2, 0xe7, + 0x4a, 0xef, 0x84, 0x42, 0x39, 0x73, 0x93, 0x6d, 0x84, 0x20, 0x89, 0xb0, 0x44, 0x12, 0xfd, 0x20, + 0x6a, 0x95, 0xe7, 0x92, 0x10, 0x42, 0x24, 0x6c, 0xb0, 0x07, 0x50, 0xf6, 0xe2, 0xc1, 0x20, 0x90, + 0xad, 0x0a, 0xb1, 0x6e, 0x4e, 0x67, 0x6d, 0x13, 0xa6, 0x53, 0xe0, 0x1a, 0xcd, 0x1e, 0x43, 0x35, + 0x89, 0xc3, 0xb0, 0xe7, 0x7a, 0xa7, 0xad, 0x2a, 0x31, 0x6f, 0x4d, 0x67, 0x72, 0x8d, 0xea, 0x14, + 0x78, 0xce, 0xa0, 0x55, 0xdd, 0xc8, 0x13, 0x61, 0xcb, 0x9a, 0xbb, 0x2a, 0x61, 0x68, 0x55, 0x6a, + 0x11, 0x2f, 0x11, 0x7e, 0x20, 0x5b, 0x30, 0x97, 0x47, 0x18, 0xe2, 0x51, 0x8b, 0xdd, 0x03, 0x73, + 0x18, 0x44, 0xfd, 0x56, 0x8d, 0x58, 0xf6, 0x74, 0xd6, 0x41, 0x10, 0xf5, 0x31, 0x74, 0x88, 0x6c, + 0x5b, 0x50, 0x19, 0x28, 0x41, 0xd9, 0x7f, 0x19, 0xd0, 0x38, 0x12, 0xc9, 0x99, 0x48, 0x3e, 0x52, + 0x62, 0x8f, 0xa0, 0x4a, 0xb2, 0x71, 0xe2, 0x53, 0xad, 0xb2, 0xa5, 0x39, 0x2a, 0x7b, 0x89, 0xae, + 0xa9, 0x9c, 0xa8, 0x26, 0xfb, 0x0a, 0x2a, 0x5e, 0x1c, 0x8e, 0x06, 0x51, 0xaa, 0xc5, 0xb6, 0x34, + 0x2b, 0x20, 0x04, 0x42, 0xaa, 0xc6, 0xb3, 0xa7, 0x50, 0x57, 0x4d, 0x47, 0x69, 0x47, 0x89, 0xee, + 0xf6, 0x3c, 0x7e, 0xa6, 0xa0, 0x9a, 0x37, 0xee, 0xb2, 0x6d, 0xa8, 0xa1, 0x7a, 0x9d, 0x44, 0xa4, + 0xa3, 0x50, 0x6a, 0x09, 0xae, 0x4c, 0x9f, 0x66, 0xf7, 0x5c, 0x78, 0x9c, 0x70, 0x9d, 0x02, 0x07, + 0x91, 0xf7, 0xd0, 0xe3, 0x7e, 0x1c, 0x09, 0xad, 0xc5, 0x19, 0x1e, 0xdf, 0x89, 0x23, 0x81, 0x1e, + 0x47, 0x24, 0xca, 0x57, 0x24, 0x49, 0x9c, 0x68, 0x21, 0xce, 0x90, 0xef, 0x2e, 0x42, 0x50, 0xbe, + 0x84, 0xa5, 0xc0, 0xc6, 0x51, 0x5f, 0x4b, 0x70, 0x56, 0x60, 0x63, 0x1d, 0xd8, 0xf8, 0x72, 0x60, + 0x7f, 0x2f, 0x42, 0xe9, 0x5b, 0x37, 0x1c, 0x61, 0xbe, 0x86, 0x68, 0x14, 0x86, 0xce, 0x19, 0xf6, + 0x28, 0xa0, 0xd5, 0x4e, 0x81, 0x5b, 0x68, 0x53, 0x80, 0x25, 0xb0, 0x82, 0x48, 0xea, 0x71, 0xca, + 0x4f, 0xa8, 0xe7, 0x20, 0x92, 0x6a, 0xf8, 0x0e, 0xa6, 0xb8, 0x51, 0x2f, 0x14, 0x1a, 0x81, 0xa1, + 0x2b, 0xa2, 0x5f, 0x95, 0x35, 0x5f, 0x44, 0xe2, 0x73, 0xa2, 0x20, 0x18, 0x1d, 0x0b, 0x17, 0x41, + 0x5b, 0x0e, 0xe8, 0x85, 0x71, 0x4f, 0x03, 0xd0, 0xef, 0x75, 0x04, 0xa0, 0x8d, 0x00, 0xed, 0x0a, + 0x94, 0x68, 0xcc, 0xfe, 0xb9, 0x08, 0x56, 0x9e, 0x36, 0x30, 0x3d, 0xa6, 0x6f, 0xb2, 0xbc, 0x8a, + 0x4d, 0xb6, 0x09, 0xe5, 0xa1, 0x9b, 0xb8, 0x03, 0x7c, 0xef, 0x8d, 0xd9, 0xce, 0xa4, 0x59, 0xb9, + 0x86, 0xb2, 0x4d, 0x30, 0x43, 0x37, 0xea, 0xd3, 0xe6, 0x17, 0x67, 0x25, 0xab, 0x43, 0xcc, 0x4f, + 0x5d, 0x37, 0xea, 0x73, 0x02, 0xdb, 0x1d, 0x28, 0x29, 0xd5, 0x7c, 0x0d, 0x90, 0x66, 0x3b, 0xca, + 0xde, 0xda, 0xab, 0x12, 0x1e, 0xbf, 0x40, 0xb1, 0x2b, 0x50, 0xa2, 0xdc, 0x64, 0x57, 0xa1, 0xac, + 0xd2, 0x8d, 0x0d, 0x50, 0xcd, 0xd2, 0x07, 0x59, 0x29, 0x09, 0xd8, 0xab, 0x50, 0x56, 0x17, 0x9c, + 0xb5, 0xa0, 0x42, 0x52, 0xa7, 0xc7, 0x1d, 0x2f, 0x61, 0xd6, 0xb5, 0xbf, 0x00, 0x13, 0xaf, 0x33, + 0xbe, 0x3d, 0x32, 0x18, 0x88, 0x54, 0xba, 0x83, 0xa1, 0x33, 0x50, 0x30, 0x83, 0xd7, 0x72, 0xdb, + 0x7e, 0x6a, 0xff, 0x04, 0x26, 0x0a, 0x84, 0x6d, 0xc2, 0xf5, 0xd0, 0x4d, 0xa5, 0x83, 0xd7, 0xdf, + 0x99, 0x42, 0xba, 0x86, 0xa3, 0x38, 0xe9, 0xf1, 0x98, 0x3c, 0x31, 0xff, 0xc2, 0xe4, 0xfc, 0x4f, + 0xa0, 0x44, 0xf7, 0x9c, 0xfd, 0x1f, 0x4a, 0xaa, 0x88, 0x50, 0x81, 0x52, 0x9d, 0x0f, 0x9f, 0xd3, + 0x85, 0x89, 0xe7, 0x74, 0x00, 0x15, 0x9d, 0x27, 0xb2, 0x77, 0xb0, 0x98, 0xbf, 0x83, 0x6c, 0x0d, + 0x9a, 0xb4, 0xdf, 0x20, 0x92, 0x22, 0x39, 0x73, 0xc3, 0x6c, 0x0f, 0x0d, 0xbe, 0x88, 0xf6, 0x3d, + 0x6d, 0xde, 0xa7, 0x62, 0x26, 0x3f, 0x59, 0x3c, 0x92, 0x08, 0x34, 0x08, 0xd8, 0x18, 0xea, 0x33, + 0xc5, 0x23, 0xb9, 0x9f, 0xda, 0xcb, 0x50, 0xd1, 0xb9, 0x05, 0x37, 0x1c, 0xb9, 0x03, 0x5d, 0x39, + 0x59, 0x5c, 0x75, 0xec, 0x3f, 0x8a, 0x18, 0x1f, 0x44, 0xd0, 0x89, 0xde, 0x0d, 0xb5, 0xf7, 0xeb, + 0x5c, 0x75, 0x18, 0x03, 0x33, 0x40, 0x0d, 0xa0, 0xf4, 0x18, 0xa7, 0x36, 0x46, 0x4a, 0x5d, 0x05, + 0x5c, 0xd5, 0x58, 0x2b, 0xf2, 0xac, 0x8b, 0xe5, 0x1e, 0xdd, 0x0a, 0x3c, 0x31, 0x5d, 0x8a, 0x3a, + 0xaf, 0xa2, 0x01, 0x6b, 0xa9, 0x7c, 0x50, 0x60, 0xe9, 0x5a, 0x5a, 0x31, 0xd6, 0x1a, 0x6a, 0x70, + 0x37, 0xf2, 0x89, 0x49, 0xd7, 0x85, 0x98, 0x65, 0xc5, 0x44, 0x43, 0xc6, 0xa4, 0x41, 0x62, 0x56, + 0x14, 0x13, 0x0d, 0xc8, 0xb4, 0x7f, 0x80, 0xda, 0x85, 0xfc, 0xc7, 0x1e, 0x8c, 0x73, 0xae, 0xd2, + 0xed, 0xcd, 0x79, 0x39, 0x73, 0x9c, 0x70, 0x19, 0x98, 0x49, 0xfc, 0x36, 0x73, 0x38, 0xb5, 0xed, + 0x00, 0x60, 0x9c, 0x13, 0xd9, 0x1d, 0x68, 0xa0, 0xd5, 0x71, 0x5f, 0xbf, 0x16, 0x9e, 0x14, 0xbe, + 0x0e, 0x5d, 0x1d, 0x8d, 0x5b, 0xda, 0xc6, 0x3e, 0x83, 0x45, 0x12, 0x5e, 0x10, 0xa5, 0x22, 0x91, + 0x99, 0x08, 0x0c, 0x5e, 0x47, 0xeb, 0x1e, 0x19, 0xf7, 0xfc, 0x29, 0x35, 0xd0, 0x43, 0x30, 0x31, + 0x81, 0x4e, 0x51, 0xc5, 0x12, 0x80, 0x8c, 0xa5, 0x1b, 0x3a, 0xf9, 0xf6, 0x4c, 0x6e, 0x91, 0x85, + 0xe3, 0x1e, 0xef, 0x43, 0x89, 0xd2, 0x28, 0x1e, 0xc0, 0x8b, 0x7d, 0xa1, 0x05, 0x49, 0x6d, 0x8c, + 0x94, 0xce, 0x8f, 0x5a, 0x8b, 0x59, 0x77, 0xd5, 0x06, 0x2b, 0xbf, 0xfd, 0xac, 0x02, 0xc6, 0xd1, + 0x61, 0xb7, 0x59, 0x58, 0x35, 0xab, 0xc5, 0x66, 0x71, 0xf5, 0x09, 0x58, 0x94, 0x4c, 0x8e, 0xdf, + 0x0d, 0x05, 0xab, 0x82, 0xf9, 0xe2, 0x55, 0xb7, 0xdb, 0x2c, 0x20, 0x6a, 0xef, 0xc5, 0x71, 0xb3, + 0xc8, 0x00, 0xca, 0x3b, 0x2f, 0x5f, 0xb5, 0xbb, 0xbb, 0xcd, 0x05, 0x1c, 0x3e, 0xde, 0xfd, 0xfe, + 0xb8, 0x69, 0x60, 0xab, 0xdd, 0x7d, 0xd9, 0x6e, 0x9a, 0x1b, 0xbf, 0x1a, 0xb0, 0xa8, 0x7d, 0x8d, + 0x4f, 0x6d, 0xe0, 0x09, 0x76, 0x98, 0xfd, 0x97, 0xe4, 0x55, 0xf5, 0x64, 0x85, 0x71, 0xe9, 0x17, + 0xc8, 0x5e, 0x9e, 0x39, 0xae, 0x2b, 0xd1, 0x6f, 0xa0, 0xf6, 0x4c, 0x8c, 0xab, 0xf4, 0xc9, 0xac, + 0x38, 0xfe, 0x6d, 0xb1, 0xaf, 0xf8, 0x4f, 0x60, 0x5d, 0x68, 0xe0, 0xaf, 0xc6, 0x4e, 0xfe, 0xb7, + 0x30, 0x29, 0x9a, 0x0b, 0x7f, 0x35, 0xf6, 0xd2, 0x8c, 0x51, 0xbd, 0xb3, 0xc3, 0xac, 0xea, 0x9e, + 0x73, 0xd8, 0x4b, 0x85, 0xfc, 0x94, 0xc3, 0x5e, 0x2e, 0xdb, 0xd9, 0x73, 0x55, 0x86, 0xe7, 0x13, + 0x4e, 0xee, 0xef, 0x42, 0x55, 0x3f, 0x65, 0x7f, 0x17, 0x6b, 0xf8, 0xf6, 0xd3, 0x1f, 0xef, 0xf4, + 0x03, 0x79, 0x32, 0xea, 0xad, 0x7b, 0xf1, 0xe0, 0xae, 0x86, 0xde, 0xa5, 0xff, 0x53, 0x2f, 0x0e, + 0x33, 0xc3, 0x6f, 0x0b, 0x8d, 0x6e, 0x70, 0x26, 0x9e, 0x07, 0x72, 0xfd, 0x00, 0x87, 0xfe, 0x5d, + 0x58, 0xd4, 0xfd, 0x47, 0x8f, 0xc8, 0xd0, 0x2b, 0x13, 0x65, 0xf3, 0xbf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xc5, 0x9a, 0x43, 0xe8, 0xeb, 0x0e, 0x00, 0x00, +} diff --git a/livekit/livekit_cloud_agent.twirp.go b/livekit/livekit_cloud_agent.twirp.go index 27ce9a912..689ae25bc 100644 --- a/livekit/livekit_cloud_agent.twirp.go +++ b/livekit/livekit_cloud_agent.twirp.go @@ -5245,7 +5245,7 @@ func (s *cloudAgentServer) serveGetPrivateLinkStatusProtobuf(ctx context.Context } func (s *cloudAgentServer) ServiceDescriptor() ([]byte, int) { - return twirpFileDescriptor6, 0 + return twirpFileDescriptor7, 0 } func (s *cloudAgentServer) ProtocGenTwirpVersion() string { @@ -5259,7 +5259,7 @@ func (s *cloudAgentServer) PathPrefix() string { return baseServicePath(s.pathPrefix, "livekit", "CloudAgent") } -var twirpFileDescriptor6 = []byte{ +var twirpFileDescriptor7 = []byte{ // 2600 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x5d, 0x6f, 0x1b, 0x4b, 0xf9, 0xcf, 0xfa, 0x2d, 0xf6, 0xe3, 0xb8, 0x71, 0x26, 0x69, 0xea, 0x38, 0x49, 0x9b, 0x6c, 0xdb, diff --git a/livekit/livekit_connector.twirp.go b/livekit/livekit_connector.twirp.go index d88f01c00..472bc090a 100644 --- a/livekit/livekit_connector.twirp.go +++ b/livekit/livekit_connector.twirp.go @@ -1618,7 +1618,7 @@ func (s *connectorServer) serveConnectTwilioCallProtobuf(ctx context.Context, re } func (s *connectorServer) ServiceDescriptor() ([]byte, int) { - return twirpFileDescriptor8, 0 + return twirpFileDescriptor9, 0 } func (s *connectorServer) ProtocGenTwirpVersion() string { @@ -1632,7 +1632,7 @@ func (s *connectorServer) PathPrefix() string { return baseServicePath(s.pathPrefix, "livekit", "Connector") } -var twirpFileDescriptor8 = []byte{ +var twirpFileDescriptor9 = []byte{ // 313 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0x4b, 0xf3, 0x30, 0x1c, 0xc6, 0xdf, 0xb7, 0xc2, 0xd4, 0xbf, 0x4e, 0x6b, 0x04, 0x85, 0x1e, 0x64, 0x5b, 0x45, 0xc1, diff --git a/livekit/livekit_egress.twirp.go b/livekit/livekit_egress.twirp.go index df5542a5a..86cf46b7c 100644 --- a/livekit/livekit_egress.twirp.go +++ b/livekit/livekit_egress.twirp.go @@ -3019,7 +3019,7 @@ func (s *egressServer) serveStartTrackEgressProtobuf(ctx context.Context, resp h } func (s *egressServer) ServiceDescriptor() ([]byte, int) { - return twirpFileDescriptor2, 0 + return twirpFileDescriptor3, 0 } func (s *egressServer) ProtocGenTwirpVersion() string { @@ -3033,7 +3033,7 @@ func (s *egressServer) PathPrefix() string { return baseServicePath(s.pathPrefix, "livekit", "Egress") } -var twirpFileDescriptor2 = []byte{ +var twirpFileDescriptor3 = []byte{ // 4257 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x3b, 0x4b, 0x70, 0x1c, 0x59, 0x52, 0xaa, 0xea, 0x7f, 0xf6, 0xaf, 0xf4, 0x24, 0x6b, 0xda, 0xf2, 0x7a, 0xec, 0x6d, 0xef, 0x8c, diff --git a/livekit/livekit_ingress.twirp.go b/livekit/livekit_ingress.twirp.go index fa7244522..acb4d95a2 100644 --- a/livekit/livekit_ingress.twirp.go +++ b/livekit/livekit_ingress.twirp.go @@ -1341,7 +1341,7 @@ func (s *ingressServer) serveDeleteIngressProtobuf(ctx context.Context, resp htt } func (s *ingressServer) ServiceDescriptor() ([]byte, int) { - return twirpFileDescriptor3, 0 + return twirpFileDescriptor4, 0 } func (s *ingressServer) ProtocGenTwirpVersion() string { @@ -1355,7 +1355,7 @@ func (s *ingressServer) PathPrefix() string { return baseServicePath(s.pathPrefix, "livekit", "Ingress") } -var twirpFileDescriptor3 = []byte{ +var twirpFileDescriptor4 = []byte{ // 1620 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4d, 0x6f, 0xdb, 0xcc, 0x11, 0x36, 0xf5, 0xad, 0x91, 0x25, 0x2b, 0x6b, 0xf9, 0x7d, 0x15, 0x7f, 0xb4, 0x82, 0x92, 0x22, diff --git a/livekit/livekit_phone_number.twirp.go b/livekit/livekit_phone_number.twirp.go index 21c6c897f..9b78d0f35 100644 --- a/livekit/livekit_phone_number.twirp.go +++ b/livekit/livekit_phone_number.twirp.go @@ -1904,7 +1904,7 @@ func (s *phoneNumberServiceServer) serveReleasePhoneNumbersProtobuf(ctx context. } func (s *phoneNumberServiceServer) ServiceDescriptor() ([]byte, int) { - return twirpFileDescriptor7, 0 + return twirpFileDescriptor8, 0 } func (s *phoneNumberServiceServer) ProtocGenTwirpVersion() string { @@ -1918,7 +1918,7 @@ func (s *phoneNumberServiceServer) PathPrefix() string { return baseServicePath(s.pathPrefix, "livekit", "PhoneNumberService") } -var twirpFileDescriptor7 = []byte{ +var twirpFileDescriptor8 = []byte{ // 1241 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x51, 0x6e, 0xdb, 0x46, 0x13, 0xd6, 0x52, 0xb6, 0x63, 0x8d, 0x64, 0x5b, 0xd9, 0x38, 0x09, 0x4d, 0x27, 0xb1, 0x42, 0xff, diff --git a/livekit/livekit_room.twirp.go b/livekit/livekit_room.twirp.go index eae205ebf..122269f8a 100644 --- a/livekit/livekit_room.twirp.go +++ b/livekit/livekit_room.twirp.go @@ -4152,7 +4152,7 @@ func (s *roomServiceServer) servePerformRpcProtobuf(ctx context.Context, resp ht } func (s *roomServiceServer) ServiceDescriptor() ([]byte, int) { - return twirpFileDescriptor4, 0 + return twirpFileDescriptor5, 0 } func (s *roomServiceServer) ProtocGenTwirpVersion() string { @@ -4166,7 +4166,7 @@ func (s *roomServiceServer) PathPrefix() string { return baseServicePath(s.pathPrefix, "livekit", "RoomService") } -var twirpFileDescriptor4 = []byte{ +var twirpFileDescriptor5 = []byte{ // 1612 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x5b, 0x6f, 0x13, 0xd7, 0x16, 0x3e, 0x4e, 0x6c, 0xc7, 0x5e, 0xce, 0xcd, 0x3b, 0x01, 0x26, 0x13, 0x2e, 0x66, 0xc2, 0x39, diff --git a/livekit/livekit_sip.twirp.go b/livekit/livekit_sip.twirp.go index 3677e1398..3150829ac 100644 --- a/livekit/livekit_sip.twirp.go +++ b/livekit/livekit_sip.twirp.go @@ -4689,7 +4689,7 @@ func (s *sIPServer) serveTransferSIPParticipantProtobuf(ctx context.Context, res } func (s *sIPServer) ServiceDescriptor() ([]byte, int) { - return twirpFileDescriptor5, 0 + return twirpFileDescriptor6, 0 } func (s *sIPServer) ProtocGenTwirpVersion() string { @@ -4703,7 +4703,7 @@ func (s *sIPServer) PathPrefix() string { return baseServicePath(s.pathPrefix, "livekit", "SIP") } -var twirpFileDescriptor5 = []byte{ +var twirpFileDescriptor6 = []byte{ // 5797 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x7c, 0x69, 0x8c, 0x1b, 0xc9, 0x75, 0xb0, 0xc8, 0xe6, 0xcc, 0x70, 0x1e, 0xe7, 0xe8, 0xa9, 0x19, 0x8d, 0xa8, 0xd1, 0x35, 0x4b, diff --git a/magefile.go b/magefile.go index 087bbf623..9a5783d47 100644 --- a/magefile.go +++ b/magefile.go @@ -45,6 +45,7 @@ func Proto() error { twirpProtoFiles := []string{ "cloud_replay.proto", "livekit_agent_dispatch.proto", + "livekit_agentdb.proto", "livekit_egress.proto", "livekit_ingress.proto", "livekit_room.proto", diff --git a/protobufs/livekit_agentdb.proto b/protobufs/livekit_agentdb.proto new file mode 100644 index 000000000..db4a837af --- /dev/null +++ b/protobufs/livekit_agentdb.proto @@ -0,0 +1,226 @@ +// Copyright 2026 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +syntax = "proto3"; + +package livekit; + +option go_package = "github.com/livekit/protocol/livekit"; +option csharp_namespace = "LiveKit.Proto"; +option ruby_package = "LiveKit::Proto"; + +// AgentDBService is the lifecycle and export API for SQLite databases; queries +// run over the data plane below. The project comes from the access token. +service AgentDBService { + rpc CreateDatabase(AgentDB.CreateRequest) returns (AgentDB.CreateResponse); + rpc GetDatabase(AgentDB.GetRequest) returns (AgentDB.AgentDatabase); + rpc ListDatabases(AgentDB.ListRequest) returns (AgentDB.ListResponse); + // Deletes the stored data, not just the metadata. + rpc DeleteDatabase(AgentDB.DeleteRequest) returns (AgentDB.DeleteResponse); + // Exports a consistent SQLite file as a time-limited download URL. + rpc DumpDatabase(AgentDB.DumpRequest) returns (AgentDB.DumpResponse); +} + +// Nested so that names like Value and Ping need not be unique across the +// livekit package. `tip` throughout is the latest durable commit sequence. +message AgentDB { + message CreateRequest { + string region = 1; + // Unset: never expires, and expires_at is then 0 everywhere. + // Otherwise clamped to the server cap, and never extended. + int64 ttl_seconds = 2; + } + + message CreateResponse { + string database_id = 1; // "DB_..." + int64 expires_at = 2; + } + + message GetRequest { + string database_id = 1; + } + + message ListRequest { + int32 page_size = 1; // server-clamped + string page_token = 2; + } + + message ListResponse { + repeated AgentDatabase databases = 1; + string next_page_token = 2; // empty when exhausted + } + + // One database, as get and list both report it. + message AgentDatabase { + string database_id = 1; + string region = 2; + int64 created_at = 3; + int64 expires_at = 4; + int64 tip = 5; + } + + message DeleteRequest { + string database_id = 1; + } + + message DeleteResponse {} + + message DumpRequest { + string database_id = 1; + } + + message DumpResponse { + string download_url = 1; // pre-authenticated object-storage URL + int64 expires_at = 2; // of the URL, not the database + int64 tip = 3; // what the dump is consistent at + } + + // Data plane: one WebSocket per database, one message per frame, correlated + // by a client-chosen request_id. Result batches are paced by Credit, so the + // server never sends more un-consumed batches than granted. + message Wire { + message ClientMessage { + uint32 request_id = 1; + oneof message { + Hello hello = 2; // must be first on the socket + Statement exec = 3; // answers ExecResult + Statement query = 4; // answers Columns + ColumnBatch* + Done + Batch batch = 5; + Begin begin = 6; + Commit commit = 7; + Rollback rollback = 8; + Cancel cancel = 9; + Credit credit = 10; + Ping ping = 11; + } + } + + message ServerMessage { + uint32 request_id = 1; + oneof message { + HelloOk hello_ok = 2; + Columns columns = 3; + ColumnBatch column_batch = 4; + ExecResult exec_result = 5; + Done done = 6; + Error error = 7; + Pong pong = 8; + } + } + + enum QueryLang { + SQL = 0; + reserved 1; + } + + // SQLite's five storage classes. + message Value { + oneof value { + bool null_value = 1; // always true when set + int64 int_value = 2; + double double_value = 3; + string text_value = 4; + bytes blob_value = 5; + } + } + + message Statement { + string sql = 1; + repeated Value params = 2; // positional + QueryLang lang = 3; + } + + message Batch { + repeated Statement statements = 1; // applied atomically, in order + } + + message Begin {} + message Commit {} + message Rollback {} + message Cancel {} + + message Credit { + uint32 batches = 1; // additional batches the client can absorb + } + + message Ping { + int64 timestamp_ms = 1; + } + + message Pong { + int64 last_ping_timestamp_ms = 1; + int64 timestamp_ms = 2; + } + + message Hello { + string token = 1; + string database_id = 2; + } + + message HelloOk { + int64 tip = 1; + uint32 ping_interval_ms = 2; + uint32 ping_timeout_ms = 3; + } + + message Columns { + repeated string names = 1; + } + + enum ValueType { + NULL = 0; + INT = 1; + DOUBLE = 2; + TEXT = 3; + BLOB = 4; + } + + // Values are typed per row, as SQLite types them, so a column may mix + // classes: walk `types` and take the next entry from the matching array. Text + // and blobs are concatenated with one exclusive end offset each, so value i + // is data[ends[i-1]:ends[i]] with 0 implied before the first. A NULL occupies + // a tag only. + message Column { + bytes types = 1; // one ValueType per row + repeated sint64 ints = 2; + repeated double doubles = 3; + bytes text_data = 4; + repeated uint32 text_ends = 5; + bytes blob_data = 6; + repeated uint32 blob_ends = 7; + } + + message ColumnBatch { + repeated Column columns = 1; // one per name in Columns + uint32 rows = 2; + } + + message ExecResult { + int64 rows_affected = 1; + int64 last_insert_id = 2; + int64 tip = 3; + } + + message Done { + int64 tip = 1; // the snapshot the query ran at + uint64 total_rows = 2; + } + + message Error { + string code = 1; // stable, machine-readable + string message = 2; + } + } +}