import type { DreamingTask } from "../../../config/schema/magic-context";
import type { PluginContext } from "../../../plugin/types";
import { Database } from "../../../shared/sqlite";
interface ExperimentalPinKeyFilesConfig {
    enabled: boolean;
    token_budget: number;
    min_reads: number;
}
export declare function registerDreamProjectDirectory(projectIdentity: string, directory: string): void;
export interface DreamRunResult {
    startedAt: number;
    finishedAt: number;
    holderId: string;
    smartNotesSurfaced: number;
    smartNotesPending: number;
    tasks: {
        name: string;
        durationMs: number;
        result: unknown;
        error?: string;
    }[];
}
export declare function runDream(args: {
    db: Database;
    client: PluginContext["client"];
    /** Project identity (e.g. "git:<sha>"), NOT a filesystem path. Used for dream state keys. */
    projectIdentity: string;
    tasks: DreamingTask[];
    taskTimeoutMinutes: number;
    maxRuntimeMinutes: number;
    parentSessionId?: string;
    sessionDirectory?: string;
    experimentalUserMemories?: {
        enabled: boolean;
        promotionThreshold: number;
    };
    experimentalPinKeyFiles?: ExperimentalPinKeyFilesConfig;
}): Promise<DreamRunResult>;
export declare function processDreamQueue(args: {
    db: Database;
    client: PluginContext["client"];
    tasks: DreamingTask[];
    taskTimeoutMinutes: number;
    maxRuntimeMinutes: number;
    experimentalUserMemories?: {
        enabled: boolean;
        promotionThreshold: number;
    };
    experimentalPinKeyFiles?: ExperimentalPinKeyFilesConfig;
    /**
     * Optional project identity filter — when provided, only entries belonging
     * to this project are dequeued. Each running OpenCode/Pi process registers
     * exactly one project, and the host's dreamer client (and `pi` runner, in
     * Pi's case) is project-specific. Without this filter, a Pi process running
     * for project A would dequeue queue entries for project B and try to
     * `posix_spawn 'pi'` in B's `git:<sha>` identity string as a directory,
     * failing with ENOENT every cycle.
     *
     * Callers should pass this whenever they own a single project — both the
     * scheduled timer tick (`sweepProject`) and the `/ctx-dream` command
     * handler. Tests pass `undefined` to keep the legacy "dequeue any" semantics.
     */
    projectIdentity?: string;
}): Promise<DreamRunResult | null>;
export {};
//# sourceMappingURL=runner.d.ts.map