diff --git a/README.md b/README.md index f391b29..c604b28 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ directory holds one subdirectory per extension. ``` secret-engines// package.yaml + Go source, served over secretengine.v1 workflows// package.yaml + workflow YAML, projected into workflow-definitions +channels// package.yaml + Go source, served over channel.v1 (webhook, email) forge// package.yaml + Go source, served over forge.v1 (github, gitea) playbooks// package.yaml + EDA playbook YAML, projected into eda-playbooks profiles// package.yaml + agent profile YAML, projected into agent-profiles diff --git a/channels/email/main.go b/channels/email/main.go new file mode 100644 index 0000000..5e4f1fb --- /dev/null +++ b/channels/email/main.go @@ -0,0 +1,299 @@ +// Command email is the email chat channel: it receives mail over SMTP, routes +// the body through the gateway, and replies through an SMTP relay. Settings: +// listen_addr (default :2525), relay_addr, relay_user, and relay_pass_ref +// ("engine:key" of the relay password). +package main + +import ( + "bufio" + "context" + "crypto/tls" + "errors" + "fmt" + "io" + "log/slog" + "net" + "net/smtp" + "strings" + + "github.com/samcharles93/archipelago/sdk/channel" + gatewayv1 "github.com/samcharles93/archipelago/sdk/gateway/v1" +) + +type gateway struct { + chat gatewayv1.ChatServiceClient + relayAddr, relayUser, relayPass string + log *slog.Logger +} + +func main() { channel.Serve(run) } + +func run(ctx context.Context, cfg channel.Config, chat gatewayv1.ChatServiceClient, lifecycle channel.Lifecycle) error { + lifecycle.Starting() + listen := cfg.Settings["listen_addr"] + if listen == "" { + listen = ":2525" + } + g := &gateway{ + chat: chat, + relayAddr: cfg.Settings["relay_addr"], + relayUser: cfg.Settings["relay_user"], + relayPass: cfg.Secrets["relay_pass"], + log: slog.Default().With("component", "email"), + } + var lc net.ListenConfig + ln, err := lc.Listen(ctx, "tcp", listen) + if err != nil { + return fmt.Errorf("email: listen %s: %w", listen, err) + } + g.log.Info("email channel listening", "addr", listen) + lifecycle.Running() + go func() { + <-ctx.Done() + _ = ln.Close() + }() + for { + conn, err := ln.Accept() + if err != nil { + if ctx.Err() != nil || errors.Is(err, net.ErrClosed) { + return nil + } + g.log.Error("email accept", "err", err) + continue + } + go g.handleSMTP(ctx, conn) + } +} + +// handleSMTP processes one SMTP session. +func (g *gateway) handleSMTP(ctx context.Context, conn net.Conn) { + defer func() { _ = conn.Close() }() + r := bufio.NewReader(conn) + w := bufio.NewWriter(conn) + + write := func(code int, msg string) { + _, _ = fmt.Fprintf(w, "%d %s\r\n", code, msg) + _ = w.Flush() + } + readLine := func() (string, error) { + line, err := r.ReadString('\n') + if err != nil { + return "", err + } + return strings.TrimRight(line, "\r\n"), nil + } + + write(220, "archie email gateway ready") + + var mailFrom, rcptTo string + var dataBuf strings.Builder + inData := false + + for { + line, err := readLine() + if err != nil { + return + } + + switch { + case inData: + if line == "." { + // End of DATA — process the message. + g.processMessage(ctx, mailFrom, rcptTo, dataBuf.String()) + write(250, "OK: message accepted") + return + } + if strings.HasPrefix(line, "..") { + line = line[1:] + } + dataBuf.WriteString(line) + dataBuf.WriteString("\r\n") + + case strings.HasPrefix(strings.ToUpper(line), "MAIL FROM:"): + mailFrom = extractAddr(line) + write(250, "OK") + + case strings.HasPrefix(strings.ToUpper(line), "RCPT TO:"): + rcptTo = extractAddr(line) + write(250, "OK") + + case strings.HasPrefix(strings.ToUpper(line), "DATA"): + write(354, "Start mail input; end with .") + inData = true + + case strings.HasPrefix(strings.ToUpper(line), "QUIT"): + write(221, "Bye") + return + + case strings.HasPrefix(strings.ToUpper(line), "EHLO"), strings.HasPrefix(strings.ToUpper(line), "HELO"): + write(250, "OK") + + default: + write(500, "Unrecognized command") + } + } +} + +// extractAddr pulls the email address from an SMTP command line like +// "MAIL FROM:" or "RCPT TO:". +func extractAddr(line string) string { + start := strings.IndexByte(line, '<') + end := strings.LastIndexByte(line, '>') + if start >= 0 && end > start { + return strings.TrimSpace(line[start+1 : end]) + } + return strings.TrimSpace(line) +} + +// processMessage extracts text from the raw email and routes it through +// the messaging chat contract. Replies are sent back via SMTP. +func (g *gateway) processMessage(ctx context.Context, from, to, raw string) { + // Extract plain text body: everything after the first blank line + // following Content-Type or headers. + text := extractBody(raw) + + // The channel names the platform it carries, which is how the gateway + // learns it is serving email. + reply, err := g.chat.Route(ctx, &gatewayv1.RouteRequest{Message: &gatewayv1.Message{ + ChannelId: to, + From: from, + Text: text, + Platform: "email", + }}) + if err != nil { + g.log.Error("email route", "err", err, "from", from) + return + } + + if reply.GetText() != "" && g.relayAddr != "" { + if err := g.sendReply(from, to, reply.GetText()); err != nil { + g.log.Error("email reply", "err", err, "to", from) + } + } +} + +// extractBody pulls the plain text body from a raw email. +func extractBody(raw string) string { + // Find the message body: after headers (blank line). + parts := strings.SplitN(raw, "\r\n\r\n", 2) + if len(parts) < 2 { + parts = strings.SplitN(raw, "\n\n", 2) + } + if len(parts) < 2 { + return strings.TrimSpace(raw) + } + + headers := parts[0] + body := parts[1] + + // If multipart, look for the text/plain section. + if strings.Contains(strings.ToLower(headers), "content-type: multipart") { + if text := extractMultipartText(headers, body); text != "" { + return text + } + } + + // Non-multipart: strip trailing SMTP dots. + return strings.TrimSpace(body) +} + +// extractMultipartText looks for a text/plain section within a multipart +// body. Returns the trimmed text body or an empty string when not found. +func extractMultipartText(headers, body string) string { + idx := strings.Index(strings.ToLower(headers), "boundary=") + if idx < 0 { + return "" + } + boundary := extractBoundary(headers[idx:]) + if boundary == "" { + return "" + } + sections := strings.SplitSeq(body, "--"+boundary) + for sec := range sections { + if !strings.Contains(strings.ToLower(sec), "content-type: text/plain") { + continue + } + if parts := strings.SplitN(sec, "\r\n\r\n", 2); len(parts) == 2 { + return strings.TrimSpace(strings.TrimRight(parts[1], "\r\n-")) + } + if parts := strings.SplitN(sec, "\n\n", 2); len(parts) == 2 { + return strings.TrimSpace(strings.TrimRight(parts[1], "\n-")) + } + } + return "" +} + +func extractBoundary(line string) string { + // boundary="xxx" or boundary=xxx + line = strings.TrimPrefix(line, "boundary=") + line = strings.TrimSpace(line) + line = strings.Trim(line, "\"") + // Stop at semicolon or whitespace. + if idx := strings.IndexAny(line, " ;\r\n"); idx >= 0 { + return line[:idx] + } + return line +} + +// sendReply delivers a reply to the original sender via SMTP relay. +func (g *gateway) sendReply(to, from, text string) error { + msg := fmt.Sprintf("From: %s\r\nTo: %s\r\nSubject: Re: %s\r\n\r\n%s", + from, to, truncateSubject(text), text) + + var auth smtp.Auth + if g.relayUser != "" { + host, _, _ := net.SplitHostPort(g.relayAddr) + auth = smtp.PlainAuth("", g.relayUser, g.relayPass, host) + } + + // Try TLS first, fall back to plain. + c, err := smtp.Dial(g.relayAddr) + if err != nil { + return fmt.Errorf("dial relay: %w", err) + } + defer func() { _ = c.Close() }() + + if ok, _ := c.Extension("STARTTLS"); ok { + tlsCfg := &tls.Config{ServerName: serverName(g.relayAddr)} + if err := c.StartTLS(tlsCfg); err != nil { + return fmt.Errorf("starttls: %w", err) + } + } + + if auth != nil { + if err := c.Auth(auth); err != nil { + g.log.Warn("email relay auth failed", "err", err) + } + } + + if err := c.Mail(from); err != nil { + return fmt.Errorf("mail from: %w", err) + } + if err := c.Rcpt(to); err != nil { + return fmt.Errorf("rcpt to: %w", err) + } + wc, err := c.Data() + if err != nil { + return fmt.Errorf("data: %w", err) + } + _, err = io.WriteString(wc, msg) + if err != nil { + return fmt.Errorf("write: %w", err) + } + return wc.Close() +} + +func serverName(addr string) string { + host, _, err := net.SplitHostPort(addr) + if err != nil { + return "localhost" + } + return host +} + +func truncateSubject(text string) string { + if len(text) > 60 { + return text[:57] + "..." + } + return text +} diff --git a/channels/email/package.yaml b/channels/email/package.yaml new file mode 100644 index 0000000..3ce9d78 --- /dev/null +++ b/channels/email/package.yaml @@ -0,0 +1,11 @@ +apiVersion: dev.archie.package.v1 +displayName: Email channel +description: Email chat channel: receive mail over SMTP, reply through an SMTP relay. +version: 1.0.0 +contributes: + extensions: + - surface: channel + path: bin/email +files: + - path: bin/email + mode: 493 diff --git a/channels/webhook/main.go b/channels/webhook/main.go new file mode 100644 index 0000000..ec859cf --- /dev/null +++ b/channels/webhook/main.go @@ -0,0 +1,135 @@ +// Command webhook is the inbound webhook chat channel. External services POST +// a message to a route; it is routed through the gateway for the model to +// answer. Settings: addr (default 0.0.0.0:8644), path (default /webhook), +// template (dot path to the text in a JSON body; empty uses the raw body), +// deliver_to ("origin" answers the HTTP request with the reply), and +// secret_ref ("engine:key" of the HMAC secret; empty skips validation). +package main + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net" + "net/http" + "strings" + "time" + + "github.com/samcharles93/archipelago/sdk/channel" + gatewayv1 "github.com/samcharles93/archipelago/sdk/gateway/v1" +) + +const maxBody = 1 << 20 + +func main() { channel.Serve(run) } + +func run(ctx context.Context, cfg channel.Config, chat gatewayv1.ChatServiceClient, lifecycle channel.Lifecycle) error { + lifecycle.Starting() + addr := cfg.Settings["addr"] + if addr == "" { + addr = "0.0.0.0:8644" + } + path := cfg.Settings["path"] + if path == "" { + path = "/webhook" + } + mux := http.NewServeMux() + mux.HandleFunc(path, handler(path, cfg.Settings["template"], cfg.Settings["deliver_to"], cfg.Secrets["secret"], chat)) + server := &http.Server{Addr: addr, Handler: mux, ReadHeaderTimeout: 5 * time.Second} + + var lc net.ListenConfig + ln, err := lc.Listen(ctx, "tcp", addr) + if err != nil { + return fmt.Errorf("webhook: listen: %w", err) + } + slog.Info("webhook channel listening", "addr", addr, "path", path) + lifecycle.Running() + go func() { + <-ctx.Done() + shutdown, cancel := context.WithTimeout(context.WithoutCancel(ctx), 5*time.Second) + defer cancel() + _ = server.Shutdown(shutdown) + }() + if err := server.Serve(ln); err != nil && !errors.Is(err, http.ErrServerClosed) { + return fmt.Errorf("webhook: serve: %w", err) + } + return nil +} + +func handler(path, template, deliverTo, secret string, chat gatewayv1.ChatServiceClient) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost { + http.Error(w, "method not allowed", http.StatusMethodNotAllowed) + return + } + body, err := io.ReadAll(io.LimitReader(r.Body, maxBody)) + if err != nil { + http.Error(w, "read error", http.StatusBadRequest) + return + } + if secret != "" { + sig := r.Header.Get("X-Hub-Signature-256") + if sig == "" { + sig = r.Header.Get("X-Signature-256") + } + if !channel.VerifyHMAC(body, sig, secret) { + slog.Warn("webhook invalid signature", "path", path) + http.Error(w, "invalid signature", http.StatusUnauthorized) + return + } + } + text := extractText(body, template) + if text == "" { + http.Error(w, "empty message", http.StatusBadRequest) + return + } + // A webhook has no per-caller identity, so source_id stays empty: a + // route path must never become a user identity. The path is the + // source the gateway rate limits on. + reply, err := chat.Route(r.Context(), &gatewayv1.RouteRequest{Message: &gatewayv1.Message{ + ChannelId: path, + From: "webhook", + Text: text, + BudgetKey: path, + Platform: "webhook", + }}) + if err != nil { + slog.Error("webhook route", "err", err, "path", path) + http.Error(w, "route error", http.StatusInternalServerError) + return + } + if deliverTo == "origin" && reply.GetText() != "" { + w.Header().Set("Content-Type", "text/plain") + _, _ = w.Write([]byte(reply.GetText())) + return + } + w.WriteHeader(http.StatusAccepted) + } +} + +// extractText pulls a value from a JSON body by dot path ("issue.title"). An +// empty path is the raw body. +func extractText(body []byte, path string) string { + if path == "" { + return strings.TrimSpace(string(body)) + } + var data map[string]any + if err := json.Unmarshal(body, &data); err != nil { + return strings.TrimSpace(string(body)) + } + var current any = data + for p := range strings.SplitSeq(path, ".") { + m, ok := current.(map[string]any) + if !ok { + return "" + } + current = m[p] + } + if s, ok := current.(string); ok { + return strings.TrimSpace(s) + } + return "" +} diff --git a/channels/webhook/package.yaml b/channels/webhook/package.yaml new file mode 100644 index 0000000..0bbf095 --- /dev/null +++ b/channels/webhook/package.yaml @@ -0,0 +1,11 @@ +apiVersion: dev.archie.package.v1 +displayName: Webhook channel +description: Inbound webhook chat channel: an external service POSTs a message and the model answers. +version: 1.0.0 +contributes: + extensions: + - surface: channel + path: bin/webhook +files: + - path: bin/webhook + mode: 493 diff --git a/sdk/channel/serve.go b/sdk/channel/serve.go new file mode 100644 index 0000000..1ebf590 --- /dev/null +++ b/sdk/channel/serve.go @@ -0,0 +1,101 @@ +// Package channel is what a Go chat channel extension builds on: the +// generated channel.v1 contract, the handshake archie-core launches extensions +// with, and the gateway chat service the host serves back to the channel. +package channel + +import ( + "context" + "crypto/hmac" + "crypto/sha256" + "encoding/hex" + "strings" + + goplugin "github.com/hashicorp/go-plugin" + "google.golang.org/grpc" + + channelv1 "github.com/samcharles93/archipelago/sdk/channel/v1" + gatewayv1 "github.com/samcharles93/archipelago/sdk/gateway/v1" +) + +const surface = "channel" + +// Config is the operator's configuration for the channel. Secrets holds the +// resolved values of settings the operator gave as secret references, under +// the setting's name without its _ref suffix. +type Config struct { + Settings map[string]string + Secrets map[string]string +} + +// Lifecycle reports the channel's state to the host. +type Lifecycle struct { + Starting func() + Running func() +} + +// Run runs the channel until ctx ends or it fails. chat is the gateway chat +// service: the channel routes inbound messages through it. +type Run func(ctx context.Context, cfg Config, chat gatewayv1.ChatServiceClient, lifecycle Lifecycle) error + +type plugin struct { + goplugin.NetRPCUnsupportedPlugin + run Run +} + +type server struct { + channelv1.UnimplementedChannelServiceServer + broker *goplugin.GRPCBroker + run Run +} + +func (p *plugin) GRPCServer(broker *goplugin.GRPCBroker, s *grpc.Server) error { + channelv1.RegisterChannelServiceServer(s, &server{broker: broker, run: p.run}) + return nil +} + +func (*plugin) GRPCClient(context.Context, *goplugin.GRPCBroker, *grpc.ClientConn) (any, error) { + return nil, nil +} + +func (s *server) Run(r *channelv1.RunRequest, stream grpc.ServerStreamingServer[channelv1.RunResponse]) error { + conn, err := s.broker.Dial(r.GetChatBrokerId()) + if err != nil { + return err + } + defer func() { _ = conn.Close() }() + send := func(state channelv1.RunResponse_State) func() { + return func() { _ = stream.Send(&channelv1.RunResponse{State: state}) } + } + return s.run(stream.Context(), Config{Settings: r.GetSettings(), Secrets: r.GetSecrets()}, + gatewayv1.NewChatServiceClient(conn), + Lifecycle{Starting: send(channelv1.RunResponse_STATE_STARTING), Running: send(channelv1.RunResponse_STATE_RUNNING)}) +} + +// Serve runs run as the extension process. It returns when archie-core stops +// the extension. +func Serve(run Run) { + goplugin.Serve(&goplugin.ServeConfig{ + HandshakeConfig: goplugin.HandshakeConfig{ + ProtocolVersion: 1, + MagicCookieKey: "ARCHIE_EXTENSION", + MagicCookieValue: "archie", + }, + Plugins: goplugin.PluginSet{surface: &plugin{run: run}}, + GRPCServer: goplugin.DefaultGRPCServer, + }) +} + +// VerifyHMAC checks a hex SHA-256 HMAC of body, with or without a "sha256=" +// prefix, case-insensitively. An empty signature never verifies. +func VerifyHMAC(body []byte, signature, secret string) bool { + if signature == "" { + return false + } + supplied, err := hex.DecodeString(strings.TrimPrefix(signature, "sha256=")) + if err != nil { + return false + } + mac := hmac.New(sha256.New, []byte(secret)) + mac.Write(body) + return hmac.Equal(supplied, mac.Sum(nil)) +} diff --git a/sdk/channel/v1/channel.pb.go b/sdk/channel/v1/channel.pb.go new file mode 100644 index 0000000..8bd7bca --- /dev/null +++ b/sdk/channel/v1/channel.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: channel/v1/channel.proto + +package channelv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RunResponse_State int32 + +const ( + RunResponse_STATE_UNSPECIFIED RunResponse_State = 0 + RunResponse_STATE_STARTING RunResponse_State = 1 + RunResponse_STATE_RUNNING RunResponse_State = 2 +) + +// Enum value maps for RunResponse_State. +var ( + RunResponse_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "STATE_STARTING", + 2: "STATE_RUNNING", + } + RunResponse_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "STATE_STARTING": 1, + "STATE_RUNNING": 2, + } +) + +func (x RunResponse_State) Enum() *RunResponse_State { + p := new(RunResponse_State) + *p = x + return p +} + +func (x RunResponse_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RunResponse_State) Descriptor() protoreflect.EnumDescriptor { + return file_channel_v1_channel_proto_enumTypes[0].Descriptor() +} + +func (RunResponse_State) Type() protoreflect.EnumType { + return &file_channel_v1_channel_proto_enumTypes[0] +} + +func (x RunResponse_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RunResponse_State.Descriptor instead. +func (RunResponse_State) EnumDescriptor() ([]byte, []int) { + return file_channel_v1_channel_proto_rawDescGZIP(), []int{1, 0} +} + +type RunRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // settings are the operator's values for this channel from extension + // settings. A key ending in _ref holds an "engine:key" secret reference the + // host resolves; the plugin receives the value in secrets, under the key + // without the suffix. + Settings map[string]string `protobuf:"bytes,1,rep,name=settings,proto3" json:"settings,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Secrets map[string]string `protobuf:"bytes,2,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // chat_broker_id is the plugin broker stream the host serves + // gateway.v1.ChatService on. + ChatBrokerId uint32 `protobuf:"varint,3,opt,name=chat_broker_id,json=chatBrokerId,proto3" json:"chat_broker_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RunRequest) Reset() { + *x = RunRequest{} + mi := &file_channel_v1_channel_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RunRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunRequest) ProtoMessage() {} + +func (x *RunRequest) ProtoReflect() protoreflect.Message { + mi := &file_channel_v1_channel_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RunRequest.ProtoReflect.Descriptor instead. +func (*RunRequest) Descriptor() ([]byte, []int) { + return file_channel_v1_channel_proto_rawDescGZIP(), []int{0} +} + +func (x *RunRequest) GetSettings() map[string]string { + if x != nil { + return x.Settings + } + return nil +} + +func (x *RunRequest) GetSecrets() map[string]string { + if x != nil { + return x.Secrets + } + return nil +} + +func (x *RunRequest) GetChatBrokerId() uint32 { + if x != nil { + return x.ChatBrokerId + } + return 0 +} + +type RunResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + State RunResponse_State `protobuf:"varint,1,opt,name=state,proto3,enum=channel.v1.RunResponse_State" json:"state,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RunResponse) Reset() { + *x = RunResponse{} + mi := &file_channel_v1_channel_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RunResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunResponse) ProtoMessage() {} + +func (x *RunResponse) ProtoReflect() protoreflect.Message { + mi := &file_channel_v1_channel_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RunResponse.ProtoReflect.Descriptor instead. +func (*RunResponse) Descriptor() ([]byte, []int) { + return file_channel_v1_channel_proto_rawDescGZIP(), []int{1} +} + +func (x *RunResponse) GetState() RunResponse_State { + if x != nil { + return x.State + } + return RunResponse_STATE_UNSPECIFIED +} + +var File_channel_v1_channel_proto protoreflect.FileDescriptor + +const file_channel_v1_channel_proto_rawDesc = "" + + "\n" + + "\x18channel/v1/channel.proto\x12\n" + + "channel.v1\"\xac\x02\n" + + "\n" + + "RunRequest\x12@\n" + + "\bsettings\x18\x01 \x03(\v2$.channel.v1.RunRequest.SettingsEntryR\bsettings\x12=\n" + + "\asecrets\x18\x02 \x03(\v2#.channel.v1.RunRequest.SecretsEntryR\asecrets\x12$\n" + + "\x0echat_broker_id\x18\x03 \x01(\rR\fchatBrokerId\x1a;\n" + + "\rSettingsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a:\n" + + "\fSecretsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x89\x01\n" + + "\vRunResponse\x123\n" + + "\x05state\x18\x01 \x01(\x0e2\x1d.channel.v1.RunResponse.StateR\x05state\"E\n" + + "\x05State\x12\x15\n" + + "\x11STATE_UNSPECIFIED\x10\x00\x12\x12\n" + + "\x0eSTATE_STARTING\x10\x01\x12\x11\n" + + "\rSTATE_RUNNING\x10\x022J\n" + + "\x0eChannelService\x128\n" + + "\x03Run\x12\x16.channel.v1.RunRequest\x1a\x17.channel.v1.RunResponse0\x01B\xa5\x01\n" + + "\x0ecom.channel.v1B\fChannelProtoP\x01Z channel.v1.RunRequest.SettingsEntry + 4, // 1: channel.v1.RunRequest.secrets:type_name -> channel.v1.RunRequest.SecretsEntry + 0, // 2: channel.v1.RunResponse.state:type_name -> channel.v1.RunResponse.State + 1, // 3: channel.v1.ChannelService.Run:input_type -> channel.v1.RunRequest + 2, // 4: channel.v1.ChannelService.Run:output_type -> channel.v1.RunResponse + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_channel_v1_channel_proto_init() } +func file_channel_v1_channel_proto_init() { + if File_channel_v1_channel_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_channel_v1_channel_proto_rawDesc), len(file_channel_v1_channel_proto_rawDesc)), + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_channel_v1_channel_proto_goTypes, + DependencyIndexes: file_channel_v1_channel_proto_depIdxs, + EnumInfos: file_channel_v1_channel_proto_enumTypes, + MessageInfos: file_channel_v1_channel_proto_msgTypes, + }.Build() + File_channel_v1_channel_proto = out.File + file_channel_v1_channel_proto_goTypes = nil + file_channel_v1_channel_proto_depIdxs = nil +} diff --git a/sdk/channel/v1/channel_grpc.pb.go b/sdk/channel/v1/channel_grpc.pb.go new file mode 100644 index 0000000..cd87a9e --- /dev/null +++ b/sdk/channel/v1/channel_grpc.pb.go @@ -0,0 +1,142 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.2 +// - protoc (unknown) +// source: channel/v1/channel.proto + +package channelv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + ChannelService_Run_FullMethodName = "/channel.v1.ChannelService/Run" +) + +// ChannelServiceClient is the client API for ChannelService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// ChannelService is the surface a chat channel extension serves. The host +// launches one plugin process per enabled channel and serves the gateway +// ChatService back to it over the plugin broker, so a channel carries messages +// in and out through that service and never dials the gateway itself. +type ChannelServiceClient interface { + // Run starts the channel and keeps it running until the call is cancelled or + // the channel fails. The stream reports lifecycle: STARTING before each + // launch attempt, RUNNING once the channel can receive. A stream that ends + // with an error is a failed channel; the host restarts it. + Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RunResponse], error) +} + +type channelServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewChannelServiceClient(cc grpc.ClientConnInterface) ChannelServiceClient { + return &channelServiceClient{cc} +} + +func (c *channelServiceClient) Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RunResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ChannelService_ServiceDesc.Streams[0], ChannelService_Run_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[RunRequest, RunResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ChannelService_RunClient = grpc.ServerStreamingClient[RunResponse] + +// ChannelServiceServer is the server API for ChannelService service. +// All implementations must embed UnimplementedChannelServiceServer +// for forward compatibility. +// +// ChannelService is the surface a chat channel extension serves. The host +// launches one plugin process per enabled channel and serves the gateway +// ChatService back to it over the plugin broker, so a channel carries messages +// in and out through that service and never dials the gateway itself. +type ChannelServiceServer interface { + // Run starts the channel and keeps it running until the call is cancelled or + // the channel fails. The stream reports lifecycle: STARTING before each + // launch attempt, RUNNING once the channel can receive. A stream that ends + // with an error is a failed channel; the host restarts it. + Run(*RunRequest, grpc.ServerStreamingServer[RunResponse]) error + mustEmbedUnimplementedChannelServiceServer() +} + +// UnimplementedChannelServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedChannelServiceServer struct{} + +func (UnimplementedChannelServiceServer) Run(*RunRequest, grpc.ServerStreamingServer[RunResponse]) error { + return status.Error(codes.Unimplemented, "method Run not implemented") +} +func (UnimplementedChannelServiceServer) mustEmbedUnimplementedChannelServiceServer() {} +func (UnimplementedChannelServiceServer) testEmbeddedByValue() {} + +// UnsafeChannelServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ChannelServiceServer will +// result in compilation errors. +type UnsafeChannelServiceServer interface { + mustEmbedUnimplementedChannelServiceServer() +} + +func RegisterChannelServiceServer(s grpc.ServiceRegistrar, srv ChannelServiceServer) { + // If the following call panics, it indicates UnimplementedChannelServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&ChannelService_ServiceDesc, srv) +} + +func _ChannelService_Run_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(RunRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ChannelServiceServer).Run(m, &grpc.GenericServerStream[RunRequest, RunResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ChannelService_RunServer = grpc.ServerStreamingServer[RunResponse] + +// ChannelService_ServiceDesc is the grpc.ServiceDesc for ChannelService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ChannelService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "channel.v1.ChannelService", + HandlerType: (*ChannelServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Run", + Handler: _ChannelService_Run_Handler, + ServerStreams: true, + }, + }, + Metadata: "channel/v1/channel.proto", +} diff --git a/sdk/gateway/v1/chat.pb.go b/sdk/gateway/v1/chat.pb.go new file mode 100644 index 0000000..0606a7f --- /dev/null +++ b/sdk/gateway/v1/chat.pb.go @@ -0,0 +1,3306 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: gateway/v1/chat.proto + +package gatewayv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Session struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"` + BotUser string `protobuf:"bytes,3,opt,name=bot_user,json=botUser,proto3" json:"bot_user,omitempty"` + ChannelId string `protobuf:"bytes,4,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + ThreadId string `protobuf:"bytes,5,opt,name=thread_id,json=threadId,proto3" json:"thread_id,omitempty"` + Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` + ParentSessionId string `protobuf:"bytes,7,opt,name=parent_session_id,json=parentSessionId,proto3" json:"parent_session_id,omitempty"` + BranchName string `protobuf:"bytes,8,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + LastActiveAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=last_active_at,json=lastActiveAt,proto3" json:"last_active_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Session) Reset() { + *x = Session{} + mi := &file_gateway_v1_chat_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Session) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Session) ProtoMessage() {} + +func (x *Session) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Session.ProtoReflect.Descriptor instead. +func (*Session) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{0} +} + +func (x *Session) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *Session) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *Session) GetBotUser() string { + if x != nil { + return x.BotUser + } + return "" +} + +func (x *Session) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *Session) GetThreadId() string { + if x != nil { + return x.ThreadId + } + return "" +} + +func (x *Session) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Session) GetParentSessionId() string { + if x != nil { + return x.ParentSessionId + } + return "" +} + +func (x *Session) GetBranchName() string { + if x != nil { + return x.BranchName + } + return "" +} + +func (x *Session) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Session) GetLastActiveAt() *timestamppb.Timestamp { + if x != nil { + return x.LastActiveAt + } + return nil +} + +type Message struct { + state protoimpl.MessageState `protogen:"open.v1"` + MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` + SourceId string `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + ChannelId string `protobuf:"bytes,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + ThreadId string `protobuf:"bytes,4,opt,name=thread_id,json=threadId,proto3" json:"thread_id,omitempty"` + From string `protobuf:"bytes,5,opt,name=from,proto3" json:"from,omitempty"` + Text string `protobuf:"bytes,6,opt,name=text,proto3" json:"text,omitempty"` + Page string `protobuf:"bytes,7,opt,name=page,proto3" json:"page,omitempty"` + At *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=at,proto3" json:"at,omitempty"` + // budget_key is the source an inbound message is charged against by the + // Gateway's inbound rate limiter, for a channel that has no per-person + // sender id but does have a stable, operator-controlled source of its own + // -- a webhook's configured route path. Transport-only: a channel frontend + // sets it on inbound and it is never persisted, exactly like page. Empty + // means the message is not rate limited. + BudgetKey string `protobuf:"bytes,9,opt,name=budget_key,json=budgetKey,proto3" json:"budget_key,omitempty"` + // platform is the channel that carried this message ("telegram", "email", + // "webhook", "web"), as the frontend that owns that channel knows it. It is + // how the Gateway learns which channel it is serving: one Router serves every + // channel, so its own name is "web" even for a Telegram turn, which made + // Source.Platform -- the first component of the session natural key -- a + // constant. Transport-only, never persisted: the session record keeps it. + Platform string `protobuf:"bytes,10,opt,name=platform,proto3" json:"platform,omitempty"` + // media carries attachment metadata for a message that arrived with a + // file. The bytes ride only on the inbound request (see Media.data); a + // stored Media with tool_name empty is a sender attachment, and the + // tool_name on tool-produced events stays a stream-only field. + Media []*Media `protobuf:"bytes,11,rep,name=media,proto3" json:"media,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Message) Reset() { + *x = Message{} + mi := &file_gateway_v1_chat_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Message) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Message) ProtoMessage() {} + +func (x *Message) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Message.ProtoReflect.Descriptor instead. +func (*Message) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{1} +} + +func (x *Message) GetMessageId() string { + if x != nil { + return x.MessageId + } + return "" +} + +func (x *Message) GetSourceId() string { + if x != nil { + return x.SourceId + } + return "" +} + +func (x *Message) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *Message) GetThreadId() string { + if x != nil { + return x.ThreadId + } + return "" +} + +func (x *Message) GetFrom() string { + if x != nil { + return x.From + } + return "" +} + +func (x *Message) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *Message) GetPage() string { + if x != nil { + return x.Page + } + return "" +} + +func (x *Message) GetAt() *timestamppb.Timestamp { + if x != nil { + return x.At + } + return nil +} + +func (x *Message) GetBudgetKey() string { + if x != nil { + return x.BudgetKey + } + return "" +} + +func (x *Message) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *Message) GetMedia() []*Media { + if x != nil { + return x.Media + } + return nil +} + +type ToolCall struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Parameters string `protobuf:"bytes,3,opt,name=parameters,proto3" json:"parameters,omitempty"` + Output string `protobuf:"bytes,4,opt,name=output,proto3" json:"output,omitempty"` + Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ToolCall) Reset() { + *x = ToolCall{} + mi := &file_gateway_v1_chat_proto_msgTypes[2] + 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_gateway_v1_chat_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ToolCall.ProtoReflect.Descriptor instead. +func (*ToolCall) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{2} +} + +func (x *ToolCall) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ToolCall) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ToolCall) GetParameters() string { + if x != nil { + return x.Parameters + } + return "" +} + +func (x *ToolCall) GetOutput() string { + if x != nil { + return x.Output + } + return "" +} + +func (x *ToolCall) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +type Media struct { + state protoimpl.MessageState `protogen:"open.v1"` + ToolName string `protobuf:"bytes,1,opt,name=tool_name,json=toolName,proto3" json:"tool_name,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + FileId string `protobuf:"bytes,3,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"` + Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` + Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` + MimeType string `protobuf:"bytes,6,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"` + FileName string `protobuf:"bytes,7,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` + FileSize *int64 `protobuf:"varint,8,opt,name=file_size,json=fileSize,proto3,oneof" json:"file_size,omitempty"` + Width *int64 `protobuf:"varint,9,opt,name=width,proto3,oneof" json:"width,omitempty"` + Height *int64 `protobuf:"varint,10,opt,name=height,proto3,oneof" json:"height,omitempty"` + Duration *int64 `protobuf:"varint,11,opt,name=duration,proto3,oneof" json:"duration,omitempty"` + // data carries a sender attachment's bytes on an inbound request. The + // channel frontend downloads the file, but the Gateway process that runs + // the turn never holds the platform credential, so this is the only way + // the model can read a photo or document. It is empty on every other + // direction: stored history and outbound media events carry metadata + // only, and a persisted record strips the bytes. + Data []byte `protobuf:"bytes,12,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Media) Reset() { + *x = Media{} + mi := &file_gateway_v1_chat_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Media) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Media) ProtoMessage() {} + +func (x *Media) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Media.ProtoReflect.Descriptor instead. +func (*Media) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{3} +} + +func (x *Media) GetToolName() string { + if x != nil { + return x.ToolName + } + return "" +} + +func (x *Media) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Media) GetFileId() string { + if x != nil { + return x.FileId + } + return "" +} + +func (x *Media) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *Media) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Media) GetMimeType() string { + if x != nil { + return x.MimeType + } + return "" +} + +func (x *Media) GetFileName() string { + if x != nil { + return x.FileName + } + return "" +} + +func (x *Media) GetFileSize() int64 { + if x != nil && x.FileSize != nil { + return *x.FileSize + } + return 0 +} + +func (x *Media) GetWidth() int64 { + if x != nil && x.Width != nil { + return *x.Width + } + return 0 +} + +func (x *Media) GetHeight() int64 { + if x != nil && x.Height != nil { + return *x.Height + } + return 0 +} + +func (x *Media) GetDuration() int64 { + if x != nil && x.Duration != nil { + return *x.Duration + } + return 0 +} + +func (x *Media) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type Turn struct { + state protoimpl.MessageState `protogen:"open.v1"` + TurnId string `protobuf:"bytes,1,opt,name=turn_id,json=turnId,proto3" json:"turn_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + SourceId string `protobuf:"bytes,3,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` + Attempt int64 `protobuf:"varint,5,opt,name=attempt,proto3" json:"attempt,omitempty"` + OwnerId string `protobuf:"bytes,6,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` + InputMessageId string `protobuf:"bytes,7,opt,name=input_message_id,json=inputMessageId,proto3" json:"input_message_id,omitempty"` + AssistantMessageId string `protobuf:"bytes,8,opt,name=assistant_message_id,json=assistantMessageId,proto3" json:"assistant_message_id,omitempty"` + PartialText string `protobuf:"bytes,9,opt,name=partial_text,json=partialText,proto3" json:"partial_text,omitempty"` + ResponseText string `protobuf:"bytes,10,opt,name=response_text,json=responseText,proto3" json:"response_text,omitempty"` + ToolCalls []*ToolCall `protobuf:"bytes,11,rep,name=tool_calls,json=toolCalls,proto3" json:"tool_calls,omitempty"` + Error string `protobuf:"bytes,12,opt,name=error,proto3" json:"error,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Turn) Reset() { + *x = Turn{} + mi := &file_gateway_v1_chat_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Turn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Turn) ProtoMessage() {} + +func (x *Turn) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Turn.ProtoReflect.Descriptor instead. +func (*Turn) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{4} +} + +func (x *Turn) GetTurnId() string { + if x != nil { + return x.TurnId + } + return "" +} + +func (x *Turn) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *Turn) GetSourceId() string { + if x != nil { + return x.SourceId + } + return "" +} + +func (x *Turn) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *Turn) GetAttempt() int64 { + if x != nil { + return x.Attempt + } + return 0 +} + +func (x *Turn) GetOwnerId() string { + if x != nil { + return x.OwnerId + } + return "" +} + +func (x *Turn) GetInputMessageId() string { + if x != nil { + return x.InputMessageId + } + return "" +} + +func (x *Turn) GetAssistantMessageId() string { + if x != nil { + return x.AssistantMessageId + } + return "" +} + +func (x *Turn) GetPartialText() string { + if x != nil { + return x.PartialText + } + return "" +} + +func (x *Turn) GetResponseText() string { + if x != nil { + return x.ResponseText + } + return "" +} + +func (x *Turn) GetToolCalls() []*ToolCall { + if x != nil { + return x.ToolCalls + } + return nil +} + +func (x *Turn) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *Turn) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Turn) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +type StringList struct { + state protoimpl.MessageState `protogen:"open.v1"` + Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StringList) Reset() { + *x = StringList{} + mi := &file_gateway_v1_chat_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StringList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StringList) ProtoMessage() {} + +func (x *StringList) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StringList.ProtoReflect.Descriptor instead. +func (*StringList) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{5} +} + +func (x *StringList) GetValues() []string { + if x != nil { + return x.Values + } + return nil +} + +type SnapshotRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SnapshotRequest) Reset() { + *x = SnapshotRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SnapshotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SnapshotRequest) ProtoMessage() {} + +func (x *SnapshotRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SnapshotRequest.ProtoReflect.Descriptor instead. +func (*SnapshotRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{6} +} + +type SnapshotResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Sessions []*Session `protobuf:"bytes,1,rep,name=sessions,proto3" json:"sessions,omitempty"` + Models []string `protobuf:"bytes,2,rep,name=models,proto3" json:"models,omitempty"` + ModelsByProvider map[string]*StringList `protobuf:"bytes,3,rep,name=models_by_provider,json=modelsByProvider,proto3" json:"models_by_provider,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Providers []string `protobuf:"bytes,4,rep,name=providers,proto3" json:"providers,omitempty"` + ActiveModel string `protobuf:"bytes,5,opt,name=active_model,json=activeModel,proto3" json:"active_model,omitempty"` + ActiveProvider string `protobuf:"bytes,6,opt,name=active_provider,json=activeProvider,proto3" json:"active_provider,omitempty"` + Personas []string `protobuf:"bytes,7,rep,name=personas,proto3" json:"personas,omitempty"` + ActivePersonas map[string]string `protobuf:"bytes,8,rep,name=active_personas,json=activePersonas,proto3" json:"active_personas,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + RestartAvailable bool `protobuf:"varint,9,opt,name=restart_available,json=restartAvailable,proto3" json:"restart_available,omitempty"` + CancellationAvailable bool `protobuf:"varint,10,opt,name=cancellation_available,json=cancellationAvailable,proto3" json:"cancellation_available,omitempty"` + PersonasAvailable bool `protobuf:"varint,11,opt,name=personas_available,json=personasAvailable,proto3" json:"personas_available,omitempty"` + Version string `protobuf:"bytes,12,opt,name=version,proto3" json:"version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SnapshotResponse) Reset() { + *x = SnapshotResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SnapshotResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SnapshotResponse) ProtoMessage() {} + +func (x *SnapshotResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SnapshotResponse.ProtoReflect.Descriptor instead. +func (*SnapshotResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{7} +} + +func (x *SnapshotResponse) GetSessions() []*Session { + if x != nil { + return x.Sessions + } + return nil +} + +func (x *SnapshotResponse) GetModels() []string { + if x != nil { + return x.Models + } + return nil +} + +func (x *SnapshotResponse) GetModelsByProvider() map[string]*StringList { + if x != nil { + return x.ModelsByProvider + } + return nil +} + +func (x *SnapshotResponse) GetProviders() []string { + if x != nil { + return x.Providers + } + return nil +} + +func (x *SnapshotResponse) GetActiveModel() string { + if x != nil { + return x.ActiveModel + } + return "" +} + +func (x *SnapshotResponse) GetActiveProvider() string { + if x != nil { + return x.ActiveProvider + } + return "" +} + +func (x *SnapshotResponse) GetPersonas() []string { + if x != nil { + return x.Personas + } + return nil +} + +func (x *SnapshotResponse) GetActivePersonas() map[string]string { + if x != nil { + return x.ActivePersonas + } + return nil +} + +func (x *SnapshotResponse) GetRestartAvailable() bool { + if x != nil { + return x.RestartAvailable + } + return false +} + +func (x *SnapshotResponse) GetCancellationAvailable() bool { + if x != nil { + return x.CancellationAvailable + } + return false +} + +func (x *SnapshotResponse) GetPersonasAvailable() bool { + if x != nil { + return x.PersonasAvailable + } + return false +} + +func (x *SnapshotResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type GetSessionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSessionRequest) Reset() { + *x = GetSessionRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSessionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSessionRequest) ProtoMessage() {} + +func (x *GetSessionRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSessionRequest.ProtoReflect.Descriptor instead. +func (*GetSessionRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{8} +} + +func (x *GetSessionRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type GetSessionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"` + Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSessionResponse) Reset() { + *x = GetSessionResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSessionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSessionResponse) ProtoMessage() {} + +func (x *GetSessionResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSessionResponse.ProtoReflect.Descriptor instead. +func (*GetSessionResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{9} +} + +func (x *GetSessionResponse) GetSession() *Session { + if x != nil { + return x.Session + } + return nil +} + +func (x *GetSessionResponse) GetFound() bool { + if x != nil { + return x.Found + } + return false +} + +type RecentMessagesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RecentMessagesRequest) Reset() { + *x = RecentMessagesRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RecentMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RecentMessagesRequest) ProtoMessage() {} + +func (x *RecentMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RecentMessagesRequest.ProtoReflect.Descriptor instead. +func (*RecentMessagesRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{10} +} + +func (x *RecentMessagesRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *RecentMessagesRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +type RecentMessagesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RecentMessagesResponse) Reset() { + *x = RecentMessagesResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RecentMessagesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RecentMessagesResponse) ProtoMessage() {} + +func (x *RecentMessagesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RecentMessagesResponse.ProtoReflect.Descriptor instead. +func (*RecentMessagesResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{11} +} + +func (x *RecentMessagesResponse) GetMessages() []*Message { + if x != nil { + return x.Messages + } + return nil +} + +type RecentTurnsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RecentTurnsRequest) Reset() { + *x = RecentTurnsRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RecentTurnsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RecentTurnsRequest) ProtoMessage() {} + +func (x *RecentTurnsRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RecentTurnsRequest.ProtoReflect.Descriptor instead. +func (*RecentTurnsRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{12} +} + +func (x *RecentTurnsRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *RecentTurnsRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +type RecentTurnsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Turns []*Turn `protobuf:"bytes,1,rep,name=turns,proto3" json:"turns,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RecentTurnsResponse) Reset() { + *x = RecentTurnsResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RecentTurnsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RecentTurnsResponse) ProtoMessage() {} + +func (x *RecentTurnsResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RecentTurnsResponse.ProtoReflect.Descriptor instead. +func (*RecentTurnsResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{13} +} + +func (x *RecentTurnsResponse) GetTurns() []*Turn { + if x != nil { + return x.Turns + } + return nil +} + +type RouteRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RouteRequest) Reset() { + *x = RouteRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RouteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RouteRequest) ProtoMessage() {} + +func (x *RouteRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RouteRequest.ProtoReflect.Descriptor instead. +func (*RouteRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{14} +} + +func (x *RouteRequest) GetMessage() *Message { + if x != nil { + return x.Message + } + return nil +} + +type RouteResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RouteResponse) Reset() { + *x = RouteResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RouteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RouteResponse) ProtoMessage() {} + +func (x *RouteResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RouteResponse.ProtoReflect.Descriptor instead. +func (*RouteResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{15} +} + +func (x *RouteResponse) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *RouteResponse) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type StreamRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StreamRequest) Reset() { + *x = StreamRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamRequest) ProtoMessage() {} + +func (x *StreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamRequest.ProtoReflect.Descriptor instead. +func (*StreamRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{16} +} + +func (x *StreamRequest) GetMessage() *Message { + if x != nil { + return x.Message + } + return nil +} + +type StreamResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` + Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` + SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Tool *ToolCall `protobuf:"bytes,4,opt,name=tool,proto3" json:"tool,omitempty"` + Media *Media `protobuf:"bytes,5,opt,name=media,proto3" json:"media,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StreamResponse) Reset() { + *x = StreamResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StreamResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamResponse) ProtoMessage() {} + +func (x *StreamResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamResponse.ProtoReflect.Descriptor instead. +func (*StreamResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{17} +} + +func (x *StreamResponse) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *StreamResponse) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *StreamResponse) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *StreamResponse) GetTool() *ToolCall { + if x != nil { + return x.Tool + } + return nil +} + +func (x *StreamResponse) GetMedia() *Media { + if x != nil { + return x.Media + } + return nil +} + +type CancelRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CancelRequest) Reset() { + *x = CancelRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CancelRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelRequest) ProtoMessage() {} + +func (x *CancelRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelRequest.ProtoReflect.Descriptor instead. +func (*CancelRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{18} +} + +func (x *CancelRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type CancelResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cancelled bool `protobuf:"varint,1,opt,name=cancelled,proto3" json:"cancelled,omitempty"` + Dropped int64 `protobuf:"varint,2,opt,name=dropped,proto3" json:"dropped,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CancelResponse) Reset() { + *x = CancelResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CancelResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelResponse) ProtoMessage() {} + +func (x *CancelResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelResponse.ProtoReflect.Descriptor instead. +func (*CancelResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{19} +} + +func (x *CancelResponse) GetCancelled() bool { + if x != nil { + return x.Cancelled + } + return false +} + +func (x *CancelResponse) GetDropped() int64 { + if x != nil { + return x.Dropped + } + return 0 +} + +type SetPersonaRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SetPersonaRequest) Reset() { + *x = SetPersonaRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetPersonaRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetPersonaRequest) ProtoMessage() {} + +func (x *SetPersonaRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetPersonaRequest.ProtoReflect.Descriptor instead. +func (*SetPersonaRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{20} +} + +func (x *SetPersonaRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *SetPersonaRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type SetPersonaResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Found bool `protobuf:"varint,1,opt,name=found,proto3" json:"found,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SetPersonaResponse) Reset() { + *x = SetPersonaResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetPersonaResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetPersonaResponse) ProtoMessage() {} + +func (x *SetPersonaResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetPersonaResponse.ProtoReflect.Descriptor instead. +func (*SetPersonaResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{21} +} + +func (x *SetPersonaResponse) GetFound() bool { + if x != nil { + return x.Found + } + return false +} + +type ApplyTaskActionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + TaskId int64 `protobuf:"varint,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"` + Instructions string `protobuf:"bytes,4,opt,name=instructions,proto3" json:"instructions,omitempty"` + Findings []string `protobuf:"bytes,5,rep,name=findings,proto3" json:"findings,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApplyTaskActionRequest) Reset() { + *x = ApplyTaskActionRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApplyTaskActionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyTaskActionRequest) ProtoMessage() {} + +func (x *ApplyTaskActionRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyTaskActionRequest.ProtoReflect.Descriptor instead. +func (*ApplyTaskActionRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{22} +} + +func (x *ApplyTaskActionRequest) GetIdentity() string { + if x != nil { + return x.Identity + } + return "" +} + +func (x *ApplyTaskActionRequest) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *ApplyTaskActionRequest) GetAction() string { + if x != nil { + return x.Action + } + return "" +} + +func (x *ApplyTaskActionRequest) GetInstructions() string { + if x != nil { + return x.Instructions + } + return "" +} + +func (x *ApplyTaskActionRequest) GetFindings() []string { + if x != nil { + return x.Findings + } + return nil +} + +type ApplyTaskActionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApplyTaskActionResponse) Reset() { + *x = ApplyTaskActionResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApplyTaskActionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyTaskActionResponse) ProtoMessage() {} + +func (x *ApplyTaskActionResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyTaskActionResponse.ProtoReflect.Descriptor instead. +func (*ApplyTaskActionResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{23} +} + +func (x *ApplyTaskActionResponse) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *ApplyTaskActionResponse) GetAction() string { + if x != nil { + return x.Action + } + return "" +} + +func (x *ApplyTaskActionResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// An authenticated dashboard operator acts across identities, so this request +// carries no identity to scope against -- the distinction the daemon's task +// action service draws with a nil identity (internal/domain/taskactions). +type ApplyOperatorTaskActionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"` + // actor_id is the identity that performed the action, as asserted by the + // caller that verified the credential the request presented. actor_kind + // travels beside it so the record can say an agent acted without a reader + // resolving the identity. principal_id is the identity whose authority the + // action used; empty means the action is recorded unattributed rather than + // credited to the actor's own authority. All three are empty when the caller + // has no verified identity, which is recorded as an unattributed action and + // never as a human's. + ActorId string `protobuf:"bytes,3,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"` + ActorKind string `protobuf:"bytes,4,opt,name=actor_kind,json=actorKind,proto3" json:"actor_kind,omitempty"` + PrincipalId string `protobuf:"bytes,5,opt,name=principal_id,json=principalId,proto3" json:"principal_id,omitempty"` + // instructions and findings are the review gate answer payload + // (taskactions.ActionPayload): the instructions a rereview requires, and + // the finding keys an approve posts (empty means every offered finding). + // They are empty for every other action. + Instructions string `protobuf:"bytes,6,opt,name=instructions,proto3" json:"instructions,omitempty"` + Findings []string `protobuf:"bytes,7,rep,name=findings,proto3" json:"findings,omitempty"` + // retry_mode is the operator's worktree choice for a retry + // (taskstate.RetryMode): refresh onto the base branch or continue the work + // already pushed on the task's branch. It is empty for every other action, + // and chat carries no mode syntax -- an empty value means refresh_onto_base. + RetryMode string `protobuf:"bytes,8,opt,name=retry_mode,json=retryMode,proto3" json:"retry_mode,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApplyOperatorTaskActionRequest) Reset() { + *x = ApplyOperatorTaskActionRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApplyOperatorTaskActionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyOperatorTaskActionRequest) ProtoMessage() {} + +func (x *ApplyOperatorTaskActionRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyOperatorTaskActionRequest.ProtoReflect.Descriptor instead. +func (*ApplyOperatorTaskActionRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{24} +} + +func (x *ApplyOperatorTaskActionRequest) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *ApplyOperatorTaskActionRequest) GetAction() string { + if x != nil { + return x.Action + } + return "" +} + +func (x *ApplyOperatorTaskActionRequest) GetActorId() string { + if x != nil { + return x.ActorId + } + return "" +} + +func (x *ApplyOperatorTaskActionRequest) GetActorKind() string { + if x != nil { + return x.ActorKind + } + return "" +} + +func (x *ApplyOperatorTaskActionRequest) GetPrincipalId() string { + if x != nil { + return x.PrincipalId + } + return "" +} + +func (x *ApplyOperatorTaskActionRequest) GetInstructions() string { + if x != nil { + return x.Instructions + } + return "" +} + +func (x *ApplyOperatorTaskActionRequest) GetFindings() []string { + if x != nil { + return x.Findings + } + return nil +} + +func (x *ApplyOperatorTaskActionRequest) GetRetryMode() string { + if x != nil { + return x.RetryMode + } + return "" +} + +type ApplyOperatorTaskActionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApplyOperatorTaskActionResponse) Reset() { + *x = ApplyOperatorTaskActionResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApplyOperatorTaskActionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyOperatorTaskActionResponse) ProtoMessage() {} + +func (x *ApplyOperatorTaskActionResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyOperatorTaskActionResponse.ProtoReflect.Descriptor instead. +func (*ApplyOperatorTaskActionResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{25} +} + +func (x *ApplyOperatorTaskActionResponse) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *ApplyOperatorTaskActionResponse) GetAction() string { + if x != nil { + return x.Action + } + return "" +} + +func (x *ApplyOperatorTaskActionResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type SaveSessionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SaveSessionResponse) Reset() { + *x = SaveSessionResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SaveSessionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveSessionResponse) ProtoMessage() {} + +func (x *SaveSessionResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveSessionResponse.ProtoReflect.Descriptor instead. +func (*SaveSessionResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{26} +} + +type SaveSessionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SaveSessionRequest) Reset() { + *x = SaveSessionRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SaveSessionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveSessionRequest) ProtoMessage() {} + +func (x *SaveSessionRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveSessionRequest.ProtoReflect.Descriptor instead. +func (*SaveSessionRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{27} +} + +func (x *SaveSessionRequest) GetSession() *Session { + if x != nil { + return x.Session + } + return nil +} + +type GetSessionsByChannelRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSessionsByChannelRequest) Reset() { + *x = GetSessionsByChannelRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSessionsByChannelRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSessionsByChannelRequest) ProtoMessage() {} + +func (x *GetSessionsByChannelRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSessionsByChannelRequest.ProtoReflect.Descriptor instead. +func (*GetSessionsByChannelRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{28} +} + +func (x *GetSessionsByChannelRequest) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *GetSessionsByChannelRequest) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +type GetSessionsByChannelResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Sessions []*Session `protobuf:"bytes,1,rep,name=sessions,proto3" json:"sessions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSessionsByChannelResponse) Reset() { + *x = GetSessionsByChannelResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSessionsByChannelResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSessionsByChannelResponse) ProtoMessage() {} + +func (x *GetSessionsByChannelResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSessionsByChannelResponse.ProtoReflect.Descriptor instead. +func (*GetSessionsByChannelResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{29} +} + +func (x *GetSessionsByChannelResponse) GetSessions() []*Session { + if x != nil { + return x.Sessions + } + return nil +} + +type ListSessionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Sessions []*Session `protobuf:"bytes,1,rep,name=sessions,proto3" json:"sessions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListSessionsResponse) Reset() { + *x = ListSessionsResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListSessionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSessionsResponse) ProtoMessage() {} + +func (x *ListSessionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSessionsResponse.ProtoReflect.Descriptor instead. +func (*ListSessionsResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{30} +} + +func (x *ListSessionsResponse) GetSessions() []*Session { + if x != nil { + return x.Sessions + } + return nil +} + +type DeleteSessionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteSessionResponse) Reset() { + *x = DeleteSessionResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteSessionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteSessionResponse) ProtoMessage() {} + +func (x *DeleteSessionResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteSessionResponse.ProtoReflect.Descriptor instead. +func (*DeleteSessionResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{31} +} + +type TouchSessionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TouchSessionResponse) Reset() { + *x = TouchSessionResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TouchSessionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TouchSessionResponse) ProtoMessage() {} + +func (x *TouchSessionResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TouchSessionResponse.ProtoReflect.Descriptor instead. +func (*TouchSessionResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{32} +} + +type SaveMessageResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SaveMessageResponse) Reset() { + *x = SaveMessageResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SaveMessageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveMessageResponse) ProtoMessage() {} + +func (x *SaveMessageResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveMessageResponse.ProtoReflect.Descriptor instead. +func (*SaveMessageResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{33} +} + +type SaveMessagesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SaveMessagesResponse) Reset() { + *x = SaveMessagesResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SaveMessagesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveMessagesResponse) ProtoMessage() {} + +func (x *SaveMessagesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveMessagesResponse.ProtoReflect.Descriptor instead. +func (*SaveMessagesResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{34} +} + +type ReplaceMessagesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReplaceMessagesResponse) Reset() { + *x = ReplaceMessagesResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReplaceMessagesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReplaceMessagesResponse) ProtoMessage() {} + +func (x *ReplaceMessagesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReplaceMessagesResponse.ProtoReflect.Descriptor instead. +func (*ReplaceMessagesResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{35} +} + +type DeleteSessionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteSessionRequest) Reset() { + *x = DeleteSessionRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteSessionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteSessionRequest) ProtoMessage() {} + +func (x *DeleteSessionRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteSessionRequest.ProtoReflect.Descriptor instead. +func (*DeleteSessionRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{36} +} + +func (x *DeleteSessionRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type TouchSessionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TouchSessionRequest) Reset() { + *x = TouchSessionRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TouchSessionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TouchSessionRequest) ProtoMessage() {} + +func (x *TouchSessionRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TouchSessionRequest.ProtoReflect.Descriptor instead. +func (*TouchSessionRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{37} +} + +func (x *TouchSessionRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type ListSessionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListSessionsRequest) Reset() { + *x = ListSessionsRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListSessionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSessionsRequest) ProtoMessage() {} + +func (x *ListSessionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSessionsRequest.ProtoReflect.Descriptor instead. +func (*ListSessionsRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{38} +} + +type SaveMessageRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Message *Message `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SaveMessageRequest) Reset() { + *x = SaveMessageRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SaveMessageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveMessageRequest) ProtoMessage() {} + +func (x *SaveMessageRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveMessageRequest.ProtoReflect.Descriptor instead. +func (*SaveMessageRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{39} +} + +func (x *SaveMessageRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *SaveMessageRequest) GetMessage() *Message { + if x != nil { + return x.Message + } + return nil +} + +type DeleteRecentMessagesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRecentMessagesRequest) Reset() { + *x = DeleteRecentMessagesRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteRecentMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRecentMessagesRequest) ProtoMessage() {} + +func (x *DeleteRecentMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRecentMessagesRequest.ProtoReflect.Descriptor instead. +func (*DeleteRecentMessagesRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{40} +} + +func (x *DeleteRecentMessagesRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *DeleteRecentMessagesRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +type DeleteRecentMessagesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Deleted int64 `protobuf:"varint,1,opt,name=deleted,proto3" json:"deleted,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRecentMessagesResponse) Reset() { + *x = DeleteRecentMessagesResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteRecentMessagesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRecentMessagesResponse) ProtoMessage() {} + +func (x *DeleteRecentMessagesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRecentMessagesResponse.ProtoReflect.Descriptor instead. +func (*DeleteRecentMessagesResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{41} +} + +func (x *DeleteRecentMessagesResponse) GetDeleted() int64 { + if x != nil { + return x.Deleted + } + return 0 +} + +type MessageCountRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MessageCountRequest) Reset() { + *x = MessageCountRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MessageCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageCountRequest) ProtoMessage() {} + +func (x *MessageCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageCountRequest.ProtoReflect.Descriptor instead. +func (*MessageCountRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{42} +} + +func (x *MessageCountRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type MessageCountResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MessageCountResponse) Reset() { + *x = MessageCountResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MessageCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageCountResponse) ProtoMessage() {} + +func (x *MessageCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageCountResponse.ProtoReflect.Descriptor instead. +func (*MessageCountResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{43} +} + +func (x *MessageCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +type SaveMessagesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Messages []*Message `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SaveMessagesRequest) Reset() { + *x = SaveMessagesRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SaveMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveMessagesRequest) ProtoMessage() {} + +func (x *SaveMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveMessagesRequest.ProtoReflect.Descriptor instead. +func (*SaveMessagesRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{44} +} + +func (x *SaveMessagesRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *SaveMessagesRequest) GetMessages() []*Message { + if x != nil { + return x.Messages + } + return nil +} + +type ReplaceMessagesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Messages []*Message `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` + Superseded []string `protobuf:"bytes,3,rep,name=superseded,proto3" json:"superseded,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReplaceMessagesRequest) Reset() { + *x = ReplaceMessagesRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReplaceMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReplaceMessagesRequest) ProtoMessage() {} + +func (x *ReplaceMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReplaceMessagesRequest.ProtoReflect.Descriptor instead. +func (*ReplaceMessagesRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{45} +} + +func (x *ReplaceMessagesRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *ReplaceMessagesRequest) GetMessages() []*Message { + if x != nil { + return x.Messages + } + return nil +} + +func (x *ReplaceMessagesRequest) GetSuperseded() []string { + if x != nil { + return x.Superseded + } + return nil +} + +type SearchMessagesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` + Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` + Offset int64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchMessagesRequest) Reset() { + *x = SearchMessagesRequest{} + mi := &file_gateway_v1_chat_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchMessagesRequest) ProtoMessage() {} + +func (x *SearchMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchMessagesRequest.ProtoReflect.Descriptor instead. +func (*SearchMessagesRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{46} +} + +func (x *SearchMessagesRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *SearchMessagesRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *SearchMessagesRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *SearchMessagesRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +type SearchMessagesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + NextOffset int64 `protobuf:"varint,2,opt,name=next_offset,json=nextOffset,proto3" json:"next_offset,omitempty"` + HasMore bool `protobuf:"varint,3,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty"` + Truncated bool `protobuf:"varint,4,opt,name=truncated,proto3" json:"truncated,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchMessagesResponse) Reset() { + *x = SearchMessagesResponse{} + mi := &file_gateway_v1_chat_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchMessagesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchMessagesResponse) ProtoMessage() {} + +func (x *SearchMessagesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_chat_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchMessagesResponse.ProtoReflect.Descriptor instead. +func (*SearchMessagesResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{47} +} + +func (x *SearchMessagesResponse) GetMessages() []*Message { + if x != nil { + return x.Messages + } + return nil +} + +func (x *SearchMessagesResponse) GetNextOffset() int64 { + if x != nil { + return x.NextOffset + } + return 0 +} + +func (x *SearchMessagesResponse) GetHasMore() bool { + if x != nil { + return x.HasMore + } + return false +} + +func (x *SearchMessagesResponse) GetTruncated() bool { + if x != nil { + return x.Truncated + } + return false +} + +var File_gateway_v1_chat_proto protoreflect.FileDescriptor + +const file_gateway_v1_chat_proto_rawDesc = "" + + "\n" + + "\x15gateway/v1/chat.proto\x12\n" + + "gateway.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfb\x02\n" + + "\aSession\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12\x1a\n" + + "\bplatform\x18\x02 \x01(\tR\bplatform\x12\x19\n" + + "\bbot_user\x18\x03 \x01(\tR\abotUser\x12\x1d\n" + + "\n" + + "channel_id\x18\x04 \x01(\tR\tchannelId\x12\x1b\n" + + "\tthread_id\x18\x05 \x01(\tR\bthreadId\x12\x14\n" + + "\x05title\x18\x06 \x01(\tR\x05title\x12*\n" + + "\x11parent_session_id\x18\a \x01(\tR\x0fparentSessionId\x12\x1f\n" + + "\vbranch_name\x18\b \x01(\tR\n" + + "branchName\x129\n" + + "\n" + + "created_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12@\n" + + "\x0elast_active_at\x18\n" + + " \x01(\v2\x1a.google.protobuf.TimestampR\flastActiveAt\"\xcd\x02\n" + + "\aMessage\x12\x1d\n" + + "\n" + + "message_id\x18\x01 \x01(\tR\tmessageId\x12\x1b\n" + + "\tsource_id\x18\x02 \x01(\tR\bsourceId\x12\x1d\n" + + "\n" + + "channel_id\x18\x03 \x01(\tR\tchannelId\x12\x1b\n" + + "\tthread_id\x18\x04 \x01(\tR\bthreadId\x12\x12\n" + + "\x04from\x18\x05 \x01(\tR\x04from\x12\x12\n" + + "\x04text\x18\x06 \x01(\tR\x04text\x12\x12\n" + + "\x04page\x18\a \x01(\tR\x04page\x12*\n" + + "\x02at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\x02at\x12\x1d\n" + + "\n" + + "budget_key\x18\t \x01(\tR\tbudgetKey\x12\x1a\n" + + "\bplatform\x18\n" + + " \x01(\tR\bplatform\x12'\n" + + "\x05media\x18\v \x03(\v2\x11.gateway.v1.MediaR\x05media\"|\n" + + "\bToolCall\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1e\n" + + "\n" + + "parameters\x18\x03 \x01(\tR\n" + + "parameters\x12\x16\n" + + "\x06output\x18\x04 \x01(\tR\x06output\x12\x14\n" + + "\x05error\x18\x05 \x01(\tR\x05error\"\xf0\x02\n" + + "\x05Media\x12\x1b\n" + + "\ttool_name\x18\x01 \x01(\tR\btoolName\x12\x12\n" + + "\x04type\x18\x02 \x01(\tR\x04type\x12\x17\n" + + "\afile_id\x18\x03 \x01(\tR\x06fileId\x12\x10\n" + + "\x03url\x18\x04 \x01(\tR\x03url\x12\x12\n" + + "\x04path\x18\x05 \x01(\tR\x04path\x12\x1b\n" + + "\tmime_type\x18\x06 \x01(\tR\bmimeType\x12\x1b\n" + + "\tfile_name\x18\a \x01(\tR\bfileName\x12 \n" + + "\tfile_size\x18\b \x01(\x03H\x00R\bfileSize\x88\x01\x01\x12\x19\n" + + "\x05width\x18\t \x01(\x03H\x01R\x05width\x88\x01\x01\x12\x1b\n" + + "\x06height\x18\n" + + " \x01(\x03H\x02R\x06height\x88\x01\x01\x12\x1f\n" + + "\bduration\x18\v \x01(\x03H\x03R\bduration\x88\x01\x01\x12\x12\n" + + "\x04data\x18\f \x01(\fR\x04dataB\f\n" + + "\n" + + "_file_sizeB\b\n" + + "\x06_widthB\t\n" + + "\a_heightB\v\n" + + "\t_duration\"\x8d\x04\n" + + "\x04Turn\x12\x17\n" + + "\aturn_id\x18\x01 \x01(\tR\x06turnId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12\x1b\n" + + "\tsource_id\x18\x03 \x01(\tR\bsourceId\x12\x16\n" + + "\x06status\x18\x04 \x01(\tR\x06status\x12\x18\n" + + "\aattempt\x18\x05 \x01(\x03R\aattempt\x12\x19\n" + + "\bowner_id\x18\x06 \x01(\tR\aownerId\x12(\n" + + "\x10input_message_id\x18\a \x01(\tR\x0einputMessageId\x120\n" + + "\x14assistant_message_id\x18\b \x01(\tR\x12assistantMessageId\x12!\n" + + "\fpartial_text\x18\t \x01(\tR\vpartialText\x12#\n" + + "\rresponse_text\x18\n" + + " \x01(\tR\fresponseText\x123\n" + + "\n" + + "tool_calls\x18\v \x03(\v2\x14.gateway.v1.ToolCallR\ttoolCalls\x12\x14\n" + + "\x05error\x18\f \x01(\tR\x05error\x129\n" + + "\n" + + "created_at\x18\r \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + + "\n" + + "updated_at\x18\x0e \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"$\n" + + "\n" + + "StringList\x12\x16\n" + + "\x06values\x18\x01 \x03(\tR\x06values\"\x11\n" + + "\x0fSnapshotRequest\"\xeb\x05\n" + + "\x10SnapshotResponse\x12/\n" + + "\bsessions\x18\x01 \x03(\v2\x13.gateway.v1.SessionR\bsessions\x12\x16\n" + + "\x06models\x18\x02 \x03(\tR\x06models\x12`\n" + + "\x12models_by_provider\x18\x03 \x03(\v22.gateway.v1.SnapshotResponse.ModelsByProviderEntryR\x10modelsByProvider\x12\x1c\n" + + "\tproviders\x18\x04 \x03(\tR\tproviders\x12!\n" + + "\factive_model\x18\x05 \x01(\tR\vactiveModel\x12'\n" + + "\x0factive_provider\x18\x06 \x01(\tR\x0eactiveProvider\x12\x1a\n" + + "\bpersonas\x18\a \x03(\tR\bpersonas\x12Y\n" + + "\x0factive_personas\x18\b \x03(\v20.gateway.v1.SnapshotResponse.ActivePersonasEntryR\x0eactivePersonas\x12+\n" + + "\x11restart_available\x18\t \x01(\bR\x10restartAvailable\x125\n" + + "\x16cancellation_available\x18\n" + + " \x01(\bR\x15cancellationAvailable\x12-\n" + + "\x12personas_available\x18\v \x01(\bR\x11personasAvailable\x12\x18\n" + + "\aversion\x18\f \x01(\tR\aversion\x1a[\n" + + "\x15ModelsByProviderEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12,\n" + + "\x05value\x18\x02 \x01(\v2\x16.gateway.v1.StringListR\x05value:\x028\x01\x1aA\n" + + "\x13ActivePersonasEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"2\n" + + "\x11GetSessionRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\"Y\n" + + "\x12GetSessionResponse\x12-\n" + + "\asession\x18\x01 \x01(\v2\x13.gateway.v1.SessionR\asession\x12\x14\n" + + "\x05found\x18\x02 \x01(\bR\x05found\"L\n" + + "\x15RecentMessagesRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12\x14\n" + + "\x05limit\x18\x02 \x01(\x03R\x05limit\"I\n" + + "\x16RecentMessagesResponse\x12/\n" + + "\bmessages\x18\x01 \x03(\v2\x13.gateway.v1.MessageR\bmessages\"I\n" + + "\x12RecentTurnsRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12\x14\n" + + "\x05limit\x18\x02 \x01(\x03R\x05limit\"=\n" + + "\x13RecentTurnsResponse\x12&\n" + + "\x05turns\x18\x01 \x03(\v2\x10.gateway.v1.TurnR\x05turns\"=\n" + + "\fRouteRequest\x12-\n" + + "\amessage\x18\x01 \x01(\v2\x13.gateway.v1.MessageR\amessage\"B\n" + + "\rRouteResponse\x12\x12\n" + + "\x04text\x18\x01 \x01(\tR\x04text\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\">\n" + + "\rStreamRequest\x12-\n" + + "\amessage\x18\x01 \x01(\v2\x13.gateway.v1.MessageR\amessage\"\xaa\x01\n" + + "\x0eStreamResponse\x12\x12\n" + + "\x04kind\x18\x01 \x01(\tR\x04kind\x12\x12\n" + + "\x04text\x18\x02 \x01(\tR\x04text\x12\x1d\n" + + "\n" + + "session_id\x18\x03 \x01(\tR\tsessionId\x12(\n" + + "\x04tool\x18\x04 \x01(\v2\x14.gateway.v1.ToolCallR\x04tool\x12'\n" + + "\x05media\x18\x05 \x01(\v2\x11.gateway.v1.MediaR\x05media\".\n" + + "\rCancelRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\"H\n" + + "\x0eCancelResponse\x12\x1c\n" + + "\tcancelled\x18\x01 \x01(\bR\tcancelled\x12\x18\n" + + "\adropped\x18\x02 \x01(\x03R\adropped\"F\n" + + "\x11SetPersonaRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\"*\n" + + "\x12SetPersonaResponse\x12\x14\n" + + "\x05found\x18\x01 \x01(\bR\x05found\"\xa5\x01\n" + + "\x16ApplyTaskActionRequest\x12\x1a\n" + + "\bidentity\x18\x01 \x01(\tR\bidentity\x12\x17\n" + + "\atask_id\x18\x02 \x01(\x03R\x06taskId\x12\x16\n" + + "\x06action\x18\x03 \x01(\tR\x06action\x12\"\n" + + "\finstructions\x18\x04 \x01(\tR\finstructions\x12\x1a\n" + + "\bfindings\x18\x05 \x03(\tR\bfindings\"d\n" + + "\x17ApplyTaskActionResponse\x12\x17\n" + + "\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x16\n" + + "\x06action\x18\x02 \x01(\tR\x06action\x12\x18\n" + + "\amessage\x18\x03 \x01(\tR\amessage\"\x8d\x02\n" + + "\x1eApplyOperatorTaskActionRequest\x12\x17\n" + + "\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x16\n" + + "\x06action\x18\x02 \x01(\tR\x06action\x12\x19\n" + + "\bactor_id\x18\x03 \x01(\tR\aactorId\x12\x1d\n" + + "\n" + + "actor_kind\x18\x04 \x01(\tR\tactorKind\x12!\n" + + "\fprincipal_id\x18\x05 \x01(\tR\vprincipalId\x12\"\n" + + "\finstructions\x18\x06 \x01(\tR\finstructions\x12\x1a\n" + + "\bfindings\x18\a \x03(\tR\bfindings\x12\x1d\n" + + "\n" + + "retry_mode\x18\b \x01(\tR\tretryMode\"l\n" + + "\x1fApplyOperatorTaskActionResponse\x12\x17\n" + + "\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x16\n" + + "\x06action\x18\x02 \x01(\tR\x06action\x12\x18\n" + + "\amessage\x18\x03 \x01(\tR\amessage\"\x15\n" + + "\x13SaveSessionResponse\"C\n" + + "\x12SaveSessionRequest\x12-\n" + + "\asession\x18\x01 \x01(\v2\x13.gateway.v1.SessionR\asession\"X\n" + + "\x1bGetSessionsByChannelRequest\x12\x1a\n" + + "\bplatform\x18\x01 \x01(\tR\bplatform\x12\x1d\n" + + "\n" + + "channel_id\x18\x02 \x01(\tR\tchannelId\"O\n" + + "\x1cGetSessionsByChannelResponse\x12/\n" + + "\bsessions\x18\x01 \x03(\v2\x13.gateway.v1.SessionR\bsessions\"G\n" + + "\x14ListSessionsResponse\x12/\n" + + "\bsessions\x18\x01 \x03(\v2\x13.gateway.v1.SessionR\bsessions\"\x17\n" + + "\x15DeleteSessionResponse\"\x16\n" + + "\x14TouchSessionResponse\"\x15\n" + + "\x13SaveMessageResponse\"\x16\n" + + "\x14SaveMessagesResponse\"\x19\n" + + "\x17ReplaceMessagesResponse\"5\n" + + "\x14DeleteSessionRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\"4\n" + + "\x13TouchSessionRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\"\x15\n" + + "\x13ListSessionsRequest\"b\n" + + "\x12SaveMessageRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12-\n" + + "\amessage\x18\x02 \x01(\v2\x13.gateway.v1.MessageR\amessage\"R\n" + + "\x1bDeleteRecentMessagesRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12\x14\n" + + "\x05limit\x18\x02 \x01(\x03R\x05limit\"8\n" + + "\x1cDeleteRecentMessagesResponse\x12\x18\n" + + "\adeleted\x18\x01 \x01(\x03R\adeleted\"4\n" + + "\x13MessageCountRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\",\n" + + "\x14MessageCountResponse\x12\x14\n" + + "\x05count\x18\x01 \x01(\x03R\x05count\"e\n" + + "\x13SaveMessagesRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12/\n" + + "\bmessages\x18\x02 \x03(\v2\x13.gateway.v1.MessageR\bmessages\"\x88\x01\n" + + "\x16ReplaceMessagesRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12/\n" + + "\bmessages\x18\x02 \x03(\v2\x13.gateway.v1.MessageR\bmessages\x12\x1e\n" + + "\n" + + "superseded\x18\x03 \x03(\tR\n" + + "superseded\"z\n" + + "\x15SearchMessagesRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12\x14\n" + + "\x05query\x18\x02 \x01(\tR\x05query\x12\x14\n" + + "\x05limit\x18\x03 \x01(\x03R\x05limit\x12\x16\n" + + "\x06offset\x18\x04 \x01(\x03R\x06offset\"\xa3\x01\n" + + "\x16SearchMessagesResponse\x12/\n" + + "\bmessages\x18\x01 \x03(\v2\x13.gateway.v1.MessageR\bmessages\x12\x1f\n" + + "\vnext_offset\x18\x02 \x01(\x03R\n" + + "nextOffset\x12\x19\n" + + "\bhas_more\x18\x03 \x01(\bR\ahasMore\x12\x1c\n" + + "\ttruncated\x18\x04 \x01(\bR\ttruncated2\xf6\r\n" + + "\vChatService\x12E\n" + + "\bSnapshot\x12\x1b.gateway.v1.SnapshotRequest\x1a\x1c.gateway.v1.SnapshotResponse\x12K\n" + + "\n" + + "GetSession\x12\x1d.gateway.v1.GetSessionRequest\x1a\x1e.gateway.v1.GetSessionResponse\x12W\n" + + "\x0eRecentMessages\x12!.gateway.v1.RecentMessagesRequest\x1a\".gateway.v1.RecentMessagesResponse\x12N\n" + + "\vRecentTurns\x12\x1e.gateway.v1.RecentTurnsRequest\x1a\x1f.gateway.v1.RecentTurnsResponse\x12<\n" + + "\x05Route\x12\x18.gateway.v1.RouteRequest\x1a\x19.gateway.v1.RouteResponse\x12A\n" + + "\x06Stream\x12\x19.gateway.v1.StreamRequest\x1a\x1a.gateway.v1.StreamResponse0\x01\x12?\n" + + "\x06Cancel\x12\x19.gateway.v1.CancelRequest\x1a\x1a.gateway.v1.CancelResponse\x12K\n" + + "\n" + + "SetPersona\x12\x1d.gateway.v1.SetPersonaRequest\x1a\x1e.gateway.v1.SetPersonaResponse\x12Z\n" + + "\x0fApplyTaskAction\x12\".gateway.v1.ApplyTaskActionRequest\x1a#.gateway.v1.ApplyTaskActionResponse\x12r\n" + + "\x17ApplyOperatorTaskAction\x12*.gateway.v1.ApplyOperatorTaskActionRequest\x1a+.gateway.v1.ApplyOperatorTaskActionResponse\x12N\n" + + "\vSaveSession\x12\x1e.gateway.v1.SaveSessionRequest\x1a\x1f.gateway.v1.SaveSessionResponse\x12i\n" + + "\x14GetSessionsByChannel\x12'.gateway.v1.GetSessionsByChannelRequest\x1a(.gateway.v1.GetSessionsByChannelResponse\x12T\n" + + "\rDeleteSession\x12 .gateway.v1.DeleteSessionRequest\x1a!.gateway.v1.DeleteSessionResponse\x12Q\n" + + "\fTouchSession\x12\x1f.gateway.v1.TouchSessionRequest\x1a .gateway.v1.TouchSessionResponse\x12Q\n" + + "\fListSessions\x12\x1f.gateway.v1.ListSessionsRequest\x1a .gateway.v1.ListSessionsResponse\x12N\n" + + "\vSaveMessage\x12\x1e.gateway.v1.SaveMessageRequest\x1a\x1f.gateway.v1.SaveMessageResponse\x12i\n" + + "\x14DeleteRecentMessages\x12'.gateway.v1.DeleteRecentMessagesRequest\x1a(.gateway.v1.DeleteRecentMessagesResponse\x12Q\n" + + "\fMessageCount\x12\x1f.gateway.v1.MessageCountRequest\x1a .gateway.v1.MessageCountResponse\x12Q\n" + + "\fSaveMessages\x12\x1f.gateway.v1.SaveMessagesRequest\x1a .gateway.v1.SaveMessagesResponse\x12Z\n" + + "\x0fReplaceMessages\x12\".gateway.v1.ReplaceMessagesRequest\x1a#.gateway.v1.ReplaceMessagesResponse\x12W\n" + + "\x0eSearchMessages\x12!.gateway.v1.SearchMessagesRequest\x1a\".gateway.v1.SearchMessagesResponseB\xa2\x01\n" + + "\x0ecom.gateway.v1B\tChatProtoP\x01Z google.protobuf.Timestamp + 50, // 1: gateway.v1.Session.last_active_at:type_name -> google.protobuf.Timestamp + 50, // 2: gateway.v1.Message.at:type_name -> google.protobuf.Timestamp + 3, // 3: gateway.v1.Message.media:type_name -> gateway.v1.Media + 2, // 4: gateway.v1.Turn.tool_calls:type_name -> gateway.v1.ToolCall + 50, // 5: gateway.v1.Turn.created_at:type_name -> google.protobuf.Timestamp + 50, // 6: gateway.v1.Turn.updated_at:type_name -> google.protobuf.Timestamp + 0, // 7: gateway.v1.SnapshotResponse.sessions:type_name -> gateway.v1.Session + 48, // 8: gateway.v1.SnapshotResponse.models_by_provider:type_name -> gateway.v1.SnapshotResponse.ModelsByProviderEntry + 49, // 9: gateway.v1.SnapshotResponse.active_personas:type_name -> gateway.v1.SnapshotResponse.ActivePersonasEntry + 0, // 10: gateway.v1.GetSessionResponse.session:type_name -> gateway.v1.Session + 1, // 11: gateway.v1.RecentMessagesResponse.messages:type_name -> gateway.v1.Message + 4, // 12: gateway.v1.RecentTurnsResponse.turns:type_name -> gateway.v1.Turn + 1, // 13: gateway.v1.RouteRequest.message:type_name -> gateway.v1.Message + 1, // 14: gateway.v1.StreamRequest.message:type_name -> gateway.v1.Message + 2, // 15: gateway.v1.StreamResponse.tool:type_name -> gateway.v1.ToolCall + 3, // 16: gateway.v1.StreamResponse.media:type_name -> gateway.v1.Media + 0, // 17: gateway.v1.SaveSessionRequest.session:type_name -> gateway.v1.Session + 0, // 18: gateway.v1.GetSessionsByChannelResponse.sessions:type_name -> gateway.v1.Session + 0, // 19: gateway.v1.ListSessionsResponse.sessions:type_name -> gateway.v1.Session + 1, // 20: gateway.v1.SaveMessageRequest.message:type_name -> gateway.v1.Message + 1, // 21: gateway.v1.SaveMessagesRequest.messages:type_name -> gateway.v1.Message + 1, // 22: gateway.v1.ReplaceMessagesRequest.messages:type_name -> gateway.v1.Message + 1, // 23: gateway.v1.SearchMessagesResponse.messages:type_name -> gateway.v1.Message + 5, // 24: gateway.v1.SnapshotResponse.ModelsByProviderEntry.value:type_name -> gateway.v1.StringList + 6, // 25: gateway.v1.ChatService.Snapshot:input_type -> gateway.v1.SnapshotRequest + 8, // 26: gateway.v1.ChatService.GetSession:input_type -> gateway.v1.GetSessionRequest + 10, // 27: gateway.v1.ChatService.RecentMessages:input_type -> gateway.v1.RecentMessagesRequest + 12, // 28: gateway.v1.ChatService.RecentTurns:input_type -> gateway.v1.RecentTurnsRequest + 14, // 29: gateway.v1.ChatService.Route:input_type -> gateway.v1.RouteRequest + 16, // 30: gateway.v1.ChatService.Stream:input_type -> gateway.v1.StreamRequest + 18, // 31: gateway.v1.ChatService.Cancel:input_type -> gateway.v1.CancelRequest + 20, // 32: gateway.v1.ChatService.SetPersona:input_type -> gateway.v1.SetPersonaRequest + 22, // 33: gateway.v1.ChatService.ApplyTaskAction:input_type -> gateway.v1.ApplyTaskActionRequest + 24, // 34: gateway.v1.ChatService.ApplyOperatorTaskAction:input_type -> gateway.v1.ApplyOperatorTaskActionRequest + 27, // 35: gateway.v1.ChatService.SaveSession:input_type -> gateway.v1.SaveSessionRequest + 28, // 36: gateway.v1.ChatService.GetSessionsByChannel:input_type -> gateway.v1.GetSessionsByChannelRequest + 36, // 37: gateway.v1.ChatService.DeleteSession:input_type -> gateway.v1.DeleteSessionRequest + 37, // 38: gateway.v1.ChatService.TouchSession:input_type -> gateway.v1.TouchSessionRequest + 38, // 39: gateway.v1.ChatService.ListSessions:input_type -> gateway.v1.ListSessionsRequest + 39, // 40: gateway.v1.ChatService.SaveMessage:input_type -> gateway.v1.SaveMessageRequest + 40, // 41: gateway.v1.ChatService.DeleteRecentMessages:input_type -> gateway.v1.DeleteRecentMessagesRequest + 42, // 42: gateway.v1.ChatService.MessageCount:input_type -> gateway.v1.MessageCountRequest + 44, // 43: gateway.v1.ChatService.SaveMessages:input_type -> gateway.v1.SaveMessagesRequest + 45, // 44: gateway.v1.ChatService.ReplaceMessages:input_type -> gateway.v1.ReplaceMessagesRequest + 46, // 45: gateway.v1.ChatService.SearchMessages:input_type -> gateway.v1.SearchMessagesRequest + 7, // 46: gateway.v1.ChatService.Snapshot:output_type -> gateway.v1.SnapshotResponse + 9, // 47: gateway.v1.ChatService.GetSession:output_type -> gateway.v1.GetSessionResponse + 11, // 48: gateway.v1.ChatService.RecentMessages:output_type -> gateway.v1.RecentMessagesResponse + 13, // 49: gateway.v1.ChatService.RecentTurns:output_type -> gateway.v1.RecentTurnsResponse + 15, // 50: gateway.v1.ChatService.Route:output_type -> gateway.v1.RouteResponse + 17, // 51: gateway.v1.ChatService.Stream:output_type -> gateway.v1.StreamResponse + 19, // 52: gateway.v1.ChatService.Cancel:output_type -> gateway.v1.CancelResponse + 21, // 53: gateway.v1.ChatService.SetPersona:output_type -> gateway.v1.SetPersonaResponse + 23, // 54: gateway.v1.ChatService.ApplyTaskAction:output_type -> gateway.v1.ApplyTaskActionResponse + 25, // 55: gateway.v1.ChatService.ApplyOperatorTaskAction:output_type -> gateway.v1.ApplyOperatorTaskActionResponse + 26, // 56: gateway.v1.ChatService.SaveSession:output_type -> gateway.v1.SaveSessionResponse + 29, // 57: gateway.v1.ChatService.GetSessionsByChannel:output_type -> gateway.v1.GetSessionsByChannelResponse + 31, // 58: gateway.v1.ChatService.DeleteSession:output_type -> gateway.v1.DeleteSessionResponse + 32, // 59: gateway.v1.ChatService.TouchSession:output_type -> gateway.v1.TouchSessionResponse + 30, // 60: gateway.v1.ChatService.ListSessions:output_type -> gateway.v1.ListSessionsResponse + 33, // 61: gateway.v1.ChatService.SaveMessage:output_type -> gateway.v1.SaveMessageResponse + 41, // 62: gateway.v1.ChatService.DeleteRecentMessages:output_type -> gateway.v1.DeleteRecentMessagesResponse + 43, // 63: gateway.v1.ChatService.MessageCount:output_type -> gateway.v1.MessageCountResponse + 34, // 64: gateway.v1.ChatService.SaveMessages:output_type -> gateway.v1.SaveMessagesResponse + 35, // 65: gateway.v1.ChatService.ReplaceMessages:output_type -> gateway.v1.ReplaceMessagesResponse + 47, // 66: gateway.v1.ChatService.SearchMessages:output_type -> gateway.v1.SearchMessagesResponse + 46, // [46:67] is the sub-list for method output_type + 25, // [25:46] is the sub-list for method input_type + 25, // [25:25] is the sub-list for extension type_name + 25, // [25:25] is the sub-list for extension extendee + 0, // [0:25] is the sub-list for field type_name +} + +func init() { file_gateway_v1_chat_proto_init() } +func file_gateway_v1_chat_proto_init() { + if File_gateway_v1_chat_proto != nil { + return + } + file_gateway_v1_chat_proto_msgTypes[3].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_gateway_v1_chat_proto_rawDesc), len(file_gateway_v1_chat_proto_rawDesc)), + NumEnums: 0, + NumMessages: 50, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gateway_v1_chat_proto_goTypes, + DependencyIndexes: file_gateway_v1_chat_proto_depIdxs, + MessageInfos: file_gateway_v1_chat_proto_msgTypes, + }.Build() + File_gateway_v1_chat_proto = out.File + file_gateway_v1_chat_proto_goTypes = nil + file_gateway_v1_chat_proto_depIdxs = nil +} diff --git a/sdk/gateway/v1/chat_grpc.pb.go b/sdk/gateway/v1/chat_grpc.pb.go new file mode 100644 index 0000000..d15a671 --- /dev/null +++ b/sdk/gateway/v1/chat_grpc.pb.go @@ -0,0 +1,885 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.2 +// - protoc (unknown) +// source: gateway/v1/chat.proto + +package gatewayv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + ChatService_Snapshot_FullMethodName = "/gateway.v1.ChatService/Snapshot" + ChatService_GetSession_FullMethodName = "/gateway.v1.ChatService/GetSession" + ChatService_RecentMessages_FullMethodName = "/gateway.v1.ChatService/RecentMessages" + ChatService_RecentTurns_FullMethodName = "/gateway.v1.ChatService/RecentTurns" + ChatService_Route_FullMethodName = "/gateway.v1.ChatService/Route" + ChatService_Stream_FullMethodName = "/gateway.v1.ChatService/Stream" + ChatService_Cancel_FullMethodName = "/gateway.v1.ChatService/Cancel" + ChatService_SetPersona_FullMethodName = "/gateway.v1.ChatService/SetPersona" + ChatService_ApplyTaskAction_FullMethodName = "/gateway.v1.ChatService/ApplyTaskAction" + ChatService_ApplyOperatorTaskAction_FullMethodName = "/gateway.v1.ChatService/ApplyOperatorTaskAction" + ChatService_SaveSession_FullMethodName = "/gateway.v1.ChatService/SaveSession" + ChatService_GetSessionsByChannel_FullMethodName = "/gateway.v1.ChatService/GetSessionsByChannel" + ChatService_DeleteSession_FullMethodName = "/gateway.v1.ChatService/DeleteSession" + ChatService_TouchSession_FullMethodName = "/gateway.v1.ChatService/TouchSession" + ChatService_ListSessions_FullMethodName = "/gateway.v1.ChatService/ListSessions" + ChatService_SaveMessage_FullMethodName = "/gateway.v1.ChatService/SaveMessage" + ChatService_DeleteRecentMessages_FullMethodName = "/gateway.v1.ChatService/DeleteRecentMessages" + ChatService_MessageCount_FullMethodName = "/gateway.v1.ChatService/MessageCount" + ChatService_SaveMessages_FullMethodName = "/gateway.v1.ChatService/SaveMessages" + ChatService_ReplaceMessages_FullMethodName = "/gateway.v1.ChatService/ReplaceMessages" + ChatService_SearchMessages_FullMethodName = "/gateway.v1.ChatService/SearchMessages" +) + +// ChatServiceClient is the client API for ChatService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ChatServiceClient interface { + Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (*SnapshotResponse, error) + GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionResponse, error) + RecentMessages(ctx context.Context, in *RecentMessagesRequest, opts ...grpc.CallOption) (*RecentMessagesResponse, error) + RecentTurns(ctx context.Context, in *RecentTurnsRequest, opts ...grpc.CallOption) (*RecentTurnsResponse, error) + Route(ctx context.Context, in *RouteRequest, opts ...grpc.CallOption) (*RouteResponse, error) + Stream(ctx context.Context, in *StreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamResponse], error) + Cancel(ctx context.Context, in *CancelRequest, opts ...grpc.CallOption) (*CancelResponse, error) + SetPersona(ctx context.Context, in *SetPersonaRequest, opts ...grpc.CallOption) (*SetPersonaResponse, error) + ApplyTaskAction(ctx context.Context, in *ApplyTaskActionRequest, opts ...grpc.CallOption) (*ApplyTaskActionResponse, error) + ApplyOperatorTaskAction(ctx context.Context, in *ApplyOperatorTaskActionRequest, opts ...grpc.CallOption) (*ApplyOperatorTaskActionResponse, error) + SaveSession(ctx context.Context, in *SaveSessionRequest, opts ...grpc.CallOption) (*SaveSessionResponse, error) + GetSessionsByChannel(ctx context.Context, in *GetSessionsByChannelRequest, opts ...grpc.CallOption) (*GetSessionsByChannelResponse, error) + DeleteSession(ctx context.Context, in *DeleteSessionRequest, opts ...grpc.CallOption) (*DeleteSessionResponse, error) + TouchSession(ctx context.Context, in *TouchSessionRequest, opts ...grpc.CallOption) (*TouchSessionResponse, error) + ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error) + SaveMessage(ctx context.Context, in *SaveMessageRequest, opts ...grpc.CallOption) (*SaveMessageResponse, error) + DeleteRecentMessages(ctx context.Context, in *DeleteRecentMessagesRequest, opts ...grpc.CallOption) (*DeleteRecentMessagesResponse, error) + MessageCount(ctx context.Context, in *MessageCountRequest, opts ...grpc.CallOption) (*MessageCountResponse, error) + SaveMessages(ctx context.Context, in *SaveMessagesRequest, opts ...grpc.CallOption) (*SaveMessagesResponse, error) + ReplaceMessages(ctx context.Context, in *ReplaceMessagesRequest, opts ...grpc.CallOption) (*ReplaceMessagesResponse, error) + SearchMessages(ctx context.Context, in *SearchMessagesRequest, opts ...grpc.CallOption) (*SearchMessagesResponse, error) +} + +type chatServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewChatServiceClient(cc grpc.ClientConnInterface) ChatServiceClient { + return &chatServiceClient{cc} +} + +func (c *chatServiceClient) Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (*SnapshotResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SnapshotResponse) + err := c.cc.Invoke(ctx, ChatService_Snapshot_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetSessionResponse) + err := c.cc.Invoke(ctx, ChatService_GetSession_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) RecentMessages(ctx context.Context, in *RecentMessagesRequest, opts ...grpc.CallOption) (*RecentMessagesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RecentMessagesResponse) + err := c.cc.Invoke(ctx, ChatService_RecentMessages_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) RecentTurns(ctx context.Context, in *RecentTurnsRequest, opts ...grpc.CallOption) (*RecentTurnsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RecentTurnsResponse) + err := c.cc.Invoke(ctx, ChatService_RecentTurns_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) Route(ctx context.Context, in *RouteRequest, opts ...grpc.CallOption) (*RouteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RouteResponse) + err := c.cc.Invoke(ctx, ChatService_Route_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) Stream(ctx context.Context, in *StreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ChatService_ServiceDesc.Streams[0], ChatService_Stream_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[StreamRequest, StreamResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ChatService_StreamClient = grpc.ServerStreamingClient[StreamResponse] + +func (c *chatServiceClient) Cancel(ctx context.Context, in *CancelRequest, opts ...grpc.CallOption) (*CancelResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CancelResponse) + err := c.cc.Invoke(ctx, ChatService_Cancel_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) SetPersona(ctx context.Context, in *SetPersonaRequest, opts ...grpc.CallOption) (*SetPersonaResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SetPersonaResponse) + err := c.cc.Invoke(ctx, ChatService_SetPersona_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) ApplyTaskAction(ctx context.Context, in *ApplyTaskActionRequest, opts ...grpc.CallOption) (*ApplyTaskActionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ApplyTaskActionResponse) + err := c.cc.Invoke(ctx, ChatService_ApplyTaskAction_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) ApplyOperatorTaskAction(ctx context.Context, in *ApplyOperatorTaskActionRequest, opts ...grpc.CallOption) (*ApplyOperatorTaskActionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ApplyOperatorTaskActionResponse) + err := c.cc.Invoke(ctx, ChatService_ApplyOperatorTaskAction_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) SaveSession(ctx context.Context, in *SaveSessionRequest, opts ...grpc.CallOption) (*SaveSessionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SaveSessionResponse) + err := c.cc.Invoke(ctx, ChatService_SaveSession_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) GetSessionsByChannel(ctx context.Context, in *GetSessionsByChannelRequest, opts ...grpc.CallOption) (*GetSessionsByChannelResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetSessionsByChannelResponse) + err := c.cc.Invoke(ctx, ChatService_GetSessionsByChannel_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) DeleteSession(ctx context.Context, in *DeleteSessionRequest, opts ...grpc.CallOption) (*DeleteSessionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteSessionResponse) + err := c.cc.Invoke(ctx, ChatService_DeleteSession_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) TouchSession(ctx context.Context, in *TouchSessionRequest, opts ...grpc.CallOption) (*TouchSessionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TouchSessionResponse) + err := c.cc.Invoke(ctx, ChatService_TouchSession_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListSessionsResponse) + err := c.cc.Invoke(ctx, ChatService_ListSessions_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) SaveMessage(ctx context.Context, in *SaveMessageRequest, opts ...grpc.CallOption) (*SaveMessageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SaveMessageResponse) + err := c.cc.Invoke(ctx, ChatService_SaveMessage_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) DeleteRecentMessages(ctx context.Context, in *DeleteRecentMessagesRequest, opts ...grpc.CallOption) (*DeleteRecentMessagesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteRecentMessagesResponse) + err := c.cc.Invoke(ctx, ChatService_DeleteRecentMessages_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) MessageCount(ctx context.Context, in *MessageCountRequest, opts ...grpc.CallOption) (*MessageCountResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MessageCountResponse) + err := c.cc.Invoke(ctx, ChatService_MessageCount_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) SaveMessages(ctx context.Context, in *SaveMessagesRequest, opts ...grpc.CallOption) (*SaveMessagesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SaveMessagesResponse) + err := c.cc.Invoke(ctx, ChatService_SaveMessages_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) ReplaceMessages(ctx context.Context, in *ReplaceMessagesRequest, opts ...grpc.CallOption) (*ReplaceMessagesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ReplaceMessagesResponse) + err := c.cc.Invoke(ctx, ChatService_ReplaceMessages_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) SearchMessages(ctx context.Context, in *SearchMessagesRequest, opts ...grpc.CallOption) (*SearchMessagesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SearchMessagesResponse) + err := c.cc.Invoke(ctx, ChatService_SearchMessages_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ChatServiceServer is the server API for ChatService service. +// All implementations must embed UnimplementedChatServiceServer +// for forward compatibility. +type ChatServiceServer interface { + Snapshot(context.Context, *SnapshotRequest) (*SnapshotResponse, error) + GetSession(context.Context, *GetSessionRequest) (*GetSessionResponse, error) + RecentMessages(context.Context, *RecentMessagesRequest) (*RecentMessagesResponse, error) + RecentTurns(context.Context, *RecentTurnsRequest) (*RecentTurnsResponse, error) + Route(context.Context, *RouteRequest) (*RouteResponse, error) + Stream(*StreamRequest, grpc.ServerStreamingServer[StreamResponse]) error + Cancel(context.Context, *CancelRequest) (*CancelResponse, error) + SetPersona(context.Context, *SetPersonaRequest) (*SetPersonaResponse, error) + ApplyTaskAction(context.Context, *ApplyTaskActionRequest) (*ApplyTaskActionResponse, error) + ApplyOperatorTaskAction(context.Context, *ApplyOperatorTaskActionRequest) (*ApplyOperatorTaskActionResponse, error) + SaveSession(context.Context, *SaveSessionRequest) (*SaveSessionResponse, error) + GetSessionsByChannel(context.Context, *GetSessionsByChannelRequest) (*GetSessionsByChannelResponse, error) + DeleteSession(context.Context, *DeleteSessionRequest) (*DeleteSessionResponse, error) + TouchSession(context.Context, *TouchSessionRequest) (*TouchSessionResponse, error) + ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) + SaveMessage(context.Context, *SaveMessageRequest) (*SaveMessageResponse, error) + DeleteRecentMessages(context.Context, *DeleteRecentMessagesRequest) (*DeleteRecentMessagesResponse, error) + MessageCount(context.Context, *MessageCountRequest) (*MessageCountResponse, error) + SaveMessages(context.Context, *SaveMessagesRequest) (*SaveMessagesResponse, error) + ReplaceMessages(context.Context, *ReplaceMessagesRequest) (*ReplaceMessagesResponse, error) + SearchMessages(context.Context, *SearchMessagesRequest) (*SearchMessagesResponse, error) + mustEmbedUnimplementedChatServiceServer() +} + +// UnimplementedChatServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedChatServiceServer struct{} + +func (UnimplementedChatServiceServer) Snapshot(context.Context, *SnapshotRequest) (*SnapshotResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Snapshot not implemented") +} +func (UnimplementedChatServiceServer) GetSession(context.Context, *GetSessionRequest) (*GetSessionResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetSession not implemented") +} +func (UnimplementedChatServiceServer) RecentMessages(context.Context, *RecentMessagesRequest) (*RecentMessagesResponse, error) { + return nil, status.Error(codes.Unimplemented, "method RecentMessages not implemented") +} +func (UnimplementedChatServiceServer) RecentTurns(context.Context, *RecentTurnsRequest) (*RecentTurnsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method RecentTurns not implemented") +} +func (UnimplementedChatServiceServer) Route(context.Context, *RouteRequest) (*RouteResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Route not implemented") +} +func (UnimplementedChatServiceServer) Stream(*StreamRequest, grpc.ServerStreamingServer[StreamResponse]) error { + return status.Error(codes.Unimplemented, "method Stream not implemented") +} +func (UnimplementedChatServiceServer) Cancel(context.Context, *CancelRequest) (*CancelResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Cancel not implemented") +} +func (UnimplementedChatServiceServer) SetPersona(context.Context, *SetPersonaRequest) (*SetPersonaResponse, error) { + return nil, status.Error(codes.Unimplemented, "method SetPersona not implemented") +} +func (UnimplementedChatServiceServer) ApplyTaskAction(context.Context, *ApplyTaskActionRequest) (*ApplyTaskActionResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ApplyTaskAction not implemented") +} +func (UnimplementedChatServiceServer) ApplyOperatorTaskAction(context.Context, *ApplyOperatorTaskActionRequest) (*ApplyOperatorTaskActionResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ApplyOperatorTaskAction not implemented") +} +func (UnimplementedChatServiceServer) SaveSession(context.Context, *SaveSessionRequest) (*SaveSessionResponse, error) { + return nil, status.Error(codes.Unimplemented, "method SaveSession not implemented") +} +func (UnimplementedChatServiceServer) GetSessionsByChannel(context.Context, *GetSessionsByChannelRequest) (*GetSessionsByChannelResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetSessionsByChannel not implemented") +} +func (UnimplementedChatServiceServer) DeleteSession(context.Context, *DeleteSessionRequest) (*DeleteSessionResponse, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteSession not implemented") +} +func (UnimplementedChatServiceServer) TouchSession(context.Context, *TouchSessionRequest) (*TouchSessionResponse, error) { + return nil, status.Error(codes.Unimplemented, "method TouchSession not implemented") +} +func (UnimplementedChatServiceServer) ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ListSessions not implemented") +} +func (UnimplementedChatServiceServer) SaveMessage(context.Context, *SaveMessageRequest) (*SaveMessageResponse, error) { + return nil, status.Error(codes.Unimplemented, "method SaveMessage not implemented") +} +func (UnimplementedChatServiceServer) DeleteRecentMessages(context.Context, *DeleteRecentMessagesRequest) (*DeleteRecentMessagesResponse, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteRecentMessages not implemented") +} +func (UnimplementedChatServiceServer) MessageCount(context.Context, *MessageCountRequest) (*MessageCountResponse, error) { + return nil, status.Error(codes.Unimplemented, "method MessageCount not implemented") +} +func (UnimplementedChatServiceServer) SaveMessages(context.Context, *SaveMessagesRequest) (*SaveMessagesResponse, error) { + return nil, status.Error(codes.Unimplemented, "method SaveMessages not implemented") +} +func (UnimplementedChatServiceServer) ReplaceMessages(context.Context, *ReplaceMessagesRequest) (*ReplaceMessagesResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ReplaceMessages not implemented") +} +func (UnimplementedChatServiceServer) SearchMessages(context.Context, *SearchMessagesRequest) (*SearchMessagesResponse, error) { + return nil, status.Error(codes.Unimplemented, "method SearchMessages not implemented") +} +func (UnimplementedChatServiceServer) mustEmbedUnimplementedChatServiceServer() {} +func (UnimplementedChatServiceServer) testEmbeddedByValue() {} + +// UnsafeChatServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ChatServiceServer will +// result in compilation errors. +type UnsafeChatServiceServer interface { + mustEmbedUnimplementedChatServiceServer() +} + +func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer) { + // If the following call panics, it indicates UnimplementedChatServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&ChatService_ServiceDesc, srv) +} + +func _ChatService_Snapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).Snapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_Snapshot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).Snapshot(ctx, req.(*SnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_GetSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).GetSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_GetSession_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).GetSession(ctx, req.(*GetSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_RecentMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RecentMessagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).RecentMessages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_RecentMessages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).RecentMessages(ctx, req.(*RecentMessagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_RecentTurns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RecentTurnsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).RecentTurns(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_RecentTurns_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).RecentTurns(ctx, req.(*RecentTurnsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_Route_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RouteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).Route(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_Route_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).Route(ctx, req.(*RouteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(StreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ChatServiceServer).Stream(m, &grpc.GenericServerStream[StreamRequest, StreamResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ChatService_StreamServer = grpc.ServerStreamingServer[StreamResponse] + +func _ChatService_Cancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).Cancel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_Cancel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).Cancel(ctx, req.(*CancelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_SetPersona_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetPersonaRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).SetPersona(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_SetPersona_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).SetPersona(ctx, req.(*SetPersonaRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_ApplyTaskAction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApplyTaskActionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).ApplyTaskAction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_ApplyTaskAction_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).ApplyTaskAction(ctx, req.(*ApplyTaskActionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_ApplyOperatorTaskAction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApplyOperatorTaskActionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).ApplyOperatorTaskAction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_ApplyOperatorTaskAction_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).ApplyOperatorTaskAction(ctx, req.(*ApplyOperatorTaskActionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_SaveSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SaveSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).SaveSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_SaveSession_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).SaveSession(ctx, req.(*SaveSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_GetSessionsByChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSessionsByChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).GetSessionsByChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_GetSessionsByChannel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).GetSessionsByChannel(ctx, req.(*GetSessionsByChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_DeleteSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).DeleteSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_DeleteSession_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).DeleteSession(ctx, req.(*DeleteSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_TouchSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TouchSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).TouchSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_TouchSession_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).TouchSession(ctx, req.(*TouchSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_ListSessions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSessionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).ListSessions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_ListSessions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).ListSessions(ctx, req.(*ListSessionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_SaveMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SaveMessageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).SaveMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_SaveMessage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).SaveMessage(ctx, req.(*SaveMessageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_DeleteRecentMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRecentMessagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).DeleteRecentMessages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_DeleteRecentMessages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).DeleteRecentMessages(ctx, req.(*DeleteRecentMessagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_MessageCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MessageCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).MessageCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_MessageCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).MessageCount(ctx, req.(*MessageCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_SaveMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SaveMessagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).SaveMessages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_SaveMessages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).SaveMessages(ctx, req.(*SaveMessagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_ReplaceMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReplaceMessagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).ReplaceMessages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_ReplaceMessages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).ReplaceMessages(ctx, req.(*ReplaceMessagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_SearchMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchMessagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).SearchMessages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_SearchMessages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).SearchMessages(ctx, req.(*SearchMessagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ChatService_ServiceDesc is the grpc.ServiceDesc for ChatService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ChatService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gateway.v1.ChatService", + HandlerType: (*ChatServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Snapshot", + Handler: _ChatService_Snapshot_Handler, + }, + { + MethodName: "GetSession", + Handler: _ChatService_GetSession_Handler, + }, + { + MethodName: "RecentMessages", + Handler: _ChatService_RecentMessages_Handler, + }, + { + MethodName: "RecentTurns", + Handler: _ChatService_RecentTurns_Handler, + }, + { + MethodName: "Route", + Handler: _ChatService_Route_Handler, + }, + { + MethodName: "Cancel", + Handler: _ChatService_Cancel_Handler, + }, + { + MethodName: "SetPersona", + Handler: _ChatService_SetPersona_Handler, + }, + { + MethodName: "ApplyTaskAction", + Handler: _ChatService_ApplyTaskAction_Handler, + }, + { + MethodName: "ApplyOperatorTaskAction", + Handler: _ChatService_ApplyOperatorTaskAction_Handler, + }, + { + MethodName: "SaveSession", + Handler: _ChatService_SaveSession_Handler, + }, + { + MethodName: "GetSessionsByChannel", + Handler: _ChatService_GetSessionsByChannel_Handler, + }, + { + MethodName: "DeleteSession", + Handler: _ChatService_DeleteSession_Handler, + }, + { + MethodName: "TouchSession", + Handler: _ChatService_TouchSession_Handler, + }, + { + MethodName: "ListSessions", + Handler: _ChatService_ListSessions_Handler, + }, + { + MethodName: "SaveMessage", + Handler: _ChatService_SaveMessage_Handler, + }, + { + MethodName: "DeleteRecentMessages", + Handler: _ChatService_DeleteRecentMessages_Handler, + }, + { + MethodName: "MessageCount", + Handler: _ChatService_MessageCount_Handler, + }, + { + MethodName: "SaveMessages", + Handler: _ChatService_SaveMessages_Handler, + }, + { + MethodName: "ReplaceMessages", + Handler: _ChatService_ReplaceMessages_Handler, + }, + { + MethodName: "SearchMessages", + Handler: _ChatService_SearchMessages_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Stream", + Handler: _ChatService_Stream_Handler, + ServerStreams: true, + }, + }, + Metadata: "gateway/v1/chat.proto", +}