import { executionRepo, TERMINAL_STATUSES } from '../../store/execution-repo.js'; import type { AgentResult } from '../../core/types/agent-types.js'; export type { ExecutionRecord, DispatchInfo } from '../../store/execution-repo.js'; export { TERMINAL_STATUSES }; export declare function getExecution(id: string): import("../../store/execution-repo.js").ExecutionRecord; export declare function getExecutionByTaskId(taskId: string | null | undefined): import("../../store/execution-repo.js").ExecutionRecord; export declare function getAll(): import("../../store/execution-repo.js").ExecutionRecord[]; export declare function getRunningExecutions(): import("../../store/execution-repo.js").ExecutionRecord[]; export declare function findRunningDispatchMatch(opts: Parameters[0]): import("../../store/execution-repo.js").ExecutionRecord; export declare function startLocalExecution(opts: Parameters[0]): import("../../store/execution-repo.js").ExecutionRecord; export declare function registerDispatchExecution(opts: Parameters[0]): import("../../store/execution-repo.js").ExecutionRecord; export declare function touchExecution(id: string, patch?: Parameters[1]): import("../../store/execution-repo.js").ExecutionRecord; export declare function completeExecution(id: string, metrics?: Parameters[1]): import("../../store/execution-repo.js").ExecutionRecord; export declare function completeExecutionByTaskId(taskId: string, metrics?: Parameters[1]): import("../../store/execution-repo.js").ExecutionRecord; export declare function failExecution(id: string, metrics?: Parameters[1]): import("../../store/execution-repo.js").ExecutionRecord; export declare function failExecutionByTaskId(taskId: string, metrics?: Parameters[1]): import("../../store/execution-repo.js").ExecutionRecord; export declare function cancelExecution(id: string, metrics?: Parameters[1]): import("../../store/execution-repo.js").ExecutionRecord; export declare function cancelExecutionByTaskId(taskId: string, metrics?: Parameters[1]): import("../../store/execution-repo.js").ExecutionRecord; /** * Close an execution across BOTH ledgers in one call: finalize the persistent record * (idempotent — terminal status is guarded in execution-repo) and tear down the in-memory * live registry while publishing the matching agent.* lifecycle event. * * This is the single teardown every execution path should funnel through so the persistent * status, the live registry, and the bus events never drift apart. In particular it gives * thread steps their agent.completed/failed events, which the old event-less remove() skipped. * * Does NOT touch the busy-tracker — trackPendingTask(±1) is per-enqueue (a thread spans many * steps under one +1), so it stays managed by the caller. */ export declare function teardownExecution({ executionId, status, result, error, durationS, costUsd }: { executionId: string | null; status: 'completed' | 'failed' | 'cancelled'; result?: AgentResult | null; error?: { message?: string; } | null; durationS: number; costUsd?: number; }): any; export declare function markMissingRunningExecutionsStale(keepRunning?: Parameters[0]): Promise; export declare function reconcileStaleDispatches(opts: Parameters[0]): Promise; /** @deprecated ExecutionRepo uses in-memory Map; cache clearing is a no-op. */ export declare function clearExecutionCache(): void;