/** * Task Runner * * Executes a discovered task by calling its run() function * with the appropriate context. */ import { type HostRuntime } from "../platform/compat/process.js"; import type { TaskDefinition } from "./types.js"; export interface RunnableTask { /** Stable task id used by CLI, triggers, and cloud runs. */ id: string; /** Human-readable task name. */ name: string; /** The task definition to execute. */ definition: TaskDefinition; } /** * Options for running a task */ export interface RunTaskOptions { /** The discovered task to run */ task: RunnableTask; /** Additional config to pass to the task */ config?: Record; /** Project ID (for cloud context) */ projectId?: string; /** Environment ID for the runtime target executing this task */ environmentId?: string; /** Cooperative cancellation propagated to the task context */ signal?: AbortSignal; /** If set, only these env var names are passed to the task. */ envAllowlist?: string[]; /** Enable debug logging */ debug?: boolean; } /** * Result of running a task */ export interface TaskRunResult { /** Whether the task completed successfully */ success: boolean; /** Return value from the task's run() */ result?: unknown; /** Error if the task failed */ error?: string; /** Execution duration in milliseconds */ durationMs: number; } /** * Run a task with the given options * * @param options Task definition and execution context. * @param host Host environment boundary. Omit it to use the current process. */ export declare function runTask(options: RunTaskOptions, host?: HostRuntime): Promise; //# sourceMappingURL=runner.d.ts.map