import type { TaskRunner } from "../contracts/orchestration.js";
export interface JsonRpcRequest<TParams = unknown> {
    jsonrpc: "2.0";
    id: string;
    method: string;
    params?: TParams;
}
export interface JsonRpcResponse<TResult = unknown> {
    jsonrpc: "2.0";
    id: string;
    result?: TResult;
    error?: {
        code: number;
        message: string;
        data?: unknown;
    };
}
export interface KimiInitializeParams {
    protocol_version: string;
    client: {
        name: string;
        version: string;
    };
    capabilities: {
        supports_question: boolean;
        supports_plan_mode: boolean;
    };
    external_tools: Array<{
        name: string;
        description: string;
        parameters: Record<string, unknown>;
    }>;
}
export interface KimiPromptParams {
    user_input: string;
}
export interface KimiPromptResult {
    status: "finished" | "cancelled";
}
export type WireEvent = {
    type: "status";
    contextUsage: number;
    maxContextTokens: number;
    tokenUsage: number;
    planMode: boolean;
} | {
    type: "message";
    role: "assistant" | "user";
    content: string;
} | {
    type: "tool_use";
    name: string;
    input: unknown;
} | {
    type: "tool_result";
    name: string;
    output: unknown;
} | {
    type: "error";
    message: string;
} | {
    type: "request";
    method: string;
    params: unknown;
    respond: (result: unknown) => void;
    reject: (error: {
        code: number;
        message: string;
    }) => void;
};
export declare class KimiWireClient {
    private options;
    private proc?;
    private rl?;
    private pending;
    private eventHandlers;
    private static readonly MAX_PENDING_RPCS;
    constructor(options?: {
        agentFile?: string;
        configFile?: string;
        mcpConfigFile?: string;
        cwd?: string;
        env?: NodeJS.ProcessEnv;
    });
    onEvent(handler: (event: WireEvent) => void): () => void;
    private emit;
    start(): Promise<void>;
    private call;
    private handleServerMessage;
    prompt(userInput: string): Promise<KimiPromptResult>;
    steer(userInput: string): Promise<void>;
    cancel(): Promise<void>;
    stop(): Promise<void>;
}
export declare function createKimiTaskRunner(client: KimiWireClient): TaskRunner;
