import { RetryConfig } from '../utils/resilience.js';
import { ResponseInputItem, ResponseOutputItem } from 'openai/resources/responses/responses';

/**
 * Core types for Morph Compact SDK
 */

/**
 * Input parameters for the compact tool
 */
interface CompactInput {
    /** Model to use for compaction (defaults to 'morph-compactor') */
    model?: string;
    /** Input content - either a string or an array of response input items */
    input: string | ResponseInputItem[];
    /** Optional prompt to guide compaction priority */
    prompt?: string;
    /** Sampling temperature */
    temperature?: number;
    /** Maximum output tokens */
    max_output_tokens?: number;
    /** Whether to stream the response */
    stream?: boolean;
}
/**
 * Result returned after executing a compaction
 */
interface CompactResult {
    /** Response ID */
    id: string;
    /** Output items from the response */
    output: ResponseOutputItem[];
    /** Token usage statistics */
    usage?: {
        input_tokens: number;
        output_tokens: number;
        total_tokens: number;
    };
    /** Response status */
    status: string;
    /** Model used for compaction */
    model: string;
}
/**
 * Configuration options for the compact tool
 */
interface CompactConfig {
    /** Morph API key (defaults to MORPH_API_KEY env var) */
    morphApiKey?: string;
    /** Morph API base URL */
    morphApiUrl?: string;
    /** Timeout for API calls in ms (default: 120000) */
    timeout?: number;
    /** Retry configuration for API calls */
    retryConfig?: RetryConfig;
    /** Enable debug logging (default: false) */
    debug?: boolean;
}

export type { CompactConfig, CompactInput, CompactResult };
