/**
 * Product Persistence — read/write Product Mode state to disk.
 *
 * State is stored at `<project>/.qlogicagent/products/<productId>/product-state.json`.
 * Product listing is done by enumerating subdirectories.
 */
import type { PathService } from "../runtime/ports/index.js";
import type { ProductPhase, ProductInstanceDef } from "../protocol/wire/acp-agent-management.js";
import type { SerializedNode } from "./dag-scheduler.js";
export interface PersistedProductState {
    productId: string;
    name: string;
    phase: ProductPhase;
    cwd: string;
    instances: ProductInstanceDef[];
    tasks: SerializedNode[];
    budget: {
        maxTotalTokens?: number;
        maxDuration?: number;
        usedTokens: number;
        startedAt: number;
        warningEmitted: boolean;
    };
    createdAt: string;
    lastCheckpointAt: string;
}
export interface ProductPersistenceOptions {
    pathService?: PathService;
}
/** Save product state to disk. */
export declare function saveProductState(state: PersistedProductState, cwd?: string, options?: ProductPersistenceOptions): Promise<void>;
/** Load product state from disk. Returns undefined if not found. */
export declare function loadProductState(productId: string, cwd?: string, options?: ProductPersistenceOptions): Promise<PersistedProductState | undefined>;
/** List all product IDs with their persisted state. */
export declare function listProducts(cwd?: string, options?: ProductPersistenceOptions): Promise<PersistedProductState[]>;
