import { type RunCommandDeps } from "@oscharko-dev/keiko-tools";
import { type SandboxPolicy } from "@oscharko-dev/keiko-tools";
import type { EvidenceStore } from "@oscharko-dev/keiko-evidence";
import type { UiStore } from "./store/index.js";
export interface TerminalExecutionInput {
    readonly projectId: string;
    readonly command: string;
    readonly args: readonly string[];
    readonly cwd?: string | undefined;
    readonly timeoutMs?: number | undefined;
    readonly requestId?: string | undefined;
}
export interface TerminalExecutionResult {
    readonly executionId: string;
    readonly exitCode: number | null;
    readonly stdout: string;
    readonly stderr: string;
    readonly durationMs: number;
    readonly truncated: boolean;
    readonly timedOut: boolean;
}
export type TerminalEventKind = "execution-started" | "execution-completed" | "execution-failed" | "execution-cancelled";
export interface TerminalEventEnvelope {
    readonly kind: TerminalEventKind;
    readonly executionId: string;
    readonly payload: Readonly<Record<string, unknown>>;
}
export type TerminalEventEmitter = (event: TerminalEventEnvelope) => void;
export interface TerminalExecutionManager {
    readonly execute: (input: TerminalExecutionInput) => Promise<TerminalExecutionResult>;
    readonly abort: (executionId: string) => boolean;
    readonly subscribe: (listener: TerminalEventEmitter) => () => void;
    readonly inFlightCount: () => number;
}
export interface TerminalDirectoryEntry {
    readonly name: string;
    readonly path: string;
}
export interface TerminalDirectoryRoot {
    readonly label: string;
    readonly path: string;
}
export interface TerminalDirectoryListing {
    readonly path: string;
    readonly parent: string | null;
    readonly entries: readonly TerminalDirectoryEntry[];
    readonly roots: readonly TerminalDirectoryRoot[];
}
export interface TerminalPolicySummary {
    readonly commands: readonly string[];
    readonly limits: {
        readonly maxOutputBytes: number;
        readonly defaultTimeoutMs: number;
    };
}
export interface TerminalExecutionManagerOptions {
    readonly store: UiStore;
    readonly evidenceStore?: EvidenceStore | undefined;
    readonly policy?: SandboxPolicy | undefined;
    readonly processEnv?: NodeJS.ProcessEnv | undefined;
    readonly redactor?: ((input: string) => string) | undefined;
    readonly runDeps?: Partial<RunCommandDeps> | undefined;
    readonly now?: (() => number) | undefined;
}
export declare function createTerminalExecutionManager(opts: TerminalExecutionManagerOptions): TerminalExecutionManager;
export declare function buildTerminalPolicySummary(policy?: SandboxPolicy): TerminalPolicySummary;
export declare function listDirectories(store: UiStore, projectId: string, pathInput: string | undefined): Promise<TerminalDirectoryListing>;
//# sourceMappingURL=terminal.d.ts.map