/**
 * Pure JSON serialiser for `olam workspace list --json`.
 *
 * Kept separate from the command action so the wire contract is
 * unit-testable without a filesystem round-trip (mirrors the pattern
 * used by `repos-list-json.ts`, `auth-list-json.ts`, and `renderPsJson`
 * in ps.ts).
 *
 * WHY this exists: agent/script drivers (CI pipelines, flywheel chain
 * skills, Rico) need to enumerate registered workspaces before spawning
 * worlds or dispatching work with `--workspace`. The human table is
 * colorized and reflows per terminal width, so scraping it is brittle and
 * breaks when column widths change. This serialiser gives drivers a stable,
 * color-free object: each entry carries the name, repo count, full repo
 * list, and updatedAt timestamp needed to select a workspace without
 * re-querying the filesystem.
 *
 * Secret redaction: `setupCmd` fields inside repos can carry inline secrets
 * (e.g. `setupCmd: "export GITHUB_TOKEN=ghp_..."`). The serialiser applies
 * `workspaceForApi` from @olam/core before emission so sensitive-key values
 * are replaced with `[redacted]`. The repo `url` and `path` fields contain
 * no credentials — workspace YAMLs store only the remote URL without
 * embedded auth.
 */
import type { Workspace } from '@olam/core/src/workspace/index.js';
/**
 * Per-repo row inside a workspace entry in the `--json` payload.
 * Field names are load-bearing — add new fields freely, never rename.
 */
export interface WorkspaceRepoJson {
    /** Repo name (lowercase, digits, dash). */
    readonly name: string;
    /** Git remote URL. */
    readonly url: string;
    /** Local filesystem path to the repo clone, if registered. null when absent. */
    readonly path: string | null;
    /** Branch override. null when not set (caller uses the repo's default branch). */
    readonly branch: string | null;
    /** True when the repo uses git submodules. */
    readonly submodules: boolean;
}
/**
 * Per-workspace entry in the `--json` payload.
 * Field names are load-bearing — add new fields freely, never rename.
 */
export interface WorkspaceListJsonEntry {
    /** Workspace name (lowercase, digits, dash). */
    readonly name: string;
    /** Number of repos declared in this workspace. */
    readonly repoCount: number;
    /** All repos in the workspace. */
    readonly repos: readonly WorkspaceRepoJson[];
    /** Default branch override for repos that don't specify one. null when not set. */
    readonly defaultBranch: string | null;
    /** Unix epoch ms of the last update. */
    readonly updatedAt: number;
}
/** Top-level shape emitted by `olam workspace list --json`. */
export interface WorkspaceListJson {
    /** Number of registered workspaces. */
    readonly count: number;
    readonly workspaces: readonly WorkspaceListJsonEntry[];
}
/**
 * Serialise the workspace catalog to the stable `--json` wire shape.
 * Returns a JSON string (no trailing newline — caller adds it).
 *
 * Applies `workspaceForApi` (redact.ts) before serialisation so any
 * sensitive-key values in repo fields (e.g. inside `setupCmd`) are
 * replaced with `[redacted]` before leaving the process.
 */
export declare function renderWorkspaceListJson(workspaces: readonly Workspace[]): string;
//# sourceMappingURL=workspace-list-json.d.ts.map