/** * 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, DetachedResult, DetachedRunOptions } from './runDetached.js'; /** * Record of a single task execution call. */ export interface MockTaskCall { taskHash: string; inputHashes: string[]; options?: TaskExecuteOptions; } /** * TaskRunner mock for testing dataflow orchestration without spawning processes. * * Allows configuring responses per task and records all calls for assertions. */ export declare class MockTaskRunner implements TaskRunner { private results; private calls; private defaultResult; /** * Set result for a specific task hash. * * @param taskHash - The task hash to configure * @param result - Either a static TaskResult or a function that computes result from inputHashes */ setResult(taskHash: string, result: TaskResult | ((inputHashes: string[]) => TaskResult | Promise)): void; /** * Set default result for tasks without specific results configured. * * @param result - The default TaskResult to return */ setDefaultResult(result: TaskResult): void; /** * Get all recorded calls. * * @returns Readonly array of all execute() calls */ getCalls(): readonly MockTaskCall[]; /** * Clear recorded calls. */ clearCalls(): void; execute(_storage: StorageBackend, taskHash: string, inputHashes: string[], options?: TaskExecuteOptions): Promise; private detachedResult; private detachedCalls; /** Set the result returned by runDetached. */ setDetachedResult(result: DetachedResult): void; /** Get all recorded runDetached calls. */ getDetachedCalls(): readonly DetachedSpec[]; runDetached(spec: DetachedSpec, _options?: DetachedRunOptions): Promise; } //# sourceMappingURL=MockTaskRunner.d.ts.map