/**
 * Shared resource list and detail view.
 *
 * Provides a reusable picker (TTY) / table (piped) presentation layer
 * for resource-type commands (plugins, subagents, skills, etc.). Each
 * resource supplies rows with sync targets; this module handles layout,
 * filtering, and paging.
 */
import type { AgentId } from '../lib/types.js';
export type SyncStatus = 'synced' | 'stale' | 'missing';
export interface SyncTarget {
    agent: AgentId;
    version: string;
    isDefault?: boolean;
    status: SyncStatus;
}
export interface ResourceRow {
    name: string;
    description?: string;
    extra?: string;
    extra2?: string;
    targets: SyncTarget[];
    buildDetail: () => string;
}
export interface ResourceViewOptions {
    resourcePlural: string;
    resourceSingular: string;
    extraLabel?: string;
    extra2Label?: string;
    rows: ResourceRow[];
    emptyMessage: string;
    centralPath?: string;
    /** When the user specified agent or agent@version, we scope per-agent. */
    filterAgent?: AgentId;
    filterVersion?: string;
    /** Emit machine-readable JSON instead of the picker/table (for agents/scripts). */
    json?: boolean;
    /**
     * Show the "Synced" column. Default true — the central-storage commands all
     * answer "which agent versions have this?". `agents inspect <repo>` does not:
     * there the repo IS the source, and empty `targets` would render the
     * misleading "no installed versions". Set false to drop the column entirely.
     */
    showSync?: boolean;
    /**
     * Cap for the Name column. Defaults to NAME_CAP (22), which suits the
     * central-storage commands. Kinds whose rows have no description — hooks are
     * all script names and no prose — want a wider cap, otherwise four pairs of
     * `00-agent-verify-work-complete…` truncate to the same string while the
     * empty Description column wastes the rest of the terminal.
     */
    nameCap?: number;
    /** Per-row OSC-8 link target, keyed by row name; makes names clickable. */
    linkFor?: (row: ResourceRow) => string | undefined;
}
/** Display a resource list: interactive picker in TTY mode, plain table otherwise. */
export declare function showResourceList(opts: ResourceViewOptions): Promise<void>;
export interface ResourceLayout {
    mode: 'table' | 'cards';
    nameW: number;
    extraW: number;
    extra2W: number;
    descW: number;
    syncW: number;
}
/**
 * Pure column arithmetic. Decides table vs. cards for the effective terminal
 * width and sizes the flexible Description column from whatever is left after the
 * fixed columns and a capped Sync column — so the table fits `cols` instead of
 * the old fixed 22+10+16+42+∞ layout that overflowed every narrow terminal.
 */
export declare function resourceLayout(cols: number, o: {
    hasExtra: boolean;
    hasExtra2: boolean;
    nameW: number;
    syncW: number;
}): ResourceLayout;
/** Build the sync targets section showing version pills grouped by agent. */
export declare function buildTargetsSection(targets: SyncTarget[]): string;
/** Pad a string to a fixed width, accounting for ANSI escape codes in length calculation. */
