import type { ChildProcess } from "node:child_process";
import { type WorkspaceFs, type WorkspaceInfo } from "@oscharko-dev/keiko-workspace";
import type { CommandResult, CommandRule, SandboxPolicy } from "./types.js";
export interface SpawnOptions {
    readonly cwd: string;
    readonly env: Record<string, string>;
    readonly shell: false;
    readonly detached: boolean;
}
export type SpawnFn = (command: string, args: readonly string[], options: SpawnOptions) => ChildProcess;
export interface ExecutableResolverDeps {
    readonly workspace: WorkspaceInfo;
    readonly processEnv: NodeJS.ProcessEnv;
    readonly fs?: WorkspaceFs | undefined;
}
export type ExecutableResolver = (command: string, deps: ExecutableResolverDeps) => string;
export declare const nodeSpawnFn: SpawnFn;
export interface HomeProvider {
    readonly make: () => string;
    readonly cleanup: (dir: string) => void;
}
export declare const nodeHomeProvider: HomeProvider;
export interface RunCommandDeps {
    readonly workspace: WorkspaceInfo;
    readonly policy: SandboxPolicy;
    readonly commandRules: readonly CommandRule[];
    readonly spawn: SpawnFn;
    readonly resolveExecutable?: ExecutableResolver | undefined;
    readonly processEnv: NodeJS.ProcessEnv;
    readonly now: () => number;
    readonly fs?: WorkspaceFs | undefined;
    readonly home?: HomeProvider | undefined;
}
export interface RunCommandInput {
    readonly command: string;
    readonly args: readonly string[];
    readonly cwd: string | undefined;
    readonly timeoutMs: number | undefined;
    readonly signal: AbortSignal;
}
export declare function runCommand(input: RunCommandInput, deps: RunCommandDeps): Promise<CommandResult>;
//# sourceMappingURL=exec.d.ts.map