/** * Copyright (c) 2025 Elara AI Pty Ltd * Licensed under BSL 1.1. See LICENSE for details. */ import type { StorageBackend } from '../storage/interfaces.js'; import type { TaskRunner, TaskExecuteOptions, TaskResult } from './interfaces.js'; import { type DetachedSpec, type DetachedResult, type DetachedRunOptions } from './runDetached.js'; export { collectNodeModulesBins, collectVenvBins } from './processExec.js'; /** * Options for task execution */ export interface ExecuteOptions { /** Re-run even if cached (default: false) */ force?: boolean; /** Pass `-v` to the runner (known runtimes only) so it prints timing/perf * to stderr. Runtime-only: applied to the evaluated argv just before spawn, * so it never affects the task hash or caching. */ verbose?: boolean; /** Timeout in milliseconds (default: none) */ timeout?: number; /** AbortSignal for cancellation */ signal?: AbortSignal; /** Stream stdout callback */ onStdout?: (data: string) => void; /** Stream stderr callback */ onStderr?: (data: string) => void; } /** * Result of task execution */ export interface ExecutionResult { /** Combined inputs hash (identifies this execution) */ inputsHash: string; /** Execution ID (UUIDv7) */ executionId: string; /** True if result was from cache */ cached: boolean; /** Final state */ state: 'success' | 'failed' | 'error'; /** Output dataset hash (null on failure) */ outputHash: string | null; /** Process exit code (null if not applicable) */ exitCode: number | null; /** Execution time in ms (0 if cached) */ duration: number; /** Error message on failure */ error: string | null; } /** * TaskRunner implementation for local process execution. * * Spawns runner processes locally to execute tasks. * Used by the local CLI and e3-api-server for task execution. */ export declare class LocalTaskRunner implements TaskRunner { private readonly repo; constructor(repo: string); execute(storage: StorageBackend, taskHash: string, inputHashes: string[], options?: TaskExecuteOptions): Promise; runDetached(spec: DetachedSpec, options?: DetachedRunOptions): Promise; } /** * Execute a single task. * * This is the core execution primitive. It: * 1. Computes the execution identity from task + inputs * 2. Checks cache (unless force=true) * 3. Marshals inputs to a scratch directory * 4. Evaluates command IR to get exec args * 5. Runs the command * 6. Stores the output and updates status * * @param storage - Storage backend * @param repo - Repository identifier (for local storage, the path to e3 repository directory) * @param taskHash - Hash of the task object * @param inputHashes - Array of input dataset hashes * @param options - Execution options * @returns Execution result */ export declare function taskExecute(storage: StorageBackend, repo: string, taskHash: string, inputHashes: string[], options?: ExecuteOptions): Promise; //# sourceMappingURL=LocalTaskRunner.d.ts.map