/**
 * Message Mapper
 *
 * Maps SDK message types to the existing SpawnedSessionEvent format
 * for backward compatibility with the orchestrator's event handling.
 *
 * SDK Message Type Mappings:
 * | SDK Message Type      | Current Event Type |
 * |-----------------------|-------------------|
 * | SDKAssistantMessage   | assistant         |
 * | SDKUserMessage        | user              |
 * | tool_use content      | tool_use          |
 * | tool_result content   | tool_result       |
 * | SDKSystemMessage      | system            |
 * | SDKResultMessage      | result            |
 *
 * @module
 */
import type { Timestamp } from '@stoneforge/core';
import type { SpawnedSessionEvent } from './spawner.js';
/**
 * Base SDK message interface
 */
export interface SDKMessage {
    type: string;
    [key: string]: unknown;
}
/**
 * SDK assistant message
 */
export interface SDKAssistantMessage extends SDKMessage {
    type: 'assistant';
    content: string | SDKContentBlock[];
}
/**
 * SDK user message
 */
export interface SDKUserMessage extends SDKMessage {
    type: 'user';
    content: string;
}
/**
 * SDK system message
 */
export interface SDKSystemMessage extends SDKMessage {
    type: 'system';
    subtype?: string;
    session_id?: string;
    message?: string;
}
/**
 * SDK result message (completion)
 */
export interface SDKResultMessage extends SDKMessage {
    type: 'result';
    result?: string;
    status?: string;
}
/**
 * SDK error message
 */
export interface SDKErrorMessage extends SDKMessage {
    type: 'error';
    error: string;
    message?: string;
}
/**
 * SDK content block (for structured content like tool use)
 */
export interface SDKContentBlock {
    type: 'text' | 'tool_use' | 'tool_result';
    text?: string;
    id?: string;
    name?: string;
    input?: unknown;
    tool_use_id?: string;
    content?: string;
    is_error?: boolean;
}
export type AnySDKMessage = SDKAssistantMessage | SDKUserMessage | SDKSystemMessage | SDKResultMessage | SDKErrorMessage;
/**
 * Maps an SDK message to a SpawnedSessionEvent.
 *
 * @param sdkMessage - The SDK message to map
 * @returns The mapped SpawnedSessionEvent
 */
export declare function mapSDKMessageToEvent(sdkMessage: AnySDKMessage): SpawnedSessionEvent;
/**
 * Maps a tool_result content block to SpawnedSessionEvent.
 */
export declare function mapToolResultToEvent(toolUseId: string, content: string, isError?: boolean, receivedAt?: Timestamp): SpawnedSessionEvent;
/**
 * Maps an array of SDK messages to SpawnedSessionEvents.
 *
 * @param messages - Array of SDK messages
 * @returns Array of mapped events
 */
export declare function mapSDKMessagesToEvents(messages: AnySDKMessage[]): SpawnedSessionEvent[];
//# sourceMappingURL=message-mapper.d.ts.map