/**
 * Typed icon enums for the human-render contract (ADR-077).
 *
 * Single source of truth for the visual language used across all renderers
 * (tree, table, list, badge). Each enum is emoji-first; `ascii()` returns the
 * NO_COLOR-safe fallback for non-UTF-8 terminals or `NO_COLOR=1` environments.
 *
 * @packageDocumentation
 */
/**
 * Status icons — agent-task lifecycle states.
 *
 * Emoji-first; `ascii()` returns a NO_COLOR-safe fallback.
 */
export var StatusIcon;
(function (StatusIcon) {
    /** Task is queued and has not started. */
    StatusIcon["PENDING"] = "\u23F3";
    /** Task is in progress. */
    StatusIcon["ACTIVE"] = "\uD83D\uDEA7";
    /** Task completed successfully. */
    StatusIcon["DONE"] = "\u2705";
    /** Task is blocked on a dependency or gate. */
    StatusIcon["BLOCKED"] = "\uD83D\uDEAA";
    /** Task is archived and no longer actively tracked. */
    StatusIcon["ARCHIVED"] = "\uD83D\uDDC4";
    /** Task was cancelled before completion. */
    StatusIcon["CANCELLED"] = "\u2717";
})(StatusIcon || (StatusIcon = {}));
/**
 * Task-kind icons — Saga / Epic / Task / Subtask plus ancillary kinds.
 */
export var KindIcon;
(function (KindIcon) {
    /** Saga — multi-release theme grouping ≥ 2 Epics. */
    KindIcon["SAGA"] = "\uD83C\uDF32";
    /** Epic — one releasable slice. */
    KindIcon["EPIC"] = "\uD83D\uDCCB";
    /** Task — one atomic PR-sized change. */
    KindIcon["TASK"] = "\u2022";
    /** Subtask — one commit contributing to a Task's PR. */
    KindIcon["SUBTASK"] = "\u25E6";
    /** Research task — investigation or audit. */
    KindIcon["RESEARCH"] = "\uD83D\uDCD6";
    /** Bug task — defect tracking. */
    KindIcon["BUG"] = "\uD83D\uDC1B";
    /** Release task — shipping work. */
    KindIcon["RELEASE"] = "\uD83D\uDE80";
})(KindIcon || (KindIcon = {}));
/**
 * Badge icons — flags attached to tasks (empty, orphan, nested, etc).
 */
export var BadgeIcon;
(function (BadgeIcon) {
    /** Container has no children. */
    BadgeIcon["EMPTY"] = "\uD83E\uDEA6";
    /**
     * Task has no parent and is unreachable from a Saga or Epic.
     *
     * NOTE: ADR-077 §2 originally specified `'🚪'`, identical to `StatusIcon.BLOCKED`.
     * TypeScript string enums share a single runtime string so `ascii()` cannot
     * disambiguate. Resolved by switching to `'👻'` (abandoned/lonely semantics).
     * A follow-up ADR amendment lands in T10137 (B12).
     */
    BadgeIcon["ORPHAN"] = "\uD83D\uDC7B";
    /** Task is nested deeper than the depth budget allows. */
    BadgeIcon["NESTED"] = "\uD83D\uDD01";
    /** Caution — something needs human attention. */
    BadgeIcon["CAUTION"] = "\u26A0";
    /** Recently added — surfaced for visibility. */
    BadgeIcon["NEW"] = "\u2605";
})(BadgeIcon || (BadgeIcon = {}));
/**
 * Relation icons — edge semantics in tree views.
 */
export var RelationIcon;
(function (RelationIcon) {
    /** Saga groups Epic via `task_relations.relation_type='groups'`. */
    RelationIcon["GROUPS"] = "\u2282";
    /** Parent edge — direct hierarchical parent. */
    RelationIcon["PARENT"] = "\u2934";
    /** Depends-on edge — A cannot start until B is done. */
    RelationIcon["DEPENDS"] = "\u21E8";
    /** Blocks edge — A actively blocks B from progressing. */
    RelationIcon["BLOCKS"] = "\u2298";
})(RelationIcon || (RelationIcon = {}));
/**
 * Maps an emoji icon to its NO_COLOR-safe ASCII equivalent.
 *
 * Used when stdout is not a UTF-8 TTY or `NO_COLOR=1` is set. Every enum
 * member has an explicit ASCII fallback — the exhaustive switch ensures the
 * TypeScript compiler flags any future icon added without an ASCII mapping.
 *
 * @param icon - Any icon from `StatusIcon`, `KindIcon`, `BadgeIcon`, or `RelationIcon`.
 * @returns The ASCII-only string to render in NO_COLOR contexts.
 */
export function ascii(icon) {
    switch (icon) {
        // Status
        case StatusIcon.PENDING:
            return '[ ]';
        case StatusIcon.ACTIVE:
            return '[~]';
        case StatusIcon.DONE:
            return '[x]';
        case StatusIcon.BLOCKED:
            return '[!]';
        case StatusIcon.ARCHIVED:
            return '[#]';
        case StatusIcon.CANCELLED:
            return '[-]';
        // Kind
        case KindIcon.SAGA:
            return 'SG';
        case KindIcon.EPIC:
            return 'E';
        case KindIcon.TASK:
            return '-';
        case KindIcon.SUBTASK:
            return '.';
        case KindIcon.RESEARCH:
            return 'R';
        case KindIcon.BUG:
            return 'B';
        case KindIcon.RELEASE:
            return '>';
        // Badge
        case BadgeIcon.EMPTY:
            return '(empty)';
        case BadgeIcon.ORPHAN:
            return '(orphan)';
        case BadgeIcon.NESTED:
            return '(nested)';
        case BadgeIcon.CAUTION:
            return '(!)';
        case BadgeIcon.NEW:
            return '(new)';
        // Relation
        case RelationIcon.GROUPS:
            return 'in';
        case RelationIcon.PARENT:
            return '^';
        case RelationIcon.DEPENDS:
            return '->';
        case RelationIcon.BLOCKS:
            return '!>';
    }
}
/**
 * Returns the icon to render given the current environment.
 *
 * Honors `NO_COLOR=1` and `TERM=dumb` for ASCII fallback when `opts.noColor`
 * is not provided explicitly.
 *
 * @param icon - The icon to render.
 * @param opts - Optional override for NO_COLOR detection.
 * @returns The emoji icon, or its ASCII equivalent if NO_COLOR mode is active.
 */
export function pickIcon(icon, opts) {
    const noColor = opts?.noColor ?? (process.env['NO_COLOR'] === '1' || process.env['TERM'] === 'dumb');
    return noColor ? ascii(icon) : icon;
}
//# sourceMappingURL=icon.js.map