import type { SessionUpdate, SpawnMode } from "../../agent-spawn/dist/index.js"; import { type AgentRunOptions } from "./agent.js"; import { type PluginConfigEntry } from "./plugins/resolve-plugins.js"; import type { AgentPlugin } from "./runtime/plugin-types.js"; import type { SessionEntry } from "./runtime/session/entry-types.js"; import type { ChatMessage } from "./runtime/types.js"; export interface AgentSession { readonly id: string; sendMessage(prompt: string, options?: AgentSessionSendMessageOptions): Promise; getHistory(): ChatMessage[]; tree(): SessionEntry[]; fork(fromEntryId: string): Promise; navigateTo(entryId: string): Promise; dispose(): Promise; } export interface AgentSessionSendMessageOptions { signal?: AbortSignal; onSessionUpdate?: SessionUpdateCallback; } export type SessionUpdateCallback = (update: SessionUpdate) => void; export interface McpStdioServerDefinition { transport: "stdio"; command: string; args?: string[]; env?: Record; } export interface McpHttpServerDefinition { transport: "http"; url: string; headers?: Record; } export type McpServerDefinition = McpStdioServerDefinition | McpHttpServerDefinition; export interface CreateAgentSessionOptions { model?: string; apiKey?: string; cwd?: string; allowedPaths?: string[]; plugins?: AgentPlugin[]; pluginsConfig?: PluginConfigEntry[]; mcpServers?: Record; baseUrl?: string; fetch?: AgentRunOptions["fetch"]; maxToolCallIterations?: number; mode?: SpawnMode; resume?: { messages: ChatMessage[]; }; env?: Record; persist?: { directory: string; }; } export declare function createAgentSession(options?: CreateAgentSessionOptions): Promise;