import { type WorkflowDefinition } from './definition.js';
export type RunChatBinding = {
    chatId: string;
    larkAppId: string;
};
type RunFileOptions = {
    runDir?: string;
    runsDir?: string;
};
export declare function workflowDefinitionSearchPaths(workflowId: string): string[];
export declare function loadWorkflowDefinition(workflowId: string): Promise<WorkflowDefinition>;
export declare function snapshotWorkflowDefinition(runId: string, def: WorkflowDefinition, opts?: RunFileOptions): Promise<string>;
/**
 * Load the workflow definition snapshot from a run's directory.  Each run
 * persists `workflow.json` next to `events.ndjson` so consumers that come
 * in via run id alone (Lark card callbacks, dashboard resolve) can recover
 * the definition without needing the catalog (which may drift).
 *
 * Returns null when the snapshot is missing or unreadable — callers can
 * still operate (e.g. resolveWait without ctx.def degrades to v0.1
 * approve/reject semantics).  The fallback is the *intended* design, but
 * we log non-ENOENT failures so an unexpected parse/IO error doesn't go
 * silently null and confuse debugging (ENOENT stays silent — missing
 * snapshot is a normal state for legacy v0.1 runs that predate this file).
 */
export declare function readWorkflowDefinitionFromRunDir(runDir: string): Promise<WorkflowDefinition | null>;
export declare function writeRunChatBinding(runId: string, binding: RunChatBinding, opts?: RunFileOptions): Promise<string>;
export declare function readRunChatBinding(runId: string, opts?: RunFileOptions): Promise<RunChatBinding>;
export {};
//# sourceMappingURL=loader.d.ts.map