import type { CommandPolicy, ContainerProvider, ExecutionProfileId, ExecutionRecord, NormalizedPipeline, NormalizedTask, SandboxDefinition, SandboxId } from "../core/index.js"; export interface CommandResult { code: number; stdout: string; stderr: string; timedOut?: boolean; } export interface RunShellOptions { cwd: string; env: NodeJS.ProcessEnv; task: NormalizedTask; timeoutMs?: number; echo?: boolean; redactValues?: readonly string[]; /** * Env keys safe to forward into isolated executors. When omitted, * isolating executors forward nothing beyond their own defaults. */ forwardEnvKeys?: readonly string[]; } export interface CommandExecutor { name: string; runShell(command: string, options: RunShellOptions): Promise; checkTool?(tool: string): Promise; } export type CommandPolicyStatus = "allowed" | "mocked" | "denied" | "approval-required"; export interface CommandInvocation { argv: string[]; cwd: string; env: NodeJS.ProcessEnv; timeoutMs?: number; } export interface CommandRecord { argv: string[]; cwd: string; status: CommandPolicyStatus; code: number; stdout: string; stderr: string; startedAt: string; finishedAt: string; durationMs: number; } export interface PipelineCommands { run(invocation: CommandInvocation, next: () => Promise): Promise; records(): CommandRecord[]; } export interface PipelineFileSystem { kind: "host"; } export interface ExecutionContext { cwd: string; env: NodeJS.ProcessEnv; fs: PipelineFileSystem; executor: CommandExecutor; commands?: PipelineCommands; } export declare class HostCommandExecutor implements CommandExecutor { name: string; runShell(command: string, options: RunShellOptions): Promise; checkTool(tool: string): Promise; } export interface DockerVolume { source: string; target: string; readonly?: boolean; } export declare class DockerCommandExecutor implements CommandExecutor { private readonly options; name: string; constructor(options: { image: string; hostCwd: string; workdir: string; volumes: DockerVolume[]; }); runShell(command: string, options: RunShellOptions): Promise; checkTool(tool: string): Promise; private dockerCommand; private containerCwd; } export declare class AppleContainerCommandExecutor implements CommandExecutor { private readonly options; name: string; constructor(options: { image: string; hostCwd: string; workdir: string; volumes: DockerVolume[]; }); runShell(command: string, options: RunShellOptions): Promise; checkTool(tool: string): Promise; private containerCommand; private containerCwd; } export declare class LimaCommandExecutor implements CommandExecutor { private readonly vm; name: string; constructor(vm?: string); runShell(command: string, options: RunShellOptions): Promise; checkTool(tool: string): Promise; } /** * Resolve flat run options into the execution context a run uses: host by * default, or the selected sandbox (by id from `pipeline.sandboxes`, or an * inline definition). */ export declare function resolveExecutionContext(pipeline: NormalizedPipeline, target?: RunTarget): ExecutionContext; export declare function commandProxy(policy?: CommandPolicy): PipelineCommands; export interface RunTarget { cwd?: string; env?: NodeJS.ProcessEnv; executor?: CommandExecutor; commands?: PipelineCommands; sandbox?: SandboxId | SandboxDefinition; provider?: ContainerProvider; execution?: ExecutionProfileId; } export interface RunOptions extends RunTarget { id: string; mode?: "manual" | "ci"; concurrency?: number; force?: boolean; echo?: boolean; } export type RunSingleTaskOptions = Omit; export declare function runJob(pipeline: NormalizedPipeline, options: RunOptions): Promise; export interface TaskPlanEntry { id: string; cacheEnabled: boolean; predicted: "run" | "cached" | "unknown"; cacheKey?: string; reason?: string; } export interface JobPlan { jobId: string; executionOrder: string[]; entries: TaskPlanEntry[]; } export type GitHubCacheManifestTrust = "read-only" | "read-write"; export interface GitHubTaskCacheManifestEntry { id: string; task: string; key: string; restoreKeys: string[]; paths: string[]; writeAllowed: boolean; predicted?: TaskPlanEntry["predicted"]; reason?: string; } export interface GitHubTaskCacheManifest { version: 1; generatedBy: "@async/pipeline"; generatedAt: string; job: string; trust: GitHubCacheManifestTrust; primaryKey: string; restoreKeys: string[]; entries: GitHubTaskCacheManifestEntry[]; } /** * Computes the execution order and predicted cache behavior for a job without running it. * Predictions reuse the real cache-key chain but do not validate cached output files. */ export declare function planJob(pipeline: NormalizedPipeline, options: { id: string; } & RunTarget): Promise; export declare function cacheManifestForJob(pipeline: NormalizedPipeline, options: { id: string; trust?: GitHubCacheManifestTrust; } & RunTarget): Promise; export declare function cacheManifestForTask(pipeline: NormalizedPipeline, taskId: string, options?: { trust?: GitHubCacheManifestTrust; } & RunTarget): Promise; export declare function runSingleTask(pipeline: NormalizedPipeline, taskId: string, options?: RunSingleTaskOptions): Promise; /** * Abort the run: terminate every live task process group (SIGTERM-style * signal first, SIGKILL after a grace period), refuse to start new task * processes, and hard-exit if the run has not finalized its execution * record by the deadline. Idempotent; the first caller wins. */ export declare function beginShutdown(signal: NodeJS.Signals, exitCode: number): void; /** Exit code requested by an in-progress shutdown, if any. */ export declare function shutdownExitCode(): number | null; //# sourceMappingURL=runner.d.ts.map