diff --git a/apps/web/src/i18n/locales/en.json b/apps/web/src/i18n/locales/en.json index f6cc2560..26cc6e28 100644 --- a/apps/web/src/i18n/locales/en.json +++ b/apps/web/src/i18n/locales/en.json @@ -151,7 +151,7 @@ "toolContactsCount": "{count} contacts", "toolEmailCount": "{count} emails", "toolEmailAccounts": "{count} accounts", - "toolSubagentCount": "{count} subagents", + "toolSpawnCount": "{count} tasks", "unknownUser": "{platform} User", "files": "Files", "sessions": "Sessions", @@ -163,7 +163,8 @@ "untitledSession": "Untitled Session", "noSessions": "No sessions yet", "sessionTypeHeartbeat": "Heartbeat", - "sessionTypeSchedule": "Scheduled Task" + "sessionTypeSchedule": "Scheduled Task", + "sessionTypeSubagent": "Subagent" }, "models": { "title": "Models", @@ -565,7 +566,6 @@ "channels": "Platforms", "container": "Container", "mcp": "MCP", - "subagents": "Subagents", "heartbeat": "Heartbeat", "compaction": "Compaction", "schedule": "Schedule", @@ -1017,27 +1017,6 @@ "filterAll": "All", "expandContent": "Expand", "collapseContent": "Collapse" - }, - "subagents": { - "title": "Subagents", - "subtitle": "Manage autonomous subagents for this bot.", - "add": "Create Subagent", - "emptyTitle": "No Subagents", - "emptyDescription": "Click above to create a subagent", - "description": "Description", - "descriptionPlaceholder": "Enter subagent description", - "deleteConfirm": "Are you sure you want to delete this subagent?", - "deleteSuccess": "Subagent deleted", - "deleteFailed": "Failed to delete subagent", - "saveSuccess": "Subagent saved", - "saveFailed": "Failed to save subagent", - "loadFailed": "Failed to load subagents", - "viewContext": "View Context", - "contextTitle": "Subagent Context", - "contextEmpty": "No context messages", - "messagesCount": "{count} messages", - "usage": "Usage", - "skills": "Skills" } }, "usage": { diff --git a/apps/web/src/i18n/locales/zh.json b/apps/web/src/i18n/locales/zh.json index 6c56914c..95584c98 100644 --- a/apps/web/src/i18n/locales/zh.json +++ b/apps/web/src/i18n/locales/zh.json @@ -147,7 +147,7 @@ "toolContactsCount": "{count} 个联系人", "toolEmailCount": "{count} 封邮件", "toolEmailAccounts": "{count} 个账户", - "toolSubagentCount": "{count} 个子代理", + "toolSpawnCount": "{count} 个任务", "unknownUser": "{platform}用户", "files": "文件管理", "sessions": "会话", @@ -159,7 +159,8 @@ "untitledSession": "未命名会话", "noSessions": "暂无会话", "sessionTypeHeartbeat": "心跳", - "sessionTypeSchedule": "定时任务" + "sessionTypeSchedule": "定时任务", + "sessionTypeSubagent": "子智能体" }, "models": { "title": "模型", @@ -561,7 +562,6 @@ "channels": "平台", "container": "容器", "mcp": "MCP", - "subagents": "子智能体", "heartbeat": "心跳", "compaction": "上下文压缩", "schedule": "定时任务", @@ -1013,27 +1013,6 @@ "filterAll": "全部", "expandContent": "展开", "collapseContent": "收起" - }, - "subagents": { - "title": "子智能体", - "subtitle": "管理当前 Bot 的自治子智能体。", - "add": "创建子智能体", - "emptyTitle": "暂无子智能体", - "emptyDescription": "点击上方按钮创建子智能体", - "description": "描述", - "descriptionPlaceholder": "输入子智能体描述", - "deleteConfirm": "确定要删除这个子智能体吗?", - "deleteSuccess": "子智能体已删除", - "deleteFailed": "删除子智能体失败", - "saveSuccess": "子智能体已保存", - "saveFailed": "保存子智能体失败", - "loadFailed": "加载子智能体失败", - "viewContext": "查看上下文", - "contextTitle": "子智能体上下文", - "contextEmpty": "暂无上下文消息", - "messagesCount": "{count} 条消息", - "usage": "用量", - "skills": "技能" } }, "usage": { diff --git a/apps/web/src/pages/bots/components/bot-history.vue b/apps/web/src/pages/bots/components/bot-history.vue deleted file mode 100644 index 1bf3310d..00000000 --- a/apps/web/src/pages/bots/components/bot-history.vue +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - {{ $t('bots.history.title') }} - - - {{ $t('bots.history.messageCount', { count: messages.length }) }} - - - - - - {{ $t('bots.history.filterAll') }} - - - {{ $t('bots.history.role.user') }} - - - {{ $t('bots.history.role.assistant') }} - - - {{ $t('bots.history.role.tool') }} - - - {{ $t('bots.history.role.system') }} - - - - - {{ $t('common.refresh') }} - - - - - - - - {{ $t('common.loading') }} - - - - - - - - - {{ $t('bots.history.empty') }} - - - - - - - - - - - {{ paginationSummary }} - - - - - - - - - - - - - - - - - - - diff --git a/apps/web/src/pages/bots/components/bot-subagents.vue b/apps/web/src/pages/bots/components/bot-subagents.vue deleted file mode 100644 index 0e47fd80..00000000 --- a/apps/web/src/pages/bots/components/bot-subagents.vue +++ /dev/null @@ -1,460 +0,0 @@ - - - - - - - {{ $t('bots.subagents.title') }} - - - {{ $t('bots.subagents.subtitle') }} - - - - - {{ $t('bots.subagents.add') }} - - - - - - - {{ $t('common.loading') }} - - - - - - - - - {{ $t('bots.subagents.emptyTitle') }} - - - {{ $t('bots.subagents.emptyDescription') }} - - - - - - - - - - - {{ agent.name }} - - {{ agent.id }} - - - {{ agent.description || '-' }} - - - - - {{ $t('bots.subagents.viewContext') }} - - {{ agent.messages.length }} - - - - - - - - - - - - - - - - - - - {{ $t('bots.subagents.skills') }} - - - {{ skill }} - - - - - - - {{ $t('bots.subagents.usage') }} - - - {{ key }}: {{ val }} - - - - - - - - {{ $t('common.createdAt') }}: {{ formatDateTime(agent.created_at) }} - - - {{ $t('bots.subagents.messagesCount', { count: agent.messages.length }) }} - - - - - - - - - - - {{ isEditing ? $t('common.edit') : $t('bots.subagents.add') }} - - - - {{ $t('common.name') }} - - - - {{ $t('bots.subagents.description') }} - - - - - - - {{ $t('common.cancel') }} - - - - - {{ $t('common.save') }} - - - - - - - - - - - {{ $t('bots.subagents.contextTitle') }} - - {{ $t('bots.subagents.messagesCount', { count: contextMessages.length }) }} - - - - - - - - - {{ key }}: {{ val }} - - - - - - - - {{ $t('bots.subagents.contextEmpty') }} - - - - - - - - - {{ $t('common.cancel') }} - - - - - - - - - diff --git a/apps/web/src/pages/bots/detail.vue b/apps/web/src/pages/bots/detail.vue index e6c2aa7d..b4e818e5 100644 --- a/apps/web/src/pages/bots/detail.vue +++ b/apps/web/src/pages/bots/detail.vue @@ -241,11 +241,9 @@ import BotChannels from './components/bot-channels.vue' import BotMcp from './components/bot-mcp.vue' import BotMemory from './components/bot-memory.vue' import BotSkills from './components/bot-skills.vue' -import BotHistory from './components/bot-history.vue' import BotHeartbeat from './components/bot-heartbeat.vue' import BotCompaction from './components/bot-compaction.vue' import BotEmail from './components/bot-email.vue' -import BotSubagents from './components/bot-subagents.vue' import BotOverview from './components/bot-overview.vue' import BotSchedule from './components/bot-schedule.vue' import BotContainer from './components/bot-container.vue' @@ -286,11 +284,9 @@ const tabList = computed(() => { { value: 'terminal', label: 'bots.tabs.terminal', component: BotTerminal, params: { 'bot-id': bot_id } }, { value: 'files', label: 'bots.tabs.files', component: BotFiles, params: { 'bot-id': bot_id, 'bot-type': bot.value?.type } }, { value: 'mcp', label: 'bots.tabs.mcp', component: BotMcp, params: { 'bot-id': bot_id } }, - { value: 'subagents', label: 'bots.tabs.subagents', component: BotSubagents, params: { 'bot-id': bot_id } }, { value: 'heartbeat', label: 'bots.tabs.heartbeat', component: BotHeartbeat, params: { 'bot-id': bot_id } }, { value: 'compaction', label: 'bots.tabs.compaction', component: BotCompaction, params: { 'bot-id': bot_id } }, { value: 'schedule', label: 'bots.tabs.schedule', component: BotSchedule, params: { 'bot-id': bot_id } }, - { value: 'history', label: 'bots.tabs.history', component: BotHistory, params: { 'bot-id': bot_id } }, { value: 'skills', label: 'bots.tabs.skills', component: BotSkills, params: { 'bot-id': bot_id } }, { value: 'access', label: 'bots.tabs.access', component: BotAccess, params: { 'bot-id': bot_id, 'bot-type': bot.value?.type } }, { value: 'settings', label: 'bots.tabs.settings', component: BotSettings, params: { 'bot-id': bot_id, 'bot-type': bot.value?.type } } diff --git a/apps/web/src/pages/chat/components/session-sidebar.vue b/apps/web/src/pages/chat/components/session-sidebar.vue index 1d49f424..8968a548 100644 --- a/apps/web/src/pages/chat/components/session-sidebar.vue +++ b/apps/web/src/pages/chat/components/session-sidebar.vue @@ -145,6 +145,7 @@ function sessionIcon(session: SessionSummary): string[] { switch (session.type) { case 'heartbeat': return ['fas', 'heart-pulse'] case 'schedule': return ['fas', 'clock'] + case 'subagent': return ['fas', 'code-branch'] default: return ['fas', 'message'] } } @@ -153,6 +154,7 @@ function sessionIconClass(session: SessionSummary): string { switch (session.type) { case 'heartbeat': return 'text-rose-400' case 'schedule': return 'text-amber-400' + case 'subagent': return 'text-violet-400' default: return 'text-muted-foreground' } } @@ -195,6 +197,7 @@ function sessionDisplayLabel(session: SessionSummary): string { function sessionSubLabel(session: SessionSummary): string { if (session.type === 'heartbeat') return t('chat.sessionTypeHeartbeat') if (session.type === 'schedule') return t('chat.sessionTypeSchedule') + if (session.type === 'subagent') return t('chat.sessionTypeSubagent') if (!isIMSession(session)) return '' const meta = routeMeta(session) diff --git a/apps/web/src/pages/chat/components/tool-call-block.vue b/apps/web/src/pages/chat/components/tool-call-block.vue index 13ffca23..2a8569c7 100644 --- a/apps/web/src/pages/chat/components/tool-call-block.vue +++ b/apps/web/src/pages/chat/components/tool-call-block.vue @@ -107,9 +107,5 @@ const emailTools = new Set([ const browserTools = new Set(['browser_action', 'browser_observe']) -const subagentTools = new Set([ - 'query_subagent', - 'list_subagents', - 'delete_subagent', -]) +const subagentTools = new Set(['spawn']) diff --git a/apps/web/src/pages/chat/components/tool-call-subagent.vue b/apps/web/src/pages/chat/components/tool-call-subagent.vue index 4e3f56f6..a8384e4c 100644 --- a/apps/web/src/pages/chat/components/tool-call-subagent.vue +++ b/apps/web/src/pages/chat/components/tool-call-subagent.vue @@ -7,46 +7,18 @@ :class="block.done ? 'text-green-600 dark:text-green-400' : 'animate-spin text-muted-foreground'" /> - - - - - {{ name }} - - - {{ query }} - - - - - - - {{ block.toolName }} - - - {{ deleteId }} - - - + + spawn + - {{ $t('chat.toolSubagentCount', { count: subagentCount }) }} + {{ $t('chat.toolSpawnCount', { count: taskCount }) }} - + + + + #{{ idx + 1 }} + {{ task }} + + + + @@ -78,7 +66,39 @@ {{ $t('chat.toolResult') }} - {{ subagentResult }} + + + + + #{{ idx + 1 }} + + {{ result.task }} + + + {{ result.text }} + + {{ result.error }} + + + @@ -89,40 +109,38 @@ import { ref, computed } from 'vue' import { Badge, Collapsible, CollapsibleTrigger, CollapsibleContent } from '@memoh/ui' import type { ToolCallBlock } from '@/store/chat-list' +interface SpawnTaskResult { + task?: string + session_id?: string + text?: string + success?: boolean + error?: string +} + const props = defineProps<{ block: ToolCallBlock }>() const resultOpen = ref(false) -const name = computed(() => { +const tasks = computed(() => { const input = props.block.input as Record | undefined - return (input?.name as string) ?? '' + const t = input?.tasks + return Array.isArray(t) ? (t as string[]) : [] }) -const query = computed(() => { - const input = props.block.input as Record | undefined - return (input?.query as string) ?? '' +const taskCount = computed(() => { + return tasks.value.length || null }) -const deleteId = computed(() => { - const input = props.block.input as Record | undefined - return (input?.id as string) ?? '' -}) - -function resolveResult() { +function resolveResult(): Record | null { if (!props.block.result) return null const result = props.block.result as Record return (result.structuredContent as Record) ?? result } -const subagentCount = computed(() => { +const results = computed(() => { const r = resolveResult() - if (!r) return null - const items = r.items as unknown[] | undefined - return Array.isArray(items) ? items.length : null -}) - -const subagentResult = computed(() => { - const r = resolveResult() - return (r?.result as string) ?? '' + if (!r) return [] + const items = r.results + return Array.isArray(items) ? (items as SpawnTaskResult[]) : [] }) diff --git a/cmd/agent/main.go b/cmd/agent/main.go index 552666e4..767431ec 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/main.go @@ -78,7 +78,6 @@ import ( sessionpkg "github.com/memohai/memoh/internal/session" "github.com/memohai/memoh/internal/settings" "github.com/memohai/memoh/internal/storage/providers/containerfs" - "github.com/memohai/memoh/internal/subagent" ttspkg "github.com/memohai/memoh/internal/tts" ttsedge "github.com/memohai/memoh/internal/tts/adapter/edge" "github.com/memohai/memoh/internal/version" @@ -168,7 +167,6 @@ func runServe() { browsercontexts.NewService, policy.NewService, mcp.NewConnectionService, - subagent.NewService, conversation.NewService, identities.NewService, bind.NewService, @@ -235,7 +233,6 @@ func runServe() { provideServerHandler(handlers.NewScheduleHandler), provideServerHandler(handlers.NewHeartbeatHandler), provideServerHandler(handlers.NewCompactionHandler), - provideServerHandler(handlers.NewSubagentHandler), provideServerHandler(handlers.NewChannelHandler), provideServerHandler(feishu.NewWebhookServerHandler), provideServerHandler(provideUsersHandler), @@ -433,8 +430,16 @@ func provideAgent(log *slog.Logger, manager *workspace.Manager) *agentpkg.Agent }) } -func injectToolProviders(a *agentpkg.Agent, providers []agenttools.ToolProvider) { +func injectToolProviders(a *agentpkg.Agent, msgService *message.DBService, providers []agenttools.ToolProvider) { a.SetToolProviders(providers) + for _, p := range providers { + if sp, ok := p.(*agenttools.SpawnProvider); ok { + sp.SetAgent(agentpkg.NewSpawnAdapter(a)) + sp.SetMessageService(msgService) + sp.SetSystemPromptFunc(agentpkg.SpawnSystemPrompt) + sp.SetModelCreator(agentpkg.SpawnModelCreatorFunc()) + } + } } func provideChatResolver(log *slog.Logger, a *agentpkg.Agent, modelsService *models.Service, queries *dbsqlc.Queries, chatService *conversation.Service, msgService *message.DBService, settingsService *settings.Service, mediaService *media.Service, containerdHandler *handlers.ContainerdHandler, memoryRegistry *memprovider.Registry, sessionService *sessionpkg.Service, eventHub *event.Hub, compactionService *compaction.Service) *flow.Resolver { @@ -494,7 +499,6 @@ func provideChannelRouter( mediaService *media.Service, ttsService *ttspkg.Service, settingsService *settings.Service, - subagentService *subagent.Service, scheduleService *schedule.Service, mcpConnService *mcp.ConnectionService, modelsService *models.Service, @@ -530,7 +534,6 @@ func provideChannelRouter( processor.SetCommandHandler(command.NewHandler( log, &command.BotMemberRoleAdapter{BotService: botService}, - subagentService, scheduleService, settingsService, mcpConnService, @@ -595,7 +598,7 @@ func provideToolGatewayService(log *slog.Logger, fedGateway *handlers.MCPFederat return svc } -func provideToolProviders(log *slog.Logger, cfg config.Config, channelManager *channel.Manager, registry *channel.Registry, routeService *route.DBService, scheduleService *schedule.Service, settingsService *settings.Service, searchProviderService *searchproviders.Service, manager *workspace.Manager, mediaService *media.Service, memoryRegistry *memprovider.Registry, emailService *emailpkg.Service, emailManager *emailpkg.Manager, fedGateway *handlers.MCPFederationGateway, mcpConnService *mcp.ConnectionService, subagentService *subagent.Service, modelsService *models.Service, browserContextService *browsercontexts.Service, queries *dbsqlc.Queries, ttsService *ttspkg.Service, sessionService *sessionpkg.Service) []agenttools.ToolProvider { +func provideToolProviders(log *slog.Logger, cfg config.Config, channelManager *channel.Manager, registry *channel.Registry, routeService *route.DBService, scheduleService *schedule.Service, settingsService *settings.Service, searchProviderService *searchproviders.Service, manager *workspace.Manager, mediaService *media.Service, memoryRegistry *memprovider.Registry, emailService *emailpkg.Service, emailManager *emailpkg.Manager, fedGateway *handlers.MCPFederationGateway, mcpConnService *mcp.ConnectionService, modelsService *models.Service, browserContextService *browsercontexts.Service, queries *dbsqlc.Queries, ttsService *ttspkg.Service, sessionService *sessionpkg.Service) []agenttools.ToolProvider { var assetResolver messaging.AssetResolver if mediaService != nil { assetResolver = &mediaAssetResolverAdapter{media: mediaService} @@ -611,7 +614,7 @@ func provideToolProviders(log *slog.Logger, cfg config.Config, channelManager *c agenttools.NewReadMediaProvider(log, manager, config.DefaultDataMount), agenttools.NewEmailProvider(log, emailService, emailManager), agenttools.NewWebFetchProvider(log), - agenttools.NewSubagentProvider(log, subagentService, settingsService, modelsService, queries, ""), + agenttools.NewSpawnProvider(log, settingsService, modelsService, queries, sessionService), agenttools.NewSkillProvider(log), agenttools.NewBrowserProvider(log, settingsService, browserContextService, manager, cfg.BrowserGateway), agenttools.NewTTSProvider(log, settingsService, ttsService, channelManager, registry), diff --git a/cmd/memoh/serve.go b/cmd/memoh/serve.go index ae91c2df..8bb2024c 100644 --- a/cmd/memoh/serve.go +++ b/cmd/memoh/serve.go @@ -79,7 +79,6 @@ import ( sessionpkg "github.com/memohai/memoh/internal/session" "github.com/memohai/memoh/internal/settings" "github.com/memohai/memoh/internal/storage/providers/containerfs" - "github.com/memohai/memoh/internal/subagent" ttspkg "github.com/memohai/memoh/internal/tts" ttsedge "github.com/memohai/memoh/internal/tts/adapter/edge" "github.com/memohai/memoh/internal/version" @@ -108,7 +107,6 @@ func runServe() { searchproviders.NewService, policy.NewService, mcp.NewConnectionService, - subagent.NewService, conversation.NewService, identities.NewService, bind.NewService, @@ -161,7 +159,6 @@ func runServe() { provideServerHandler(handlers.NewScheduleHandler), provideServerHandler(handlers.NewHeartbeatHandler), provideServerHandler(handlers.NewCompactionHandler), - provideServerHandler(handlers.NewSubagentHandler), provideServerHandler(handlers.NewChannelHandler), provideServerHandler(feishu.NewWebhookServerHandler), provideServerHandler(provideUsersHandler), @@ -357,8 +354,16 @@ func provideAgent(log *slog.Logger, manager *workspace.Manager) *agentpkg.Agent }) } -func injectToolProviders(a *agentpkg.Agent, providers []agenttools.ToolProvider) { +func injectToolProviders(a *agentpkg.Agent, msgService *message.DBService, providers []agenttools.ToolProvider) { a.SetToolProviders(providers) + for _, p := range providers { + if sp, ok := p.(*agenttools.SpawnProvider); ok { + sp.SetAgent(agentpkg.NewSpawnAdapter(a)) + sp.SetMessageService(msgService) + sp.SetSystemPromptFunc(agentpkg.SpawnSystemPrompt) + sp.SetModelCreator(agentpkg.SpawnModelCreatorFunc()) + } + } } func provideChatResolver(log *slog.Logger, a *agentpkg.Agent, modelsService *models.Service, queries *dbsqlc.Queries, chatService *conversation.Service, msgService *message.DBService, settingsService *settings.Service, mediaService *media.Service, containerdHandler *handlers.ContainerdHandler, memoryRegistry *memprovider.Registry, sessionService *sessionpkg.Service, eventHub *event.Hub, compactionService *compaction.Service) *flow.Resolver { @@ -392,7 +397,7 @@ func provideChannelRegistry(log *slog.Logger, hub *local.RouteHub, mediaService return registry } -func provideChannelRouter(log *slog.Logger, registry *channel.Registry, hub *local.RouteHub, routeService *route.DBService, sessionService *sessionpkg.Service, msgService *message.DBService, resolver *flow.Resolver, identityService *identities.Service, botService *bots.Service, aclService *acl.Service, policyService *policy.Service, bindService *bind.Service, mediaService *media.Service, ttsService *ttspkg.Service, settingsService *settings.Service, subagentService *subagent.Service, scheduleService *schedule.Service, mcpConnService *mcp.ConnectionService, modelsService *models.Service, providersService *providers.Service, memProvService *memprovider.Service, searchProvService *searchproviders.Service, browserCtxService *browsercontexts.Service, emailService *emailpkg.Service, emailOutboxService *emailpkg.OutboxService, heartbeatService *heartbeat.Service, queries *dbsqlc.Queries, containerdHandler *handlers.ContainerdHandler, manager *workspace.Manager, rc *boot.RuntimeConfig) *inbound.ChannelInboundProcessor { +func provideChannelRouter(log *slog.Logger, registry *channel.Registry, hub *local.RouteHub, routeService *route.DBService, sessionService *sessionpkg.Service, msgService *message.DBService, resolver *flow.Resolver, identityService *identities.Service, botService *bots.Service, aclService *acl.Service, policyService *policy.Service, bindService *bind.Service, mediaService *media.Service, ttsService *ttspkg.Service, settingsService *settings.Service, scheduleService *schedule.Service, mcpConnService *mcp.ConnectionService, modelsService *models.Service, providersService *providers.Service, memProvService *memprovider.Service, searchProvService *searchproviders.Service, browserCtxService *browsercontexts.Service, emailService *emailpkg.Service, emailOutboxService *emailpkg.OutboxService, heartbeatService *heartbeat.Service, queries *dbsqlc.Queries, containerdHandler *handlers.ContainerdHandler, manager *workspace.Manager, rc *boot.RuntimeConfig) *inbound.ChannelInboundProcessor { adapter, ok := registry.Get(qq.Type) if !ok { panic("qq adapter not registered") @@ -412,7 +417,6 @@ func provideChannelRouter(log *slog.Logger, registry *channel.Registry, hub *loc processor.SetCommandHandler(command.NewHandler( log, &command.BotMemberRoleAdapter{BotService: botService}, - subagentService, scheduleService, settingsService, mcpConnService, @@ -473,7 +477,7 @@ func provideToolGatewayService(log *slog.Logger, fedGateway *handlers.MCPFederat return svc } -func provideToolProviders(log *slog.Logger, cfg config.Config, channelManager *channel.Manager, registry *channel.Registry, routeService *route.DBService, scheduleService *schedule.Service, settingsService *settings.Service, searchProviderService *searchproviders.Service, manager *workspace.Manager, mediaService *media.Service, memoryRegistry *memprovider.Registry, emailService *emailpkg.Service, emailManager *emailpkg.Manager, fedGateway *handlers.MCPFederationGateway, mcpConnService *mcp.ConnectionService, subagentService *subagent.Service, modelsService *models.Service, browserContextService *browsercontexts.Service, queries *dbsqlc.Queries, ttsService *ttspkg.Service, sessionService *sessionpkg.Service) []agenttools.ToolProvider { +func provideToolProviders(log *slog.Logger, cfg config.Config, channelManager *channel.Manager, registry *channel.Registry, routeService *route.DBService, scheduleService *schedule.Service, settingsService *settings.Service, searchProviderService *searchproviders.Service, manager *workspace.Manager, mediaService *media.Service, memoryRegistry *memprovider.Registry, emailService *emailpkg.Service, emailManager *emailpkg.Manager, fedGateway *handlers.MCPFederationGateway, mcpConnService *mcp.ConnectionService, modelsService *models.Service, browserContextService *browsercontexts.Service, queries *dbsqlc.Queries, ttsService *ttspkg.Service, sessionService *sessionpkg.Service) []agenttools.ToolProvider { var assetResolver messaging.AssetResolver if mediaService != nil { assetResolver = &mediaAssetResolverAdapter{media: mediaService} @@ -489,7 +493,7 @@ func provideToolProviders(log *slog.Logger, cfg config.Config, channelManager *c agenttools.NewReadMediaProvider(log, manager, config.DefaultDataMount), agenttools.NewEmailProvider(log, emailService, emailManager), agenttools.NewWebFetchProvider(log), - agenttools.NewSubagentProvider(log, subagentService, settingsService, modelsService, queries, ""), + agenttools.NewSpawnProvider(log, settingsService, modelsService, queries, sessionService), agenttools.NewSkillProvider(log), agenttools.NewBrowserProvider(log, settingsService, browserContextService, manager, cfg.BrowserGateway), agenttools.NewTTSProvider(log, settingsService, ttsService, channelManager, registry), @@ -603,7 +607,6 @@ var ( "/schedule", "/bind", "/preauth", - "/subagents", "/ping", "/health", } diff --git a/db/migrations/0001_init.up.sql b/db/migrations/0001_init.up.sql index 14987937..1075eb64 100644 --- a/db/migrations/0001_init.up.sql +++ b/db/migrations/0001_init.up.sql @@ -343,9 +343,10 @@ CREATE TABLE IF NOT EXISTS bot_sessions ( bot_id UUID NOT NULL REFERENCES bots(id) ON DELETE CASCADE, route_id UUID REFERENCES bot_channel_routes(id) ON DELETE SET NULL, channel_type TEXT, - type TEXT NOT NULL DEFAULT 'chat' CHECK (type IN ('chat', 'heartbeat', 'schedule')), + type TEXT NOT NULL DEFAULT 'chat' CHECK (type IN ('chat', 'heartbeat', 'schedule', 'subagent')), title TEXT NOT NULL DEFAULT '', metadata JSONB NOT NULL DEFAULT '{}'::jsonb, + parent_session_id UUID REFERENCES bot_sessions(id) ON DELETE SET NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), updated_at TIMESTAMPTZ NOT NULL DEFAULT now(), deleted_at TIMESTAMPTZ @@ -354,6 +355,7 @@ CREATE TABLE IF NOT EXISTS bot_sessions ( CREATE INDEX IF NOT EXISTS idx_bot_sessions_bot_id ON bot_sessions(bot_id); CREATE INDEX IF NOT EXISTS idx_bot_sessions_route_id ON bot_sessions(route_id); CREATE INDEX IF NOT EXISTS idx_bot_sessions_bot_active ON bot_sessions(bot_id, deleted_at); +CREATE INDEX IF NOT EXISTS idx_bot_sessions_parent ON bot_sessions(parent_session_id) WHERE parent_session_id IS NOT NULL; -- Add FK from routes to sessions (deferred to avoid circular dependency during CREATE). ALTER TABLE bot_channel_routes @@ -465,25 +467,6 @@ CREATE TABLE IF NOT EXISTS schedule ( CREATE INDEX IF NOT EXISTS idx_schedule_bot_id ON schedule(bot_id); CREATE INDEX IF NOT EXISTS idx_schedule_enabled ON schedule(enabled); -CREATE TABLE IF NOT EXISTS subagents ( - id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - name TEXT NOT NULL, - description TEXT NOT NULL, - created_at TIMESTAMPTZ NOT NULL DEFAULT now(), - updated_at TIMESTAMPTZ NOT NULL DEFAULT now(), - deleted BOOLEAN NOT NULL DEFAULT false, - deleted_at TIMESTAMPTZ, - bot_id UUID NOT NULL REFERENCES bots(id) ON DELETE CASCADE, - messages JSONB NOT NULL DEFAULT '[]'::jsonb, - metadata JSONB NOT NULL DEFAULT '{}'::jsonb, - skills JSONB NOT NULL DEFAULT '[]'::jsonb, - usage JSONB NOT NULL DEFAULT '{}'::jsonb, - CONSTRAINT subagents_name_unique UNIQUE (bot_id, name) -); - -CREATE INDEX IF NOT EXISTS idx_subagents_bot_id ON subagents(bot_id); -CREATE INDEX IF NOT EXISTS idx_subagents_deleted ON subagents(deleted); - -- storage_providers: pluggable object storage backends CREATE TABLE IF NOT EXISTS storage_providers ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), diff --git a/db/migrations/0012_subagent_usage.down.sql b/db/migrations/0012_subagent_usage.down.sql index d55faa5f..204e479a 100644 --- a/db/migrations/0012_subagent_usage.down.sql +++ b/db/migrations/0012_subagent_usage.down.sql @@ -1,5 +1,2 @@ -- 0012_subagent_usage (rollback) --- Remove usage column from subagents table. - -ALTER TABLE subagents DROP COLUMN IF EXISTS usage; - +-- (no-op: subagents table removed in 0043) diff --git a/db/migrations/0012_subagent_usage.up.sql b/db/migrations/0012_subagent_usage.up.sql index 717c97aa..63d6d959 100644 --- a/db/migrations/0012_subagent_usage.up.sql +++ b/db/migrations/0012_subagent_usage.up.sql @@ -1,5 +1,2 @@ -- 0012_subagent_usage --- Add usage JSONB column to subagents table for tracking cumulative token usage. - -ALTER TABLE subagents ADD COLUMN IF NOT EXISTS usage JSONB NOT NULL DEFAULT '{}'::jsonb; - +-- (no-op: subagents table removed in 0043) diff --git a/db/migrations/0043_drop_subagents_add_parent_session.down.sql b/db/migrations/0043_drop_subagents_add_parent_session.down.sql new file mode 100644 index 00000000..6386f055 --- /dev/null +++ b/db/migrations/0043_drop_subagents_add_parent_session.down.sql @@ -0,0 +1,32 @@ +-- 0043_drop_subagents_add_parent_session (rollback) +-- Re-create the subagents table and remove parent_session_id from bot_sessions. + +DROP INDEX IF EXISTS idx_bot_sessions_parent; + +ALTER TABLE bot_sessions + DROP COLUMN IF EXISTS parent_session_id; + +ALTER TABLE bot_sessions + DROP CONSTRAINT IF EXISTS bot_sessions_type_check; + +ALTER TABLE bot_sessions + ADD CONSTRAINT bot_sessions_type_check CHECK (type IN ('chat', 'heartbeat', 'schedule')); + +CREATE TABLE IF NOT EXISTS subagents ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + name TEXT NOT NULL, + description TEXT NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT now(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT now(), + deleted BOOLEAN NOT NULL DEFAULT false, + deleted_at TIMESTAMPTZ, + bot_id UUID NOT NULL REFERENCES bots(id) ON DELETE CASCADE, + messages JSONB NOT NULL DEFAULT '[]'::jsonb, + metadata JSONB NOT NULL DEFAULT '{}'::jsonb, + skills JSONB NOT NULL DEFAULT '[]'::jsonb, + usage JSONB NOT NULL DEFAULT '{}'::jsonb, + CONSTRAINT subagents_name_unique UNIQUE (bot_id, name) +); + +CREATE INDEX IF NOT EXISTS idx_subagents_bot_id ON subagents(bot_id); +CREATE INDEX IF NOT EXISTS idx_subagents_deleted ON subagents(deleted); diff --git a/db/migrations/0043_drop_subagents_add_parent_session.up.sql b/db/migrations/0043_drop_subagents_add_parent_session.up.sql new file mode 100644 index 00000000..18150ccb --- /dev/null +++ b/db/migrations/0043_drop_subagents_add_parent_session.up.sql @@ -0,0 +1,15 @@ +-- 0043_drop_subagents_add_parent_session +-- Drop the subagents table (no longer needed) and add parent_session_id to bot_sessions for subagent session tracking. + +DROP TABLE IF EXISTS subagents; + +ALTER TABLE bot_sessions + DROP CONSTRAINT IF EXISTS bot_sessions_type_check; + +ALTER TABLE bot_sessions + ADD CONSTRAINT bot_sessions_type_check CHECK (type IN ('chat', 'heartbeat', 'schedule', 'subagent')); + +ALTER TABLE bot_sessions + ADD COLUMN IF NOT EXISTS parent_session_id UUID REFERENCES bot_sessions(id) ON DELETE SET NULL; + +CREATE INDEX IF NOT EXISTS idx_bot_sessions_parent ON bot_sessions(parent_session_id) WHERE parent_session_id IS NOT NULL; diff --git a/db/queries/sessions.sql b/db/queries/sessions.sql index e849b828..8d10be9f 100644 --- a/db/queries/sessions.sql +++ b/db/queries/sessions.sql @@ -1,6 +1,6 @@ -- name: CreateSession :one INSERT INTO bot_sessions ( - bot_id, route_id, channel_type, type, title, metadata + bot_id, route_id, channel_type, type, title, metadata, parent_session_id ) VALUES ( sqlc.arg(bot_id), @@ -8,7 +8,8 @@ VALUES ( sqlc.narg(channel_type)::text, sqlc.arg(type), sqlc.arg(title), - sqlc.arg(metadata) + sqlc.arg(metadata), + sqlc.narg(parent_session_id)::uuid ) RETURNING *; @@ -66,6 +67,13 @@ JOIN bot_channel_routes r ON r.active_session_id = s.id WHERE r.id = sqlc.arg(route_id) AND s.deleted_at IS NULL; +-- name: ListSubagentSessionsByParent :many +SELECT * +FROM bot_sessions +WHERE parent_session_id = sqlc.arg(parent_session_id) + AND deleted_at IS NULL +ORDER BY created_at DESC; + -- name: SoftDeleteSessionsByBot :exec UPDATE bot_sessions SET deleted_at = now(), updated_at = now() diff --git a/db/queries/subagents.sql b/db/queries/subagents.sql deleted file mode 100644 index 979d3369..00000000 --- a/db/queries/subagents.sql +++ /dev/null @@ -1,58 +0,0 @@ --- name: CreateSubagent :one -INSERT INTO subagents (name, description, bot_id, messages, metadata, skills) -VALUES ($1, $2, $3, $4, $5, $6) -RETURNING id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage; - --- name: GetSubagentByID :one -SELECT id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage -FROM subagents -WHERE id = $1 AND deleted = false; - --- name: GetSubagentByBotAndName :one -SELECT id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage -FROM subagents -WHERE bot_id = $1 AND name = $2 AND deleted = false; - --- name: ListSubagentsByBot :many -SELECT id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage -FROM subagents -WHERE bot_id = $1 AND deleted = false -ORDER BY created_at DESC; - --- name: UpdateSubagent :one -UPDATE subagents -SET name = $2, - description = $3, - metadata = $4, - updated_at = now() -WHERE id = $1 AND deleted = false -RETURNING id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage; - --- name: UpdateSubagentMessages :one -UPDATE subagents -SET messages = $2, - updated_at = now() -WHERE id = $1 AND deleted = false -RETURNING id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage; - --- name: UpdateSubagentMessagesAndUsage :one -UPDATE subagents -SET messages = $2, - usage = $3, - updated_at = now() -WHERE id = $1 AND deleted = false -RETURNING id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage; - --- name: UpdateSubagentSkills :one -UPDATE subagents -SET skills = $2, - updated_at = now() -WHERE id = $1 AND deleted = false -RETURNING id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage; - --- name: SoftDeleteSubagent :exec -UPDATE subagents -SET deleted = true, - deleted_at = now(), - updated_at = now() -WHERE id = $1 AND deleted = false; diff --git a/db/queries/token_usage.sql b/db/queries/token_usage.sql index d493a696..719fdd8a 100644 --- a/db/queries/token_usage.sql +++ b/db/queries/token_usage.sql @@ -1,6 +1,9 @@ -- name: GetTokenUsageByDayAndType :many SELECT - COALESCE(s.type, 'chat')::text AS session_type, + COALESCE( + CASE WHEN s.type = 'subagent' THEN COALESCE(ps.type, 'chat') ELSE s.type END, + 'chat' + )::text AS session_type, date_trunc('day', m.created_at)::date AS day, COALESCE(SUM((m.usage->>'inputTokens')::bigint), 0)::bigint AS input_tokens, COALESCE(SUM((m.usage->>'outputTokens')::bigint), 0)::bigint AS output_tokens, @@ -9,6 +12,7 @@ SELECT COALESCE(SUM((m.usage->'outputTokenDetails'->>'reasoningTokens')::bigint), 0)::bigint AS reasoning_tokens FROM bot_history_messages m LEFT JOIN bot_sessions s ON s.id = m.session_id +LEFT JOIN bot_sessions ps ON ps.id = s.parent_session_id WHERE m.bot_id = sqlc.arg(bot_id) AND m.usage IS NOT NULL AND m.created_at >= sqlc.arg(from_time) diff --git a/internal/agent/agent.go b/internal/agent/agent.go index 5909452b..ad0a33b7 100644 --- a/internal/agent/agent.go +++ b/internal/agent/agent.go @@ -417,6 +417,7 @@ func (a *Agent) assembleTools(ctx context.Context, cfg RunConfig) ([]sdk.Tool, e session := tools.SessionContext{ BotID: cfg.Identity.BotID, ChatID: cfg.Identity.ChatID, + SessionID: cfg.Identity.SessionID, ChannelIdentityID: cfg.Identity.ChannelIdentityID, SessionToken: cfg.Identity.SessionToken, CurrentPlatform: cfg.Identity.CurrentPlatform, diff --git a/internal/agent/prompt.go b/internal/agent/prompt.go index 33828d9e..a685c4c7 100644 --- a/internal/agent/prompt.go +++ b/internal/agent/prompt.go @@ -16,9 +16,9 @@ var ( systemChatTmpl string systemHeartbeatTmpl string systemScheduleTmpl string + systemSubagentTmpl string scheduleTmpl string heartbeatTmpl string - subagentTmpl string includes map[string]string ) @@ -29,9 +29,9 @@ func init() { systemChatTmpl = mustReadPrompt("prompts/system_chat.md") systemHeartbeatTmpl = mustReadPrompt("prompts/system_heartbeat.md") systemScheduleTmpl = mustReadPrompt("prompts/system_schedule.md") + systemSubagentTmpl = mustReadPrompt("prompts/system_subagent.md") scheduleTmpl = mustReadPrompt("prompts/schedule.md") heartbeatTmpl = mustReadPrompt("prompts/heartbeat.md") - subagentTmpl = mustReadPrompt("prompts/subagent.md") includes = map[string]string{ "_memory": mustReadPrompt("prompts/_memory.md"), @@ -44,6 +44,7 @@ func init() { systemChatTmpl = resolveIncludes(systemChatTmpl) systemHeartbeatTmpl = resolveIncludes(systemHeartbeatTmpl) systemScheduleTmpl = resolveIncludes(systemScheduleTmpl) + systemSubagentTmpl = resolveIncludes(systemSubagentTmpl) } func mustReadPrompt(name string) string { @@ -84,6 +85,8 @@ func selectSystemTemplate(sessionType string) string { return systemHeartbeatTmpl case "schedule": return systemScheduleTmpl + case "subagent": + return systemSubagentTmpl default: return systemChatTmpl } @@ -169,14 +172,6 @@ func GenerateHeartbeatPrompt(interval int, checklist string, lastHeartbeatAt str }) } -// GenerateSubagentSystemPrompt builds the system prompt for a subagent. -func GenerateSubagentSystemPrompt(name, description string) string { - return render(subagentTmpl, map[string]string{ - "name": name, - "description": description, - }) -} - func buildSkillsSection(skills []SkillEntry) string { if len(skills) == 0 { return "" diff --git a/internal/agent/prompts/_subagent.md b/internal/agent/prompts/_subagent.md index 92e73690..01688226 100644 --- a/internal/agent/prompts/_subagent.md +++ b/internal/agent/prompts/_subagent.md @@ -1,4 +1,9 @@ -## Subagent +## Subagents -For complex tasks (create a website, research a topic, generate a report, etc.), you can create a subagent. -`description` will be the system prompt for the subagent. +Use `spawn` to run tasks in parallel. Each subagent has file, exec, and web tools. + +``` +spawn({ tasks: ["task one", "task two"] }) +``` + +Use when you have independent subtasks that benefit from parallel execution. Don't use for simple single-step work — just do it directly. diff --git a/internal/agent/prompts/subagent.md b/internal/agent/prompts/subagent.md deleted file mode 100644 index 5fec6f6c..00000000 --- a/internal/agent/prompts/subagent.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -name: {{name}} ---- - -{{description}} diff --git a/internal/agent/prompts/system_subagent.md b/internal/agent/prompts/system_subagent.md new file mode 100644 index 00000000..edd11fab --- /dev/null +++ b/internal/agent/prompts/system_subagent.md @@ -0,0 +1,20 @@ +You are a **subagent** — a task-focused worker spawned by a parent agent. Complete the given task and report the result concisely. + +{{include:_tools}} + +## Available Capabilities + +You have access to: +- **File operations**: read, write, list, edit files in the workspace +- **Command execution**: run shell commands +- **Web search**: search the internet for information +- **Web fetch**: retrieve content from URLs + +## Rules + +- Focus on completing the assigned task efficiently +- Report results concisely — the parent agent will synthesize your output +- Do NOT attempt to send messages or interact with chat channels +- Do NOT create schedules or manage memory +- Keep private data private +- Don't run destructive commands without necessity diff --git a/internal/agent/spawn_adapter.go b/internal/agent/spawn_adapter.go new file mode 100644 index 00000000..e411bacf --- /dev/null +++ b/internal/agent/spawn_adapter.go @@ -0,0 +1,81 @@ +package agent + +import ( + "context" + + sdk "github.com/memohai/twilight-ai/sdk" + + "github.com/memohai/memoh/internal/agent/tools" +) + +// SpawnAdapter wraps *Agent to satisfy tools.SpawnAgent without creating +// an import cycle (tools -> agent). +type SpawnAdapter struct { + agent *Agent +} + +// NewSpawnAdapter creates a SpawnAdapter from the given Agent. +func NewSpawnAdapter(a *Agent) *SpawnAdapter { + return &SpawnAdapter{agent: a} +} + +func (s *SpawnAdapter) Generate(ctx context.Context, cfg tools.SpawnRunConfig) (*tools.SpawnResult, error) { + messages := cfg.Messages + if cfg.Query != "" { + messages = append(messages, sdk.Message{ + Role: sdk.MessageRoleUser, + Content: []sdk.MessagePart{sdk.TextPart{Text: cfg.Query}}, + }) + } + + rc := RunConfig{ + Model: cfg.Model, + System: cfg.System, + Query: cfg.Query, + SessionType: cfg.SessionType, + Messages: messages, + ReasoningEffort: cfg.ReasoningEffort, + Identity: SessionContext{ + BotID: cfg.Identity.BotID, + ChatID: cfg.Identity.ChatID, + SessionID: cfg.Identity.SessionID, + ChannelIdentityID: cfg.Identity.ChannelIdentityID, + CurrentPlatform: cfg.Identity.CurrentPlatform, + SessionToken: cfg.Identity.SessionToken, + IsSubagent: cfg.Identity.IsSubagent, + }, + LoopDetection: LoopDetectionConfig{ + Enabled: cfg.LoopDetection.Enabled, + }, + } + + result, err := s.agent.Generate(ctx, rc) + if err != nil { + return nil, err + } + + return &tools.SpawnResult{ + Messages: result.Messages, + Text: result.Text, + Usage: result.Usage, + }, nil +} + +// SpawnSystemPrompt returns the system prompt for a given session type. +func SpawnSystemPrompt(sessionType string) string { + return GenerateSystemPrompt(SystemPromptParams{ + SessionType: sessionType, + }) +} + +// SpawnModelCreatorFunc returns a tools.ModelCreator that delegates to agent.CreateModel. +func SpawnModelCreatorFunc() tools.ModelCreator { + return func(modelID, clientType, apiKey, baseURL string) *sdk.Model { + return CreateModel(ModelConfig{ + ModelID: modelID, + ClientType: clientType, + APIKey: apiKey, + BaseURL: baseURL, + }) + } +} diff --git a/internal/agent/tools/browser.go b/internal/agent/tools/browser.go index 2ebf6c56..a9794491 100644 --- a/internal/agent/tools/browser.go +++ b/internal/agent/tools/browser.go @@ -45,7 +45,7 @@ func NewBrowserProvider(log *slog.Logger, settingsSvc *settings.Service, browser } func (p *BrowserProvider) Tools(ctx context.Context, session SessionContext) ([]sdk.Tool, error) { - if p.settings == nil || p.browserContexts == nil { + if session.IsSubagent || p.settings == nil || p.browserContexts == nil { return nil, nil } botID := strings.TrimSpace(session.BotID) diff --git a/internal/agent/tools/contacts.go b/internal/agent/tools/contacts.go index 1ce93449..a710f9d0 100644 --- a/internal/agent/tools/contacts.go +++ b/internal/agent/tools/contacts.go @@ -27,7 +27,7 @@ func NewContactsProvider(log *slog.Logger, routeService route.Service) *Contacts } func (p *ContactsProvider) Tools(_ context.Context, session SessionContext) ([]sdk.Tool, error) { - if p.routeService == nil { + if session.IsSubagent || p.routeService == nil { return nil, nil } sess := session diff --git a/internal/agent/tools/email.go b/internal/agent/tools/email.go index 0df4cbe4..c1b49593 100644 --- a/internal/agent/tools/email.go +++ b/internal/agent/tools/email.go @@ -28,6 +28,9 @@ func NewEmailProvider(log *slog.Logger, service *email.Service, manager *email.M } func (p *EmailProvider) Tools(_ context.Context, session SessionContext) ([]sdk.Tool, error) { + if session.IsSubagent { + return nil, nil + } sess := session return []sdk.Tool{ { diff --git a/internal/agent/tools/federation.go b/internal/agent/tools/federation.go index 3080180c..48cb4043 100644 --- a/internal/agent/tools/federation.go +++ b/internal/agent/tools/federation.go @@ -29,7 +29,7 @@ func NewFederationProvider(log *slog.Logger, source mcp.ToolSource) *FederationP } func (f *FederationProvider) Tools(ctx context.Context, session SessionContext) ([]sdk.Tool, error) { - if f.source == nil { + if session.IsSubagent || f.source == nil { return nil, nil } mcpSession := toMCPSession(session) diff --git a/internal/agent/tools/history.go b/internal/agent/tools/history.go index e28d2e66..3baf8e6d 100644 --- a/internal/agent/tools/history.go +++ b/internal/agent/tools/history.go @@ -43,6 +43,9 @@ func NewHistoryProvider(log *slog.Logger, sessions SessionLister, queries *sqlc. } func (p *HistoryProvider) Tools(_ context.Context, sess SessionContext) ([]sdk.Tool, error) { + if sess.IsSubagent { + return nil, nil + } var tools []sdk.Tool if p.sessions != nil { diff --git a/internal/agent/tools/memory.go b/internal/agent/tools/memory.go index c01a6022..03f1d8ee 100644 --- a/internal/agent/tools/memory.go +++ b/internal/agent/tools/memory.go @@ -36,6 +36,9 @@ func NewMemoryProvider(log *slog.Logger, registry *memprovider.Registry, setting } func (p *MemoryProvider) Tools(ctx context.Context, session SessionContext) ([]sdk.Tool, error) { + if session.IsSubagent { + return nil, nil + } provider := p.resolveProvider(ctx, session.BotID) if provider == nil { return nil, nil diff --git a/internal/agent/tools/message.go b/internal/agent/tools/message.go index 21655bfb..6b6f4fc2 100644 --- a/internal/agent/tools/message.go +++ b/internal/agent/tools/message.go @@ -29,6 +29,9 @@ func NewMessageProvider(log *slog.Logger, sender messaging.Sender, reactor messa } func (p *MessageProvider) Tools(_ context.Context, session SessionContext) ([]sdk.Tool, error) { + if session.IsSubagent { + return nil, nil + } var tools []sdk.Tool sess := session if p.exec.CanSend() { diff --git a/internal/agent/tools/schedule.go b/internal/agent/tools/schedule.go index 6ded2b65..30823211 100644 --- a/internal/agent/tools/schedule.go +++ b/internal/agent/tools/schedule.go @@ -36,7 +36,7 @@ func NewScheduleProvider(log *slog.Logger, service Scheduler) *ScheduleProvider } func (p *ScheduleProvider) Tools(_ context.Context, session SessionContext) ([]sdk.Tool, error) { - if p.service == nil { + if session.IsSubagent || p.service == nil { return nil, nil } sess := session diff --git a/internal/agent/tools/subagent.go b/internal/agent/tools/subagent.go index 31023bd8..03406489 100644 --- a/internal/agent/tools/subagent.go +++ b/internal/agent/tools/subagent.go @@ -1,299 +1,356 @@ package tools import ( - "bytes" "context" "encoding/json" "errors" "fmt" - "io" "log/slog" - "net/http" - "slices" "strings" - "time" + "sync" sdk "github.com/memohai/twilight-ai/sdk" "github.com/memohai/memoh/internal/db/sqlc" + messagepkg "github.com/memohai/memoh/internal/message" "github.com/memohai/memoh/internal/models" + sessionpkg "github.com/memohai/memoh/internal/session" "github.com/memohai/memoh/internal/settings" - subagentsvc "github.com/memohai/memoh/internal/subagent" ) -const subagentGatewayTimeout = 120 * time.Second +// SpawnAgent is the interface the spawn tool uses to run subagent tasks. +// It is satisfied by *agent.Agent and avoids an import cycle. +type SpawnAgent interface { + Generate(ctx context.Context, cfg SpawnRunConfig) (*SpawnResult, error) +} -type SubagentProvider struct { - logger *slog.Logger - service *subagentsvc.Service +// SpawnRunConfig mirrors agent.RunConfig fields needed by spawn. +type SpawnRunConfig struct { + Model *sdk.Model + System string + Query string + SessionType string + Identity SpawnIdentity + LoopDetection SpawnLoopConfig + Messages []sdk.Message + ReasoningEffort string +} + +// SpawnIdentity mirrors agent.SessionContext fields needed by spawn. +type SpawnIdentity struct { + BotID string + ChatID string + SessionID string + ChannelIdentityID string + CurrentPlatform string + SessionToken string //nolint:gosec // #nosec G117 -- session identifier, not a secret + IsSubagent bool +} + +// SpawnLoopConfig mirrors agent.LoopDetectionConfig. +type SpawnLoopConfig struct { + Enabled bool +} + +// SpawnResult mirrors agent.GenerateResult. +type SpawnResult struct { + Messages []sdk.Message + Text string + Usage *sdk.Usage +} + +// SpawnProvider exposes a "spawn" tool that runs one or more subagent tasks +// concurrently and returns results to the parent agent. +type SpawnProvider struct { + agent SpawnAgent settings *settings.Service models *models.Service queries *sqlc.Queries - gatewayBaseURL string - httpClient *http.Client + sessionService *sessionpkg.Service + messageService messagepkg.Writer + systemPromptFn func(sessionType string) string + modelCreator ModelCreator + logger *slog.Logger } -func NewSubagentProvider( +// NewSpawnProvider creates a SpawnProvider. The agent must be injected later +// via SetAgent to avoid a dependency cycle. +func NewSpawnProvider( log *slog.Logger, - service *subagentsvc.Service, settingsSvc *settings.Service, modelsSvc *models.Service, queries *sqlc.Queries, - gatewayBaseURL string, -) *SubagentProvider { + sessionService *sessionpkg.Service, +) *SpawnProvider { if log == nil { log = slog.Default() } - return &SubagentProvider{ - logger: log.With(slog.String("tool", "subagent")), - service: service, + return &SpawnProvider{ settings: settingsSvc, models: modelsSvc, queries: queries, - gatewayBaseURL: strings.TrimRight(gatewayBaseURL, "/"), - httpClient: &http.Client{Timeout: subagentGatewayTimeout}, + sessionService: sessionService, + logger: log.With(slog.String("tool", "spawn")), } } -func (p *SubagentProvider) Tools(_ context.Context, session SessionContext) ([]sdk.Tool, error) { - if p.service == nil || session.IsSubagent { +// SetAgent injects the agent after construction (breaking the DI cycle). +func (p *SpawnProvider) SetAgent(a SpawnAgent) { + p.agent = a +} + +// SetMessageService injects an optional message writer for persisting +// subagent conversation history. +func (p *SpawnProvider) SetMessageService(w messagepkg.Writer) { + p.messageService = w +} + +// SetSystemPromptFunc injects the function used to generate the system prompt +// (typically agent.GenerateSystemPrompt). +func (p *SpawnProvider) SetSystemPromptFunc(fn func(sessionType string) string) { + p.systemPromptFn = fn +} + +func (p *SpawnProvider) Tools(_ context.Context, session SessionContext) ([]sdk.Tool, error) { + if session.IsSubagent || p.agent == nil { return nil, nil } sess := session return []sdk.Tool{ { - Name: "list_subagents", Description: "List subagents for current bot", - Parameters: emptyObjectSchema(), - Execute: func(ctx *sdk.ToolExecContext, _ any) (any, error) { - botID := strings.TrimSpace(sess.BotID) - if botID == "" { - return nil, errors.New("bot_id is required") - } - items, err := p.service.List(ctx.Context, botID) - if err != nil { - return nil, err - } - result := make([]map[string]any, 0, len(items)) - for _, item := range items { - result = append(result, map[string]any{"id": item.ID, "name": item.Name, "description": item.Description}) - } - return map[string]any{"items": result}, nil - }, - }, - { - Name: "delete_subagent", Description: "Delete a subagent by id", + Name: "spawn", + Description: "Spawn one or more subagents to work on tasks in parallel. Each task runs in its own context with file, exec, and web tools. All results are returned together.", Parameters: map[string]any{ "type": "object", "properties": map[string]any{ - "id": map[string]any{"type": "string", "description": "Subagent ID"}, + "tasks": map[string]any{ + "type": "array", + "description": "List of task instructions. Each string is a self-contained prompt for one subagent.", + "items": map[string]any{"type": "string"}, + }, }, - "required": []string{"id"}, + "required": []string{"tasks"}, }, Execute: func(ctx *sdk.ToolExecContext, input any) (any, error) { - args := inputAsMap(input) - id := StringArg(args, "id") - if id == "" { - return nil, errors.New("id is required") - } - if err := p.service.Delete(ctx.Context, id); err != nil { - return nil, err - } - return map[string]any{"success": true}, nil - }, - }, - { - Name: "query_subagent", Description: "Query a subagent. If the subagent does not exist it will be created automatically.", - Parameters: map[string]any{ - "type": "object", - "properties": map[string]any{ - "name": map[string]any{"type": "string", "description": "The name of the subagent"}, - "description": map[string]any{"type": "string", "description": "A short description of the subagent purpose (used when creating)"}, - "query": map[string]any{"type": "string", "description": "The prompt to ask the subagent to do."}, - }, - "required": []string{"name", "description", "query"}, - }, - Execute: func(ctx *sdk.ToolExecContext, input any) (any, error) { - return p.execQuery(ctx.Context, sess, inputAsMap(input)) + return p.execSpawn(ctx.Context, sess, inputAsMap(input)) }, }, }, nil } -func (p *SubagentProvider) execQuery(ctx context.Context, session SessionContext, args map[string]any) (any, error) { +type spawnResult struct { + Task string `json:"task"` + SessionID string `json:"session_id,omitempty"` + Text string `json:"text"` + Success bool `json:"success"` + Error string `json:"error,omitempty"` +} + +func (p *SpawnProvider) execSpawn(ctx context.Context, session SessionContext, args map[string]any) (any, error) { botID := strings.TrimSpace(session.BotID) if botID == "" { return nil, errors.New("bot_id is required") } - name := StringArg(args, "name") - description := StringArg(args, "description") - query := StringArg(args, "query") - if name == "" || description == "" || query == "" { - return nil, errors.New("name, description, and query are required") + + tasksRaw, ok := args["tasks"] + if !ok { + return nil, errors.New("tasks is required") } - target, err := p.service.GetOrCreate(ctx, botID, subagentsvc.CreateRequest{Name: name, Description: description}) + tasks, err := toStringSlice(tasksRaw) if err != nil { - return nil, fmt.Errorf("failed to get or create subagent: %w", err) + return nil, fmt.Errorf("invalid tasks: %w", err) } - modelCfg, provider, err := p.resolveModel(ctx, botID) + if len(tasks) == 0 { + return nil, errors.New("at least one task is required") + } + + sdkModel, modelID, err := p.resolveModel(ctx, botID) if err != nil { - return nil, fmt.Errorf("failed to resolve model: %w", err) + return nil, fmt.Errorf("resolve model: %w", err) } - gwResp, err := p.postSubagent(ctx, session, subagentGWRequest{ - Model: subagentModelCfg{ - ModelID: modelCfg.ModelID, ClientType: provider.ClientType, - APIKey: provider.ApiKey, BaseURL: provider.BaseUrl, - }, - Identity: subagentIdentityCfg{ - BotID: botID, ChannelIdentityID: session.ChannelIdentityID, - CurrentPlatform: session.CurrentPlatform, SessionToken: session.SessionToken, - }, - Messages: target.Messages, Query: query, Name: name, Desc: description, - }) - if err != nil { - return nil, fmt.Errorf("subagent query failed: %w", err) + + systemPrompt := "" + if p.systemPromptFn != nil { + systemPrompt = p.systemPromptFn(sessionpkg.TypeSubagent) } - updatedMessages := slices.Clone(target.Messages) - updatedMessages = append(updatedMessages, gwResp.Messages...) - usage := mergeSubagentUsage(target.Usage, gwResp.Usage) - if _, err := p.service.UpdateContext(ctx, target.ID, subagentsvc.UpdateContextRequest{ - Messages: updatedMessages, Usage: usage, - }); err != nil { - p.logger.Warn("failed to persist subagent context", slog.String("subagent_id", target.ID), slog.Any("error", err)) + + results := make([]spawnResult, len(tasks)) + var wg sync.WaitGroup + wg.Add(len(tasks)) + + for i, task := range tasks { + go func(idx int, query string) { + defer wg.Done() + results[idx] = p.runSubagentTask(ctx, session, sdkModel, modelID, systemPrompt, query) + }(i, task) } - resultContent := gwResp.Text - if resultContent == "" && len(gwResp.Messages) > 0 { - last := gwResp.Messages[len(gwResp.Messages)-1] - if content, ok := last["content"]; ok { - resultContent = fmt.Sprintf("%v", content) - } - } - return map[string]any{"success": true, "result": resultContent}, nil + wg.Wait() + + return map[string]any{"results": results}, nil } -func (p *SubagentProvider) resolveModel(ctx context.Context, botID string) (models.GetResponse, sqlc.LlmProvider, error) { +func (p *SpawnProvider) runSubagentTask( + ctx context.Context, + parentSession SessionContext, + model *sdk.Model, + modelID string, + systemPrompt string, + query string, +) spawnResult { + res := spawnResult{Task: query} + + var sessionID string + if p.sessionService != nil { + sess, err := p.sessionService.Create(ctx, sessionpkg.CreateInput{ + BotID: parentSession.BotID, + Type: sessionpkg.TypeSubagent, + Title: truncateTitle(query, 100), + ParentSessionID: parentSession.SessionID, + }) + if err != nil { + p.logger.Warn("failed to create subagent session", slog.Any("error", err)) + } else { + sessionID = sess.ID + res.SessionID = sessionID + } + } + + cfg := SpawnRunConfig{ + Model: model, + System: systemPrompt, + Query: query, + SessionType: sessionpkg.TypeSubagent, + Identity: SpawnIdentity{ + BotID: parentSession.BotID, + ChatID: parentSession.ChatID, + SessionID: sessionID, + ChannelIdentityID: parentSession.ChannelIdentityID, + CurrentPlatform: parentSession.CurrentPlatform, + SessionToken: parentSession.SessionToken, + IsSubagent: true, + }, + LoopDetection: SpawnLoopConfig{Enabled: true}, + } + + genResult, err := p.agent.Generate(ctx, cfg) + if err != nil { + res.Error = err.Error() + return res + } + + res.Text = genResult.Text + res.Success = true + + if p.messageService != nil && sessionID != "" { + p.persistMessages(ctx, parentSession.BotID, sessionID, modelID, query, genResult) + } + + return res +} + +func (p *SpawnProvider) persistMessages( + ctx context.Context, + botID, sessionID, modelID, query string, + result *SpawnResult, +) { + userContent, _ := json.Marshal(map[string]any{ + "role": "user", + "content": query, + }) + if _, err := p.messageService.Persist(ctx, messagepkg.PersistInput{ + BotID: botID, + SessionID: sessionID, + Role: "user", + Content: userContent, + }); err != nil { + p.logger.Warn("persist subagent user message failed", slog.Any("error", err)) + } + + for _, msg := range result.Messages { + if msg.Role == sdk.MessageRoleUser { + continue + } + content, err := json.Marshal(msg) + if err != nil { + continue + } + var usage json.RawMessage + if msg.Usage != nil { + usage, _ = json.Marshal(msg.Usage) + } + if _, err := p.messageService.Persist(ctx, messagepkg.PersistInput{ + BotID: botID, + SessionID: sessionID, + Role: string(msg.Role), + Content: content, + Usage: usage, + ModelID: modelID, + }); err != nil { + p.logger.Warn("persist subagent message failed", slog.Any("error", err)) + } + } +} + +// ModelCreator creates an sdk.Model from provider config. Set via SetModelCreator. +type ModelCreator func(modelID, clientType, apiKey, baseURL string) *sdk.Model + +// SetModelCreator injects the function used to create SDK models +// (typically agent.CreateModel wrapped to match the signature). +func (p *SpawnProvider) SetModelCreator(fn ModelCreator) { + p.modelCreator = fn +} + +func (p *SpawnProvider) resolveModel(ctx context.Context, botID string) (*sdk.Model, string, error) { if p.settings == nil || p.models == nil || p.queries == nil { - return models.GetResponse{}, sqlc.LlmProvider{}, errors.New("model resolution services not configured") + return nil, "", errors.New("model resolution services not configured") } botSettings, err := p.settings.GetBot(ctx, botID) if err != nil { - return models.GetResponse{}, sqlc.LlmProvider{}, err + return nil, "", err } chatModelID := strings.TrimSpace(botSettings.ChatModelID) if chatModelID == "" { - return models.GetResponse{}, sqlc.LlmProvider{}, errors.New("no chat model configured for bot") + return nil, "", errors.New("no chat model configured for bot") } - model, err := p.models.GetByID(ctx, chatModelID) + modelInfo, err := p.models.GetByID(ctx, chatModelID) if err != nil { - return models.GetResponse{}, sqlc.LlmProvider{}, err + return nil, "", err } - provider, err := models.FetchProviderByID(ctx, p.queries, model.LlmProviderID) + provider, err := models.FetchProviderByID(ctx, p.queries, modelInfo.LlmProviderID) if err != nil { - return models.GetResponse{}, sqlc.LlmProvider{}, err + return nil, "", err } - return model, provider, nil + if p.modelCreator == nil { + return nil, "", errors.New("model creator not configured") + } + sdkModel := p.modelCreator(modelInfo.ModelID, provider.ClientType, provider.ApiKey, provider.BaseUrl) + return sdkModel, modelInfo.ID, nil } -type subagentModelCfg struct { - ModelID string `json:"modelId"` - ClientType string `json:"clientType"` - APIKey string `json:"apiKey"` //nolint:gosec // forwarded to agent gateway - BaseURL string `json:"baseUrl"` -} - -type subagentIdentityCfg struct { - BotID string `json:"botId"` - ChannelIdentityID string `json:"channelIdentityId"` - CurrentPlatform string `json:"currentPlatform,omitempty"` - SessionToken string `json:"sessionToken,omitempty"` //nolint:gosec // session token forwarded -} - -type subagentGWRequest struct { - Model subagentModelCfg `json:"model"` - Identity subagentIdentityCfg `json:"identity"` - Messages []map[string]any `json:"messages"` - Query string `json:"query"` - Name string `json:"name"` - Desc string `json:"description"` -} - -type subagentGWResponse struct { - Messages []map[string]any `json:"messages"` - Text string `json:"text,omitempty"` - Usage json.RawMessage `json:"usage,omitempty"` -} - -func (p *SubagentProvider) postSubagent(ctx context.Context, session SessionContext, payload subagentGWRequest) (subagentGWResponse, error) { - url := p.gatewayBaseURL + "/chat/subagent" - body, err := json.Marshal(payload) - if err != nil { - return subagentGWResponse{}, err - } - req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(body)) - if err != nil { - return subagentGWResponse{}, err - } - req.Header.Set("Content-Type", "application/json") - if token := strings.TrimSpace(session.SessionToken); token != "" { - req.Header.Set("Authorization", "Bearer "+token) - } - resp, err := p.httpClient.Do(req) //nolint:gosec // URL is from operator-configured agent gateway - if err != nil { - return subagentGWResponse{}, err - } - defer func() { _ = resp.Body.Close() }() - respBody, err := io.ReadAll(resp.Body) - if err != nil { - return subagentGWResponse{}, err - } - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - detail := string(respBody) - if len(detail) > 300 { - detail = detail[:300] - } - return subagentGWResponse{}, fmt.Errorf("agent gateway error (HTTP %d): %s", resp.StatusCode, strings.TrimSpace(detail)) - } - var parsed subagentGWResponse - if err := json.Unmarshal(respBody, &parsed); err != nil { - return subagentGWResponse{}, fmt.Errorf("failed to parse gateway response: %w", err) - } - return parsed, nil -} - -func mergeSubagentUsage(existing map[string]any, delta json.RawMessage) map[string]any { - if existing == nil { - existing = map[string]any{} - } - if len(delta) == 0 { - return existing - } - var deltaMap map[string]any - if err := json.Unmarshal(delta, &deltaMap); err != nil { - return existing - } - for key, val := range deltaMap { - if num, ok := toFloat64(val); ok { - if prev, ok := toFloat64(existing[key]); ok { - existing[key] = prev + num - } else { - existing[key] = num +func toStringSlice(v any) ([]string, error) { + switch val := v.(type) { + case []string: + return val, nil + case []any: + result := make([]string, 0, len(val)) + for _, item := range val { + s, ok := item.(string) + if !ok { + return nil, fmt.Errorf("expected string, got %T", item) } + result = append(result, s) } + return result, nil + default: + return nil, fmt.Errorf("expected array, got %T", v) } - return existing } -func toFloat64(v any) (float64, bool) { - switch n := v.(type) { - case float64: - return n, true - case int: - return float64(n), true - case int64: - return float64(n), true - case json.Number: - f, err := n.Float64() - return f, err == nil - default: - return 0, false +func truncateTitle(s string, maxRunes int) string { + s = strings.ReplaceAll(s, "\n", " ") + runes := []rune(s) + if len(runes) <= maxRunes { + return s } + return string(runes[:maxRunes-3]) + "..." } diff --git a/internal/agent/tools/tts.go b/internal/agent/tools/tts.go index c993725b..24c85a65 100644 --- a/internal/agent/tools/tts.go +++ b/internal/agent/tools/tts.go @@ -49,7 +49,7 @@ func NewTTSProvider(log *slog.Logger, settingsSvc *settings.Service, ttsSvc *tts } func (p *TTSProvider) Tools(ctx context.Context, session SessionContext) ([]sdk.Tool, error) { - if p.settings == nil || p.tts == nil || p.sender == nil || p.resolver == nil { + if session.IsSubagent || p.settings == nil || p.tts == nil || p.sender == nil || p.resolver == nil { return nil, nil } botID := strings.TrimSpace(session.BotID) diff --git a/internal/agent/tools/types.go b/internal/agent/tools/types.go index acc3f59e..1c23dfef 100644 --- a/internal/agent/tools/types.go +++ b/internal/agent/tools/types.go @@ -20,6 +20,7 @@ type SkillDetail struct { type SessionContext struct { BotID string ChatID string + SessionID string ChannelIdentityID string SessionToken string //nolint:gosec // carries session credential material at runtime CurrentPlatform string diff --git a/internal/agent/types.go b/internal/agent/types.go index bb931765..ff37a9f4 100644 --- a/internal/agent/types.go +++ b/internal/agent/types.go @@ -11,6 +11,7 @@ import ( type SessionContext struct { BotID string ChatID string + SessionID string ChannelIdentityID string CurrentPlatform string ReplyTarget string diff --git a/internal/command/commands.go b/internal/command/commands.go index a523a6ca..5456c1a4 100644 --- a/internal/command/commands.go +++ b/internal/command/commands.go @@ -3,7 +3,6 @@ package command // buildRegistry constructs the full command registry with all resource groups. func (h *Handler) buildRegistry() *Registry { r := newRegistry() - r.RegisterGroup(h.buildSubagentGroup()) r.RegisterGroup(h.buildScheduleGroup()) r.RegisterGroup(h.buildMCPGroup()) r.RegisterGroup(h.buildSettingsGroup()) diff --git a/internal/command/handler.go b/internal/command/handler.go index 2fb17750..cfe97600 100644 --- a/internal/command/handler.go +++ b/internal/command/handler.go @@ -17,7 +17,6 @@ import ( "github.com/memohai/memoh/internal/schedule" "github.com/memohai/memoh/internal/searchproviders" "github.com/memohai/memoh/internal/settings" - "github.com/memohai/memoh/internal/subagent" ) // MemberRoleResolver resolves a user's role within a bot. @@ -45,7 +44,6 @@ func (a *BotMemberRoleAdapter) GetMemberRole(ctx context.Context, botID, channel type Handler struct { registry *Registry roleResolver MemberRoleResolver - subagentService *subagent.Service scheduleService *schedule.Service settingsService *settings.Service mcpConnService *mcp.ConnectionService @@ -69,7 +67,6 @@ type Handler struct { func NewHandler( log *slog.Logger, roleResolver MemberRoleResolver, - subagentService *subagent.Service, scheduleService *schedule.Service, settingsService *settings.Service, mcpConnService *mcp.ConnectionService, @@ -90,7 +87,6 @@ func NewHandler( } h := &Handler{ roleResolver: roleResolver, - subagentService: subagentService, scheduleService: scheduleService, settingsService: settingsService, mcpConnService: mcpConnService, diff --git a/internal/command/handler_test.go b/internal/command/handler_test.go index a82905a9..f8205c4f 100644 --- a/internal/command/handler_test.go +++ b/internal/command/handler_test.go @@ -4,12 +4,10 @@ import ( "context" "strings" "testing" - "time" "github.com/memohai/memoh/internal/mcp" "github.com/memohai/memoh/internal/schedule" "github.com/memohai/memoh/internal/settings" - "github.com/memohai/memoh/internal/subagent" ) // --- fake services --- @@ -23,17 +21,13 @@ func (f *fakeRoleResolver) GetMemberRole(_ context.Context, _, _ string) (string return f.role, f.err } -type fakeSubagentService struct { - items []subagent.Subagent -} - type fakeScheduleService struct { items []schedule.Schedule } // newTestHandler creates a Handler with nil services for use in tests. func newTestHandler(roleResolver MemberRoleResolver) *Handler { - return NewHandler(nil, roleResolver, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil) + return NewHandler(nil, roleResolver, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil) } // --- tests --- @@ -46,7 +40,6 @@ func TestIsCommand(t *testing.T) { want bool }{ {"/help", true}, - {"/subagent list", true}, {" /schedule list", true}, {"@BotName /help", true}, {"@_user_1 /schedule list", true}, @@ -80,9 +73,6 @@ func TestExecute_Help(t *testing.T) { if !strings.Contains(result, "Available commands") { t.Errorf("expected help text, got: %s", result) } - if !strings.Contains(result, "/subagent") { - t.Errorf("expected /subagent in help, got: %s", result) - } } func TestExecute_UnknownCommand(t *testing.T) { @@ -124,22 +114,22 @@ func TestExecute_TelegramBotSuffix(t *testing.T) { func TestExecute_UnknownAction(t *testing.T) { t.Parallel() h := newTestHandler(&fakeRoleResolver{role: "owner"}) - result, err := h.Execute(context.Background(), "bot-1", "user-1", "/subagent foobar") + result, err := h.Execute(context.Background(), "bot-1", "user-1", "/schedule foobar") if err != nil { t.Fatalf("unexpected error: %v", err) } if !strings.Contains(result, "Unknown action") { t.Errorf("expected unknown action message, got: %s", result) } - if !strings.Contains(result, "/subagent") { - t.Errorf("expected subagent usage in message, got: %s", result) + if !strings.Contains(result, "/schedule") { + t.Errorf("expected schedule usage in message, got: %s", result) } } func TestExecute_WritePermissionDenied(t *testing.T) { t.Parallel() h := newTestHandler(&fakeRoleResolver{role: ""}) - result, err := h.Execute(context.Background(), "bot-1", "user-1", "/subagent create test desc") + result, err := h.Execute(context.Background(), "bot-1", "user-1", "/schedule create test desc") if err != nil { t.Fatalf("unexpected error: %v", err) } @@ -151,7 +141,7 @@ func TestExecute_WritePermissionDenied(t *testing.T) { func TestExecute_WritePermissionAllowedForOwner(t *testing.T) { t.Parallel() h := newTestHandler(&fakeRoleResolver{role: "owner"}) - result, err := h.Execute(context.Background(), "bot-1", "user-1", "/subagent create") + result, err := h.Execute(context.Background(), "bot-1", "user-1", "/schedule create") if err != nil { t.Fatalf("unexpected error: %v", err) } @@ -182,9 +172,6 @@ func TestExecute_MissingArgs(t *testing.T) { cmd string contains string }{ - {"/subagent get", "Usage:"}, - {"/subagent create", "Usage:"}, - {"/subagent delete", "Usage:"}, {"/schedule get", "Usage:"}, {"/schedule create", "Usage:"}, {"/schedule delete", "Usage:"}, @@ -266,7 +253,7 @@ func TestGlobalHelp_AllGroups(t *testing.T) { h := newTestHandler(nil) help := h.registry.GlobalHelp() for _, group := range []string{ - "subagent", "schedule", "mcp", "settings", + "schedule", "mcp", "settings", "model", "memory", "search", "browser", "usage", "email", "heartbeat", "skill", "fs", } { @@ -317,7 +304,6 @@ func TestNewCommands_NilServices(t *testing.T) { // suppress unused warnings. var ( - _ = fakeSubagentService{items: []subagent.Subagent{{ID: "1", Name: "test", CreatedAt: time.Now(), UpdatedAt: time.Now()}}} _ = fakeScheduleService{items: []schedule.Schedule{{ID: "1", Name: "test"}}} _ = mcp.Connection{} _ = settings.Settings{} diff --git a/internal/command/subagent.go b/internal/command/subagent.go deleted file mode 100644 index 670b7e09..00000000 --- a/internal/command/subagent.go +++ /dev/null @@ -1,94 +0,0 @@ -package command - -import ( - "fmt" - "strings" - - "github.com/memohai/memoh/internal/subagent" -) - -func (h *Handler) buildSubagentGroup() *CommandGroup { - g := newCommandGroup("subagent", "Manage subagents") - g.Register(SubCommand{ - Name: "list", - Usage: "list - List all subagents", - Handler: func(cc CommandContext) (string, error) { - items, err := h.subagentService.List(cc.Ctx, cc.BotID) - if err != nil { - return "", err - } - if len(items) == 0 { - return "No subagents found.", nil - } - records := make([][]kv, 0, len(items)) - for _, item := range items { - records = append(records, []kv{ - {"Name", item.Name}, - {"Description", truncate(item.Description, 40)}, - }) - } - return formatItems(records), nil - }, - }) - g.Register(SubCommand{ - Name: "get", - Usage: "get - Get subagent details", - Handler: func(cc CommandContext) (string, error) { - if len(cc.Args) < 1 { - return "Usage: /subagent get ", nil - } - name := cc.Args[0] - item, err := h.subagentService.GetByBotAndName(cc.Ctx, cc.BotID, name) - if err != nil { - return "", fmt.Errorf("subagent %q not found", name) - } - return formatKV([]kv{ - {"Name", item.Name}, - {"Description", item.Description}, - {"Skills", fmt.Sprintf("%v", item.Skills)}, - {"Created", item.CreatedAt.Format("2006-01-02 15:04:05")}, - {"Updated", item.UpdatedAt.Format("2006-01-02 15:04:05")}, - }), nil - }, - }) - g.Register(SubCommand{ - Name: "create", - Usage: "create - Create a subagent", - IsWrite: true, - Handler: func(cc CommandContext) (string, error) { - if len(cc.Args) < 2 { - return "Usage: /subagent create ", nil - } - name := cc.Args[0] - description := strings.Join(cc.Args[1:], " ") - item, err := h.subagentService.Create(cc.Ctx, cc.BotID, subagent.CreateRequest{ - Name: name, - Description: description, - }) - if err != nil { - return "", err - } - return fmt.Sprintf("Subagent %q created (ID: %s).", item.Name, item.ID), nil - }, - }) - g.Register(SubCommand{ - Name: "delete", - Usage: "delete - Delete a subagent", - IsWrite: true, - Handler: func(cc CommandContext) (string, error) { - if len(cc.Args) < 1 { - return "Usage: /subagent delete ", nil - } - name := cc.Args[0] - item, err := h.subagentService.GetByBotAndName(cc.Ctx, cc.BotID, name) - if err != nil { - return "", fmt.Errorf("subagent %q not found", name) - } - if err := h.subagentService.Delete(cc.Ctx, item.ID); err != nil { - return "", err - } - return fmt.Sprintf("Subagent %q deleted.", name), nil - }, - }) - return g -} diff --git a/internal/conversation/flow/resolver.go b/internal/conversation/flow/resolver.go index 1604dde2..72012f29 100644 --- a/internal/conversation/flow/resolver.go +++ b/internal/conversation/flow/resolver.go @@ -290,6 +290,7 @@ func (r *Resolver) resolve(ctx context.Context, req conversation.ChatRequest) (r Identity: agentpkg.SessionContext{ BotID: req.BotID, ChatID: req.ChatID, + SessionID: req.SessionID, ChannelIdentityID: strings.TrimSpace(req.SourceChannelIdentityID), CurrentPlatform: req.CurrentChannel, ReplyTarget: strings.TrimSpace(req.ReplyTarget), diff --git a/internal/db/sqlc/models.go b/internal/db/sqlc/models.go index 478ba7d4..5e297e00 100644 --- a/internal/db/sqlc/models.go +++ b/internal/db/sqlc/models.go @@ -154,16 +154,17 @@ type BotHistoryMessageCompact struct { } type BotSession struct { - ID pgtype.UUID `json:"id"` - BotID pgtype.UUID `json:"bot_id"` - RouteID pgtype.UUID `json:"route_id"` - ChannelType pgtype.Text `json:"channel_type"` - Type string `json:"type"` - Title string `json:"title"` - Metadata []byte `json:"metadata"` - CreatedAt pgtype.Timestamptz `json:"created_at"` - UpdatedAt pgtype.Timestamptz `json:"updated_at"` - DeletedAt pgtype.Timestamptz `json:"deleted_at"` + ID pgtype.UUID `json:"id"` + BotID pgtype.UUID `json:"bot_id"` + RouteID pgtype.UUID `json:"route_id"` + ChannelType pgtype.Text `json:"channel_type"` + Type string `json:"type"` + Title string `json:"title"` + Metadata []byte `json:"metadata"` + ParentSessionID pgtype.UUID `json:"parent_session_id"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` + DeletedAt pgtype.Timestamptz `json:"deleted_at"` } type BotStorageBinding struct { @@ -435,21 +436,6 @@ type StorageProvider struct { UpdatedAt pgtype.Timestamptz `json:"updated_at"` } -type Subagent struct { - ID pgtype.UUID `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - CreatedAt pgtype.Timestamptz `json:"created_at"` - UpdatedAt pgtype.Timestamptz `json:"updated_at"` - Deleted bool `json:"deleted"` - DeletedAt pgtype.Timestamptz `json:"deleted_at"` - BotID pgtype.UUID `json:"bot_id"` - Messages []byte `json:"messages"` - Metadata []byte `json:"metadata"` - Skills []byte `json:"skills"` - Usage []byte `json:"usage"` -} - type TtsModel struct { ID pgtype.UUID `json:"id"` ModelID string `json:"model_id"` diff --git a/internal/db/sqlc/sessions.sql.go b/internal/db/sqlc/sessions.sql.go index 86d64f7d..259ea2f0 100644 --- a/internal/db/sqlc/sessions.sql.go +++ b/internal/db/sqlc/sessions.sql.go @@ -13,7 +13,7 @@ import ( const createSession = `-- name: CreateSession :one INSERT INTO bot_sessions ( - bot_id, route_id, channel_type, type, title, metadata + bot_id, route_id, channel_type, type, title, metadata, parent_session_id ) VALUES ( $1, @@ -21,18 +21,20 @@ VALUES ( $3::text, $4, $5, - $6 + $6, + $7::uuid ) -RETURNING id, bot_id, route_id, channel_type, type, title, metadata, created_at, updated_at, deleted_at +RETURNING id, bot_id, route_id, channel_type, type, title, metadata, parent_session_id, created_at, updated_at, deleted_at ` type CreateSessionParams struct { - BotID pgtype.UUID `json:"bot_id"` - RouteID pgtype.UUID `json:"route_id"` - ChannelType pgtype.Text `json:"channel_type"` - Type string `json:"type"` - Title string `json:"title"` - Metadata []byte `json:"metadata"` + BotID pgtype.UUID `json:"bot_id"` + RouteID pgtype.UUID `json:"route_id"` + ChannelType pgtype.Text `json:"channel_type"` + Type string `json:"type"` + Title string `json:"title"` + Metadata []byte `json:"metadata"` + ParentSessionID pgtype.UUID `json:"parent_session_id"` } func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (BotSession, error) { @@ -43,6 +45,7 @@ func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (B arg.Type, arg.Title, arg.Metadata, + arg.ParentSessionID, ) var i BotSession err := row.Scan( @@ -53,6 +56,7 @@ func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (B &i.Type, &i.Title, &i.Metadata, + &i.ParentSessionID, &i.CreatedAt, &i.UpdatedAt, &i.DeletedAt, @@ -61,7 +65,7 @@ func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (B } const getActiveSessionForRoute = `-- name: GetActiveSessionForRoute :one -SELECT s.id, s.bot_id, s.route_id, s.channel_type, s.type, s.title, s.metadata, s.created_at, s.updated_at, s.deleted_at +SELECT s.id, s.bot_id, s.route_id, s.channel_type, s.type, s.title, s.metadata, s.parent_session_id, s.created_at, s.updated_at, s.deleted_at FROM bot_sessions s JOIN bot_channel_routes r ON r.active_session_id = s.id WHERE r.id = $1 @@ -79,6 +83,7 @@ func (q *Queries) GetActiveSessionForRoute(ctx context.Context, routeID pgtype.U &i.Type, &i.Title, &i.Metadata, + &i.ParentSessionID, &i.CreatedAt, &i.UpdatedAt, &i.DeletedAt, @@ -87,7 +92,7 @@ func (q *Queries) GetActiveSessionForRoute(ctx context.Context, routeID pgtype.U } const getSessionByID = `-- name: GetSessionByID :one -SELECT id, bot_id, route_id, channel_type, type, title, metadata, created_at, updated_at, deleted_at +SELECT id, bot_id, route_id, channel_type, type, title, metadata, parent_session_id, created_at, updated_at, deleted_at FROM bot_sessions WHERE id = $1 AND deleted_at IS NULL @@ -104,6 +109,7 @@ func (q *Queries) GetSessionByID(ctx context.Context, id pgtype.UUID) (BotSessio &i.Type, &i.Title, &i.Metadata, + &i.ParentSessionID, &i.CreatedAt, &i.UpdatedAt, &i.DeletedAt, @@ -173,7 +179,7 @@ func (q *Queries) ListSessionsByBot(ctx context.Context, botID pgtype.UUID) ([]L } const listSessionsByRoute = `-- name: ListSessionsByRoute :many -SELECT id, bot_id, route_id, channel_type, type, title, metadata, created_at, updated_at, deleted_at +SELECT id, bot_id, route_id, channel_type, type, title, metadata, parent_session_id, created_at, updated_at, deleted_at FROM bot_sessions WHERE route_id = $1 AND deleted_at IS NULL @@ -197,6 +203,47 @@ func (q *Queries) ListSessionsByRoute(ctx context.Context, routeID pgtype.UUID) &i.Type, &i.Title, &i.Metadata, + &i.ParentSessionID, + &i.CreatedAt, + &i.UpdatedAt, + &i.DeletedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listSubagentSessionsByParent = `-- name: ListSubagentSessionsByParent :many +SELECT id, bot_id, route_id, channel_type, type, title, metadata, parent_session_id, created_at, updated_at, deleted_at +FROM bot_sessions +WHERE parent_session_id = $1 + AND deleted_at IS NULL +ORDER BY created_at DESC +` + +func (q *Queries) ListSubagentSessionsByParent(ctx context.Context, parentSessionID pgtype.UUID) ([]BotSession, error) { + rows, err := q.db.Query(ctx, listSubagentSessionsByParent, parentSessionID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []BotSession + for rows.Next() { + var i BotSession + if err := rows.Scan( + &i.ID, + &i.BotID, + &i.RouteID, + &i.ChannelType, + &i.Type, + &i.Title, + &i.Metadata, + &i.ParentSessionID, &i.CreatedAt, &i.UpdatedAt, &i.DeletedAt, @@ -248,7 +295,7 @@ const updateSessionMetadata = `-- name: UpdateSessionMetadata :one UPDATE bot_sessions SET metadata = $1, updated_at = now() WHERE id = $2 AND deleted_at IS NULL -RETURNING id, bot_id, route_id, channel_type, type, title, metadata, created_at, updated_at, deleted_at +RETURNING id, bot_id, route_id, channel_type, type, title, metadata, parent_session_id, created_at, updated_at, deleted_at ` type UpdateSessionMetadataParams struct { @@ -267,6 +314,7 @@ func (q *Queries) UpdateSessionMetadata(ctx context.Context, arg UpdateSessionMe &i.Type, &i.Title, &i.Metadata, + &i.ParentSessionID, &i.CreatedAt, &i.UpdatedAt, &i.DeletedAt, @@ -278,7 +326,7 @@ const updateSessionTitle = `-- name: UpdateSessionTitle :one UPDATE bot_sessions SET title = $1, updated_at = now() WHERE id = $2 AND deleted_at IS NULL -RETURNING id, bot_id, route_id, channel_type, type, title, metadata, created_at, updated_at, deleted_at +RETURNING id, bot_id, route_id, channel_type, type, title, metadata, parent_session_id, created_at, updated_at, deleted_at ` type UpdateSessionTitleParams struct { @@ -297,6 +345,7 @@ func (q *Queries) UpdateSessionTitle(ctx context.Context, arg UpdateSessionTitle &i.Type, &i.Title, &i.Metadata, + &i.ParentSessionID, &i.CreatedAt, &i.UpdatedAt, &i.DeletedAt, diff --git a/internal/db/sqlc/subagents.sql.go b/internal/db/sqlc/subagents.sql.go deleted file mode 100644 index f2559a1f..00000000 --- a/internal/db/sqlc/subagents.sql.go +++ /dev/null @@ -1,307 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.30.0 -// source: subagents.sql - -package sqlc - -import ( - "context" - - "github.com/jackc/pgx/v5/pgtype" -) - -const createSubagent = `-- name: CreateSubagent :one -INSERT INTO subagents (name, description, bot_id, messages, metadata, skills) -VALUES ($1, $2, $3, $4, $5, $6) -RETURNING id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage -` - -type CreateSubagentParams struct { - Name string `json:"name"` - Description string `json:"description"` - BotID pgtype.UUID `json:"bot_id"` - Messages []byte `json:"messages"` - Metadata []byte `json:"metadata"` - Skills []byte `json:"skills"` -} - -func (q *Queries) CreateSubagent(ctx context.Context, arg CreateSubagentParams) (Subagent, error) { - row := q.db.QueryRow(ctx, createSubagent, - arg.Name, - arg.Description, - arg.BotID, - arg.Messages, - arg.Metadata, - arg.Skills, - ) - var i Subagent - err := row.Scan( - &i.ID, - &i.Name, - &i.Description, - &i.CreatedAt, - &i.UpdatedAt, - &i.Deleted, - &i.DeletedAt, - &i.BotID, - &i.Messages, - &i.Metadata, - &i.Skills, - &i.Usage, - ) - return i, err -} - -const getSubagentByBotAndName = `-- name: GetSubagentByBotAndName :one -SELECT id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage -FROM subagents -WHERE bot_id = $1 AND name = $2 AND deleted = false -` - -type GetSubagentByBotAndNameParams struct { - BotID pgtype.UUID `json:"bot_id"` - Name string `json:"name"` -} - -func (q *Queries) GetSubagentByBotAndName(ctx context.Context, arg GetSubagentByBotAndNameParams) (Subagent, error) { - row := q.db.QueryRow(ctx, getSubagentByBotAndName, arg.BotID, arg.Name) - var i Subagent - err := row.Scan( - &i.ID, - &i.Name, - &i.Description, - &i.CreatedAt, - &i.UpdatedAt, - &i.Deleted, - &i.DeletedAt, - &i.BotID, - &i.Messages, - &i.Metadata, - &i.Skills, - &i.Usage, - ) - return i, err -} - -const getSubagentByID = `-- name: GetSubagentByID :one -SELECT id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage -FROM subagents -WHERE id = $1 AND deleted = false -` - -func (q *Queries) GetSubagentByID(ctx context.Context, id pgtype.UUID) (Subagent, error) { - row := q.db.QueryRow(ctx, getSubagentByID, id) - var i Subagent - err := row.Scan( - &i.ID, - &i.Name, - &i.Description, - &i.CreatedAt, - &i.UpdatedAt, - &i.Deleted, - &i.DeletedAt, - &i.BotID, - &i.Messages, - &i.Metadata, - &i.Skills, - &i.Usage, - ) - return i, err -} - -const listSubagentsByBot = `-- name: ListSubagentsByBot :many -SELECT id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage -FROM subagents -WHERE bot_id = $1 AND deleted = false -ORDER BY created_at DESC -` - -func (q *Queries) ListSubagentsByBot(ctx context.Context, botID pgtype.UUID) ([]Subagent, error) { - rows, err := q.db.Query(ctx, listSubagentsByBot, botID) - if err != nil { - return nil, err - } - defer rows.Close() - var items []Subagent - for rows.Next() { - var i Subagent - if err := rows.Scan( - &i.ID, - &i.Name, - &i.Description, - &i.CreatedAt, - &i.UpdatedAt, - &i.Deleted, - &i.DeletedAt, - &i.BotID, - &i.Messages, - &i.Metadata, - &i.Skills, - &i.Usage, - ); err != nil { - return nil, err - } - items = append(items, i) - } - if err := rows.Err(); err != nil { - return nil, err - } - return items, nil -} - -const softDeleteSubagent = `-- name: SoftDeleteSubagent :exec -UPDATE subagents -SET deleted = true, - deleted_at = now(), - updated_at = now() -WHERE id = $1 AND deleted = false -` - -func (q *Queries) SoftDeleteSubagent(ctx context.Context, id pgtype.UUID) error { - _, err := q.db.Exec(ctx, softDeleteSubagent, id) - return err -} - -const updateSubagent = `-- name: UpdateSubagent :one -UPDATE subagents -SET name = $2, - description = $3, - metadata = $4, - updated_at = now() -WHERE id = $1 AND deleted = false -RETURNING id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage -` - -type UpdateSubagentParams struct { - ID pgtype.UUID `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - Metadata []byte `json:"metadata"` -} - -func (q *Queries) UpdateSubagent(ctx context.Context, arg UpdateSubagentParams) (Subagent, error) { - row := q.db.QueryRow(ctx, updateSubagent, - arg.ID, - arg.Name, - arg.Description, - arg.Metadata, - ) - var i Subagent - err := row.Scan( - &i.ID, - &i.Name, - &i.Description, - &i.CreatedAt, - &i.UpdatedAt, - &i.Deleted, - &i.DeletedAt, - &i.BotID, - &i.Messages, - &i.Metadata, - &i.Skills, - &i.Usage, - ) - return i, err -} - -const updateSubagentMessages = `-- name: UpdateSubagentMessages :one -UPDATE subagents -SET messages = $2, - updated_at = now() -WHERE id = $1 AND deleted = false -RETURNING id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage -` - -type UpdateSubagentMessagesParams struct { - ID pgtype.UUID `json:"id"` - Messages []byte `json:"messages"` -} - -func (q *Queries) UpdateSubagentMessages(ctx context.Context, arg UpdateSubagentMessagesParams) (Subagent, error) { - row := q.db.QueryRow(ctx, updateSubagentMessages, arg.ID, arg.Messages) - var i Subagent - err := row.Scan( - &i.ID, - &i.Name, - &i.Description, - &i.CreatedAt, - &i.UpdatedAt, - &i.Deleted, - &i.DeletedAt, - &i.BotID, - &i.Messages, - &i.Metadata, - &i.Skills, - &i.Usage, - ) - return i, err -} - -const updateSubagentMessagesAndUsage = `-- name: UpdateSubagentMessagesAndUsage :one -UPDATE subagents -SET messages = $2, - usage = $3, - updated_at = now() -WHERE id = $1 AND deleted = false -RETURNING id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage -` - -type UpdateSubagentMessagesAndUsageParams struct { - ID pgtype.UUID `json:"id"` - Messages []byte `json:"messages"` - Usage []byte `json:"usage"` -} - -func (q *Queries) UpdateSubagentMessagesAndUsage(ctx context.Context, arg UpdateSubagentMessagesAndUsageParams) (Subagent, error) { - row := q.db.QueryRow(ctx, updateSubagentMessagesAndUsage, arg.ID, arg.Messages, arg.Usage) - var i Subagent - err := row.Scan( - &i.ID, - &i.Name, - &i.Description, - &i.CreatedAt, - &i.UpdatedAt, - &i.Deleted, - &i.DeletedAt, - &i.BotID, - &i.Messages, - &i.Metadata, - &i.Skills, - &i.Usage, - ) - return i, err -} - -const updateSubagentSkills = `-- name: UpdateSubagentSkills :one -UPDATE subagents -SET skills = $2, - updated_at = now() -WHERE id = $1 AND deleted = false -RETURNING id, name, description, created_at, updated_at, deleted, deleted_at, bot_id, messages, metadata, skills, usage -` - -type UpdateSubagentSkillsParams struct { - ID pgtype.UUID `json:"id"` - Skills []byte `json:"skills"` -} - -func (q *Queries) UpdateSubagentSkills(ctx context.Context, arg UpdateSubagentSkillsParams) (Subagent, error) { - row := q.db.QueryRow(ctx, updateSubagentSkills, arg.ID, arg.Skills) - var i Subagent - err := row.Scan( - &i.ID, - &i.Name, - &i.Description, - &i.CreatedAt, - &i.UpdatedAt, - &i.Deleted, - &i.DeletedAt, - &i.BotID, - &i.Messages, - &i.Metadata, - &i.Skills, - &i.Usage, - ) - return i, err -} diff --git a/internal/db/sqlc/token_usage.sql.go b/internal/db/sqlc/token_usage.sql.go index 5c65dbaa..b84eb1a2 100644 --- a/internal/db/sqlc/token_usage.sql.go +++ b/internal/db/sqlc/token_usage.sql.go @@ -13,7 +13,10 @@ import ( const getTokenUsageByDayAndType = `-- name: GetTokenUsageByDayAndType :many SELECT - COALESCE(s.type, 'chat')::text AS session_type, + COALESCE( + CASE WHEN s.type = 'subagent' THEN COALESCE(ps.type, 'chat') ELSE s.type END, + 'chat' + )::text AS session_type, date_trunc('day', m.created_at)::date AS day, COALESCE(SUM((m.usage->>'inputTokens')::bigint), 0)::bigint AS input_tokens, COALESCE(SUM((m.usage->>'outputTokens')::bigint), 0)::bigint AS output_tokens, @@ -22,6 +25,7 @@ SELECT COALESCE(SUM((m.usage->'outputTokenDetails'->>'reasoningTokens')::bigint), 0)::bigint AS reasoning_tokens FROM bot_history_messages m LEFT JOIN bot_sessions s ON s.id = m.session_id +LEFT JOIN bot_sessions ps ON ps.id = s.parent_session_id WHERE m.bot_id = $1 AND m.usage IS NOT NULL AND m.created_at >= $2 diff --git a/internal/handlers/subagent.go b/internal/handlers/subagent.go deleted file mode 100644 index 50e1b46e..00000000 --- a/internal/handlers/subagent.go +++ /dev/null @@ -1,438 +0,0 @@ -package handlers - -import ( - "context" - "log/slog" - "net/http" - "strings" - - "github.com/labstack/echo/v4" - - "github.com/memohai/memoh/internal/accounts" - "github.com/memohai/memoh/internal/bots" - "github.com/memohai/memoh/internal/subagent" -) - -type SubagentHandler struct { - service *subagent.Service - botService *bots.Service - accountService *accounts.Service - logger *slog.Logger -} - -func NewSubagentHandler(log *slog.Logger, service *subagent.Service, botService *bots.Service, accountService *accounts.Service) *SubagentHandler { - return &SubagentHandler{ - service: service, - botService: botService, - accountService: accountService, - logger: log.With(slog.String("handler", "subagent")), - } -} - -func (h *SubagentHandler) Register(e *echo.Echo) { - group := e.Group("/bots/:bot_id/subagents") - group.POST("", h.Create) - group.GET("", h.List) - group.GET("/:id", h.Get) - group.PUT("/:id", h.Update) - group.DELETE("/:id", h.Delete) - group.GET("/:id/context", h.GetContext) - group.PUT("/:id/context", h.UpdateContext) - group.GET("/:id/skills", h.GetSkills) - group.PUT("/:id/skills", h.UpdateSkills) - group.POST("/:id/skills", h.AddSkills) -} - -// Create godoc -// @Summary Create subagent -// @Description Create a subagent for current user -// @Tags subagent -// @Param payload body subagent.CreateRequest true "Subagent payload" -// @Success 201 {object} subagent.Subagent -// @Failure 400 {object} ErrorResponse -// @Failure 500 {object} ErrorResponse -// @Router /bots/{bot_id}/subagents [post]. -func (h *SubagentHandler) Create(c echo.Context) error { - channelIdentityID, err := h.requireChannelIdentityID(c) - if err != nil { - return err - } - botID := strings.TrimSpace(c.Param("bot_id")) - if botID == "" { - return echo.NewHTTPError(http.StatusBadRequest, "bot id is required") - } - if _, err := h.authorizeBotAccess(c.Request().Context(), channelIdentityID, botID); err != nil { - return err - } - var req subagent.CreateRequest - if err := c.Bind(&req); err != nil { - return echo.NewHTTPError(http.StatusBadRequest, err.Error()) - } - resp, err := h.service.Create(c.Request().Context(), botID, req) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) - } - return c.JSON(http.StatusCreated, resp) -} - -// List godoc -// @Summary List subagents -// @Description List subagents for current user -// @Tags subagent -// @Success 200 {object} subagent.ListResponse -// @Failure 400 {object} ErrorResponse -// @Failure 500 {object} ErrorResponse -// @Router /bots/{bot_id}/subagents [get]. -func (h *SubagentHandler) List(c echo.Context) error { - channelIdentityID, err := h.requireChannelIdentityID(c) - if err != nil { - return err - } - botID := strings.TrimSpace(c.Param("bot_id")) - if botID == "" { - return echo.NewHTTPError(http.StatusBadRequest, "bot id is required") - } - if _, err := h.authorizeBotAccess(c.Request().Context(), channelIdentityID, botID); err != nil { - return err - } - items, err := h.service.List(c.Request().Context(), botID) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) - } - return c.JSON(http.StatusOK, subagent.ListResponse{Items: items}) -} - -// Get godoc -// @Summary Get subagent -// @Description Get a subagent by ID -// @Tags subagent -// @Param id path string true "Subagent ID" -// @Success 200 {object} subagent.Subagent -// @Failure 400 {object} ErrorResponse -// @Failure 404 {object} ErrorResponse -// @Failure 500 {object} ErrorResponse -// @Router /bots/{bot_id}/subagents/{id} [get]. -func (h *SubagentHandler) Get(c echo.Context) error { - channelIdentityID, err := h.requireChannelIdentityID(c) - if err != nil { - return err - } - botID := strings.TrimSpace(c.Param("bot_id")) - if botID == "" { - return echo.NewHTTPError(http.StatusBadRequest, "bot id is required") - } - id := c.Param("id") - if id == "" { - return echo.NewHTTPError(http.StatusBadRequest, "id is required") - } - item, err := h.service.Get(c.Request().Context(), id) - if err != nil { - return echo.NewHTTPError(http.StatusNotFound, err.Error()) - } - if item.BotID != botID { - return echo.NewHTTPError(http.StatusForbidden, "bot mismatch") - } - if _, err := h.authorizeBotAccess(c.Request().Context(), channelIdentityID, botID); err != nil { - return err - } - return c.JSON(http.StatusOK, item) -} - -// Update godoc -// @Summary Update subagent -// @Description Update a subagent by ID -// @Tags subagent -// @Param id path string true "Subagent ID" -// @Param payload body subagent.UpdateRequest true "Subagent payload" -// @Success 200 {object} subagent.Subagent -// @Failure 400 {object} ErrorResponse -// @Failure 404 {object} ErrorResponse -// @Failure 500 {object} ErrorResponse -// @Router /bots/{bot_id}/subagents/{id} [put]. -func (h *SubagentHandler) Update(c echo.Context) error { - channelIdentityID, err := h.requireChannelIdentityID(c) - if err != nil { - return err - } - botID := strings.TrimSpace(c.Param("bot_id")) - if botID == "" { - return echo.NewHTTPError(http.StatusBadRequest, "bot id is required") - } - id := c.Param("id") - if id == "" { - return echo.NewHTTPError(http.StatusBadRequest, "id is required") - } - var req subagent.UpdateRequest - if err := c.Bind(&req); err != nil { - return echo.NewHTTPError(http.StatusBadRequest, err.Error()) - } - item, err := h.service.Get(c.Request().Context(), id) - if err != nil { - return echo.NewHTTPError(http.StatusNotFound, err.Error()) - } - if item.BotID != botID { - return echo.NewHTTPError(http.StatusForbidden, "bot mismatch") - } - if _, err := h.authorizeBotAccess(c.Request().Context(), channelIdentityID, botID); err != nil { - return err - } - resp, err := h.service.Update(c.Request().Context(), id, req) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) - } - return c.JSON(http.StatusOK, resp) -} - -// Delete godoc -// @Summary Delete subagent -// @Description Delete a subagent by ID -// @Tags subagent -// @Param id path string true "Subagent ID" -// @Success 204 "No Content" -// @Failure 400 {object} ErrorResponse -// @Failure 404 {object} ErrorResponse -// @Failure 500 {object} ErrorResponse -// @Router /bots/{bot_id}/subagents/{id} [delete]. -func (h *SubagentHandler) Delete(c echo.Context) error { - channelIdentityID, err := h.requireChannelIdentityID(c) - if err != nil { - return err - } - botID := strings.TrimSpace(c.Param("bot_id")) - if botID == "" { - return echo.NewHTTPError(http.StatusBadRequest, "bot id is required") - } - id := c.Param("id") - if id == "" { - return echo.NewHTTPError(http.StatusBadRequest, "id is required") - } - item, err := h.service.Get(c.Request().Context(), id) - if err != nil { - return echo.NewHTTPError(http.StatusNotFound, err.Error()) - } - if item.BotID != botID { - return echo.NewHTTPError(http.StatusForbidden, "bot mismatch") - } - if _, err := h.authorizeBotAccess(c.Request().Context(), channelIdentityID, botID); err != nil { - return err - } - if err := h.service.Delete(c.Request().Context(), id); err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) - } - return c.NoContent(http.StatusNoContent) -} - -// GetContext godoc -// @Summary Get subagent context -// @Description Get a subagent's message context -// @Tags subagent -// @Param id path string true "Subagent ID" -// @Success 200 {object} subagent.ContextResponse -// @Failure 400 {object} ErrorResponse -// @Failure 404 {object} ErrorResponse -// @Failure 500 {object} ErrorResponse -// @Router /bots/{bot_id}/subagents/{id}/context [get]. -func (h *SubagentHandler) GetContext(c echo.Context) error { - channelIdentityID, err := h.requireChannelIdentityID(c) - if err != nil { - return err - } - botID := strings.TrimSpace(c.Param("bot_id")) - if botID == "" { - return echo.NewHTTPError(http.StatusBadRequest, "bot id is required") - } - id := c.Param("id") - if id == "" { - return echo.NewHTTPError(http.StatusBadRequest, "id is required") - } - item, err := h.service.Get(c.Request().Context(), id) - if err != nil { - return echo.NewHTTPError(http.StatusNotFound, err.Error()) - } - if item.BotID != botID { - return echo.NewHTTPError(http.StatusForbidden, "bot mismatch") - } - if _, err := h.authorizeBotAccess(c.Request().Context(), channelIdentityID, botID); err != nil { - return err - } - return c.JSON(http.StatusOK, subagent.ContextResponse{Messages: item.Messages, Usage: item.Usage}) -} - -// UpdateContext godoc -// @Summary Update subagent context -// @Description Update a subagent's message context -// @Tags subagent -// @Param id path string true "Subagent ID" -// @Param payload body subagent.UpdateContextRequest true "Context payload" -// @Success 200 {object} subagent.ContextResponse -// @Failure 400 {object} ErrorResponse -// @Failure 404 {object} ErrorResponse -// @Failure 500 {object} ErrorResponse -// @Router /bots/{bot_id}/subagents/{id}/context [put]. -func (h *SubagentHandler) UpdateContext(c echo.Context) error { - channelIdentityID, err := h.requireChannelIdentityID(c) - if err != nil { - return err - } - botID := strings.TrimSpace(c.Param("bot_id")) - if botID == "" { - return echo.NewHTTPError(http.StatusBadRequest, "bot id is required") - } - id := c.Param("id") - if id == "" { - return echo.NewHTTPError(http.StatusBadRequest, "id is required") - } - var req subagent.UpdateContextRequest - if err := c.Bind(&req); err != nil { - return echo.NewHTTPError(http.StatusBadRequest, err.Error()) - } - item, err := h.service.Get(c.Request().Context(), id) - if err != nil { - return echo.NewHTTPError(http.StatusNotFound, err.Error()) - } - if item.BotID != botID { - return echo.NewHTTPError(http.StatusForbidden, "bot mismatch") - } - if _, err := h.authorizeBotAccess(c.Request().Context(), channelIdentityID, botID); err != nil { - return err - } - updated, err := h.service.UpdateContext(c.Request().Context(), id, req) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) - } - return c.JSON(http.StatusOK, subagent.ContextResponse{Messages: updated.Messages, Usage: updated.Usage}) -} - -// GetSkills godoc -// @Summary Get subagent skills -// @Description Get a subagent's skills -// @Tags subagent -// @Param id path string true "Subagent ID" -// @Success 200 {object} subagent.SkillsResponse -// @Failure 400 {object} ErrorResponse -// @Failure 404 {object} ErrorResponse -// @Failure 500 {object} ErrorResponse -// @Router /bots/{bot_id}/subagents/{id}/skills [get]. -func (h *SubagentHandler) GetSkills(c echo.Context) error { - channelIdentityID, err := h.requireChannelIdentityID(c) - if err != nil { - return err - } - botID := strings.TrimSpace(c.Param("bot_id")) - if botID == "" { - return echo.NewHTTPError(http.StatusBadRequest, "bot id is required") - } - id := c.Param("id") - if id == "" { - return echo.NewHTTPError(http.StatusBadRequest, "id is required") - } - item, err := h.service.Get(c.Request().Context(), id) - if err != nil { - return echo.NewHTTPError(http.StatusNotFound, err.Error()) - } - if item.BotID != botID { - return echo.NewHTTPError(http.StatusForbidden, "bot mismatch") - } - if _, err := h.authorizeBotAccess(c.Request().Context(), channelIdentityID, botID); err != nil { - return err - } - return c.JSON(http.StatusOK, subagent.SkillsResponse{Skills: item.Skills}) -} - -// UpdateSkills godoc -// @Summary Update subagent skills -// @Description Replace a subagent's skills -// @Tags subagent -// @Param id path string true "Subagent ID" -// @Param payload body subagent.UpdateSkillsRequest true "Skills payload" -// @Success 200 {object} subagent.SkillsResponse -// @Failure 400 {object} ErrorResponse -// @Failure 404 {object} ErrorResponse -// @Failure 500 {object} ErrorResponse -// @Router /bots/{bot_id}/subagents/{id}/skills [put]. -func (h *SubagentHandler) UpdateSkills(c echo.Context) error { - channelIdentityID, err := h.requireChannelIdentityID(c) - if err != nil { - return err - } - botID := strings.TrimSpace(c.Param("bot_id")) - if botID == "" { - return echo.NewHTTPError(http.StatusBadRequest, "bot id is required") - } - id := c.Param("id") - if id == "" { - return echo.NewHTTPError(http.StatusBadRequest, "id is required") - } - var req subagent.UpdateSkillsRequest - if err := c.Bind(&req); err != nil { - return echo.NewHTTPError(http.StatusBadRequest, err.Error()) - } - item, err := h.service.Get(c.Request().Context(), id) - if err != nil { - return echo.NewHTTPError(http.StatusNotFound, err.Error()) - } - if item.BotID != botID { - return echo.NewHTTPError(http.StatusForbidden, "bot mismatch") - } - if _, err := h.authorizeBotAccess(c.Request().Context(), channelIdentityID, botID); err != nil { - return err - } - updated, err := h.service.UpdateSkills(c.Request().Context(), id, req) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) - } - return c.JSON(http.StatusOK, subagent.SkillsResponse{Skills: updated.Skills}) -} - -// AddSkills godoc -// @Summary Add subagent skills -// @Description Add skills to a subagent -// @Tags subagent -// @Param id path string true "Subagent ID" -// @Param payload body subagent.AddSkillsRequest true "Skills payload" -// @Success 200 {object} subagent.SkillsResponse -// @Failure 400 {object} ErrorResponse -// @Failure 404 {object} ErrorResponse -// @Failure 500 {object} ErrorResponse -// @Router /bots/{bot_id}/subagents/{id}/skills [post]. -func (h *SubagentHandler) AddSkills(c echo.Context) error { - channelIdentityID, err := h.requireChannelIdentityID(c) - if err != nil { - return err - } - botID := strings.TrimSpace(c.Param("bot_id")) - if botID == "" { - return echo.NewHTTPError(http.StatusBadRequest, "bot id is required") - } - id := c.Param("id") - if id == "" { - return echo.NewHTTPError(http.StatusBadRequest, "id is required") - } - var req subagent.AddSkillsRequest - if err := c.Bind(&req); err != nil { - return echo.NewHTTPError(http.StatusBadRequest, err.Error()) - } - item, err := h.service.Get(c.Request().Context(), id) - if err != nil { - return echo.NewHTTPError(http.StatusNotFound, err.Error()) - } - if item.BotID != botID { - return echo.NewHTTPError(http.StatusForbidden, "user mismatch") - } - if _, err := h.authorizeBotAccess(c.Request().Context(), channelIdentityID, botID); err != nil { - return err - } - updated, err := h.service.AddSkills(c.Request().Context(), id, req) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) - } - return c.JSON(http.StatusOK, subagent.SkillsResponse{Skills: updated.Skills}) -} - -func (*SubagentHandler) requireChannelIdentityID(c echo.Context) (string, error) { - return RequireChannelIdentityID(c) -} - -func (h *SubagentHandler) authorizeBotAccess(ctx context.Context, channelIdentityID, botID string) (bots.Bot, error) { - return AuthorizeBotAccess(ctx, h.botService, h.accountService, channelIdentityID, botID) -} diff --git a/internal/session/service.go b/internal/session/service.go index 98295e7e..a719393b 100644 --- a/internal/session/service.go +++ b/internal/session/service.go @@ -23,6 +23,7 @@ type Session struct { Type string `json:"type"` Title string `json:"title"` Metadata map[string]any `json:"metadata,omitempty"` + ParentSessionID string `json:"parent_session_id,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` RouteMetadata map[string]any `json:"route_metadata,omitempty"` @@ -33,16 +34,18 @@ const ( TypeChat = "chat" TypeHeartbeat = "heartbeat" TypeSchedule = "schedule" + TypeSubagent = "subagent" ) // CreateInput holds input for creating a new session. type CreateInput struct { - BotID string - RouteID string - ChannelType string - Type string - Title string - Metadata map[string]any + BotID string + RouteID string + ChannelType string + Type string + Title string + Metadata map[string]any + ParentSessionID string } // Service manages bot chat sessions. @@ -92,13 +95,19 @@ func (s *Service) Create(ctx context.Context, input CreateInput) (Session, error sessionType = TypeChat } + pgParentSessionID, err := parseOptionalUUID(input.ParentSessionID) + if err != nil { + return Session{}, fmt.Errorf("invalid parent session id: %w", err) + } + row, err := s.queries.CreateSession(ctx, sqlc.CreateSessionParams{ - BotID: pgBotID, - RouteID: pgRouteID, - ChannelType: channelType, - Type: sessionType, - Title: input.Title, - Metadata: metaBytes, + BotID: pgBotID, + RouteID: pgRouteID, + ChannelType: channelType, + Type: sessionType, + Title: input.Title, + Metadata: metaBytes, + ParentSessionID: pgParentSessionID, }) if err != nil { return Session{}, err @@ -280,16 +289,21 @@ func (s *Service) EnsureActiveSession(ctx context.Context, botID, routeID, chann } func toSession(row sqlc.BotSession) Session { + parentID := "" + if row.ParentSessionID.Valid { + parentID = row.ParentSessionID.String() + } return Session{ - ID: row.ID.String(), - BotID: row.BotID.String(), - RouteID: row.RouteID.String(), - ChannelType: dbpkg.TextToString(row.ChannelType), - Type: row.Type, - Title: row.Title, - Metadata: parseJSONMap(row.Metadata), - CreatedAt: row.CreatedAt.Time, - UpdatedAt: row.UpdatedAt.Time, + ID: row.ID.String(), + BotID: row.BotID.String(), + RouteID: row.RouteID.String(), + ChannelType: dbpkg.TextToString(row.ChannelType), + Type: row.Type, + Title: row.Title, + Metadata: parseJSONMap(row.Metadata), + ParentSessionID: parentID, + CreatedAt: row.CreatedAt.Time, + UpdatedAt: row.UpdatedAt.Time, } } diff --git a/internal/subagent/service.go b/internal/subagent/service.go deleted file mode 100644 index 15991540..00000000 --- a/internal/subagent/service.go +++ /dev/null @@ -1,402 +0,0 @@ -package subagent - -import ( - "context" - "encoding/json" - "errors" - "log/slog" - "strings" - - "github.com/jackc/pgx/v5" - - "github.com/memohai/memoh/internal/db" - "github.com/memohai/memoh/internal/db/sqlc" -) - -type Service struct { - queries *sqlc.Queries - logger *slog.Logger -} - -func NewService(log *slog.Logger, queries *sqlc.Queries) *Service { - return &Service{ - queries: queries, - logger: log.With(slog.String("service", "subagent")), - } -} - -func (s *Service) Create(ctx context.Context, botID string, req CreateRequest) (Subagent, error) { - if s.queries == nil { - return Subagent{}, errors.New("subagent queries not configured") - } - name := strings.TrimSpace(req.Name) - if name == "" { - return Subagent{}, errors.New("name is required") - } - description := strings.TrimSpace(req.Description) - if description == "" { - return Subagent{}, errors.New("description is required") - } - pgBotID, err := db.ParseUUID(botID) - if err != nil { - return Subagent{}, err - } - messagesPayload, err := marshalMessages(req.Messages) - if err != nil { - return Subagent{}, err - } - metadataPayload, err := marshalMetadata(req.Metadata) - if err != nil { - return Subagent{}, err - } - skillsPayload, err := marshalSkills(req.Skills) - if err != nil { - return Subagent{}, err - } - row, err := s.queries.CreateSubagent(ctx, sqlc.CreateSubagentParams{ - Name: name, - Description: description, - BotID: pgBotID, - Messages: messagesPayload, - Metadata: metadataPayload, - Skills: skillsPayload, - }) - if err != nil { - return Subagent{}, err - } - return toSubagent(row) -} - -func (s *Service) Get(ctx context.Context, id string) (Subagent, error) { - pgID, err := db.ParseUUID(id) - if err != nil { - return Subagent{}, err - } - row, err := s.queries.GetSubagentByID(ctx, pgID) - if err != nil { - if errors.Is(err, pgx.ErrNoRows) { - return Subagent{}, errors.New("subagent not found") - } - return Subagent{}, err - } - return toSubagent(row) -} - -func (s *Service) GetByBotAndName(ctx context.Context, botID string, name string) (Subagent, error) { - pgBotID, err := db.ParseUUID(botID) - if err != nil { - return Subagent{}, err - } - row, err := s.queries.GetSubagentByBotAndName(ctx, sqlc.GetSubagentByBotAndNameParams{ - BotID: pgBotID, - Name: strings.TrimSpace(name), - }) - if err != nil { - if errors.Is(err, pgx.ErrNoRows) { - return Subagent{}, errors.New("subagent not found") - } - return Subagent{}, err - } - return toSubagent(row) -} - -func (s *Service) GetOrCreate(ctx context.Context, botID string, req CreateRequest) (Subagent, error) { - existing, err := s.GetByBotAndName(ctx, botID, req.Name) - if err == nil { - return existing, nil - } - return s.Create(ctx, botID, req) -} - -func (s *Service) List(ctx context.Context, botID string) ([]Subagent, error) { - pgBotID, err := db.ParseUUID(botID) - if err != nil { - return nil, err - } - rows, err := s.queries.ListSubagentsByBot(ctx, pgBotID) - if err != nil { - return nil, err - } - items := make([]Subagent, 0, len(rows)) - for _, row := range rows { - item, err := toSubagent(row) - if err != nil { - return nil, err - } - items = append(items, item) - } - return items, nil -} - -func (s *Service) Update(ctx context.Context, id string, req UpdateRequest) (Subagent, error) { - existing, err := s.Get(ctx, id) - if err != nil { - return Subagent{}, err - } - name := existing.Name - if req.Name != nil { - name = strings.TrimSpace(*req.Name) - if name == "" { - return Subagent{}, errors.New("name is required") - } - } - description := existing.Description - if req.Description != nil { - description = strings.TrimSpace(*req.Description) - if description == "" { - return Subagent{}, errors.New("description is required") - } - } - metadata := existing.Metadata - if req.Metadata != nil { - metadata = req.Metadata - } - metadataPayload, err := marshalMetadata(metadata) - if err != nil { - return Subagent{}, err - } - pgID, err := db.ParseUUID(id) - if err != nil { - return Subagent{}, err - } - row, err := s.queries.UpdateSubagent(ctx, sqlc.UpdateSubagentParams{ - ID: pgID, - Name: name, - Description: description, - Metadata: metadataPayload, - }) - if err != nil { - return Subagent{}, err - } - return toSubagent(row) -} - -func (s *Service) UpdateContext(ctx context.Context, id string, req UpdateContextRequest) (Subagent, error) { - messagesPayload, err := marshalMessages(req.Messages) - if err != nil { - return Subagent{}, err - } - pgID, err := db.ParseUUID(id) - if err != nil { - return Subagent{}, err - } - if req.Usage != nil { - usagePayload, err := marshalUsage(req.Usage) - if err != nil { - return Subagent{}, err - } - row, err := s.queries.UpdateSubagentMessagesAndUsage(ctx, sqlc.UpdateSubagentMessagesAndUsageParams{ - ID: pgID, - Messages: messagesPayload, - Usage: usagePayload, - }) - if err != nil { - return Subagent{}, err - } - return toSubagent(row) - } - row, err := s.queries.UpdateSubagentMessages(ctx, sqlc.UpdateSubagentMessagesParams{ - ID: pgID, - Messages: messagesPayload, - }) - if err != nil { - return Subagent{}, err - } - return toSubagent(row) -} - -func (s *Service) UpdateSkills(ctx context.Context, id string, req UpdateSkillsRequest) (Subagent, error) { - skillsPayload, err := marshalSkills(req.Skills) - if err != nil { - return Subagent{}, err - } - pgID, err := db.ParseUUID(id) - if err != nil { - return Subagent{}, err - } - row, err := s.queries.UpdateSubagentSkills(ctx, sqlc.UpdateSubagentSkillsParams{ - ID: pgID, - Skills: skillsPayload, - }) - if err != nil { - return Subagent{}, err - } - return toSubagent(row) -} - -func (s *Service) AddSkills(ctx context.Context, id string, req AddSkillsRequest) (Subagent, error) { - existing, err := s.Get(ctx, id) - if err != nil { - return Subagent{}, err - } - merged := mergeSkills(existing.Skills, req.Skills) - payload, err := marshalSkills(merged) - if err != nil { - return Subagent{}, err - } - pgID, err := db.ParseUUID(id) - if err != nil { - return Subagent{}, err - } - row, err := s.queries.UpdateSubagentSkills(ctx, sqlc.UpdateSubagentSkillsParams{ - ID: pgID, - Skills: payload, - }) - if err != nil { - return Subagent{}, err - } - return toSubagent(row) -} - -func (s *Service) Delete(ctx context.Context, id string) error { - pgID, err := db.ParseUUID(id) - if err != nil { - return err - } - return s.queries.SoftDeleteSubagent(ctx, pgID) -} - -func toSubagent(row sqlc.Subagent) (Subagent, error) { - messages, err := unmarshalMessages(row.Messages) - if err != nil { - return Subagent{}, err - } - metadata, err := unmarshalMetadata(row.Metadata) - if err != nil { - return Subagent{}, err - } - skills, err := unmarshalSkills(row.Skills) - if err != nil { - return Subagent{}, err - } - usage, err := unmarshalUsage(row.Usage) - if err != nil { - return Subagent{}, err - } - item := Subagent{ - ID: row.ID.String(), - Name: row.Name, - Description: row.Description, - BotID: row.BotID.String(), - Messages: messages, - Metadata: metadata, - Skills: skills, - Usage: usage, - Deleted: row.Deleted, - } - if row.CreatedAt.Valid { - item.CreatedAt = row.CreatedAt.Time - } - if row.UpdatedAt.Valid { - item.UpdatedAt = row.UpdatedAt.Time - } - if row.DeletedAt.Valid { - deletedAt := row.DeletedAt.Time - item.DeletedAt = &deletedAt - } - return item, nil -} - -func marshalMessages(messages []map[string]any) ([]byte, error) { - if messages == nil { - messages = []map[string]any{} - } - return json.Marshal(messages) -} - -func unmarshalMessages(payload []byte) ([]map[string]any, error) { - if len(payload) == 0 { - return []map[string]any{}, nil - } - var messages []map[string]any - if err := json.Unmarshal(payload, &messages); err != nil { - return nil, err - } - if messages == nil { - messages = []map[string]any{} - } - return messages, nil -} - -func marshalMetadata(metadata map[string]any) ([]byte, error) { - if metadata == nil { - metadata = map[string]any{} - } - return json.Marshal(metadata) -} - -func unmarshalMetadata(payload []byte) (map[string]any, error) { - if len(payload) == 0 { - return map[string]any{}, nil - } - var metadata map[string]any - if err := json.Unmarshal(payload, &metadata); err != nil { - return nil, err - } - if metadata == nil { - metadata = map[string]any{} - } - return metadata, nil -} - -func marshalUsage(usage map[string]any) ([]byte, error) { - if usage == nil { - usage = map[string]any{} - } - return json.Marshal(usage) -} - -func unmarshalUsage(payload []byte) (map[string]any, error) { - if len(payload) == 0 { - return map[string]any{}, nil - } - var usage map[string]any - if err := json.Unmarshal(payload, &usage); err != nil { - return nil, err - } - if usage == nil { - usage = map[string]any{} - } - return usage, nil -} - -func marshalSkills(skills []string) ([]byte, error) { - return json.Marshal(normalizeSkills(skills)) -} - -func unmarshalSkills(payload []byte) ([]string, error) { - if len(payload) == 0 { - return []string{}, nil - } - var skills []string - if err := json.Unmarshal(payload, &skills); err != nil { - return nil, err - } - if skills == nil { - skills = []string{} - } - return skills, nil -} - -func normalizeSkills(skills []string) []string { - seen := map[string]struct{}{} - normalized := make([]string, 0, len(skills)) - for _, skill := range skills { - trimmed := strings.TrimSpace(skill) - if trimmed == "" { - continue - } - if _, ok := seen[trimmed]; ok { - continue - } - seen[trimmed] = struct{}{} - normalized = append(normalized, trimmed) - } - return normalized -} - -func mergeSkills(existing []string, incoming []string) []string { - merged := append([]string{}, existing...) - merged = append(merged, incoming...) - return normalizeSkills(merged) -} diff --git a/internal/subagent/types.go b/internal/subagent/types.go deleted file mode 100644 index 90126be0..00000000 --- a/internal/subagent/types.go +++ /dev/null @@ -1,58 +0,0 @@ -package subagent - -import "time" - -type Subagent struct { - ID string `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - BotID string `json:"bot_id"` - Messages []map[string]any `json:"messages"` - Metadata map[string]any `json:"metadata"` - Skills []string `json:"skills"` - Usage map[string]any `json:"usage"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - Deleted bool `json:"deleted"` - DeletedAt *time.Time `json:"deleted_at,omitempty"` -} - -type CreateRequest struct { - Name string `json:"name"` - Description string `json:"description"` - Messages []map[string]any `json:"messages,omitempty"` - Metadata map[string]any `json:"metadata,omitempty"` - Skills []string `json:"skills,omitempty"` -} - -type UpdateRequest struct { - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - Metadata map[string]any `json:"metadata,omitempty"` -} - -type UpdateContextRequest struct { - Messages []map[string]any `json:"messages"` - Usage map[string]any `json:"usage,omitempty"` -} - -type UpdateSkillsRequest struct { - Skills []string `json:"skills"` -} - -type AddSkillsRequest struct { - Skills []string `json:"skills"` -} - -type ListResponse struct { - Items []Subagent `json:"items"` -} - -type ContextResponse struct { - Messages []map[string]any `json:"messages"` - Usage map[string]any `json:"usage"` -} - -type SkillsResponse struct { - Skills []string `json:"skills"` -} diff --git a/packages/sdk/src/@pinia/colada.gen.ts b/packages/sdk/src/@pinia/colada.gen.ts index 199c4e3b..a232d0de 100644 --- a/packages/sdk/src/@pinia/colada.gen.ts +++ b/packages/sdk/src/@pinia/colada.gen.ts @@ -4,8 +4,8 @@ import { type _JSONValue, defineQueryOptions, type UseMutationOptions } from '@p import { serializeQueryKeyValue } from '../client'; import { client } from '../client.gen'; -import { deleteBotsByBotIdBlacklistByRuleId, deleteBotsByBotIdCompactionLogs, deleteBotsByBotIdContainer, deleteBotsByBotIdContainerSkills, deleteBotsByBotIdEmailBindingsById, deleteBotsByBotIdHeartbeatLogs, deleteBotsByBotIdMcpById, deleteBotsByBotIdMcpByIdOauthToken, deleteBotsByBotIdMemory, deleteBotsByBotIdMemoryById, deleteBotsByBotIdMessages, deleteBotsByBotIdScheduleById, deleteBotsByBotIdScheduleLogs, deleteBotsByBotIdSessionsBySessionId, deleteBotsByBotIdSettings, deleteBotsByBotIdSubagentsById, deleteBotsByBotIdWhitelistByRuleId, deleteBotsById, deleteBotsByIdChannelByPlatform, deleteBrowserContextsById, deleteEmailProvidersById, deleteEmailProvidersByIdOauthToken, deleteMemoryProvidersById, deleteModelsById, deleteModelsModelByModelId, deleteProvidersById, deleteSearchProvidersById, deleteTtsModelsById, deleteTtsProvidersById, getBots, getBotsByBotIdAccessChannelIdentities, getBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversations, getBotsByBotIdAccessUsers, getBotsByBotIdBlacklist, getBotsByBotIdCliWs, getBotsByBotIdCompactionLogs, getBotsByBotIdContainer, getBotsByBotIdContainerFs, getBotsByBotIdContainerFsDownload, getBotsByBotIdContainerFsList, getBotsByBotIdContainerFsRead, getBotsByBotIdContainerSkills, getBotsByBotIdContainerSnapshots, getBotsByBotIdContainerTerminal, getBotsByBotIdContainerTerminalWs, getBotsByBotIdEmailBindings, getBotsByBotIdEmailOutbox, getBotsByBotIdEmailOutboxById, getBotsByBotIdHeartbeatLogs, getBotsByBotIdMcp, getBotsByBotIdMcpById, getBotsByBotIdMcpByIdOauthStatus, getBotsByBotIdMcpExport, getBotsByBotIdMemory, getBotsByBotIdMemoryStatus, getBotsByBotIdMemoryUsage, getBotsByBotIdMessages, getBotsByBotIdSchedule, getBotsByBotIdScheduleById, getBotsByBotIdScheduleByIdLogs, getBotsByBotIdScheduleLogs, getBotsByBotIdSessions, getBotsByBotIdSessionsBySessionId, getBotsByBotIdSettings, getBotsByBotIdSubagents, getBotsByBotIdSubagentsById, getBotsByBotIdSubagentsByIdContext, getBotsByBotIdSubagentsByIdSkills, getBotsByBotIdTokenUsage, getBotsByBotIdWebWs, getBotsByBotIdWhitelist, getBotsById, getBotsByIdChannelByPlatform, getBotsByIdChecks, getBrowserContexts, getBrowserContextsById, getBrowserContextsCores, getChannels, getChannelsByPlatform, getEmailOauthCallback, getEmailProviders, getEmailProvidersById, getEmailProvidersByIdOauthAuthorize, getEmailProvidersByIdOauthStatus, getEmailProvidersMeta, getMemoryProviders, getMemoryProvidersById, getMemoryProvidersByIdStatus, getMemoryProvidersMeta, getModels, getModelsById, getModelsCount, getModelsModelByModelId, getPing, getProviders, getProvidersById, getProvidersByIdModels, getProvidersCount, getProvidersNameByName, getSearchProviders, getSearchProvidersById, getSearchProvidersMeta, getTtsModels, getTtsModelsById, getTtsModelsByIdCapabilities, getTtsProviders, getTtsProvidersById, getTtsProvidersByIdModels, getTtsProvidersMeta, getUsers, getUsersById, getUsersMe, getUsersMeChannelsByPlatform, getUsersMeIdentities, type Options, patchBotsByBotIdSessionsBySessionId, patchBotsByIdChannelByPlatformStatus, postAuthLogin, postAuthRefresh, postBots, postBotsByBotIdCliMessages, postBotsByBotIdContainer, postBotsByBotIdContainerDataExport, postBotsByBotIdContainerDataImport, postBotsByBotIdContainerDataRestore, postBotsByBotIdContainerFsDelete, postBotsByBotIdContainerFsMkdir, postBotsByBotIdContainerFsRename, postBotsByBotIdContainerFsUpload, postBotsByBotIdContainerFsWrite, postBotsByBotIdContainerSkills, postBotsByBotIdContainerSnapshots, postBotsByBotIdContainerSnapshotsRollback, postBotsByBotIdContainerStart, postBotsByBotIdContainerStop, postBotsByBotIdEmailBindings, postBotsByBotIdMcp, postBotsByBotIdMcpByIdOauthAuthorize, postBotsByBotIdMcpByIdOauthDiscover, postBotsByBotIdMcpByIdOauthExchange, postBotsByBotIdMcpByIdProbe, postBotsByBotIdMcpOpsBatchDelete, postBotsByBotIdMcpStdio, postBotsByBotIdMcpStdioByConnectionId, postBotsByBotIdMemory, postBotsByBotIdMemoryCompact, postBotsByBotIdMemoryRebuild, postBotsByBotIdMemorySearch, postBotsByBotIdSchedule, postBotsByBotIdSessions, postBotsByBotIdSettings, postBotsByBotIdSubagents, postBotsByBotIdSubagentsByIdSkills, postBotsByBotIdTools, postBotsByBotIdTtsSynthesize, postBotsByBotIdWebMessages, postBotsByIdChannelByPlatformSend, postBotsByIdChannelByPlatformSendChat, postBrowserContexts, postEmailMailgunWebhookByConfigId, postEmailProviders, postMemoryProviders, postModels, postModelsByIdTest, postProviders, postProvidersByIdImportModels, postProvidersByIdTest, postSearchProviders, postTtsModels, postTtsModelsByIdTest, postTtsProviders, postTtsProvidersByIdImportModels, postUsers, putBotsByBotIdBlacklist, putBotsByBotIdEmailBindingsById, putBotsByBotIdMcpById, putBotsByBotIdMcpImport, putBotsByBotIdScheduleById, putBotsByBotIdSettings, putBotsByBotIdSubagentsById, putBotsByBotIdSubagentsByIdContext, putBotsByBotIdSubagentsByIdSkills, putBotsByBotIdWhitelist, putBotsById, putBotsByIdChannelByPlatform, putBotsByIdOwner, putBrowserContextsById, putEmailProvidersById, putMemoryProvidersById, putModelsById, putModelsModelByModelId, putProvidersById, putSearchProvidersById, putTtsModelsById, putTtsProvidersById, putUsersById, putUsersByIdPassword, putUsersMe, putUsersMeChannelsByPlatform, putUsersMePassword } from '../sdk.gen'; -import type { DeleteBotsByBotIdBlacklistByRuleIdData, DeleteBotsByBotIdBlacklistByRuleIdError, DeleteBotsByBotIdCompactionLogsData, DeleteBotsByBotIdCompactionLogsError, DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerError, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsError, DeleteBotsByBotIdContainerSkillsResponse, DeleteBotsByBotIdEmailBindingsByIdData, DeleteBotsByBotIdEmailBindingsByIdError, DeleteBotsByBotIdHeartbeatLogsData, DeleteBotsByBotIdHeartbeatLogsError, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdError, DeleteBotsByBotIdMcpByIdOauthTokenData, DeleteBotsByBotIdMcpByIdOauthTokenError, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdError, DeleteBotsByBotIdMemoryByIdResponse, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryError, DeleteBotsByBotIdMemoryResponse, DeleteBotsByBotIdMessagesData, DeleteBotsByBotIdMessagesError, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdError, DeleteBotsByBotIdScheduleLogsData, DeleteBotsByBotIdScheduleLogsError, DeleteBotsByBotIdSessionsBySessionIdData, DeleteBotsByBotIdSessionsBySessionIdError, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsError, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdError, DeleteBotsByBotIdWhitelistByRuleIdData, DeleteBotsByBotIdWhitelistByRuleIdError, DeleteBotsByIdChannelByPlatformData, DeleteBotsByIdChannelByPlatformError, DeleteBotsByIdData, DeleteBotsByIdError, DeleteBotsByIdResponse, DeleteBrowserContextsByIdData, DeleteBrowserContextsByIdError, DeleteEmailProvidersByIdData, DeleteEmailProvidersByIdError, DeleteEmailProvidersByIdOauthTokenData, DeleteEmailProvidersByIdOauthTokenError, DeleteMemoryProvidersByIdData, DeleteMemoryProvidersByIdError, DeleteModelsByIdData, DeleteModelsByIdError, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdError, DeleteProvidersByIdData, DeleteProvidersByIdError, DeleteSearchProvidersByIdData, DeleteSearchProvidersByIdError, DeleteTtsModelsByIdData, DeleteTtsModelsByIdError, DeleteTtsProvidersByIdData, DeleteTtsProvidersByIdError, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsData, GetBotsByBotIdAccessChannelIdentitiesData, GetBotsByBotIdAccessUsersData, GetBotsByBotIdBlacklistData, GetBotsByBotIdCliWsData, GetBotsByBotIdCompactionLogsData, GetBotsByBotIdContainerData, GetBotsByBotIdContainerFsData, GetBotsByBotIdContainerFsDownloadData, GetBotsByBotIdContainerFsListData, GetBotsByBotIdContainerFsReadData, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerTerminalData, GetBotsByBotIdContainerTerminalWsData, GetBotsByBotIdEmailBindingsData, GetBotsByBotIdEmailOutboxByIdData, GetBotsByBotIdEmailOutboxData, GetBotsByBotIdHeartbeatLogsData, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdOauthStatusData, GetBotsByBotIdMcpData, GetBotsByBotIdMcpExportData, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryStatusData, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMessagesData, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdLogsData, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleLogsData, GetBotsByBotIdSessionsBySessionIdData, GetBotsByBotIdSessionsData, GetBotsByBotIdSettingsData, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsData, GetBotsByBotIdTokenUsageData, GetBotsByBotIdWebWsData, GetBotsByBotIdWhitelistData, GetBotsByIdChannelByPlatformData, GetBotsByIdChecksData, GetBotsByIdData, GetBotsData, GetBrowserContextsByIdData, GetBrowserContextsCoresData, GetBrowserContextsData, GetChannelsByPlatformData, GetChannelsData, GetEmailOauthCallbackData, GetEmailProvidersByIdData, GetEmailProvidersByIdOauthAuthorizeData, GetEmailProvidersByIdOauthStatusData, GetEmailProvidersData, GetEmailProvidersMetaData, GetMemoryProvidersByIdData, GetMemoryProvidersByIdStatusData, GetMemoryProvidersData, GetMemoryProvidersMetaData, GetModelsByIdData, GetModelsCountData, GetModelsData, GetModelsModelByModelIdData, GetPingData, GetProvidersByIdData, GetProvidersByIdModelsData, GetProvidersCountData, GetProvidersData, GetProvidersNameByNameData, GetSearchProvidersByIdData, GetSearchProvidersData, GetSearchProvidersMetaData, GetTtsModelsByIdCapabilitiesData, GetTtsModelsByIdData, GetTtsModelsData, GetTtsProvidersByIdData, GetTtsProvidersByIdModelsData, GetTtsProvidersData, GetTtsProvidersMetaData, GetUsersByIdData, GetUsersData, GetUsersMeChannelsByPlatformData, GetUsersMeData, GetUsersMeIdentitiesData, PatchBotsByBotIdSessionsBySessionIdData, PatchBotsByBotIdSessionsBySessionIdError, PatchBotsByBotIdSessionsBySessionIdResponse, PatchBotsByIdChannelByPlatformStatusData, PatchBotsByIdChannelByPlatformStatusError, PatchBotsByIdChannelByPlatformStatusResponse, PostAuthLoginData, PostAuthLoginError, PostAuthLoginResponse, PostAuthRefreshData, PostAuthRefreshError, PostAuthRefreshResponse, PostBotsByBotIdCliMessagesData, PostBotsByBotIdCliMessagesError, PostBotsByBotIdCliMessagesResponse, PostBotsByBotIdContainerData, PostBotsByBotIdContainerDataExportData, PostBotsByBotIdContainerDataExportError, PostBotsByBotIdContainerDataImportData, PostBotsByBotIdContainerDataImportError, PostBotsByBotIdContainerDataImportResponse, PostBotsByBotIdContainerDataRestoreData, PostBotsByBotIdContainerDataRestoreError, PostBotsByBotIdContainerDataRestoreResponse, PostBotsByBotIdContainerError, PostBotsByBotIdContainerFsDeleteData, PostBotsByBotIdContainerFsDeleteError, PostBotsByBotIdContainerFsDeleteResponse, PostBotsByBotIdContainerFsMkdirData, PostBotsByBotIdContainerFsMkdirError, PostBotsByBotIdContainerFsMkdirResponse, PostBotsByBotIdContainerFsRenameData, PostBotsByBotIdContainerFsRenameError, PostBotsByBotIdContainerFsRenameResponse, PostBotsByBotIdContainerFsUploadData, PostBotsByBotIdContainerFsUploadError, PostBotsByBotIdContainerFsUploadResponse, PostBotsByBotIdContainerFsWriteData, PostBotsByBotIdContainerFsWriteError, PostBotsByBotIdContainerFsWriteResponse, PostBotsByBotIdContainerResponse, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsError, PostBotsByBotIdContainerSkillsResponse, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsError, PostBotsByBotIdContainerSnapshotsResponse, PostBotsByBotIdContainerSnapshotsRollbackData, PostBotsByBotIdContainerSnapshotsRollbackError, PostBotsByBotIdContainerSnapshotsRollbackResponse, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartError, PostBotsByBotIdContainerStartResponse, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopError, PostBotsByBotIdContainerStopResponse, PostBotsByBotIdEmailBindingsData, PostBotsByBotIdEmailBindingsError, PostBotsByBotIdEmailBindingsResponse, PostBotsByBotIdMcpByIdOauthAuthorizeData, PostBotsByBotIdMcpByIdOauthAuthorizeError, PostBotsByBotIdMcpByIdOauthAuthorizeResponse, PostBotsByBotIdMcpByIdOauthDiscoverData, PostBotsByBotIdMcpByIdOauthDiscoverError, PostBotsByBotIdMcpByIdOauthDiscoverResponse, PostBotsByBotIdMcpByIdOauthExchangeData, PostBotsByBotIdMcpByIdOauthExchangeError, PostBotsByBotIdMcpByIdOauthExchangeResponse, PostBotsByBotIdMcpByIdProbeData, PostBotsByBotIdMcpByIdProbeError, PostBotsByBotIdMcpByIdProbeResponse, PostBotsByBotIdMcpData, PostBotsByBotIdMcpError, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteError, PostBotsByBotIdMcpResponse, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdError, PostBotsByBotIdMcpStdioByConnectionIdResponse, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioError, PostBotsByBotIdMcpStdioResponse, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactError, PostBotsByBotIdMemoryCompactResponse, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryError, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildError, PostBotsByBotIdMemoryRebuildResponse, PostBotsByBotIdMemoryResponse, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchError, PostBotsByBotIdMemorySearchResponse, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleError, PostBotsByBotIdScheduleResponse, PostBotsByBotIdSessionsData, PostBotsByBotIdSessionsError, PostBotsByBotIdSessionsResponse, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsError, PostBotsByBotIdSettingsResponse, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsError, PostBotsByBotIdSubagentsByIdSkillsResponse, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsError, PostBotsByBotIdSubagentsResponse, PostBotsByBotIdToolsData, PostBotsByBotIdToolsError, PostBotsByBotIdToolsResponse, PostBotsByBotIdTtsSynthesizeData, PostBotsByBotIdTtsSynthesizeError, PostBotsByBotIdTtsSynthesizeResponse, PostBotsByBotIdWebMessagesData, PostBotsByBotIdWebMessagesError, PostBotsByBotIdWebMessagesResponse, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatError, PostBotsByIdChannelByPlatformSendChatResponse, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendError, PostBotsByIdChannelByPlatformSendResponse, PostBotsData, PostBotsError, PostBotsResponse, PostBrowserContextsData, PostBrowserContextsError, PostBrowserContextsResponse, PostEmailMailgunWebhookByConfigIdData, PostEmailMailgunWebhookByConfigIdError, PostEmailMailgunWebhookByConfigIdResponse, PostEmailProvidersData, PostEmailProvidersError, PostEmailProvidersResponse, PostMemoryProvidersData, PostMemoryProvidersError, PostMemoryProvidersResponse, PostModelsByIdTestData, PostModelsByIdTestError, PostModelsByIdTestResponse, PostModelsData, PostModelsError, PostModelsResponse, PostProvidersByIdImportModelsData, PostProvidersByIdImportModelsError, PostProvidersByIdImportModelsResponse, PostProvidersByIdTestData, PostProvidersByIdTestError, PostProvidersByIdTestResponse, PostProvidersData, PostProvidersError, PostProvidersResponse, PostSearchProvidersData, PostSearchProvidersError, PostSearchProvidersResponse, PostTtsModelsByIdTestData, PostTtsModelsByIdTestError, PostTtsModelsData, PostTtsModelsError, PostTtsModelsResponse, PostTtsProvidersByIdImportModelsData, PostTtsProvidersByIdImportModelsError, PostTtsProvidersByIdImportModelsResponse, PostTtsProvidersData, PostTtsProvidersError, PostTtsProvidersResponse, PostUsersData, PostUsersError, PostUsersResponse, PutBotsByBotIdBlacklistData, PutBotsByBotIdBlacklistError, PutBotsByBotIdBlacklistResponse, PutBotsByBotIdEmailBindingsByIdData, PutBotsByBotIdEmailBindingsByIdError, PutBotsByBotIdEmailBindingsByIdResponse, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdError, PutBotsByBotIdMcpByIdResponse, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportError, PutBotsByBotIdMcpImportResponse, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdError, PutBotsByBotIdScheduleByIdResponse, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsError, PutBotsByBotIdSettingsResponse, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextError, PutBotsByBotIdSubagentsByIdContextResponse, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdError, PutBotsByBotIdSubagentsByIdResponse, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsError, PutBotsByBotIdSubagentsByIdSkillsResponse, PutBotsByBotIdWhitelistData, PutBotsByBotIdWhitelistError, PutBotsByBotIdWhitelistResponse, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformError, PutBotsByIdChannelByPlatformResponse, PutBotsByIdData, PutBotsByIdError, PutBotsByIdOwnerData, PutBotsByIdOwnerError, PutBotsByIdOwnerResponse, PutBotsByIdResponse, PutBrowserContextsByIdData, PutBrowserContextsByIdError, PutBrowserContextsByIdResponse, PutEmailProvidersByIdData, PutEmailProvidersByIdError, PutEmailProvidersByIdResponse, PutMemoryProvidersByIdData, PutMemoryProvidersByIdError, PutMemoryProvidersByIdResponse, PutModelsByIdData, PutModelsByIdError, PutModelsByIdResponse, PutModelsModelByModelIdData, PutModelsModelByModelIdError, PutModelsModelByModelIdResponse, PutProvidersByIdData, PutProvidersByIdError, PutProvidersByIdResponse, PutSearchProvidersByIdData, PutSearchProvidersByIdError, PutSearchProvidersByIdResponse, PutTtsModelsByIdData, PutTtsModelsByIdError, PutTtsModelsByIdResponse, PutTtsProvidersByIdData, PutTtsProvidersByIdError, PutTtsProvidersByIdResponse, PutUsersByIdData, PutUsersByIdError, PutUsersByIdPasswordData, PutUsersByIdPasswordError, PutUsersByIdResponse, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformError, PutUsersMeChannelsByPlatformResponse, PutUsersMeData, PutUsersMeError, PutUsersMePasswordData, PutUsersMePasswordError, PutUsersMeResponse } from '../types.gen'; +import { deleteBotsByBotIdBlacklistByRuleId, deleteBotsByBotIdCompactionLogs, deleteBotsByBotIdContainer, deleteBotsByBotIdContainerSkills, deleteBotsByBotIdEmailBindingsById, deleteBotsByBotIdHeartbeatLogs, deleteBotsByBotIdMcpById, deleteBotsByBotIdMcpByIdOauthToken, deleteBotsByBotIdMemory, deleteBotsByBotIdMemoryById, deleteBotsByBotIdMessages, deleteBotsByBotIdScheduleById, deleteBotsByBotIdScheduleLogs, deleteBotsByBotIdSessionsBySessionId, deleteBotsByBotIdSettings, deleteBotsByBotIdWhitelistByRuleId, deleteBotsById, deleteBotsByIdChannelByPlatform, deleteBrowserContextsById, deleteEmailProvidersById, deleteEmailProvidersByIdOauthToken, deleteMemoryProvidersById, deleteModelsById, deleteModelsModelByModelId, deleteProvidersById, deleteSearchProvidersById, deleteTtsModelsById, deleteTtsProvidersById, getBots, getBotsByBotIdAccessChannelIdentities, getBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversations, getBotsByBotIdAccessUsers, getBotsByBotIdBlacklist, getBotsByBotIdCliWs, getBotsByBotIdCompactionLogs, getBotsByBotIdContainer, getBotsByBotIdContainerFs, getBotsByBotIdContainerFsDownload, getBotsByBotIdContainerFsList, getBotsByBotIdContainerFsRead, getBotsByBotIdContainerSkills, getBotsByBotIdContainerSnapshots, getBotsByBotIdContainerTerminal, getBotsByBotIdContainerTerminalWs, getBotsByBotIdEmailBindings, getBotsByBotIdEmailOutbox, getBotsByBotIdEmailOutboxById, getBotsByBotIdHeartbeatLogs, getBotsByBotIdMcp, getBotsByBotIdMcpById, getBotsByBotIdMcpByIdOauthStatus, getBotsByBotIdMcpExport, getBotsByBotIdMemory, getBotsByBotIdMemoryStatus, getBotsByBotIdMemoryUsage, getBotsByBotIdMessages, getBotsByBotIdSchedule, getBotsByBotIdScheduleById, getBotsByBotIdScheduleByIdLogs, getBotsByBotIdScheduleLogs, getBotsByBotIdSessions, getBotsByBotIdSessionsBySessionId, getBotsByBotIdSettings, getBotsByBotIdTokenUsage, getBotsByBotIdWebWs, getBotsByBotIdWhitelist, getBotsById, getBotsByIdChannelByPlatform, getBotsByIdChecks, getBrowserContexts, getBrowserContextsById, getBrowserContextsCores, getChannels, getChannelsByPlatform, getEmailOauthCallback, getEmailProviders, getEmailProvidersById, getEmailProvidersByIdOauthAuthorize, getEmailProvidersByIdOauthStatus, getEmailProvidersMeta, getMemoryProviders, getMemoryProvidersById, getMemoryProvidersByIdStatus, getMemoryProvidersMeta, getModels, getModelsById, getModelsCount, getModelsModelByModelId, getPing, getProviders, getProvidersById, getProvidersByIdModels, getProvidersCount, getProvidersNameByName, getSearchProviders, getSearchProvidersById, getSearchProvidersMeta, getTtsModels, getTtsModelsById, getTtsModelsByIdCapabilities, getTtsProviders, getTtsProvidersById, getTtsProvidersByIdModels, getTtsProvidersMeta, getUsers, getUsersById, getUsersMe, getUsersMeChannelsByPlatform, getUsersMeIdentities, type Options, patchBotsByBotIdSessionsBySessionId, patchBotsByIdChannelByPlatformStatus, postAuthLogin, postAuthRefresh, postBots, postBotsByBotIdCliMessages, postBotsByBotIdContainer, postBotsByBotIdContainerDataExport, postBotsByBotIdContainerDataImport, postBotsByBotIdContainerDataRestore, postBotsByBotIdContainerFsDelete, postBotsByBotIdContainerFsMkdir, postBotsByBotIdContainerFsRename, postBotsByBotIdContainerFsUpload, postBotsByBotIdContainerFsWrite, postBotsByBotIdContainerSkills, postBotsByBotIdContainerSnapshots, postBotsByBotIdContainerSnapshotsRollback, postBotsByBotIdContainerStart, postBotsByBotIdContainerStop, postBotsByBotIdEmailBindings, postBotsByBotIdMcp, postBotsByBotIdMcpByIdOauthAuthorize, postBotsByBotIdMcpByIdOauthDiscover, postBotsByBotIdMcpByIdOauthExchange, postBotsByBotIdMcpByIdProbe, postBotsByBotIdMcpOpsBatchDelete, postBotsByBotIdMcpStdio, postBotsByBotIdMcpStdioByConnectionId, postBotsByBotIdMemory, postBotsByBotIdMemoryCompact, postBotsByBotIdMemoryRebuild, postBotsByBotIdMemorySearch, postBotsByBotIdSchedule, postBotsByBotIdSessions, postBotsByBotIdSettings, postBotsByBotIdTools, postBotsByBotIdTtsSynthesize, postBotsByBotIdWebMessages, postBotsByIdChannelByPlatformSend, postBotsByIdChannelByPlatformSendChat, postBrowserContexts, postEmailMailgunWebhookByConfigId, postEmailProviders, postMemoryProviders, postModels, postModelsByIdTest, postProviders, postProvidersByIdImportModels, postProvidersByIdTest, postSearchProviders, postTtsModels, postTtsModelsByIdTest, postTtsProviders, postTtsProvidersByIdImportModels, postUsers, putBotsByBotIdBlacklist, putBotsByBotIdEmailBindingsById, putBotsByBotIdMcpById, putBotsByBotIdMcpImport, putBotsByBotIdScheduleById, putBotsByBotIdSettings, putBotsByBotIdWhitelist, putBotsById, putBotsByIdChannelByPlatform, putBotsByIdOwner, putBrowserContextsById, putEmailProvidersById, putMemoryProvidersById, putModelsById, putModelsModelByModelId, putProvidersById, putSearchProvidersById, putTtsModelsById, putTtsProvidersById, putUsersById, putUsersByIdPassword, putUsersMe, putUsersMeChannelsByPlatform, putUsersMePassword } from '../sdk.gen'; +import type { DeleteBotsByBotIdBlacklistByRuleIdData, DeleteBotsByBotIdBlacklistByRuleIdError, DeleteBotsByBotIdCompactionLogsData, DeleteBotsByBotIdCompactionLogsError, DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerError, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsError, DeleteBotsByBotIdContainerSkillsResponse, DeleteBotsByBotIdEmailBindingsByIdData, DeleteBotsByBotIdEmailBindingsByIdError, DeleteBotsByBotIdHeartbeatLogsData, DeleteBotsByBotIdHeartbeatLogsError, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdError, DeleteBotsByBotIdMcpByIdOauthTokenData, DeleteBotsByBotIdMcpByIdOauthTokenError, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdError, DeleteBotsByBotIdMemoryByIdResponse, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryError, DeleteBotsByBotIdMemoryResponse, DeleteBotsByBotIdMessagesData, DeleteBotsByBotIdMessagesError, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdError, DeleteBotsByBotIdScheduleLogsData, DeleteBotsByBotIdScheduleLogsError, DeleteBotsByBotIdSessionsBySessionIdData, DeleteBotsByBotIdSessionsBySessionIdError, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsError, DeleteBotsByBotIdWhitelistByRuleIdData, DeleteBotsByBotIdWhitelistByRuleIdError, DeleteBotsByIdChannelByPlatformData, DeleteBotsByIdChannelByPlatformError, DeleteBotsByIdData, DeleteBotsByIdError, DeleteBotsByIdResponse, DeleteBrowserContextsByIdData, DeleteBrowserContextsByIdError, DeleteEmailProvidersByIdData, DeleteEmailProvidersByIdError, DeleteEmailProvidersByIdOauthTokenData, DeleteEmailProvidersByIdOauthTokenError, DeleteMemoryProvidersByIdData, DeleteMemoryProvidersByIdError, DeleteModelsByIdData, DeleteModelsByIdError, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdError, DeleteProvidersByIdData, DeleteProvidersByIdError, DeleteSearchProvidersByIdData, DeleteSearchProvidersByIdError, DeleteTtsModelsByIdData, DeleteTtsModelsByIdError, DeleteTtsProvidersByIdData, DeleteTtsProvidersByIdError, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsData, GetBotsByBotIdAccessChannelIdentitiesData, GetBotsByBotIdAccessUsersData, GetBotsByBotIdBlacklistData, GetBotsByBotIdCliWsData, GetBotsByBotIdCompactionLogsData, GetBotsByBotIdContainerData, GetBotsByBotIdContainerFsData, GetBotsByBotIdContainerFsDownloadData, GetBotsByBotIdContainerFsListData, GetBotsByBotIdContainerFsReadData, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerTerminalData, GetBotsByBotIdContainerTerminalWsData, GetBotsByBotIdEmailBindingsData, GetBotsByBotIdEmailOutboxByIdData, GetBotsByBotIdEmailOutboxData, GetBotsByBotIdHeartbeatLogsData, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdOauthStatusData, GetBotsByBotIdMcpData, GetBotsByBotIdMcpExportData, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryStatusData, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMessagesData, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdLogsData, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleLogsData, GetBotsByBotIdSessionsBySessionIdData, GetBotsByBotIdSessionsData, GetBotsByBotIdSettingsData, GetBotsByBotIdTokenUsageData, GetBotsByBotIdWebWsData, GetBotsByBotIdWhitelistData, GetBotsByIdChannelByPlatformData, GetBotsByIdChecksData, GetBotsByIdData, GetBotsData, GetBrowserContextsByIdData, GetBrowserContextsCoresData, GetBrowserContextsData, GetChannelsByPlatformData, GetChannelsData, GetEmailOauthCallbackData, GetEmailProvidersByIdData, GetEmailProvidersByIdOauthAuthorizeData, GetEmailProvidersByIdOauthStatusData, GetEmailProvidersData, GetEmailProvidersMetaData, GetMemoryProvidersByIdData, GetMemoryProvidersByIdStatusData, GetMemoryProvidersData, GetMemoryProvidersMetaData, GetModelsByIdData, GetModelsCountData, GetModelsData, GetModelsModelByModelIdData, GetPingData, GetProvidersByIdData, GetProvidersByIdModelsData, GetProvidersCountData, GetProvidersData, GetProvidersNameByNameData, GetSearchProvidersByIdData, GetSearchProvidersData, GetSearchProvidersMetaData, GetTtsModelsByIdCapabilitiesData, GetTtsModelsByIdData, GetTtsModelsData, GetTtsProvidersByIdData, GetTtsProvidersByIdModelsData, GetTtsProvidersData, GetTtsProvidersMetaData, GetUsersByIdData, GetUsersData, GetUsersMeChannelsByPlatformData, GetUsersMeData, GetUsersMeIdentitiesData, PatchBotsByBotIdSessionsBySessionIdData, PatchBotsByBotIdSessionsBySessionIdError, PatchBotsByBotIdSessionsBySessionIdResponse, PatchBotsByIdChannelByPlatformStatusData, PatchBotsByIdChannelByPlatformStatusError, PatchBotsByIdChannelByPlatformStatusResponse, PostAuthLoginData, PostAuthLoginError, PostAuthLoginResponse, PostAuthRefreshData, PostAuthRefreshError, PostAuthRefreshResponse, PostBotsByBotIdCliMessagesData, PostBotsByBotIdCliMessagesError, PostBotsByBotIdCliMessagesResponse, PostBotsByBotIdContainerData, PostBotsByBotIdContainerDataExportData, PostBotsByBotIdContainerDataExportError, PostBotsByBotIdContainerDataImportData, PostBotsByBotIdContainerDataImportError, PostBotsByBotIdContainerDataImportResponse, PostBotsByBotIdContainerDataRestoreData, PostBotsByBotIdContainerDataRestoreError, PostBotsByBotIdContainerDataRestoreResponse, PostBotsByBotIdContainerError, PostBotsByBotIdContainerFsDeleteData, PostBotsByBotIdContainerFsDeleteError, PostBotsByBotIdContainerFsDeleteResponse, PostBotsByBotIdContainerFsMkdirData, PostBotsByBotIdContainerFsMkdirError, PostBotsByBotIdContainerFsMkdirResponse, PostBotsByBotIdContainerFsRenameData, PostBotsByBotIdContainerFsRenameError, PostBotsByBotIdContainerFsRenameResponse, PostBotsByBotIdContainerFsUploadData, PostBotsByBotIdContainerFsUploadError, PostBotsByBotIdContainerFsUploadResponse, PostBotsByBotIdContainerFsWriteData, PostBotsByBotIdContainerFsWriteError, PostBotsByBotIdContainerFsWriteResponse, PostBotsByBotIdContainerResponse, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsError, PostBotsByBotIdContainerSkillsResponse, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsError, PostBotsByBotIdContainerSnapshotsResponse, PostBotsByBotIdContainerSnapshotsRollbackData, PostBotsByBotIdContainerSnapshotsRollbackError, PostBotsByBotIdContainerSnapshotsRollbackResponse, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartError, PostBotsByBotIdContainerStartResponse, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopError, PostBotsByBotIdContainerStopResponse, PostBotsByBotIdEmailBindingsData, PostBotsByBotIdEmailBindingsError, PostBotsByBotIdEmailBindingsResponse, PostBotsByBotIdMcpByIdOauthAuthorizeData, PostBotsByBotIdMcpByIdOauthAuthorizeError, PostBotsByBotIdMcpByIdOauthAuthorizeResponse, PostBotsByBotIdMcpByIdOauthDiscoverData, PostBotsByBotIdMcpByIdOauthDiscoverError, PostBotsByBotIdMcpByIdOauthDiscoverResponse, PostBotsByBotIdMcpByIdOauthExchangeData, PostBotsByBotIdMcpByIdOauthExchangeError, PostBotsByBotIdMcpByIdOauthExchangeResponse, PostBotsByBotIdMcpByIdProbeData, PostBotsByBotIdMcpByIdProbeError, PostBotsByBotIdMcpByIdProbeResponse, PostBotsByBotIdMcpData, PostBotsByBotIdMcpError, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteError, PostBotsByBotIdMcpResponse, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdError, PostBotsByBotIdMcpStdioByConnectionIdResponse, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioError, PostBotsByBotIdMcpStdioResponse, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactError, PostBotsByBotIdMemoryCompactResponse, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryError, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildError, PostBotsByBotIdMemoryRebuildResponse, PostBotsByBotIdMemoryResponse, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchError, PostBotsByBotIdMemorySearchResponse, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleError, PostBotsByBotIdScheduleResponse, PostBotsByBotIdSessionsData, PostBotsByBotIdSessionsError, PostBotsByBotIdSessionsResponse, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsError, PostBotsByBotIdSettingsResponse, PostBotsByBotIdToolsData, PostBotsByBotIdToolsError, PostBotsByBotIdToolsResponse, PostBotsByBotIdTtsSynthesizeData, PostBotsByBotIdTtsSynthesizeError, PostBotsByBotIdTtsSynthesizeResponse, PostBotsByBotIdWebMessagesData, PostBotsByBotIdWebMessagesError, PostBotsByBotIdWebMessagesResponse, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatError, PostBotsByIdChannelByPlatformSendChatResponse, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendError, PostBotsByIdChannelByPlatformSendResponse, PostBotsData, PostBotsError, PostBotsResponse, PostBrowserContextsData, PostBrowserContextsError, PostBrowserContextsResponse, PostEmailMailgunWebhookByConfigIdData, PostEmailMailgunWebhookByConfigIdError, PostEmailMailgunWebhookByConfigIdResponse, PostEmailProvidersData, PostEmailProvidersError, PostEmailProvidersResponse, PostMemoryProvidersData, PostMemoryProvidersError, PostMemoryProvidersResponse, PostModelsByIdTestData, PostModelsByIdTestError, PostModelsByIdTestResponse, PostModelsData, PostModelsError, PostModelsResponse, PostProvidersByIdImportModelsData, PostProvidersByIdImportModelsError, PostProvidersByIdImportModelsResponse, PostProvidersByIdTestData, PostProvidersByIdTestError, PostProvidersByIdTestResponse, PostProvidersData, PostProvidersError, PostProvidersResponse, PostSearchProvidersData, PostSearchProvidersError, PostSearchProvidersResponse, PostTtsModelsByIdTestData, PostTtsModelsByIdTestError, PostTtsModelsData, PostTtsModelsError, PostTtsModelsResponse, PostTtsProvidersByIdImportModelsData, PostTtsProvidersByIdImportModelsError, PostTtsProvidersByIdImportModelsResponse, PostTtsProvidersData, PostTtsProvidersError, PostTtsProvidersResponse, PostUsersData, PostUsersError, PostUsersResponse, PutBotsByBotIdBlacklistData, PutBotsByBotIdBlacklistError, PutBotsByBotIdBlacklistResponse, PutBotsByBotIdEmailBindingsByIdData, PutBotsByBotIdEmailBindingsByIdError, PutBotsByBotIdEmailBindingsByIdResponse, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdError, PutBotsByBotIdMcpByIdResponse, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportError, PutBotsByBotIdMcpImportResponse, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdError, PutBotsByBotIdScheduleByIdResponse, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsError, PutBotsByBotIdSettingsResponse, PutBotsByBotIdWhitelistData, PutBotsByBotIdWhitelistError, PutBotsByBotIdWhitelistResponse, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformError, PutBotsByIdChannelByPlatformResponse, PutBotsByIdData, PutBotsByIdError, PutBotsByIdOwnerData, PutBotsByIdOwnerError, PutBotsByIdOwnerResponse, PutBotsByIdResponse, PutBrowserContextsByIdData, PutBrowserContextsByIdError, PutBrowserContextsByIdResponse, PutEmailProvidersByIdData, PutEmailProvidersByIdError, PutEmailProvidersByIdResponse, PutMemoryProvidersByIdData, PutMemoryProvidersByIdError, PutMemoryProvidersByIdResponse, PutModelsByIdData, PutModelsByIdError, PutModelsByIdResponse, PutModelsModelByModelIdData, PutModelsModelByModelIdError, PutModelsModelByModelIdResponse, PutProvidersByIdData, PutProvidersByIdError, PutProvidersByIdResponse, PutSearchProvidersByIdData, PutSearchProvidersByIdError, PutSearchProvidersByIdResponse, PutTtsModelsByIdData, PutTtsModelsByIdError, PutTtsModelsByIdResponse, PutTtsProvidersByIdData, PutTtsProvidersByIdError, PutTtsProvidersByIdResponse, PutUsersByIdData, PutUsersByIdError, PutUsersByIdPasswordData, PutUsersByIdPasswordError, PutUsersByIdResponse, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformError, PutUsersMeChannelsByPlatformResponse, PutUsersMeData, PutUsersMeError, PutUsersMePasswordData, PutUsersMePasswordError, PutUsersMeResponse } from '../types.gen'; /** * Login @@ -1556,178 +1556,6 @@ export const putBotsByBotIdSettingsMutation = (options?: Partial) => createQueryKey('getBotsByBotIdSubagents', options); - -/** - * List subagents - * - * List subagents for current user - */ -export const getBotsByBotIdSubagentsQuery = defineQueryOptions((options?: Options) => ({ - key: getBotsByBotIdSubagentsQueryKey(options), - query: async (context) => { - const { data } = await getBotsByBotIdSubagents({ - ...options, - ...context, - throwOnError: true - }); - return data; - } -})); - -/** - * Create subagent - * - * Create a subagent for current user - */ -export const postBotsByBotIdSubagentsMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdSubagentsError> => ({ - mutation: async (vars) => { - const { data } = await postBotsByBotIdSubagents({ - ...options, - ...vars, - throwOnError: true - }); - return data; - } -}); - -/** - * Delete subagent - * - * Delete a subagent by ID - */ -export const deleteBotsByBotIdSubagentsByIdMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdSubagentsByIdError> => ({ - mutation: async (vars) => { - const { data } = await deleteBotsByBotIdSubagentsById({ - ...options, - ...vars, - throwOnError: true - }); - return data; - } -}); - -export const getBotsByBotIdSubagentsByIdQueryKey = (options: Options) => createQueryKey('getBotsByBotIdSubagentsById', options); - -/** - * Get subagent - * - * Get a subagent by ID - */ -export const getBotsByBotIdSubagentsByIdQuery = defineQueryOptions((options: Options) => ({ - key: getBotsByBotIdSubagentsByIdQueryKey(options), - query: async (context) => { - const { data } = await getBotsByBotIdSubagentsById({ - ...options, - ...context, - throwOnError: true - }); - return data; - } -})); - -/** - * Update subagent - * - * Update a subagent by ID - */ -export const putBotsByBotIdSubagentsByIdMutation = (options?: Partial>): UseMutationOptions, PutBotsByBotIdSubagentsByIdError> => ({ - mutation: async (vars) => { - const { data } = await putBotsByBotIdSubagentsById({ - ...options, - ...vars, - throwOnError: true - }); - return data; - } -}); - -export const getBotsByBotIdSubagentsByIdContextQueryKey = (options: Options) => createQueryKey('getBotsByBotIdSubagentsByIdContext', options); - -/** - * Get subagent context - * - * Get a subagent's message context - */ -export const getBotsByBotIdSubagentsByIdContextQuery = defineQueryOptions((options: Options) => ({ - key: getBotsByBotIdSubagentsByIdContextQueryKey(options), - query: async (context) => { - const { data } = await getBotsByBotIdSubagentsByIdContext({ - ...options, - ...context, - throwOnError: true - }); - return data; - } -})); - -/** - * Update subagent context - * - * Update a subagent's message context - */ -export const putBotsByBotIdSubagentsByIdContextMutation = (options?: Partial>): UseMutationOptions, PutBotsByBotIdSubagentsByIdContextError> => ({ - mutation: async (vars) => { - const { data } = await putBotsByBotIdSubagentsByIdContext({ - ...options, - ...vars, - throwOnError: true - }); - return data; - } -}); - -export const getBotsByBotIdSubagentsByIdSkillsQueryKey = (options: Options) => createQueryKey('getBotsByBotIdSubagentsByIdSkills', options); - -/** - * Get subagent skills - * - * Get a subagent's skills - */ -export const getBotsByBotIdSubagentsByIdSkillsQuery = defineQueryOptions((options: Options) => ({ - key: getBotsByBotIdSubagentsByIdSkillsQueryKey(options), - query: async (context) => { - const { data } = await getBotsByBotIdSubagentsByIdSkills({ - ...options, - ...context, - throwOnError: true - }); - return data; - } -})); - -/** - * Add subagent skills - * - * Add skills to a subagent - */ -export const postBotsByBotIdSubagentsByIdSkillsMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdSubagentsByIdSkillsError> => ({ - mutation: async (vars) => { - const { data } = await postBotsByBotIdSubagentsByIdSkills({ - ...options, - ...vars, - throwOnError: true - }); - return data; - } -}); - -/** - * Update subagent skills - * - * Replace a subagent's skills - */ -export const putBotsByBotIdSubagentsByIdSkillsMutation = (options?: Partial>): UseMutationOptions, PutBotsByBotIdSubagentsByIdSkillsError> => ({ - mutation: async (vars) => { - const { data } = await putBotsByBotIdSubagentsByIdSkills({ - ...options, - ...vars, - throwOnError: true - }); - return data; - } -}); - export const getBotsByBotIdTokenUsageQueryKey = (options: Options) => createQueryKey('getBotsByBotIdTokenUsage', options); /** diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index 43ece380..700f219d 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export { deleteBotsByBotIdBlacklistByRuleId, deleteBotsByBotIdCompactionLogs, deleteBotsByBotIdContainer, deleteBotsByBotIdContainerSkills, deleteBotsByBotIdEmailBindingsById, deleteBotsByBotIdHeartbeatLogs, deleteBotsByBotIdMcpById, deleteBotsByBotIdMcpByIdOauthToken, deleteBotsByBotIdMemory, deleteBotsByBotIdMemoryById, deleteBotsByBotIdMessages, deleteBotsByBotIdScheduleById, deleteBotsByBotIdScheduleLogs, deleteBotsByBotIdSessionsBySessionId, deleteBotsByBotIdSettings, deleteBotsByBotIdSubagentsById, deleteBotsByBotIdWhitelistByRuleId, deleteBotsById, deleteBotsByIdChannelByPlatform, deleteBrowserContextsById, deleteEmailProvidersById, deleteEmailProvidersByIdOauthToken, deleteMemoryProvidersById, deleteModelsById, deleteModelsModelByModelId, deleteProvidersById, deleteSearchProvidersById, deleteTtsModelsById, deleteTtsProvidersById, getBots, getBotsByBotIdAccessChannelIdentities, getBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversations, getBotsByBotIdAccessUsers, getBotsByBotIdBlacklist, getBotsByBotIdCliStream, getBotsByBotIdCliWs, getBotsByBotIdCompactionLogs, getBotsByBotIdContainer, getBotsByBotIdContainerFs, getBotsByBotIdContainerFsDownload, getBotsByBotIdContainerFsList, getBotsByBotIdContainerFsRead, getBotsByBotIdContainerSkills, getBotsByBotIdContainerSnapshots, getBotsByBotIdContainerTerminal, getBotsByBotIdContainerTerminalWs, getBotsByBotIdEmailBindings, getBotsByBotIdEmailOutbox, getBotsByBotIdEmailOutboxById, getBotsByBotIdHeartbeatLogs, getBotsByBotIdMcp, getBotsByBotIdMcpById, getBotsByBotIdMcpByIdOauthStatus, getBotsByBotIdMcpExport, getBotsByBotIdMemory, getBotsByBotIdMemoryStatus, getBotsByBotIdMemoryUsage, getBotsByBotIdMessages, getBotsByBotIdSchedule, getBotsByBotIdScheduleById, getBotsByBotIdScheduleByIdLogs, getBotsByBotIdScheduleLogs, getBotsByBotIdSessions, getBotsByBotIdSessionsBySessionId, getBotsByBotIdSettings, getBotsByBotIdSubagents, getBotsByBotIdSubagentsById, getBotsByBotIdSubagentsByIdContext, getBotsByBotIdSubagentsByIdSkills, getBotsByBotIdTokenUsage, getBotsByBotIdWebStream, getBotsByBotIdWebWs, getBotsByBotIdWhitelist, getBotsById, getBotsByIdChannelByPlatform, getBotsByIdChecks, getBrowserContexts, getBrowserContextsById, getBrowserContextsCores, getChannels, getChannelsByPlatform, getEmailOauthCallback, getEmailProviders, getEmailProvidersById, getEmailProvidersByIdOauthAuthorize, getEmailProvidersByIdOauthStatus, getEmailProvidersMeta, getMemoryProviders, getMemoryProvidersById, getMemoryProvidersByIdStatus, getMemoryProvidersMeta, getModels, getModelsById, getModelsCount, getModelsModelByModelId, getPing, getProviders, getProvidersById, getProvidersByIdModels, getProvidersCount, getProvidersNameByName, getSearchProviders, getSearchProvidersById, getSearchProvidersMeta, getTtsModels, getTtsModelsById, getTtsModelsByIdCapabilities, getTtsProviders, getTtsProvidersById, getTtsProvidersByIdModels, getTtsProvidersMeta, getUsers, getUsersById, getUsersMe, getUsersMeChannelsByPlatform, getUsersMeIdentities, type Options, patchBotsByBotIdSessionsBySessionId, patchBotsByIdChannelByPlatformStatus, postAuthLogin, postAuthRefresh, postBots, postBotsByBotIdCliMessages, postBotsByBotIdContainer, postBotsByBotIdContainerDataExport, postBotsByBotIdContainerDataImport, postBotsByBotIdContainerDataRestore, postBotsByBotIdContainerFsDelete, postBotsByBotIdContainerFsMkdir, postBotsByBotIdContainerFsRename, postBotsByBotIdContainerFsUpload, postBotsByBotIdContainerFsWrite, postBotsByBotIdContainerSkills, postBotsByBotIdContainerSnapshots, postBotsByBotIdContainerSnapshotsRollback, postBotsByBotIdContainerStart, postBotsByBotIdContainerStop, postBotsByBotIdEmailBindings, postBotsByBotIdMcp, postBotsByBotIdMcpByIdOauthAuthorize, postBotsByBotIdMcpByIdOauthDiscover, postBotsByBotIdMcpByIdOauthExchange, postBotsByBotIdMcpByIdProbe, postBotsByBotIdMcpOpsBatchDelete, postBotsByBotIdMcpStdio, postBotsByBotIdMcpStdioByConnectionId, postBotsByBotIdMemory, postBotsByBotIdMemoryCompact, postBotsByBotIdMemoryRebuild, postBotsByBotIdMemorySearch, postBotsByBotIdSchedule, postBotsByBotIdSessions, postBotsByBotIdSettings, postBotsByBotIdSubagents, postBotsByBotIdSubagentsByIdSkills, postBotsByBotIdTools, postBotsByBotIdTtsSynthesize, postBotsByBotIdWebMessages, postBotsByIdChannelByPlatformSend, postBotsByIdChannelByPlatformSendChat, postBrowserContexts, postEmailMailgunWebhookByConfigId, postEmailProviders, postMemoryProviders, postModels, postModelsByIdTest, postProviders, postProvidersByIdImportModels, postProvidersByIdTest, postSearchProviders, postTtsModels, postTtsModelsByIdTest, postTtsProviders, postTtsProvidersByIdImportModels, postUsers, putBotsByBotIdBlacklist, putBotsByBotIdEmailBindingsById, putBotsByBotIdMcpById, putBotsByBotIdMcpImport, putBotsByBotIdScheduleById, putBotsByBotIdSettings, putBotsByBotIdSubagentsById, putBotsByBotIdSubagentsByIdContext, putBotsByBotIdSubagentsByIdSkills, putBotsByBotIdWhitelist, putBotsById, putBotsByIdChannelByPlatform, putBotsByIdOwner, putBrowserContextsById, putEmailProvidersById, putMemoryProvidersById, putModelsById, putModelsModelByModelId, putProvidersById, putSearchProvidersById, putTtsModelsById, putTtsProvidersById, putUsersById, putUsersByIdPassword, putUsersMe, putUsersMeChannelsByPlatform, putUsersMePassword } from './sdk.gen'; -export type { AccountsAccount, AccountsCreateAccountRequest, AccountsListAccountsResponse, AccountsResetPasswordRequest, AccountsUpdateAccountRequest, AccountsUpdatePasswordRequest, AccountsUpdateProfileRequest, AclChannelIdentityCandidate, AclChannelIdentityCandidateListResponse, AclListRulesResponse, AclObservedConversationCandidate, AclObservedConversationCandidateListResponse, AclRule, AclSourceScope, AclUpsertRuleRequest, AclUserCandidate, AclUserCandidateListResponse, AdaptersCdfPoint, AdaptersCompactResult, AdaptersDeleteResponse, AdaptersHealthStatus, AdaptersMemoryItem, AdaptersMemoryStatusResponse, AdaptersMessage, AdaptersProviderCollectionStatus, AdaptersProviderConfigSchema, AdaptersProviderCreateRequest, AdaptersProviderFieldSchema, AdaptersProviderGetResponse, AdaptersProviderMeta, AdaptersProviderStatusResponse, AdaptersProviderType, AdaptersProviderUpdateRequest, AdaptersRebuildResult, AdaptersSearchResponse, AdaptersTopKBucket, AdaptersUsageResponse, BotsBot, BotsBotCheck, BotsCreateBotRequest, BotsListBotsResponse, BotsListChecksResponse, BotsTransferBotRequest, BotsUpdateBotRequest, BrowsercontextsBrowserContext, BrowsercontextsCreateRequest, BrowsercontextsUpdateRequest, ChannelAction, ChannelAttachment, ChannelAttachmentType, ChannelChannelCapabilities, ChannelChannelConfig, ChannelChannelIdentityBinding, ChannelConfigSchema, ChannelFieldSchema, ChannelFieldType, ChannelMessage, ChannelMessageFormat, ChannelMessagePart, ChannelMessagePartType, ChannelMessageTextStyle, ChannelReplyRef, ChannelSendRequest, ChannelTargetHint, ChannelTargetSpec, ChannelThreadRef, ChannelUpdateChannelStatusRequest, ChannelUpsertChannelIdentityConfigRequest, ChannelUpsertConfigRequest, ClientOptions, CompactionListLogsResponse, CompactionLog, DeleteBotsByBotIdBlacklistByRuleIdData, DeleteBotsByBotIdBlacklistByRuleIdError, DeleteBotsByBotIdBlacklistByRuleIdErrors, DeleteBotsByBotIdBlacklistByRuleIdResponses, DeleteBotsByBotIdCompactionLogsData, DeleteBotsByBotIdCompactionLogsError, DeleteBotsByBotIdCompactionLogsErrors, DeleteBotsByBotIdCompactionLogsResponses, DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerError, DeleteBotsByBotIdContainerErrors, DeleteBotsByBotIdContainerResponses, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsError, DeleteBotsByBotIdContainerSkillsErrors, DeleteBotsByBotIdContainerSkillsResponse, DeleteBotsByBotIdContainerSkillsResponses, DeleteBotsByBotIdEmailBindingsByIdData, DeleteBotsByBotIdEmailBindingsByIdError, DeleteBotsByBotIdEmailBindingsByIdErrors, DeleteBotsByBotIdEmailBindingsByIdResponses, DeleteBotsByBotIdHeartbeatLogsData, DeleteBotsByBotIdHeartbeatLogsError, DeleteBotsByBotIdHeartbeatLogsErrors, DeleteBotsByBotIdHeartbeatLogsResponses, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdError, DeleteBotsByBotIdMcpByIdErrors, DeleteBotsByBotIdMcpByIdOauthTokenData, DeleteBotsByBotIdMcpByIdOauthTokenError, DeleteBotsByBotIdMcpByIdOauthTokenErrors, DeleteBotsByBotIdMcpByIdOauthTokenResponses, DeleteBotsByBotIdMcpByIdResponses, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdError, DeleteBotsByBotIdMemoryByIdErrors, DeleteBotsByBotIdMemoryByIdResponse, DeleteBotsByBotIdMemoryByIdResponses, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryError, DeleteBotsByBotIdMemoryErrors, DeleteBotsByBotIdMemoryResponse, DeleteBotsByBotIdMemoryResponses, DeleteBotsByBotIdMessagesData, DeleteBotsByBotIdMessagesError, DeleteBotsByBotIdMessagesErrors, DeleteBotsByBotIdMessagesResponses, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdError, DeleteBotsByBotIdScheduleByIdErrors, DeleteBotsByBotIdScheduleByIdResponses, DeleteBotsByBotIdScheduleLogsData, DeleteBotsByBotIdScheduleLogsError, DeleteBotsByBotIdScheduleLogsErrors, DeleteBotsByBotIdScheduleLogsResponses, DeleteBotsByBotIdSessionsBySessionIdData, DeleteBotsByBotIdSessionsBySessionIdError, DeleteBotsByBotIdSessionsBySessionIdErrors, DeleteBotsByBotIdSessionsBySessionIdResponses, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsError, DeleteBotsByBotIdSettingsErrors, DeleteBotsByBotIdSettingsResponses, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdError, DeleteBotsByBotIdSubagentsByIdErrors, DeleteBotsByBotIdSubagentsByIdResponses, DeleteBotsByBotIdWhitelistByRuleIdData, DeleteBotsByBotIdWhitelistByRuleIdError, DeleteBotsByBotIdWhitelistByRuleIdErrors, DeleteBotsByBotIdWhitelistByRuleIdResponses, DeleteBotsByIdChannelByPlatformData, DeleteBotsByIdChannelByPlatformError, DeleteBotsByIdChannelByPlatformErrors, DeleteBotsByIdChannelByPlatformResponses, DeleteBotsByIdData, DeleteBotsByIdError, DeleteBotsByIdErrors, DeleteBotsByIdResponse, DeleteBotsByIdResponses, DeleteBrowserContextsByIdData, DeleteBrowserContextsByIdError, DeleteBrowserContextsByIdErrors, DeleteBrowserContextsByIdResponses, DeleteEmailProvidersByIdData, DeleteEmailProvidersByIdError, DeleteEmailProvidersByIdErrors, DeleteEmailProvidersByIdOauthTokenData, DeleteEmailProvidersByIdOauthTokenError, DeleteEmailProvidersByIdOauthTokenErrors, DeleteEmailProvidersByIdOauthTokenResponses, DeleteEmailProvidersByIdResponses, DeleteMemoryProvidersByIdData, DeleteMemoryProvidersByIdError, DeleteMemoryProvidersByIdErrors, DeleteMemoryProvidersByIdResponses, DeleteModelsByIdData, DeleteModelsByIdError, DeleteModelsByIdErrors, DeleteModelsByIdResponses, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdError, DeleteModelsModelByModelIdErrors, DeleteModelsModelByModelIdResponses, DeleteProvidersByIdData, DeleteProvidersByIdError, DeleteProvidersByIdErrors, DeleteProvidersByIdResponses, DeleteSearchProvidersByIdData, DeleteSearchProvidersByIdError, DeleteSearchProvidersByIdErrors, DeleteSearchProvidersByIdResponses, DeleteTtsModelsByIdData, DeleteTtsModelsByIdError, DeleteTtsModelsByIdErrors, DeleteTtsModelsByIdResponses, DeleteTtsProvidersByIdData, DeleteTtsProvidersByIdError, DeleteTtsProvidersByIdErrors, DeleteTtsProvidersByIdResponses, EmailBindingResponse, EmailConfigSchema, EmailCreateBindingRequest, EmailCreateProviderRequest, EmailFieldSchema, EmailOutboxItemResponse, EmailProviderMeta, EmailProviderResponse, EmailUpdateBindingRequest, EmailUpdateProviderRequest, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsData, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsError, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsErrors, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsResponse, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsResponses, GetBotsByBotIdAccessChannelIdentitiesData, GetBotsByBotIdAccessChannelIdentitiesError, GetBotsByBotIdAccessChannelIdentitiesErrors, GetBotsByBotIdAccessChannelIdentitiesResponse, GetBotsByBotIdAccessChannelIdentitiesResponses, GetBotsByBotIdAccessUsersData, GetBotsByBotIdAccessUsersError, GetBotsByBotIdAccessUsersErrors, GetBotsByBotIdAccessUsersResponse, GetBotsByBotIdAccessUsersResponses, GetBotsByBotIdBlacklistData, GetBotsByBotIdBlacklistError, GetBotsByBotIdBlacklistErrors, GetBotsByBotIdBlacklistResponse, GetBotsByBotIdBlacklistResponses, GetBotsByBotIdCliStreamData, GetBotsByBotIdCliStreamError, GetBotsByBotIdCliStreamErrors, GetBotsByBotIdCliStreamResponse, GetBotsByBotIdCliStreamResponses, GetBotsByBotIdCliWsData, GetBotsByBotIdCliWsError, GetBotsByBotIdCliWsErrors, GetBotsByBotIdCompactionLogsData, GetBotsByBotIdCompactionLogsError, GetBotsByBotIdCompactionLogsErrors, GetBotsByBotIdCompactionLogsResponse, GetBotsByBotIdCompactionLogsResponses, GetBotsByBotIdContainerData, GetBotsByBotIdContainerError, GetBotsByBotIdContainerErrors, GetBotsByBotIdContainerFsData, GetBotsByBotIdContainerFsDownloadData, GetBotsByBotIdContainerFsDownloadError, GetBotsByBotIdContainerFsDownloadErrors, GetBotsByBotIdContainerFsDownloadResponses, GetBotsByBotIdContainerFsError, GetBotsByBotIdContainerFsErrors, GetBotsByBotIdContainerFsListData, GetBotsByBotIdContainerFsListError, GetBotsByBotIdContainerFsListErrors, GetBotsByBotIdContainerFsListResponse, GetBotsByBotIdContainerFsListResponses, GetBotsByBotIdContainerFsReadData, GetBotsByBotIdContainerFsReadError, GetBotsByBotIdContainerFsReadErrors, GetBotsByBotIdContainerFsReadResponse, GetBotsByBotIdContainerFsReadResponses, GetBotsByBotIdContainerFsResponse, GetBotsByBotIdContainerFsResponses, GetBotsByBotIdContainerResponse, GetBotsByBotIdContainerResponses, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSkillsError, GetBotsByBotIdContainerSkillsErrors, GetBotsByBotIdContainerSkillsResponse, GetBotsByBotIdContainerSkillsResponses, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerSnapshotsError, GetBotsByBotIdContainerSnapshotsErrors, GetBotsByBotIdContainerSnapshotsResponse, GetBotsByBotIdContainerSnapshotsResponses, GetBotsByBotIdContainerTerminalData, GetBotsByBotIdContainerTerminalError, GetBotsByBotIdContainerTerminalErrors, GetBotsByBotIdContainerTerminalResponse, GetBotsByBotIdContainerTerminalResponses, GetBotsByBotIdContainerTerminalWsData, GetBotsByBotIdContainerTerminalWsError, GetBotsByBotIdContainerTerminalWsErrors, GetBotsByBotIdEmailBindingsData, GetBotsByBotIdEmailBindingsError, GetBotsByBotIdEmailBindingsErrors, GetBotsByBotIdEmailBindingsResponse, GetBotsByBotIdEmailBindingsResponses, GetBotsByBotIdEmailOutboxByIdData, GetBotsByBotIdEmailOutboxByIdError, GetBotsByBotIdEmailOutboxByIdErrors, GetBotsByBotIdEmailOutboxByIdResponse, GetBotsByBotIdEmailOutboxByIdResponses, GetBotsByBotIdEmailOutboxData, GetBotsByBotIdEmailOutboxError, GetBotsByBotIdEmailOutboxErrors, GetBotsByBotIdEmailOutboxResponse, GetBotsByBotIdEmailOutboxResponses, GetBotsByBotIdHeartbeatLogsData, GetBotsByBotIdHeartbeatLogsError, GetBotsByBotIdHeartbeatLogsErrors, GetBotsByBotIdHeartbeatLogsResponse, GetBotsByBotIdHeartbeatLogsResponses, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdError, GetBotsByBotIdMcpByIdErrors, GetBotsByBotIdMcpByIdOauthStatusData, GetBotsByBotIdMcpByIdOauthStatusError, GetBotsByBotIdMcpByIdOauthStatusErrors, GetBotsByBotIdMcpByIdOauthStatusResponse, GetBotsByBotIdMcpByIdOauthStatusResponses, GetBotsByBotIdMcpByIdResponse, GetBotsByBotIdMcpByIdResponses, GetBotsByBotIdMcpData, GetBotsByBotIdMcpError, GetBotsByBotIdMcpErrors, GetBotsByBotIdMcpExportData, GetBotsByBotIdMcpExportError, GetBotsByBotIdMcpExportErrors, GetBotsByBotIdMcpExportResponse, GetBotsByBotIdMcpExportResponses, GetBotsByBotIdMcpResponse, GetBotsByBotIdMcpResponses, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryError, GetBotsByBotIdMemoryErrors, GetBotsByBotIdMemoryResponse, GetBotsByBotIdMemoryResponses, GetBotsByBotIdMemoryStatusData, GetBotsByBotIdMemoryStatusError, GetBotsByBotIdMemoryStatusErrors, GetBotsByBotIdMemoryStatusResponse, GetBotsByBotIdMemoryStatusResponses, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMemoryUsageError, GetBotsByBotIdMemoryUsageErrors, GetBotsByBotIdMemoryUsageResponse, GetBotsByBotIdMemoryUsageResponses, GetBotsByBotIdMessagesData, GetBotsByBotIdMessagesError, GetBotsByBotIdMessagesErrors, GetBotsByBotIdMessagesResponse, GetBotsByBotIdMessagesResponses, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdError, GetBotsByBotIdScheduleByIdErrors, GetBotsByBotIdScheduleByIdLogsData, GetBotsByBotIdScheduleByIdLogsError, GetBotsByBotIdScheduleByIdLogsErrors, GetBotsByBotIdScheduleByIdLogsResponse, GetBotsByBotIdScheduleByIdLogsResponses, GetBotsByBotIdScheduleByIdResponse, GetBotsByBotIdScheduleByIdResponses, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleError, GetBotsByBotIdScheduleErrors, GetBotsByBotIdScheduleLogsData, GetBotsByBotIdScheduleLogsError, GetBotsByBotIdScheduleLogsErrors, GetBotsByBotIdScheduleLogsResponse, GetBotsByBotIdScheduleLogsResponses, GetBotsByBotIdScheduleResponse, GetBotsByBotIdScheduleResponses, GetBotsByBotIdSessionsBySessionIdData, GetBotsByBotIdSessionsBySessionIdError, GetBotsByBotIdSessionsBySessionIdErrors, GetBotsByBotIdSessionsBySessionIdResponse, GetBotsByBotIdSessionsBySessionIdResponses, GetBotsByBotIdSessionsData, GetBotsByBotIdSessionsError, GetBotsByBotIdSessionsErrors, GetBotsByBotIdSessionsResponse, GetBotsByBotIdSessionsResponses, GetBotsByBotIdSettingsData, GetBotsByBotIdSettingsError, GetBotsByBotIdSettingsErrors, GetBotsByBotIdSettingsResponse, GetBotsByBotIdSettingsResponses, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdContextError, GetBotsByBotIdSubagentsByIdContextErrors, GetBotsByBotIdSubagentsByIdContextResponse, GetBotsByBotIdSubagentsByIdContextResponses, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdError, GetBotsByBotIdSubagentsByIdErrors, GetBotsByBotIdSubagentsByIdResponse, GetBotsByBotIdSubagentsByIdResponses, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsByIdSkillsError, GetBotsByBotIdSubagentsByIdSkillsErrors, GetBotsByBotIdSubagentsByIdSkillsResponse, GetBotsByBotIdSubagentsByIdSkillsResponses, GetBotsByBotIdSubagentsData, GetBotsByBotIdSubagentsError, GetBotsByBotIdSubagentsErrors, GetBotsByBotIdSubagentsResponse, GetBotsByBotIdSubagentsResponses, GetBotsByBotIdTokenUsageData, GetBotsByBotIdTokenUsageError, GetBotsByBotIdTokenUsageErrors, GetBotsByBotIdTokenUsageResponse, GetBotsByBotIdTokenUsageResponses, GetBotsByBotIdWebStreamData, GetBotsByBotIdWebStreamError, GetBotsByBotIdWebStreamErrors, GetBotsByBotIdWebStreamResponse, GetBotsByBotIdWebStreamResponses, GetBotsByBotIdWebWsData, GetBotsByBotIdWebWsError, GetBotsByBotIdWebWsErrors, GetBotsByBotIdWhitelistData, GetBotsByBotIdWhitelistError, GetBotsByBotIdWhitelistErrors, GetBotsByBotIdWhitelistResponse, GetBotsByBotIdWhitelistResponses, GetBotsByIdChannelByPlatformData, GetBotsByIdChannelByPlatformError, GetBotsByIdChannelByPlatformErrors, GetBotsByIdChannelByPlatformResponse, GetBotsByIdChannelByPlatformResponses, GetBotsByIdChecksData, GetBotsByIdChecksError, GetBotsByIdChecksErrors, GetBotsByIdChecksResponse, GetBotsByIdChecksResponses, GetBotsByIdData, GetBotsByIdError, GetBotsByIdErrors, GetBotsByIdResponse, GetBotsByIdResponses, GetBotsData, GetBotsError, GetBotsErrors, GetBotsResponse, GetBotsResponses, GetBrowserContextsByIdData, GetBrowserContextsByIdError, GetBrowserContextsByIdErrors, GetBrowserContextsByIdResponse, GetBrowserContextsByIdResponses, GetBrowserContextsCoresData, GetBrowserContextsCoresError, GetBrowserContextsCoresErrors, GetBrowserContextsCoresResponse, GetBrowserContextsCoresResponses, GetBrowserContextsData, GetBrowserContextsError, GetBrowserContextsErrors, GetBrowserContextsResponse, GetBrowserContextsResponses, GetChannelsByPlatformData, GetChannelsByPlatformError, GetChannelsByPlatformErrors, GetChannelsByPlatformResponse, GetChannelsByPlatformResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetEmailOauthCallbackData, GetEmailOauthCallbackError, GetEmailOauthCallbackErrors, GetEmailOauthCallbackResponse, GetEmailOauthCallbackResponses, GetEmailProvidersByIdData, GetEmailProvidersByIdError, GetEmailProvidersByIdErrors, GetEmailProvidersByIdOauthAuthorizeData, GetEmailProvidersByIdOauthAuthorizeError, GetEmailProvidersByIdOauthAuthorizeErrors, GetEmailProvidersByIdOauthAuthorizeResponse, GetEmailProvidersByIdOauthAuthorizeResponses, GetEmailProvidersByIdOauthStatusData, GetEmailProvidersByIdOauthStatusError, GetEmailProvidersByIdOauthStatusErrors, GetEmailProvidersByIdOauthStatusResponse, GetEmailProvidersByIdOauthStatusResponses, GetEmailProvidersByIdResponse, GetEmailProvidersByIdResponses, GetEmailProvidersData, GetEmailProvidersError, GetEmailProvidersErrors, GetEmailProvidersMetaData, GetEmailProvidersMetaResponse, GetEmailProvidersMetaResponses, GetEmailProvidersResponse, GetEmailProvidersResponses, GetMemoryProvidersByIdData, GetMemoryProvidersByIdError, GetMemoryProvidersByIdErrors, GetMemoryProvidersByIdResponse, GetMemoryProvidersByIdResponses, GetMemoryProvidersByIdStatusData, GetMemoryProvidersByIdStatusError, GetMemoryProvidersByIdStatusErrors, GetMemoryProvidersByIdStatusResponse, GetMemoryProvidersByIdStatusResponses, GetMemoryProvidersData, GetMemoryProvidersError, GetMemoryProvidersErrors, GetMemoryProvidersMetaData, GetMemoryProvidersMetaResponse, GetMemoryProvidersMetaResponses, GetMemoryProvidersResponse, GetMemoryProvidersResponses, GetModelsByIdData, GetModelsByIdError, GetModelsByIdErrors, GetModelsByIdResponse, GetModelsByIdResponses, GetModelsCountData, GetModelsCountError, GetModelsCountErrors, GetModelsCountResponse, GetModelsCountResponses, GetModelsData, GetModelsError, GetModelsErrors, GetModelsModelByModelIdData, GetModelsModelByModelIdError, GetModelsModelByModelIdErrors, GetModelsModelByModelIdResponse, GetModelsModelByModelIdResponses, GetModelsResponse, GetModelsResponses, GetPingData, GetPingResponse, GetPingResponses, GetProvidersByIdData, GetProvidersByIdError, GetProvidersByIdErrors, GetProvidersByIdModelsData, GetProvidersByIdModelsError, GetProvidersByIdModelsErrors, GetProvidersByIdModelsResponse, GetProvidersByIdModelsResponses, GetProvidersByIdResponse, GetProvidersByIdResponses, GetProvidersCountData, GetProvidersCountError, GetProvidersCountErrors, GetProvidersCountResponse, GetProvidersCountResponses, GetProvidersData, GetProvidersError, GetProvidersErrors, GetProvidersNameByNameData, GetProvidersNameByNameError, GetProvidersNameByNameErrors, GetProvidersNameByNameResponse, GetProvidersNameByNameResponses, GetProvidersResponse, GetProvidersResponses, GetSearchProvidersByIdData, GetSearchProvidersByIdError, GetSearchProvidersByIdErrors, GetSearchProvidersByIdResponse, GetSearchProvidersByIdResponses, GetSearchProvidersData, GetSearchProvidersError, GetSearchProvidersErrors, GetSearchProvidersMetaData, GetSearchProvidersMetaResponse, GetSearchProvidersMetaResponses, GetSearchProvidersResponse, GetSearchProvidersResponses, GetTtsModelsByIdCapabilitiesData, GetTtsModelsByIdCapabilitiesError, GetTtsModelsByIdCapabilitiesErrors, GetTtsModelsByIdCapabilitiesResponse, GetTtsModelsByIdCapabilitiesResponses, GetTtsModelsByIdData, GetTtsModelsByIdError, GetTtsModelsByIdErrors, GetTtsModelsByIdResponse, GetTtsModelsByIdResponses, GetTtsModelsData, GetTtsModelsError, GetTtsModelsErrors, GetTtsModelsResponse, GetTtsModelsResponses, GetTtsProvidersByIdData, GetTtsProvidersByIdError, GetTtsProvidersByIdErrors, GetTtsProvidersByIdModelsData, GetTtsProvidersByIdModelsError, GetTtsProvidersByIdModelsErrors, GetTtsProvidersByIdModelsResponse, GetTtsProvidersByIdModelsResponses, GetTtsProvidersByIdResponse, GetTtsProvidersByIdResponses, GetTtsProvidersData, GetTtsProvidersError, GetTtsProvidersErrors, GetTtsProvidersMetaData, GetTtsProvidersMetaResponse, GetTtsProvidersMetaResponses, GetTtsProvidersResponse, GetTtsProvidersResponses, GetUsersByIdData, GetUsersByIdError, GetUsersByIdErrors, GetUsersByIdResponse, GetUsersByIdResponses, GetUsersData, GetUsersError, GetUsersErrors, GetUsersMeChannelsByPlatformData, GetUsersMeChannelsByPlatformError, GetUsersMeChannelsByPlatformErrors, GetUsersMeChannelsByPlatformResponse, GetUsersMeChannelsByPlatformResponses, GetUsersMeData, GetUsersMeError, GetUsersMeErrors, GetUsersMeIdentitiesData, GetUsersMeIdentitiesError, GetUsersMeIdentitiesErrors, GetUsersMeIdentitiesResponse, GetUsersMeIdentitiesResponses, GetUsersMeResponse, GetUsersMeResponses, GetUsersResponse, GetUsersResponses, GithubComMemohaiMemohInternalMcpConnection, HandlersBatchDeleteRequest, HandlersBrowserCoresResponse, HandlersChannelMeta, HandlersCreateContainerRequest, HandlersCreateContainerResponse, HandlersCreateSessionRequest, HandlersCreateSnapshotRequest, HandlersCreateSnapshotResponse, HandlersDailyTokenUsage, HandlersEmailOAuthStatusResponse, HandlersErrorResponse, HandlersFsDeleteRequest, HandlersFsFileInfo, HandlersFsListResponse, HandlersFsMkdirRequest, HandlersFsOpResponse, HandlersFsReadResponse, HandlersFsRenameRequest, HandlersFsUploadResponse, HandlersFsWriteRequest, HandlersGetContainerResponse, HandlersListMyIdentitiesResponse, HandlersListSnapshotsResponse, HandlersLocalChannelMessageRequest, HandlersLoginRequest, HandlersLoginResponse, HandlersMcpStdioRequest, HandlersMcpStdioResponse, HandlersMemoryAddPayload, HandlersMemoryCompactPayload, HandlersMemoryDeletePayload, HandlersMemorySearchPayload, HandlersModelTokenUsage, HandlersOauthAuthorizeRequest, HandlersOauthDiscoverRequest, HandlersOauthExchangeRequest, HandlersPingResponse, HandlersProbeResponse, HandlersRefreshResponse, HandlersRollbackRequest, HandlersSkillItem, HandlersSkillsDeleteRequest, HandlersSkillsOpResponse, HandlersSkillsResponse, HandlersSkillsUpsertRequest, HandlersSnapshotInfo, HandlersSynthesizeRequest, HandlersSynthesizeResponse, HandlersTerminalInfoResponse, HandlersTokenUsageResponse, HandlersUpdateSessionRequest, HeartbeatListLogsResponse, HeartbeatLog, IdentitiesChannelIdentity, McpAuthorizeResult, McpDiscoveryResult, McpExportResponse, McpImportRequest, McpListResponse, McpMcpServerEntry, McpOAuthStatus, McpToolDescriptor, McpUpsertRequest, MessageMessage, MessageMessageAsset, ModelsAddRequest, ModelsAddResponse, ModelsCountResponse, ModelsGetResponse, ModelsModelConfig, ModelsModelType, ModelsTestResponse, ModelsTestStatus, ModelsUpdateRequest, PatchBotsByBotIdSessionsBySessionIdData, PatchBotsByBotIdSessionsBySessionIdError, PatchBotsByBotIdSessionsBySessionIdErrors, PatchBotsByBotIdSessionsBySessionIdResponse, PatchBotsByBotIdSessionsBySessionIdResponses, PatchBotsByIdChannelByPlatformStatusData, PatchBotsByIdChannelByPlatformStatusError, PatchBotsByIdChannelByPlatformStatusErrors, PatchBotsByIdChannelByPlatformStatusResponse, PatchBotsByIdChannelByPlatformStatusResponses, PostAuthLoginData, PostAuthLoginError, PostAuthLoginErrors, PostAuthLoginResponse, PostAuthLoginResponses, PostAuthRefreshData, PostAuthRefreshError, PostAuthRefreshErrors, PostAuthRefreshResponse, PostAuthRefreshResponses, PostBotsByBotIdCliMessagesData, PostBotsByBotIdCliMessagesError, PostBotsByBotIdCliMessagesErrors, PostBotsByBotIdCliMessagesResponse, PostBotsByBotIdCliMessagesResponses, PostBotsByBotIdContainerData, PostBotsByBotIdContainerDataExportData, PostBotsByBotIdContainerDataExportError, PostBotsByBotIdContainerDataExportErrors, PostBotsByBotIdContainerDataExportResponses, PostBotsByBotIdContainerDataImportData, PostBotsByBotIdContainerDataImportError, PostBotsByBotIdContainerDataImportErrors, PostBotsByBotIdContainerDataImportResponse, PostBotsByBotIdContainerDataImportResponses, PostBotsByBotIdContainerDataRestoreData, PostBotsByBotIdContainerDataRestoreError, PostBotsByBotIdContainerDataRestoreErrors, PostBotsByBotIdContainerDataRestoreResponse, PostBotsByBotIdContainerDataRestoreResponses, PostBotsByBotIdContainerError, PostBotsByBotIdContainerErrors, PostBotsByBotIdContainerFsDeleteData, PostBotsByBotIdContainerFsDeleteError, PostBotsByBotIdContainerFsDeleteErrors, PostBotsByBotIdContainerFsDeleteResponse, PostBotsByBotIdContainerFsDeleteResponses, PostBotsByBotIdContainerFsMkdirData, PostBotsByBotIdContainerFsMkdirError, PostBotsByBotIdContainerFsMkdirErrors, PostBotsByBotIdContainerFsMkdirResponse, PostBotsByBotIdContainerFsMkdirResponses, PostBotsByBotIdContainerFsRenameData, PostBotsByBotIdContainerFsRenameError, PostBotsByBotIdContainerFsRenameErrors, PostBotsByBotIdContainerFsRenameResponse, PostBotsByBotIdContainerFsRenameResponses, PostBotsByBotIdContainerFsUploadData, PostBotsByBotIdContainerFsUploadError, PostBotsByBotIdContainerFsUploadErrors, PostBotsByBotIdContainerFsUploadResponse, PostBotsByBotIdContainerFsUploadResponses, PostBotsByBotIdContainerFsWriteData, PostBotsByBotIdContainerFsWriteError, PostBotsByBotIdContainerFsWriteErrors, PostBotsByBotIdContainerFsWriteResponse, PostBotsByBotIdContainerFsWriteResponses, PostBotsByBotIdContainerResponse, PostBotsByBotIdContainerResponses, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsError, PostBotsByBotIdContainerSkillsErrors, PostBotsByBotIdContainerSkillsResponse, PostBotsByBotIdContainerSkillsResponses, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsError, PostBotsByBotIdContainerSnapshotsErrors, PostBotsByBotIdContainerSnapshotsResponse, PostBotsByBotIdContainerSnapshotsResponses, PostBotsByBotIdContainerSnapshotsRollbackData, PostBotsByBotIdContainerSnapshotsRollbackError, PostBotsByBotIdContainerSnapshotsRollbackErrors, PostBotsByBotIdContainerSnapshotsRollbackResponse, PostBotsByBotIdContainerSnapshotsRollbackResponses, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartError, PostBotsByBotIdContainerStartErrors, PostBotsByBotIdContainerStartResponse, PostBotsByBotIdContainerStartResponses, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopError, PostBotsByBotIdContainerStopErrors, PostBotsByBotIdContainerStopResponse, PostBotsByBotIdContainerStopResponses, PostBotsByBotIdEmailBindingsData, PostBotsByBotIdEmailBindingsError, PostBotsByBotIdEmailBindingsErrors, PostBotsByBotIdEmailBindingsResponse, PostBotsByBotIdEmailBindingsResponses, PostBotsByBotIdMcpByIdOauthAuthorizeData, PostBotsByBotIdMcpByIdOauthAuthorizeError, PostBotsByBotIdMcpByIdOauthAuthorizeErrors, PostBotsByBotIdMcpByIdOauthAuthorizeResponse, PostBotsByBotIdMcpByIdOauthAuthorizeResponses, PostBotsByBotIdMcpByIdOauthDiscoverData, PostBotsByBotIdMcpByIdOauthDiscoverError, PostBotsByBotIdMcpByIdOauthDiscoverErrors, PostBotsByBotIdMcpByIdOauthDiscoverResponse, PostBotsByBotIdMcpByIdOauthDiscoverResponses, PostBotsByBotIdMcpByIdOauthExchangeData, PostBotsByBotIdMcpByIdOauthExchangeError, PostBotsByBotIdMcpByIdOauthExchangeErrors, PostBotsByBotIdMcpByIdOauthExchangeResponse, PostBotsByBotIdMcpByIdOauthExchangeResponses, PostBotsByBotIdMcpByIdProbeData, PostBotsByBotIdMcpByIdProbeError, PostBotsByBotIdMcpByIdProbeErrors, PostBotsByBotIdMcpByIdProbeResponse, PostBotsByBotIdMcpByIdProbeResponses, PostBotsByBotIdMcpData, PostBotsByBotIdMcpError, PostBotsByBotIdMcpErrors, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteError, PostBotsByBotIdMcpOpsBatchDeleteErrors, PostBotsByBotIdMcpOpsBatchDeleteResponses, PostBotsByBotIdMcpResponse, PostBotsByBotIdMcpResponses, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdError, PostBotsByBotIdMcpStdioByConnectionIdErrors, PostBotsByBotIdMcpStdioByConnectionIdResponse, PostBotsByBotIdMcpStdioByConnectionIdResponses, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioError, PostBotsByBotIdMcpStdioErrors, PostBotsByBotIdMcpStdioResponse, PostBotsByBotIdMcpStdioResponses, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactError, PostBotsByBotIdMemoryCompactErrors, PostBotsByBotIdMemoryCompactResponse, PostBotsByBotIdMemoryCompactResponses, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryError, PostBotsByBotIdMemoryErrors, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildError, PostBotsByBotIdMemoryRebuildErrors, PostBotsByBotIdMemoryRebuildResponse, PostBotsByBotIdMemoryRebuildResponses, PostBotsByBotIdMemoryResponse, PostBotsByBotIdMemoryResponses, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchError, PostBotsByBotIdMemorySearchErrors, PostBotsByBotIdMemorySearchResponse, PostBotsByBotIdMemorySearchResponses, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleError, PostBotsByBotIdScheduleErrors, PostBotsByBotIdScheduleResponse, PostBotsByBotIdScheduleResponses, PostBotsByBotIdSessionsData, PostBotsByBotIdSessionsError, PostBotsByBotIdSessionsErrors, PostBotsByBotIdSessionsResponse, PostBotsByBotIdSessionsResponses, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsError, PostBotsByBotIdSettingsErrors, PostBotsByBotIdSettingsResponse, PostBotsByBotIdSettingsResponses, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsError, PostBotsByBotIdSubagentsByIdSkillsErrors, PostBotsByBotIdSubagentsByIdSkillsResponse, PostBotsByBotIdSubagentsByIdSkillsResponses, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsError, PostBotsByBotIdSubagentsErrors, PostBotsByBotIdSubagentsResponse, PostBotsByBotIdSubagentsResponses, PostBotsByBotIdToolsData, PostBotsByBotIdToolsError, PostBotsByBotIdToolsErrors, PostBotsByBotIdToolsResponse, PostBotsByBotIdToolsResponses, PostBotsByBotIdTtsSynthesizeData, PostBotsByBotIdTtsSynthesizeError, PostBotsByBotIdTtsSynthesizeErrors, PostBotsByBotIdTtsSynthesizeResponse, PostBotsByBotIdTtsSynthesizeResponses, PostBotsByBotIdWebMessagesData, PostBotsByBotIdWebMessagesError, PostBotsByBotIdWebMessagesErrors, PostBotsByBotIdWebMessagesResponse, PostBotsByBotIdWebMessagesResponses, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatError, PostBotsByIdChannelByPlatformSendChatErrors, PostBotsByIdChannelByPlatformSendChatResponse, PostBotsByIdChannelByPlatformSendChatResponses, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendError, PostBotsByIdChannelByPlatformSendErrors, PostBotsByIdChannelByPlatformSendResponse, PostBotsByIdChannelByPlatformSendResponses, PostBotsData, PostBotsError, PostBotsErrors, PostBotsResponse, PostBotsResponses, PostBrowserContextsData, PostBrowserContextsError, PostBrowserContextsErrors, PostBrowserContextsResponse, PostBrowserContextsResponses, PostEmailMailgunWebhookByConfigIdData, PostEmailMailgunWebhookByConfigIdError, PostEmailMailgunWebhookByConfigIdErrors, PostEmailMailgunWebhookByConfigIdResponse, PostEmailMailgunWebhookByConfigIdResponses, PostEmailProvidersData, PostEmailProvidersError, PostEmailProvidersErrors, PostEmailProvidersResponse, PostEmailProvidersResponses, PostMemoryProvidersData, PostMemoryProvidersError, PostMemoryProvidersErrors, PostMemoryProvidersResponse, PostMemoryProvidersResponses, PostModelsByIdTestData, PostModelsByIdTestError, PostModelsByIdTestErrors, PostModelsByIdTestResponse, PostModelsByIdTestResponses, PostModelsData, PostModelsError, PostModelsErrors, PostModelsResponse, PostModelsResponses, PostProvidersByIdImportModelsData, PostProvidersByIdImportModelsError, PostProvidersByIdImportModelsErrors, PostProvidersByIdImportModelsResponse, PostProvidersByIdImportModelsResponses, PostProvidersByIdTestData, PostProvidersByIdTestError, PostProvidersByIdTestErrors, PostProvidersByIdTestResponse, PostProvidersByIdTestResponses, PostProvidersData, PostProvidersError, PostProvidersErrors, PostProvidersResponse, PostProvidersResponses, PostSearchProvidersData, PostSearchProvidersError, PostSearchProvidersErrors, PostSearchProvidersResponse, PostSearchProvidersResponses, PostTtsModelsByIdTestData, PostTtsModelsByIdTestError, PostTtsModelsByIdTestErrors, PostTtsModelsByIdTestResponses, PostTtsModelsData, PostTtsModelsError, PostTtsModelsErrors, PostTtsModelsResponse, PostTtsModelsResponses, PostTtsProvidersByIdImportModelsData, PostTtsProvidersByIdImportModelsError, PostTtsProvidersByIdImportModelsErrors, PostTtsProvidersByIdImportModelsResponse, PostTtsProvidersByIdImportModelsResponses, PostTtsProvidersData, PostTtsProvidersError, PostTtsProvidersErrors, PostTtsProvidersResponse, PostTtsProvidersResponses, PostUsersData, PostUsersError, PostUsersErrors, PostUsersResponse, PostUsersResponses, ProvidersCountResponse, ProvidersCreateRequest, ProvidersGetResponse, ProvidersImportModelsResponse, ProvidersTestResponse, ProvidersUpdateRequest, PutBotsByBotIdBlacklistData, PutBotsByBotIdBlacklistError, PutBotsByBotIdBlacklistErrors, PutBotsByBotIdBlacklistResponse, PutBotsByBotIdBlacklistResponses, PutBotsByBotIdEmailBindingsByIdData, PutBotsByBotIdEmailBindingsByIdError, PutBotsByBotIdEmailBindingsByIdErrors, PutBotsByBotIdEmailBindingsByIdResponse, PutBotsByBotIdEmailBindingsByIdResponses, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdError, PutBotsByBotIdMcpByIdErrors, PutBotsByBotIdMcpByIdResponse, PutBotsByBotIdMcpByIdResponses, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportError, PutBotsByBotIdMcpImportErrors, PutBotsByBotIdMcpImportResponse, PutBotsByBotIdMcpImportResponses, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdError, PutBotsByBotIdScheduleByIdErrors, PutBotsByBotIdScheduleByIdResponse, PutBotsByBotIdScheduleByIdResponses, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsError, PutBotsByBotIdSettingsErrors, PutBotsByBotIdSettingsResponse, PutBotsByBotIdSettingsResponses, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextError, PutBotsByBotIdSubagentsByIdContextErrors, PutBotsByBotIdSubagentsByIdContextResponse, PutBotsByBotIdSubagentsByIdContextResponses, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdError, PutBotsByBotIdSubagentsByIdErrors, PutBotsByBotIdSubagentsByIdResponse, PutBotsByBotIdSubagentsByIdResponses, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsError, PutBotsByBotIdSubagentsByIdSkillsErrors, PutBotsByBotIdSubagentsByIdSkillsResponse, PutBotsByBotIdSubagentsByIdSkillsResponses, PutBotsByBotIdWhitelistData, PutBotsByBotIdWhitelistError, PutBotsByBotIdWhitelistErrors, PutBotsByBotIdWhitelistResponse, PutBotsByBotIdWhitelistResponses, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformError, PutBotsByIdChannelByPlatformErrors, PutBotsByIdChannelByPlatformResponse, PutBotsByIdChannelByPlatformResponses, PutBotsByIdData, PutBotsByIdError, PutBotsByIdErrors, PutBotsByIdOwnerData, PutBotsByIdOwnerError, PutBotsByIdOwnerErrors, PutBotsByIdOwnerResponse, PutBotsByIdOwnerResponses, PutBotsByIdResponse, PutBotsByIdResponses, PutBrowserContextsByIdData, PutBrowserContextsByIdError, PutBrowserContextsByIdErrors, PutBrowserContextsByIdResponse, PutBrowserContextsByIdResponses, PutEmailProvidersByIdData, PutEmailProvidersByIdError, PutEmailProvidersByIdErrors, PutEmailProvidersByIdResponse, PutEmailProvidersByIdResponses, PutMemoryProvidersByIdData, PutMemoryProvidersByIdError, PutMemoryProvidersByIdErrors, PutMemoryProvidersByIdResponse, PutMemoryProvidersByIdResponses, PutModelsByIdData, PutModelsByIdError, PutModelsByIdErrors, PutModelsByIdResponse, PutModelsByIdResponses, PutModelsModelByModelIdData, PutModelsModelByModelIdError, PutModelsModelByModelIdErrors, PutModelsModelByModelIdResponse, PutModelsModelByModelIdResponses, PutProvidersByIdData, PutProvidersByIdError, PutProvidersByIdErrors, PutProvidersByIdResponse, PutProvidersByIdResponses, PutSearchProvidersByIdData, PutSearchProvidersByIdError, PutSearchProvidersByIdErrors, PutSearchProvidersByIdResponse, PutSearchProvidersByIdResponses, PutTtsModelsByIdData, PutTtsModelsByIdError, PutTtsModelsByIdErrors, PutTtsModelsByIdResponse, PutTtsModelsByIdResponses, PutTtsProvidersByIdData, PutTtsProvidersByIdError, PutTtsProvidersByIdErrors, PutTtsProvidersByIdResponse, PutTtsProvidersByIdResponses, PutUsersByIdData, PutUsersByIdError, PutUsersByIdErrors, PutUsersByIdPasswordData, PutUsersByIdPasswordError, PutUsersByIdPasswordErrors, PutUsersByIdPasswordResponses, PutUsersByIdResponse, PutUsersByIdResponses, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformError, PutUsersMeChannelsByPlatformErrors, PutUsersMeChannelsByPlatformResponse, PutUsersMeChannelsByPlatformResponses, PutUsersMeData, PutUsersMeError, PutUsersMeErrors, PutUsersMePasswordData, PutUsersMePasswordError, PutUsersMePasswordErrors, PutUsersMePasswordResponses, PutUsersMeResponse, PutUsersMeResponses, ScheduleCreateRequest, ScheduleListLogsResponse, ScheduleListResponse, ScheduleLog, ScheduleNullableInt, ScheduleSchedule, ScheduleUpdateRequest, SearchprovidersCreateRequest, SearchprovidersGetResponse, SearchprovidersProviderConfigSchema, SearchprovidersProviderFieldSchema, SearchprovidersProviderMeta, SearchprovidersProviderName, SearchprovidersUpdateRequest, SessionSession, SettingsSettings, SettingsUpsertRequest, SubagentAddSkillsRequest, SubagentContextResponse, SubagentCreateRequest, SubagentListResponse, SubagentSkillsResponse, SubagentSubagent, SubagentUpdateContextRequest, SubagentUpdateRequest, SubagentUpdateSkillsRequest, TtsCreateModelRequest, TtsCreateProviderRequest, TtsModelCapabilities, TtsModelInfo, TtsModelResponse, TtsParamConstraint, TtsProviderMetaResponse, TtsProviderResponse, TtsTestSynthesizeRequest, TtsUpdateModelRequest, TtsUpdateProviderRequest, TtsVoiceInfo } from './types.gen'; +export { deleteBotsByBotIdBlacklistByRuleId, deleteBotsByBotIdCompactionLogs, deleteBotsByBotIdContainer, deleteBotsByBotIdContainerSkills, deleteBotsByBotIdEmailBindingsById, deleteBotsByBotIdHeartbeatLogs, deleteBotsByBotIdMcpById, deleteBotsByBotIdMcpByIdOauthToken, deleteBotsByBotIdMemory, deleteBotsByBotIdMemoryById, deleteBotsByBotIdMessages, deleteBotsByBotIdScheduleById, deleteBotsByBotIdScheduleLogs, deleteBotsByBotIdSessionsBySessionId, deleteBotsByBotIdSettings, deleteBotsByBotIdWhitelistByRuleId, deleteBotsById, deleteBotsByIdChannelByPlatform, deleteBrowserContextsById, deleteEmailProvidersById, deleteEmailProvidersByIdOauthToken, deleteMemoryProvidersById, deleteModelsById, deleteModelsModelByModelId, deleteProvidersById, deleteSearchProvidersById, deleteTtsModelsById, deleteTtsProvidersById, getBots, getBotsByBotIdAccessChannelIdentities, getBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversations, getBotsByBotIdAccessUsers, getBotsByBotIdBlacklist, getBotsByBotIdCliStream, getBotsByBotIdCliWs, getBotsByBotIdCompactionLogs, getBotsByBotIdContainer, getBotsByBotIdContainerFs, getBotsByBotIdContainerFsDownload, getBotsByBotIdContainerFsList, getBotsByBotIdContainerFsRead, getBotsByBotIdContainerSkills, getBotsByBotIdContainerSnapshots, getBotsByBotIdContainerTerminal, getBotsByBotIdContainerTerminalWs, getBotsByBotIdEmailBindings, getBotsByBotIdEmailOutbox, getBotsByBotIdEmailOutboxById, getBotsByBotIdHeartbeatLogs, getBotsByBotIdMcp, getBotsByBotIdMcpById, getBotsByBotIdMcpByIdOauthStatus, getBotsByBotIdMcpExport, getBotsByBotIdMemory, getBotsByBotIdMemoryStatus, getBotsByBotIdMemoryUsage, getBotsByBotIdMessages, getBotsByBotIdSchedule, getBotsByBotIdScheduleById, getBotsByBotIdScheduleByIdLogs, getBotsByBotIdScheduleLogs, getBotsByBotIdSessions, getBotsByBotIdSessionsBySessionId, getBotsByBotIdSettings, getBotsByBotIdTokenUsage, getBotsByBotIdWebStream, getBotsByBotIdWebWs, getBotsByBotIdWhitelist, getBotsById, getBotsByIdChannelByPlatform, getBotsByIdChecks, getBrowserContexts, getBrowserContextsById, getBrowserContextsCores, getChannels, getChannelsByPlatform, getEmailOauthCallback, getEmailProviders, getEmailProvidersById, getEmailProvidersByIdOauthAuthorize, getEmailProvidersByIdOauthStatus, getEmailProvidersMeta, getMemoryProviders, getMemoryProvidersById, getMemoryProvidersByIdStatus, getMemoryProvidersMeta, getModels, getModelsById, getModelsCount, getModelsModelByModelId, getPing, getProviders, getProvidersById, getProvidersByIdModels, getProvidersCount, getProvidersNameByName, getSearchProviders, getSearchProvidersById, getSearchProvidersMeta, getTtsModels, getTtsModelsById, getTtsModelsByIdCapabilities, getTtsProviders, getTtsProvidersById, getTtsProvidersByIdModels, getTtsProvidersMeta, getUsers, getUsersById, getUsersMe, getUsersMeChannelsByPlatform, getUsersMeIdentities, type Options, patchBotsByBotIdSessionsBySessionId, patchBotsByIdChannelByPlatformStatus, postAuthLogin, postAuthRefresh, postBots, postBotsByBotIdCliMessages, postBotsByBotIdContainer, postBotsByBotIdContainerDataExport, postBotsByBotIdContainerDataImport, postBotsByBotIdContainerDataRestore, postBotsByBotIdContainerFsDelete, postBotsByBotIdContainerFsMkdir, postBotsByBotIdContainerFsRename, postBotsByBotIdContainerFsUpload, postBotsByBotIdContainerFsWrite, postBotsByBotIdContainerSkills, postBotsByBotIdContainerSnapshots, postBotsByBotIdContainerSnapshotsRollback, postBotsByBotIdContainerStart, postBotsByBotIdContainerStop, postBotsByBotIdEmailBindings, postBotsByBotIdMcp, postBotsByBotIdMcpByIdOauthAuthorize, postBotsByBotIdMcpByIdOauthDiscover, postBotsByBotIdMcpByIdOauthExchange, postBotsByBotIdMcpByIdProbe, postBotsByBotIdMcpOpsBatchDelete, postBotsByBotIdMcpStdio, postBotsByBotIdMcpStdioByConnectionId, postBotsByBotIdMemory, postBotsByBotIdMemoryCompact, postBotsByBotIdMemoryRebuild, postBotsByBotIdMemorySearch, postBotsByBotIdSchedule, postBotsByBotIdSessions, postBotsByBotIdSettings, postBotsByBotIdTools, postBotsByBotIdTtsSynthesize, postBotsByBotIdWebMessages, postBotsByIdChannelByPlatformSend, postBotsByIdChannelByPlatformSendChat, postBrowserContexts, postEmailMailgunWebhookByConfigId, postEmailProviders, postMemoryProviders, postModels, postModelsByIdTest, postProviders, postProvidersByIdImportModels, postProvidersByIdTest, postSearchProviders, postTtsModels, postTtsModelsByIdTest, postTtsProviders, postTtsProvidersByIdImportModels, postUsers, putBotsByBotIdBlacklist, putBotsByBotIdEmailBindingsById, putBotsByBotIdMcpById, putBotsByBotIdMcpImport, putBotsByBotIdScheduleById, putBotsByBotIdSettings, putBotsByBotIdWhitelist, putBotsById, putBotsByIdChannelByPlatform, putBotsByIdOwner, putBrowserContextsById, putEmailProvidersById, putMemoryProvidersById, putModelsById, putModelsModelByModelId, putProvidersById, putSearchProvidersById, putTtsModelsById, putTtsProvidersById, putUsersById, putUsersByIdPassword, putUsersMe, putUsersMeChannelsByPlatform, putUsersMePassword } from './sdk.gen'; +export type { AccountsAccount, AccountsCreateAccountRequest, AccountsListAccountsResponse, AccountsResetPasswordRequest, AccountsUpdateAccountRequest, AccountsUpdatePasswordRequest, AccountsUpdateProfileRequest, AclChannelIdentityCandidate, AclChannelIdentityCandidateListResponse, AclListRulesResponse, AclObservedConversationCandidate, AclObservedConversationCandidateListResponse, AclRule, AclSourceScope, AclUpsertRuleRequest, AclUserCandidate, AclUserCandidateListResponse, AdaptersCdfPoint, AdaptersCompactResult, AdaptersDeleteResponse, AdaptersHealthStatus, AdaptersMemoryItem, AdaptersMemoryStatusResponse, AdaptersMessage, AdaptersProviderCollectionStatus, AdaptersProviderConfigSchema, AdaptersProviderCreateRequest, AdaptersProviderFieldSchema, AdaptersProviderGetResponse, AdaptersProviderMeta, AdaptersProviderStatusResponse, AdaptersProviderType, AdaptersProviderUpdateRequest, AdaptersRebuildResult, AdaptersSearchResponse, AdaptersTopKBucket, AdaptersUsageResponse, BotsBot, BotsBotCheck, BotsCreateBotRequest, BotsListBotsResponse, BotsListChecksResponse, BotsTransferBotRequest, BotsUpdateBotRequest, BrowsercontextsBrowserContext, BrowsercontextsCreateRequest, BrowsercontextsUpdateRequest, ChannelAction, ChannelAttachment, ChannelAttachmentType, ChannelChannelCapabilities, ChannelChannelConfig, ChannelChannelIdentityBinding, ChannelConfigSchema, ChannelFieldSchema, ChannelFieldType, ChannelMessage, ChannelMessageFormat, ChannelMessagePart, ChannelMessagePartType, ChannelMessageTextStyle, ChannelReplyRef, ChannelSendRequest, ChannelTargetHint, ChannelTargetSpec, ChannelThreadRef, ChannelUpdateChannelStatusRequest, ChannelUpsertChannelIdentityConfigRequest, ChannelUpsertConfigRequest, ClientOptions, CompactionListLogsResponse, CompactionLog, DeleteBotsByBotIdBlacklistByRuleIdData, DeleteBotsByBotIdBlacklistByRuleIdError, DeleteBotsByBotIdBlacklistByRuleIdErrors, DeleteBotsByBotIdBlacklistByRuleIdResponses, DeleteBotsByBotIdCompactionLogsData, DeleteBotsByBotIdCompactionLogsError, DeleteBotsByBotIdCompactionLogsErrors, DeleteBotsByBotIdCompactionLogsResponses, DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerError, DeleteBotsByBotIdContainerErrors, DeleteBotsByBotIdContainerResponses, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsError, DeleteBotsByBotIdContainerSkillsErrors, DeleteBotsByBotIdContainerSkillsResponse, DeleteBotsByBotIdContainerSkillsResponses, DeleteBotsByBotIdEmailBindingsByIdData, DeleteBotsByBotIdEmailBindingsByIdError, DeleteBotsByBotIdEmailBindingsByIdErrors, DeleteBotsByBotIdEmailBindingsByIdResponses, DeleteBotsByBotIdHeartbeatLogsData, DeleteBotsByBotIdHeartbeatLogsError, DeleteBotsByBotIdHeartbeatLogsErrors, DeleteBotsByBotIdHeartbeatLogsResponses, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdError, DeleteBotsByBotIdMcpByIdErrors, DeleteBotsByBotIdMcpByIdOauthTokenData, DeleteBotsByBotIdMcpByIdOauthTokenError, DeleteBotsByBotIdMcpByIdOauthTokenErrors, DeleteBotsByBotIdMcpByIdOauthTokenResponses, DeleteBotsByBotIdMcpByIdResponses, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdError, DeleteBotsByBotIdMemoryByIdErrors, DeleteBotsByBotIdMemoryByIdResponse, DeleteBotsByBotIdMemoryByIdResponses, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryError, DeleteBotsByBotIdMemoryErrors, DeleteBotsByBotIdMemoryResponse, DeleteBotsByBotIdMemoryResponses, DeleteBotsByBotIdMessagesData, DeleteBotsByBotIdMessagesError, DeleteBotsByBotIdMessagesErrors, DeleteBotsByBotIdMessagesResponses, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdError, DeleteBotsByBotIdScheduleByIdErrors, DeleteBotsByBotIdScheduleByIdResponses, DeleteBotsByBotIdScheduleLogsData, DeleteBotsByBotIdScheduleLogsError, DeleteBotsByBotIdScheduleLogsErrors, DeleteBotsByBotIdScheduleLogsResponses, DeleteBotsByBotIdSessionsBySessionIdData, DeleteBotsByBotIdSessionsBySessionIdError, DeleteBotsByBotIdSessionsBySessionIdErrors, DeleteBotsByBotIdSessionsBySessionIdResponses, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsError, DeleteBotsByBotIdSettingsErrors, DeleteBotsByBotIdSettingsResponses, DeleteBotsByBotIdWhitelistByRuleIdData, DeleteBotsByBotIdWhitelistByRuleIdError, DeleteBotsByBotIdWhitelistByRuleIdErrors, DeleteBotsByBotIdWhitelistByRuleIdResponses, DeleteBotsByIdChannelByPlatformData, DeleteBotsByIdChannelByPlatformError, DeleteBotsByIdChannelByPlatformErrors, DeleteBotsByIdChannelByPlatformResponses, DeleteBotsByIdData, DeleteBotsByIdError, DeleteBotsByIdErrors, DeleteBotsByIdResponse, DeleteBotsByIdResponses, DeleteBrowserContextsByIdData, DeleteBrowserContextsByIdError, DeleteBrowserContextsByIdErrors, DeleteBrowserContextsByIdResponses, DeleteEmailProvidersByIdData, DeleteEmailProvidersByIdError, DeleteEmailProvidersByIdErrors, DeleteEmailProvidersByIdOauthTokenData, DeleteEmailProvidersByIdOauthTokenError, DeleteEmailProvidersByIdOauthTokenErrors, DeleteEmailProvidersByIdOauthTokenResponses, DeleteEmailProvidersByIdResponses, DeleteMemoryProvidersByIdData, DeleteMemoryProvidersByIdError, DeleteMemoryProvidersByIdErrors, DeleteMemoryProvidersByIdResponses, DeleteModelsByIdData, DeleteModelsByIdError, DeleteModelsByIdErrors, DeleteModelsByIdResponses, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdError, DeleteModelsModelByModelIdErrors, DeleteModelsModelByModelIdResponses, DeleteProvidersByIdData, DeleteProvidersByIdError, DeleteProvidersByIdErrors, DeleteProvidersByIdResponses, DeleteSearchProvidersByIdData, DeleteSearchProvidersByIdError, DeleteSearchProvidersByIdErrors, DeleteSearchProvidersByIdResponses, DeleteTtsModelsByIdData, DeleteTtsModelsByIdError, DeleteTtsModelsByIdErrors, DeleteTtsModelsByIdResponses, DeleteTtsProvidersByIdData, DeleteTtsProvidersByIdError, DeleteTtsProvidersByIdErrors, DeleteTtsProvidersByIdResponses, EmailBindingResponse, EmailConfigSchema, EmailCreateBindingRequest, EmailCreateProviderRequest, EmailFieldSchema, EmailOutboxItemResponse, EmailProviderMeta, EmailProviderResponse, EmailUpdateBindingRequest, EmailUpdateProviderRequest, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsData, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsError, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsErrors, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsResponse, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsResponses, GetBotsByBotIdAccessChannelIdentitiesData, GetBotsByBotIdAccessChannelIdentitiesError, GetBotsByBotIdAccessChannelIdentitiesErrors, GetBotsByBotIdAccessChannelIdentitiesResponse, GetBotsByBotIdAccessChannelIdentitiesResponses, GetBotsByBotIdAccessUsersData, GetBotsByBotIdAccessUsersError, GetBotsByBotIdAccessUsersErrors, GetBotsByBotIdAccessUsersResponse, GetBotsByBotIdAccessUsersResponses, GetBotsByBotIdBlacklistData, GetBotsByBotIdBlacklistError, GetBotsByBotIdBlacklistErrors, GetBotsByBotIdBlacklistResponse, GetBotsByBotIdBlacklistResponses, GetBotsByBotIdCliStreamData, GetBotsByBotIdCliStreamError, GetBotsByBotIdCliStreamErrors, GetBotsByBotIdCliStreamResponse, GetBotsByBotIdCliStreamResponses, GetBotsByBotIdCliWsData, GetBotsByBotIdCliWsError, GetBotsByBotIdCliWsErrors, GetBotsByBotIdCompactionLogsData, GetBotsByBotIdCompactionLogsError, GetBotsByBotIdCompactionLogsErrors, GetBotsByBotIdCompactionLogsResponse, GetBotsByBotIdCompactionLogsResponses, GetBotsByBotIdContainerData, GetBotsByBotIdContainerError, GetBotsByBotIdContainerErrors, GetBotsByBotIdContainerFsData, GetBotsByBotIdContainerFsDownloadData, GetBotsByBotIdContainerFsDownloadError, GetBotsByBotIdContainerFsDownloadErrors, GetBotsByBotIdContainerFsDownloadResponses, GetBotsByBotIdContainerFsError, GetBotsByBotIdContainerFsErrors, GetBotsByBotIdContainerFsListData, GetBotsByBotIdContainerFsListError, GetBotsByBotIdContainerFsListErrors, GetBotsByBotIdContainerFsListResponse, GetBotsByBotIdContainerFsListResponses, GetBotsByBotIdContainerFsReadData, GetBotsByBotIdContainerFsReadError, GetBotsByBotIdContainerFsReadErrors, GetBotsByBotIdContainerFsReadResponse, GetBotsByBotIdContainerFsReadResponses, GetBotsByBotIdContainerFsResponse, GetBotsByBotIdContainerFsResponses, GetBotsByBotIdContainerResponse, GetBotsByBotIdContainerResponses, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSkillsError, GetBotsByBotIdContainerSkillsErrors, GetBotsByBotIdContainerSkillsResponse, GetBotsByBotIdContainerSkillsResponses, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerSnapshotsError, GetBotsByBotIdContainerSnapshotsErrors, GetBotsByBotIdContainerSnapshotsResponse, GetBotsByBotIdContainerSnapshotsResponses, GetBotsByBotIdContainerTerminalData, GetBotsByBotIdContainerTerminalError, GetBotsByBotIdContainerTerminalErrors, GetBotsByBotIdContainerTerminalResponse, GetBotsByBotIdContainerTerminalResponses, GetBotsByBotIdContainerTerminalWsData, GetBotsByBotIdContainerTerminalWsError, GetBotsByBotIdContainerTerminalWsErrors, GetBotsByBotIdEmailBindingsData, GetBotsByBotIdEmailBindingsError, GetBotsByBotIdEmailBindingsErrors, GetBotsByBotIdEmailBindingsResponse, GetBotsByBotIdEmailBindingsResponses, GetBotsByBotIdEmailOutboxByIdData, GetBotsByBotIdEmailOutboxByIdError, GetBotsByBotIdEmailOutboxByIdErrors, GetBotsByBotIdEmailOutboxByIdResponse, GetBotsByBotIdEmailOutboxByIdResponses, GetBotsByBotIdEmailOutboxData, GetBotsByBotIdEmailOutboxError, GetBotsByBotIdEmailOutboxErrors, GetBotsByBotIdEmailOutboxResponse, GetBotsByBotIdEmailOutboxResponses, GetBotsByBotIdHeartbeatLogsData, GetBotsByBotIdHeartbeatLogsError, GetBotsByBotIdHeartbeatLogsErrors, GetBotsByBotIdHeartbeatLogsResponse, GetBotsByBotIdHeartbeatLogsResponses, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdError, GetBotsByBotIdMcpByIdErrors, GetBotsByBotIdMcpByIdOauthStatusData, GetBotsByBotIdMcpByIdOauthStatusError, GetBotsByBotIdMcpByIdOauthStatusErrors, GetBotsByBotIdMcpByIdOauthStatusResponse, GetBotsByBotIdMcpByIdOauthStatusResponses, GetBotsByBotIdMcpByIdResponse, GetBotsByBotIdMcpByIdResponses, GetBotsByBotIdMcpData, GetBotsByBotIdMcpError, GetBotsByBotIdMcpErrors, GetBotsByBotIdMcpExportData, GetBotsByBotIdMcpExportError, GetBotsByBotIdMcpExportErrors, GetBotsByBotIdMcpExportResponse, GetBotsByBotIdMcpExportResponses, GetBotsByBotIdMcpResponse, GetBotsByBotIdMcpResponses, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryError, GetBotsByBotIdMemoryErrors, GetBotsByBotIdMemoryResponse, GetBotsByBotIdMemoryResponses, GetBotsByBotIdMemoryStatusData, GetBotsByBotIdMemoryStatusError, GetBotsByBotIdMemoryStatusErrors, GetBotsByBotIdMemoryStatusResponse, GetBotsByBotIdMemoryStatusResponses, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMemoryUsageError, GetBotsByBotIdMemoryUsageErrors, GetBotsByBotIdMemoryUsageResponse, GetBotsByBotIdMemoryUsageResponses, GetBotsByBotIdMessagesData, GetBotsByBotIdMessagesError, GetBotsByBotIdMessagesErrors, GetBotsByBotIdMessagesResponse, GetBotsByBotIdMessagesResponses, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdError, GetBotsByBotIdScheduleByIdErrors, GetBotsByBotIdScheduleByIdLogsData, GetBotsByBotIdScheduleByIdLogsError, GetBotsByBotIdScheduleByIdLogsErrors, GetBotsByBotIdScheduleByIdLogsResponse, GetBotsByBotIdScheduleByIdLogsResponses, GetBotsByBotIdScheduleByIdResponse, GetBotsByBotIdScheduleByIdResponses, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleError, GetBotsByBotIdScheduleErrors, GetBotsByBotIdScheduleLogsData, GetBotsByBotIdScheduleLogsError, GetBotsByBotIdScheduleLogsErrors, GetBotsByBotIdScheduleLogsResponse, GetBotsByBotIdScheduleLogsResponses, GetBotsByBotIdScheduleResponse, GetBotsByBotIdScheduleResponses, GetBotsByBotIdSessionsBySessionIdData, GetBotsByBotIdSessionsBySessionIdError, GetBotsByBotIdSessionsBySessionIdErrors, GetBotsByBotIdSessionsBySessionIdResponse, GetBotsByBotIdSessionsBySessionIdResponses, GetBotsByBotIdSessionsData, GetBotsByBotIdSessionsError, GetBotsByBotIdSessionsErrors, GetBotsByBotIdSessionsResponse, GetBotsByBotIdSessionsResponses, GetBotsByBotIdSettingsData, GetBotsByBotIdSettingsError, GetBotsByBotIdSettingsErrors, GetBotsByBotIdSettingsResponse, GetBotsByBotIdSettingsResponses, GetBotsByBotIdTokenUsageData, GetBotsByBotIdTokenUsageError, GetBotsByBotIdTokenUsageErrors, GetBotsByBotIdTokenUsageResponse, GetBotsByBotIdTokenUsageResponses, GetBotsByBotIdWebStreamData, GetBotsByBotIdWebStreamError, GetBotsByBotIdWebStreamErrors, GetBotsByBotIdWebStreamResponse, GetBotsByBotIdWebStreamResponses, GetBotsByBotIdWebWsData, GetBotsByBotIdWebWsError, GetBotsByBotIdWebWsErrors, GetBotsByBotIdWhitelistData, GetBotsByBotIdWhitelistError, GetBotsByBotIdWhitelistErrors, GetBotsByBotIdWhitelistResponse, GetBotsByBotIdWhitelistResponses, GetBotsByIdChannelByPlatformData, GetBotsByIdChannelByPlatformError, GetBotsByIdChannelByPlatformErrors, GetBotsByIdChannelByPlatformResponse, GetBotsByIdChannelByPlatformResponses, GetBotsByIdChecksData, GetBotsByIdChecksError, GetBotsByIdChecksErrors, GetBotsByIdChecksResponse, GetBotsByIdChecksResponses, GetBotsByIdData, GetBotsByIdError, GetBotsByIdErrors, GetBotsByIdResponse, GetBotsByIdResponses, GetBotsData, GetBotsError, GetBotsErrors, GetBotsResponse, GetBotsResponses, GetBrowserContextsByIdData, GetBrowserContextsByIdError, GetBrowserContextsByIdErrors, GetBrowserContextsByIdResponse, GetBrowserContextsByIdResponses, GetBrowserContextsCoresData, GetBrowserContextsCoresError, GetBrowserContextsCoresErrors, GetBrowserContextsCoresResponse, GetBrowserContextsCoresResponses, GetBrowserContextsData, GetBrowserContextsError, GetBrowserContextsErrors, GetBrowserContextsResponse, GetBrowserContextsResponses, GetChannelsByPlatformData, GetChannelsByPlatformError, GetChannelsByPlatformErrors, GetChannelsByPlatformResponse, GetChannelsByPlatformResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetEmailOauthCallbackData, GetEmailOauthCallbackError, GetEmailOauthCallbackErrors, GetEmailOauthCallbackResponse, GetEmailOauthCallbackResponses, GetEmailProvidersByIdData, GetEmailProvidersByIdError, GetEmailProvidersByIdErrors, GetEmailProvidersByIdOauthAuthorizeData, GetEmailProvidersByIdOauthAuthorizeError, GetEmailProvidersByIdOauthAuthorizeErrors, GetEmailProvidersByIdOauthAuthorizeResponse, GetEmailProvidersByIdOauthAuthorizeResponses, GetEmailProvidersByIdOauthStatusData, GetEmailProvidersByIdOauthStatusError, GetEmailProvidersByIdOauthStatusErrors, GetEmailProvidersByIdOauthStatusResponse, GetEmailProvidersByIdOauthStatusResponses, GetEmailProvidersByIdResponse, GetEmailProvidersByIdResponses, GetEmailProvidersData, GetEmailProvidersError, GetEmailProvidersErrors, GetEmailProvidersMetaData, GetEmailProvidersMetaResponse, GetEmailProvidersMetaResponses, GetEmailProvidersResponse, GetEmailProvidersResponses, GetMemoryProvidersByIdData, GetMemoryProvidersByIdError, GetMemoryProvidersByIdErrors, GetMemoryProvidersByIdResponse, GetMemoryProvidersByIdResponses, GetMemoryProvidersByIdStatusData, GetMemoryProvidersByIdStatusError, GetMemoryProvidersByIdStatusErrors, GetMemoryProvidersByIdStatusResponse, GetMemoryProvidersByIdStatusResponses, GetMemoryProvidersData, GetMemoryProvidersError, GetMemoryProvidersErrors, GetMemoryProvidersMetaData, GetMemoryProvidersMetaResponse, GetMemoryProvidersMetaResponses, GetMemoryProvidersResponse, GetMemoryProvidersResponses, GetModelsByIdData, GetModelsByIdError, GetModelsByIdErrors, GetModelsByIdResponse, GetModelsByIdResponses, GetModelsCountData, GetModelsCountError, GetModelsCountErrors, GetModelsCountResponse, GetModelsCountResponses, GetModelsData, GetModelsError, GetModelsErrors, GetModelsModelByModelIdData, GetModelsModelByModelIdError, GetModelsModelByModelIdErrors, GetModelsModelByModelIdResponse, GetModelsModelByModelIdResponses, GetModelsResponse, GetModelsResponses, GetPingData, GetPingResponse, GetPingResponses, GetProvidersByIdData, GetProvidersByIdError, GetProvidersByIdErrors, GetProvidersByIdModelsData, GetProvidersByIdModelsError, GetProvidersByIdModelsErrors, GetProvidersByIdModelsResponse, GetProvidersByIdModelsResponses, GetProvidersByIdResponse, GetProvidersByIdResponses, GetProvidersCountData, GetProvidersCountError, GetProvidersCountErrors, GetProvidersCountResponse, GetProvidersCountResponses, GetProvidersData, GetProvidersError, GetProvidersErrors, GetProvidersNameByNameData, GetProvidersNameByNameError, GetProvidersNameByNameErrors, GetProvidersNameByNameResponse, GetProvidersNameByNameResponses, GetProvidersResponse, GetProvidersResponses, GetSearchProvidersByIdData, GetSearchProvidersByIdError, GetSearchProvidersByIdErrors, GetSearchProvidersByIdResponse, GetSearchProvidersByIdResponses, GetSearchProvidersData, GetSearchProvidersError, GetSearchProvidersErrors, GetSearchProvidersMetaData, GetSearchProvidersMetaResponse, GetSearchProvidersMetaResponses, GetSearchProvidersResponse, GetSearchProvidersResponses, GetTtsModelsByIdCapabilitiesData, GetTtsModelsByIdCapabilitiesError, GetTtsModelsByIdCapabilitiesErrors, GetTtsModelsByIdCapabilitiesResponse, GetTtsModelsByIdCapabilitiesResponses, GetTtsModelsByIdData, GetTtsModelsByIdError, GetTtsModelsByIdErrors, GetTtsModelsByIdResponse, GetTtsModelsByIdResponses, GetTtsModelsData, GetTtsModelsError, GetTtsModelsErrors, GetTtsModelsResponse, GetTtsModelsResponses, GetTtsProvidersByIdData, GetTtsProvidersByIdError, GetTtsProvidersByIdErrors, GetTtsProvidersByIdModelsData, GetTtsProvidersByIdModelsError, GetTtsProvidersByIdModelsErrors, GetTtsProvidersByIdModelsResponse, GetTtsProvidersByIdModelsResponses, GetTtsProvidersByIdResponse, GetTtsProvidersByIdResponses, GetTtsProvidersData, GetTtsProvidersError, GetTtsProvidersErrors, GetTtsProvidersMetaData, GetTtsProvidersMetaResponse, GetTtsProvidersMetaResponses, GetTtsProvidersResponse, GetTtsProvidersResponses, GetUsersByIdData, GetUsersByIdError, GetUsersByIdErrors, GetUsersByIdResponse, GetUsersByIdResponses, GetUsersData, GetUsersError, GetUsersErrors, GetUsersMeChannelsByPlatformData, GetUsersMeChannelsByPlatformError, GetUsersMeChannelsByPlatformErrors, GetUsersMeChannelsByPlatformResponse, GetUsersMeChannelsByPlatformResponses, GetUsersMeData, GetUsersMeError, GetUsersMeErrors, GetUsersMeIdentitiesData, GetUsersMeIdentitiesError, GetUsersMeIdentitiesErrors, GetUsersMeIdentitiesResponse, GetUsersMeIdentitiesResponses, GetUsersMeResponse, GetUsersMeResponses, GetUsersResponse, GetUsersResponses, GithubComMemohaiMemohInternalMcpConnection, HandlersBatchDeleteRequest, HandlersBrowserCoresResponse, HandlersChannelMeta, HandlersCreateContainerRequest, HandlersCreateContainerResponse, HandlersCreateSessionRequest, HandlersCreateSnapshotRequest, HandlersCreateSnapshotResponse, HandlersDailyTokenUsage, HandlersEmailOAuthStatusResponse, HandlersErrorResponse, HandlersFsDeleteRequest, HandlersFsFileInfo, HandlersFsListResponse, HandlersFsMkdirRequest, HandlersFsOpResponse, HandlersFsReadResponse, HandlersFsRenameRequest, HandlersFsUploadResponse, HandlersFsWriteRequest, HandlersGetContainerResponse, HandlersListMyIdentitiesResponse, HandlersListSnapshotsResponse, HandlersLocalChannelMessageRequest, HandlersLoginRequest, HandlersLoginResponse, HandlersMcpStdioRequest, HandlersMcpStdioResponse, HandlersMemoryAddPayload, HandlersMemoryCompactPayload, HandlersMemoryDeletePayload, HandlersMemorySearchPayload, HandlersModelTokenUsage, HandlersOauthAuthorizeRequest, HandlersOauthDiscoverRequest, HandlersOauthExchangeRequest, HandlersPingResponse, HandlersProbeResponse, HandlersRefreshResponse, HandlersRollbackRequest, HandlersSkillItem, HandlersSkillsDeleteRequest, HandlersSkillsOpResponse, HandlersSkillsResponse, HandlersSkillsUpsertRequest, HandlersSnapshotInfo, HandlersSynthesizeRequest, HandlersSynthesizeResponse, HandlersTerminalInfoResponse, HandlersTokenUsageResponse, HandlersUpdateSessionRequest, HeartbeatListLogsResponse, HeartbeatLog, IdentitiesChannelIdentity, McpAuthorizeResult, McpDiscoveryResult, McpExportResponse, McpImportRequest, McpListResponse, McpMcpServerEntry, McpOAuthStatus, McpToolDescriptor, McpUpsertRequest, MessageMessage, MessageMessageAsset, ModelsAddRequest, ModelsAddResponse, ModelsCountResponse, ModelsGetResponse, ModelsModelConfig, ModelsModelType, ModelsTestResponse, ModelsTestStatus, ModelsUpdateRequest, PatchBotsByBotIdSessionsBySessionIdData, PatchBotsByBotIdSessionsBySessionIdError, PatchBotsByBotIdSessionsBySessionIdErrors, PatchBotsByBotIdSessionsBySessionIdResponse, PatchBotsByBotIdSessionsBySessionIdResponses, PatchBotsByIdChannelByPlatformStatusData, PatchBotsByIdChannelByPlatformStatusError, PatchBotsByIdChannelByPlatformStatusErrors, PatchBotsByIdChannelByPlatformStatusResponse, PatchBotsByIdChannelByPlatformStatusResponses, PostAuthLoginData, PostAuthLoginError, PostAuthLoginErrors, PostAuthLoginResponse, PostAuthLoginResponses, PostAuthRefreshData, PostAuthRefreshError, PostAuthRefreshErrors, PostAuthRefreshResponse, PostAuthRefreshResponses, PostBotsByBotIdCliMessagesData, PostBotsByBotIdCliMessagesError, PostBotsByBotIdCliMessagesErrors, PostBotsByBotIdCliMessagesResponse, PostBotsByBotIdCliMessagesResponses, PostBotsByBotIdContainerData, PostBotsByBotIdContainerDataExportData, PostBotsByBotIdContainerDataExportError, PostBotsByBotIdContainerDataExportErrors, PostBotsByBotIdContainerDataExportResponses, PostBotsByBotIdContainerDataImportData, PostBotsByBotIdContainerDataImportError, PostBotsByBotIdContainerDataImportErrors, PostBotsByBotIdContainerDataImportResponse, PostBotsByBotIdContainerDataImportResponses, PostBotsByBotIdContainerDataRestoreData, PostBotsByBotIdContainerDataRestoreError, PostBotsByBotIdContainerDataRestoreErrors, PostBotsByBotIdContainerDataRestoreResponse, PostBotsByBotIdContainerDataRestoreResponses, PostBotsByBotIdContainerError, PostBotsByBotIdContainerErrors, PostBotsByBotIdContainerFsDeleteData, PostBotsByBotIdContainerFsDeleteError, PostBotsByBotIdContainerFsDeleteErrors, PostBotsByBotIdContainerFsDeleteResponse, PostBotsByBotIdContainerFsDeleteResponses, PostBotsByBotIdContainerFsMkdirData, PostBotsByBotIdContainerFsMkdirError, PostBotsByBotIdContainerFsMkdirErrors, PostBotsByBotIdContainerFsMkdirResponse, PostBotsByBotIdContainerFsMkdirResponses, PostBotsByBotIdContainerFsRenameData, PostBotsByBotIdContainerFsRenameError, PostBotsByBotIdContainerFsRenameErrors, PostBotsByBotIdContainerFsRenameResponse, PostBotsByBotIdContainerFsRenameResponses, PostBotsByBotIdContainerFsUploadData, PostBotsByBotIdContainerFsUploadError, PostBotsByBotIdContainerFsUploadErrors, PostBotsByBotIdContainerFsUploadResponse, PostBotsByBotIdContainerFsUploadResponses, PostBotsByBotIdContainerFsWriteData, PostBotsByBotIdContainerFsWriteError, PostBotsByBotIdContainerFsWriteErrors, PostBotsByBotIdContainerFsWriteResponse, PostBotsByBotIdContainerFsWriteResponses, PostBotsByBotIdContainerResponse, PostBotsByBotIdContainerResponses, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsError, PostBotsByBotIdContainerSkillsErrors, PostBotsByBotIdContainerSkillsResponse, PostBotsByBotIdContainerSkillsResponses, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsError, PostBotsByBotIdContainerSnapshotsErrors, PostBotsByBotIdContainerSnapshotsResponse, PostBotsByBotIdContainerSnapshotsResponses, PostBotsByBotIdContainerSnapshotsRollbackData, PostBotsByBotIdContainerSnapshotsRollbackError, PostBotsByBotIdContainerSnapshotsRollbackErrors, PostBotsByBotIdContainerSnapshotsRollbackResponse, PostBotsByBotIdContainerSnapshotsRollbackResponses, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartError, PostBotsByBotIdContainerStartErrors, PostBotsByBotIdContainerStartResponse, PostBotsByBotIdContainerStartResponses, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopError, PostBotsByBotIdContainerStopErrors, PostBotsByBotIdContainerStopResponse, PostBotsByBotIdContainerStopResponses, PostBotsByBotIdEmailBindingsData, PostBotsByBotIdEmailBindingsError, PostBotsByBotIdEmailBindingsErrors, PostBotsByBotIdEmailBindingsResponse, PostBotsByBotIdEmailBindingsResponses, PostBotsByBotIdMcpByIdOauthAuthorizeData, PostBotsByBotIdMcpByIdOauthAuthorizeError, PostBotsByBotIdMcpByIdOauthAuthorizeErrors, PostBotsByBotIdMcpByIdOauthAuthorizeResponse, PostBotsByBotIdMcpByIdOauthAuthorizeResponses, PostBotsByBotIdMcpByIdOauthDiscoverData, PostBotsByBotIdMcpByIdOauthDiscoverError, PostBotsByBotIdMcpByIdOauthDiscoverErrors, PostBotsByBotIdMcpByIdOauthDiscoverResponse, PostBotsByBotIdMcpByIdOauthDiscoverResponses, PostBotsByBotIdMcpByIdOauthExchangeData, PostBotsByBotIdMcpByIdOauthExchangeError, PostBotsByBotIdMcpByIdOauthExchangeErrors, PostBotsByBotIdMcpByIdOauthExchangeResponse, PostBotsByBotIdMcpByIdOauthExchangeResponses, PostBotsByBotIdMcpByIdProbeData, PostBotsByBotIdMcpByIdProbeError, PostBotsByBotIdMcpByIdProbeErrors, PostBotsByBotIdMcpByIdProbeResponse, PostBotsByBotIdMcpByIdProbeResponses, PostBotsByBotIdMcpData, PostBotsByBotIdMcpError, PostBotsByBotIdMcpErrors, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteError, PostBotsByBotIdMcpOpsBatchDeleteErrors, PostBotsByBotIdMcpOpsBatchDeleteResponses, PostBotsByBotIdMcpResponse, PostBotsByBotIdMcpResponses, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdError, PostBotsByBotIdMcpStdioByConnectionIdErrors, PostBotsByBotIdMcpStdioByConnectionIdResponse, PostBotsByBotIdMcpStdioByConnectionIdResponses, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioError, PostBotsByBotIdMcpStdioErrors, PostBotsByBotIdMcpStdioResponse, PostBotsByBotIdMcpStdioResponses, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactError, PostBotsByBotIdMemoryCompactErrors, PostBotsByBotIdMemoryCompactResponse, PostBotsByBotIdMemoryCompactResponses, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryError, PostBotsByBotIdMemoryErrors, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildError, PostBotsByBotIdMemoryRebuildErrors, PostBotsByBotIdMemoryRebuildResponse, PostBotsByBotIdMemoryRebuildResponses, PostBotsByBotIdMemoryResponse, PostBotsByBotIdMemoryResponses, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchError, PostBotsByBotIdMemorySearchErrors, PostBotsByBotIdMemorySearchResponse, PostBotsByBotIdMemorySearchResponses, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleError, PostBotsByBotIdScheduleErrors, PostBotsByBotIdScheduleResponse, PostBotsByBotIdScheduleResponses, PostBotsByBotIdSessionsData, PostBotsByBotIdSessionsError, PostBotsByBotIdSessionsErrors, PostBotsByBotIdSessionsResponse, PostBotsByBotIdSessionsResponses, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsError, PostBotsByBotIdSettingsErrors, PostBotsByBotIdSettingsResponse, PostBotsByBotIdSettingsResponses, PostBotsByBotIdToolsData, PostBotsByBotIdToolsError, PostBotsByBotIdToolsErrors, PostBotsByBotIdToolsResponse, PostBotsByBotIdToolsResponses, PostBotsByBotIdTtsSynthesizeData, PostBotsByBotIdTtsSynthesizeError, PostBotsByBotIdTtsSynthesizeErrors, PostBotsByBotIdTtsSynthesizeResponse, PostBotsByBotIdTtsSynthesizeResponses, PostBotsByBotIdWebMessagesData, PostBotsByBotIdWebMessagesError, PostBotsByBotIdWebMessagesErrors, PostBotsByBotIdWebMessagesResponse, PostBotsByBotIdWebMessagesResponses, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatError, PostBotsByIdChannelByPlatformSendChatErrors, PostBotsByIdChannelByPlatformSendChatResponse, PostBotsByIdChannelByPlatformSendChatResponses, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendError, PostBotsByIdChannelByPlatformSendErrors, PostBotsByIdChannelByPlatformSendResponse, PostBotsByIdChannelByPlatformSendResponses, PostBotsData, PostBotsError, PostBotsErrors, PostBotsResponse, PostBotsResponses, PostBrowserContextsData, PostBrowserContextsError, PostBrowserContextsErrors, PostBrowserContextsResponse, PostBrowserContextsResponses, PostEmailMailgunWebhookByConfigIdData, PostEmailMailgunWebhookByConfigIdError, PostEmailMailgunWebhookByConfigIdErrors, PostEmailMailgunWebhookByConfigIdResponse, PostEmailMailgunWebhookByConfigIdResponses, PostEmailProvidersData, PostEmailProvidersError, PostEmailProvidersErrors, PostEmailProvidersResponse, PostEmailProvidersResponses, PostMemoryProvidersData, PostMemoryProvidersError, PostMemoryProvidersErrors, PostMemoryProvidersResponse, PostMemoryProvidersResponses, PostModelsByIdTestData, PostModelsByIdTestError, PostModelsByIdTestErrors, PostModelsByIdTestResponse, PostModelsByIdTestResponses, PostModelsData, PostModelsError, PostModelsErrors, PostModelsResponse, PostModelsResponses, PostProvidersByIdImportModelsData, PostProvidersByIdImportModelsError, PostProvidersByIdImportModelsErrors, PostProvidersByIdImportModelsResponse, PostProvidersByIdImportModelsResponses, PostProvidersByIdTestData, PostProvidersByIdTestError, PostProvidersByIdTestErrors, PostProvidersByIdTestResponse, PostProvidersByIdTestResponses, PostProvidersData, PostProvidersError, PostProvidersErrors, PostProvidersResponse, PostProvidersResponses, PostSearchProvidersData, PostSearchProvidersError, PostSearchProvidersErrors, PostSearchProvidersResponse, PostSearchProvidersResponses, PostTtsModelsByIdTestData, PostTtsModelsByIdTestError, PostTtsModelsByIdTestErrors, PostTtsModelsByIdTestResponses, PostTtsModelsData, PostTtsModelsError, PostTtsModelsErrors, PostTtsModelsResponse, PostTtsModelsResponses, PostTtsProvidersByIdImportModelsData, PostTtsProvidersByIdImportModelsError, PostTtsProvidersByIdImportModelsErrors, PostTtsProvidersByIdImportModelsResponse, PostTtsProvidersByIdImportModelsResponses, PostTtsProvidersData, PostTtsProvidersError, PostTtsProvidersErrors, PostTtsProvidersResponse, PostTtsProvidersResponses, PostUsersData, PostUsersError, PostUsersErrors, PostUsersResponse, PostUsersResponses, ProvidersCountResponse, ProvidersCreateRequest, ProvidersGetResponse, ProvidersImportModelsResponse, ProvidersTestResponse, ProvidersUpdateRequest, PutBotsByBotIdBlacklistData, PutBotsByBotIdBlacklistError, PutBotsByBotIdBlacklistErrors, PutBotsByBotIdBlacklistResponse, PutBotsByBotIdBlacklistResponses, PutBotsByBotIdEmailBindingsByIdData, PutBotsByBotIdEmailBindingsByIdError, PutBotsByBotIdEmailBindingsByIdErrors, PutBotsByBotIdEmailBindingsByIdResponse, PutBotsByBotIdEmailBindingsByIdResponses, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdError, PutBotsByBotIdMcpByIdErrors, PutBotsByBotIdMcpByIdResponse, PutBotsByBotIdMcpByIdResponses, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportError, PutBotsByBotIdMcpImportErrors, PutBotsByBotIdMcpImportResponse, PutBotsByBotIdMcpImportResponses, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdError, PutBotsByBotIdScheduleByIdErrors, PutBotsByBotIdScheduleByIdResponse, PutBotsByBotIdScheduleByIdResponses, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsError, PutBotsByBotIdSettingsErrors, PutBotsByBotIdSettingsResponse, PutBotsByBotIdSettingsResponses, PutBotsByBotIdWhitelistData, PutBotsByBotIdWhitelistError, PutBotsByBotIdWhitelistErrors, PutBotsByBotIdWhitelistResponse, PutBotsByBotIdWhitelistResponses, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformError, PutBotsByIdChannelByPlatformErrors, PutBotsByIdChannelByPlatformResponse, PutBotsByIdChannelByPlatformResponses, PutBotsByIdData, PutBotsByIdError, PutBotsByIdErrors, PutBotsByIdOwnerData, PutBotsByIdOwnerError, PutBotsByIdOwnerErrors, PutBotsByIdOwnerResponse, PutBotsByIdOwnerResponses, PutBotsByIdResponse, PutBotsByIdResponses, PutBrowserContextsByIdData, PutBrowserContextsByIdError, PutBrowserContextsByIdErrors, PutBrowserContextsByIdResponse, PutBrowserContextsByIdResponses, PutEmailProvidersByIdData, PutEmailProvidersByIdError, PutEmailProvidersByIdErrors, PutEmailProvidersByIdResponse, PutEmailProvidersByIdResponses, PutMemoryProvidersByIdData, PutMemoryProvidersByIdError, PutMemoryProvidersByIdErrors, PutMemoryProvidersByIdResponse, PutMemoryProvidersByIdResponses, PutModelsByIdData, PutModelsByIdError, PutModelsByIdErrors, PutModelsByIdResponse, PutModelsByIdResponses, PutModelsModelByModelIdData, PutModelsModelByModelIdError, PutModelsModelByModelIdErrors, PutModelsModelByModelIdResponse, PutModelsModelByModelIdResponses, PutProvidersByIdData, PutProvidersByIdError, PutProvidersByIdErrors, PutProvidersByIdResponse, PutProvidersByIdResponses, PutSearchProvidersByIdData, PutSearchProvidersByIdError, PutSearchProvidersByIdErrors, PutSearchProvidersByIdResponse, PutSearchProvidersByIdResponses, PutTtsModelsByIdData, PutTtsModelsByIdError, PutTtsModelsByIdErrors, PutTtsModelsByIdResponse, PutTtsModelsByIdResponses, PutTtsProvidersByIdData, PutTtsProvidersByIdError, PutTtsProvidersByIdErrors, PutTtsProvidersByIdResponse, PutTtsProvidersByIdResponses, PutUsersByIdData, PutUsersByIdError, PutUsersByIdErrors, PutUsersByIdPasswordData, PutUsersByIdPasswordError, PutUsersByIdPasswordErrors, PutUsersByIdPasswordResponses, PutUsersByIdResponse, PutUsersByIdResponses, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformError, PutUsersMeChannelsByPlatformErrors, PutUsersMeChannelsByPlatformResponse, PutUsersMeChannelsByPlatformResponses, PutUsersMeData, PutUsersMeError, PutUsersMeErrors, PutUsersMePasswordData, PutUsersMePasswordError, PutUsersMePasswordErrors, PutUsersMePasswordResponses, PutUsersMeResponse, PutUsersMeResponses, ScheduleCreateRequest, ScheduleListLogsResponse, ScheduleListResponse, ScheduleLog, ScheduleNullableInt, ScheduleSchedule, ScheduleUpdateRequest, SearchprovidersCreateRequest, SearchprovidersGetResponse, SearchprovidersProviderConfigSchema, SearchprovidersProviderFieldSchema, SearchprovidersProviderMeta, SearchprovidersProviderName, SearchprovidersUpdateRequest, SessionSession, SettingsSettings, SettingsUpsertRequest, TtsCreateModelRequest, TtsCreateProviderRequest, TtsModelCapabilities, TtsModelInfo, TtsModelResponse, TtsParamConstraint, TtsProviderMetaResponse, TtsProviderResponse, TtsTestSynthesizeRequest, TtsUpdateModelRequest, TtsUpdateProviderRequest, TtsVoiceInfo } from './types.gen'; diff --git a/packages/sdk/src/sdk.gen.ts b/packages/sdk/src/sdk.gen.ts index c0497203..11343694 100644 --- a/packages/sdk/src/sdk.gen.ts +++ b/packages/sdk/src/sdk.gen.ts @@ -2,7 +2,7 @@ import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape } from './client'; import { client } from './client.gen'; -import type { DeleteBotsByBotIdBlacklistByRuleIdData, DeleteBotsByBotIdBlacklistByRuleIdErrors, DeleteBotsByBotIdBlacklistByRuleIdResponses, DeleteBotsByBotIdCompactionLogsData, DeleteBotsByBotIdCompactionLogsErrors, DeleteBotsByBotIdCompactionLogsResponses, DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerErrors, DeleteBotsByBotIdContainerResponses, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsErrors, DeleteBotsByBotIdContainerSkillsResponses, DeleteBotsByBotIdEmailBindingsByIdData, DeleteBotsByBotIdEmailBindingsByIdErrors, DeleteBotsByBotIdEmailBindingsByIdResponses, DeleteBotsByBotIdHeartbeatLogsData, DeleteBotsByBotIdHeartbeatLogsErrors, DeleteBotsByBotIdHeartbeatLogsResponses, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdErrors, DeleteBotsByBotIdMcpByIdOauthTokenData, DeleteBotsByBotIdMcpByIdOauthTokenErrors, DeleteBotsByBotIdMcpByIdOauthTokenResponses, DeleteBotsByBotIdMcpByIdResponses, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdErrors, DeleteBotsByBotIdMemoryByIdResponses, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryErrors, DeleteBotsByBotIdMemoryResponses, DeleteBotsByBotIdMessagesData, DeleteBotsByBotIdMessagesErrors, DeleteBotsByBotIdMessagesResponses, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdErrors, DeleteBotsByBotIdScheduleByIdResponses, DeleteBotsByBotIdScheduleLogsData, DeleteBotsByBotIdScheduleLogsErrors, DeleteBotsByBotIdScheduleLogsResponses, DeleteBotsByBotIdSessionsBySessionIdData, DeleteBotsByBotIdSessionsBySessionIdErrors, DeleteBotsByBotIdSessionsBySessionIdResponses, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsErrors, DeleteBotsByBotIdSettingsResponses, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdErrors, DeleteBotsByBotIdSubagentsByIdResponses, DeleteBotsByBotIdWhitelistByRuleIdData, DeleteBotsByBotIdWhitelistByRuleIdErrors, DeleteBotsByBotIdWhitelistByRuleIdResponses, DeleteBotsByIdChannelByPlatformData, DeleteBotsByIdChannelByPlatformErrors, DeleteBotsByIdChannelByPlatformResponses, DeleteBotsByIdData, DeleteBotsByIdErrors, DeleteBotsByIdResponses, DeleteBrowserContextsByIdData, DeleteBrowserContextsByIdErrors, DeleteBrowserContextsByIdResponses, DeleteEmailProvidersByIdData, DeleteEmailProvidersByIdErrors, DeleteEmailProvidersByIdOauthTokenData, DeleteEmailProvidersByIdOauthTokenErrors, DeleteEmailProvidersByIdOauthTokenResponses, DeleteEmailProvidersByIdResponses, DeleteMemoryProvidersByIdData, DeleteMemoryProvidersByIdErrors, DeleteMemoryProvidersByIdResponses, DeleteModelsByIdData, DeleteModelsByIdErrors, DeleteModelsByIdResponses, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdErrors, DeleteModelsModelByModelIdResponses, DeleteProvidersByIdData, DeleteProvidersByIdErrors, DeleteProvidersByIdResponses, DeleteSearchProvidersByIdData, DeleteSearchProvidersByIdErrors, DeleteSearchProvidersByIdResponses, DeleteTtsModelsByIdData, DeleteTtsModelsByIdErrors, DeleteTtsModelsByIdResponses, DeleteTtsProvidersByIdData, DeleteTtsProvidersByIdErrors, DeleteTtsProvidersByIdResponses, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsData, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsErrors, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsResponses, GetBotsByBotIdAccessChannelIdentitiesData, GetBotsByBotIdAccessChannelIdentitiesErrors, GetBotsByBotIdAccessChannelIdentitiesResponses, GetBotsByBotIdAccessUsersData, GetBotsByBotIdAccessUsersErrors, GetBotsByBotIdAccessUsersResponses, GetBotsByBotIdBlacklistData, GetBotsByBotIdBlacklistErrors, GetBotsByBotIdBlacklistResponses, GetBotsByBotIdCliStreamData, GetBotsByBotIdCliStreamErrors, GetBotsByBotIdCliStreamResponses, GetBotsByBotIdCliWsData, GetBotsByBotIdCliWsErrors, GetBotsByBotIdCompactionLogsData, GetBotsByBotIdCompactionLogsErrors, GetBotsByBotIdCompactionLogsResponses, GetBotsByBotIdContainerData, GetBotsByBotIdContainerErrors, GetBotsByBotIdContainerFsData, GetBotsByBotIdContainerFsDownloadData, GetBotsByBotIdContainerFsDownloadErrors, GetBotsByBotIdContainerFsDownloadResponses, GetBotsByBotIdContainerFsErrors, GetBotsByBotIdContainerFsListData, GetBotsByBotIdContainerFsListErrors, GetBotsByBotIdContainerFsListResponses, GetBotsByBotIdContainerFsReadData, GetBotsByBotIdContainerFsReadErrors, GetBotsByBotIdContainerFsReadResponses, GetBotsByBotIdContainerFsResponses, GetBotsByBotIdContainerResponses, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSkillsErrors, GetBotsByBotIdContainerSkillsResponses, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerSnapshotsErrors, GetBotsByBotIdContainerSnapshotsResponses, GetBotsByBotIdContainerTerminalData, GetBotsByBotIdContainerTerminalErrors, GetBotsByBotIdContainerTerminalResponses, GetBotsByBotIdContainerTerminalWsData, GetBotsByBotIdContainerTerminalWsErrors, GetBotsByBotIdEmailBindingsData, GetBotsByBotIdEmailBindingsErrors, GetBotsByBotIdEmailBindingsResponses, GetBotsByBotIdEmailOutboxByIdData, GetBotsByBotIdEmailOutboxByIdErrors, GetBotsByBotIdEmailOutboxByIdResponses, GetBotsByBotIdEmailOutboxData, GetBotsByBotIdEmailOutboxErrors, GetBotsByBotIdEmailOutboxResponses, GetBotsByBotIdHeartbeatLogsData, GetBotsByBotIdHeartbeatLogsErrors, GetBotsByBotIdHeartbeatLogsResponses, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdErrors, GetBotsByBotIdMcpByIdOauthStatusData, GetBotsByBotIdMcpByIdOauthStatusErrors, GetBotsByBotIdMcpByIdOauthStatusResponses, GetBotsByBotIdMcpByIdResponses, GetBotsByBotIdMcpData, GetBotsByBotIdMcpErrors, GetBotsByBotIdMcpExportData, GetBotsByBotIdMcpExportErrors, GetBotsByBotIdMcpExportResponses, GetBotsByBotIdMcpResponses, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryErrors, GetBotsByBotIdMemoryResponses, GetBotsByBotIdMemoryStatusData, GetBotsByBotIdMemoryStatusErrors, GetBotsByBotIdMemoryStatusResponses, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMemoryUsageErrors, GetBotsByBotIdMemoryUsageResponses, GetBotsByBotIdMessagesData, GetBotsByBotIdMessagesErrors, GetBotsByBotIdMessagesResponses, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdErrors, GetBotsByBotIdScheduleByIdLogsData, GetBotsByBotIdScheduleByIdLogsErrors, GetBotsByBotIdScheduleByIdLogsResponses, GetBotsByBotIdScheduleByIdResponses, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleErrors, GetBotsByBotIdScheduleLogsData, GetBotsByBotIdScheduleLogsErrors, GetBotsByBotIdScheduleLogsResponses, GetBotsByBotIdScheduleResponses, GetBotsByBotIdSessionsBySessionIdData, GetBotsByBotIdSessionsBySessionIdErrors, GetBotsByBotIdSessionsBySessionIdResponses, GetBotsByBotIdSessionsData, GetBotsByBotIdSessionsErrors, GetBotsByBotIdSessionsResponses, GetBotsByBotIdSettingsData, GetBotsByBotIdSettingsErrors, GetBotsByBotIdSettingsResponses, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdContextErrors, GetBotsByBotIdSubagentsByIdContextResponses, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdErrors, GetBotsByBotIdSubagentsByIdResponses, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsByIdSkillsErrors, GetBotsByBotIdSubagentsByIdSkillsResponses, GetBotsByBotIdSubagentsData, GetBotsByBotIdSubagentsErrors, GetBotsByBotIdSubagentsResponses, GetBotsByBotIdTokenUsageData, GetBotsByBotIdTokenUsageErrors, GetBotsByBotIdTokenUsageResponses, GetBotsByBotIdWebStreamData, GetBotsByBotIdWebStreamErrors, GetBotsByBotIdWebStreamResponses, GetBotsByBotIdWebWsData, GetBotsByBotIdWebWsErrors, GetBotsByBotIdWhitelistData, GetBotsByBotIdWhitelistErrors, GetBotsByBotIdWhitelistResponses, GetBotsByIdChannelByPlatformData, GetBotsByIdChannelByPlatformErrors, GetBotsByIdChannelByPlatformResponses, GetBotsByIdChecksData, GetBotsByIdChecksErrors, GetBotsByIdChecksResponses, GetBotsByIdData, GetBotsByIdErrors, GetBotsByIdResponses, GetBotsData, GetBotsErrors, GetBotsResponses, GetBrowserContextsByIdData, GetBrowserContextsByIdErrors, GetBrowserContextsByIdResponses, GetBrowserContextsCoresData, GetBrowserContextsCoresErrors, GetBrowserContextsCoresResponses, GetBrowserContextsData, GetBrowserContextsErrors, GetBrowserContextsResponses, GetChannelsByPlatformData, GetChannelsByPlatformErrors, GetChannelsByPlatformResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetEmailOauthCallbackData, GetEmailOauthCallbackErrors, GetEmailOauthCallbackResponses, GetEmailProvidersByIdData, GetEmailProvidersByIdErrors, GetEmailProvidersByIdOauthAuthorizeData, GetEmailProvidersByIdOauthAuthorizeErrors, GetEmailProvidersByIdOauthAuthorizeResponses, GetEmailProvidersByIdOauthStatusData, GetEmailProvidersByIdOauthStatusErrors, GetEmailProvidersByIdOauthStatusResponses, GetEmailProvidersByIdResponses, GetEmailProvidersData, GetEmailProvidersErrors, GetEmailProvidersMetaData, GetEmailProvidersMetaResponses, GetEmailProvidersResponses, GetMemoryProvidersByIdData, GetMemoryProvidersByIdErrors, GetMemoryProvidersByIdResponses, GetMemoryProvidersByIdStatusData, GetMemoryProvidersByIdStatusErrors, GetMemoryProvidersByIdStatusResponses, GetMemoryProvidersData, GetMemoryProvidersErrors, GetMemoryProvidersMetaData, GetMemoryProvidersMetaResponses, GetMemoryProvidersResponses, GetModelsByIdData, GetModelsByIdErrors, GetModelsByIdResponses, GetModelsCountData, GetModelsCountErrors, GetModelsCountResponses, GetModelsData, GetModelsErrors, GetModelsModelByModelIdData, GetModelsModelByModelIdErrors, GetModelsModelByModelIdResponses, GetModelsResponses, GetPingData, GetPingResponses, GetProvidersByIdData, GetProvidersByIdErrors, GetProvidersByIdModelsData, GetProvidersByIdModelsErrors, GetProvidersByIdModelsResponses, GetProvidersByIdResponses, GetProvidersCountData, GetProvidersCountErrors, GetProvidersCountResponses, GetProvidersData, GetProvidersErrors, GetProvidersNameByNameData, GetProvidersNameByNameErrors, GetProvidersNameByNameResponses, GetProvidersResponses, GetSearchProvidersByIdData, GetSearchProvidersByIdErrors, GetSearchProvidersByIdResponses, GetSearchProvidersData, GetSearchProvidersErrors, GetSearchProvidersMetaData, GetSearchProvidersMetaResponses, GetSearchProvidersResponses, GetTtsModelsByIdCapabilitiesData, GetTtsModelsByIdCapabilitiesErrors, GetTtsModelsByIdCapabilitiesResponses, GetTtsModelsByIdData, GetTtsModelsByIdErrors, GetTtsModelsByIdResponses, GetTtsModelsData, GetTtsModelsErrors, GetTtsModelsResponses, GetTtsProvidersByIdData, GetTtsProvidersByIdErrors, GetTtsProvidersByIdModelsData, GetTtsProvidersByIdModelsErrors, GetTtsProvidersByIdModelsResponses, GetTtsProvidersByIdResponses, GetTtsProvidersData, GetTtsProvidersErrors, GetTtsProvidersMetaData, GetTtsProvidersMetaResponses, GetTtsProvidersResponses, GetUsersByIdData, GetUsersByIdErrors, GetUsersByIdResponses, GetUsersData, GetUsersErrors, GetUsersMeChannelsByPlatformData, GetUsersMeChannelsByPlatformErrors, GetUsersMeChannelsByPlatformResponses, GetUsersMeData, GetUsersMeErrors, GetUsersMeIdentitiesData, GetUsersMeIdentitiesErrors, GetUsersMeIdentitiesResponses, GetUsersMeResponses, GetUsersResponses, PatchBotsByBotIdSessionsBySessionIdData, PatchBotsByBotIdSessionsBySessionIdErrors, PatchBotsByBotIdSessionsBySessionIdResponses, PatchBotsByIdChannelByPlatformStatusData, PatchBotsByIdChannelByPlatformStatusErrors, PatchBotsByIdChannelByPlatformStatusResponses, PostAuthLoginData, PostAuthLoginErrors, PostAuthLoginResponses, PostAuthRefreshData, PostAuthRefreshErrors, PostAuthRefreshResponses, PostBotsByBotIdCliMessagesData, PostBotsByBotIdCliMessagesErrors, PostBotsByBotIdCliMessagesResponses, PostBotsByBotIdContainerData, PostBotsByBotIdContainerDataExportData, PostBotsByBotIdContainerDataExportErrors, PostBotsByBotIdContainerDataExportResponses, PostBotsByBotIdContainerDataImportData, PostBotsByBotIdContainerDataImportErrors, PostBotsByBotIdContainerDataImportResponses, PostBotsByBotIdContainerDataRestoreData, PostBotsByBotIdContainerDataRestoreErrors, PostBotsByBotIdContainerDataRestoreResponses, PostBotsByBotIdContainerErrors, PostBotsByBotIdContainerFsDeleteData, PostBotsByBotIdContainerFsDeleteErrors, PostBotsByBotIdContainerFsDeleteResponses, PostBotsByBotIdContainerFsMkdirData, PostBotsByBotIdContainerFsMkdirErrors, PostBotsByBotIdContainerFsMkdirResponses, PostBotsByBotIdContainerFsRenameData, PostBotsByBotIdContainerFsRenameErrors, PostBotsByBotIdContainerFsRenameResponses, PostBotsByBotIdContainerFsUploadData, PostBotsByBotIdContainerFsUploadErrors, PostBotsByBotIdContainerFsUploadResponses, PostBotsByBotIdContainerFsWriteData, PostBotsByBotIdContainerFsWriteErrors, PostBotsByBotIdContainerFsWriteResponses, PostBotsByBotIdContainerResponses, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsErrors, PostBotsByBotIdContainerSkillsResponses, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsErrors, PostBotsByBotIdContainerSnapshotsResponses, PostBotsByBotIdContainerSnapshotsRollbackData, PostBotsByBotIdContainerSnapshotsRollbackErrors, PostBotsByBotIdContainerSnapshotsRollbackResponses, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartErrors, PostBotsByBotIdContainerStartResponses, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopErrors, PostBotsByBotIdContainerStopResponses, PostBotsByBotIdEmailBindingsData, PostBotsByBotIdEmailBindingsErrors, PostBotsByBotIdEmailBindingsResponses, PostBotsByBotIdMcpByIdOauthAuthorizeData, PostBotsByBotIdMcpByIdOauthAuthorizeErrors, PostBotsByBotIdMcpByIdOauthAuthorizeResponses, PostBotsByBotIdMcpByIdOauthDiscoverData, PostBotsByBotIdMcpByIdOauthDiscoverErrors, PostBotsByBotIdMcpByIdOauthDiscoverResponses, PostBotsByBotIdMcpByIdOauthExchangeData, PostBotsByBotIdMcpByIdOauthExchangeErrors, PostBotsByBotIdMcpByIdOauthExchangeResponses, PostBotsByBotIdMcpByIdProbeData, PostBotsByBotIdMcpByIdProbeErrors, PostBotsByBotIdMcpByIdProbeResponses, PostBotsByBotIdMcpData, PostBotsByBotIdMcpErrors, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteErrors, PostBotsByBotIdMcpOpsBatchDeleteResponses, PostBotsByBotIdMcpResponses, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdErrors, PostBotsByBotIdMcpStdioByConnectionIdResponses, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioErrors, PostBotsByBotIdMcpStdioResponses, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactErrors, PostBotsByBotIdMemoryCompactResponses, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryErrors, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildErrors, PostBotsByBotIdMemoryRebuildResponses, PostBotsByBotIdMemoryResponses, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchErrors, PostBotsByBotIdMemorySearchResponses, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleErrors, PostBotsByBotIdScheduleResponses, PostBotsByBotIdSessionsData, PostBotsByBotIdSessionsErrors, PostBotsByBotIdSessionsResponses, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsErrors, PostBotsByBotIdSettingsResponses, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsErrors, PostBotsByBotIdSubagentsByIdSkillsResponses, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsErrors, PostBotsByBotIdSubagentsResponses, PostBotsByBotIdToolsData, PostBotsByBotIdToolsErrors, PostBotsByBotIdToolsResponses, PostBotsByBotIdTtsSynthesizeData, PostBotsByBotIdTtsSynthesizeErrors, PostBotsByBotIdTtsSynthesizeResponses, PostBotsByBotIdWebMessagesData, PostBotsByBotIdWebMessagesErrors, PostBotsByBotIdWebMessagesResponses, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatErrors, PostBotsByIdChannelByPlatformSendChatResponses, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendErrors, PostBotsByIdChannelByPlatformSendResponses, PostBotsData, PostBotsErrors, PostBotsResponses, PostBrowserContextsData, PostBrowserContextsErrors, PostBrowserContextsResponses, PostEmailMailgunWebhookByConfigIdData, PostEmailMailgunWebhookByConfigIdErrors, PostEmailMailgunWebhookByConfigIdResponses, PostEmailProvidersData, PostEmailProvidersErrors, PostEmailProvidersResponses, PostMemoryProvidersData, PostMemoryProvidersErrors, PostMemoryProvidersResponses, PostModelsByIdTestData, PostModelsByIdTestErrors, PostModelsByIdTestResponses, PostModelsData, PostModelsErrors, PostModelsResponses, PostProvidersByIdImportModelsData, PostProvidersByIdImportModelsErrors, PostProvidersByIdImportModelsResponses, PostProvidersByIdTestData, PostProvidersByIdTestErrors, PostProvidersByIdTestResponses, PostProvidersData, PostProvidersErrors, PostProvidersResponses, PostSearchProvidersData, PostSearchProvidersErrors, PostSearchProvidersResponses, PostTtsModelsByIdTestData, PostTtsModelsByIdTestErrors, PostTtsModelsByIdTestResponses, PostTtsModelsData, PostTtsModelsErrors, PostTtsModelsResponses, PostTtsProvidersByIdImportModelsData, PostTtsProvidersByIdImportModelsErrors, PostTtsProvidersByIdImportModelsResponses, PostTtsProvidersData, PostTtsProvidersErrors, PostTtsProvidersResponses, PostUsersData, PostUsersErrors, PostUsersResponses, PutBotsByBotIdBlacklistData, PutBotsByBotIdBlacklistErrors, PutBotsByBotIdBlacklistResponses, PutBotsByBotIdEmailBindingsByIdData, PutBotsByBotIdEmailBindingsByIdErrors, PutBotsByBotIdEmailBindingsByIdResponses, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdErrors, PutBotsByBotIdMcpByIdResponses, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportErrors, PutBotsByBotIdMcpImportResponses, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdErrors, PutBotsByBotIdScheduleByIdResponses, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsErrors, PutBotsByBotIdSettingsResponses, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextErrors, PutBotsByBotIdSubagentsByIdContextResponses, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdErrors, PutBotsByBotIdSubagentsByIdResponses, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsErrors, PutBotsByBotIdSubagentsByIdSkillsResponses, PutBotsByBotIdWhitelistData, PutBotsByBotIdWhitelistErrors, PutBotsByBotIdWhitelistResponses, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformErrors, PutBotsByIdChannelByPlatformResponses, PutBotsByIdData, PutBotsByIdErrors, PutBotsByIdOwnerData, PutBotsByIdOwnerErrors, PutBotsByIdOwnerResponses, PutBotsByIdResponses, PutBrowserContextsByIdData, PutBrowserContextsByIdErrors, PutBrowserContextsByIdResponses, PutEmailProvidersByIdData, PutEmailProvidersByIdErrors, PutEmailProvidersByIdResponses, PutMemoryProvidersByIdData, PutMemoryProvidersByIdErrors, PutMemoryProvidersByIdResponses, PutModelsByIdData, PutModelsByIdErrors, PutModelsByIdResponses, PutModelsModelByModelIdData, PutModelsModelByModelIdErrors, PutModelsModelByModelIdResponses, PutProvidersByIdData, PutProvidersByIdErrors, PutProvidersByIdResponses, PutSearchProvidersByIdData, PutSearchProvidersByIdErrors, PutSearchProvidersByIdResponses, PutTtsModelsByIdData, PutTtsModelsByIdErrors, PutTtsModelsByIdResponses, PutTtsProvidersByIdData, PutTtsProvidersByIdErrors, PutTtsProvidersByIdResponses, PutUsersByIdData, PutUsersByIdErrors, PutUsersByIdPasswordData, PutUsersByIdPasswordErrors, PutUsersByIdPasswordResponses, PutUsersByIdResponses, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformErrors, PutUsersMeChannelsByPlatformResponses, PutUsersMeData, PutUsersMeErrors, PutUsersMePasswordData, PutUsersMePasswordErrors, PutUsersMePasswordResponses, PutUsersMeResponses } from './types.gen'; +import type { DeleteBotsByBotIdBlacklistByRuleIdData, DeleteBotsByBotIdBlacklistByRuleIdErrors, DeleteBotsByBotIdBlacklistByRuleIdResponses, DeleteBotsByBotIdCompactionLogsData, DeleteBotsByBotIdCompactionLogsErrors, DeleteBotsByBotIdCompactionLogsResponses, DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerErrors, DeleteBotsByBotIdContainerResponses, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsErrors, DeleteBotsByBotIdContainerSkillsResponses, DeleteBotsByBotIdEmailBindingsByIdData, DeleteBotsByBotIdEmailBindingsByIdErrors, DeleteBotsByBotIdEmailBindingsByIdResponses, DeleteBotsByBotIdHeartbeatLogsData, DeleteBotsByBotIdHeartbeatLogsErrors, DeleteBotsByBotIdHeartbeatLogsResponses, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdErrors, DeleteBotsByBotIdMcpByIdOauthTokenData, DeleteBotsByBotIdMcpByIdOauthTokenErrors, DeleteBotsByBotIdMcpByIdOauthTokenResponses, DeleteBotsByBotIdMcpByIdResponses, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdErrors, DeleteBotsByBotIdMemoryByIdResponses, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryErrors, DeleteBotsByBotIdMemoryResponses, DeleteBotsByBotIdMessagesData, DeleteBotsByBotIdMessagesErrors, DeleteBotsByBotIdMessagesResponses, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdErrors, DeleteBotsByBotIdScheduleByIdResponses, DeleteBotsByBotIdScheduleLogsData, DeleteBotsByBotIdScheduleLogsErrors, DeleteBotsByBotIdScheduleLogsResponses, DeleteBotsByBotIdSessionsBySessionIdData, DeleteBotsByBotIdSessionsBySessionIdErrors, DeleteBotsByBotIdSessionsBySessionIdResponses, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsErrors, DeleteBotsByBotIdSettingsResponses, DeleteBotsByBotIdWhitelistByRuleIdData, DeleteBotsByBotIdWhitelistByRuleIdErrors, DeleteBotsByBotIdWhitelistByRuleIdResponses, DeleteBotsByIdChannelByPlatformData, DeleteBotsByIdChannelByPlatformErrors, DeleteBotsByIdChannelByPlatformResponses, DeleteBotsByIdData, DeleteBotsByIdErrors, DeleteBotsByIdResponses, DeleteBrowserContextsByIdData, DeleteBrowserContextsByIdErrors, DeleteBrowserContextsByIdResponses, DeleteEmailProvidersByIdData, DeleteEmailProvidersByIdErrors, DeleteEmailProvidersByIdOauthTokenData, DeleteEmailProvidersByIdOauthTokenErrors, DeleteEmailProvidersByIdOauthTokenResponses, DeleteEmailProvidersByIdResponses, DeleteMemoryProvidersByIdData, DeleteMemoryProvidersByIdErrors, DeleteMemoryProvidersByIdResponses, DeleteModelsByIdData, DeleteModelsByIdErrors, DeleteModelsByIdResponses, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdErrors, DeleteModelsModelByModelIdResponses, DeleteProvidersByIdData, DeleteProvidersByIdErrors, DeleteProvidersByIdResponses, DeleteSearchProvidersByIdData, DeleteSearchProvidersByIdErrors, DeleteSearchProvidersByIdResponses, DeleteTtsModelsByIdData, DeleteTtsModelsByIdErrors, DeleteTtsModelsByIdResponses, DeleteTtsProvidersByIdData, DeleteTtsProvidersByIdErrors, DeleteTtsProvidersByIdResponses, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsData, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsErrors, GetBotsByBotIdAccessChannelIdentitiesByChannelIdentityIdConversationsResponses, GetBotsByBotIdAccessChannelIdentitiesData, GetBotsByBotIdAccessChannelIdentitiesErrors, GetBotsByBotIdAccessChannelIdentitiesResponses, GetBotsByBotIdAccessUsersData, GetBotsByBotIdAccessUsersErrors, GetBotsByBotIdAccessUsersResponses, GetBotsByBotIdBlacklistData, GetBotsByBotIdBlacklistErrors, GetBotsByBotIdBlacklistResponses, GetBotsByBotIdCliStreamData, GetBotsByBotIdCliStreamErrors, GetBotsByBotIdCliStreamResponses, GetBotsByBotIdCliWsData, GetBotsByBotIdCliWsErrors, GetBotsByBotIdCompactionLogsData, GetBotsByBotIdCompactionLogsErrors, GetBotsByBotIdCompactionLogsResponses, GetBotsByBotIdContainerData, GetBotsByBotIdContainerErrors, GetBotsByBotIdContainerFsData, GetBotsByBotIdContainerFsDownloadData, GetBotsByBotIdContainerFsDownloadErrors, GetBotsByBotIdContainerFsDownloadResponses, GetBotsByBotIdContainerFsErrors, GetBotsByBotIdContainerFsListData, GetBotsByBotIdContainerFsListErrors, GetBotsByBotIdContainerFsListResponses, GetBotsByBotIdContainerFsReadData, GetBotsByBotIdContainerFsReadErrors, GetBotsByBotIdContainerFsReadResponses, GetBotsByBotIdContainerFsResponses, GetBotsByBotIdContainerResponses, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSkillsErrors, GetBotsByBotIdContainerSkillsResponses, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerSnapshotsErrors, GetBotsByBotIdContainerSnapshotsResponses, GetBotsByBotIdContainerTerminalData, GetBotsByBotIdContainerTerminalErrors, GetBotsByBotIdContainerTerminalResponses, GetBotsByBotIdContainerTerminalWsData, GetBotsByBotIdContainerTerminalWsErrors, GetBotsByBotIdEmailBindingsData, GetBotsByBotIdEmailBindingsErrors, GetBotsByBotIdEmailBindingsResponses, GetBotsByBotIdEmailOutboxByIdData, GetBotsByBotIdEmailOutboxByIdErrors, GetBotsByBotIdEmailOutboxByIdResponses, GetBotsByBotIdEmailOutboxData, GetBotsByBotIdEmailOutboxErrors, GetBotsByBotIdEmailOutboxResponses, GetBotsByBotIdHeartbeatLogsData, GetBotsByBotIdHeartbeatLogsErrors, GetBotsByBotIdHeartbeatLogsResponses, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdErrors, GetBotsByBotIdMcpByIdOauthStatusData, GetBotsByBotIdMcpByIdOauthStatusErrors, GetBotsByBotIdMcpByIdOauthStatusResponses, GetBotsByBotIdMcpByIdResponses, GetBotsByBotIdMcpData, GetBotsByBotIdMcpErrors, GetBotsByBotIdMcpExportData, GetBotsByBotIdMcpExportErrors, GetBotsByBotIdMcpExportResponses, GetBotsByBotIdMcpResponses, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryErrors, GetBotsByBotIdMemoryResponses, GetBotsByBotIdMemoryStatusData, GetBotsByBotIdMemoryStatusErrors, GetBotsByBotIdMemoryStatusResponses, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMemoryUsageErrors, GetBotsByBotIdMemoryUsageResponses, GetBotsByBotIdMessagesData, GetBotsByBotIdMessagesErrors, GetBotsByBotIdMessagesResponses, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdErrors, GetBotsByBotIdScheduleByIdLogsData, GetBotsByBotIdScheduleByIdLogsErrors, GetBotsByBotIdScheduleByIdLogsResponses, GetBotsByBotIdScheduleByIdResponses, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleErrors, GetBotsByBotIdScheduleLogsData, GetBotsByBotIdScheduleLogsErrors, GetBotsByBotIdScheduleLogsResponses, GetBotsByBotIdScheduleResponses, GetBotsByBotIdSessionsBySessionIdData, GetBotsByBotIdSessionsBySessionIdErrors, GetBotsByBotIdSessionsBySessionIdResponses, GetBotsByBotIdSessionsData, GetBotsByBotIdSessionsErrors, GetBotsByBotIdSessionsResponses, GetBotsByBotIdSettingsData, GetBotsByBotIdSettingsErrors, GetBotsByBotIdSettingsResponses, GetBotsByBotIdTokenUsageData, GetBotsByBotIdTokenUsageErrors, GetBotsByBotIdTokenUsageResponses, GetBotsByBotIdWebStreamData, GetBotsByBotIdWebStreamErrors, GetBotsByBotIdWebStreamResponses, GetBotsByBotIdWebWsData, GetBotsByBotIdWebWsErrors, GetBotsByBotIdWhitelistData, GetBotsByBotIdWhitelistErrors, GetBotsByBotIdWhitelistResponses, GetBotsByIdChannelByPlatformData, GetBotsByIdChannelByPlatformErrors, GetBotsByIdChannelByPlatformResponses, GetBotsByIdChecksData, GetBotsByIdChecksErrors, GetBotsByIdChecksResponses, GetBotsByIdData, GetBotsByIdErrors, GetBotsByIdResponses, GetBotsData, GetBotsErrors, GetBotsResponses, GetBrowserContextsByIdData, GetBrowserContextsByIdErrors, GetBrowserContextsByIdResponses, GetBrowserContextsCoresData, GetBrowserContextsCoresErrors, GetBrowserContextsCoresResponses, GetBrowserContextsData, GetBrowserContextsErrors, GetBrowserContextsResponses, GetChannelsByPlatformData, GetChannelsByPlatformErrors, GetChannelsByPlatformResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetEmailOauthCallbackData, GetEmailOauthCallbackErrors, GetEmailOauthCallbackResponses, GetEmailProvidersByIdData, GetEmailProvidersByIdErrors, GetEmailProvidersByIdOauthAuthorizeData, GetEmailProvidersByIdOauthAuthorizeErrors, GetEmailProvidersByIdOauthAuthorizeResponses, GetEmailProvidersByIdOauthStatusData, GetEmailProvidersByIdOauthStatusErrors, GetEmailProvidersByIdOauthStatusResponses, GetEmailProvidersByIdResponses, GetEmailProvidersData, GetEmailProvidersErrors, GetEmailProvidersMetaData, GetEmailProvidersMetaResponses, GetEmailProvidersResponses, GetMemoryProvidersByIdData, GetMemoryProvidersByIdErrors, GetMemoryProvidersByIdResponses, GetMemoryProvidersByIdStatusData, GetMemoryProvidersByIdStatusErrors, GetMemoryProvidersByIdStatusResponses, GetMemoryProvidersData, GetMemoryProvidersErrors, GetMemoryProvidersMetaData, GetMemoryProvidersMetaResponses, GetMemoryProvidersResponses, GetModelsByIdData, GetModelsByIdErrors, GetModelsByIdResponses, GetModelsCountData, GetModelsCountErrors, GetModelsCountResponses, GetModelsData, GetModelsErrors, GetModelsModelByModelIdData, GetModelsModelByModelIdErrors, GetModelsModelByModelIdResponses, GetModelsResponses, GetPingData, GetPingResponses, GetProvidersByIdData, GetProvidersByIdErrors, GetProvidersByIdModelsData, GetProvidersByIdModelsErrors, GetProvidersByIdModelsResponses, GetProvidersByIdResponses, GetProvidersCountData, GetProvidersCountErrors, GetProvidersCountResponses, GetProvidersData, GetProvidersErrors, GetProvidersNameByNameData, GetProvidersNameByNameErrors, GetProvidersNameByNameResponses, GetProvidersResponses, GetSearchProvidersByIdData, GetSearchProvidersByIdErrors, GetSearchProvidersByIdResponses, GetSearchProvidersData, GetSearchProvidersErrors, GetSearchProvidersMetaData, GetSearchProvidersMetaResponses, GetSearchProvidersResponses, GetTtsModelsByIdCapabilitiesData, GetTtsModelsByIdCapabilitiesErrors, GetTtsModelsByIdCapabilitiesResponses, GetTtsModelsByIdData, GetTtsModelsByIdErrors, GetTtsModelsByIdResponses, GetTtsModelsData, GetTtsModelsErrors, GetTtsModelsResponses, GetTtsProvidersByIdData, GetTtsProvidersByIdErrors, GetTtsProvidersByIdModelsData, GetTtsProvidersByIdModelsErrors, GetTtsProvidersByIdModelsResponses, GetTtsProvidersByIdResponses, GetTtsProvidersData, GetTtsProvidersErrors, GetTtsProvidersMetaData, GetTtsProvidersMetaResponses, GetTtsProvidersResponses, GetUsersByIdData, GetUsersByIdErrors, GetUsersByIdResponses, GetUsersData, GetUsersErrors, GetUsersMeChannelsByPlatformData, GetUsersMeChannelsByPlatformErrors, GetUsersMeChannelsByPlatformResponses, GetUsersMeData, GetUsersMeErrors, GetUsersMeIdentitiesData, GetUsersMeIdentitiesErrors, GetUsersMeIdentitiesResponses, GetUsersMeResponses, GetUsersResponses, PatchBotsByBotIdSessionsBySessionIdData, PatchBotsByBotIdSessionsBySessionIdErrors, PatchBotsByBotIdSessionsBySessionIdResponses, PatchBotsByIdChannelByPlatformStatusData, PatchBotsByIdChannelByPlatformStatusErrors, PatchBotsByIdChannelByPlatformStatusResponses, PostAuthLoginData, PostAuthLoginErrors, PostAuthLoginResponses, PostAuthRefreshData, PostAuthRefreshErrors, PostAuthRefreshResponses, PostBotsByBotIdCliMessagesData, PostBotsByBotIdCliMessagesErrors, PostBotsByBotIdCliMessagesResponses, PostBotsByBotIdContainerData, PostBotsByBotIdContainerDataExportData, PostBotsByBotIdContainerDataExportErrors, PostBotsByBotIdContainerDataExportResponses, PostBotsByBotIdContainerDataImportData, PostBotsByBotIdContainerDataImportErrors, PostBotsByBotIdContainerDataImportResponses, PostBotsByBotIdContainerDataRestoreData, PostBotsByBotIdContainerDataRestoreErrors, PostBotsByBotIdContainerDataRestoreResponses, PostBotsByBotIdContainerErrors, PostBotsByBotIdContainerFsDeleteData, PostBotsByBotIdContainerFsDeleteErrors, PostBotsByBotIdContainerFsDeleteResponses, PostBotsByBotIdContainerFsMkdirData, PostBotsByBotIdContainerFsMkdirErrors, PostBotsByBotIdContainerFsMkdirResponses, PostBotsByBotIdContainerFsRenameData, PostBotsByBotIdContainerFsRenameErrors, PostBotsByBotIdContainerFsRenameResponses, PostBotsByBotIdContainerFsUploadData, PostBotsByBotIdContainerFsUploadErrors, PostBotsByBotIdContainerFsUploadResponses, PostBotsByBotIdContainerFsWriteData, PostBotsByBotIdContainerFsWriteErrors, PostBotsByBotIdContainerFsWriteResponses, PostBotsByBotIdContainerResponses, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsErrors, PostBotsByBotIdContainerSkillsResponses, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsErrors, PostBotsByBotIdContainerSnapshotsResponses, PostBotsByBotIdContainerSnapshotsRollbackData, PostBotsByBotIdContainerSnapshotsRollbackErrors, PostBotsByBotIdContainerSnapshotsRollbackResponses, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartErrors, PostBotsByBotIdContainerStartResponses, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopErrors, PostBotsByBotIdContainerStopResponses, PostBotsByBotIdEmailBindingsData, PostBotsByBotIdEmailBindingsErrors, PostBotsByBotIdEmailBindingsResponses, PostBotsByBotIdMcpByIdOauthAuthorizeData, PostBotsByBotIdMcpByIdOauthAuthorizeErrors, PostBotsByBotIdMcpByIdOauthAuthorizeResponses, PostBotsByBotIdMcpByIdOauthDiscoverData, PostBotsByBotIdMcpByIdOauthDiscoverErrors, PostBotsByBotIdMcpByIdOauthDiscoverResponses, PostBotsByBotIdMcpByIdOauthExchangeData, PostBotsByBotIdMcpByIdOauthExchangeErrors, PostBotsByBotIdMcpByIdOauthExchangeResponses, PostBotsByBotIdMcpByIdProbeData, PostBotsByBotIdMcpByIdProbeErrors, PostBotsByBotIdMcpByIdProbeResponses, PostBotsByBotIdMcpData, PostBotsByBotIdMcpErrors, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteErrors, PostBotsByBotIdMcpOpsBatchDeleteResponses, PostBotsByBotIdMcpResponses, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdErrors, PostBotsByBotIdMcpStdioByConnectionIdResponses, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioErrors, PostBotsByBotIdMcpStdioResponses, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactErrors, PostBotsByBotIdMemoryCompactResponses, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryErrors, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildErrors, PostBotsByBotIdMemoryRebuildResponses, PostBotsByBotIdMemoryResponses, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchErrors, PostBotsByBotIdMemorySearchResponses, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleErrors, PostBotsByBotIdScheduleResponses, PostBotsByBotIdSessionsData, PostBotsByBotIdSessionsErrors, PostBotsByBotIdSessionsResponses, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsErrors, PostBotsByBotIdSettingsResponses, PostBotsByBotIdToolsData, PostBotsByBotIdToolsErrors, PostBotsByBotIdToolsResponses, PostBotsByBotIdTtsSynthesizeData, PostBotsByBotIdTtsSynthesizeErrors, PostBotsByBotIdTtsSynthesizeResponses, PostBotsByBotIdWebMessagesData, PostBotsByBotIdWebMessagesErrors, PostBotsByBotIdWebMessagesResponses, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatErrors, PostBotsByIdChannelByPlatformSendChatResponses, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendErrors, PostBotsByIdChannelByPlatformSendResponses, PostBotsData, PostBotsErrors, PostBotsResponses, PostBrowserContextsData, PostBrowserContextsErrors, PostBrowserContextsResponses, PostEmailMailgunWebhookByConfigIdData, PostEmailMailgunWebhookByConfigIdErrors, PostEmailMailgunWebhookByConfigIdResponses, PostEmailProvidersData, PostEmailProvidersErrors, PostEmailProvidersResponses, PostMemoryProvidersData, PostMemoryProvidersErrors, PostMemoryProvidersResponses, PostModelsByIdTestData, PostModelsByIdTestErrors, PostModelsByIdTestResponses, PostModelsData, PostModelsErrors, PostModelsResponses, PostProvidersByIdImportModelsData, PostProvidersByIdImportModelsErrors, PostProvidersByIdImportModelsResponses, PostProvidersByIdTestData, PostProvidersByIdTestErrors, PostProvidersByIdTestResponses, PostProvidersData, PostProvidersErrors, PostProvidersResponses, PostSearchProvidersData, PostSearchProvidersErrors, PostSearchProvidersResponses, PostTtsModelsByIdTestData, PostTtsModelsByIdTestErrors, PostTtsModelsByIdTestResponses, PostTtsModelsData, PostTtsModelsErrors, PostTtsModelsResponses, PostTtsProvidersByIdImportModelsData, PostTtsProvidersByIdImportModelsErrors, PostTtsProvidersByIdImportModelsResponses, PostTtsProvidersData, PostTtsProvidersErrors, PostTtsProvidersResponses, PostUsersData, PostUsersErrors, PostUsersResponses, PutBotsByBotIdBlacklistData, PutBotsByBotIdBlacklistErrors, PutBotsByBotIdBlacklistResponses, PutBotsByBotIdEmailBindingsByIdData, PutBotsByBotIdEmailBindingsByIdErrors, PutBotsByBotIdEmailBindingsByIdResponses, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdErrors, PutBotsByBotIdMcpByIdResponses, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportErrors, PutBotsByBotIdMcpImportResponses, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdErrors, PutBotsByBotIdScheduleByIdResponses, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsErrors, PutBotsByBotIdSettingsResponses, PutBotsByBotIdWhitelistData, PutBotsByBotIdWhitelistErrors, PutBotsByBotIdWhitelistResponses, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformErrors, PutBotsByIdChannelByPlatformResponses, PutBotsByIdData, PutBotsByIdErrors, PutBotsByIdOwnerData, PutBotsByIdOwnerErrors, PutBotsByIdOwnerResponses, PutBotsByIdResponses, PutBrowserContextsByIdData, PutBrowserContextsByIdErrors, PutBrowserContextsByIdResponses, PutEmailProvidersByIdData, PutEmailProvidersByIdErrors, PutEmailProvidersByIdResponses, PutMemoryProvidersByIdData, PutMemoryProvidersByIdErrors, PutMemoryProvidersByIdResponses, PutModelsByIdData, PutModelsByIdErrors, PutModelsByIdResponses, PutModelsModelByModelIdData, PutModelsModelByModelIdErrors, PutModelsModelByModelIdResponses, PutProvidersByIdData, PutProvidersByIdErrors, PutProvidersByIdResponses, PutSearchProvidersByIdData, PutSearchProvidersByIdErrors, PutSearchProvidersByIdResponses, PutTtsModelsByIdData, PutTtsModelsByIdErrors, PutTtsModelsByIdResponses, PutTtsProvidersByIdData, PutTtsProvidersByIdErrors, PutTtsProvidersByIdResponses, PutUsersByIdData, PutUsersByIdErrors, PutUsersByIdPasswordData, PutUsersByIdPasswordErrors, PutUsersByIdPasswordResponses, PutUsersByIdResponses, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformErrors, PutUsersMeChannelsByPlatformResponses, PutUsersMeData, PutUsersMeErrors, PutUsersMePasswordData, PutUsersMePasswordErrors, PutUsersMePasswordResponses, PutUsersMeResponses } from './types.gen'; export type Options = Options2 & { /** @@ -869,111 +869,6 @@ export const putBotsByBotIdSettings = (opt } }); -/** - * List subagents - * - * List subagents for current user - */ -export const getBotsByBotIdSubagents = (options?: Options) => (options?.client ?? client).get({ url: '/bots/{bot_id}/subagents', ...options }); - -/** - * Create subagent - * - * Create a subagent for current user - */ -export const postBotsByBotIdSubagents = (options: Options) => (options.client ?? client).post({ - url: '/bots/{bot_id}/subagents', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } -}); - -/** - * Delete subagent - * - * Delete a subagent by ID - */ -export const deleteBotsByBotIdSubagentsById = (options: Options) => (options.client ?? client).delete({ url: '/bots/{bot_id}/subagents/{id}', ...options }); - -/** - * Get subagent - * - * Get a subagent by ID - */ -export const getBotsByBotIdSubagentsById = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/subagents/{id}', ...options }); - -/** - * Update subagent - * - * Update a subagent by ID - */ -export const putBotsByBotIdSubagentsById = (options: Options) => (options.client ?? client).put({ - url: '/bots/{bot_id}/subagents/{id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } -}); - -/** - * Get subagent context - * - * Get a subagent's message context - */ -export const getBotsByBotIdSubagentsByIdContext = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/subagents/{id}/context', ...options }); - -/** - * Update subagent context - * - * Update a subagent's message context - */ -export const putBotsByBotIdSubagentsByIdContext = (options: Options) => (options.client ?? client).put({ - url: '/bots/{bot_id}/subagents/{id}/context', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } -}); - -/** - * Get subagent skills - * - * Get a subagent's skills - */ -export const getBotsByBotIdSubagentsByIdSkills = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/subagents/{id}/skills', ...options }); - -/** - * Add subagent skills - * - * Add skills to a subagent - */ -export const postBotsByBotIdSubagentsByIdSkills = (options: Options) => (options.client ?? client).post({ - url: '/bots/{bot_id}/subagents/{id}/skills', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } -}); - -/** - * Update subagent skills - * - * Replace a subagent's skills - */ -export const putBotsByBotIdSubagentsByIdSkills = (options: Options) => (options.client ?? client).put({ - url: '/bots/{bot_id}/subagents/{id}/skills', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } -}); - /** * Get token usage statistics * diff --git a/packages/sdk/src/types.gen.ts b/packages/sdk/src/types.gen.ts index 8208073c..d63ee4e7 100644 --- a/packages/sdk/src/types.gen.ts +++ b/packages/sdk/src/types.gen.ts @@ -1392,6 +1392,7 @@ export type SessionSession = { metadata?: { [key: string]: unknown; }; + parent_session_id?: string; route_conversation_type?: string; route_id?: string; route_metadata?: { @@ -1444,81 +1445,6 @@ export type SettingsUpsertRequest = { tts_model_id?: string; }; -export type SubagentAddSkillsRequest = { - skills?: Array; -}; - -export type SubagentContextResponse = { - messages?: Array<{ - [key: string]: unknown; - }>; - usage?: { - [key: string]: unknown; - }; -}; - -export type SubagentCreateRequest = { - description?: string; - messages?: Array<{ - [key: string]: unknown; - }>; - metadata?: { - [key: string]: unknown; - }; - name?: string; - skills?: Array; -}; - -export type SubagentListResponse = { - items?: Array; -}; - -export type SubagentSkillsResponse = { - skills?: Array; -}; - -export type SubagentSubagent = { - bot_id?: string; - created_at?: string; - deleted?: boolean; - deleted_at?: string; - description?: string; - id?: string; - messages?: Array<{ - [key: string]: unknown; - }>; - metadata?: { - [key: string]: unknown; - }; - name?: string; - skills?: Array; - updated_at?: string; - usage?: { - [key: string]: unknown; - }; -}; - -export type SubagentUpdateContextRequest = { - messages?: Array<{ - [key: string]: unknown; - }>; - usage?: { - [key: string]: unknown; - }; -}; - -export type SubagentUpdateRequest = { - description?: string; - metadata?: { - [key: string]: unknown; - }; - name?: string; -}; - -export type SubagentUpdateSkillsRequest = { - skills?: Array; -}; - export type TtsCreateModelRequest = { config?: { [key: string]: unknown; @@ -5164,381 +5090,6 @@ export type PutBotsByBotIdSettingsResponses = { export type PutBotsByBotIdSettingsResponse = PutBotsByBotIdSettingsResponses[keyof PutBotsByBotIdSettingsResponses]; -export type GetBotsByBotIdSubagentsData = { - body?: never; - path?: never; - query?: never; - url: '/bots/{bot_id}/subagents'; -}; - -export type GetBotsByBotIdSubagentsErrors = { - /** - * Bad Request - */ - 400: HandlersErrorResponse; - /** - * Internal Server Error - */ - 500: HandlersErrorResponse; -}; - -export type GetBotsByBotIdSubagentsError = GetBotsByBotIdSubagentsErrors[keyof GetBotsByBotIdSubagentsErrors]; - -export type GetBotsByBotIdSubagentsResponses = { - /** - * OK - */ - 200: SubagentListResponse; -}; - -export type GetBotsByBotIdSubagentsResponse = GetBotsByBotIdSubagentsResponses[keyof GetBotsByBotIdSubagentsResponses]; - -export type PostBotsByBotIdSubagentsData = { - /** - * Subagent payload - */ - body: SubagentCreateRequest; - path?: never; - query?: never; - url: '/bots/{bot_id}/subagents'; -}; - -export type PostBotsByBotIdSubagentsErrors = { - /** - * Bad Request - */ - 400: HandlersErrorResponse; - /** - * Internal Server Error - */ - 500: HandlersErrorResponse; -}; - -export type PostBotsByBotIdSubagentsError = PostBotsByBotIdSubagentsErrors[keyof PostBotsByBotIdSubagentsErrors]; - -export type PostBotsByBotIdSubagentsResponses = { - /** - * Created - */ - 201: SubagentSubagent; -}; - -export type PostBotsByBotIdSubagentsResponse = PostBotsByBotIdSubagentsResponses[keyof PostBotsByBotIdSubagentsResponses]; - -export type DeleteBotsByBotIdSubagentsByIdData = { - body?: never; - path: { - /** - * Subagent ID - */ - id: string; - }; - query?: never; - url: '/bots/{bot_id}/subagents/{id}'; -}; - -export type DeleteBotsByBotIdSubagentsByIdErrors = { - /** - * Bad Request - */ - 400: HandlersErrorResponse; - /** - * Not Found - */ - 404: HandlersErrorResponse; - /** - * Internal Server Error - */ - 500: HandlersErrorResponse; -}; - -export type DeleteBotsByBotIdSubagentsByIdError = DeleteBotsByBotIdSubagentsByIdErrors[keyof DeleteBotsByBotIdSubagentsByIdErrors]; - -export type DeleteBotsByBotIdSubagentsByIdResponses = { - /** - * No Content - */ - 204: unknown; -}; - -export type GetBotsByBotIdSubagentsByIdData = { - body?: never; - path: { - /** - * Subagent ID - */ - id: string; - }; - query?: never; - url: '/bots/{bot_id}/subagents/{id}'; -}; - -export type GetBotsByBotIdSubagentsByIdErrors = { - /** - * Bad Request - */ - 400: HandlersErrorResponse; - /** - * Not Found - */ - 404: HandlersErrorResponse; - /** - * Internal Server Error - */ - 500: HandlersErrorResponse; -}; - -export type GetBotsByBotIdSubagentsByIdError = GetBotsByBotIdSubagentsByIdErrors[keyof GetBotsByBotIdSubagentsByIdErrors]; - -export type GetBotsByBotIdSubagentsByIdResponses = { - /** - * OK - */ - 200: SubagentSubagent; -}; - -export type GetBotsByBotIdSubagentsByIdResponse = GetBotsByBotIdSubagentsByIdResponses[keyof GetBotsByBotIdSubagentsByIdResponses]; - -export type PutBotsByBotIdSubagentsByIdData = { - /** - * Subagent payload - */ - body: SubagentUpdateRequest; - path: { - /** - * Subagent ID - */ - id: string; - }; - query?: never; - url: '/bots/{bot_id}/subagents/{id}'; -}; - -export type PutBotsByBotIdSubagentsByIdErrors = { - /** - * Bad Request - */ - 400: HandlersErrorResponse; - /** - * Not Found - */ - 404: HandlersErrorResponse; - /** - * Internal Server Error - */ - 500: HandlersErrorResponse; -}; - -export type PutBotsByBotIdSubagentsByIdError = PutBotsByBotIdSubagentsByIdErrors[keyof PutBotsByBotIdSubagentsByIdErrors]; - -export type PutBotsByBotIdSubagentsByIdResponses = { - /** - * OK - */ - 200: SubagentSubagent; -}; - -export type PutBotsByBotIdSubagentsByIdResponse = PutBotsByBotIdSubagentsByIdResponses[keyof PutBotsByBotIdSubagentsByIdResponses]; - -export type GetBotsByBotIdSubagentsByIdContextData = { - body?: never; - path: { - /** - * Subagent ID - */ - id: string; - }; - query?: never; - url: '/bots/{bot_id}/subagents/{id}/context'; -}; - -export type GetBotsByBotIdSubagentsByIdContextErrors = { - /** - * Bad Request - */ - 400: HandlersErrorResponse; - /** - * Not Found - */ - 404: HandlersErrorResponse; - /** - * Internal Server Error - */ - 500: HandlersErrorResponse; -}; - -export type GetBotsByBotIdSubagentsByIdContextError = GetBotsByBotIdSubagentsByIdContextErrors[keyof GetBotsByBotIdSubagentsByIdContextErrors]; - -export type GetBotsByBotIdSubagentsByIdContextResponses = { - /** - * OK - */ - 200: SubagentContextResponse; -}; - -export type GetBotsByBotIdSubagentsByIdContextResponse = GetBotsByBotIdSubagentsByIdContextResponses[keyof GetBotsByBotIdSubagentsByIdContextResponses]; - -export type PutBotsByBotIdSubagentsByIdContextData = { - /** - * Context payload - */ - body: SubagentUpdateContextRequest; - path: { - /** - * Subagent ID - */ - id: string; - }; - query?: never; - url: '/bots/{bot_id}/subagents/{id}/context'; -}; - -export type PutBotsByBotIdSubagentsByIdContextErrors = { - /** - * Bad Request - */ - 400: HandlersErrorResponse; - /** - * Not Found - */ - 404: HandlersErrorResponse; - /** - * Internal Server Error - */ - 500: HandlersErrorResponse; -}; - -export type PutBotsByBotIdSubagentsByIdContextError = PutBotsByBotIdSubagentsByIdContextErrors[keyof PutBotsByBotIdSubagentsByIdContextErrors]; - -export type PutBotsByBotIdSubagentsByIdContextResponses = { - /** - * OK - */ - 200: SubagentContextResponse; -}; - -export type PutBotsByBotIdSubagentsByIdContextResponse = PutBotsByBotIdSubagentsByIdContextResponses[keyof PutBotsByBotIdSubagentsByIdContextResponses]; - -export type GetBotsByBotIdSubagentsByIdSkillsData = { - body?: never; - path: { - /** - * Subagent ID - */ - id: string; - }; - query?: never; - url: '/bots/{bot_id}/subagents/{id}/skills'; -}; - -export type GetBotsByBotIdSubagentsByIdSkillsErrors = { - /** - * Bad Request - */ - 400: HandlersErrorResponse; - /** - * Not Found - */ - 404: HandlersErrorResponse; - /** - * Internal Server Error - */ - 500: HandlersErrorResponse; -}; - -export type GetBotsByBotIdSubagentsByIdSkillsError = GetBotsByBotIdSubagentsByIdSkillsErrors[keyof GetBotsByBotIdSubagentsByIdSkillsErrors]; - -export type GetBotsByBotIdSubagentsByIdSkillsResponses = { - /** - * OK - */ - 200: SubagentSkillsResponse; -}; - -export type GetBotsByBotIdSubagentsByIdSkillsResponse = GetBotsByBotIdSubagentsByIdSkillsResponses[keyof GetBotsByBotIdSubagentsByIdSkillsResponses]; - -export type PostBotsByBotIdSubagentsByIdSkillsData = { - /** - * Skills payload - */ - body: SubagentAddSkillsRequest; - path: { - /** - * Subagent ID - */ - id: string; - }; - query?: never; - url: '/bots/{bot_id}/subagents/{id}/skills'; -}; - -export type PostBotsByBotIdSubagentsByIdSkillsErrors = { - /** - * Bad Request - */ - 400: HandlersErrorResponse; - /** - * Not Found - */ - 404: HandlersErrorResponse; - /** - * Internal Server Error - */ - 500: HandlersErrorResponse; -}; - -export type PostBotsByBotIdSubagentsByIdSkillsError = PostBotsByBotIdSubagentsByIdSkillsErrors[keyof PostBotsByBotIdSubagentsByIdSkillsErrors]; - -export type PostBotsByBotIdSubagentsByIdSkillsResponses = { - /** - * OK - */ - 200: SubagentSkillsResponse; -}; - -export type PostBotsByBotIdSubagentsByIdSkillsResponse = PostBotsByBotIdSubagentsByIdSkillsResponses[keyof PostBotsByBotIdSubagentsByIdSkillsResponses]; - -export type PutBotsByBotIdSubagentsByIdSkillsData = { - /** - * Skills payload - */ - body: SubagentUpdateSkillsRequest; - path: { - /** - * Subagent ID - */ - id: string; - }; - query?: never; - url: '/bots/{bot_id}/subagents/{id}/skills'; -}; - -export type PutBotsByBotIdSubagentsByIdSkillsErrors = { - /** - * Bad Request - */ - 400: HandlersErrorResponse; - /** - * Not Found - */ - 404: HandlersErrorResponse; - /** - * Internal Server Error - */ - 500: HandlersErrorResponse; -}; - -export type PutBotsByBotIdSubagentsByIdSkillsError = PutBotsByBotIdSubagentsByIdSkillsErrors[keyof PutBotsByBotIdSubagentsByIdSkillsErrors]; - -export type PutBotsByBotIdSubagentsByIdSkillsResponses = { - /** - * OK - */ - 200: SubagentSkillsResponse; -}; - -export type PutBotsByBotIdSubagentsByIdSkillsResponse = PutBotsByBotIdSubagentsByIdSkillsResponses[keyof PutBotsByBotIdSubagentsByIdSkillsResponses]; - export type GetBotsByBotIdTokenUsageData = { body?: never; path: { diff --git a/spec/docs.go b/spec/docs.go index 5a0e5139..1dd6a179 100644 --- a/spec/docs.go +++ b/spec/docs.go @@ -4325,448 +4325,6 @@ const docTemplate = `{ } } }, - "/bots/{bot_id}/subagents": { - "get": { - "description": "List subagents for current user", - "tags": [ - "subagent" - ], - "summary": "List subagents", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.ListResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "post": { - "description": "Create a subagent for current user", - "tags": [ - "subagent" - ], - "summary": "Create subagent", - "parameters": [ - { - "description": "Subagent payload", - "name": "payload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/subagent.CreateRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/subagent.Subagent" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - } - }, - "/bots/{bot_id}/subagents/{id}": { - "get": { - "description": "Get a subagent by ID", - "tags": [ - "subagent" - ], - "summary": "Get subagent", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.Subagent" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "put": { - "description": "Update a subagent by ID", - "tags": [ - "subagent" - ], - "summary": "Update subagent", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Subagent payload", - "name": "payload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/subagent.UpdateRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.Subagent" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "delete": { - "description": "Delete a subagent by ID", - "tags": [ - "subagent" - ], - "summary": "Delete subagent", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - } - }, - "/bots/{bot_id}/subagents/{id}/context": { - "get": { - "description": "Get a subagent's message context", - "tags": [ - "subagent" - ], - "summary": "Get subagent context", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.ContextResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "put": { - "description": "Update a subagent's message context", - "tags": [ - "subagent" - ], - "summary": "Update subagent context", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Context payload", - "name": "payload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/subagent.UpdateContextRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.ContextResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - } - }, - "/bots/{bot_id}/subagents/{id}/skills": { - "get": { - "description": "Get a subagent's skills", - "tags": [ - "subagent" - ], - "summary": "Get subagent skills", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.SkillsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "put": { - "description": "Replace a subagent's skills", - "tags": [ - "subagent" - ], - "summary": "Update subagent skills", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Skills payload", - "name": "payload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/subagent.UpdateSkillsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.SkillsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "post": { - "description": "Add skills to a subagent", - "tags": [ - "subagent" - ], - "summary": "Add subagent skills", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Skills payload", - "name": "payload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/subagent.AddSkillsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.SkillsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - } - }, "/bots/{bot_id}/token-usage": { "get": { "description": "Get daily aggregated token usage for a bot, split by chat, heartbeat, and schedule session types, with optional model filter and per-model breakdown", @@ -12491,6 +12049,9 @@ const docTemplate = `{ "type": "object", "additionalProperties": {} }, + "parent_session_id": { + "type": "string" + }, "route_conversation_type": { "type": "string" }, @@ -12630,175 +12191,6 @@ const docTemplate = `{ } } }, - "subagent.AddSkillsRequest": { - "type": "object", - "properties": { - "skills": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "subagent.ContextResponse": { - "type": "object", - "properties": { - "messages": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "usage": { - "type": "object", - "additionalProperties": {} - } - } - }, - "subagent.CreateRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "messages": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "metadata": { - "type": "object", - "additionalProperties": {} - }, - "name": { - "type": "string" - }, - "skills": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "subagent.ListResponse": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/subagent.Subagent" - } - } - } - }, - "subagent.SkillsResponse": { - "type": "object", - "properties": { - "skills": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "subagent.Subagent": { - "type": "object", - "properties": { - "bot_id": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "deleted": { - "type": "boolean" - }, - "deleted_at": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "messages": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "metadata": { - "type": "object", - "additionalProperties": {} - }, - "name": { - "type": "string" - }, - "skills": { - "type": "array", - "items": { - "type": "string" - } - }, - "updated_at": { - "type": "string" - }, - "usage": { - "type": "object", - "additionalProperties": {} - } - } - }, - "subagent.UpdateContextRequest": { - "type": "object", - "properties": { - "messages": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "usage": { - "type": "object", - "additionalProperties": {} - } - } - }, - "subagent.UpdateRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "metadata": { - "type": "object", - "additionalProperties": {} - }, - "name": { - "type": "string" - } - } - }, - "subagent.UpdateSkillsRequest": { - "type": "object", - "properties": { - "skills": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, "tts.CreateModelRequest": { "type": "object", "properties": { diff --git a/spec/swagger.json b/spec/swagger.json index 99637e7c..ce7fe1bc 100644 --- a/spec/swagger.json +++ b/spec/swagger.json @@ -4316,448 +4316,6 @@ } } }, - "/bots/{bot_id}/subagents": { - "get": { - "description": "List subagents for current user", - "tags": [ - "subagent" - ], - "summary": "List subagents", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.ListResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "post": { - "description": "Create a subagent for current user", - "tags": [ - "subagent" - ], - "summary": "Create subagent", - "parameters": [ - { - "description": "Subagent payload", - "name": "payload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/subagent.CreateRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/subagent.Subagent" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - } - }, - "/bots/{bot_id}/subagents/{id}": { - "get": { - "description": "Get a subagent by ID", - "tags": [ - "subagent" - ], - "summary": "Get subagent", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.Subagent" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "put": { - "description": "Update a subagent by ID", - "tags": [ - "subagent" - ], - "summary": "Update subagent", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Subagent payload", - "name": "payload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/subagent.UpdateRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.Subagent" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "delete": { - "description": "Delete a subagent by ID", - "tags": [ - "subagent" - ], - "summary": "Delete subagent", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - } - }, - "/bots/{bot_id}/subagents/{id}/context": { - "get": { - "description": "Get a subagent's message context", - "tags": [ - "subagent" - ], - "summary": "Get subagent context", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.ContextResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "put": { - "description": "Update a subagent's message context", - "tags": [ - "subagent" - ], - "summary": "Update subagent context", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Context payload", - "name": "payload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/subagent.UpdateContextRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.ContextResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - } - }, - "/bots/{bot_id}/subagents/{id}/skills": { - "get": { - "description": "Get a subagent's skills", - "tags": [ - "subagent" - ], - "summary": "Get subagent skills", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.SkillsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "put": { - "description": "Replace a subagent's skills", - "tags": [ - "subagent" - ], - "summary": "Update subagent skills", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Skills payload", - "name": "payload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/subagent.UpdateSkillsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.SkillsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - }, - "post": { - "description": "Add skills to a subagent", - "tags": [ - "subagent" - ], - "summary": "Add subagent skills", - "parameters": [ - { - "type": "string", - "description": "Subagent ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Skills payload", - "name": "payload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/subagent.AddSkillsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/subagent.SkillsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.ErrorResponse" - } - } - } - } - }, "/bots/{bot_id}/token-usage": { "get": { "description": "Get daily aggregated token usage for a bot, split by chat, heartbeat, and schedule session types, with optional model filter and per-model breakdown", @@ -12482,6 +12040,9 @@ "type": "object", "additionalProperties": {} }, + "parent_session_id": { + "type": "string" + }, "route_conversation_type": { "type": "string" }, @@ -12621,175 +12182,6 @@ } } }, - "subagent.AddSkillsRequest": { - "type": "object", - "properties": { - "skills": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "subagent.ContextResponse": { - "type": "object", - "properties": { - "messages": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "usage": { - "type": "object", - "additionalProperties": {} - } - } - }, - "subagent.CreateRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "messages": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "metadata": { - "type": "object", - "additionalProperties": {} - }, - "name": { - "type": "string" - }, - "skills": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "subagent.ListResponse": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/subagent.Subagent" - } - } - } - }, - "subagent.SkillsResponse": { - "type": "object", - "properties": { - "skills": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "subagent.Subagent": { - "type": "object", - "properties": { - "bot_id": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "deleted": { - "type": "boolean" - }, - "deleted_at": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "messages": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "metadata": { - "type": "object", - "additionalProperties": {} - }, - "name": { - "type": "string" - }, - "skills": { - "type": "array", - "items": { - "type": "string" - } - }, - "updated_at": { - "type": "string" - }, - "usage": { - "type": "object", - "additionalProperties": {} - } - } - }, - "subagent.UpdateContextRequest": { - "type": "object", - "properties": { - "messages": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "usage": { - "type": "object", - "additionalProperties": {} - } - } - }, - "subagent.UpdateRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "metadata": { - "type": "object", - "additionalProperties": {} - }, - "name": { - "type": "string" - } - } - }, - "subagent.UpdateSkillsRequest": { - "type": "object", - "properties": { - "skills": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, "tts.CreateModelRequest": { "type": "object", "properties": { diff --git a/spec/swagger.yaml b/spec/swagger.yaml index a702e008..89c9fe60 100644 --- a/spec/swagger.yaml +++ b/spec/swagger.yaml @@ -2301,6 +2301,8 @@ definitions: metadata: additionalProperties: {} type: object + parent_session_id: + type: string route_conversation_type: type: string route_id: @@ -2393,119 +2395,6 @@ definitions: tts_model_id: type: string type: object - subagent.AddSkillsRequest: - properties: - skills: - items: - type: string - type: array - type: object - subagent.ContextResponse: - properties: - messages: - items: - additionalProperties: {} - type: object - type: array - usage: - additionalProperties: {} - type: object - type: object - subagent.CreateRequest: - properties: - description: - type: string - messages: - items: - additionalProperties: {} - type: object - type: array - metadata: - additionalProperties: {} - type: object - name: - type: string - skills: - items: - type: string - type: array - type: object - subagent.ListResponse: - properties: - items: - items: - $ref: '#/definitions/subagent.Subagent' - type: array - type: object - subagent.SkillsResponse: - properties: - skills: - items: - type: string - type: array - type: object - subagent.Subagent: - properties: - bot_id: - type: string - created_at: - type: string - deleted: - type: boolean - deleted_at: - type: string - description: - type: string - id: - type: string - messages: - items: - additionalProperties: {} - type: object - type: array - metadata: - additionalProperties: {} - type: object - name: - type: string - skills: - items: - type: string - type: array - updated_at: - type: string - usage: - additionalProperties: {} - type: object - type: object - subagent.UpdateContextRequest: - properties: - messages: - items: - additionalProperties: {} - type: object - type: array - usage: - additionalProperties: {} - type: object - type: object - subagent.UpdateRequest: - properties: - description: - type: string - metadata: - additionalProperties: {} - type: object - name: - type: string - type: object - subagent.UpdateSkillsRequest: - properties: - skills: - items: - type: string - type: array - type: object tts.CreateModelRequest: properties: config: @@ -5516,299 +5405,6 @@ paths: summary: Update user settings tags: - settings - /bots/{bot_id}/subagents: - get: - description: List subagents for current user - responses: - "200": - description: OK - schema: - $ref: '#/definitions/subagent.ListResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.ErrorResponse' - summary: List subagents - tags: - - subagent - post: - description: Create a subagent for current user - parameters: - - description: Subagent payload - in: body - name: payload - required: true - schema: - $ref: '#/definitions/subagent.CreateRequest' - responses: - "201": - description: Created - schema: - $ref: '#/definitions/subagent.Subagent' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.ErrorResponse' - summary: Create subagent - tags: - - subagent - /bots/{bot_id}/subagents/{id}: - delete: - description: Delete a subagent by ID - parameters: - - description: Subagent ID - in: path - name: id - required: true - type: string - responses: - "204": - description: No Content - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.ErrorResponse' - summary: Delete subagent - tags: - - subagent - get: - description: Get a subagent by ID - parameters: - - description: Subagent ID - in: path - name: id - required: true - type: string - responses: - "200": - description: OK - schema: - $ref: '#/definitions/subagent.Subagent' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.ErrorResponse' - summary: Get subagent - tags: - - subagent - put: - description: Update a subagent by ID - parameters: - - description: Subagent ID - in: path - name: id - required: true - type: string - - description: Subagent payload - in: body - name: payload - required: true - schema: - $ref: '#/definitions/subagent.UpdateRequest' - responses: - "200": - description: OK - schema: - $ref: '#/definitions/subagent.Subagent' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.ErrorResponse' - summary: Update subagent - tags: - - subagent - /bots/{bot_id}/subagents/{id}/context: - get: - description: Get a subagent's message context - parameters: - - description: Subagent ID - in: path - name: id - required: true - type: string - responses: - "200": - description: OK - schema: - $ref: '#/definitions/subagent.ContextResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.ErrorResponse' - summary: Get subagent context - tags: - - subagent - put: - description: Update a subagent's message context - parameters: - - description: Subagent ID - in: path - name: id - required: true - type: string - - description: Context payload - in: body - name: payload - required: true - schema: - $ref: '#/definitions/subagent.UpdateContextRequest' - responses: - "200": - description: OK - schema: - $ref: '#/definitions/subagent.ContextResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.ErrorResponse' - summary: Update subagent context - tags: - - subagent - /bots/{bot_id}/subagents/{id}/skills: - get: - description: Get a subagent's skills - parameters: - - description: Subagent ID - in: path - name: id - required: true - type: string - responses: - "200": - description: OK - schema: - $ref: '#/definitions/subagent.SkillsResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.ErrorResponse' - summary: Get subagent skills - tags: - - subagent - post: - description: Add skills to a subagent - parameters: - - description: Subagent ID - in: path - name: id - required: true - type: string - - description: Skills payload - in: body - name: payload - required: true - schema: - $ref: '#/definitions/subagent.AddSkillsRequest' - responses: - "200": - description: OK - schema: - $ref: '#/definitions/subagent.SkillsResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.ErrorResponse' - summary: Add subagent skills - tags: - - subagent - put: - description: Replace a subagent's skills - parameters: - - description: Subagent ID - in: path - name: id - required: true - type: string - - description: Skills payload - in: body - name: payload - required: true - schema: - $ref: '#/definitions/subagent.UpdateSkillsRequest' - responses: - "200": - description: OK - schema: - $ref: '#/definitions/subagent.SkillsResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.ErrorResponse' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.ErrorResponse' - summary: Update subagent skills - tags: - - subagent /bots/{bot_id}/token-usage: get: description: Get daily aggregated token usage for a bot, split by chat, heartbeat,
- {{ $t('bots.history.empty') }} -
- {{ $t('bots.subagents.subtitle') }} -
- {{ $t('bots.subagents.emptyDescription') }} -
- {{ $t('bots.subagents.contextEmpty') }} -
{{ subagentResult }}
{{ result.text }}
+ {{ result.error }} +