/** * Agent Manager types. * * Defines the data model for the Agent Manager multi-session UI. * Supports multi-SDK sessions (Claude, Codex, OpenCode, Gemini) * in both SDK and CLI modes. */ export type AgentSdkType = 'claude' | 'codex' | 'opencode' | 'gemini' | 'cursor' | 'openrouter' | 'minimax' | 'ollama' | 'openai-compat' | 'goose' | 'amp' | 'copilot' | 'crush' | 'pi' | 'aider' | 'plandex'; export type ProviderMode = 'sdk' | 'cli'; /** * Autonomy level for CLI-mode sessions (provider-agnostic). Ignored in SDK * mode (chat-only). 'acceptEdits' is the default. */ export type PermissionMode = 'plan' | 'acceptEdits' | 'fullAuto'; export interface AgentManagerMessage { id: string; role: 'user' | 'assistant' | 'system'; content: string; timestamp: string; tokens?: { input: number; output: number; }; model?: string; sdk?: AgentSdkType; attachments?: FileAttachment[]; metadata?: Record; } export interface FileAttachment { id: string; name: string; size: number; mimeType: string; url: string; uploadedAt: string; } /** * A context item attached to a chat session and passed to the agent as part of * `contexts[]` on send. Sourced from a backend AiContext, an inserted AiPrompt, * or a Files-module file the agent materialised onto the server (`path`). */ export interface ChatContextItem { /** Local id (for list keys / removal). */ id: string; kind: 'prompt' | 'context' | 'file'; label: string; /** Inline text content (rendered prompt / context body / small text file). */ content?: string | null; /** Absolute server path when the agent materialised a file for this context. */ path?: string | null; /** Backing backend entity id (AiPrompt / AiContext) when applicable. */ sourceId?: string | null; } export interface SessionFilters { status: string[]; model: string[]; sdk: AgentSdkType[]; dateRange: { from: string | null; to: string | null; }; searchQuery: string; } export interface McpServer { id: string; name: string; url: string; status: 'connected' | 'disconnected' | 'error'; tools: string[]; } export type AdminTab = 'templates' | 'contexts' | 'prompts' | 'tasks' | 'stats' | 'playground' | 'aiKeys' | 'bridle' | 'config'; export interface AgentManagerTab { sessionId: string; name: string; pinned: boolean; order: number; } export interface AgentManagerSessionState { messages: AgentManagerMessage[]; model: string; sdk: AgentSdkType; mode: ProviderMode; permissionMode: PermissionMode; mcpServers: string[]; voiceEnabled: boolean; showThinking: boolean; contextHistoryLimit: number; status: 'idle' | 'streaming' | 'processing' | 'error'; rootPath: string | null; contextLevel: 'agent' | 'vibe'; vibeId: string | null; /** Context items attached to this session; sent to the agent on each prompt. */ contexts: ChatContextItem[]; } export type SidebarGroupBy = 'date' | 'model' | 'status' | 'sdk' | 'none'; export type DetailPanelTab = 'info' | 'config' | 'logs' | 'mcp';