/**
 * Transport interface — what every chat backend adapter implements.
 *
 * Default web implementation lives in `core/transport/http.ts`.
 * Pydantic-AI adapter lives in `core/transport/pydantic-ai-transport.ts`.
 */

import type { ChatMessage } from './message';
import type { ChatStreamEvent } from './events';
import type {
  CreateSessionOptions,
  HistoryPage,
  SendOptions,
  SessionInfo,
  StreamOptions,
} from './session';

export interface ChatTransport {
  createSession(opts?: CreateSessionOptions): Promise<SessionInfo>;
  loadHistory(sessionId: string, cursor?: string | null, limit?: number): Promise<HistoryPage>;
  stream(
    sessionId: string,
    content: string,
    options: StreamOptions,
  ): AsyncGenerator<ChatStreamEvent, void, void>;
  send(sessionId: string, content: string, options?: SendOptions): Promise<ChatMessage>;
  closeSession(sessionId: string): Promise<void>;
}
