/**
 * Core types for the Axiom Lattice Client SDK
 */
import { Message, MessageChunk } from "@axiom-lattice/protocols";
/**
 * Transport method for client-server communication
 * Note: Currently only "ws" is used for tool registration
 */
export type Transport = "sse" | "ws";
/**
 * Configuration options for the Client
 */
export interface ClientConfig {
    /**
     * Base URL for the API
     */
    baseURL: string;
    /**
     * API key for authentication
     */
    apiKey: string;
    /**
     * Assistant identifier
     */
    assistantId: string;
    /**
     * Transport method (Server-Sent Events or WebSocket)
     */
    transport: Transport;
    /**
     * Request timeout in milliseconds (optional, defaults to 30000)
     */
    timeout?: number;
    /**
     * Additional headers to include in requests (optional)
     */
    headers?: Record<string, string>;
    /**
     * Configuration for retry behavior (optional)
     */
    retry?: RetryConfig;
}
/**
 * Configuration for retry behavior
 */
export interface RetryConfig {
    /**
     * Maximum number of retry attempts
     */
    maxRetries: number;
    /**
     * Initial delay between retries in milliseconds
     */
    initialDelayMs: number;
    /**
     * Maximum delay between retries in milliseconds
     */
    maxDelayMs: number;
    /**
     * Factor to multiply delay by after each retry attempt
     */
    backoffFactor: number;
}
/**
 * Thread creation options
 */
export interface CreateThreadOptions {
    /**
     * Optional metadata for the thread
     */
    metadata?: Record<string, any>;
}
/**
 * Thread information
 */
export interface Thread {
    /**
     * Thread identifier
     */
    id: string;
    /**
     * Thread metadata
     */
    metadata?: Record<string, any>;
    /**
     * Thread creation timestamp
     */
    createdAt: string;
}
/**
 * Chat send options
 */
export interface ChatSendOptions {
    /**
     * Thread identifier
     */
    threadId: string;
    /**
     * Messages to send
     */
    messages: Message[];
    /**
     * Files to attach (optional)
     */
    files?: any[];
    /**
     * Command to execute (optional)
     */
    command?: {
        resume?: {
            action: string;
            data: Record<string, any> & {
                config?: {
                    thread_id?: string;
                    work_log_id?: string;
                };
            };
            message: string;
        };
        update?: any;
        send?: {
            node: string;
            input: any;
        };
    };
    [key: string]: any;
}
/**
 * Chat stream options
 */
export interface ChatStreamOptions extends ChatSendOptions {
    /**
     * Whether to run in background (optional)
     */
    background?: boolean;
    /**
     * Whether to return agent state when stream completes (optional)
     */
    enableReturnStateWhenSteamCompleted?: boolean;
}
/**
 * Stream callbacks interface
 */
export interface StreamCallbacks {
    /**
     * Called when a stream event is received
     */
    onEvent: (event: MessageChunk) => void;
    /**
     * Called when the stream completes, with optional agent state
     */
    onComplete?: (state?: AgentState) => void;
    /**
     * Called when an error occurs
     */
    onError?: (error: Error) => void;
}
/**
 * Chat response
 */
export interface ChatResponse {
    /**
     * Response messages
     */
    messages: Message[];
    /**
     * Trace ID for debugging
     */
    traceId?: string;
}
/**
 * Tool registration options
 */
export interface RegisterToolOptions {
    /**
     * Tool name
     */
    name: string;
    /**
     * Tool parameter schema
     */
    schema: object;
    /**
     * Tool handler function
     */
    handler: (params: any) => Promise<any>;
}
/**
 * Get messages options
 */
export interface GetMessagesOptions {
    /**
     * Thread identifier
     */
    threadId: string;
    /**
     * Maximum number of messages to return
     */
    limit?: number;
    /**
     * Message ID to start from (for pagination)
     */
    after?: string;
    /**
     * Whether to return messages in reverse chronological order
     */
    reverse?: boolean;
}
/**
 * Resume stream options
 */
export interface ResumeStreamOptions {
    /**
     * Thread identifier
     */
    threadId: string;
    /**
     * Message identifier (usually run_id)
     */
    messageId: string;
    /**
     * Content already received (used to find resume position)
     */
    knownContent: string;
    /**
     * Polling interval in milliseconds (default: 100ms)
     */
    pollInterval?: number;
}
/**
 * Thread list options
 */
export interface ListThreadsOptions {
    /**
     * Maximum number of threads to return
     */
    limit?: number;
    /**
     * Offset for pagination
     */
    offset?: number;
}
/**
 * Run options
 */
export type RunOptions = {
    /**
     * Thread identifier
     */
    threadId: string;
    /**
     * Message to send
     */
    message: string;
    /**
     * Files to attach (optional)
     */
    files?: any[];
    /**
     * Command to execute (optional)
     */
    command?: any;
    /**
     * Whether to stream the response (optional)
     */
    streaming?: boolean;
    /**
     * Whether to run in background (optional)
     */
    background?: boolean;
    /**
     * Whether to return agent state when stream completes (optional)
     */
    enableReturnStateWhenSteamCompleted?: boolean;
} & Record<string, any>;
/**
 * Agent state
 */
export interface AgentState {
    values: {
        messages: Message[];
        [key: string]: any;
    };
    tasks: Array<{
        interrupts: Array<{
            value: any;
        }>;
    }>;
}
/**
 * Custom error classes
 */
export declare class ApiError extends Error {
    statusCode: number;
    responseBody?: any | undefined;
    constructor(message: string, statusCode: number, responseBody?: any | undefined);
}
export declare class NetworkError extends Error {
    constructor(message: string);
}
export declare class AuthenticationError extends Error {
    constructor(message: string);
}
//# sourceMappingURL=types.d.ts.map