/**
 * Pure JSON serialiser for `olam lanes list <world> --json`.
 *
 * Kept separate from the command action so the wire contract is
 * unit-testable without a network round-trip (mirrors the pattern
 * used by `repos-list-json.ts`, `auth-list-json.ts`, `services.ts`).
 *
 * WHY this exists: agent/script drivers (Rico, flywheel chain skills,
 * CI pipelines) need to enumerate running lanes in a world before
 * dispatching work or routing a follow-up task to the right lane.
 * The human renderer uses printInfo/printHeader which emit ANSI codes
 * and may reflow — scraping it is brittle. This serialiser gives
 * drivers a stable, colour-free array with the exact fields needed to
 * pick a lane without re-querying host-cp.
 *
 * Secret redaction: lane records contain no secrets (names, tasks, and
 * status strings are all operator-visible). No redaction needed.
 */
/**
 * Serialise host-cp's lane list to the stable `--json` wire shape.
 *
 * @param worldId  The world id that was queried (echoed back for driver convenience).
 * @param lanes    Lane array from host-cp (may be empty).
 * @returns        JSON string — no trailing newline (caller adds it).
 */
export function renderLanesListJson(worldId, lanes) {
    const rows = lanes.map((l) => ({
        name: l.name,
        task: l.task,
        status: l.status,
        tmuxSession: l.tmuxSession,
        createdAt: l.createdAt,
        isMain: l.isMain ?? false,
    }));
    const payload = {
        worldId,
        count: rows.length,
        lanes: rows,
    };
    return JSON.stringify(payload);
}
//# sourceMappingURL=lanes-list-json.js.map