/**
 * agent-plans — persistence for `amplitude-wizard plan` output.
 *
 * The wizard's plan/apply/verify command split decouples "decide what to do"
 * from "actually do it." `plan` runs detection + planning, persists a JSON
 * blob keyed by a generated `planId`, and emits a `plan` NDJSON event so an
 * outer agent (Claude Code, Cursor, custom orchestrator) can inspect what
 * the wizard intends to do _before_ any files are touched.
 *
 * `apply --plan-id <id> --yes` then re-loads the plan, validates it's still
 * fresh, and runs the actual instrumentation flow against it. This is the
 * sub-agent contract the design doc calls for: outer agent proposes →
 * human approves → wizard executes.
 *
 * Storage is a flat directory under `$TMPDIR`. Plans expire after 24 hours
 * (matching the wizard session checkpoint TTL) so stale plans don't pile up
 * across runs. All writes go through `atomicWriteJSON` to avoid corruption
 * on crash.
 *
 * Privacy: plans contain framework, SDK choice, event names, and file paths
 * relative to the install dir. They never include credentials, tokens, or
 * absolute paths outside the install dir. Outer agents see only what the
 * `plan` NDJSON event carries.
 */
import { z } from 'zod';
/** A single file the inner agent intends to create or modify. */
export declare const FileChangeSchema: z.ZodObject<{
    path: z.ZodString;
    operation: z.ZodEnum<{
        create: "create";
        modify: "modify";
        delete: "delete";
    }>;
    reason: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type FileChange = z.infer<typeof FileChangeSchema>;
/** A single event the inner agent intends to instrument. */
export declare const PlannedEventSchema: z.ZodObject<{
    name: z.ZodString;
    description: z.ZodString;
}, z.core.$strip>;
export type PlannedEvent = z.infer<typeof PlannedEventSchema>;
export declare const WizardPlanSchema: z.ZodObject<{
    v: z.ZodLiteral<1>;
    planId: z.ZodString;
    createdAt: z.ZodString;
    installDir: z.ZodString;
    framework: z.ZodString;
    frameworkName: z.ZodNullable<z.ZodString>;
    sdk: z.ZodNullable<z.ZodString>;
    events: z.ZodDefault<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    fileChanges: z.ZodDefault<z.ZodArray<z.ZodObject<{
        path: z.ZodString;
        operation: z.ZodEnum<{
            create: "create";
            modify: "modify";
            delete: "delete";
        }>;
        reason: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>>;
    requiresApproval: z.ZodDefault<z.ZodLiteral<true>>;
}, z.core.$strip>;
export type WizardPlan = z.infer<typeof WizardPlanSchema>;
/**
 * Plans live under `<cacheRoot>/plans/`. The directory is created lazily on
 * first write.
 */
export declare function getPlansDir(): string;
/** 24 hours, matching the session-checkpoint TTL. */
export declare const PLAN_TTL_MS: number;
export declare function isPlanFresh(plan: WizardPlan, now?: number): boolean;
export interface CreatePlanInput {
    installDir: string;
    framework: string;
    frameworkName: string | null;
    sdk: string | null;
    events?: PlannedEvent[];
    fileChanges?: FileChange[];
}
export declare function createAndPersistPlan(input: CreatePlanInput): WizardPlan;
export type LoadPlanResult = {
    kind: 'ok';
    plan: WizardPlan;
} | {
    kind: 'not_found';
} | {
    kind: 'invalid';
    reason: string;
} | {
    kind: 'expired';
    createdAt: string;
};
export declare function loadPlan(planId: string): Promise<LoadPlanResult>;
/** Delete plans older than the TTL. Best-effort; errors are swallowed. */
export declare function pruneStalePlans(now?: number): Promise<number>;
