From 86501fa1d43ea031a83cdad48b343a1a4dbbccd3 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sat, 31 Oct 2026 14:49:50 +1100 Subject: [PATCH] feat(messaging): run Telegram as an archipelago channel extension (#1399) The bundled internal/channels/telegram package (17 files) is deleted; the channel now ships as archipelago/channels/telegram, launched by archiemessaging through the existing channel-extension machinery. An existing [chat.telegram] config enables it with the same keys: the token stays a secret reference (token_ref) the host resolves, allowed_user_ids and show_tool_calls map onto extension settings. Per-org bots compose the same extension per org from the org's credential binding. Reload support is now derived from a channels.Reloader interface instead of a *telegram.Gateway assertion. The five host-only seams (/update, release announcements, running versions, in-place show_tool_calls, reload) are dropped from the channel and need a contract home or deletion. --- channels/telegram/main.go | 492 +++++++++++++++++ channels/telegram/main_test.go | 131 +++++ channels/telegram/media.go | 149 ++++++ channels/telegram/package.yaml | 11 + channels/telegram/turn.go | 257 +++++++++ go.mod | 1 + go.sum | 2 + sdk/gateway/v1/chat.pb.go | 763 +++++++++++++++++---------- sdk/gateway/v1/task_tools.pb.go | 382 ++++++++++++++ sdk/gateway/v1/task_tools_grpc.pb.go | 203 +++++++ 10 files changed, 2115 insertions(+), 276 deletions(-) create mode 100644 channels/telegram/main.go create mode 100644 channels/telegram/main_test.go create mode 100644 channels/telegram/media.go create mode 100644 channels/telegram/package.yaml create mode 100644 channels/telegram/turn.go create mode 100644 sdk/gateway/v1/task_tools.pb.go create mode 100644 sdk/gateway/v1/task_tools_grpc.pb.go diff --git a/channels/telegram/main.go b/channels/telegram/main.go new file mode 100644 index 0000000..a7554d5 --- /dev/null +++ b/channels/telegram/main.go @@ -0,0 +1,492 @@ +// Command telegram is the Telegram chat channel. It long-polls the Bot API, +// routes messages from allowed user ids through the gateway ChatService, and +// replies in the chat. Settings: token_ref ("engine:key" naming the bot token +// from @BotFather), allowed_user_ids (comma-separated Telegram user ids; empty +// denies everyone) and show_tool_calls ("true"/"false", default false). +package main + +import ( + "context" + "errors" + "fmt" + "log/slog" + "slices" + "strconv" + "strings" + "sync" + "time" + + "github.com/go-telegram/bot" + "github.com/go-telegram/bot/models" + "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/samcharles93/archipelago/sdk/channel" + gatewayv1 "github.com/samcharles93/archipelago/sdk/gateway/v1" +) + +const platform = "telegram" + +type settings struct { + token string + allowed []int64 + showTools bool +} + +func main() { channel.Serve(run) } + +func run(ctx context.Context, cfg channel.Config, chat gatewayv1.ChatServiceClient, lifecycle channel.Lifecycle) error { + lifecycle.Starting() + s, err := parseSettings(cfg) + if err != nil { + return err + } + log := slog.Default().With("component", "telegram") + g := &gateway{ + settings: s, + chat: chat, + log: log, + pending: map[pendingKey]*pendingAsk{}, + } + + b, err := bot.New(s.token, + bot.WithDefaultHandler(g.defaultHandler), + bot.WithErrorsHandler(func(err error) { log.WarnContext(ctx, "telegram error", "error", err) }), + bot.WithMiddlewares(g.panicRecovery()), + ) + if err != nil { + return fmt.Errorf("telegram: create bot: %w", err) + } + g.bot = b + g.registerCommands(b) + if _, err := b.DeleteWebhook(ctx, &bot.DeleteWebhookParams{DropPendingUpdates: true}); err != nil { + log.WarnContext(ctx, "could not drop pending updates, backlog may be replayed", "error", err) + } + if _, err := b.SetMyCommands(ctx, &bot.SetMyCommandsParams{Commands: botCommands()}); err != nil { + log.WarnContext(ctx, "could not publish the command menu", "error", err) + } + lifecycle.Running() + log.InfoContext(ctx, "telegram channel polling", "allowed_user_ids", len(s.allowed)) + b.Start(ctx) + return nil +} + +// parseSettings reads the operator's settings. token comes from token_ref, +// which the host resolved into secrets under "token". +func parseSettings(cfg channel.Config) (settings, error) { + s := settings{ + token: cfg.Secrets["token"], + showTools: cfg.Settings["show_tool_calls"] == "true", + } + for part := range strings.SplitSeq(cfg.Settings["allowed_user_ids"], ",") { + part = strings.TrimSpace(part) + if part == "" { + continue + } + id, err := strconv.ParseInt(part, 10, 64) + if err != nil || id <= 0 { + return s, fmt.Errorf("telegram: allowed_user_ids %q is not a positive Telegram user id", part) + } + s.allowed = append(s.allowed, id) + } + if s.token == "" { + return s, errors.New("telegram: token_ref is required") + } + if len(s.allowed) == 0 { + return s, errors.New("telegram: allowed_user_ids is required; the bot answers nobody without it") + } + return s, nil +} + +// gateway is one running channel: the bot, the chat service and the asks +// waiting on a user decision. +type gateway struct { + settings settings + chat gatewayv1.ChatServiceClient + log *slog.Logger + bot *bot.Bot + + mu sync.Mutex + pending map[pendingKey]*pendingAsk +} + +// pendingKey identifies the chat an ask was posed to, so only that chat's +// next text or button answers it. +type pendingKey struct { + chatID int64 + threadID int +} + +// pendingAsk is one question the turn blocks on until Answer names its id. +type pendingAsk struct { + id string + kind string +} + +func (g *gateway) allowedUser(userID int64) bool { + return slices.Contains(g.settings.allowed, userID) +} + +// authorized returns the message when its sender is allowed, and tells the +// chat otherwise so a misconfigured allowlist is visible rather than silent. +func (g *gateway) authorized(ctx context.Context, update *models.Update) *models.Message { + msg := update.Message + if msg == nil || msg.From == nil { + return nil + } + if g.allowedUser(msg.From.ID) { + return msg + } + g.log.WarnContext(ctx, "message from unauthorized sender", + "user_id", msg.From.ID, "username", msg.From.Username, "chat_id", msg.Chat.ID) + g.sendText(ctx, msg.Chat.ID, msg.MessageThreadID, + "ā›” You are not authorised to use this bot.") + return nil +} + +// conversationKey is the session a chat addresses: the chat id, and the topic +// thread within it for supergroups. It matches the host's session key for +// the conversation, so /stop reaches the turn the sender is watching. +func conversationKey(msg *models.Message) string { + if msg.MessageThreadID == 0 { + return strconv.FormatInt(msg.Chat.ID, 10) + } + return strconv.FormatInt(msg.Chat.ID, 10) + "/" + strconv.Itoa(msg.MessageThreadID) +} + +// inboundMessage renders a Telegram message as the gateway's wire message. +func inboundMessage(msg *models.Message, text string, media []*gatewayv1.Media) *gatewayv1.Message { + m := &gatewayv1.Message{ + MessageId: strconv.Itoa(msg.ID), + SourceId: strconv.Itoa(msg.ID), // redelivery is idempotent on this + ChannelId: strconv.FormatInt(msg.Chat.ID, 10), + From: msg.From.Username, + SenderId: strconv.FormatInt(msg.From.ID, 10), + Text: text, + At: timestampOf(msg.Date), + Platform: platform, + Media: media, + } + if msg.MessageThreadID != 0 { + m.ThreadId = strconv.Itoa(msg.MessageThreadID) + } + return m +} + +func timestampOf(unix int) *timestamppb.Timestamp { + if unix == 0 { + return nil + } + return timestamppb.New(time.Unix(int64(unix), 0).UTC()) +} + +// defaultHandler routes every update that is not a registered command: an +// answer to a pending question first, then media and text as a new turn. +func (g *gateway) defaultHandler(ctx context.Context, b *bot.Bot, update *models.Update) { + if update.CallbackQuery != nil { + g.handleCallback(ctx, update.CallbackQuery) + return + } + msg := g.authorized(ctx, update) + if msg == nil { + return + } + if g.consumePendingAnswer(ctx, msg) { + return + } + text, media := msg.Text, []*gatewayv1.Media(nil) + if attachment, ok := inboundAttachment(msg); ok { + if data, err := g.download(ctx, attachment.fileID); err != nil { + g.log.WarnContext(ctx, "attachment download failed", "file_id", attachment.fileID, "error", err) + g.sendText(ctx, msg.Chat.ID, msg.MessageThreadID, "I couldn't download that file — try sending it again.") + return + } else { + media = []*gatewayv1.Media{{ + Type: attachment.kind, FileId: attachment.fileID, + MimeType: attachment.mime, FileName: attachment.name, Data: data, + }} + text = strings.TrimSpace(attachment.note + " " + text) + } + } + if text == "" && len(media) == 0 { + return + } + g.submitTurn(ctx, msg, text, media) +} + +// handleCallback answers a pending approval button. +func (g *gateway) handleCallback(ctx context.Context, q *models.CallbackQuery) { + data := q.Data + const prefix = "ask:" + if !strings.HasPrefix(data, prefix) { + _, _ = g.bot.AnswerCallbackQuery(ctx, &bot.AnswerCallbackQueryParams{CallbackQueryID: q.ID}) + return + } + rest := strings.TrimPrefix(data, prefix) + askID, answer, ok := strings.Cut(rest, ":") + if !ok { + return + } + key := pendingKey{} + if msg := q.Message.Message; msg != nil { + key = pendingKey{chatID: msg.Chat.ID, threadID: msg.MessageThreadID} + } + g.mu.Lock() + _, pending := g.pending[key] + delete(g.pending, key) + g.mu.Unlock() + _, _ = g.bot.AnswerCallbackQuery(ctx, &bot.AnswerCallbackQueryParams{CallbackQueryID: q.ID}) + if !pending { + return + } + if _, err := g.chat.Answer(ctx, &gatewayv1.AnswerRequest{AskId: askID, Answer: answer}); err != nil { + g.log.WarnContext(ctx, "answer failed", "ask_id", askID, "error", err) + return + } + if msg := q.Message.Message; msg != nil { + g.editText(ctx, msg.Chat.ID, msg.ID, "āœ… Answered: "+answer) + } +} + +// consumePendingAnswer routes a text message that answers a blocked clarify, +// picker or questionnaire instead of starting a new turn. +func (g *gateway) consumePendingAnswer(ctx context.Context, msg *models.Message) bool { + key := pendingKey{chatID: msg.Chat.ID, threadID: msg.MessageThreadID} + g.mu.Lock() + ask, ok := g.pending[key] + if ok { + delete(g.pending, key) + } + g.mu.Unlock() + if !ok || msg.Text == "" { + return false + } + if _, err := g.chat.Answer(ctx, &gatewayv1.AnswerRequest{AskId: ask.id, Answer: msg.Text}); err != nil { + g.log.WarnContext(ctx, "answer failed", "ask_id", ask.id, "error", err) + g.sendText(ctx, msg.Chat.ID, msg.MessageThreadID, "I couldn't deliver that answer; the question may have expired.") + } + return true +} + +func (g *gateway) registerCommands(b *bot.Bot) { + for _, cmd := range []struct { + name string + handler bot.HandlerFunc + }{ + {"/start", g.startHandler}, + {"/help", g.helpHandler}, + {"/version", g.versionHandler}, + {"/stop", g.stopHandler}, + } { + b.RegisterHandler(bot.HandlerTypeMessageText, cmd.name, bot.MatchTypeExact, cmd.handler) + } + b.RegisterHandler(bot.HandlerTypeCallbackQueryData, "ask:", bot.MatchTypePrefix, g.callbackHandler) +} + +func (g *gateway) callbackHandler(ctx context.Context, b *bot.Bot, update *models.Update) { + g.handleCallback(ctx, update.CallbackQuery) +} + +func (g *gateway) startHandler(ctx context.Context, b *bot.Bot, update *models.Update) { + msg := g.authorized(ctx, update) + if msg == nil { + return + } + g.sendText(ctx, msg.Chat.ID, msg.MessageThreadID, + "Archie is running. Send a message to chat, or type /help for available commands.") +} + +func (g *gateway) helpHandler(ctx context.Context, b *bot.Bot, update *models.Update) { + msg := g.authorized(ctx, update) + if msg == nil { + return + } + g.sendText(ctx, msg.Chat.ID, msg.MessageThreadID, helpText()) +} + +// versionHandler reports the gateway's build, fetched per call. +func (g *gateway) versionHandler(ctx context.Context, b *bot.Bot, update *models.Update) { + msg := g.authorized(ctx, update) + if msg == nil { + return + } + snapshot, err := g.chat.Snapshot(ctx, &gatewayv1.SnapshotRequest{}) + if err != nil || snapshot.GetVersion() == "" { + g.sendText(ctx, msg.Chat.ID, msg.MessageThreadID, "Version information is unavailable.") + return + } + g.sendText(ctx, msg.Chat.ID, msg.MessageThreadID, snapshot.GetVersion()) +} + +// stopHandler serves /stop: bare /stop cancels the conversation's running +// reply, else stops the tasks this conversation created; /stop stops one +// task. +func (g *gateway) stopHandler(ctx context.Context, b *bot.Bot, update *models.Update) { + msg := g.authorized(ctx, update) + if msg == nil { + return + } + rest := strings.TrimSpace(strings.TrimPrefix(msg.Text, "/stop")) + if rest == "" { + g.sendText(ctx, msg.Chat.ID, msg.MessageThreadID, g.stopConversation(ctx, msg)) + return + } + id, err := strconv.ParseInt(strings.TrimPrefix(rest, "#"), 10, 64) + if err != nil || id <= 0 { + g.sendText(ctx, msg.Chat.ID, msg.MessageThreadID, "Usage: /stop, or /stop ") + return + } + g.sendText(ctx, msg.Chat.ID, msg.MessageThreadID, g.stopTasks(ctx, originOf(msg), id)) +} + +// stopConversation cancels the chat's most recently active session; with none +// running it stops the conversation's tasks instead. +func (g *gateway) stopConversation(ctx context.Context, msg *models.Message) string { + sessions, err := g.chat.GetSessionsByChannel(ctx, &gatewayv1.GetSessionsByChannelRequest{ + Platform: platform, ChannelId: strconv.FormatInt(msg.Chat.ID, 10), + }) + if err == nil { + thread := "" + if msg.MessageThreadID != 0 { + thread = strconv.Itoa(msg.MessageThreadID) + } + var latest *gatewayv1.Session + for _, s := range sessions.GetSessions() { + if s.GetThreadId() != thread { + continue + } + if latest == nil || s.GetLastActiveAt().AsTime().After(latest.GetLastActiveAt().AsTime()) { + latest = s + } + } + if latest != nil { + if res, err := g.chat.Cancel(ctx, &gatewayv1.CancelRequest{SessionId: latest.GetSessionId()}); err == nil && (res.GetCancelled() || res.GetDropped() > 0) { + return stopReport(res.GetCancelled(), int(res.GetDropped()), nil) + } + } + } + return g.stopTasks(ctx, originOf(msg), 0) +} + +func (g *gateway) stopTasks(ctx context.Context, origin string, id int64) string { + res, err := g.chat.StopTasks(ctx, &gatewayv1.StopTasksRequest{Origin: origin, TaskId: id}) + if err != nil { + return "Could not stop: " + err.Error() + } + stopped := make([]int64, 0, len(res.GetStopped())) + stopped = append(stopped, res.GetStopped()...) + report := stopReport(false, 0, stopped) + if res.GetError() != "" { + report += "\n\n" + res.GetError() + } + return report +} + +func originOf(msg *models.Message) string { + return platform + ":" + conversationKey(msg) +} + +func stopReport(cancelled bool, dropped int, tasks []int64) string { + var parts []string + if cancelled { + parts = append(parts, "the running reply") + } + if dropped > 0 { + parts = append(parts, fmt.Sprintf("%d queued message(s)", dropped)) + } + if len(tasks) > 0 { + ids := make([]string, len(tasks)) + for i, id := range tasks { + ids[i] = "#" + strconv.FormatInt(id, 10) + } + parts = append(parts, "task(s) "+strings.Join(ids, ", ")) + } + if len(parts) == 0 { + return "Nothing is running." + } + return "šŸ›‘ Stopped " + joinWithAnd(parts) + "." +} + +func joinWithAnd(parts []string) string { + switch len(parts) { + case 1: + return parts[0] + case 2: + return parts[0] + " and " + parts[1] + default: + return strings.Join(parts[:len(parts)-1], ", ") + " and " + parts[len(parts)-1] + } +} + +// botCommands is the published command menu; the handlers it names are the +// ones this channel answers locally. Everything else routes through the +// gateway like any other message. +func botCommands() []models.BotCommand { + return []models.BotCommand{ + {Command: "start", Description: "Confirm that Archie is running"}, + {Command: "help", Description: "See what Archie can do"}, + {Command: "version", Description: "Show installed Archie versions"}, + {Command: "stop", Description: "Stop the running reply or this chat's tasks"}, + } +} + +func helpText() string { + return "Send a message to chat. Commands: /start, /help, /version, /stop — every other slash command is answered by Archie itself." +} + +// sendText sends one message, split under Telegram's 4096-character limit. +func (g *gateway) sendText(ctx context.Context, chatID int64, threadID int, text string) { + for _, part := range splitText(text, messageMaxLen) { + params := &bot.SendMessageParams{ChatID: chatID, Text: part} + if threadID != 0 { + params.MessageThreadID = threadID + } + if _, err := g.bot.SendMessage(ctx, params); err != nil { + g.log.WarnContext(ctx, "send message failed", "chat_id", chatID, "error", err) + } + } +} + +func (g *gateway) editText(ctx context.Context, chatID int64, messageID int, text string) { + parts := splitText(text, messageMaxLen) + if _, err := g.bot.EditMessageText(ctx, &bot.EditMessageTextParams{ChatID: chatID, MessageID: messageID, Text: parts[0]}); err != nil { + g.log.DebugContext(ctx, "edit message failed", "chat_id", chatID, "error", err) + } +} + +// messageMaxLen keeps one message under Telegram's 4096-character limit. +const messageMaxLen = 4000 + +// splitText splits on paragraph boundaries, then hard-wraps long lines. +func splitText(text string, max int) []string { + if len([]rune(text)) <= max { + return []string{text} + } + var parts []string + for _, para := range strings.Split(text, "\n\n") { + for len([]rune(para)) > max { + cut := max + if i := strings.LastIndex(para[:min(cut, len(para))], "\n"); i > 0 { + cut = i + } + parts = append(parts, para[:cut]) + para = strings.TrimLeft(para[cut:], "\n") + } + if para != "" { + parts = append(parts, para) + } + } + return parts +} + +func (g *gateway) panicRecovery() bot.Middleware { + return func(next bot.HandlerFunc) bot.HandlerFunc { + return func(ctx context.Context, b *bot.Bot, update *models.Update) { + defer func() { + if r := recover(); r != nil { + g.log.ErrorContext(ctx, "panic in telegram handler", "panic", r) + } + }() + next(ctx, b, update) + } + } +} diff --git a/channels/telegram/main_test.go b/channels/telegram/main_test.go new file mode 100644 index 0000000..b1959b5 --- /dev/null +++ b/channels/telegram/main_test.go @@ -0,0 +1,131 @@ +package main + +import ( + "strings" + "testing" + + "github.com/go-telegram/bot/models" + + "github.com/samcharles93/archipelago/sdk/channel" +) + +func TestParseSettings(t *testing.T) { + for _, tc := range []struct { + name string + cfg channel.Config + wantErr string + check func(t *testing.T, s settings) + }{ + { + name: "token and allowlist", + cfg: channel.Config{ + Settings: map[string]string{"allowed_user_ids": " 111, 222 ,,333 "}, + Secrets: map[string]string{"token": "123:ABC"}, + }, + check: func(t *testing.T, s settings) { + if s.token != "123:ABC" { + t.Errorf("token = %q", s.token) + } + if len(s.allowed) != 3 || s.allowed[0] != 111 || s.allowed[2] != 333 { + t.Errorf("allowed = %v", s.allowed) + } + if s.showTools { + t.Error("showTools defaulted true") + } + }, + }, + { + name: "show_tool_calls on", + cfg: channel.Config{ + Settings: map[string]string{"allowed_user_ids": "1", "show_tool_calls": "true"}, + Secrets: map[string]string{"token": "t"}, + }, + check: func(t *testing.T, s settings) { + if !s.showTools { + t.Error("showTools = false, want true") + } + }, + }, + {name: "missing token", cfg: channel.Config{Settings: map[string]string{"allowed_user_ids": "1"}}, wantErr: "token_ref"}, + {name: "missing allowlist", cfg: channel.Config{Secrets: map[string]string{"token": "t"}}, wantErr: "allowed_user_ids"}, + {name: "empty allowlist", cfg: channel.Config{Secrets: map[string]string{"token": "t"}, Settings: map[string]string{"allowed_user_ids": " ,"}}, wantErr: "allowed_user_ids"}, + {name: "bad user id", cfg: channel.Config{Secrets: map[string]string{"token": "t"}, Settings: map[string]string{"allowed_user_ids": "abc"}}, wantErr: "not a positive"}, + {name: "negative user id", cfg: channel.Config{Secrets: map[string]string{"token": "t"}, Settings: map[string]string{"allowed_user_ids": "-5"}}, wantErr: "not a positive"}, + } { + t.Run(tc.name, func(t *testing.T) { + s, err := parseSettings(tc.cfg) + if tc.wantErr != "" { + if err == nil || !strings.Contains(err.Error(), tc.wantErr) { + t.Fatalf("err = %v, want it to mention %q", err, tc.wantErr) + } + return + } + if err != nil { + t.Fatalf("parseSettings: %v", err) + } + if tc.check != nil { + tc.check(t, s) + } + }) + } +} + +func TestSplitText(t *testing.T) { + long := strings.Repeat("a", 9000) + parts := splitText(long, messageMaxLen) + if len(parts) != 3 { + t.Fatalf("splitText gave %d parts, want 3", len(parts)) + } + for _, p := range parts { + if len([]rune(p)) > messageMaxLen { + t.Errorf("part is %d runes, over the limit", len([]rune(p))) + } + } + if got := splitText("short", messageMaxLen); len(got) != 1 || got[0] != "short" { + t.Errorf("splitText(short) = %v", got) + } + paras := splitText("one\n\n"+long, messageMaxLen) + if paras[0] != "one" { + t.Errorf("first part = %q, want %q", paras[0], "one") + } +} + +func TestConversationKey(t *testing.T) { + for _, tc := range []struct { + chatID, thread int64 + want string + }{ + {123, 0, "123"}, + {123, 7, "123/7"}, + {-100, 42, "-100/42"}, + } { + msg := &models.Message{Chat: models.Chat{ID: tc.chatID}, MessageThreadID: int(tc.thread)} + if got := conversationKey(msg); got != tc.want { + t.Errorf("conversationKey(%d, %d) = %q, want %q", tc.chatID, tc.thread, got, tc.want) + } + } +} + +func TestInboundMessage(t *testing.T) { + msg := &models.Message{ + ID: 42, + Chat: models.Chat{ID: -100}, + MessageThreadID: 7, + From: &models.User{ID: 111, Username: "sam"}, + Text: "hello", + Date: 1700000000, + } + m := inboundMessage(msg, "hello", nil) + if m.GetMessageId() != "42" || m.GetSourceId() != "42" { + t.Errorf("ids = %q/%q, want both 42", m.GetMessageId(), m.GetSourceId()) + } + if m.GetChannelId() != "-100" || m.GetThreadId() != "7" { + t.Errorf("channel/thread = %q/%q", m.GetChannelId(), m.GetThreadId()) + } + if m.GetFrom() != "sam" || m.GetSenderId() != "111" || m.GetPlatform() != "telegram" { + t.Errorf("from/sender/platform = %q/%q/%q", m.GetFrom(), m.GetSenderId(), m.GetPlatform()) + } + if m.GetAt() == nil || m.GetAt().GetSeconds() != 1700000000 { + t.Errorf("at = %v", m.GetAt()) + } +} diff --git a/channels/telegram/media.go b/channels/telegram/media.go new file mode 100644 index 0000000..fecb997 --- /dev/null +++ b/channels/telegram/media.go @@ -0,0 +1,149 @@ +package main + +import ( + "context" + "fmt" + "io" + "net/http" + + "github.com/go-telegram/bot" + "github.com/go-telegram/bot/models" + + gatewayv1 "github.com/samcharles93/archipelago/sdk/gateway/v1" +) + +// attachment is one inbound file Telegram carries. +type attachment struct { + fileID, kind, mime, name, note string +} + +// inboundAttachment maps a Telegram message's file onto an attachment. A +// message carries at most one file; a photo collapses to its largest size. +func inboundAttachment(msg *models.Message) (attachment, bool) { + switch { + case len(msg.Photo) > 0: + largest := msg.Photo[len(msg.Photo)-1] + for _, size := range msg.Photo { + if size.FileSize >= largest.FileSize { + largest = size + } + } + return attachment{fileID: largest.FileID, kind: "image", mime: "image/jpeg", note: "[photo]"}, true + case msg.Document != nil: + return attachment{ + fileID: msg.Document.FileID, kind: "document", mime: msg.Document.MimeType, + name: msg.Document.FileName, note: "[document: " + msg.Document.FileName + "]", + }, true + case msg.Video != nil: + return attachment{fileID: msg.Video.FileID, kind: "video", mime: msg.Video.MimeType, note: "[video]"}, true + case msg.VideoNote != nil: + return attachment{fileID: msg.VideoNote.FileID, kind: "video", mime: "video/mp4", note: "[video message]"}, true + case msg.Voice != nil: + return attachment{fileID: msg.Voice.FileID, kind: "audio", mime: msg.Voice.MimeType, note: "[voice message]"}, true + case msg.Audio != nil: + return attachment{ + fileID: msg.Audio.FileID, kind: "audio", mime: msg.Audio.MimeType, + name: msg.Audio.FileName, note: "[audio: " + msg.Audio.FileName + "]", + }, true + } + return attachment{}, false +} + +// download fetches an attachment's bytes through the Bot API file link. The +// gateway process never holds the bot token, so the bytes ride on the inbound +// message. +func (g *gateway) download(ctx context.Context, fileID string) ([]byte, error) { + file, err := g.bot.GetFile(ctx, &bot.GetFileParams{FileID: fileID}) + if err != nil { + return nil, err + } + req, err := http.NewRequestWithContext(ctx, http.MethodGet, g.bot.FileDownloadLink(file), nil) + if err != nil { + return nil, err + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + return nil, err + } + defer func() { _ = resp.Body.Close() }() + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("telegram: download %s: %s", fileID, resp.Status) + } + return io.ReadAll(io.LimitReader(resp.Body, maxAttachmentBytes)) +} + +// maxAttachmentBytes bounds one inbound attachment. +const maxAttachmentBytes = 20 << 20 + +// sendMedia delivers an outbound media event: photos and documents by file id +// or url, anything else as a link. +func (g *gateway) sendMedia(ctx context.Context, chatID int64, threadID int, media *gatewayv1.Media) { + if media == nil { + return + } + var file any + switch { + case media.GetFileId() != "": + file = models.InputFileString{Data: media.GetFileId()} + case media.GetUrl() != "": + file = models.InputFileString{Data: media.GetUrl()} + } + send := func(err error) { + if err != nil { + g.log.WarnContext(ctx, "send media failed", "type", media.GetType(), "error", err) + } + } + switch media.GetType() { + case "image": + if file == nil { + g.sendText(ctx, chatID, threadID, media.GetUrl()) + return + } + params := &bot.SendPhotoParams{ChatID: chatID, Photo: file.(models.InputFile)} + if threadID != 0 { + params.MessageThreadID = threadID + } + if media.GetFileName() != "" { + params.Caption = media.GetFileName() + } + _, err := g.bot.SendPhoto(ctx, params) + send(err) + case "video": + if file == nil { + g.sendText(ctx, chatID, threadID, media.GetUrl()) + return + } + params := &bot.SendVideoParams{ChatID: chatID, Video: file.(models.InputFile)} + if threadID != 0 { + params.MessageThreadID = threadID + } + _, err := g.bot.SendVideo(ctx, params) + send(err) + case "audio": + if file == nil { + g.sendText(ctx, chatID, threadID, media.GetUrl()) + return + } + params := &bot.SendAudioParams{ChatID: chatID, Audio: file.(models.InputFile)} + if threadID != 0 { + params.MessageThreadID = threadID + } + _, err := g.bot.SendAudio(ctx, params) + send(err) + default: + if file == nil { + if media.GetUrl() != "" { + g.sendText(ctx, chatID, threadID, media.GetUrl()) + } else if media.GetPath() != "" { + g.sendText(ctx, chatID, threadID, media.GetPath()) + } + return + } + params := &bot.SendDocumentParams{ChatID: chatID, Document: file.(models.InputFile)} + if threadID != 0 { + params.MessageThreadID = threadID + } + _, err := g.bot.SendDocument(ctx, params) + send(err) + } +} diff --git a/channels/telegram/package.yaml b/channels/telegram/package.yaml new file mode 100644 index 0000000..f46579f --- /dev/null +++ b/channels/telegram/package.yaml @@ -0,0 +1,11 @@ +apiVersion: dev.archie.package.v1 +displayName: Telegram +description: "Telegram chat channel: long-polls the Bot API, routes messages from allowed user ids through the gateway, and replies in the chat. The bot token is a secret reference (token_ref) resolved by the host." +version: 1.0.0 +contributes: + extensions: + - surface: channel + path: bin/telegram +files: + - path: bin/telegram + mode: 493 diff --git a/channels/telegram/turn.go b/channels/telegram/turn.go new file mode 100644 index 0000000..0437089 --- /dev/null +++ b/channels/telegram/turn.go @@ -0,0 +1,257 @@ +package main + +import ( + "context" + "errors" + "fmt" + "strings" + "time" + + "github.com/go-telegram/bot" + "github.com/go-telegram/bot/models" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + gatewayv1 "github.com/samcharles93/archipelago/sdk/gateway/v1" +) + +// typingRefresh is how often the typing indicator is re-sent; Telegram clears +// it after ~5s. +const typingRefresh = 4 * time.Second + +// liveEditInterval bounds how often a streaming reply is edited in place. +const liveEditInterval = 2 * time.Second + +// submitTurn routes one inbound message as a streamed chat turn and renders +// the reply live: deltas edit one message, tools and media post alongside, and +// the done text replaces what was streamed. +func (g *gateway) submitTurn(ctx context.Context, msg *models.Message, text string, media []*gatewayv1.Media) { + chatID, threadID := msg.Chat.ID, msg.MessageThreadID + in := inboundMessage(msg, text, media) + + stopTyping := g.startTyping(ctx, chatID, threadID) + defer stopTyping() + + stream, err := g.chat.Stream(ctx, &gatewayv1.StreamRequest{ + Message: in, + CanApprove: true, + CanClarify: true, + CanPick: true, + CanQuestion: true, + }) + switch status.Code(err) { + case codes.OK: + case codes.InvalidArgument, codes.PermissionDenied: + g.sendText(ctx, chatID, threadID, "Archie refused that message: "+status.Convert(err).Message()) + return + default: + if err != nil { + g.log.ErrorContext(ctx, "stream failed", "error", err) + g.sendText(ctx, chatID, threadID, "Something went wrong on my side — try again in a moment.") + return + } + } + + live := &liveReply{g: g, chatID: chatID, threadID: threadID} + var reply string + var streamErr error + lastEdit := time.Time{} + for { + ev, err := stream.Recv() + if errors.Is(err, context.Canceled) || ctx.Err() != nil { + return + } + if err != nil { + if status.Code(err) != codes.Canceled { + streamErr = err + } + break + } + switch ev.GetKind() { + case "delta": + live.buf.WriteString(ev.GetText()) + if time.Since(lastEdit) >= liveEditInterval { + live.edit(ctx, false) + lastEdit = time.Now() + } + case "tool": + live.toolCall(ctx, ev.GetTool()) + case "media": + g.sendMedia(ctx, chatID, threadID, ev.GetMedia()) + case "ask": + g.presentAsk(ctx, chatID, threadID, ev.GetAsk()) + case "done": + reply = ev.GetText() + case "error": + streamErr = errors.New(ev.GetText()) + } + } + stopTyping() + switch { + case streamErr != nil: + g.log.ErrorContext(ctx, "stream turn failed", "error", streamErr) + live.editText(ctx, "āš ļø "+streamErr.Error(), true) + case reply != "": + live.editText(ctx, reply, true) + default: + live.finish(ctx) + } +} + +// liveReply is one streamed reply: the deltas accumulate in buf and are edited +// into a single Telegram message. +type liveReply struct { + g *gateway + chatID int64 + threadID int + buf strings.Builder + messageID int +} + +func (l *liveReply) edit(ctx context.Context, final bool) { + text := l.buf.String() + if l.messageID == 0 { + params := &bot.SendMessageParams{ChatID: l.chatID, Text: clip(text, messageMaxLen)} + if l.threadID != 0 { + params.MessageThreadID = l.threadID + } + if sent, err := l.g.bot.SendMessage(ctx, params); err == nil { + l.messageID = sent.ID + } + return + } + l.g.editText(ctx, l.chatID, l.messageID, clip(text, messageMaxLen)) +} + +func (l *liveReply) editText(ctx context.Context, text string, final bool) { + if l.messageID == 0 { + l.buf.Reset() + l.buf.WriteString(text) + l.edit(ctx, final) + return + } + l.g.editText(ctx, l.chatID, l.messageID, text) +} + +func (l *liveReply) finish(ctx context.Context) { + if l.messageID != 0 { + l.g.editText(ctx, l.chatID, l.messageID, clip(l.buf.String(), messageMaxLen)) + } +} + +// toolCall posts a completed tool call as its own short message when the +// operator turned show_tool_calls on. +func (l *liveReply) toolCall(ctx context.Context, tool *gatewayv1.ToolCall) { + if !l.g.settings.showTools || tool == nil { + return + } + name := tool.GetName() + if tool.GetError() != "" { + l.g.sendText(ctx, l.chatID, l.threadID, "šŸ”§ "+name+" failed: "+tool.GetError()) + return + } + l.g.sendText(ctx, l.chatID, l.threadID, "šŸ”§ "+name) +} + +// presentAsk poses a blocking question to the chat. Approvals get inline +// buttons; clarify, picker and questionnaire questions are posed as text and +// the chat's next message is consumed as the answer. +func (g *gateway) presentAsk(ctx context.Context, chatID int64, threadID int, ask *gatewayv1.Ask) { + if ask == nil { + return + } + key := pendingKey{chatID: chatID, threadID: threadID} + g.mu.Lock() + g.pending[key] = &pendingAsk{id: ask.GetId(), kind: ask.GetKind()} + g.mu.Unlock() + + switch ask.GetKind() { + case "approval": + prompt := ask.GetPrompt() + if ask.GetDetail() != "" { + prompt += "\n\n" + ask.GetDetail() + } + g.sendApproval(ctx, chatID, threadID, ask.GetId(), prompt) + default: + g.sendText(ctx, chatID, threadID, askPrompt(ask)) + } +} + +func askPrompt(ask *gatewayv1.Ask) string { + var b strings.Builder + b.WriteString(ask.GetPrompt()) + if len(ask.GetChoices()) > 0 { + b.WriteString("\n") + for i, c := range ask.GetChoices() { + fmt.Fprintf(&b, "%d. %s\n", i+1, c.GetLabel()) + } + b.WriteString("Reply with a number or the text.") + } + if len(ask.GetQuestions()) > 0 { + for _, q := range ask.GetQuestions() { + fmt.Fprintf(&b, "\n• %s", q.GetTitle()) + if q.GetDescription() != "" { + fmt.Fprintf(&b, " — %s", q.GetDescription()) + } + } + } + return b.String() +} + +// sendApproval posts the approval question with Approve / Always / Deny +// buttons whose callback carries the ask id and the answer. +func (g *gateway) sendApproval(ctx context.Context, chatID int64, threadID int, askID, prompt string) { + row := [][]models.InlineKeyboardButton{{ + {Text: "Approve", CallbackData: "ask:" + askID + ":approve"}, + {Text: "Always", CallbackData: "ask:" + askID + ":always"}, + {Text: "Deny", CallbackData: "ask:" + askID + ":deny"}, + }} + params := &bot.SendMessageParams{ + ChatID: chatID, + Text: "šŸ›‘ Approval needed\n\n" + prompt, + ReplyMarkup: &models.InlineKeyboardMarkup{InlineKeyboard: row}, + } + if threadID != 0 { + params.MessageThreadID = threadID + } + if _, err := g.bot.SendMessage(ctx, params); err != nil { + g.log.WarnContext(ctx, "send approval failed", "error", err) + } +} + +// startTyping shows the typing indicator until the returned stop is called. +func (g *gateway) startTyping(ctx context.Context, chatID int64, threadID int) func() { + send := func(c context.Context) { + params := &bot.SendChatActionParams{ChatID: chatID, Action: models.ChatActionTyping} + if threadID != 0 { + params.MessageThreadID = threadID + } + if _, err := g.bot.SendChatAction(c, params); err != nil { + g.log.DebugContext(c, "send chat action failed", "error", err) + } + } + typingCtx, cancel := context.WithCancel(ctx) + send(typingCtx) + go func() { + ticker := time.NewTicker(typingRefresh) + defer ticker.Stop() + for { + select { + case <-typingCtx.Done(): + return + case <-ticker.C: + send(typingCtx) + } + } + }() + return cancel +} + +// clip truncates text to max runes. +func clip(text string, max int) string { + runes := []rune(text) + if len(runes) <= max { + return text + } + return string(runes[:max]) + "…" +} diff --git a/go.mod b/go.mod index 01ee74a..60d943b 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/emersion/go-msgauth v0.7.0 github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 github.com/emersion/go-smtp v0.25.0 + github.com/go-telegram/bot v1.27.0 github.com/gofri/go-github-ratelimit/v2 v2.0.2 github.com/google/go-github/v78 v78.0.0 github.com/hashicorp/go-plugin v1.8.0 diff --git a/go.sum b/go.sum index 03ee027..0fe5662 100644 --- a/go.sum +++ b/go.sum @@ -36,6 +36,8 @@ github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI= github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM= github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= +github.com/go-telegram/bot v1.27.0 h1:PG9yBDzM8O26oUerE9SZwWlHon4RpH8WcNslZ7CEZmE= +github.com/go-telegram/bot v1.27.0/go.mod h1:i2TRs7fXWIeaceF3z7KzsMt/he0TwkVC680mvdTFYeM= github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/gofri/go-github-ratelimit/v2 v2.0.2 h1:gS8wAS1jTmlWGdTjAM7KIpsLjwY1S0S/gKK5hthfSXM= diff --git a/sdk/gateway/v1/chat.pb.go b/sdk/gateway/v1/chat.pb.go index c4f3e60..42e6f24 100644 --- a/sdk/gateway/v1/chat.pb.go +++ b/sdk/gateway/v1/chat.pb.go @@ -378,6 +378,8 @@ type ToolCall struct { 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"` + DurationMs int64 `protobuf:"varint,6,opt,name=duration_ms,json=durationMs,proto3" json:"duration_ms,omitempty"` + TextOffset int32 `protobuf:"varint,7,opt,name=text_offset,json=textOffset,proto3" json:"text_offset,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -447,6 +449,20 @@ func (x *ToolCall) GetError() string { return "" } +func (x *ToolCall) GetDurationMs() int64 { + if x != nil { + return x.DurationMs + } + return 0 +} + +func (x *ToolCall) GetTextOffset() int32 { + if x != nil { + return x.TextOffset + } + return 0 +} + 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"` @@ -1330,6 +1346,7 @@ type StreamRequest struct { CanApprove bool `protobuf:"varint,2,opt,name=can_approve,json=canApprove,proto3" json:"can_approve,omitempty"` CanClarify bool `protobuf:"varint,3,opt,name=can_clarify,json=canClarify,proto3" json:"can_clarify,omitempty"` CanPick bool `protobuf:"varint,4,opt,name=can_pick,json=canPick,proto3" json:"can_pick,omitempty"` + CanQuestion bool `protobuf:"varint,5,opt,name=can_question,json=canQuestion,proto3" json:"can_question,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1392,6 +1409,13 @@ func (x *StreamRequest) GetCanPick() bool { return false } +func (x *StreamRequest) GetCanQuestion() bool { + if x != nil { + return x.CanQuestion + } + return false +} + // Ask is a question the turn blocks on until Answer names its id. type Ask struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -1400,8 +1424,10 @@ type Ask struct { Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` Prompt string `protobuf:"bytes,3,opt,name=prompt,proto3" json:"prompt,omitempty"` // Tool description, for an approval. - Detail string `protobuf:"bytes,4,opt,name=detail,proto3" json:"detail,omitempty"` - Choices []*Choice `protobuf:"bytes,5,rep,name=choices,proto3" json:"choices,omitempty"` + Detail string `protobuf:"bytes,4,opt,name=detail,proto3" json:"detail,omitempty"` + Choices []*Choice `protobuf:"bytes,5,rep,name=choices,proto3" json:"choices,omitempty"` + // The questions of a questionnaire, in order. + Questions []*Question `protobuf:"bytes,6,rep,name=questions,proto3" json:"questions,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1471,6 +1497,13 @@ func (x *Ask) GetChoices() []*Choice { return nil } +func (x *Ask) GetQuestions() []*Question { + if x != nil { + return x.Questions + } + return nil +} + type Choice struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -1523,8 +1556,163 @@ func (x *Choice) GetLabel() string { return "" } +type Question struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The key the answer is returned under. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Multiple bool `protobuf:"varint,4,opt,name=multiple,proto3" json:"multiple,omitempty"` + Required bool `protobuf:"varint,5,opt,name=required,proto3" json:"required,omitempty"` + // Whether a value outside choices is an answer. + AllowOther bool `protobuf:"varint,6,opt,name=allow_other,json=allowOther,proto3" json:"allow_other,omitempty"` + Choices []*QuestionChoice `protobuf:"bytes,7,rep,name=choices,proto3" json:"choices,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Question) Reset() { + *x = Question{} + mi := &file_gateway_v1_chat_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Question) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Question) ProtoMessage() {} + +func (x *Question) 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 Question.ProtoReflect.Descriptor instead. +func (*Question) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{21} +} + +func (x *Question) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Question) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Question) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Question) GetMultiple() bool { + if x != nil { + return x.Multiple + } + return false +} + +func (x *Question) GetRequired() bool { + if x != nil { + return x.Required + } + return false +} + +func (x *Question) GetAllowOther() bool { + if x != nil { + return x.AllowOther + } + return false +} + +func (x *Question) GetChoices() []*QuestionChoice { + if x != nil { + return x.Choices + } + return nil +} + +type QuestionChoice struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuestionChoice) Reset() { + *x = QuestionChoice{} + mi := &file_gateway_v1_chat_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuestionChoice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuestionChoice) ProtoMessage() {} + +func (x *QuestionChoice) 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 QuestionChoice.ProtoReflect.Descriptor instead. +func (*QuestionChoice) Descriptor() ([]byte, []int) { + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{22} +} + +func (x *QuestionChoice) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *QuestionChoice) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *QuestionChoice) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + // For an approval, answer is approve, always or deny; for a picker, the -// choice id; for a clarify, the reply text. +// choice id; for a clarify, the reply text; for a questionnaire, a JSON object +// of question name to the list of values given. type AnswerRequest struct { state protoimpl.MessageState `protogen:"open.v1"` AskId string `protobuf:"bytes,1,opt,name=ask_id,json=askId,proto3" json:"ask_id,omitempty"` @@ -1535,7 +1723,7 @@ type AnswerRequest struct { func (x *AnswerRequest) Reset() { *x = AnswerRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[21] + mi := &file_gateway_v1_chat_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1547,7 +1735,7 @@ func (x *AnswerRequest) String() string { func (*AnswerRequest) ProtoMessage() {} func (x *AnswerRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[21] + mi := &file_gateway_v1_chat_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1560,7 +1748,7 @@ func (x *AnswerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AnswerRequest.ProtoReflect.Descriptor instead. func (*AnswerRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{21} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{23} } func (x *AnswerRequest) GetAskId() string { @@ -1586,7 +1774,7 @@ type AnswerResponse struct { func (x *AnswerResponse) Reset() { *x = AnswerResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[22] + mi := &file_gateway_v1_chat_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1598,7 +1786,7 @@ func (x *AnswerResponse) String() string { func (*AnswerResponse) ProtoMessage() {} func (x *AnswerResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[22] + mi := &file_gateway_v1_chat_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1611,7 +1799,7 @@ func (x *AnswerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AnswerResponse.ProtoReflect.Descriptor instead. func (*AnswerResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{22} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{24} } func (x *AnswerResponse) GetFound() bool { @@ -1635,7 +1823,7 @@ type StreamResponse struct { func (x *StreamResponse) Reset() { *x = StreamResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[23] + mi := &file_gateway_v1_chat_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1647,7 +1835,7 @@ func (x *StreamResponse) String() string { func (*StreamResponse) ProtoMessage() {} func (x *StreamResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[23] + mi := &file_gateway_v1_chat_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1660,7 +1848,7 @@ func (x *StreamResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamResponse.ProtoReflect.Descriptor instead. func (*StreamResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{23} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{25} } func (x *StreamResponse) GetKind() string { @@ -1714,7 +1902,7 @@ type CancelRequest struct { func (x *CancelRequest) Reset() { *x = CancelRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[24] + mi := &file_gateway_v1_chat_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1726,7 +1914,7 @@ func (x *CancelRequest) String() string { func (*CancelRequest) ProtoMessage() {} func (x *CancelRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[24] + mi := &file_gateway_v1_chat_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1739,7 +1927,7 @@ func (x *CancelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelRequest.ProtoReflect.Descriptor instead. func (*CancelRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{24} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{26} } func (x *CancelRequest) GetSessionId() string { @@ -1759,7 +1947,7 @@ type CancelResponse struct { func (x *CancelResponse) Reset() { *x = CancelResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[25] + mi := &file_gateway_v1_chat_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1771,7 +1959,7 @@ func (x *CancelResponse) String() string { func (*CancelResponse) ProtoMessage() {} func (x *CancelResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[25] + mi := &file_gateway_v1_chat_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1784,7 +1972,7 @@ func (x *CancelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelResponse.ProtoReflect.Descriptor instead. func (*CancelResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{25} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{27} } func (x *CancelResponse) GetCancelled() bool { @@ -1813,7 +2001,7 @@ type StopTasksRequest struct { func (x *StopTasksRequest) Reset() { *x = StopTasksRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[26] + mi := &file_gateway_v1_chat_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1825,7 +2013,7 @@ func (x *StopTasksRequest) String() string { func (*StopTasksRequest) ProtoMessage() {} func (x *StopTasksRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[26] + mi := &file_gateway_v1_chat_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1838,7 +2026,7 @@ func (x *StopTasksRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StopTasksRequest.ProtoReflect.Descriptor instead. func (*StopTasksRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{26} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{28} } func (x *StopTasksRequest) GetOrigin() string { @@ -1866,7 +2054,7 @@ type StopTasksResponse struct { func (x *StopTasksResponse) Reset() { *x = StopTasksResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[27] + mi := &file_gateway_v1_chat_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1878,7 +2066,7 @@ func (x *StopTasksResponse) String() string { func (*StopTasksResponse) ProtoMessage() {} func (x *StopTasksResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[27] + mi := &file_gateway_v1_chat_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1891,7 +2079,7 @@ func (x *StopTasksResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StopTasksResponse.ProtoReflect.Descriptor instead. func (*StopTasksResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{27} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{29} } func (x *StopTasksResponse) GetStopped() []int64 { @@ -1921,7 +2109,7 @@ type ApplyTaskActionRequest struct { func (x *ApplyTaskActionRequest) Reset() { *x = ApplyTaskActionRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[28] + mi := &file_gateway_v1_chat_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1933,7 +2121,7 @@ func (x *ApplyTaskActionRequest) String() string { func (*ApplyTaskActionRequest) ProtoMessage() {} func (x *ApplyTaskActionRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[28] + mi := &file_gateway_v1_chat_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1946,7 +2134,7 @@ func (x *ApplyTaskActionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplyTaskActionRequest.ProtoReflect.Descriptor instead. func (*ApplyTaskActionRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{28} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{30} } func (x *ApplyTaskActionRequest) GetIdentity() string { @@ -1995,7 +2183,7 @@ type ApplyTaskActionResponse struct { func (x *ApplyTaskActionResponse) Reset() { *x = ApplyTaskActionResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[29] + mi := &file_gateway_v1_chat_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2007,7 +2195,7 @@ func (x *ApplyTaskActionResponse) String() string { func (*ApplyTaskActionResponse) ProtoMessage() {} func (x *ApplyTaskActionResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[29] + mi := &file_gateway_v1_chat_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2020,7 +2208,7 @@ func (x *ApplyTaskActionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplyTaskActionResponse.ProtoReflect.Descriptor instead. func (*ApplyTaskActionResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{29} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{31} } func (x *ApplyTaskActionResponse) GetTaskId() int64 { @@ -2058,7 +2246,7 @@ type ApplyOperatorTaskActionRequest struct { // 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. + // never as an operator'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"` @@ -2084,7 +2272,7 @@ type ApplyOperatorTaskActionRequest struct { func (x *ApplyOperatorTaskActionRequest) Reset() { *x = ApplyOperatorTaskActionRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[30] + mi := &file_gateway_v1_chat_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2096,7 +2284,7 @@ func (x *ApplyOperatorTaskActionRequest) String() string { func (*ApplyOperatorTaskActionRequest) ProtoMessage() {} func (x *ApplyOperatorTaskActionRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[30] + mi := &file_gateway_v1_chat_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2109,7 +2297,7 @@ func (x *ApplyOperatorTaskActionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplyOperatorTaskActionRequest.ProtoReflect.Descriptor instead. func (*ApplyOperatorTaskActionRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{30} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{32} } func (x *ApplyOperatorTaskActionRequest) GetTaskId() int64 { @@ -2193,7 +2381,7 @@ type ApplyOperatorTaskActionResponse struct { func (x *ApplyOperatorTaskActionResponse) Reset() { *x = ApplyOperatorTaskActionResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[31] + mi := &file_gateway_v1_chat_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2205,7 +2393,7 @@ func (x *ApplyOperatorTaskActionResponse) String() string { func (*ApplyOperatorTaskActionResponse) ProtoMessage() {} func (x *ApplyOperatorTaskActionResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[31] + mi := &file_gateway_v1_chat_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2218,7 +2406,7 @@ func (x *ApplyOperatorTaskActionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplyOperatorTaskActionResponse.ProtoReflect.Descriptor instead. func (*ApplyOperatorTaskActionResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{31} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{33} } func (x *ApplyOperatorTaskActionResponse) GetTaskId() int64 { @@ -2250,7 +2438,7 @@ type SaveSessionResponse struct { func (x *SaveSessionResponse) Reset() { *x = SaveSessionResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[32] + mi := &file_gateway_v1_chat_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2262,7 +2450,7 @@ func (x *SaveSessionResponse) String() string { func (*SaveSessionResponse) ProtoMessage() {} func (x *SaveSessionResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[32] + mi := &file_gateway_v1_chat_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2275,7 +2463,7 @@ func (x *SaveSessionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SaveSessionResponse.ProtoReflect.Descriptor instead. func (*SaveSessionResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{32} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{34} } type SaveSessionRequest struct { @@ -2287,7 +2475,7 @@ type SaveSessionRequest struct { func (x *SaveSessionRequest) Reset() { *x = SaveSessionRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[33] + mi := &file_gateway_v1_chat_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2299,7 +2487,7 @@ func (x *SaveSessionRequest) String() string { func (*SaveSessionRequest) ProtoMessage() {} func (x *SaveSessionRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[33] + mi := &file_gateway_v1_chat_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2312,7 +2500,7 @@ func (x *SaveSessionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SaveSessionRequest.ProtoReflect.Descriptor instead. func (*SaveSessionRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{33} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{35} } func (x *SaveSessionRequest) GetSession() *Session { @@ -2332,7 +2520,7 @@ type GetSessionsByChannelRequest struct { func (x *GetSessionsByChannelRequest) Reset() { *x = GetSessionsByChannelRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[34] + mi := &file_gateway_v1_chat_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2344,7 +2532,7 @@ func (x *GetSessionsByChannelRequest) String() string { func (*GetSessionsByChannelRequest) ProtoMessage() {} func (x *GetSessionsByChannelRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[34] + mi := &file_gateway_v1_chat_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2357,7 +2545,7 @@ func (x *GetSessionsByChannelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSessionsByChannelRequest.ProtoReflect.Descriptor instead. func (*GetSessionsByChannelRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{34} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{36} } func (x *GetSessionsByChannelRequest) GetPlatform() string { @@ -2383,7 +2571,7 @@ type GetSessionsByChannelResponse struct { func (x *GetSessionsByChannelResponse) Reset() { *x = GetSessionsByChannelResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[35] + mi := &file_gateway_v1_chat_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2395,7 +2583,7 @@ func (x *GetSessionsByChannelResponse) String() string { func (*GetSessionsByChannelResponse) ProtoMessage() {} func (x *GetSessionsByChannelResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[35] + mi := &file_gateway_v1_chat_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2408,7 +2596,7 @@ func (x *GetSessionsByChannelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSessionsByChannelResponse.ProtoReflect.Descriptor instead. func (*GetSessionsByChannelResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{35} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{37} } func (x *GetSessionsByChannelResponse) GetSessions() []*Session { @@ -2427,7 +2615,7 @@ type ListSessionsResponse struct { func (x *ListSessionsResponse) Reset() { *x = ListSessionsResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[36] + mi := &file_gateway_v1_chat_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2439,7 +2627,7 @@ func (x *ListSessionsResponse) String() string { func (*ListSessionsResponse) ProtoMessage() {} func (x *ListSessionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[36] + mi := &file_gateway_v1_chat_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2452,7 +2640,7 @@ func (x *ListSessionsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSessionsResponse.ProtoReflect.Descriptor instead. func (*ListSessionsResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{36} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{38} } func (x *ListSessionsResponse) GetSessions() []*Session { @@ -2470,7 +2658,7 @@ type DeleteSessionResponse struct { func (x *DeleteSessionResponse) Reset() { *x = DeleteSessionResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[37] + mi := &file_gateway_v1_chat_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2482,7 +2670,7 @@ func (x *DeleteSessionResponse) String() string { func (*DeleteSessionResponse) ProtoMessage() {} func (x *DeleteSessionResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[37] + mi := &file_gateway_v1_chat_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2495,7 +2683,7 @@ func (x *DeleteSessionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteSessionResponse.ProtoReflect.Descriptor instead. func (*DeleteSessionResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{37} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{39} } type TouchSessionResponse struct { @@ -2506,7 +2694,7 @@ type TouchSessionResponse struct { func (x *TouchSessionResponse) Reset() { *x = TouchSessionResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[38] + mi := &file_gateway_v1_chat_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2518,7 +2706,7 @@ func (x *TouchSessionResponse) String() string { func (*TouchSessionResponse) ProtoMessage() {} func (x *TouchSessionResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[38] + mi := &file_gateway_v1_chat_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2531,7 +2719,7 @@ func (x *TouchSessionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TouchSessionResponse.ProtoReflect.Descriptor instead. func (*TouchSessionResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{38} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{40} } type SaveMessageResponse struct { @@ -2542,7 +2730,7 @@ type SaveMessageResponse struct { func (x *SaveMessageResponse) Reset() { *x = SaveMessageResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[39] + mi := &file_gateway_v1_chat_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2554,7 +2742,7 @@ func (x *SaveMessageResponse) String() string { func (*SaveMessageResponse) ProtoMessage() {} func (x *SaveMessageResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[39] + mi := &file_gateway_v1_chat_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2567,7 +2755,7 @@ func (x *SaveMessageResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SaveMessageResponse.ProtoReflect.Descriptor instead. func (*SaveMessageResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{39} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{41} } type SaveMessagesResponse struct { @@ -2578,7 +2766,7 @@ type SaveMessagesResponse struct { func (x *SaveMessagesResponse) Reset() { *x = SaveMessagesResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[40] + mi := &file_gateway_v1_chat_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2590,7 +2778,7 @@ func (x *SaveMessagesResponse) String() string { func (*SaveMessagesResponse) ProtoMessage() {} func (x *SaveMessagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[40] + mi := &file_gateway_v1_chat_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2603,7 +2791,7 @@ func (x *SaveMessagesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SaveMessagesResponse.ProtoReflect.Descriptor instead. func (*SaveMessagesResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{40} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{42} } type ReplaceMessagesResponse struct { @@ -2614,7 +2802,7 @@ type ReplaceMessagesResponse struct { func (x *ReplaceMessagesResponse) Reset() { *x = ReplaceMessagesResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[41] + mi := &file_gateway_v1_chat_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2626,7 +2814,7 @@ func (x *ReplaceMessagesResponse) String() string { func (*ReplaceMessagesResponse) ProtoMessage() {} func (x *ReplaceMessagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[41] + mi := &file_gateway_v1_chat_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2639,7 +2827,7 @@ func (x *ReplaceMessagesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReplaceMessagesResponse.ProtoReflect.Descriptor instead. func (*ReplaceMessagesResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{41} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{43} } type DeleteSessionRequest struct { @@ -2651,7 +2839,7 @@ type DeleteSessionRequest struct { func (x *DeleteSessionRequest) Reset() { *x = DeleteSessionRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[42] + mi := &file_gateway_v1_chat_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2663,7 +2851,7 @@ func (x *DeleteSessionRequest) String() string { func (*DeleteSessionRequest) ProtoMessage() {} func (x *DeleteSessionRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[42] + mi := &file_gateway_v1_chat_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2676,7 +2864,7 @@ func (x *DeleteSessionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteSessionRequest.ProtoReflect.Descriptor instead. func (*DeleteSessionRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{42} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{44} } func (x *DeleteSessionRequest) GetSessionId() string { @@ -2695,7 +2883,7 @@ type TouchSessionRequest struct { func (x *TouchSessionRequest) Reset() { *x = TouchSessionRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[43] + mi := &file_gateway_v1_chat_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2707,7 +2895,7 @@ func (x *TouchSessionRequest) String() string { func (*TouchSessionRequest) ProtoMessage() {} func (x *TouchSessionRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[43] + mi := &file_gateway_v1_chat_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2720,7 +2908,7 @@ func (x *TouchSessionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TouchSessionRequest.ProtoReflect.Descriptor instead. func (*TouchSessionRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{43} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{45} } func (x *TouchSessionRequest) GetSessionId() string { @@ -2738,7 +2926,7 @@ type ListSessionsRequest struct { func (x *ListSessionsRequest) Reset() { *x = ListSessionsRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[44] + mi := &file_gateway_v1_chat_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2750,7 +2938,7 @@ func (x *ListSessionsRequest) String() string { func (*ListSessionsRequest) ProtoMessage() {} func (x *ListSessionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[44] + mi := &file_gateway_v1_chat_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2763,7 +2951,7 @@ func (x *ListSessionsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSessionsRequest.ProtoReflect.Descriptor instead. func (*ListSessionsRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{44} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{46} } type SaveMessageRequest struct { @@ -2776,7 +2964,7 @@ type SaveMessageRequest struct { func (x *SaveMessageRequest) Reset() { *x = SaveMessageRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[45] + mi := &file_gateway_v1_chat_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2788,7 +2976,7 @@ func (x *SaveMessageRequest) String() string { func (*SaveMessageRequest) ProtoMessage() {} func (x *SaveMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[45] + mi := &file_gateway_v1_chat_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2801,7 +2989,7 @@ func (x *SaveMessageRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SaveMessageRequest.ProtoReflect.Descriptor instead. func (*SaveMessageRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{45} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{47} } func (x *SaveMessageRequest) GetSessionId() string { @@ -2828,7 +3016,7 @@ type DeleteRecentMessagesRequest struct { func (x *DeleteRecentMessagesRequest) Reset() { *x = DeleteRecentMessagesRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[46] + mi := &file_gateway_v1_chat_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2840,7 +3028,7 @@ func (x *DeleteRecentMessagesRequest) String() string { func (*DeleteRecentMessagesRequest) ProtoMessage() {} func (x *DeleteRecentMessagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[46] + mi := &file_gateway_v1_chat_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2853,7 +3041,7 @@ func (x *DeleteRecentMessagesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteRecentMessagesRequest.ProtoReflect.Descriptor instead. func (*DeleteRecentMessagesRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{46} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{48} } func (x *DeleteRecentMessagesRequest) GetSessionId() string { @@ -2879,7 +3067,7 @@ type DeleteRecentMessagesResponse struct { func (x *DeleteRecentMessagesResponse) Reset() { *x = DeleteRecentMessagesResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[47] + mi := &file_gateway_v1_chat_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2891,7 +3079,7 @@ func (x *DeleteRecentMessagesResponse) String() string { func (*DeleteRecentMessagesResponse) ProtoMessage() {} func (x *DeleteRecentMessagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[47] + mi := &file_gateway_v1_chat_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2904,7 +3092,7 @@ func (x *DeleteRecentMessagesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteRecentMessagesResponse.ProtoReflect.Descriptor instead. func (*DeleteRecentMessagesResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{47} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{49} } func (x *DeleteRecentMessagesResponse) GetDeleted() int64 { @@ -2923,7 +3111,7 @@ type MessageCountRequest struct { func (x *MessageCountRequest) Reset() { *x = MessageCountRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[48] + mi := &file_gateway_v1_chat_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2935,7 +3123,7 @@ func (x *MessageCountRequest) String() string { func (*MessageCountRequest) ProtoMessage() {} func (x *MessageCountRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[48] + mi := &file_gateway_v1_chat_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2948,7 +3136,7 @@ func (x *MessageCountRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageCountRequest.ProtoReflect.Descriptor instead. func (*MessageCountRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{48} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{50} } func (x *MessageCountRequest) GetSessionId() string { @@ -2967,7 +3155,7 @@ type MessageCountResponse struct { func (x *MessageCountResponse) Reset() { *x = MessageCountResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[49] + mi := &file_gateway_v1_chat_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2979,7 +3167,7 @@ func (x *MessageCountResponse) String() string { func (*MessageCountResponse) ProtoMessage() {} func (x *MessageCountResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[49] + mi := &file_gateway_v1_chat_proto_msgTypes[51] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2992,7 +3180,7 @@ func (x *MessageCountResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageCountResponse.ProtoReflect.Descriptor instead. func (*MessageCountResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{49} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{51} } func (x *MessageCountResponse) GetCount() int64 { @@ -3012,7 +3200,7 @@ type SaveMessagesRequest struct { func (x *SaveMessagesRequest) Reset() { *x = SaveMessagesRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[50] + mi := &file_gateway_v1_chat_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3024,7 +3212,7 @@ func (x *SaveMessagesRequest) String() string { func (*SaveMessagesRequest) ProtoMessage() {} func (x *SaveMessagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[50] + mi := &file_gateway_v1_chat_proto_msgTypes[52] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3037,7 +3225,7 @@ func (x *SaveMessagesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SaveMessagesRequest.ProtoReflect.Descriptor instead. func (*SaveMessagesRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{50} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{52} } func (x *SaveMessagesRequest) GetSessionId() string { @@ -3065,7 +3253,7 @@ type ReplaceMessagesRequest struct { func (x *ReplaceMessagesRequest) Reset() { *x = ReplaceMessagesRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[51] + mi := &file_gateway_v1_chat_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3077,7 +3265,7 @@ func (x *ReplaceMessagesRequest) String() string { func (*ReplaceMessagesRequest) ProtoMessage() {} func (x *ReplaceMessagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[51] + mi := &file_gateway_v1_chat_proto_msgTypes[53] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3090,7 +3278,7 @@ func (x *ReplaceMessagesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReplaceMessagesRequest.ProtoReflect.Descriptor instead. func (*ReplaceMessagesRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{51} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{53} } func (x *ReplaceMessagesRequest) GetSessionId() string { @@ -3126,7 +3314,7 @@ type SearchMessagesRequest struct { func (x *SearchMessagesRequest) Reset() { *x = SearchMessagesRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[52] + mi := &file_gateway_v1_chat_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3138,7 +3326,7 @@ func (x *SearchMessagesRequest) String() string { func (*SearchMessagesRequest) ProtoMessage() {} func (x *SearchMessagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[52] + mi := &file_gateway_v1_chat_proto_msgTypes[54] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3151,7 +3339,7 @@ func (x *SearchMessagesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchMessagesRequest.ProtoReflect.Descriptor instead. func (*SearchMessagesRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{52} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{54} } func (x *SearchMessagesRequest) GetSessionId() string { @@ -3194,7 +3382,7 @@ type SearchMessagesResponse struct { func (x *SearchMessagesResponse) Reset() { *x = SearchMessagesResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[53] + mi := &file_gateway_v1_chat_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3206,7 +3394,7 @@ func (x *SearchMessagesResponse) String() string { func (*SearchMessagesResponse) ProtoMessage() {} func (x *SearchMessagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[53] + mi := &file_gateway_v1_chat_proto_msgTypes[55] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3219,7 +3407,7 @@ func (x *SearchMessagesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchMessagesResponse.ProtoReflect.Descriptor instead. func (*SearchMessagesResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{53} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{55} } func (x *SearchMessagesResponse) GetMessages() []*Message { @@ -3261,7 +3449,7 @@ type ListSkillsRequest struct { func (x *ListSkillsRequest) Reset() { *x = ListSkillsRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[54] + mi := &file_gateway_v1_chat_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3273,7 +3461,7 @@ func (x *ListSkillsRequest) String() string { func (*ListSkillsRequest) ProtoMessage() {} func (x *ListSkillsRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[54] + mi := &file_gateway_v1_chat_proto_msgTypes[56] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3286,7 +3474,7 @@ func (x *ListSkillsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSkillsRequest.ProtoReflect.Descriptor instead. func (*ListSkillsRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{54} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{56} } type ListSkillsResponse struct { @@ -3298,7 +3486,7 @@ type ListSkillsResponse struct { func (x *ListSkillsResponse) Reset() { *x = ListSkillsResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[55] + mi := &file_gateway_v1_chat_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3310,7 +3498,7 @@ func (x *ListSkillsResponse) String() string { func (*ListSkillsResponse) ProtoMessage() {} func (x *ListSkillsResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[55] + mi := &file_gateway_v1_chat_proto_msgTypes[57] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3323,7 +3511,7 @@ func (x *ListSkillsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSkillsResponse.ProtoReflect.Descriptor instead. func (*ListSkillsResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{55} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{57} } func (x *ListSkillsResponse) GetSkills() []*Skill { @@ -3345,7 +3533,7 @@ type Skill struct { func (x *Skill) Reset() { *x = Skill{} - mi := &file_gateway_v1_chat_proto_msgTypes[56] + mi := &file_gateway_v1_chat_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3357,7 +3545,7 @@ func (x *Skill) String() string { func (*Skill) ProtoMessage() {} func (x *Skill) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[56] + mi := &file_gateway_v1_chat_proto_msgTypes[58] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3370,7 +3558,7 @@ func (x *Skill) ProtoReflect() protoreflect.Message { // Deprecated: Use Skill.ProtoReflect.Descriptor instead. func (*Skill) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{56} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{58} } func (x *Skill) GetName() string { @@ -3411,7 +3599,7 @@ type CuratorHealthRequest struct { func (x *CuratorHealthRequest) Reset() { *x = CuratorHealthRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[57] + mi := &file_gateway_v1_chat_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3423,7 +3611,7 @@ func (x *CuratorHealthRequest) String() string { func (*CuratorHealthRequest) ProtoMessage() {} func (x *CuratorHealthRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[57] + mi := &file_gateway_v1_chat_proto_msgTypes[59] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3436,7 +3624,7 @@ func (x *CuratorHealthRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CuratorHealthRequest.ProtoReflect.Descriptor instead. func (*CuratorHealthRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{57} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{59} } type CuratorHealthResponse struct { @@ -3448,7 +3636,7 @@ type CuratorHealthResponse struct { func (x *CuratorHealthResponse) Reset() { *x = CuratorHealthResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[58] + mi := &file_gateway_v1_chat_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3460,7 +3648,7 @@ func (x *CuratorHealthResponse) String() string { func (*CuratorHealthResponse) ProtoMessage() {} func (x *CuratorHealthResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[58] + mi := &file_gateway_v1_chat_proto_msgTypes[60] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3473,7 +3661,7 @@ func (x *CuratorHealthResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CuratorHealthResponse.ProtoReflect.Descriptor instead. func (*CuratorHealthResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{58} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{60} } func (x *CuratorHealthResponse) GetCurators() []*Curator { @@ -3497,7 +3685,7 @@ type Curator struct { func (x *Curator) Reset() { *x = Curator{} - mi := &file_gateway_v1_chat_proto_msgTypes[59] + mi := &file_gateway_v1_chat_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3509,7 +3697,7 @@ func (x *Curator) String() string { func (*Curator) ProtoMessage() {} func (x *Curator) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[59] + mi := &file_gateway_v1_chat_proto_msgTypes[61] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3522,7 +3710,7 @@ func (x *Curator) ProtoReflect() protoreflect.Message { // Deprecated: Use Curator.ProtoReflect.Descriptor instead. func (*Curator) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{59} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{61} } func (x *Curator) GetName() string { @@ -3579,7 +3767,7 @@ type CuratorAction struct { func (x *CuratorAction) Reset() { *x = CuratorAction{} - mi := &file_gateway_v1_chat_proto_msgTypes[60] + mi := &file_gateway_v1_chat_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3591,7 +3779,7 @@ func (x *CuratorAction) String() string { func (*CuratorAction) ProtoMessage() {} func (x *CuratorAction) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[60] + mi := &file_gateway_v1_chat_proto_msgTypes[62] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3604,7 +3792,7 @@ func (x *CuratorAction) ProtoReflect() protoreflect.Message { // Deprecated: Use CuratorAction.ProtoReflect.Descriptor instead. func (*CuratorAction) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{60} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{62} } func (x *CuratorAction) GetAt() *timestamppb.Timestamp { @@ -3646,7 +3834,7 @@ type ReloadChannelRequest struct { func (x *ReloadChannelRequest) Reset() { *x = ReloadChannelRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[61] + mi := &file_gateway_v1_chat_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3658,7 +3846,7 @@ func (x *ReloadChannelRequest) String() string { func (*ReloadChannelRequest) ProtoMessage() {} func (x *ReloadChannelRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[61] + mi := &file_gateway_v1_chat_proto_msgTypes[63] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3671,7 +3859,7 @@ func (x *ReloadChannelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReloadChannelRequest.ProtoReflect.Descriptor instead. func (*ReloadChannelRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{61} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{63} } func (x *ReloadChannelRequest) GetChannelId() string { @@ -3689,7 +3877,7 @@ type ReloadChannelResponse struct { func (x *ReloadChannelResponse) Reset() { *x = ReloadChannelResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[62] + mi := &file_gateway_v1_chat_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3701,7 +3889,7 @@ func (x *ReloadChannelResponse) String() string { func (*ReloadChannelResponse) ProtoMessage() {} func (x *ReloadChannelResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[62] + mi := &file_gateway_v1_chat_proto_msgTypes[64] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3714,7 +3902,7 @@ func (x *ReloadChannelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReloadChannelResponse.ProtoReflect.Descriptor instead. func (*ReloadChannelResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{62} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{64} } type RecentLogsRequest struct { @@ -3727,7 +3915,7 @@ type RecentLogsRequest struct { func (x *RecentLogsRequest) Reset() { *x = RecentLogsRequest{} - mi := &file_gateway_v1_chat_proto_msgTypes[63] + mi := &file_gateway_v1_chat_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3739,7 +3927,7 @@ func (x *RecentLogsRequest) String() string { func (*RecentLogsRequest) ProtoMessage() {} func (x *RecentLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[63] + mi := &file_gateway_v1_chat_proto_msgTypes[65] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3752,7 +3940,7 @@ func (x *RecentLogsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RecentLogsRequest.ProtoReflect.Descriptor instead. func (*RecentLogsRequest) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{63} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{65} } func (x *RecentLogsRequest) GetQuery() *v1.LogQuery { @@ -3778,7 +3966,7 @@ type RecentLogsResponse struct { func (x *RecentLogsResponse) Reset() { *x = RecentLogsResponse{} - mi := &file_gateway_v1_chat_proto_msgTypes[64] + mi := &file_gateway_v1_chat_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3790,7 +3978,7 @@ func (x *RecentLogsResponse) String() string { func (*RecentLogsResponse) ProtoMessage() {} func (x *RecentLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_v1_chat_proto_msgTypes[64] + mi := &file_gateway_v1_chat_proto_msgTypes[66] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3803,7 +3991,7 @@ func (x *RecentLogsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RecentLogsResponse.ProtoReflect.Descriptor instead. func (*RecentLogsResponse) Descriptor() ([]byte, []int) { - return file_gateway_v1_chat_proto_rawDescGZIP(), []int{64} + return file_gateway_v1_chat_proto_rawDescGZIP(), []int{66} } func (x *RecentLogsResponse) GetSnapshot() *v1.LogSnapshot { @@ -3856,7 +4044,7 @@ const file_gateway_v1_chat_proto_rawDesc = "" + "\x05media\x18\v \x03(\v2\x11.gateway.v1.MediaR\x05media\x12\x1b\n" + "\tsender_id\x18\f \x01(\tR\bsenderIdJ\x04\b\t\x10\n" + "R\n" + - "budget_key\"|\n" + + "budget_key\"\xbe\x01\n" + "\bToolCall\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1e\n" + @@ -3864,7 +4052,11 @@ const file_gateway_v1_chat_proto_rawDesc = "" + "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" + + "\x05error\x18\x05 \x01(\tR\x05error\x12\x1f\n" + + "\vduration_ms\x18\x06 \x01(\x03R\n" + + "durationMs\x12\x1f\n" + + "\vtext_offset\x18\a \x01(\x05R\n" + + "textOffset\"\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" + @@ -3947,23 +4139,38 @@ const file_gateway_v1_chat_proto_rawDesc = "" + "\x04text\x18\x01 \x01(\tR\x04text\x12\x1d\n" + "\n" + "session_id\x18\x02 \x01(\tR\tsessionId\x12!\n" + - "\frate_limited\x18\x03 \x01(\bR\vrateLimited\"\x9b\x01\n" + + "\frate_limited\x18\x03 \x01(\bR\vrateLimited\"\xbe\x01\n" + "\rStreamRequest\x12-\n" + "\amessage\x18\x01 \x01(\v2\x13.gateway.v1.MessageR\amessage\x12\x1f\n" + "\vcan_approve\x18\x02 \x01(\bR\n" + "canApprove\x12\x1f\n" + "\vcan_clarify\x18\x03 \x01(\bR\n" + "canClarify\x12\x19\n" + - "\bcan_pick\x18\x04 \x01(\bR\acanPick\"\x87\x01\n" + + "\bcan_pick\x18\x04 \x01(\bR\acanPick\x12!\n" + + "\fcan_question\x18\x05 \x01(\bR\vcanQuestion\"\xbb\x01\n" + "\x03Ask\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04kind\x18\x02 \x01(\tR\x04kind\x12\x16\n" + "\x06prompt\x18\x03 \x01(\tR\x06prompt\x12\x16\n" + "\x06detail\x18\x04 \x01(\tR\x06detail\x12,\n" + - "\achoices\x18\x05 \x03(\v2\x12.gateway.v1.ChoiceR\achoices\".\n" + + "\achoices\x18\x05 \x03(\v2\x12.gateway.v1.ChoiceR\achoices\x122\n" + + "\tquestions\x18\x06 \x03(\v2\x14.gateway.v1.QuestionR\tquestions\".\n" + "\x06Choice\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n" + - "\x05label\x18\x02 \x01(\tR\x05label\">\n" + + "\x05label\x18\x02 \x01(\tR\x05label\"\xe5\x01\n" + + "\bQuestion\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05title\x18\x02 \x01(\tR\x05title\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x1a\n" + + "\bmultiple\x18\x04 \x01(\bR\bmultiple\x12\x1a\n" + + "\brequired\x18\x05 \x01(\bR\brequired\x12\x1f\n" + + "\vallow_other\x18\x06 \x01(\bR\n" + + "allowOther\x124\n" + + "\achoices\x18\a \x03(\v2\x1a.gateway.v1.QuestionChoiceR\achoices\"^\n" + + "\x0eQuestionChoice\x12\x14\n" + + "\x05value\x18\x01 \x01(\tR\x05value\x12\x14\n" + + "\x05label\x18\x02 \x01(\tR\x05label\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\">\n" + "\rAnswerRequest\x12\x15\n" + "\x06ask_id\x18\x01 \x01(\tR\x05askId\x12\x16\n" + "\x06answer\x18\x02 \x01(\tR\x06answer\"&\n" + @@ -4159,7 +4366,7 @@ func file_gateway_v1_chat_proto_rawDescGZIP() []byte { return file_gateway_v1_chat_proto_rawDescData } -var file_gateway_v1_chat_proto_msgTypes = make([]protoimpl.MessageInfo, 66) +var file_gateway_v1_chat_proto_msgTypes = make([]protoimpl.MessageInfo, 68) var file_gateway_v1_chat_proto_goTypes = []any{ (*CheckSecretRequest)(nil), // 0: gateway.v1.CheckSecretRequest (*CheckSecretResponse)(nil), // 1: gateway.v1.CheckSecretResponse @@ -4182,148 +4389,152 @@ var file_gateway_v1_chat_proto_goTypes = []any{ (*StreamRequest)(nil), // 18: gateway.v1.StreamRequest (*Ask)(nil), // 19: gateway.v1.Ask (*Choice)(nil), // 20: gateway.v1.Choice - (*AnswerRequest)(nil), // 21: gateway.v1.AnswerRequest - (*AnswerResponse)(nil), // 22: gateway.v1.AnswerResponse - (*StreamResponse)(nil), // 23: gateway.v1.StreamResponse - (*CancelRequest)(nil), // 24: gateway.v1.CancelRequest - (*CancelResponse)(nil), // 25: gateway.v1.CancelResponse - (*StopTasksRequest)(nil), // 26: gateway.v1.StopTasksRequest - (*StopTasksResponse)(nil), // 27: gateway.v1.StopTasksResponse - (*ApplyTaskActionRequest)(nil), // 28: gateway.v1.ApplyTaskActionRequest - (*ApplyTaskActionResponse)(nil), // 29: gateway.v1.ApplyTaskActionResponse - (*ApplyOperatorTaskActionRequest)(nil), // 30: gateway.v1.ApplyOperatorTaskActionRequest - (*ApplyOperatorTaskActionResponse)(nil), // 31: gateway.v1.ApplyOperatorTaskActionResponse - (*SaveSessionResponse)(nil), // 32: gateway.v1.SaveSessionResponse - (*SaveSessionRequest)(nil), // 33: gateway.v1.SaveSessionRequest - (*GetSessionsByChannelRequest)(nil), // 34: gateway.v1.GetSessionsByChannelRequest - (*GetSessionsByChannelResponse)(nil), // 35: gateway.v1.GetSessionsByChannelResponse - (*ListSessionsResponse)(nil), // 36: gateway.v1.ListSessionsResponse - (*DeleteSessionResponse)(nil), // 37: gateway.v1.DeleteSessionResponse - (*TouchSessionResponse)(nil), // 38: gateway.v1.TouchSessionResponse - (*SaveMessageResponse)(nil), // 39: gateway.v1.SaveMessageResponse - (*SaveMessagesResponse)(nil), // 40: gateway.v1.SaveMessagesResponse - (*ReplaceMessagesResponse)(nil), // 41: gateway.v1.ReplaceMessagesResponse - (*DeleteSessionRequest)(nil), // 42: gateway.v1.DeleteSessionRequest - (*TouchSessionRequest)(nil), // 43: gateway.v1.TouchSessionRequest - (*ListSessionsRequest)(nil), // 44: gateway.v1.ListSessionsRequest - (*SaveMessageRequest)(nil), // 45: gateway.v1.SaveMessageRequest - (*DeleteRecentMessagesRequest)(nil), // 46: gateway.v1.DeleteRecentMessagesRequest - (*DeleteRecentMessagesResponse)(nil), // 47: gateway.v1.DeleteRecentMessagesResponse - (*MessageCountRequest)(nil), // 48: gateway.v1.MessageCountRequest - (*MessageCountResponse)(nil), // 49: gateway.v1.MessageCountResponse - (*SaveMessagesRequest)(nil), // 50: gateway.v1.SaveMessagesRequest - (*ReplaceMessagesRequest)(nil), // 51: gateway.v1.ReplaceMessagesRequest - (*SearchMessagesRequest)(nil), // 52: gateway.v1.SearchMessagesRequest - (*SearchMessagesResponse)(nil), // 53: gateway.v1.SearchMessagesResponse - (*ListSkillsRequest)(nil), // 54: gateway.v1.ListSkillsRequest - (*ListSkillsResponse)(nil), // 55: gateway.v1.ListSkillsResponse - (*Skill)(nil), // 56: gateway.v1.Skill - (*CuratorHealthRequest)(nil), // 57: gateway.v1.CuratorHealthRequest - (*CuratorHealthResponse)(nil), // 58: gateway.v1.CuratorHealthResponse - (*Curator)(nil), // 59: gateway.v1.Curator - (*CuratorAction)(nil), // 60: gateway.v1.CuratorAction - (*ReloadChannelRequest)(nil), // 61: gateway.v1.ReloadChannelRequest - (*ReloadChannelResponse)(nil), // 62: gateway.v1.ReloadChannelResponse - (*RecentLogsRequest)(nil), // 63: gateway.v1.RecentLogsRequest - (*RecentLogsResponse)(nil), // 64: gateway.v1.RecentLogsResponse - nil, // 65: gateway.v1.SnapshotResponse.ModelsByProviderEntry - (*timestamppb.Timestamp)(nil), // 66: google.protobuf.Timestamp - (*v1.LogQuery)(nil), // 67: logging.v1.LogQuery - (*v1.LogSnapshot)(nil), // 68: logging.v1.LogSnapshot + (*Question)(nil), // 21: gateway.v1.Question + (*QuestionChoice)(nil), // 22: gateway.v1.QuestionChoice + (*AnswerRequest)(nil), // 23: gateway.v1.AnswerRequest + (*AnswerResponse)(nil), // 24: gateway.v1.AnswerResponse + (*StreamResponse)(nil), // 25: gateway.v1.StreamResponse + (*CancelRequest)(nil), // 26: gateway.v1.CancelRequest + (*CancelResponse)(nil), // 27: gateway.v1.CancelResponse + (*StopTasksRequest)(nil), // 28: gateway.v1.StopTasksRequest + (*StopTasksResponse)(nil), // 29: gateway.v1.StopTasksResponse + (*ApplyTaskActionRequest)(nil), // 30: gateway.v1.ApplyTaskActionRequest + (*ApplyTaskActionResponse)(nil), // 31: gateway.v1.ApplyTaskActionResponse + (*ApplyOperatorTaskActionRequest)(nil), // 32: gateway.v1.ApplyOperatorTaskActionRequest + (*ApplyOperatorTaskActionResponse)(nil), // 33: gateway.v1.ApplyOperatorTaskActionResponse + (*SaveSessionResponse)(nil), // 34: gateway.v1.SaveSessionResponse + (*SaveSessionRequest)(nil), // 35: gateway.v1.SaveSessionRequest + (*GetSessionsByChannelRequest)(nil), // 36: gateway.v1.GetSessionsByChannelRequest + (*GetSessionsByChannelResponse)(nil), // 37: gateway.v1.GetSessionsByChannelResponse + (*ListSessionsResponse)(nil), // 38: gateway.v1.ListSessionsResponse + (*DeleteSessionResponse)(nil), // 39: gateway.v1.DeleteSessionResponse + (*TouchSessionResponse)(nil), // 40: gateway.v1.TouchSessionResponse + (*SaveMessageResponse)(nil), // 41: gateway.v1.SaveMessageResponse + (*SaveMessagesResponse)(nil), // 42: gateway.v1.SaveMessagesResponse + (*ReplaceMessagesResponse)(nil), // 43: gateway.v1.ReplaceMessagesResponse + (*DeleteSessionRequest)(nil), // 44: gateway.v1.DeleteSessionRequest + (*TouchSessionRequest)(nil), // 45: gateway.v1.TouchSessionRequest + (*ListSessionsRequest)(nil), // 46: gateway.v1.ListSessionsRequest + (*SaveMessageRequest)(nil), // 47: gateway.v1.SaveMessageRequest + (*DeleteRecentMessagesRequest)(nil), // 48: gateway.v1.DeleteRecentMessagesRequest + (*DeleteRecentMessagesResponse)(nil), // 49: gateway.v1.DeleteRecentMessagesResponse + (*MessageCountRequest)(nil), // 50: gateway.v1.MessageCountRequest + (*MessageCountResponse)(nil), // 51: gateway.v1.MessageCountResponse + (*SaveMessagesRequest)(nil), // 52: gateway.v1.SaveMessagesRequest + (*ReplaceMessagesRequest)(nil), // 53: gateway.v1.ReplaceMessagesRequest + (*SearchMessagesRequest)(nil), // 54: gateway.v1.SearchMessagesRequest + (*SearchMessagesResponse)(nil), // 55: gateway.v1.SearchMessagesResponse + (*ListSkillsRequest)(nil), // 56: gateway.v1.ListSkillsRequest + (*ListSkillsResponse)(nil), // 57: gateway.v1.ListSkillsResponse + (*Skill)(nil), // 58: gateway.v1.Skill + (*CuratorHealthRequest)(nil), // 59: gateway.v1.CuratorHealthRequest + (*CuratorHealthResponse)(nil), // 60: gateway.v1.CuratorHealthResponse + (*Curator)(nil), // 61: gateway.v1.Curator + (*CuratorAction)(nil), // 62: gateway.v1.CuratorAction + (*ReloadChannelRequest)(nil), // 63: gateway.v1.ReloadChannelRequest + (*ReloadChannelResponse)(nil), // 64: gateway.v1.ReloadChannelResponse + (*RecentLogsRequest)(nil), // 65: gateway.v1.RecentLogsRequest + (*RecentLogsResponse)(nil), // 66: gateway.v1.RecentLogsResponse + nil, // 67: gateway.v1.SnapshotResponse.ModelsByProviderEntry + (*timestamppb.Timestamp)(nil), // 68: google.protobuf.Timestamp + (*v1.LogQuery)(nil), // 69: logging.v1.LogQuery + (*v1.LogSnapshot)(nil), // 70: logging.v1.LogSnapshot } var file_gateway_v1_chat_proto_depIdxs = []int32{ - 66, // 0: gateway.v1.Session.created_at:type_name -> google.protobuf.Timestamp - 66, // 1: gateway.v1.Session.last_active_at:type_name -> google.protobuf.Timestamp - 66, // 2: gateway.v1.Message.at:type_name -> google.protobuf.Timestamp + 68, // 0: gateway.v1.Session.created_at:type_name -> google.protobuf.Timestamp + 68, // 1: gateway.v1.Session.last_active_at:type_name -> google.protobuf.Timestamp + 68, // 2: gateway.v1.Message.at:type_name -> google.protobuf.Timestamp 5, // 3: gateway.v1.Message.media:type_name -> gateway.v1.Media 4, // 4: gateway.v1.Turn.tool_calls:type_name -> gateway.v1.ToolCall - 66, // 5: gateway.v1.Turn.created_at:type_name -> google.protobuf.Timestamp - 66, // 6: gateway.v1.Turn.updated_at:type_name -> google.protobuf.Timestamp + 68, // 5: gateway.v1.Turn.created_at:type_name -> google.protobuf.Timestamp + 68, // 6: gateway.v1.Turn.updated_at:type_name -> google.protobuf.Timestamp 2, // 7: gateway.v1.SnapshotResponse.sessions:type_name -> gateway.v1.Session - 65, // 8: gateway.v1.SnapshotResponse.models_by_provider:type_name -> gateway.v1.SnapshotResponse.ModelsByProviderEntry + 67, // 8: gateway.v1.SnapshotResponse.models_by_provider:type_name -> gateway.v1.SnapshotResponse.ModelsByProviderEntry 2, // 9: gateway.v1.GetSessionResponse.session:type_name -> gateway.v1.Session 3, // 10: gateway.v1.RecentMessagesResponse.messages:type_name -> gateway.v1.Message 6, // 11: gateway.v1.RecentTurnsResponse.turns:type_name -> gateway.v1.Turn 3, // 12: gateway.v1.RouteRequest.message:type_name -> gateway.v1.Message 3, // 13: gateway.v1.StreamRequest.message:type_name -> gateway.v1.Message 20, // 14: gateway.v1.Ask.choices:type_name -> gateway.v1.Choice - 4, // 15: gateway.v1.StreamResponse.tool:type_name -> gateway.v1.ToolCall - 5, // 16: gateway.v1.StreamResponse.media:type_name -> gateway.v1.Media - 19, // 17: gateway.v1.StreamResponse.ask:type_name -> gateway.v1.Ask - 2, // 18: gateway.v1.SaveSessionRequest.session:type_name -> gateway.v1.Session - 2, // 19: gateway.v1.GetSessionsByChannelResponse.sessions:type_name -> gateway.v1.Session - 2, // 20: gateway.v1.ListSessionsResponse.sessions:type_name -> gateway.v1.Session - 3, // 21: gateway.v1.SaveMessageRequest.message:type_name -> gateway.v1.Message - 3, // 22: gateway.v1.SaveMessagesRequest.messages:type_name -> gateway.v1.Message - 3, // 23: gateway.v1.ReplaceMessagesRequest.messages:type_name -> gateway.v1.Message - 3, // 24: gateway.v1.SearchMessagesResponse.messages:type_name -> gateway.v1.Message - 56, // 25: gateway.v1.ListSkillsResponse.skills:type_name -> gateway.v1.Skill - 59, // 26: gateway.v1.CuratorHealthResponse.curators:type_name -> gateway.v1.Curator - 66, // 27: gateway.v1.Curator.last_run_at:type_name -> google.protobuf.Timestamp - 60, // 28: gateway.v1.Curator.recent_actions:type_name -> gateway.v1.CuratorAction - 66, // 29: gateway.v1.CuratorAction.at:type_name -> google.protobuf.Timestamp - 67, // 30: gateway.v1.RecentLogsRequest.query:type_name -> logging.v1.LogQuery - 68, // 31: gateway.v1.RecentLogsResponse.snapshot:type_name -> logging.v1.LogSnapshot - 7, // 32: gateway.v1.SnapshotResponse.ModelsByProviderEntry.value:type_name -> gateway.v1.StringList - 63, // 33: gateway.v1.ChatService.RecentLogs:input_type -> gateway.v1.RecentLogsRequest - 8, // 34: gateway.v1.ChatService.Snapshot:input_type -> gateway.v1.SnapshotRequest - 10, // 35: gateway.v1.ChatService.GetSession:input_type -> gateway.v1.GetSessionRequest - 12, // 36: gateway.v1.ChatService.RecentMessages:input_type -> gateway.v1.RecentMessagesRequest - 14, // 37: gateway.v1.ChatService.RecentTurns:input_type -> gateway.v1.RecentTurnsRequest - 16, // 38: gateway.v1.ChatService.Route:input_type -> gateway.v1.RouteRequest - 18, // 39: gateway.v1.ChatService.Stream:input_type -> gateway.v1.StreamRequest - 21, // 40: gateway.v1.ChatService.Answer:input_type -> gateway.v1.AnswerRequest - 24, // 41: gateway.v1.ChatService.Cancel:input_type -> gateway.v1.CancelRequest - 26, // 42: gateway.v1.ChatService.StopTasks:input_type -> gateway.v1.StopTasksRequest - 28, // 43: gateway.v1.ChatService.ApplyTaskAction:input_type -> gateway.v1.ApplyTaskActionRequest - 30, // 44: gateway.v1.ChatService.ApplyOperatorTaskAction:input_type -> gateway.v1.ApplyOperatorTaskActionRequest - 33, // 45: gateway.v1.ChatService.SaveSession:input_type -> gateway.v1.SaveSessionRequest - 34, // 46: gateway.v1.ChatService.GetSessionsByChannel:input_type -> gateway.v1.GetSessionsByChannelRequest - 42, // 47: gateway.v1.ChatService.DeleteSession:input_type -> gateway.v1.DeleteSessionRequest - 43, // 48: gateway.v1.ChatService.TouchSession:input_type -> gateway.v1.TouchSessionRequest - 44, // 49: gateway.v1.ChatService.ListSessions:input_type -> gateway.v1.ListSessionsRequest - 45, // 50: gateway.v1.ChatService.SaveMessage:input_type -> gateway.v1.SaveMessageRequest - 46, // 51: gateway.v1.ChatService.DeleteRecentMessages:input_type -> gateway.v1.DeleteRecentMessagesRequest - 48, // 52: gateway.v1.ChatService.MessageCount:input_type -> gateway.v1.MessageCountRequest - 50, // 53: gateway.v1.ChatService.SaveMessages:input_type -> gateway.v1.SaveMessagesRequest - 51, // 54: gateway.v1.ChatService.ReplaceMessages:input_type -> gateway.v1.ReplaceMessagesRequest - 52, // 55: gateway.v1.ChatService.SearchMessages:input_type -> gateway.v1.SearchMessagesRequest - 54, // 56: gateway.v1.ChatService.ListSkills:input_type -> gateway.v1.ListSkillsRequest - 57, // 57: gateway.v1.ChatService.CuratorHealth:input_type -> gateway.v1.CuratorHealthRequest - 61, // 58: gateway.v1.ChatService.ReloadChannel:input_type -> gateway.v1.ReloadChannelRequest - 0, // 59: gateway.v1.ChatService.CheckSecret:input_type -> gateway.v1.CheckSecretRequest - 64, // 60: gateway.v1.ChatService.RecentLogs:output_type -> gateway.v1.RecentLogsResponse - 9, // 61: gateway.v1.ChatService.Snapshot:output_type -> gateway.v1.SnapshotResponse - 11, // 62: gateway.v1.ChatService.GetSession:output_type -> gateway.v1.GetSessionResponse - 13, // 63: gateway.v1.ChatService.RecentMessages:output_type -> gateway.v1.RecentMessagesResponse - 15, // 64: gateway.v1.ChatService.RecentTurns:output_type -> gateway.v1.RecentTurnsResponse - 17, // 65: gateway.v1.ChatService.Route:output_type -> gateway.v1.RouteResponse - 23, // 66: gateway.v1.ChatService.Stream:output_type -> gateway.v1.StreamResponse - 22, // 67: gateway.v1.ChatService.Answer:output_type -> gateway.v1.AnswerResponse - 25, // 68: gateway.v1.ChatService.Cancel:output_type -> gateway.v1.CancelResponse - 27, // 69: gateway.v1.ChatService.StopTasks:output_type -> gateway.v1.StopTasksResponse - 29, // 70: gateway.v1.ChatService.ApplyTaskAction:output_type -> gateway.v1.ApplyTaskActionResponse - 31, // 71: gateway.v1.ChatService.ApplyOperatorTaskAction:output_type -> gateway.v1.ApplyOperatorTaskActionResponse - 32, // 72: gateway.v1.ChatService.SaveSession:output_type -> gateway.v1.SaveSessionResponse - 35, // 73: gateway.v1.ChatService.GetSessionsByChannel:output_type -> gateway.v1.GetSessionsByChannelResponse - 37, // 74: gateway.v1.ChatService.DeleteSession:output_type -> gateway.v1.DeleteSessionResponse - 38, // 75: gateway.v1.ChatService.TouchSession:output_type -> gateway.v1.TouchSessionResponse - 36, // 76: gateway.v1.ChatService.ListSessions:output_type -> gateway.v1.ListSessionsResponse - 39, // 77: gateway.v1.ChatService.SaveMessage:output_type -> gateway.v1.SaveMessageResponse - 47, // 78: gateway.v1.ChatService.DeleteRecentMessages:output_type -> gateway.v1.DeleteRecentMessagesResponse - 49, // 79: gateway.v1.ChatService.MessageCount:output_type -> gateway.v1.MessageCountResponse - 40, // 80: gateway.v1.ChatService.SaveMessages:output_type -> gateway.v1.SaveMessagesResponse - 41, // 81: gateway.v1.ChatService.ReplaceMessages:output_type -> gateway.v1.ReplaceMessagesResponse - 53, // 82: gateway.v1.ChatService.SearchMessages:output_type -> gateway.v1.SearchMessagesResponse - 55, // 83: gateway.v1.ChatService.ListSkills:output_type -> gateway.v1.ListSkillsResponse - 58, // 84: gateway.v1.ChatService.CuratorHealth:output_type -> gateway.v1.CuratorHealthResponse - 62, // 85: gateway.v1.ChatService.ReloadChannel:output_type -> gateway.v1.ReloadChannelResponse - 1, // 86: gateway.v1.ChatService.CheckSecret:output_type -> gateway.v1.CheckSecretResponse - 60, // [60:87] is the sub-list for method output_type - 33, // [33:60] is the sub-list for method input_type - 33, // [33:33] is the sub-list for extension type_name - 33, // [33:33] is the sub-list for extension extendee - 0, // [0:33] is the sub-list for field type_name + 21, // 15: gateway.v1.Ask.questions:type_name -> gateway.v1.Question + 22, // 16: gateway.v1.Question.choices:type_name -> gateway.v1.QuestionChoice + 4, // 17: gateway.v1.StreamResponse.tool:type_name -> gateway.v1.ToolCall + 5, // 18: gateway.v1.StreamResponse.media:type_name -> gateway.v1.Media + 19, // 19: gateway.v1.StreamResponse.ask:type_name -> gateway.v1.Ask + 2, // 20: gateway.v1.SaveSessionRequest.session:type_name -> gateway.v1.Session + 2, // 21: gateway.v1.GetSessionsByChannelResponse.sessions:type_name -> gateway.v1.Session + 2, // 22: gateway.v1.ListSessionsResponse.sessions:type_name -> gateway.v1.Session + 3, // 23: gateway.v1.SaveMessageRequest.message:type_name -> gateway.v1.Message + 3, // 24: gateway.v1.SaveMessagesRequest.messages:type_name -> gateway.v1.Message + 3, // 25: gateway.v1.ReplaceMessagesRequest.messages:type_name -> gateway.v1.Message + 3, // 26: gateway.v1.SearchMessagesResponse.messages:type_name -> gateway.v1.Message + 58, // 27: gateway.v1.ListSkillsResponse.skills:type_name -> gateway.v1.Skill + 61, // 28: gateway.v1.CuratorHealthResponse.curators:type_name -> gateway.v1.Curator + 68, // 29: gateway.v1.Curator.last_run_at:type_name -> google.protobuf.Timestamp + 62, // 30: gateway.v1.Curator.recent_actions:type_name -> gateway.v1.CuratorAction + 68, // 31: gateway.v1.CuratorAction.at:type_name -> google.protobuf.Timestamp + 69, // 32: gateway.v1.RecentLogsRequest.query:type_name -> logging.v1.LogQuery + 70, // 33: gateway.v1.RecentLogsResponse.snapshot:type_name -> logging.v1.LogSnapshot + 7, // 34: gateway.v1.SnapshotResponse.ModelsByProviderEntry.value:type_name -> gateway.v1.StringList + 65, // 35: gateway.v1.ChatService.RecentLogs:input_type -> gateway.v1.RecentLogsRequest + 8, // 36: gateway.v1.ChatService.Snapshot:input_type -> gateway.v1.SnapshotRequest + 10, // 37: gateway.v1.ChatService.GetSession:input_type -> gateway.v1.GetSessionRequest + 12, // 38: gateway.v1.ChatService.RecentMessages:input_type -> gateway.v1.RecentMessagesRequest + 14, // 39: gateway.v1.ChatService.RecentTurns:input_type -> gateway.v1.RecentTurnsRequest + 16, // 40: gateway.v1.ChatService.Route:input_type -> gateway.v1.RouteRequest + 18, // 41: gateway.v1.ChatService.Stream:input_type -> gateway.v1.StreamRequest + 23, // 42: gateway.v1.ChatService.Answer:input_type -> gateway.v1.AnswerRequest + 26, // 43: gateway.v1.ChatService.Cancel:input_type -> gateway.v1.CancelRequest + 28, // 44: gateway.v1.ChatService.StopTasks:input_type -> gateway.v1.StopTasksRequest + 30, // 45: gateway.v1.ChatService.ApplyTaskAction:input_type -> gateway.v1.ApplyTaskActionRequest + 32, // 46: gateway.v1.ChatService.ApplyOperatorTaskAction:input_type -> gateway.v1.ApplyOperatorTaskActionRequest + 35, // 47: gateway.v1.ChatService.SaveSession:input_type -> gateway.v1.SaveSessionRequest + 36, // 48: gateway.v1.ChatService.GetSessionsByChannel:input_type -> gateway.v1.GetSessionsByChannelRequest + 44, // 49: gateway.v1.ChatService.DeleteSession:input_type -> gateway.v1.DeleteSessionRequest + 45, // 50: gateway.v1.ChatService.TouchSession:input_type -> gateway.v1.TouchSessionRequest + 46, // 51: gateway.v1.ChatService.ListSessions:input_type -> gateway.v1.ListSessionsRequest + 47, // 52: gateway.v1.ChatService.SaveMessage:input_type -> gateway.v1.SaveMessageRequest + 48, // 53: gateway.v1.ChatService.DeleteRecentMessages:input_type -> gateway.v1.DeleteRecentMessagesRequest + 50, // 54: gateway.v1.ChatService.MessageCount:input_type -> gateway.v1.MessageCountRequest + 52, // 55: gateway.v1.ChatService.SaveMessages:input_type -> gateway.v1.SaveMessagesRequest + 53, // 56: gateway.v1.ChatService.ReplaceMessages:input_type -> gateway.v1.ReplaceMessagesRequest + 54, // 57: gateway.v1.ChatService.SearchMessages:input_type -> gateway.v1.SearchMessagesRequest + 56, // 58: gateway.v1.ChatService.ListSkills:input_type -> gateway.v1.ListSkillsRequest + 59, // 59: gateway.v1.ChatService.CuratorHealth:input_type -> gateway.v1.CuratorHealthRequest + 63, // 60: gateway.v1.ChatService.ReloadChannel:input_type -> gateway.v1.ReloadChannelRequest + 0, // 61: gateway.v1.ChatService.CheckSecret:input_type -> gateway.v1.CheckSecretRequest + 66, // 62: gateway.v1.ChatService.RecentLogs:output_type -> gateway.v1.RecentLogsResponse + 9, // 63: gateway.v1.ChatService.Snapshot:output_type -> gateway.v1.SnapshotResponse + 11, // 64: gateway.v1.ChatService.GetSession:output_type -> gateway.v1.GetSessionResponse + 13, // 65: gateway.v1.ChatService.RecentMessages:output_type -> gateway.v1.RecentMessagesResponse + 15, // 66: gateway.v1.ChatService.RecentTurns:output_type -> gateway.v1.RecentTurnsResponse + 17, // 67: gateway.v1.ChatService.Route:output_type -> gateway.v1.RouteResponse + 25, // 68: gateway.v1.ChatService.Stream:output_type -> gateway.v1.StreamResponse + 24, // 69: gateway.v1.ChatService.Answer:output_type -> gateway.v1.AnswerResponse + 27, // 70: gateway.v1.ChatService.Cancel:output_type -> gateway.v1.CancelResponse + 29, // 71: gateway.v1.ChatService.StopTasks:output_type -> gateway.v1.StopTasksResponse + 31, // 72: gateway.v1.ChatService.ApplyTaskAction:output_type -> gateway.v1.ApplyTaskActionResponse + 33, // 73: gateway.v1.ChatService.ApplyOperatorTaskAction:output_type -> gateway.v1.ApplyOperatorTaskActionResponse + 34, // 74: gateway.v1.ChatService.SaveSession:output_type -> gateway.v1.SaveSessionResponse + 37, // 75: gateway.v1.ChatService.GetSessionsByChannel:output_type -> gateway.v1.GetSessionsByChannelResponse + 39, // 76: gateway.v1.ChatService.DeleteSession:output_type -> gateway.v1.DeleteSessionResponse + 40, // 77: gateway.v1.ChatService.TouchSession:output_type -> gateway.v1.TouchSessionResponse + 38, // 78: gateway.v1.ChatService.ListSessions:output_type -> gateway.v1.ListSessionsResponse + 41, // 79: gateway.v1.ChatService.SaveMessage:output_type -> gateway.v1.SaveMessageResponse + 49, // 80: gateway.v1.ChatService.DeleteRecentMessages:output_type -> gateway.v1.DeleteRecentMessagesResponse + 51, // 81: gateway.v1.ChatService.MessageCount:output_type -> gateway.v1.MessageCountResponse + 42, // 82: gateway.v1.ChatService.SaveMessages:output_type -> gateway.v1.SaveMessagesResponse + 43, // 83: gateway.v1.ChatService.ReplaceMessages:output_type -> gateway.v1.ReplaceMessagesResponse + 55, // 84: gateway.v1.ChatService.SearchMessages:output_type -> gateway.v1.SearchMessagesResponse + 57, // 85: gateway.v1.ChatService.ListSkills:output_type -> gateway.v1.ListSkillsResponse + 60, // 86: gateway.v1.ChatService.CuratorHealth:output_type -> gateway.v1.CuratorHealthResponse + 64, // 87: gateway.v1.ChatService.ReloadChannel:output_type -> gateway.v1.ReloadChannelResponse + 1, // 88: gateway.v1.ChatService.CheckSecret:output_type -> gateway.v1.CheckSecretResponse + 62, // [62:89] is the sub-list for method output_type + 35, // [35:62] is the sub-list for method input_type + 35, // [35:35] is the sub-list for extension type_name + 35, // [35:35] is the sub-list for extension extendee + 0, // [0:35] is the sub-list for field type_name } func init() { file_gateway_v1_chat_proto_init() } @@ -4332,14 +4543,14 @@ func file_gateway_v1_chat_proto_init() { return } file_gateway_v1_chat_proto_msgTypes[5].OneofWrappers = []any{} - file_gateway_v1_chat_proto_msgTypes[59].OneofWrappers = []any{} + file_gateway_v1_chat_proto_msgTypes[61].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: 66, + NumMessages: 68, NumExtensions: 0, NumServices: 1, }, diff --git a/sdk/gateway/v1/task_tools.pb.go b/sdk/gateway/v1/task_tools.pb.go new file mode 100644 index 0000000..9fa21db --- /dev/null +++ b/sdk/gateway/v1/task_tools.pb.go @@ -0,0 +1,382 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: gateway/v1/task_tools.proto + +package gatewayv1 + +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 ListTaskToolsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RunCredential string `protobuf:"bytes,1,opt,name=run_credential,json=runCredential,proto3" json:"run_credential,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListTaskToolsRequest) Reset() { + *x = ListTaskToolsRequest{} + mi := &file_gateway_v1_task_tools_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListTaskToolsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTaskToolsRequest) ProtoMessage() {} + +func (x *ListTaskToolsRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_task_tools_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 ListTaskToolsRequest.ProtoReflect.Descriptor instead. +func (*ListTaskToolsRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{0} +} + +func (x *ListTaskToolsRequest) GetRunCredential() string { + if x != nil { + return x.RunCredential + } + return "" +} + +type ListTaskToolsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ToolsJson []byte `protobuf:"bytes,1,opt,name=tools_json,json=toolsJson,proto3" json:"tools_json,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListTaskToolsResponse) Reset() { + *x = ListTaskToolsResponse{} + mi := &file_gateway_v1_task_tools_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListTaskToolsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTaskToolsResponse) ProtoMessage() {} + +func (x *ListTaskToolsResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_task_tools_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 ListTaskToolsResponse.ProtoReflect.Descriptor instead. +func (*ListTaskToolsResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{1} +} + +func (x *ListTaskToolsResponse) GetToolsJson() []byte { + if x != nil { + return x.ToolsJson + } + return nil +} + +type CallTaskToolRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RunCredential string `protobuf:"bytes,1,opt,name=run_credential,json=runCredential,proto3" json:"run_credential,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + ArgumentsJson []byte `protobuf:"bytes,3,opt,name=arguments_json,json=argumentsJson,proto3" json:"arguments_json,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CallTaskToolRequest) Reset() { + *x = CallTaskToolRequest{} + mi := &file_gateway_v1_task_tools_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CallTaskToolRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallTaskToolRequest) ProtoMessage() {} + +func (x *CallTaskToolRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_task_tools_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 CallTaskToolRequest.ProtoReflect.Descriptor instead. +func (*CallTaskToolRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{2} +} + +func (x *CallTaskToolRequest) GetRunCredential() string { + if x != nil { + return x.RunCredential + } + return "" +} + +func (x *CallTaskToolRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CallTaskToolRequest) GetArgumentsJson() []byte { + if x != nil { + return x.ArgumentsJson + } + return nil +} + +type CallTaskToolResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResultJson []byte `protobuf:"bytes,1,opt,name=result_json,json=resultJson,proto3" json:"result_json,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CallTaskToolResponse) Reset() { + *x = CallTaskToolResponse{} + mi := &file_gateway_v1_task_tools_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CallTaskToolResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallTaskToolResponse) ProtoMessage() {} + +func (x *CallTaskToolResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_task_tools_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 CallTaskToolResponse.ProtoReflect.Descriptor instead. +func (*CallTaskToolResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{3} +} + +func (x *CallTaskToolResponse) GetResultJson() []byte { + if x != nil { + return x.ResultJson + } + return nil +} + +type CloseTaskToolsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RunCredential string `protobuf:"bytes,1,opt,name=run_credential,json=runCredential,proto3" json:"run_credential,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CloseTaskToolsRequest) Reset() { + *x = CloseTaskToolsRequest{} + mi := &file_gateway_v1_task_tools_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CloseTaskToolsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloseTaskToolsRequest) ProtoMessage() {} + +func (x *CloseTaskToolsRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_task_tools_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 CloseTaskToolsRequest.ProtoReflect.Descriptor instead. +func (*CloseTaskToolsRequest) Descriptor() ([]byte, []int) { + return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{4} +} + +func (x *CloseTaskToolsRequest) GetRunCredential() string { + if x != nil { + return x.RunCredential + } + return "" +} + +type CloseTaskToolsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CloseTaskToolsResponse) Reset() { + *x = CloseTaskToolsResponse{} + mi := &file_gateway_v1_task_tools_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CloseTaskToolsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloseTaskToolsResponse) ProtoMessage() {} + +func (x *CloseTaskToolsResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_v1_task_tools_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 CloseTaskToolsResponse.ProtoReflect.Descriptor instead. +func (*CloseTaskToolsResponse) Descriptor() ([]byte, []int) { + return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{5} +} + +var File_gateway_v1_task_tools_proto protoreflect.FileDescriptor + +const file_gateway_v1_task_tools_proto_rawDesc = "" + + "\n" + + "\x1bgateway/v1/task_tools.proto\x12\n" + + "gateway.v1\"=\n" + + "\x14ListTaskToolsRequest\x12%\n" + + "\x0erun_credential\x18\x01 \x01(\tR\rrunCredential\"6\n" + + "\x15ListTaskToolsResponse\x12\x1d\n" + + "\n" + + "tools_json\x18\x01 \x01(\fR\ttoolsJson\"w\n" + + "\x13CallTaskToolRequest\x12%\n" + + "\x0erun_credential\x18\x01 \x01(\tR\rrunCredential\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12%\n" + + "\x0earguments_json\x18\x03 \x01(\fR\rargumentsJson\"7\n" + + "\x14CallTaskToolResponse\x12\x1f\n" + + "\vresult_json\x18\x01 \x01(\fR\n" + + "resultJson\">\n" + + "\x15CloseTaskToolsRequest\x12%\n" + + "\x0erun_credential\x18\x01 \x01(\tR\rrunCredential\"\x18\n" + + "\x16CloseTaskToolsResponse2\x94\x02\n" + + "\x10TaskToolsService\x12T\n" + + "\rListTaskTools\x12 .gateway.v1.ListTaskToolsRequest\x1a!.gateway.v1.ListTaskToolsResponse\x12Q\n" + + "\fCallTaskTool\x12\x1f.gateway.v1.CallTaskToolRequest\x1a .gateway.v1.CallTaskToolResponse\x12W\n" + + "\x0eCloseTaskTools\x12!.gateway.v1.CloseTaskToolsRequest\x1a\".gateway.v1.CloseTaskToolsResponseB\xa7\x01\n" + + "\x0ecom.gateway.v1B\x0eTaskToolsProtoP\x01Z gateway.v1.ListTaskToolsRequest + 2, // 1: gateway.v1.TaskToolsService.CallTaskTool:input_type -> gateway.v1.CallTaskToolRequest + 4, // 2: gateway.v1.TaskToolsService.CloseTaskTools:input_type -> gateway.v1.CloseTaskToolsRequest + 1, // 3: gateway.v1.TaskToolsService.ListTaskTools:output_type -> gateway.v1.ListTaskToolsResponse + 3, // 4: gateway.v1.TaskToolsService.CallTaskTool:output_type -> gateway.v1.CallTaskToolResponse + 5, // 5: gateway.v1.TaskToolsService.CloseTaskTools:output_type -> gateway.v1.CloseTaskToolsResponse + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_gateway_v1_task_tools_proto_init() } +func file_gateway_v1_task_tools_proto_init() { + if File_gateway_v1_task_tools_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_gateway_v1_task_tools_proto_rawDesc), len(file_gateway_v1_task_tools_proto_rawDesc)), + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gateway_v1_task_tools_proto_goTypes, + DependencyIndexes: file_gateway_v1_task_tools_proto_depIdxs, + MessageInfos: file_gateway_v1_task_tools_proto_msgTypes, + }.Build() + File_gateway_v1_task_tools_proto = out.File + file_gateway_v1_task_tools_proto_goTypes = nil + file_gateway_v1_task_tools_proto_depIdxs = nil +} diff --git a/sdk/gateway/v1/task_tools_grpc.pb.go b/sdk/gateway/v1/task_tools_grpc.pb.go new file mode 100644 index 0000000..0e64a95 --- /dev/null +++ b/sdk/gateway/v1/task_tools_grpc.pb.go @@ -0,0 +1,203 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.2 +// - protoc (unknown) +// source: gateway/v1/task_tools.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 ( + TaskToolsService_ListTaskTools_FullMethodName = "/gateway.v1.TaskToolsService/ListTaskTools" + TaskToolsService_CallTaskTool_FullMethodName = "/gateway.v1.TaskToolsService/CallTaskTool" + TaskToolsService_CloseTaskTools_FullMethodName = "/gateway.v1.TaskToolsService/CloseTaskTools" +) + +// TaskToolsServiceClient is the client API for TaskToolsService 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. +// +// TaskToolsService executes central tools for a live task grant. Only the +// daemon calls it; identities, orgs and permissions are resolved by the server. +type TaskToolsServiceClient interface { + ListTaskTools(ctx context.Context, in *ListTaskToolsRequest, opts ...grpc.CallOption) (*ListTaskToolsResponse, error) + CallTaskTool(ctx context.Context, in *CallTaskToolRequest, opts ...grpc.CallOption) (*CallTaskToolResponse, error) + CloseTaskTools(ctx context.Context, in *CloseTaskToolsRequest, opts ...grpc.CallOption) (*CloseTaskToolsResponse, error) +} + +type taskToolsServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTaskToolsServiceClient(cc grpc.ClientConnInterface) TaskToolsServiceClient { + return &taskToolsServiceClient{cc} +} + +func (c *taskToolsServiceClient) ListTaskTools(ctx context.Context, in *ListTaskToolsRequest, opts ...grpc.CallOption) (*ListTaskToolsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListTaskToolsResponse) + err := c.cc.Invoke(ctx, TaskToolsService_ListTaskTools_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *taskToolsServiceClient) CallTaskTool(ctx context.Context, in *CallTaskToolRequest, opts ...grpc.CallOption) (*CallTaskToolResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CallTaskToolResponse) + err := c.cc.Invoke(ctx, TaskToolsService_CallTaskTool_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *taskToolsServiceClient) CloseTaskTools(ctx context.Context, in *CloseTaskToolsRequest, opts ...grpc.CallOption) (*CloseTaskToolsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CloseTaskToolsResponse) + err := c.cc.Invoke(ctx, TaskToolsService_CloseTaskTools_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TaskToolsServiceServer is the server API for TaskToolsService service. +// All implementations must embed UnimplementedTaskToolsServiceServer +// for forward compatibility. +// +// TaskToolsService executes central tools for a live task grant. Only the +// daemon calls it; identities, orgs and permissions are resolved by the server. +type TaskToolsServiceServer interface { + ListTaskTools(context.Context, *ListTaskToolsRequest) (*ListTaskToolsResponse, error) + CallTaskTool(context.Context, *CallTaskToolRequest) (*CallTaskToolResponse, error) + CloseTaskTools(context.Context, *CloseTaskToolsRequest) (*CloseTaskToolsResponse, error) + mustEmbedUnimplementedTaskToolsServiceServer() +} + +// UnimplementedTaskToolsServiceServer 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 UnimplementedTaskToolsServiceServer struct{} + +func (UnimplementedTaskToolsServiceServer) ListTaskTools(context.Context, *ListTaskToolsRequest) (*ListTaskToolsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ListTaskTools not implemented") +} +func (UnimplementedTaskToolsServiceServer) CallTaskTool(context.Context, *CallTaskToolRequest) (*CallTaskToolResponse, error) { + return nil, status.Error(codes.Unimplemented, "method CallTaskTool not implemented") +} +func (UnimplementedTaskToolsServiceServer) CloseTaskTools(context.Context, *CloseTaskToolsRequest) (*CloseTaskToolsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method CloseTaskTools not implemented") +} +func (UnimplementedTaskToolsServiceServer) mustEmbedUnimplementedTaskToolsServiceServer() {} +func (UnimplementedTaskToolsServiceServer) testEmbeddedByValue() {} + +// UnsafeTaskToolsServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TaskToolsServiceServer will +// result in compilation errors. +type UnsafeTaskToolsServiceServer interface { + mustEmbedUnimplementedTaskToolsServiceServer() +} + +func RegisterTaskToolsServiceServer(s grpc.ServiceRegistrar, srv TaskToolsServiceServer) { + // If the following call panics, it indicates UnimplementedTaskToolsServiceServer 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(&TaskToolsService_ServiceDesc, srv) +} + +func _TaskToolsService_ListTaskTools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTaskToolsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TaskToolsServiceServer).ListTaskTools(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TaskToolsService_ListTaskTools_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TaskToolsServiceServer).ListTaskTools(ctx, req.(*ListTaskToolsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TaskToolsService_CallTaskTool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CallTaskToolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TaskToolsServiceServer).CallTaskTool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TaskToolsService_CallTaskTool_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TaskToolsServiceServer).CallTaskTool(ctx, req.(*CallTaskToolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TaskToolsService_CloseTaskTools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CloseTaskToolsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TaskToolsServiceServer).CloseTaskTools(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TaskToolsService_CloseTaskTools_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TaskToolsServiceServer).CloseTaskTools(ctx, req.(*CloseTaskToolsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// TaskToolsService_ServiceDesc is the grpc.ServiceDesc for TaskToolsService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var TaskToolsService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gateway.v1.TaskToolsService", + HandlerType: (*TaskToolsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListTaskTools", + Handler: _TaskToolsService_ListTaskTools_Handler, + }, + { + MethodName: "CallTaskTool", + Handler: _TaskToolsService_CallTaskTool_Handler, + }, + { + MethodName: "CloseTaskTools", + Handler: _TaskToolsService_CloseTaskTools_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "gateway/v1/task_tools.proto", +}