/**
 * Pure JSON serialiser for `olam plans list --json`.
 *
 * Kept separate from the command action so the wire contract is
 * unit-testable without a live cloud endpoint (mirrors the pattern
 * used by `repos-list-json.ts`, `auth-list-json.ts`, and
 * `servicesStatusJson` in services.ts).
 *
 * WHY this exists: agent/script drivers (Rico, flywheel chain, CI pipelines)
 * need to enumerate cloud plan state — plan IDs, statuses, modes — before
 * deciding whether to spawn a new plan or pick up an existing one. The human
 * table is colorized and column-width-sensitive, so scraping it is brittle.
 * This serialiser gives drivers a stable, color-free array via
 * `olam plans list --json | jq '.plans[] | select(.status=="active")'`.
 *
 * Secret redaction: the PlanSummary shape carries two URL fields
 * (`host_cp_url`, `auth_recovery_callback_url`) that MAY embed auth
 * tokens in the URL userinfo component. Both are redacted before emission
 * using the canonical `:***@` substitution that matches
 * `@olam/core/src/skill-sources/store.ts`'s `redactUrl`.
 * The `bearer` (showcase password) used for HTTP auth never enters the
 * PlanSummary shape itself and is therefore never serialised.
 */
import type { PlanSummary } from '../lib/plans-client.js';
/**
 * Per-plan row in the `plans list --json` payload.
 * Field names are load-bearing — add new fields freely, never rename.
 */
export interface PlanListJsonEntry {
    /** Stable UUID identifying the plan. */
    readonly plan_id: string;
    /** Operator that owns the plan. */
    readonly operator_id: string;
    /** Lifecycle state of the plan. */
    readonly status: PlanSummary['status'];
    /** Execution mode (cloud / goal). */
    readonly mode: PlanSummary['mode'];
    /** Unix epoch ms when the plan was created. */
    readonly created_at: number;
    /** Unix epoch ms of the last activity, or null when never active. */
    readonly last_active_at: number | null;
    /** Unix epoch ms until which the plan is pinned, or null when not pinned. */
    readonly pinned_until: number | null;
    /**
     * Host-CP URL for the plan, with credentials redacted.
     * null when not set.
     */
    readonly host_cp_url: string | null;
    /**
     * Auth recovery callback URL, with credentials redacted.
     * null when not set.
     */
    readonly auth_recovery_callback_url: string | null;
    /**
     * Whether a recovery callback URL is registered (boolean convenience flag).
     * Consumers should prefer this over checking `auth_recovery_callback_url`
     * when they only need to know "does a callback exist?".
     */
    readonly has_recovery_callback: boolean;
}
/** Top-level shape emitted by `olam plans list --json`. */
export interface PlansListJson {
    /** Number of plans returned. */
    readonly count: number;
    readonly plans: readonly PlanListJsonEntry[];
}
/**
 * Serialise a PlanSummary array to the stable `--json` wire shape.
 * Returns a JSON string (no trailing newline — caller adds it).
 *
 * Redacts any URL credentials in `host_cp_url` and
 * `auth_recovery_callback_url` using the canonical `redactUrl` helper
 * (`:***@` substitution), matching the pattern used by `repos-list-json.ts`
 * and `skills source list --json`.
 */
export declare function renderPlansListJson(plans: readonly PlanSummary[]): string;
//# sourceMappingURL=plans-list-json.d.ts.map