import { AgentManagerMessage, FileAttachment, McpServer, PermissionMode, ProviderMode } from '../types/agentManager'; /** * Identifier for an agent + its profile name. Every aiApi function takes * one of these so the canonical path `/api/profiles//` can * be constructed at every callsite. Callers should pass * `{ id: agent.id, profile: agent.metadata?.profile ?? 'default' }`. */ export interface AgentRef { id: string; profile: string; } /** * Build the canonical agent-API path for a given profile + path segment. * The svc-side proxy validates that paths are exactly of the form * `/api/profiles//` (or one of the bare carve-outs), so every * callsite builds the path explicitly via this helper instead of the * proxy doing any rewriting. * * Example: `agentApiPath('default', '/ai/sessions')` → * `/api/profiles/default/ai/sessions`. */ export declare function agentApiPath(profile: string, segment: string): string; export declare function agentAiGet(agentId: string, path: string, query?: Record): Promise; export declare function agentAiMutate(agentId: string, path: string, method: string, body?: unknown): Promise; export declare function getAgentConfigValue(agent: AgentRef, key: string): Promise; export declare function setAgentConfigValue(agent: AgentRef, key: string, value: string): Promise; export declare function deleteAgentConfigValue(agent: AgentRef, key: string): Promise; export interface AITemplate { id: string; name: string; content: string; description?: string | null; category?: string | null; variables: Record; tags: string[]; isShared?: boolean; usageCount?: number; metadata?: Record; createdAt?: string; updatedAt?: string; } export interface AIContext { id: string; name: string; type: string; content: string; tags: string[]; metadata?: Record; createdAt?: string; updatedAt?: string; } export interface AISession { id: string; name: string; agentType: string; providerPlugin?: string; status: 'active' | 'idle' | 'processing' | 'error' | 'terminated'; stats?: Record; config?: Record; createdAt?: string; updatedAt?: string; terminatedAt?: string | null; } export interface AISessionLog { id: string; sessionId: string; type: 'input' | 'output' | 'thinking' | 'event' | 'error' | 'metadata'; content: string; message: string; tokenCount?: number; model?: string; durationMs?: number; agentMetadata?: Record; timestamp: string; createdAt: string; } export interface AISessionStats { session: { id: string; name: string; agentType: string; status: string; createdAt: string; }; stats: { totalLogs: number; totalInputTokens: number; totalOutputTokens: number; totalDurationMs: number; logsByType: Record; }; totalTokens: number; inputTokens: number; outputTokens: number; promptCount: number; averageLatency?: number; } export interface AIDispatch { id: string; templateId?: string | null; content: string; prompt: string; resolvedVariables?: Record; contextIds?: string[]; sessionId?: string | null; status: string; result?: Record | null; scheduledAt?: string | null; createdAt?: string; updatedAt?: string; } export interface AIQueueItem { id: string; dispatchedPromptId: string; sessionId: string; priority: number; status: 'pending' | 'processing' | 'completed' | 'failed' | 'cancelled'; attempts: number; maxAttempts: number; lastError?: string | null; createdAt?: string; } export interface AIStatsOverview { totalSessions: number; activeSessions: number; totalInputTokens: number; totalOutputTokens: number; totalTokens: number; inputTokens: number; outputTokens: number; totalRequests: number; sessionsByAgentType: Record; queuedPrompts: number; } export interface AIUsageStats { usage: Record; byProvider: Array<{ provider: string; tokens: number; sessions: number; cost?: number; inputTokens: number; outputTokens: number; requestCount: number; }>; byStatus: Array<{ status: string; count: number; }>; } export interface AIProvider { pluginName: string; name?: string; displayName?: string; isDefault: boolean; currentMode?: ProviderMode; defaultMode?: ProviderMode; supportedModes?: ProviderMode[]; unsupportedModes?: ProviderMode[]; modes?: Record; prereqApiPrefix?: string; } export interface AIApiParameter { name: string; type: string; required: boolean; description: string; } export interface AIApiEndpoint { id: string; method: string; path: string; description: string; parameters?: AIApiParameter[]; body?: AIApiParameter[]; } export interface AITool { name: string; displayName: string; description: string; installed: boolean; version?: string; configFiles?: string[]; foundConfigs?: string[]; installCommand?: string; } export interface PaginatedResponse { items: T[]; total: number; hasMore: boolean; } export declare function fetchTools(agent: AgentRef): Promise; type AITemplateInput = { name: string; content: string; description?: string | null; category?: string | null; status?: string | null; variables?: Record | string[] | null; tags?: string[]; isShared?: boolean; metadata?: Record; }; type AITemplateUpdateInput = Partial; export declare function fetchTemplates(_agentId: string, params?: Record): Promise; export declare function createTemplate(_agentId: string, input: AITemplateInput): Promise; export declare function recordTemplateUsage(_agentId: string, id: string): Promise; export declare function updateTemplate(_agentId: string, id: string, input: AITemplateUpdateInput): Promise; export declare function deleteTemplate(_agentId: string, id: string): Promise; export declare function renderTemplate(_agentId: string, id: string, variables: Record): Promise<{ rendered: string; }>; export declare function fetchContexts(agent: AgentRef, params?: Record): Promise; export declare function createContext(agent: AgentRef, input: { name: string; type: string; content: string; tags?: string[]; metadata?: Record; }): Promise; export declare function updateContext(agent: AgentRef, id: string, input: Partial<{ name: string; type: string; content: string; tags: string[]; metadata: Record; }>): Promise; export declare function deleteContext(agent: AgentRef, id: string): Promise; export declare function fetchSessions(agent: AgentRef, params?: Record): Promise; export declare function fetchSessionsPaginated(agent: AgentRef, params?: { limit?: number; offset?: number; search?: string; agentType?: string; status?: string; vibeId?: string; agentId?: string; contextLevel?: 'agent' | 'vibe'; }): Promise>; export declare function createSession(agent: AgentRef, input: { name: string; agentType: string; config?: Record; vibeId?: string | null; agentId?: string | null; contextLevel?: 'agent' | 'vibe'; workspaceId?: string | null; createdByUserId?: string | null; }): Promise; /** * Materialise a Files-module file onto the agent's machine for use as context. * The agent fetches the signed `downloadUrl` server-side and writes it under * the session working dir, returning the absolute path (+ inline text for small * text files) which the caller attaches to the session contexts. */ export declare function fetchFileIntoContext(agent: AgentRef, input: { downloadUrl: string; filename: string; sessionId?: string; workingDirectory?: string; }): Promise<{ path: string; bytes: number; contentType?: string; inline?: string | null; }>; /** * Push an instruction file (AGENTS.md / CLAUDE.md / GEMINI.md / custom) into the * agent's working folder so the LLM CLI picks it up. Called on session open for * each instruction file linked to the active agent/vibe context. */ export declare function pushInstructionFileToAgent(agent: AgentRef, input: { filename: string; content: string; sessionId?: string; workingDirectory?: string; }): Promise<{ path: string; bytes: number; }>; export declare function sendPromptToSession(agent: AgentRef, sessionId: string, prompt: string, contexts?: unknown[], options?: { agentType?: string; model?: string; mode?: string; permissionMode?: PermissionMode; conversationHistory?: Array<{ role: string; content: string; }>; }): Promise<{ response: string; tokens?: { input: number; output: number; }; [key: string]: unknown; }>; export declare function fetchSessionLogs(agent: AgentRef, sessionId: string, params?: Record): Promise; export declare function fetchSessionStats(agent: AgentRef, sessionId: string): Promise; export declare function updateSessionConfig(agent: AgentRef, sessionId: string, config: Record): Promise; export declare function terminateSession(agent: AgentRef, sessionId: string): Promise; export declare function composePrompt(agent: AgentRef, input: { templateId?: string; variables?: Record; content?: string; contextIds?: string[]; sessionId?: string; }): Promise<{ dispatch: AIDispatch; preview: string; }>; export declare function sendDispatch(agent: AgentRef, input: { dispatchId?: string; prompt?: string; content?: string; sessionId?: string; contextIds?: string[]; scheduledAt?: string; }): Promise<{ status: string; dispatchId: string; sessionId: string; }>; export declare function fetchDispatchHistory(agent: AgentRef, params?: Record): Promise; export declare function fetchQueueItems(agent: AgentRef, params?: Record): Promise; export declare function enqueueItem(agent: AgentRef, input: { dispatchedPromptId: string; sessionId: string; priority?: number; scheduledAt?: string; maxAttempts?: number; }): Promise; export declare function cancelQueueItem(agent: AgentRef, id: string): Promise; export declare function fetchStatsOverview(agent: AgentRef): Promise; export declare function fetchUsageStats(agent: AgentRef): Promise; export declare function fetchProviders(agent: AgentRef): Promise; export declare function fetchApiDescriptor(agent: AgentRef): Promise; export interface AIModelInfo { id: string; name: string; provider: string; contextWindow?: number; maxOutputTokens?: number; } export interface SearchResult { sessionId: string; sessionName: string; messageId?: string; content: string; timestamp: string; score?: number; } export declare function renameSession(agent: AgentRef, sessionId: string, name: string): Promise; export declare function bulkDeleteSessions(agent: AgentRef, ids: string[]): Promise; export declare function fetchSessionMessages(agent: AgentRef, sessionId: string): Promise; export declare function searchSessions(agent: AgentRef, query: string, params?: Record): Promise; export declare function fetchMcpServers(agent: AgentRef): Promise; export declare function switchSessionModel(agent: AgentRef, sessionId: string, model: string): Promise; export declare function switchSessionSdk(agent: AgentRef, sessionId: string, sdk: string): Promise; export declare function switchSessionMode(agent: AgentRef, sessionId: string, mode: string): Promise; export declare function cancelSessionRequest(agent: AgentRef, sessionId: string): Promise; export declare function fetchModels(agent: AgentRef, provider?: string): Promise; export declare function exportSession(agent: AgentRef, sessionId: string, format: 'json' | 'markdown'): Promise; export declare function uploadSessionFile(agent: AgentRef, sessionId: string, file: File): Promise; export {};