/**
 * Session info + history page shapes returned by transports.
 */

import type { ChatAttachment } from './attachment';
import type { ChatMessage } from './message';

export interface CreateSessionOptions {
  metadata?: Record<string, unknown>;
}

export interface SessionInfo {
  sessionId: string;
  /** If the server resumed an existing session, it may return prior messages. */
  messages?: ChatMessage[];
  hasMore?: boolean;
  cursor?: string | null;
  resumed?: boolean;
  /**
   * Optional human-readable title (typically derived from the first
   * user message). Hosts that render a session-list sidebar can read
   * this directly instead of crawling messages. Plan64.
   */
  title?: string;
}

export interface HistoryPage {
  messages: ChatMessage[];
  hasMore: boolean;
  nextCursor: string | null;
}

export interface StreamOptions {
  signal: AbortSignal;
  attachments?: ChatAttachment[];
  metadata?: Record<string, unknown>;
}

export interface SendOptions {
  signal?: AbortSignal;
  attachments?: ChatAttachment[];
  metadata?: Record<string, unknown>;
}
