/**
 * Session bridge for mapping between ContractSpec and Claude Agent SDK sessions.
 *
 * Handles session state synchronization, message history conversion,
 * and context preservation across the two systems.
 */
import type { AgentCallOptions, AgentSessionState } from '../../types';
/**
 * Claude Agent SDK content block (text or tool use).
 */
export interface ClaudeAgentContentBlock {
    type: 'text' | 'tool_use' | 'tool_result';
    text?: string;
    id?: string;
    name?: string;
    input?: unknown;
    tool_use_id?: string;
    content?: string | ClaudeAgentContentBlock[];
    is_error?: boolean;
}
/**
 * Claude Agent SDK message format.
 */
export interface ClaudeAgentMessage {
    role: 'user' | 'assistant';
    content: string | ClaudeAgentContentBlock[];
}
/**
 * Claude Agent SDK session state.
 */
export interface ClaudeAgentSession {
    sessionId?: string;
    messages: ClaudeAgentMessage[];
    metadata?: Record<string, unknown>;
}
/**
 * Claude Agent SDK session state (alias).
 */
export type ClaudeAgentSessionState = ClaudeAgentSession;
/**
 * Convert ContractSpec session to Claude Agent SDK session.
 */
export declare function toClaudeAgentSession(state: AgentSessionState): ClaudeAgentSession;
/**
 * Create a new Claude Agent session from call options.
 */
export declare function createClaudeAgentSession(options?: AgentCallOptions): ClaudeAgentSession;
/**
 * Create an empty Claude Agent session.
 */
export declare function createEmptyClaudeSession(): ClaudeAgentSession;
/**
 * Build Claude Agent context metadata from call options.
 */
export declare function buildClaudeAgentContext(options?: AgentCallOptions): Record<string, unknown>;
/**
 * Append a user message to the session.
 */
export declare function appendUserMessage(session: ClaudeAgentSession, content: string): ClaudeAgentSession;
/**
 * Append an assistant message to the session.
 */
export declare function appendAssistantMessage(session: ClaudeAgentSession, content: string | ClaudeAgentContentBlock[]): ClaudeAgentSession;
/**
 * Clear the session history.
 */
export declare function clearSession(session: ClaudeAgentSession): ClaudeAgentSession;
/**
 * Get the last N messages from the session.
 */
export declare function getRecentMessages(session: ClaudeAgentSession, count: number): ClaudeAgentMessage[];
/**
 * Extract tool calls from a message content.
 */
export declare function extractToolUseBlocks(content: string | ClaudeAgentContentBlock[]): ClaudeAgentContentBlock[];
/**
 * Create a tool result block.
 */
export declare function createToolResultBlock(toolUseId: string, result: unknown, isError?: boolean): ClaudeAgentContentBlock;
/**
 * Update session metadata.
 */
export declare function updateSessionMetadata(session: ClaudeAgentSession, metadata: Record<string, unknown>): ClaudeAgentSession;
/**
 * Get session message count.
 */
export declare function getMessageCount(session: ClaudeAgentSession): number;
/**
 * Get the total token estimate for the session.
 * This is a rough estimate based on character count.
 */
export declare function estimateTokens(session: ClaudeAgentSession): number;
/**
 * Summarize the session for logging.
 */
export declare function summarizeSession(session: ClaudeAgentSession): {
    messageCount: number;
    userMessages: number;
    assistantMessages: number;
    estimatedTokens: number;
};
