import { type KernelDisplayOutput } from "./display";
import { type PythonRuntime } from "./runtime";
export type { KernelDisplayOutput, PythonStatusEvent } from "./display";
export { renderKernelDisplay } from "./display";
export type KernelRuntimeEnv = Record<string, string | null>;
export interface KernelExecuteOptions {
    id?: string;
    /** Runtime working directory applied immediately before this request executes. */
    cwd?: string;
    /** Managed runtime environment variables applied immediately before this request executes. */
    env?: KernelRuntimeEnv;
    signal?: AbortSignal;
    onChunk?: (text: string) => Promise<void> | void;
    onDisplay?: (output: KernelDisplayOutput) => Promise<void> | void;
    timeoutMs?: number;
    silent?: boolean;
    storeHistory?: boolean;
    allowStdin?: boolean;
}
export interface KernelExecuteResult {
    status: "ok" | "error";
    executionCount?: number;
    error?: {
        name: string;
        value: string;
        traceback: string[];
    };
    cancelled: boolean;
    timedOut: boolean;
    stdinRequested: boolean;
    /**
     * True when the kernel subprocess was killed as part of settling this
     * execution (e.g. SIGINT was ignored and we escalated to shutdown, or the
     * kernel died unexpectedly). When false, the kernel remains reusable.
     */
    kernelKilled?: boolean;
}
export interface KernelShutdownResult {
    confirmed: boolean;
}
interface KernelLifecycleOptions {
    signal?: AbortSignal;
    deadlineMs?: number;
}
interface KernelStartOptions extends KernelLifecycleOptions {
    cwd: string;
    env?: Record<string, string | undefined>;
    /**
     * Explicit interpreter path (`python.interpreter` from the session's
     * settings). When set, runtime discovery is skipped entirely.
     */
    interpreter?: string;
}
interface KernelShutdownOptions {
    signal?: AbortSignal;
    timeoutMs?: number;
}
export interface PythonKernelAvailability {
    ok: boolean;
    pythonPath?: string;
    reason?: string;
    /** The probed-working runtime, when one was found. */
    runtime?: PythonRuntime;
}
export declare function checkPythonKernelAvailability(cwd: string, interpreter?: string): Promise<PythonKernelAvailability>;
export declare class PythonKernel {
    #private;
    readonly id: string;
    private constructor();
    static start(options: KernelStartOptions): Promise<PythonKernel>;
    isAlive(): boolean;
    execute(code: string, options?: KernelExecuteOptions): Promise<KernelExecuteResult>;
    interrupt(): Promise<void>;
    shutdown(options?: KernelShutdownOptions): Promise<KernelShutdownResult>;
}
