From 0228213b1150bb78b5a8ebae466ac1623690f860 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 11 Sep 2025 08:22:18 -0500 Subject: [PATCH] config --- book.gui.pb.go | 394 ++++++ book.marshal.pb.go | 56 + book.pb.go | 355 ++++++ book.sort.pb.go | 283 +++++ chat.gui.pb.go | 387 ++++++ chat.marshal.pb.go | 130 ++ chat.pb.go | 2927 ++++++++++++++++++++++++++++++++++++++++++++ chat.sort.pb.go | 1441 ++++++++++++++++++++++ go.mod | 22 + go.sum | 32 + 10 files changed, 6027 insertions(+) create mode 100644 book.gui.pb.go create mode 100644 book.marshal.pb.go create mode 100644 book.pb.go create mode 100644 book.sort.pb.go create mode 100644 chat.gui.pb.go create mode 100644 chat.marshal.pb.go create mode 100644 chat.pb.go create mode 100644 chat.sort.pb.go create mode 100644 go.mod create mode 100644 go.sum diff --git a/book.gui.pb.go b/book.gui.pb.go new file mode 100644 index 0000000..c0615d0 --- /dev/null +++ b/book.gui.pb.go @@ -0,0 +1,394 @@ +// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. +// This file was autogenerated with autogenpb v0.0.79 2025-09-01_01:52:08_UTC +// go install go.wit.com/apps/autogenpb@latest +// +// define which structs (messages) you want to use in the .proto file +// Then sort.pb.go and marshal.pb.go files are autogenerated +// +// autogenpb uses it and has an example .proto file with instructions +// + +package chatpb + +import ( + "time" + + "github.com/google/uuid" + "go.wit.com/gui" + "go.wit.com/lib/protobuf/guipb" + "go.wit.com/log" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +// START GUI + +func (x *Books) NewTable(title string) *BooksTable { + t := new(BooksTable) + t.x = x + pb := new(guipb.Table) + pb.Title = title + t.pb = pb + return t +} + +func (t *BooksTable) AddStringFunc(title string, f func(*Book) string) *BookStringFunc { + t.pb.Order = append(t.pb.Order, title) + + sf := new(BookStringFunc) + sf.title = title + sf.f = f + sf.order = t.order + t.order += 1 + t.stringFuncs = append(t.stringFuncs, sf) + return sf +} + +func (t *BooksTable) AddButtonFunc(title string, f func(*Book) string) *BookButtonFunc { + t.pb.Order = append(t.pb.Order, title) + + sf := new(BookButtonFunc) + sf.title = title + sf.f = f + sf.order = t.order + t.order += 1 + t.buttonFuncs = append(t.buttonFuncs, sf) + return sf +} + +func (t *BooksTable) AddIntFunc(title string, f func(*Book) int) *BookIntFunc { + t.pb.Order = append(t.pb.Order, title) + + sf := new(BookIntFunc) + sf.title = title + sf.f = f + sf.order = t.order + t.order += 1 + t.intFuncs = append(t.intFuncs, sf) + return sf +} + +func (t *BooksTable) AddTimeFunc(title string, f func(*Book) time.Time) *BookTimeFunc { + t.pb.Order = append(t.pb.Order, title) + + sf := new(BookTimeFunc) + sf.title = title + sf.f = f + sf.order = t.order + t.order += 1 + t.timeFuncs = append(t.timeFuncs, sf) + return sf +} + +func (sf *BookStringFunc) SetTitle(title string) { + sf.title = title +} +func (sf *BookIntFunc) SetTitle(title string) { + sf.title = title +} +func (sf *BookTimeFunc) SetTitle(title string) { + sf.title = title +} + +func (mt *BooksTable) SetParent(p *gui.Node) { + mt.parent = p +} + +func (mt *BooksTable) ShowTable() { + // log.Info("ShowTable() SENDING TO GUI") + mt.MakeTable() + mt.parent.ShowTable(mt.pb) +} + +type BookStringFunc struct { + title string + f func(*Book) string + Custom func(*Book) + order int +} + +type BookButtonFunc struct { + title string + f func(*Book) string + Custom func(*Book) + order int +} + +type BookIntFunc struct { + title string + f func(*Book) int + Custom func(*Book) + order int +} + +type BookTimeFunc struct { + title string + f func(*Book) time.Time + Custom func(*Book) + order int +} + +type BooksTable struct { + pb *guipb.Table + parent *gui.Node + x *Books + hostnames []string + stringFuncs []*BookStringFunc + intFuncs []*BookIntFunc + timeFuncs []*BookTimeFunc + buttonFuncs []*BookButtonFunc + CustomFunc func(*Book) + order int +} + +func (mt *BooksTable) doStringFunc(name string) bool { + for _, sf := range mt.stringFuncs { + if sf.title != name { + continue + } + // log.Info("chatpb: found stringfunc name:", name) + r := new(guipb.StringRow) + r.Header = new(guipb.Widget) + r.Header.Name = name + for m := range mt.x.IterAll() { + r.Vals = append(r.Vals, sf.f(m)) + // log.Info("chatpb: adding", name, r.Vals) + } + mt.pb.StringRows = append(mt.pb.StringRows, r) + return true + } + return false +} + +func (mt *BooksTable) doButtonFunc(name string) bool { + for _, sf := range mt.buttonFuncs { + if sf.title != name { + continue + } + // log.Info("chatpb: found stringfunc name:", name) + r := new(guipb.ButtonRow) + r.Header = new(guipb.Widget) + r.Header.Name = name + for m := range mt.x.IterAll() { + r.Vals = append(r.Vals, sf.f(m)) + // log.Info("chatpb: adding", name, r.Vals) + } + mt.pb.ButtonRows = append(mt.pb.ButtonRows, r) + return true + } + return false +} + +func (mt *BooksTable) doIntFunc(name string) bool { + for _, sf := range mt.intFuncs { + if sf.title != name { + continue + } + // log.Info("chatpb: found intfunc name:", name) + r := new(guipb.IntRow) + r.Header = new(guipb.Widget) + r.Header.Name = name + for m := range mt.x.IterAll() { + r.Vals = append(r.Vals, int64(sf.f(m))) + // log.Info("chatpb: adding", name, r.Vals) + } + mt.pb.IntRows = append(mt.pb.IntRows, r) + return true + } + return false +} + +func (mt *BooksTable) doTimeFunc(name string) bool { + for _, sf := range mt.timeFuncs { + if sf.title != name { + continue + } + // log.Info("chatpb: found timefunc name:", name) + r := new(guipb.TimeRow) + r.Header = new(guipb.Widget) + r.Header.Name = name + for m := range mt.x.IterAll() { + t := sf.f(m) + r.Vals = append(r.Vals, timestamppb.New(t)) // convert to protobuf time + // log.Info("chatpb: adding", name, r.Vals) + } + mt.pb.TimeRows = append(mt.pb.TimeRows, r) + return true + } + return false +} + +func (mt *BooksTable) MakeTable() { + for _, name := range mt.pb.Order { + // log.Info("chatpb: looking for row name()", name) + if mt.doStringFunc(name) { + continue + } + if mt.doIntFunc(name) { + continue + } + if mt.doTimeFunc(name) { + continue + } + if mt.doButtonFunc(name) { + continue + } + } +} + +func (t *BooksTable) AddUuid() *BookStringFunc { + sf := t.AddStringFunc("Uuid", func(m *Book) string { + return m.Uuid + }) + return sf +} + +func (t *BooksTable) AddTitle() *BookStringFunc { + sf := t.AddStringFunc("Title", func(m *Book) string { + return m.Title + }) + return sf +} + +func (t *BooksTable) AddContent() *BookStringFunc { + sf := t.AddStringFunc("Content", func(m *Book) string { + return m.Content + }) + return sf +} +func (mt *BooksTable) NewUuid() { + mt.pb.Uuid = uuid.New().String() +} + +// START TABLE UPDATE +func (mt *BooksTable) todoUpdate() { + for _, name := range mt.pb.Order { + // log.Info("Bookpb: trying to update row()", name) + if mt.updateStringFunc(name) { + continue + } + if mt.updateTimeFunc(name) { + continue + } + /* + if mt.updateIntFunc(name) { + continue + } + */ + } + // mt.dumpStringFunc("Hostname") + mt.parent.UpdateTable(mt.pb) +} + +func (mt *BooksTable) dumpStringFunc(name string) { + for i, r := range mt.pb.StringRows { + // log.Info("could use", i, r.Header.Name, "for name =", name) + if r.Header.Name == name { + log.Info("dump Strings row", i, r.Header.Name, r.Vals) + break + } + } +} + +func (mt *BooksTable) updateStringFunc(name string) bool { + // log.Info("LOOKING FOR STRING row", name) + var found *guipb.StringRow + for _, r := range mt.pb.StringRows { + // log.Info("could use", i, r.Header.Name, "for name =", name) + if r.Header.Name == name { + // log.Info("found row", i, r.Header.Name) + found = r + break + } + } + if found == nil { + log.Info("did not find string row", name) + return false + } + for _, sf := range mt.stringFuncs { + if sf.title != name { + continue + } + // log.Info("Bookpb: starting", name, found.Vals) + for i, _ := range found.Vals { + tmp := sf.f(mt.x.Books[i]) + if tmp == "www.wit.com" { + log.Info("virtpb: FOUND WWW", i) + tmp = "new.www" + } + found.Vals[i] = tmp + } + // log.Info("Bookpb: ending", name, found.Vals) + return true + } + return false +} + +func (mt *BooksTable) updateTimeFunc(name string) bool { + log.Info("LOOKING FOR TIME row", name) + var found *guipb.TimeRow + for i, r := range mt.pb.TimeRows { + // log.Info("could use", i, r.Header.Name, "for name =", name) + if r.Header.Name == name { + log.Info("found row", i, r.Header.Name) + found = r + break + } + } + if found == nil { + log.Info("did not find time row", name) + return false + } + for _, sf := range mt.timeFuncs { + if sf.title != name { + continue + } + // log.Info("updateTimeFunc() has row len =", len(mt.x.Books)) + // log.Info("virtpb: starting", name, found.Vals) + for i, _ := range found.Vals { + newt := sf.f(mt.x.Books[i]) + found.Vals[i] = timestamppb.New(newt) // convert to protobuf time + } + // log.Info("virtpb: ending", name, found.Vals) + return true + } + return false +} + +func (mt *BooksTable) Delete() { + if mt == nil { + log.Info("mt == nil table already deleted") + return + } + // log.Info("table Delete here") + mt.parent.DeleteTable(mt.pb) +} + +func (mt *BooksTable) booksCustom(w *guipb.Widget) { + row := mt.x.Books[w.Location.Y-1] + // log.Info("got to booksCustom() with", w.Location.X, w.Location.Y-1) + + for _, sf := range mt.buttonFuncs { + if sf.order == int(w.Location.X) { + // log.Info("found order", sf.order) + if sf.Custom != nil { + log.Info("doing Custom() func for button") + sf.Custom(row) + return + } + } + } + mt.CustomFunc(row) +} + +func (mt *BooksTable) Custom(f func(*Book)) { + mt.pb.RegisterCustom(mt.booksCustom) + mt.CustomFunc = f +} + +func (mt *BooksTable) GetUuid() string { + return mt.pb.Uuid +} + +// END TABLE UPDATE + +// END GUI diff --git a/book.marshal.pb.go b/book.marshal.pb.go new file mode 100644 index 0000000..ca3c6de --- /dev/null +++ b/book.marshal.pb.go @@ -0,0 +1,56 @@ +// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. +// This file was autogenerated with autogenpb v0.0.79 2025-09-01_01:52:08_UTC +// go install go.wit.com/apps/autogenpb@latest +// +// define which structs (messages) you want to use in the .proto file +// Then sort.pb.go and marshal.pb.go files are autogenerated +// +// autogenpb uses it and has an example .proto file with instructions +// + +package chatpb + +import ( + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" +) + +// human readable JSON +func (v *Books) FormatJSON() string { + return protojson.Format(v) +} + +// marshal json +func (v *Books) MarshalJSON() ([]byte, error) { + return protojson.Marshal(v) +} + +// unmarshal json +func (v *Books) UnmarshalJSON(data []byte) error { + return protojson.Unmarshal(data, v) +} + +// apparently this isn't stable, but it's awesomely better +// https://protobuf.dev/reference/go/faq/#unstable-text +// it's brilliant for config files! +func (v *Books) FormatTEXT() string { + v.fixUuid() + return prototext.Format(v) +} + +// unmarshalTEXT. This reads the .text config file back in after the user edits it +func (v *Books) UnmarshalTEXT(data []byte) error { + return prototext.Unmarshal(data, v) +} + +// marshal to wire. This is called winning. +func (v *Books) Marshal() ([]byte, error) { + v.fixUuid() + return proto.Marshal(v) +} + +// unmarshal from wire. You have won. +func (v *Books) Unmarshal(data []byte) error { + return proto.Unmarshal(data, v) +} diff --git a/book.pb.go b/book.pb.go new file mode 100644 index 0000000..01895a8 --- /dev/null +++ b/book.pb.go @@ -0,0 +1,355 @@ +// Code modified by go.wit.com/apps/autogenpb DO NOT EDIT. +// +// user defined Mutex locks were auto added +// +// autogenpb version & build time: v0.0.79 2025-09-01_01:52:08_UTC +// autogenpb auto generates Sort(), Unique() and Marshal() functions +// go install go.wit.com/apps/autogenpb@latest + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.21.12 +// source: book.proto + +package chatpb // autogenpb changed the package name + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +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 Book struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // `autogenpb:unique` `autogenpb:sort` + Ctime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=ctime,proto3" json:"ctime,omitempty"` + Title string `protobuf:"bytes,3,opt,name=Title,proto3" json:"Title,omitempty"` + Version int32 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` + From Who `protobuf:"varint,5,opt,name=from,proto3,enum=chatpb.Who" json:"from,omitempty"` + Content string `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"` + Table *Table `protobuf:"bytes,7,opt,name=table,proto3" json:"table,omitempty"` + GeminiRequest *GeminiRequest `protobuf:"bytes,8,opt,name=GeminiRequest,proto3" json:"GeminiRequest,omitempty"` +} + +func (x *Book) Reset() { + *x = Book{} + if protoimpl.UnsafeEnabled { + mi := &file_book_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Book) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Book) ProtoMessage() {} + +func (x *Book) ProtoReflect() protoreflect.Message { + mi := &file_book_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Book.ProtoReflect.Descriptor instead. +func (*Book) Descriptor() ([]byte, []int) { + return file_book_proto_rawDescGZIP(), []int{0} +} + +func (x *Book) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *Book) GetCtime() *timestamppb.Timestamp { + if x != nil { + return x.Ctime + } + return nil +} + +func (x *Book) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Book) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *Book) GetFrom() Who { + if x != nil { + return x.From + } + return Who_NOONE +} + +func (x *Book) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *Book) GetTable() *Table { + if x != nil { + return x.Table + } + return nil +} + +func (x *Book) GetGeminiRequest() *GeminiRequest { + if x != nil { + return x.GeminiRequest + } + return nil +} + +type Books struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // `autogenpb:uuid:8b6409ad-4498-43a6-b09a-7835c00dcb9a` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v0.0.1` + Books []*Book `protobuf:"bytes,3,rep,name=Books,proto3" json:"Books,omitempty"` // THIS MUST BE Chat and then Chats + Ctime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=ctime,proto3" json:"ctime,omitempty"` + Title string `protobuf:"bytes,5,opt,name=Title,proto3" json:"Title,omitempty"` + TitleUuid string `protobuf:"bytes,6,opt,name=TitleUuid,proto3" json:"TitleUuid,omitempty"` +} + +func (x *Books) Reset() { + *x = Books{} + if protoimpl.UnsafeEnabled { + mi := &file_book_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Books) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Books) ProtoMessage() {} + +func (x *Books) ProtoReflect() protoreflect.Message { + mi := &file_book_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Books.ProtoReflect.Descriptor instead. +func (*Books) Descriptor() ([]byte, []int) { + return file_book_proto_rawDescGZIP(), []int{1} +} + +func (x *Books) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *Books) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Books) GetBooks() []*Book { + if x != nil { + return x.Books + } + return nil +} + +func (x *Books) GetCtime() *timestamppb.Timestamp { + if x != nil { + return x.Ctime + } + return nil +} + +func (x *Books) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Books) GetTitleUuid() string { + if x != nil { + return x.TitleUuid + } + return "" +} + +var File_book_proto protoreflect.FileDescriptor + +var file_book_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x68, + 0x61, 0x74, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x99, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x6f, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x05, + 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, + 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x63, + 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x57, 0x68, 0x6f, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, + 0x62, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3b, + 0x0a, 0x0d, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x47, 0x65, + 0x6d, 0x69, 0x6e, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xbf, 0x01, 0x0a, 0x05, + 0x42, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x05, 0x42, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, + 0x52, 0x05, 0x42, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x30, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x55, 0x75, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x55, 0x75, 0x69, 0x64, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_book_proto_rawDescOnce sync.Once + file_book_proto_rawDescData = file_book_proto_rawDesc +) + +func file_book_proto_rawDescGZIP() []byte { + file_book_proto_rawDescOnce.Do(func() { + file_book_proto_rawDescData = protoimpl.X.CompressGZIP(file_book_proto_rawDescData) + }) + return file_book_proto_rawDescData +} + +var file_book_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_book_proto_goTypes = []interface{}{ + (*Book)(nil), // 0: chatpb.Book + (*Books)(nil), // 1: chatpb.Books + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (Who)(0), // 3: chatpb.Who + (*Table)(nil), // 4: chatpb.Table + (*GeminiRequest)(nil), // 5: chatpb.GeminiRequest +} +var file_book_proto_depIdxs = []int32{ + 2, // 0: chatpb.Book.ctime:type_name -> google.protobuf.Timestamp + 3, // 1: chatpb.Book.from:type_name -> chatpb.Who + 4, // 2: chatpb.Book.table:type_name -> chatpb.Table + 5, // 3: chatpb.Book.GeminiRequest:type_name -> chatpb.GeminiRequest + 0, // 4: chatpb.Books.Books:type_name -> chatpb.Book + 2, // 5: chatpb.Books.ctime:type_name -> google.protobuf.Timestamp + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_book_proto_init() } +func file_book_proto_init() { + if File_book_proto != nil { + return + } + file_chat_proto_init() + if !protoimpl.UnsafeEnabled { + file_book_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Book); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_book_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Books); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_book_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_book_proto_goTypes, + DependencyIndexes: file_book_proto_depIdxs, + MessageInfos: file_book_proto_msgTypes, + }.Build() + File_book_proto = out.File + file_book_proto_rawDesc = nil + file_book_proto_goTypes = nil + file_book_proto_depIdxs = nil +} diff --git a/book.sort.pb.go b/book.sort.pb.go new file mode 100644 index 0000000..d4e9f3f --- /dev/null +++ b/book.sort.pb.go @@ -0,0 +1,283 @@ +// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. +// This file was autogenerated with autogenpb v0.0.79 2025-09-01_01:52:08_UTC +// go install go.wit.com/apps/autogenpb@latest +// +// define which structs (messages) you want to use in the .proto file +// Then sort.pb.go and marshal.pb.go files are autogenerated +// +// autogenpb uses it and has an example .proto file with instructions +// + +package chatpb + +import ( + "fmt" + "iter" + "sort" + "sync" + + "google.golang.org/protobuf/proto" +) + +// a simple global lock +var bookMu sync.RWMutex + +func (x *Books) fixUuid() { + if x == nil { + return + } + if x.Uuid == "8b6409ad-4498-43a6-b09a-7835c00dcb9a" { + return + } + x.Uuid = "8b6409ad-4498-43a6-b09a-7835c00dcb9a" + x.Version = "v0.0.1 go.wit.com/lib/protobuf/chatpb" +} + +func NewBooks() *Books { + x := new(Books) + x.Uuid = "8b6409ad-4498-43a6-b09a-7835c00dcb9a" + x.Version = "v0.0.1 go.wit.com/lib/protobuf/chatpb" + return x +} + +// START SORT + +// DEFINE THE Books SCANNER. +// itializes a new scanner. +func newBooksScanner(things []*Books) *BooksScanner { + return &BooksScanner{things: things} +} + +type BooksScanner struct { + sync.Mutex + + things []*Books + index int +} + +func (it *BooksScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *BooksScanner) Next() *Books { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in BooksScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Book SCANNER. +// itializes a new scanner. +func newBookScanner(things []*Book) *BookScanner { + return &BookScanner{things: things} +} + +type BookScanner struct { + sync.Mutex + + things []*Book + index int +} + +func (it *BookScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *BookScanner) Next() *Book { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in BookScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// sort struct by Uuid +type sortBookUuid []*Book + +func (a sortBookUuid) Len() int { return len(a) } +func (a sortBookUuid) Less(i, j int) bool { return a[i].Uuid < a[j].Uuid } +func (a sortBookUuid) Swap(i, j int) { a[i], a[j] = a[j], a[i] } + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *Books) allBooks() []*Book { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*Book + tmp = make([]*Book, len(x.Books)) + for i, p := range x.Books { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the Book protobufs +func (x *Books) selectAllBooks() []*Book { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each Book + var tmp []*Book + tmp = make([]*Book, len(x.Books)) + for i, p := range x.Books { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} +func (x *Books) SortByUuid() *BookScanner { + // copy the pointers as fast as possible. + things := x.selectAllBooks() + + // todo: try slices.SortFunc() instead to see what happens + sort.Sort(sortBookUuid(things)) + // slices.SortFunc(things, func(a, b *Books) bool { + // return a.Uuid < b.Uuid // Sort by ??. let the compiler work it out?? + // }) + return newBookScanner(things) +} + +// 'for x := range' syntax using the awesome golang 1.24 'iter' +func (x *Books) IterByUuid() iter.Seq[*Book] { + items := x.selectAllBooks() + sort.Sort(sortBookUuid(items)) + // log.Println("Made Iter.Seq[] with length", len(items)) + return func(yield func(*Book) bool) { + for _, v := range items { + if !yield(v) { + return + } + } + } +} + +// END SORT + +func (x *Books) Len() int { + x.RLock() + defer x.RUnlock() + + return len(x.Books) +} + +// a Append() shortcut (that does Clone() with a mutex) notsure if it really works +func (x *Books) Append(y *Book) { + x.Lock() + defer x.Unlock() + + x.Books = append(x.Books, proto.Clone(y).(*Book)) +} + +func (x *Books) All() *BookScanner { + BookPointers := x.selectAllBooks() + + scanner := newBookScanner(BookPointers) + return scanner +} + +// Iterate 'for x := range' syntax using the awesome golang 1.24 'iter' +func (x *Books) IterAll() iter.Seq[*Book] { + items := x.selectAllBooks() + // log.Println("Made All() Iter.Seq[] with length", len(items)) + return func(yield func(*Book) bool) { + for _, v := range items { + if !yield(v) { + return + } + } + } +} +func (x *Books) Delete(y *Book) bool { + x.Lock() + defer x.Unlock() + + for i, _ := range x.Books { + if x.Books[i] == y { + x.Books[i] = x.Books[len(x.Books)-1] + x.Books = x.Books[:len(x.Books)-1] + return true + } + } + return false +} + +// lookup a Books by the Uuid +func (x *Books) FindByUuid(s string) *Book { + if x == nil { + return nil + } + + x.RLock() + defer x.RUnlock() + + for i, _ := range x.Books { + if x.Books[i].Uuid == s { + return x.Books[i] + } + } + return nil +} + +// returns a Book if Uuid matches, otherwise create +func (x *Books) InsertByUuid(y string) *Book { + x.Lock() + defer x.Unlock() + + for _, z := range x.Books { + if z.Uuid == y { + return z + } + } + + z := new(Book) + z.Uuid = y + x.Books = append(x.Books, z) + return z +} + +func (x *Books) DeleteByUuid(s string) bool { + x.Lock() + defer x.Unlock() + + for i, _ := range x.Books { + if x.Books[i].Uuid == s { + x.Books[i] = x.Books[len(x.Books)-1] + x.Books = x.Books[:len(x.Books)-1] + return true + } + } + return false +} + +func (x *Books) AppendByUuid(y *Book) bool { + x.Lock() + defer x.Unlock() + + for _, p := range x.Books { + if p.Uuid == y.Uuid { + return false + } + } + + x.Books = append(x.Books, proto.Clone(y).(*Book)) + return true +} diff --git a/chat.gui.pb.go b/chat.gui.pb.go new file mode 100644 index 0000000..541edbf --- /dev/null +++ b/chat.gui.pb.go @@ -0,0 +1,387 @@ +// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. +// This file was autogenerated with autogenpb v0.0.79 2025-09-01_01:52:08_UTC +// go install go.wit.com/apps/autogenpb@latest +// +// define which structs (messages) you want to use in the .proto file +// Then sort.pb.go and marshal.pb.go files are autogenerated +// +// autogenpb uses it and has an example .proto file with instructions +// + +package chatpb + +import ( + "time" + + "github.com/google/uuid" + "go.wit.com/gui" + "go.wit.com/lib/protobuf/guipb" + "go.wit.com/log" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +// START GUI + +func (x *Chats) NewTable(title string) *ChatsTable { + t := new(ChatsTable) + t.x = x + pb := new(guipb.Table) + pb.Title = title + t.pb = pb + return t +} + +func (t *ChatsTable) AddStringFunc(title string, f func(*Chat) string) *ChatStringFunc { + t.pb.Order = append(t.pb.Order, title) + + sf := new(ChatStringFunc) + sf.title = title + sf.f = f + sf.order = t.order + t.order += 1 + t.stringFuncs = append(t.stringFuncs, sf) + return sf +} + +func (t *ChatsTable) AddButtonFunc(title string, f func(*Chat) string) *ChatButtonFunc { + t.pb.Order = append(t.pb.Order, title) + + sf := new(ChatButtonFunc) + sf.title = title + sf.f = f + sf.order = t.order + t.order += 1 + t.buttonFuncs = append(t.buttonFuncs, sf) + return sf +} + +func (t *ChatsTable) AddIntFunc(title string, f func(*Chat) int) *ChatIntFunc { + t.pb.Order = append(t.pb.Order, title) + + sf := new(ChatIntFunc) + sf.title = title + sf.f = f + sf.order = t.order + t.order += 1 + t.intFuncs = append(t.intFuncs, sf) + return sf +} + +func (t *ChatsTable) AddTimeFunc(title string, f func(*Chat) time.Time) *ChatTimeFunc { + t.pb.Order = append(t.pb.Order, title) + + sf := new(ChatTimeFunc) + sf.title = title + sf.f = f + sf.order = t.order + t.order += 1 + t.timeFuncs = append(t.timeFuncs, sf) + return sf +} + +func (sf *ChatStringFunc) SetTitle(title string) { + sf.title = title +} +func (sf *ChatIntFunc) SetTitle(title string) { + sf.title = title +} +func (sf *ChatTimeFunc) SetTitle(title string) { + sf.title = title +} + +func (mt *ChatsTable) SetParent(p *gui.Node) { + mt.parent = p +} + +func (mt *ChatsTable) ShowTable() { + // log.Info("ShowTable() SENDING TO GUI") + mt.MakeTable() + mt.parent.ShowTable(mt.pb) +} + +type ChatStringFunc struct { + title string + f func(*Chat) string + Custom func(*Chat) + order int +} + +type ChatButtonFunc struct { + title string + f func(*Chat) string + Custom func(*Chat) + order int +} + +type ChatIntFunc struct { + title string + f func(*Chat) int + Custom func(*Chat) + order int +} + +type ChatTimeFunc struct { + title string + f func(*Chat) time.Time + Custom func(*Chat) + order int +} + +type ChatsTable struct { + pb *guipb.Table + parent *gui.Node + x *Chats + hostnames []string + stringFuncs []*ChatStringFunc + intFuncs []*ChatIntFunc + timeFuncs []*ChatTimeFunc + buttonFuncs []*ChatButtonFunc + CustomFunc func(*Chat) + order int +} + +func (mt *ChatsTable) doStringFunc(name string) bool { + for _, sf := range mt.stringFuncs { + if sf.title != name { + continue + } + // log.Info("chatpb: found stringfunc name:", name) + r := new(guipb.StringRow) + r.Header = new(guipb.Widget) + r.Header.Name = name + for m := range mt.x.IterAll() { + r.Vals = append(r.Vals, sf.f(m)) + // log.Info("chatpb: adding", name, r.Vals) + } + mt.pb.StringRows = append(mt.pb.StringRows, r) + return true + } + return false +} + +func (mt *ChatsTable) doButtonFunc(name string) bool { + for _, sf := range mt.buttonFuncs { + if sf.title != name { + continue + } + // log.Info("chatpb: found stringfunc name:", name) + r := new(guipb.ButtonRow) + r.Header = new(guipb.Widget) + r.Header.Name = name + for m := range mt.x.IterAll() { + r.Vals = append(r.Vals, sf.f(m)) + // log.Info("chatpb: adding", name, r.Vals) + } + mt.pb.ButtonRows = append(mt.pb.ButtonRows, r) + return true + } + return false +} + +func (mt *ChatsTable) doIntFunc(name string) bool { + for _, sf := range mt.intFuncs { + if sf.title != name { + continue + } + // log.Info("chatpb: found intfunc name:", name) + r := new(guipb.IntRow) + r.Header = new(guipb.Widget) + r.Header.Name = name + for m := range mt.x.IterAll() { + r.Vals = append(r.Vals, int64(sf.f(m))) + // log.Info("chatpb: adding", name, r.Vals) + } + mt.pb.IntRows = append(mt.pb.IntRows, r) + return true + } + return false +} + +func (mt *ChatsTable) doTimeFunc(name string) bool { + for _, sf := range mt.timeFuncs { + if sf.title != name { + continue + } + // log.Info("chatpb: found timefunc name:", name) + r := new(guipb.TimeRow) + r.Header = new(guipb.Widget) + r.Header.Name = name + for m := range mt.x.IterAll() { + t := sf.f(m) + r.Vals = append(r.Vals, timestamppb.New(t)) // convert to protobuf time + // log.Info("chatpb: adding", name, r.Vals) + } + mt.pb.TimeRows = append(mt.pb.TimeRows, r) + return true + } + return false +} + +func (mt *ChatsTable) MakeTable() { + for _, name := range mt.pb.Order { + // log.Info("chatpb: looking for row name()", name) + if mt.doStringFunc(name) { + continue + } + if mt.doIntFunc(name) { + continue + } + if mt.doTimeFunc(name) { + continue + } + if mt.doButtonFunc(name) { + continue + } + } +} + +func (t *ChatsTable) AddUuid() *ChatStringFunc { + sf := t.AddStringFunc("Uuid", func(m *Chat) string { + return m.Uuid + }) + return sf +} + +func (t *ChatsTable) AddChatName() *ChatStringFunc { + sf := t.AddStringFunc("ChatName", func(m *Chat) string { + return m.ChatName + }) + return sf +} +func (mt *ChatsTable) NewUuid() { + mt.pb.Uuid = uuid.New().String() +} + +// START TABLE UPDATE +func (mt *ChatsTable) todoUpdate() { + for _, name := range mt.pb.Order { + // log.Info("Chatpb: trying to update row()", name) + if mt.updateStringFunc(name) { + continue + } + if mt.updateTimeFunc(name) { + continue + } + /* + if mt.updateIntFunc(name) { + continue + } + */ + } + // mt.dumpStringFunc("Hostname") + mt.parent.UpdateTable(mt.pb) +} + +func (mt *ChatsTable) dumpStringFunc(name string) { + for i, r := range mt.pb.StringRows { + // log.Info("could use", i, r.Header.Name, "for name =", name) + if r.Header.Name == name { + log.Info("dump Strings row", i, r.Header.Name, r.Vals) + break + } + } +} + +func (mt *ChatsTable) updateStringFunc(name string) bool { + // log.Info("LOOKING FOR STRING row", name) + var found *guipb.StringRow + for _, r := range mt.pb.StringRows { + // log.Info("could use", i, r.Header.Name, "for name =", name) + if r.Header.Name == name { + // log.Info("found row", i, r.Header.Name) + found = r + break + } + } + if found == nil { + log.Info("did not find string row", name) + return false + } + for _, sf := range mt.stringFuncs { + if sf.title != name { + continue + } + // log.Info("Chatpb: starting", name, found.Vals) + for i, _ := range found.Vals { + tmp := sf.f(mt.x.Chats[i]) + if tmp == "www.wit.com" { + log.Info("virtpb: FOUND WWW", i) + tmp = "new.www" + } + found.Vals[i] = tmp + } + // log.Info("Chatpb: ending", name, found.Vals) + return true + } + return false +} + +func (mt *ChatsTable) updateTimeFunc(name string) bool { + log.Info("LOOKING FOR TIME row", name) + var found *guipb.TimeRow + for i, r := range mt.pb.TimeRows { + // log.Info("could use", i, r.Header.Name, "for name =", name) + if r.Header.Name == name { + log.Info("found row", i, r.Header.Name) + found = r + break + } + } + if found == nil { + log.Info("did not find time row", name) + return false + } + for _, sf := range mt.timeFuncs { + if sf.title != name { + continue + } + // log.Info("updateTimeFunc() has row len =", len(mt.x.Chats)) + // log.Info("virtpb: starting", name, found.Vals) + for i, _ := range found.Vals { + newt := sf.f(mt.x.Chats[i]) + found.Vals[i] = timestamppb.New(newt) // convert to protobuf time + } + // log.Info("virtpb: ending", name, found.Vals) + return true + } + return false +} + +func (mt *ChatsTable) Delete() { + if mt == nil { + log.Info("mt == nil table already deleted") + return + } + // log.Info("table Delete here") + mt.parent.DeleteTable(mt.pb) +} + +func (mt *ChatsTable) chatsCustom(w *guipb.Widget) { + row := mt.x.Chats[w.Location.Y-1] + // log.Info("got to chatsCustom() with", w.Location.X, w.Location.Y-1) + + for _, sf := range mt.buttonFuncs { + if sf.order == int(w.Location.X) { + // log.Info("found order", sf.order) + if sf.Custom != nil { + log.Info("doing Custom() func for button") + sf.Custom(row) + return + } + } + } + mt.CustomFunc(row) +} + +func (mt *ChatsTable) Custom(f func(*Chat)) { + mt.pb.RegisterCustom(mt.chatsCustom) + mt.CustomFunc = f +} + +func (mt *ChatsTable) GetUuid() string { + return mt.pb.Uuid +} + +// END TABLE UPDATE + +// END GUI diff --git a/chat.marshal.pb.go b/chat.marshal.pb.go new file mode 100644 index 0000000..3120e24 --- /dev/null +++ b/chat.marshal.pb.go @@ -0,0 +1,130 @@ +// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. +// This file was autogenerated with autogenpb v0.0.79 2025-09-01_01:52:08_UTC +// go install go.wit.com/apps/autogenpb@latest +// +// define which structs (messages) you want to use in the .proto file +// Then sort.pb.go and marshal.pb.go files are autogenerated +// +// autogenpb uses it and has an example .proto file with instructions +// + +package chatpb + +import ( + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" +) + +// human readable JSON +func (v *Chats) FormatJSON() string { + return protojson.Format(v) +} + +// marshal json +func (v *Chats) MarshalJSON() ([]byte, error) { + return protojson.Marshal(v) +} + +// unmarshal json +func (v *Chats) UnmarshalJSON(data []byte) error { + return protojson.Unmarshal(data, v) +} + +// apparently this isn't stable, but it's awesomely better +// https://protobuf.dev/reference/go/faq/#unstable-text +// it's brilliant for config files! +func (v *Chats) FormatTEXT() string { + v.fixUuid() + return prototext.Format(v) +} + +// unmarshalTEXT. This reads the .text config file back in after the user edits it +func (v *Chats) UnmarshalTEXT(data []byte) error { + return prototext.Unmarshal(data, v) +} + +// marshal to wire. This is called winning. +func (v *Chats) Marshal() ([]byte, error) { + v.fixUuid() + return proto.Marshal(v) +} + +// unmarshal from wire. You have won. +func (v *Chats) Unmarshal(data []byte) error { + return proto.Unmarshal(data, v) +} + +// human readable JSON +func (v *GeminiRequest) FormatJSON() string { + return protojson.Format(v) +} + +// marshal json +func (v *GeminiRequest) MarshalJSON() ([]byte, error) { + return protojson.Marshal(v) +} + +// unmarshal json +func (v *GeminiRequest) UnmarshalJSON(data []byte) error { + return protojson.Unmarshal(data, v) +} + +// apparently this isn't stable, but it's awesomely better +// https://protobuf.dev/reference/go/faq/#unstable-text +// it's brilliant for config files! +func (v *GeminiRequest) FormatTEXT() string { + return prototext.Format(v) +} + +// unmarshalTEXT. This reads the .text config file back in after the user edits it +func (v *GeminiRequest) UnmarshalTEXT(data []byte) error { + return prototext.Unmarshal(data, v) +} + +// marshal to wire. This is called winning. +func (v *GeminiRequest) Marshal() ([]byte, error) { + return proto.Marshal(v) +} + +// unmarshal from wire. You have won. +func (v *GeminiRequest) Unmarshal(data []byte) error { + return proto.Unmarshal(data, v) +} + +// human readable JSON +func (v *ChatEntry) FormatJSON() string { + return protojson.Format(v) +} + +// marshal json +func (v *ChatEntry) MarshalJSON() ([]byte, error) { + return protojson.Marshal(v) +} + +// unmarshal json +func (v *ChatEntry) UnmarshalJSON(data []byte) error { + return protojson.Unmarshal(data, v) +} + +// apparently this isn't stable, but it's awesomely better +// https://protobuf.dev/reference/go/faq/#unstable-text +// it's brilliant for config files! +func (v *ChatEntry) FormatTEXT() string { + return prototext.Format(v) +} + +// unmarshalTEXT. This reads the .text config file back in after the user edits it +func (v *ChatEntry) UnmarshalTEXT(data []byte) error { + return prototext.Unmarshal(data, v) +} + +// marshal to wire. This is called winning. +func (v *ChatEntry) Marshal() ([]byte, error) { + return proto.Marshal(v) +} + +// unmarshal from wire. You have won. +func (v *ChatEntry) Unmarshal(data []byte) error { + return proto.Unmarshal(data, v) +} diff --git a/chat.pb.go b/chat.pb.go new file mode 100644 index 0000000..cc5c5b1 --- /dev/null +++ b/chat.pb.go @@ -0,0 +1,2927 @@ +// Code modified by go.wit.com/apps/autogenpb DO NOT EDIT. +// +// user defined Mutex locks were auto added +// +// autogenpb version & build time: v0.0.79 2025-09-01_01:52:08_UTC +// autogenpb auto generates Sort(), Unique() and Marshal() functions +// go install go.wit.com/apps/autogenpb@latest + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.21.12 +// source: chat.proto + +package chatpb // autogenpb changed the package name + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +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 Who int32 + +const ( + Who_NOONE Who = 0 + Who_REGEX Who = 1 + Who_USER Who = 2 +) + +// Enum value maps for Who. +var ( + Who_name = map[int32]string{ + 0: "NOONE", + 1: "REGEX", + 2: "USER", + } + Who_value = map[string]int32{ + "NOONE": 0, + "REGEX": 1, + "USER": 2, + } +) + +func (x Who) Enum() *Who { + p := new(Who) + *p = x + return p +} + +func (x Who) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Who) Descriptor() protoreflect.EnumDescriptor { + return file_chat_proto_enumTypes[0].Descriptor() +} + +func (Who) Type() protoreflect.EnumType { + return &file_chat_proto_enumTypes[0] +} + +func (x Who) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Who.Descriptor instead. +func (Who) EnumDescriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{0} +} + +type GeminiRequest struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` + Config *Config `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` + Contents []*Content `protobuf:"bytes,3,rep,name=contents,proto3" json:"contents,omitempty"` +} + +func (x *GeminiRequest) Reset() { + *x = GeminiRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GeminiRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GeminiRequest) ProtoMessage() {} + +func (x *GeminiRequest) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GeminiRequest.ProtoReflect.Descriptor instead. +func (*GeminiRequest) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{0} +} + +func (x *GeminiRequest) GetModel() string { + if x != nil { + return x.Model + } + return "" +} + +func (x *GeminiRequest) GetConfig() *Config { + if x != nil { + return x.Config + } + return nil +} + +func (x *GeminiRequest) GetContents() []*Content { + if x != nil { + return x.Contents + } + return nil +} + +// Abort signal for the request +type AbortSignal struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AbortSignal) Reset() { + *x = AbortSignal{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AbortSignal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AbortSignal) ProtoMessage() {} + +func (x *AbortSignal) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AbortSignal.ProtoReflect.Descriptor instead. +func (*AbortSignal) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{1} +} + +type Schema struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Properties map[string]*Schema `protobuf:"bytes,2,rep,name=properties,proto3" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Required []string `protobuf:"bytes,3,rep,name=required,proto3" json:"required,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + Items *Schema `protobuf:"bytes,5,opt,name=items,proto3" json:"items,omitempty"` + Enum []string `protobuf:"bytes,6,rep,name=enum,proto3" json:"enum,omitempty"` + Minimum int32 `protobuf:"varint,7,opt,name=minimum,proto3" json:"minimum,omitempty"` + MinLength int32 `protobuf:"varint,8,opt,name=minLength,proto3" json:"minLength,omitempty"` + MinItems int32 `protobuf:"varint,9,opt,name=minItems,proto3" json:"minItems,omitempty"` + DefaultValue *structpb.Value `protobuf:"bytes,10,opt,name=default_value,json=default,proto3" json:"default_value,omitempty"` +} + +func (x *Schema) Reset() { + *x = Schema{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Schema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Schema) ProtoMessage() {} + +func (x *Schema) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Schema.ProtoReflect.Descriptor instead. +func (*Schema) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{2} +} + +func (x *Schema) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Schema) GetProperties() map[string]*Schema { + if x != nil { + return x.Properties + } + return nil +} + +func (x *Schema) GetRequired() []string { + if x != nil { + return x.Required + } + return nil +} + +func (x *Schema) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Schema) GetItems() *Schema { + if x != nil { + return x.Items + } + return nil +} + +func (x *Schema) GetEnum() []string { + if x != nil { + return x.Enum + } + return nil +} + +func (x *Schema) GetMinimum() int32 { + if x != nil { + return x.Minimum + } + return 0 +} + +func (x *Schema) GetMinLength() int32 { + if x != nil { + return x.MinLength + } + return 0 +} + +func (x *Schema) GetMinItems() int32 { + if x != nil { + return x.MinItems + } + return 0 +} + +func (x *Schema) GetDefaultValue() *structpb.Value { + if x != nil { + return x.DefaultValue + } + return nil +} + +type FunctionDeclaration struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ParametersJsonSchema *Schema `protobuf:"bytes,3,opt,name=parameters_json_schema,json=parametersJsonSchema,proto3" json:"parameters_json_schema,omitempty"` +} + +func (x *FunctionDeclaration) Reset() { + *x = FunctionDeclaration{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FunctionDeclaration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FunctionDeclaration) ProtoMessage() {} + +func (x *FunctionDeclaration) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FunctionDeclaration.ProtoReflect.Descriptor instead. +func (*FunctionDeclaration) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{3} +} + +func (x *FunctionDeclaration) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FunctionDeclaration) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *FunctionDeclaration) GetParametersJsonSchema() *Schema { + if x != nil { + return x.ParametersJsonSchema + } + return nil +} + +type GoogleSearch struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GoogleSearch) Reset() { + *x = GoogleSearch{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GoogleSearch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GoogleSearch) ProtoMessage() {} + +func (x *GoogleSearch) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GoogleSearch.ProtoReflect.Descriptor instead. +func (*GoogleSearch) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{4} +} + +type Tool struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FunctionDeclarations []*FunctionDeclaration `protobuf:"bytes,1,rep,name=functionDeclarations,proto3" json:"functionDeclarations,omitempty"` + GoogleSearch *GoogleSearch `protobuf:"bytes,2,opt,name=googleSearch,proto3" json:"googleSearch,omitempty"` +} + +func (x *Tool) Reset() { + *x = Tool{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Tool) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Tool) ProtoMessage() {} + +func (x *Tool) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Tool.ProtoReflect.Descriptor instead. +func (*Tool) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{5} +} + +func (x *Tool) GetFunctionDeclarations() []*FunctionDeclaration { + if x != nil { + return x.FunctionDeclarations + } + return nil +} + +func (x *Tool) GetGoogleSearch() *GoogleSearch { + if x != nil { + return x.GoogleSearch + } + return nil +} + +// Configuration for the request +type Config struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Temperature float64 `protobuf:"fixed64,2,opt,name=temperature,proto3" json:"temperature,omitempty"` + TopP float64 `protobuf:"fixed64,3,opt,name=topP,proto3" json:"topP,omitempty"` + SystemInstruction string `protobuf:"bytes,4,opt,name=systemInstruction,proto3" json:"systemInstruction,omitempty"` + ResponseJsonSchema *ResponseJsonSchema `protobuf:"bytes,5,opt,name=responseJsonSchema,proto3" json:"responseJsonSchema,omitempty"` + ResponseMimeType string `protobuf:"bytes,6,opt,name=responseMimeType,proto3" json:"responseMimeType,omitempty"` + AbortSignal *AbortSignal `protobuf:"bytes,7,opt,name=abort_signal,json=abortSignal,proto3" json:"abort_signal,omitempty"` + ThinkingConfig *Config_ThinkingConfig `protobuf:"bytes,8,opt,name=thinkingConfig,proto3" json:"thinkingConfig,omitempty"` + Tools []*Tool `protobuf:"bytes,9,rep,name=tools,proto3" json:"tools,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{6} +} + +func (x *Config) GetTemperature() float64 { + if x != nil { + return x.Temperature + } + return 0 +} + +func (x *Config) GetTopP() float64 { + if x != nil { + return x.TopP + } + return 0 +} + +func (x *Config) GetSystemInstruction() string { + if x != nil { + return x.SystemInstruction + } + return "" +} + +func (x *Config) GetResponseJsonSchema() *ResponseJsonSchema { + if x != nil { + return x.ResponseJsonSchema + } + return nil +} + +func (x *Config) GetResponseMimeType() string { + if x != nil { + return x.ResponseMimeType + } + return "" +} + +func (x *Config) GetAbortSignal() *AbortSignal { + if x != nil { + return x.AbortSignal + } + return nil +} + +func (x *Config) GetThinkingConfig() *Config_ThinkingConfig { + if x != nil { + return x.ThinkingConfig + } + return nil +} + +func (x *Config) GetTools() []*Tool { + if x != nil { + return x.Tools + } + return nil +} + +// JSON schema for the response +type ResponseJsonSchema struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Properties *Properties `protobuf:"bytes,2,opt,name=properties,proto3" json:"properties,omitempty"` + Required []string `protobuf:"bytes,3,rep,name=required,proto3" json:"required,omitempty"` +} + +func (x *ResponseJsonSchema) Reset() { + *x = ResponseJsonSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResponseJsonSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResponseJsonSchema) ProtoMessage() {} + +func (x *ResponseJsonSchema) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResponseJsonSchema.ProtoReflect.Descriptor instead. +func (*ResponseJsonSchema) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{7} +} + +func (x *ResponseJsonSchema) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *ResponseJsonSchema) GetProperties() *Properties { + if x != nil { + return x.Properties + } + return nil +} + +func (x *ResponseJsonSchema) GetRequired() []string { + if x != nil { + return x.Required + } + return nil +} + +// Properties within the JSON schema +type Properties struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reasoning *Reasoning `protobuf:"bytes,1,opt,name=reasoning,proto3" json:"reasoning,omitempty"` + NextSpeaker *NextSpeaker `protobuf:"bytes,2,opt,name=next_speaker,json=nextSpeaker,proto3" json:"next_speaker,omitempty"` + CorrectedNewStringEscaping *CorrectedNewStringEscaping `protobuf:"bytes,3,opt,name=corrected_new_string_escaping,json=correctedNewStringEscaping,proto3" json:"corrected_new_string_escaping,omitempty"` + CorrectedTargetSnippet *CorrectedTargetSnippet `protobuf:"bytes,4,opt,name=corrected_target_snippet,json=correctedTargetSnippet,proto3" json:"corrected_target_snippet,omitempty"` + Confidence *Confidence `protobuf:"bytes,5,opt,name=confidence,proto3" json:"confidence,omitempty"` +} + +func (x *Properties) Reset() { + *x = Properties{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Properties) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Properties) ProtoMessage() {} + +func (x *Properties) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Properties.ProtoReflect.Descriptor instead. +func (*Properties) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{8} +} + +func (x *Properties) GetReasoning() *Reasoning { + if x != nil { + return x.Reasoning + } + return nil +} + +func (x *Properties) GetNextSpeaker() *NextSpeaker { + if x != nil { + return x.NextSpeaker + } + return nil +} + +func (x *Properties) GetCorrectedNewStringEscaping() *CorrectedNewStringEscaping { + if x != nil { + return x.CorrectedNewStringEscaping + } + return nil +} + +func (x *Properties) GetCorrectedTargetSnippet() *CorrectedTargetSnippet { + if x != nil { + return x.CorrectedTargetSnippet + } + return nil +} + +func (x *Properties) GetConfidence() *Confidence { + if x != nil { + return x.Confidence + } + return nil +} + +type Confidence struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *Confidence) Reset() { + *x = Confidence{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Confidence) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Confidence) ProtoMessage() {} + +func (x *Confidence) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Confidence.ProtoReflect.Descriptor instead. +func (*Confidence) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{9} +} + +func (x *Confidence) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Confidence) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type CorrectedTargetSnippet struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *CorrectedTargetSnippet) Reset() { + *x = CorrectedTargetSnippet{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CorrectedTargetSnippet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CorrectedTargetSnippet) ProtoMessage() {} + +func (x *CorrectedTargetSnippet) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CorrectedTargetSnippet.ProtoReflect.Descriptor instead. +func (*CorrectedTargetSnippet) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{10} +} + +func (x *CorrectedTargetSnippet) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *CorrectedTargetSnippet) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +// Reasoning property +type CorrectedNewStringEscaping struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *CorrectedNewStringEscaping) Reset() { + *x = CorrectedNewStringEscaping{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CorrectedNewStringEscaping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CorrectedNewStringEscaping) ProtoMessage() {} + +func (x *CorrectedNewStringEscaping) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CorrectedNewStringEscaping.ProtoReflect.Descriptor instead. +func (*CorrectedNewStringEscaping) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{11} +} + +func (x *CorrectedNewStringEscaping) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *CorrectedNewStringEscaping) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type Reasoning struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *Reasoning) Reset() { + *x = Reasoning{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Reasoning) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Reasoning) ProtoMessage() {} + +func (x *Reasoning) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Reasoning.ProtoReflect.Descriptor instead. +func (*Reasoning) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{12} +} + +func (x *Reasoning) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Reasoning) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +// Next speaker property +type NextSpeaker struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Enum []string `protobuf:"bytes,2,rep,name=enum,proto3" json:"enum,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *NextSpeaker) Reset() { + *x = NextSpeaker{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NextSpeaker) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NextSpeaker) ProtoMessage() {} + +func (x *NextSpeaker) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NextSpeaker.ProtoReflect.Descriptor instead. +func (*NextSpeaker) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{13} +} + +func (x *NextSpeaker) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *NextSpeaker) GetEnum() []string { + if x != nil { + return x.Enum + } + return nil +} + +func (x *NextSpeaker) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +// Content of the chat +type Content struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Parts []*Part `protobuf:"bytes,2,rep,name=parts,proto3" json:"parts,omitempty"` +} + +func (x *Content) Reset() { + *x = Content{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Content) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Content) ProtoMessage() {} + +func (x *Content) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Content.ProtoReflect.Descriptor instead. +func (*Content) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{14} +} + +func (x *Content) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *Content) GetParts() []*Part { + if x != nil { + return x.Parts + } + return nil +} + +// Part of the content +type Part struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to PartType: + // + // *Part_Text + // *Part_FunctionCall + // *Part_FunctionResponse + PartType isPart_PartType `protobuf_oneof:"part_type"` + ThoughtSignature string `protobuf:"bytes,4,opt,name=thoughtSignature,proto3" json:"thoughtSignature,omitempty"` +} + +func (x *Part) Reset() { + *x = Part{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Part) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Part) ProtoMessage() {} + +func (x *Part) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Part.ProtoReflect.Descriptor instead. +func (*Part) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{15} +} + +func (m *Part) GetPartType() isPart_PartType { + if m != nil { + return m.PartType + } + return nil +} + +func (x *Part) GetText() string { + if x, ok := x.GetPartType().(*Part_Text); ok { + return x.Text + } + return "" +} + +func (x *Part) GetFunctionCall() *FunctionCall { + if x, ok := x.GetPartType().(*Part_FunctionCall); ok { + return x.FunctionCall + } + return nil +} + +func (x *Part) GetFunctionResponse() *FunctionResponse { + if x, ok := x.GetPartType().(*Part_FunctionResponse); ok { + return x.FunctionResponse + } + return nil +} + +func (x *Part) GetThoughtSignature() string { + if x != nil { + return x.ThoughtSignature + } + return "" +} + +type isPart_PartType interface { + isPart_PartType() +} + +type Part_Text struct { + Text string `protobuf:"bytes,1,opt,name=text,proto3,oneof"` +} + +type Part_FunctionCall struct { + FunctionCall *FunctionCall `protobuf:"bytes,2,opt,name=functionCall,proto3,oneof"` +} + +type Part_FunctionResponse struct { + FunctionResponse *FunctionResponse `protobuf:"bytes,3,opt,name=functionResponse,proto3,oneof"` +} + +func (*Part_Text) isPart_PartType() {} + +func (*Part_FunctionCall) isPart_PartType() {} + +func (*Part_FunctionResponse) isPart_PartType() {} + +// Function call +type FunctionCall struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Args *ArgsInfo `protobuf:"bytes,3,opt,name=args,proto3" json:"args,omitempty"` +} + +func (x *FunctionCall) Reset() { + *x = FunctionCall{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FunctionCall) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FunctionCall) ProtoMessage() {} + +func (x *FunctionCall) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FunctionCall.ProtoReflect.Descriptor instead. +func (*FunctionCall) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{16} +} + +func (x *FunctionCall) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FunctionCall) GetArgs() *ArgsInfo { + if x != nil { + return x.Args + } + return nil +} + +type ArgsInfo struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AbsolutePath string `protobuf:"bytes,1,opt,name=absolute_path,json=absolutePath,proto3" json:"absolute_path,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Command string `protobuf:"bytes,3,opt,name=command,proto3" json:"command,omitempty"` + NewString string `protobuf:"bytes,4,opt,name=new_string,json=newString,proto3" json:"new_string,omitempty"` + OldString string `protobuf:"bytes,5,opt,name=old_string,json=oldString,proto3" json:"old_string,omitempty"` + ExpectedReplacements int32 `protobuf:"varint,6,opt,name=expected_replacements,json=expectedReplacements,proto3" json:"expected_replacements,omitempty"` + FilePath string `protobuf:"bytes,7,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` + Directory string `protobuf:"bytes,8,opt,name=directory,proto3" json:"directory,omitempty"` + Path string `protobuf:"bytes,9,opt,name=path,proto3" json:"path,omitempty"` + ThinkingConfig string `protobuf:"bytes,10,opt,name=thinkingConfig,proto3" json:"thinkingConfig,omitempty"` + Pattern string `protobuf:"bytes,11,opt,name=pattern,proto3" json:"pattern,omitempty"` + Content string `protobuf:"bytes,12,opt,name=content,proto3" json:"content,omitempty"` + Fact string `protobuf:"bytes,13,opt,name=fact,proto3" json:"fact,omitempty"` + Paths []string `protobuf:"bytes,14,rep,name=paths,proto3" json:"paths,omitempty"` + Query string `protobuf:"bytes,15,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ArgsInfo) Reset() { + *x = ArgsInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArgsInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArgsInfo) ProtoMessage() {} + +func (x *ArgsInfo) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArgsInfo.ProtoReflect.Descriptor instead. +func (*ArgsInfo) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{17} +} + +func (x *ArgsInfo) GetAbsolutePath() string { + if x != nil { + return x.AbsolutePath + } + return "" +} + +func (x *ArgsInfo) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *ArgsInfo) GetCommand() string { + if x != nil { + return x.Command + } + return "" +} + +func (x *ArgsInfo) GetNewString() string { + if x != nil { + return x.NewString + } + return "" +} + +func (x *ArgsInfo) GetOldString() string { + if x != nil { + return x.OldString + } + return "" +} + +func (x *ArgsInfo) GetExpectedReplacements() int32 { + if x != nil { + return x.ExpectedReplacements + } + return 0 +} + +func (x *ArgsInfo) GetFilePath() string { + if x != nil { + return x.FilePath + } + return "" +} + +func (x *ArgsInfo) GetDirectory() string { + if x != nil { + return x.Directory + } + return "" +} + +func (x *ArgsInfo) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *ArgsInfo) GetThinkingConfig() string { + if x != nil { + return x.ThinkingConfig + } + return "" +} + +func (x *ArgsInfo) GetPattern() string { + if x != nil { + return x.Pattern + } + return "" +} + +func (x *ArgsInfo) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *ArgsInfo) GetFact() string { + if x != nil { + return x.Fact + } + return "" +} + +func (x *ArgsInfo) GetPaths() []string { + if x != nil { + return x.Paths + } + return nil +} + +func (x *ArgsInfo) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +// Function response +type FunctionResponse struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Response *Response `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *FunctionResponse) Reset() { + *x = FunctionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FunctionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FunctionResponse) ProtoMessage() {} + +func (x *FunctionResponse) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FunctionResponse.ProtoReflect.Descriptor instead. +func (*FunctionResponse) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{18} +} + +func (x *FunctionResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *FunctionResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FunctionResponse) GetResponse() *Response { + if x != nil { + return x.Response + } + return nil +} + +// Response from a function call +type Response struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` +} + +func (x *Response) Reset() { + *x = Response{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{19} +} + +func (x *Response) GetOutput() string { + if x != nil { + return x.Output + } + return "" +} + +func (x *Response) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +type Row struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Fields []string `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"` +} + +func (x *Row) Reset() { + *x = Row{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Row) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Row) ProtoMessage() {} + +func (x *Row) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Row.ProtoReflect.Descriptor instead. +func (*Row) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{20} +} + +func (x *Row) GetFields() []string { + if x != nil { + return x.Fields + } + return nil +} + +type Table struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Columns int32 `protobuf:"varint,1,opt,name=columns,proto3" json:"columns,omitempty"` + Rows []*Row `protobuf:"bytes,2,rep,name=rows,proto3" json:"rows,omitempty"` +} + +func (x *Table) Reset() { + *x = Table{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Table) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Table) ProtoMessage() {} + +func (x *Table) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Table.ProtoReflect.Descriptor instead. +func (*Table) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{21} +} + +func (x *Table) GetColumns() int32 { + if x != nil { + return x.Columns + } + return 0 +} + +func (x *Table) GetRows() []*Row { + if x != nil { + return x.Rows + } + return nil +} + +type ToolCall struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Input string `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + OutputStdout string `protobuf:"bytes,4,opt,name=output_stdout,json=outputStdout,proto3" json:"output_stdout,omitempty"` + OutputStderr string `protobuf:"bytes,5,opt,name=output_stderr,json=outputStderr,proto3" json:"output_stderr,omitempty"` + ExitCode int32 `protobuf:"varint,6,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` +} + +func (x *ToolCall) Reset() { + *x = ToolCall{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ToolCall) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ToolCall) ProtoMessage() {} + +func (x *ToolCall) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ToolCall.ProtoReflect.Descriptor instead. +func (*ToolCall) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{22} +} + +func (x *ToolCall) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ToolCall) GetInput() string { + if x != nil { + return x.Input + } + return "" +} + +func (x *ToolCall) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *ToolCall) GetOutputStdout() string { + if x != nil { + return x.OutputStdout + } + return "" +} + +func (x *ToolCall) GetOutputStderr() string { + if x != nil { + return x.OutputStderr + } + return "" +} + +func (x *ToolCall) GetExitCode() int32 { + if x != nil { + return x.ExitCode + } + return 0 +} + +type CodeSnippet struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *CodeSnippet) Reset() { + *x = CodeSnippet{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CodeSnippet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CodeSnippet) ProtoMessage() {} + +func (x *CodeSnippet) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CodeSnippet.ProtoReflect.Descriptor instead. +func (*CodeSnippet) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{23} +} + +func (x *CodeSnippet) GetFilename() string { + if x != nil { + return x.Filename + } + return "" +} + +func (x *CodeSnippet) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +type ChatEntry struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + From Who `protobuf:"varint,1,opt,name=from,proto3,enum=chatpb.Who" json:"from,omitempty"` + Ctime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=ctime,proto3" json:"ctime,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + Table *Table `protobuf:"bytes,4,opt,name=table,proto3" json:"table,omitempty"` + ToolCalls []*ToolCall `protobuf:"bytes,5,rep,name=ToolCalls,proto3" json:"ToolCalls,omitempty"` + ContentFile string `protobuf:"bytes,6,opt,name=ContentFile,proto3" json:"ContentFile,omitempty"` + Uuid string `protobuf:"bytes,7,opt,name=uuid,proto3" json:"uuid,omitempty"` + Snippets []*CodeSnippet `protobuf:"bytes,8,rep,name=Snippets,proto3" json:"Snippets,omitempty"` + Parts []*Part `protobuf:"bytes,9,rep,name=parts,proto3" json:"parts,omitempty"` + GeminiRequest *GeminiRequest `protobuf:"bytes,10,opt,name=GeminiRequest,proto3" json:"GeminiRequest,omitempty"` + RequestCounter int32 `protobuf:"varint,11,opt,name=RequestCounter,proto3" json:"RequestCounter,omitempty"` + Paths []string `protobuf:"bytes,12,rep,name=paths,proto3" json:"paths,omitempty"` +} + +func (x *ChatEntry) Reset() { + *x = ChatEntry{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChatEntry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChatEntry) ProtoMessage() {} + +func (x *ChatEntry) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChatEntry.ProtoReflect.Descriptor instead. +func (*ChatEntry) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{24} +} + +func (x *ChatEntry) GetFrom() Who { + if x != nil { + return x.From + } + return Who_NOONE +} + +func (x *ChatEntry) GetCtime() *timestamppb.Timestamp { + if x != nil { + return x.Ctime + } + return nil +} + +func (x *ChatEntry) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *ChatEntry) GetTable() *Table { + if x != nil { + return x.Table + } + return nil +} + +func (x *ChatEntry) GetToolCalls() []*ToolCall { + if x != nil { + return x.ToolCalls + } + return nil +} + +func (x *ChatEntry) GetContentFile() string { + if x != nil { + return x.ContentFile + } + return "" +} + +func (x *ChatEntry) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *ChatEntry) GetSnippets() []*CodeSnippet { + if x != nil { + return x.Snippets + } + return nil +} + +func (x *ChatEntry) GetParts() []*Part { + if x != nil { + return x.Parts + } + return nil +} + +func (x *ChatEntry) GetGeminiRequest() *GeminiRequest { + if x != nil { + return x.GeminiRequest + } + return nil +} + +func (x *ChatEntry) GetRequestCounter() int32 { + if x != nil { + return x.RequestCounter + } + return 0 +} + +func (x *ChatEntry) GetPaths() []string { + if x != nil { + return x.Paths + } + return nil +} + +type SessionStats struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` +} + +func (x *SessionStats) Reset() { + *x = SessionStats{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SessionStats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SessionStats) ProtoMessage() {} + +func (x *SessionStats) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SessionStats.ProtoReflect.Descriptor instead. +func (*SessionStats) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{25} +} + +func (x *SessionStats) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +type Chat struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // `autogenpb:unique` `autogenpb:sort` + Ctime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=ctime,proto3" json:"ctime,omitempty"` + ChatName string `protobuf:"bytes,3,opt,name=ChatName,proto3" json:"ChatName,omitempty"` + Entries []*ChatEntry `protobuf:"bytes,4,rep,name=Entries,proto3" json:"Entries,omitempty"` + Session []*SessionStats `protobuf:"bytes,5,rep,name=Session,proto3" json:"Session,omitempty"` +} + +func (x *Chat) Reset() { + *x = Chat{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Chat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Chat) ProtoMessage() {} + +func (x *Chat) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Chat.ProtoReflect.Descriptor instead. +func (*Chat) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{26} +} + +func (x *Chat) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *Chat) GetCtime() *timestamppb.Timestamp { + if x != nil { + return x.Ctime + } + return nil +} + +func (x *Chat) GetChatName() string { + if x != nil { + return x.ChatName + } + return "" +} + +func (x *Chat) GetEntries() []*ChatEntry { + if x != nil { + return x.Entries + } + return nil +} + +func (x *Chat) GetSession() []*SessionStats { + if x != nil { + return x.Session + } + return nil +} + +type Chats struct { + sync.RWMutex // auto-added by go.wit.com/apps/autogenpb + + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // `autogenpb:uuid:9fd31f10-c25d-4d66-bc8d-5f6eb7c79057` `autogenpb:primary` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v0.0.1` + Chats []*Chat `protobuf:"bytes,3,rep,name=Chats,proto3" json:"Chats,omitempty"` // THIS MUST BE Chat and then Chats +} + +func (x *Chats) Reset() { + *x = Chats{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Chats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Chats) ProtoMessage() {} + +func (x *Chats) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Chats.ProtoReflect.Descriptor instead. +func (*Chats) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{27} +} + +func (x *Chats) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *Chats) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Chats) GetChats() []*Chat { + if x != nil { + return x.Chats + } + return nil +} + +type Config_ThinkingConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IncludeThoughts bool `protobuf:"varint,1,opt,name=includeThoughts,proto3" json:"includeThoughts,omitempty"` + ThinkingBudget int32 `protobuf:"varint,2,opt,name=thinkingBudget,proto3" json:"thinkingBudget,omitempty"` +} + +func (x *Config_ThinkingConfig) Reset() { + *x = Config_ThinkingConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config_ThinkingConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config_ThinkingConfig) ProtoMessage() {} + +func (x *Config_ThinkingConfig) ProtoReflect() protoreflect.Message { + mi := &file_chat_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config_ThinkingConfig.ProtoReflect.Descriptor instead. +func (*Config_ThinkingConfig) Descriptor() ([]byte, []int) { + return file_chat_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *Config_ThinkingConfig) GetIncludeThoughts() bool { + if x != nil { + return x.IncludeThoughts + } + return false +} + +func (x *Config_ThinkingConfig) GetThinkingBudget() int32 { + if x != nil { + return x.ThinkingBudget + } + return 0 +} + +var File_chat_proto protoreflect.FileDescriptor + +var file_chat_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x68, + 0x61, 0x74, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x7a, 0x0a, 0x0d, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x26, 0x0a, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x68, 0x61, + 0x74, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x2b, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, + 0x0d, 0x0a, 0x0b, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x22, 0xaf, + 0x03, 0x0a, 0x06, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3e, 0x0a, + 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1a, 0x0a, + 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x68, 0x61, + 0x74, 0x70, 0x62, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, + 0x1c, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1a, 0x0a, + 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x0d, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x1a, 0x4d, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x91, 0x01, 0x0a, 0x13, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x63, + 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, + 0x0a, 0x16, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x5f, 0x6a, 0x73, 0x6f, + 0x6e, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x14, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x22, 0x0e, 0x0a, 0x0c, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x22, 0x91, 0x01, 0x0a, 0x04, 0x54, 0x6f, 0x6f, 0x6c, 0x12, 0x4f, 0x0a, + 0x14, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x68, + 0x61, 0x74, 0x70, 0x62, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x63, + 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x14, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, + 0x0a, 0x0c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x0c, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x22, 0xeb, 0x03, 0x0a, 0x06, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x70, 0x50, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x50, 0x12, 0x2c, 0x0a, 0x11, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x4a, 0x73, 0x6f, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4a, 0x73, 0x6f, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, + 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4a, 0x73, 0x6f, 0x6e, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x12, 0x2a, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, + 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x36, 0x0a, 0x0c, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x41, + 0x62, 0x6f, 0x72, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x0b, 0x61, 0x62, 0x6f, 0x72, + 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x45, 0x0a, 0x0e, 0x74, 0x68, 0x69, 0x6e, 0x6b, + 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x54, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, + 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, + 0x0a, 0x05, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, + 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x6f, 0x6f, 0x6c, 0x52, 0x05, 0x74, 0x6f, 0x6f, + 0x6c, 0x73, 0x1a, 0x62, 0x0a, 0x0e, 0x54, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x28, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, + 0x68, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x69, + 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x73, 0x12, 0x26, + 0x0a, 0x0e, 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, + 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x22, 0x78, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x4a, 0x73, 0x6f, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x32, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x50, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x69, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, + 0x22, 0xea, 0x02, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, + 0x2f, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, + 0x12, 0x36, 0x0a, 0x0c, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x61, 0x6b, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, + 0x4e, 0x65, 0x78, 0x74, 0x53, 0x70, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x52, 0x0b, 0x6e, 0x65, 0x78, + 0x74, 0x53, 0x70, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x1d, 0x63, 0x6f, 0x72, 0x72, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x5f, 0x65, 0x73, 0x63, 0x61, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x4e, 0x65, 0x77, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x73, 0x63, 0x61, 0x70, + 0x69, 0x6e, 0x67, 0x52, 0x1a, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4e, 0x65, + 0x77, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x73, 0x63, 0x61, 0x70, 0x69, 0x6e, 0x67, 0x12, + 0x58, 0x0a, 0x18, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x73, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x72, 0x72, 0x65, + 0x63, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x6e, 0x69, 0x70, 0x70, 0x65, + 0x74, 0x52, 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x53, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x12, 0x32, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, + 0x65, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x42, 0x0a, + 0x0a, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x4e, 0x0a, 0x16, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x65, 0x64, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x53, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x52, 0x0a, 0x1a, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4e, 0x65, + 0x77, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x73, 0x63, 0x61, 0x70, 0x69, 0x6e, 0x67, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x41, 0x0a, 0x09, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, + 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x57, 0x0a, 0x0b, 0x4e, 0x65, 0x78, 0x74, + 0x53, 0x70, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x65, + 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x41, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x12, 0x22, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x52, 0x05, 0x70, + 0x61, 0x72, 0x74, 0x73, 0x22, 0xd9, 0x01, 0x0a, 0x04, 0x50, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, + 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x74, + 0x65, 0x78, 0x74, 0x12, 0x3a, 0x0a, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x68, 0x61, 0x74, + 0x70, 0x62, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x48, + 0x00, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x12, + 0x46, 0x0a, 0x10, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x68, 0x61, 0x74, + 0x70, 0x62, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x10, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x68, 0x6f, 0x75, 0x67, + 0x68, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x10, 0x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x48, 0x0a, 0x0c, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x61, 0x72, 0x67, 0x73, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0xc9, 0x03, 0x0a, 0x08, 0x61, + 0x72, 0x67, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x62, 0x73, 0x6f, 0x6c, + 0x75, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x77, 0x5f, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, + 0x77, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x6c, 0x64, 0x5f, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x6c, 0x64, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x33, 0x0a, 0x15, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, + 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x66, + 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x72, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x26, 0x0a, 0x0e, 0x74, 0x68, + 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x61, 0x63, 0x74, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x61, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, + 0x74, 0x68, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x64, 0x0a, 0x10, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, + 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x0a, 0x08, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x1d, 0x0a, 0x03, 0x52, 0x6f, 0x77, 0x12, 0x16, 0x0a, + 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x42, 0x0a, 0x05, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, + 0x52, 0x6f, 0x77, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x22, 0xbd, 0x01, 0x0a, 0x08, 0x54, 0x6f, + 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, + 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x73, 0x74, 0x64, + 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x53, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x5f, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, 0x74, 0x64, 0x65, 0x72, 0x72, 0x12, 0x1b, 0x0a, 0x09, + 0x65, 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x43, 0x0a, 0x0b, 0x43, 0x6f, 0x64, + 0x65, 0x53, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0xd3, + 0x03, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x04, + 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x63, 0x68, 0x61, + 0x74, 0x70, 0x62, 0x2e, 0x57, 0x68, 0x6f, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x30, 0x0a, + 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, + 0x62, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2e, + 0x0a, 0x09, 0x54, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x6f, 0x6f, 0x6c, 0x43, + 0x61, 0x6c, 0x6c, 0x52, 0x09, 0x54, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x20, + 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x75, 0x75, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x08, 0x53, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x73, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, + 0x43, 0x6f, 0x64, 0x65, 0x53, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x52, 0x08, 0x53, 0x6e, 0x69, + 0x70, 0x70, 0x65, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, 0x09, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x50, 0x61, + 0x72, 0x74, 0x52, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x12, 0x3b, 0x0a, 0x0d, 0x47, 0x65, 0x6d, + 0x69, 0x6e, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x70, + 0x61, 0x74, 0x68, 0x73, 0x22, 0x22, 0x0a, 0x0c, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, + 0x74, 0x61, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x22, 0xc5, 0x01, 0x0a, 0x04, 0x43, 0x68, 0x61, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x68, 0x61, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x68, + 0x61, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, + 0x12, 0x2e, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x22, 0x59, 0x0a, 0x05, 0x43, 0x68, 0x61, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x05, 0x43, 0x68, 0x61, 0x74, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x70, 0x62, 0x2e, + 0x43, 0x68, 0x61, 0x74, 0x52, 0x05, 0x43, 0x68, 0x61, 0x74, 0x73, 0x2a, 0x25, 0x0a, 0x03, 0x57, + 0x68, 0x6f, 0x12, 0x09, 0x0a, 0x05, 0x4e, 0x4f, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, + 0x05, 0x52, 0x45, 0x47, 0x45, 0x58, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, + 0x10, 0x02, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_chat_proto_rawDescOnce sync.Once + file_chat_proto_rawDescData = file_chat_proto_rawDesc +) + +func file_chat_proto_rawDescGZIP() []byte { + file_chat_proto_rawDescOnce.Do(func() { + file_chat_proto_rawDescData = protoimpl.X.CompressGZIP(file_chat_proto_rawDescData) + }) + return file_chat_proto_rawDescData +} + +var file_chat_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_chat_proto_msgTypes = make([]protoimpl.MessageInfo, 30) +var file_chat_proto_goTypes = []interface{}{ + (Who)(0), // 0: chatpb.Who + (*GeminiRequest)(nil), // 1: chatpb.GeminiRequest + (*AbortSignal)(nil), // 2: chatpb.AbortSignal + (*Schema)(nil), // 3: chatpb.Schema + (*FunctionDeclaration)(nil), // 4: chatpb.FunctionDeclaration + (*GoogleSearch)(nil), // 5: chatpb.GoogleSearch + (*Tool)(nil), // 6: chatpb.Tool + (*Config)(nil), // 7: chatpb.Config + (*ResponseJsonSchema)(nil), // 8: chatpb.ResponseJsonSchema + (*Properties)(nil), // 9: chatpb.Properties + (*Confidence)(nil), // 10: chatpb.Confidence + (*CorrectedTargetSnippet)(nil), // 11: chatpb.CorrectedTargetSnippet + (*CorrectedNewStringEscaping)(nil), // 12: chatpb.CorrectedNewStringEscaping + (*Reasoning)(nil), // 13: chatpb.Reasoning + (*NextSpeaker)(nil), // 14: chatpb.NextSpeaker + (*Content)(nil), // 15: chatpb.Content + (*Part)(nil), // 16: chatpb.Part + (*FunctionCall)(nil), // 17: chatpb.FunctionCall + (*ArgsInfo)(nil), // 18: chatpb.argsInfo + (*FunctionResponse)(nil), // 19: chatpb.FunctionResponse + (*Response)(nil), // 20: chatpb.Response + (*Row)(nil), // 21: chatpb.Row + (*Table)(nil), // 22: chatpb.Table + (*ToolCall)(nil), // 23: chatpb.ToolCall + (*CodeSnippet)(nil), // 24: chatpb.CodeSnippet + (*ChatEntry)(nil), // 25: chatpb.ChatEntry + (*SessionStats)(nil), // 26: chatpb.SessionStats + (*Chat)(nil), // 27: chatpb.Chat + (*Chats)(nil), // 28: chatpb.Chats + nil, // 29: chatpb.Schema.PropertiesEntry + (*Config_ThinkingConfig)(nil), // 30: chatpb.Config.ThinkingConfig + (*structpb.Value)(nil), // 31: google.protobuf.Value + (*timestamppb.Timestamp)(nil), // 32: google.protobuf.Timestamp +} +var file_chat_proto_depIdxs = []int32{ + 7, // 0: chatpb.GeminiRequest.config:type_name -> chatpb.Config + 15, // 1: chatpb.GeminiRequest.contents:type_name -> chatpb.Content + 29, // 2: chatpb.Schema.properties:type_name -> chatpb.Schema.PropertiesEntry + 3, // 3: chatpb.Schema.items:type_name -> chatpb.Schema + 31, // 4: chatpb.Schema.default_value:type_name -> google.protobuf.Value + 3, // 5: chatpb.FunctionDeclaration.parameters_json_schema:type_name -> chatpb.Schema + 4, // 6: chatpb.Tool.functionDeclarations:type_name -> chatpb.FunctionDeclaration + 5, // 7: chatpb.Tool.googleSearch:type_name -> chatpb.GoogleSearch + 8, // 8: chatpb.Config.responseJsonSchema:type_name -> chatpb.ResponseJsonSchema + 2, // 9: chatpb.Config.abort_signal:type_name -> chatpb.AbortSignal + 30, // 10: chatpb.Config.thinkingConfig:type_name -> chatpb.Config.ThinkingConfig + 6, // 11: chatpb.Config.tools:type_name -> chatpb.Tool + 9, // 12: chatpb.ResponseJsonSchema.properties:type_name -> chatpb.Properties + 13, // 13: chatpb.Properties.reasoning:type_name -> chatpb.Reasoning + 14, // 14: chatpb.Properties.next_speaker:type_name -> chatpb.NextSpeaker + 12, // 15: chatpb.Properties.corrected_new_string_escaping:type_name -> chatpb.CorrectedNewStringEscaping + 11, // 16: chatpb.Properties.corrected_target_snippet:type_name -> chatpb.CorrectedTargetSnippet + 10, // 17: chatpb.Properties.confidence:type_name -> chatpb.Confidence + 16, // 18: chatpb.Content.parts:type_name -> chatpb.Part + 17, // 19: chatpb.Part.functionCall:type_name -> chatpb.FunctionCall + 19, // 20: chatpb.Part.functionResponse:type_name -> chatpb.FunctionResponse + 18, // 21: chatpb.FunctionCall.args:type_name -> chatpb.argsInfo + 20, // 22: chatpb.FunctionResponse.response:type_name -> chatpb.Response + 21, // 23: chatpb.Table.rows:type_name -> chatpb.Row + 0, // 24: chatpb.ChatEntry.from:type_name -> chatpb.Who + 32, // 25: chatpb.ChatEntry.ctime:type_name -> google.protobuf.Timestamp + 22, // 26: chatpb.ChatEntry.table:type_name -> chatpb.Table + 23, // 27: chatpb.ChatEntry.ToolCalls:type_name -> chatpb.ToolCall + 24, // 28: chatpb.ChatEntry.Snippets:type_name -> chatpb.CodeSnippet + 16, // 29: chatpb.ChatEntry.parts:type_name -> chatpb.Part + 1, // 30: chatpb.ChatEntry.GeminiRequest:type_name -> chatpb.GeminiRequest + 32, // 31: chatpb.Chat.ctime:type_name -> google.protobuf.Timestamp + 25, // 32: chatpb.Chat.Entries:type_name -> chatpb.ChatEntry + 26, // 33: chatpb.Chat.Session:type_name -> chatpb.SessionStats + 27, // 34: chatpb.Chats.Chats:type_name -> chatpb.Chat + 3, // 35: chatpb.Schema.PropertiesEntry.value:type_name -> chatpb.Schema + 36, // [36:36] is the sub-list for method output_type + 36, // [36:36] is the sub-list for method input_type + 36, // [36:36] is the sub-list for extension type_name + 36, // [36:36] is the sub-list for extension extendee + 0, // [0:36] is the sub-list for field type_name +} + +func init() { file_chat_proto_init() } +func file_chat_proto_init() { + if File_chat_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_chat_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GeminiRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AbortSignal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Schema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FunctionDeclaration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GoogleSearch); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Tool); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResponseJsonSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Properties); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Confidence); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CorrectedTargetSnippet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CorrectedNewStringEscaping); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Reasoning); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NextSpeaker); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Content); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Part); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FunctionCall); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ArgsInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FunctionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Row); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Table); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ToolCall); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CodeSnippet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChatEntry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SessionStats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Chat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Chats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config_ThinkingConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_chat_proto_msgTypes[15].OneofWrappers = []interface{}{ + (*Part_Text)(nil), + (*Part_FunctionCall)(nil), + (*Part_FunctionResponse)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_chat_proto_rawDesc, + NumEnums: 1, + NumMessages: 30, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_chat_proto_goTypes, + DependencyIndexes: file_chat_proto_depIdxs, + EnumInfos: file_chat_proto_enumTypes, + MessageInfos: file_chat_proto_msgTypes, + }.Build() + File_chat_proto = out.File + file_chat_proto_rawDesc = nil + file_chat_proto_goTypes = nil + file_chat_proto_depIdxs = nil +} diff --git a/chat.sort.pb.go b/chat.sort.pb.go new file mode 100644 index 0000000..b1cb8e0 --- /dev/null +++ b/chat.sort.pb.go @@ -0,0 +1,1441 @@ +// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. +// This file was autogenerated with autogenpb v0.0.79 2025-09-01_01:52:08_UTC +// go install go.wit.com/apps/autogenpb@latest +// +// define which structs (messages) you want to use in the .proto file +// Then sort.pb.go and marshal.pb.go files are autogenerated +// +// autogenpb uses it and has an example .proto file with instructions +// + +package chatpb + +import ( + "fmt" + "iter" + "sort" + "sync" + + "google.golang.org/protobuf/proto" +) + +// a simple global lock +var chatMu sync.RWMutex + +func (x *Chats) fixUuid() { + if x == nil { + return + } + if x.Uuid == "9fd31f10-c25d-4d66-bc8d-5f6eb7c79057" { + return + } + x.Uuid = "9fd31f10-c25d-4d66-bc8d-5f6eb7c79057" + x.Version = "v0.0.1 go.wit.com/lib/protobuf/chatpb" +} + +func NewChats() *Chats { + x := new(Chats) + x.Uuid = "9fd31f10-c25d-4d66-bc8d-5f6eb7c79057" + x.Version = "v0.0.1 go.wit.com/lib/protobuf/chatpb" + return x +} + +// START SORT + +// DEFINE THE Chats SCANNER. +// itializes a new scanner. +func newChatsScanner(things []*Chats) *ChatsScanner { + return &ChatsScanner{things: things} +} + +type ChatsScanner struct { + sync.Mutex + + things []*Chats + index int +} + +func (it *ChatsScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ChatsScanner) Next() *Chats { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ChatsScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Chat SCANNER. +// itializes a new scanner. +func newChatScanner(things []*Chat) *ChatScanner { + return &ChatScanner{things: things} +} + +type ChatScanner struct { + sync.Mutex + + things []*Chat + index int +} + +func (it *ChatScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ChatScanner) Next() *Chat { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ChatScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE GeminiRequest SCANNER. +// itializes a new scanner. +func newGeminiRequestScanner(things []*GeminiRequest) *GeminiRequestScanner { + return &GeminiRequestScanner{things: things} +} + +type GeminiRequestScanner struct { + sync.Mutex + + things []*GeminiRequest + index int +} + +func (it *GeminiRequestScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *GeminiRequestScanner) Next() *GeminiRequest { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in GeminiRequestScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE AbortSignal SCANNER. +// itializes a new scanner. +func newAbortSignalScanner(things []*AbortSignal) *AbortSignalScanner { + return &AbortSignalScanner{things: things} +} + +type AbortSignalScanner struct { + sync.Mutex + + things []*AbortSignal + index int +} + +func (it *AbortSignalScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *AbortSignalScanner) Next() *AbortSignal { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in AbortSignalScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Schema SCANNER. +// itializes a new scanner. +func newSchemaScanner(things []*Schema) *SchemaScanner { + return &SchemaScanner{things: things} +} + +type SchemaScanner struct { + sync.Mutex + + things []*Schema + index int +} + +func (it *SchemaScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *SchemaScanner) Next() *Schema { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in SchemaScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE FunctionDeclaration SCANNER. +// itializes a new scanner. +func newFunctionDeclarationScanner(things []*FunctionDeclaration) *FunctionDeclarationScanner { + return &FunctionDeclarationScanner{things: things} +} + +type FunctionDeclarationScanner struct { + sync.Mutex + + things []*FunctionDeclaration + index int +} + +func (it *FunctionDeclarationScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *FunctionDeclarationScanner) Next() *FunctionDeclaration { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in FunctionDeclarationScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE GoogleSearch SCANNER. +// itializes a new scanner. +func newGoogleSearchScanner(things []*GoogleSearch) *GoogleSearchScanner { + return &GoogleSearchScanner{things: things} +} + +type GoogleSearchScanner struct { + sync.Mutex + + things []*GoogleSearch + index int +} + +func (it *GoogleSearchScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *GoogleSearchScanner) Next() *GoogleSearch { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in GoogleSearchScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Tool SCANNER. +// itializes a new scanner. +func newToolScanner(things []*Tool) *ToolScanner { + return &ToolScanner{things: things} +} + +type ToolScanner struct { + sync.Mutex + + things []*Tool + index int +} + +func (it *ToolScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ToolScanner) Next() *Tool { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ToolScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Config SCANNER. +// itializes a new scanner. +func newConfigScanner(things []*Config) *ConfigScanner { + return &ConfigScanner{things: things} +} + +type ConfigScanner struct { + sync.Mutex + + things []*Config + index int +} + +func (it *ConfigScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ConfigScanner) Next() *Config { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ConfigScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE ResponseJsonSchema SCANNER. +// itializes a new scanner. +func newResponseJsonSchemaScanner(things []*ResponseJsonSchema) *ResponseJsonSchemaScanner { + return &ResponseJsonSchemaScanner{things: things} +} + +type ResponseJsonSchemaScanner struct { + sync.Mutex + + things []*ResponseJsonSchema + index int +} + +func (it *ResponseJsonSchemaScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ResponseJsonSchemaScanner) Next() *ResponseJsonSchema { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ResponseJsonSchemaScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Properties SCANNER. +// itializes a new scanner. +func newPropertiesScanner(things []*Properties) *PropertiesScanner { + return &PropertiesScanner{things: things} +} + +type PropertiesScanner struct { + sync.Mutex + + things []*Properties + index int +} + +func (it *PropertiesScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *PropertiesScanner) Next() *Properties { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in PropertiesScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Confidence SCANNER. +// itializes a new scanner. +func newConfidenceScanner(things []*Confidence) *ConfidenceScanner { + return &ConfidenceScanner{things: things} +} + +type ConfidenceScanner struct { + sync.Mutex + + things []*Confidence + index int +} + +func (it *ConfidenceScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ConfidenceScanner) Next() *Confidence { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ConfidenceScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE CorrectedTargetSnippet SCANNER. +// itializes a new scanner. +func newCorrectedTargetSnippetScanner(things []*CorrectedTargetSnippet) *CorrectedTargetSnippetScanner { + return &CorrectedTargetSnippetScanner{things: things} +} + +type CorrectedTargetSnippetScanner struct { + sync.Mutex + + things []*CorrectedTargetSnippet + index int +} + +func (it *CorrectedTargetSnippetScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *CorrectedTargetSnippetScanner) Next() *CorrectedTargetSnippet { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in CorrectedTargetSnippetScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE CorrectedNewStringEscaping SCANNER. +// itializes a new scanner. +func newCorrectedNewStringEscapingScanner(things []*CorrectedNewStringEscaping) *CorrectedNewStringEscapingScanner { + return &CorrectedNewStringEscapingScanner{things: things} +} + +type CorrectedNewStringEscapingScanner struct { + sync.Mutex + + things []*CorrectedNewStringEscaping + index int +} + +func (it *CorrectedNewStringEscapingScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *CorrectedNewStringEscapingScanner) Next() *CorrectedNewStringEscaping { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in CorrectedNewStringEscapingScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Reasoning SCANNER. +// itializes a new scanner. +func newReasoningScanner(things []*Reasoning) *ReasoningScanner { + return &ReasoningScanner{things: things} +} + +type ReasoningScanner struct { + sync.Mutex + + things []*Reasoning + index int +} + +func (it *ReasoningScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ReasoningScanner) Next() *Reasoning { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ReasoningScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE NextSpeaker SCANNER. +// itializes a new scanner. +func newNextSpeakerScanner(things []*NextSpeaker) *NextSpeakerScanner { + return &NextSpeakerScanner{things: things} +} + +type NextSpeakerScanner struct { + sync.Mutex + + things []*NextSpeaker + index int +} + +func (it *NextSpeakerScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *NextSpeakerScanner) Next() *NextSpeaker { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in NextSpeakerScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Content SCANNER. +// itializes a new scanner. +func newContentScanner(things []*Content) *ContentScanner { + return &ContentScanner{things: things} +} + +type ContentScanner struct { + sync.Mutex + + things []*Content + index int +} + +func (it *ContentScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ContentScanner) Next() *Content { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ContentScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Part SCANNER. +// itializes a new scanner. +func newPartScanner(things []*Part) *PartScanner { + return &PartScanner{things: things} +} + +type PartScanner struct { + sync.Mutex + + things []*Part + index int +} + +func (it *PartScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *PartScanner) Next() *Part { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in PartScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE FunctionCall SCANNER. +// itializes a new scanner. +func newFunctionCallScanner(things []*FunctionCall) *FunctionCallScanner { + return &FunctionCallScanner{things: things} +} + +type FunctionCallScanner struct { + sync.Mutex + + things []*FunctionCall + index int +} + +func (it *FunctionCallScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *FunctionCallScanner) Next() *FunctionCall { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in FunctionCallScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE ArgsInfo SCANNER. +// itializes a new scanner. +func newArgsInfoScanner(things []*ArgsInfo) *ArgsInfoScanner { + return &ArgsInfoScanner{things: things} +} + +type ArgsInfoScanner struct { + sync.Mutex + + things []*ArgsInfo + index int +} + +func (it *ArgsInfoScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ArgsInfoScanner) Next() *ArgsInfo { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ArgsInfoScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE FunctionResponse SCANNER. +// itializes a new scanner. +func newFunctionResponseScanner(things []*FunctionResponse) *FunctionResponseScanner { + return &FunctionResponseScanner{things: things} +} + +type FunctionResponseScanner struct { + sync.Mutex + + things []*FunctionResponse + index int +} + +func (it *FunctionResponseScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *FunctionResponseScanner) Next() *FunctionResponse { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in FunctionResponseScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Response SCANNER. +// itializes a new scanner. +func newResponseScanner(things []*Response) *ResponseScanner { + return &ResponseScanner{things: things} +} + +type ResponseScanner struct { + sync.Mutex + + things []*Response + index int +} + +func (it *ResponseScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ResponseScanner) Next() *Response { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ResponseScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Row SCANNER. +// itializes a new scanner. +func newRowScanner(things []*Row) *RowScanner { + return &RowScanner{things: things} +} + +type RowScanner struct { + sync.Mutex + + things []*Row + index int +} + +func (it *RowScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *RowScanner) Next() *Row { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in RowScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE Table SCANNER. +// itializes a new scanner. +func newTableScanner(things []*Table) *TableScanner { + return &TableScanner{things: things} +} + +type TableScanner struct { + sync.Mutex + + things []*Table + index int +} + +func (it *TableScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *TableScanner) Next() *Table { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in TableScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE ToolCall SCANNER. +// itializes a new scanner. +func newToolCallScanner(things []*ToolCall) *ToolCallScanner { + return &ToolCallScanner{things: things} +} + +type ToolCallScanner struct { + sync.Mutex + + things []*ToolCall + index int +} + +func (it *ToolCallScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ToolCallScanner) Next() *ToolCall { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ToolCallScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE CodeSnippet SCANNER. +// itializes a new scanner. +func newCodeSnippetScanner(things []*CodeSnippet) *CodeSnippetScanner { + return &CodeSnippetScanner{things: things} +} + +type CodeSnippetScanner struct { + sync.Mutex + + things []*CodeSnippet + index int +} + +func (it *CodeSnippetScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *CodeSnippetScanner) Next() *CodeSnippet { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in CodeSnippetScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE ChatEntry SCANNER. +// itializes a new scanner. +func newChatEntryScanner(things []*ChatEntry) *ChatEntryScanner { + return &ChatEntryScanner{things: things} +} + +type ChatEntryScanner struct { + sync.Mutex + + things []*ChatEntry + index int +} + +func (it *ChatEntryScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *ChatEntryScanner) Next() *ChatEntry { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in ChatEntryScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// DEFINE THE SessionStats SCANNER. +// itializes a new scanner. +func newSessionStatsScanner(things []*SessionStats) *SessionStatsScanner { + return &SessionStatsScanner{things: things} +} + +type SessionStatsScanner struct { + sync.Mutex + + things []*SessionStats + index int +} + +func (it *SessionStatsScanner) Scan() bool { + if it.index >= len(it.things) { + return false + } + it.Lock() + it.index++ + it.Unlock() + return true +} + +// Next() returns the next thing in the array +func (it *SessionStatsScanner) Next() *SessionStats { + if it.things[it.index-1] == nil { + fmt.Println("Next() error in SessionStatsScanner", it.index) + } + return it.things[it.index-1] +} + +// END DEFINE THE SCANNER + +// sort struct by Uuid +type sortChatUuid []*Chat + +func (a sortChatUuid) Len() int { return len(a) } +func (a sortChatUuid) Less(i, j int) bool { return a[i].Uuid < a[j].Uuid } +func (a sortChatUuid) Swap(i, j int) { a[i], a[j] = a[j], a[i] } + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *Chats) allChats() []*Chat { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*Chat + tmp = make([]*Chat, len(x.Chats)) + for i, p := range x.Chats { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *Chat) allEntries() []*ChatEntry { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*ChatEntry + tmp = make([]*ChatEntry, len(x.Entries)) + for i, p := range x.Entries { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *Chat) allSession() []*SessionStats { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*SessionStats + tmp = make([]*SessionStats, len(x.Session)) + for i, p := range x.Session { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *GeminiRequest) allContents() []*Content { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*Content + tmp = make([]*Content, len(x.Contents)) + for i, p := range x.Contents { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *Tool) allFunctionDeclarations() []*FunctionDeclaration { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*FunctionDeclaration + tmp = make([]*FunctionDeclaration, len(x.FunctionDeclarations)) + for i, p := range x.FunctionDeclarations { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *Config) allTools() []*Tool { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*Tool + tmp = make([]*Tool, len(x.Tools)) + for i, p := range x.Tools { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *Content) allParts() []*Part { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*Part + tmp = make([]*Part, len(x.Parts)) + for i, p := range x.Parts { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *Table) allRows() []*Row { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*Row + tmp = make([]*Row, len(x.Rows)) + for i, p := range x.Rows { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *ChatEntry) allToolCalls() []*ToolCall { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*ToolCall + tmp = make([]*ToolCall, len(x.ToolCalls)) + for i, p := range x.ToolCalls { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *ChatEntry) allSnippets() []*CodeSnippet { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*CodeSnippet + tmp = make([]*CodeSnippet, len(x.Snippets)) + for i, p := range x.Snippets { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the FRUIT protobufs +func (x *ChatEntry) allParts() []*Part { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FRUIT + var tmp []*Part + tmp = make([]*Part, len(x.Parts)) + for i, p := range x.Parts { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the Chat protobufs +func (x *Chats) selectAllChats() []*Chat { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each Chat + var tmp []*Chat + tmp = make([]*Chat, len(x.Chats)) + for i, p := range x.Chats { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the ChatEntry protobufs +func (x *Chat) selectAllEntries() []*ChatEntry { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each ChatEntry + var tmp []*ChatEntry + tmp = make([]*ChatEntry, len(x.Entries)) + for i, p := range x.Entries { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the SessionStats protobufs +func (x *Chat) selectAllSession() []*SessionStats { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each SessionStats + var tmp []*SessionStats + tmp = make([]*SessionStats, len(x.Session)) + for i, p := range x.Session { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the Content protobufs +func (x *GeminiRequest) selectAllContents() []*Content { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each Content + var tmp []*Content + tmp = make([]*Content, len(x.Contents)) + for i, p := range x.Contents { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the FunctionDeclaration protobufs +func (x *Tool) selectAllFunctionDeclarations() []*FunctionDeclaration { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each FunctionDeclaration + var tmp []*FunctionDeclaration + tmp = make([]*FunctionDeclaration, len(x.FunctionDeclarations)) + for i, p := range x.FunctionDeclarations { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the Tool protobufs +func (x *Config) selectAllTools() []*Tool { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each Tool + var tmp []*Tool + tmp = make([]*Tool, len(x.Tools)) + for i, p := range x.Tools { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the Part protobufs +func (x *Content) selectAllParts() []*Part { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each Part + var tmp []*Part + tmp = make([]*Part, len(x.Parts)) + for i, p := range x.Parts { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the Row protobufs +func (x *Table) selectAllRows() []*Row { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each Row + var tmp []*Row + tmp = make([]*Row, len(x.Rows)) + for i, p := range x.Rows { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the ToolCall protobufs +func (x *ChatEntry) selectAllToolCalls() []*ToolCall { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each ToolCall + var tmp []*ToolCall + tmp = make([]*ToolCall, len(x.ToolCalls)) + for i, p := range x.ToolCalls { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the CodeSnippet protobufs +func (x *ChatEntry) selectAllSnippets() []*CodeSnippet { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each CodeSnippet + var tmp []*CodeSnippet + tmp = make([]*CodeSnippet, len(x.Snippets)) + for i, p := range x.Snippets { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} + +// safely returns a slice of pointers to the Part protobufs +func (x *ChatEntry) selectAllParts() []*Part { + x.RLock() + defer x.RUnlock() + + // Create a new slice to hold pointers to each Part + var tmp []*Part + tmp = make([]*Part, len(x.Parts)) + for i, p := range x.Parts { + tmp[i] = p // Copy pointers for safe iteration + } + + return tmp +} +func (x *Chats) SortByUuid() *ChatScanner { + // copy the pointers as fast as possible. + things := x.selectAllChats() + + // todo: try slices.SortFunc() instead to see what happens + sort.Sort(sortChatUuid(things)) + // slices.SortFunc(things, func(a, b *Chats) bool { + // return a.Uuid < b.Uuid // Sort by ??. let the compiler work it out?? + // }) + return newChatScanner(things) +} + +// 'for x := range' syntax using the awesome golang 1.24 'iter' +func (x *Chats) IterByUuid() iter.Seq[*Chat] { + items := x.selectAllChats() + sort.Sort(sortChatUuid(items)) + // log.Println("Made Iter.Seq[] with length", len(items)) + return func(yield func(*Chat) bool) { + for _, v := range items { + if !yield(v) { + return + } + } + } +} + +// END SORT + +func (x *Chats) Len() int { + x.RLock() + defer x.RUnlock() + + return len(x.Chats) +} + +// a Append() shortcut (that does Clone() with a mutex) notsure if it really works +func (x *Chats) Append(y *Chat) { + x.Lock() + defer x.Unlock() + + x.Chats = append(x.Chats, proto.Clone(y).(*Chat)) +} + +func (x *Chats) All() *ChatScanner { + ChatPointers := x.selectAllChats() + + scanner := newChatScanner(ChatPointers) + return scanner +} + +// Iterate 'for x := range' syntax using the awesome golang 1.24 'iter' +func (x *Chats) IterAll() iter.Seq[*Chat] { + items := x.selectAllChats() + // log.Println("Made All() Iter.Seq[] with length", len(items)) + return func(yield func(*Chat) bool) { + for _, v := range items { + if !yield(v) { + return + } + } + } +} +func (x *Chats) Delete(y *Chat) bool { + x.Lock() + defer x.Unlock() + + for i, _ := range x.Chats { + if x.Chats[i] == y { + x.Chats[i] = x.Chats[len(x.Chats)-1] + x.Chats = x.Chats[:len(x.Chats)-1] + return true + } + } + return false +} + +// lookup a Chats by the Uuid +func (x *Chats) FindByUuid(s string) *Chat { + if x == nil { + return nil + } + + x.RLock() + defer x.RUnlock() + + for i, _ := range x.Chats { + if x.Chats[i].Uuid == s { + return x.Chats[i] + } + } + return nil +} + +// returns a Chat if Uuid matches, otherwise create +func (x *Chats) InsertByUuid(y string) *Chat { + x.Lock() + defer x.Unlock() + + for _, z := range x.Chats { + if z.Uuid == y { + return z + } + } + + z := new(Chat) + z.Uuid = y + x.Chats = append(x.Chats, z) + return z +} + +func (x *Chats) DeleteByUuid(s string) bool { + x.Lock() + defer x.Unlock() + + for i, _ := range x.Chats { + if x.Chats[i].Uuid == s { + x.Chats[i] = x.Chats[len(x.Chats)-1] + x.Chats = x.Chats[:len(x.Chats)-1] + return true + } + } + return false +} + +func (x *Chats) AppendByUuid(y *Chat) bool { + x.Lock() + defer x.Unlock() + + for _, p := range x.Chats { + if p.Uuid == y.Uuid { + return false + } + } + + x.Chats = append(x.Chats, proto.Clone(y).(*Chat)) + return true +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..35a766b --- /dev/null +++ b/go.mod @@ -0,0 +1,22 @@ +module go.wit.com/lib/protobuf/chatpb + +go 1.24.1 + +require ( + github.com/google/uuid v1.6.0 + go.wit.com/gui v0.25.2 + go.wit.com/lib/cobol v0.0.5 + go.wit.com/lib/gui/shell v0.22.33 + go.wit.com/lib/protobuf/bugpb v0.0.5 + go.wit.com/lib/protobuf/guipb v0.0.14 + go.wit.com/log v0.25.1 + google.golang.org/protobuf v1.36.9 +) + +require ( + github.com/go-cmd/cmd v1.4.3 // indirect + go.wit.com/widget v1.1.30 // indirect + golang.org/x/sys v0.36.0 // indirect + golang.org/x/term v0.35.0 // indirect + golang.org/x/text v0.26.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..8643ed5 --- /dev/null +++ b/go.sum @@ -0,0 +1,32 @@ +github.com/go-cmd/cmd v1.4.3 h1:6y3G+3UqPerXvPcXvj+5QNPHT02BUw7p6PsqRxLNA7Y= +github.com/go-cmd/cmd v1.4.3/go.mod h1:u3hxg/ry+D5kwh8WvUkHLAMe2zQCaXd00t35WfQaOFk= +github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= +github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +go.wit.com/gui v0.25.2 h1:Efs6sduON1a7I2MmV3QiPNGclHqOOCisNqbnbjQ/OpY= +go.wit.com/gui v0.25.2/go.mod h1:jjAQ/g3QRZjZVQMrdvNYSbFGXdXmWJ1zKaMDoj/MZBI= +go.wit.com/lib/cobol v0.0.5 h1:pYEQ2O2psSqoTXJaeNhQWJ1cLy9sMdQfB35a4GA3g6s= +go.wit.com/lib/cobol v0.0.5/go.mod h1:ISWyhCGzH3wsJkjqcBoK088qNdPjS4Um3wFh/9zT2jg= +go.wit.com/lib/gui/shell v0.22.33 h1:3MvWBQU4rOHK4Ac5MkQ62ndW7WhCBpu9F3AVeUF7YgQ= +go.wit.com/lib/gui/shell v0.22.33/go.mod h1:aRDwKXKXkZaO4y/0KPe1lhKQCXpyi8hXgUEOrHhzpAI= +go.wit.com/lib/protobuf/bugpb v0.0.5 h1:o09DPLf4GwbU99vy8oVPdv2BNyEdRsy0wnFUnXiO8L0= +go.wit.com/lib/protobuf/bugpb v0.0.5/go.mod h1:FkkeImmqh67mOnz8MHM6Ohs6km9T8Vr4mdgztCypsSk= +go.wit.com/lib/protobuf/guipb v0.0.14 h1:K/SrSG6oCgem2UMrn3YeOGv2EPPZxKlk9wMNniFkGyQ= +go.wit.com/lib/protobuf/guipb v0.0.14/go.mod h1:9AzFoNKnE0161IOTfdul6SX5+GPAFNW7RPKWohenmcQ= +go.wit.com/log v0.25.1 h1:74WVf9NSN6z5jc2oSbA1ehxdZ7V/NBXTk5t0jIoaTMg= +go.wit.com/log v0.25.1/go.mod h1:XE4lTfAibWgwBJksIk7u3IEJ8xcBvNhnlewYAQGj2Ew= +go.wit.com/widget v1.1.30 h1:O/dIG7QtDrZkR5P6f8JAMyevBiMXSun9vL6F0KFAWV8= +go.wit.com/widget v1.1.30/go.mod h1:wj7TpAr2gk7Poa+v8XQkH1aidnTdgAa/a8GxrMtcztw= +golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= +golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ= +golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw= +google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=