import { MorphAPIClient } from '../../core/client.js'; import { APIResource } from '../../core/resource.js'; import { CompactConfig, CompactInput, CompactResult } from './types.js'; import '../utils/resilience.js'; /** * CompactClient — calls the Morph /v1/compact endpoint. * * Returns per-message compacted_line_ranges showing which lines were removed. * HTTP goes through the shared `MorphAPIClient` transport. */ /** * @deprecated Prefer the unified `MorphClient` (`new MorphClient({ apiKey }).compact`). * In edge runtimes where `MorphClient` is unavailable, pass a shared transport: * `new CompactClient(new MorphAPIClient({ apiKey }))`. Kept only for backwards compatibility. */ declare class CompactClient extends APIResource { /** Resolved URL/timeout, exposed for backwards-compatible introspection. */ readonly config: { morphApiUrl: string; timeout: number; debug: boolean; }; constructor(clientOrConfig?: MorphAPIClient | CompactConfig); /** * Compact messages or text via /v1/compact. * Returns per-message `compacted_line_ranges` showing which lines were removed. * * @example * ```typescript * const client = new CompactClient({ morphApiKey: 'sk-...' }); * const result = await client.compact({ * input: codeFile, * query: "authentication", * compressionRatio: 0.5, * }); * console.log(result.output); * ``` */ compact(input: CompactInput): Promise; } export { CompactClient };