import type { StateManager } from "../../poe-code-config/dist/index.js";
import type { DownloadResult, ExecutionEnvFactory, OpenSpec } from "./execution-env.js";
export declare function runPoeCommand(opts: {
    factory: ExecutionEnvFactory;
    openSpec: OpenSpec;
    detach: boolean;
    state: StateManager;
    signal?: AbortSignal;
}): Promise<{
    kind: "sync";
    exitCode: number;
    download: DownloadResult;
    stdout?: string;
    stderr?: string;
} | {
    kind: "detached";
    jobId: string;
    envId: string;
}>;
export interface PoeCommandSession {
    run(openSpec: OpenSpec, signal?: AbortSignal): Promise<{
        kind: "sync";
        exitCode: number;
        download: DownloadResult;
        stdout?: string;
        stderr?: string;
    }>;
    close(): Promise<void>;
}
export declare function createPoeCommandSession(opts: {
    factory: ExecutionEnvFactory;
    state: StateManager;
}): PoeCommandSession;
