/**
 * View command for inspecting installed agents, versions, accounts, and resources.
 *
 * Implements `agents view` -- shows installed agent CLIs with version info,
 * account emails, usage stats, and active status. When given an agent@version
 * argument, displays a detailed breakdown of commands, skills, MCP servers,
 * rules, hooks, and promptcuts synced to that version.
 */
import type { Command } from 'commander';
import { accountDisplayLabel } from '../lib/agents.js';
import type { AccountInfo } from '../lib/agents.js';
import type { AgentId } from '../lib/types.js';
import type { FormatUsageSummaryOpts, UsageInfo } from '../lib/accounting/usage.js';
import { type ConfiguredDeviceRole } from '../lib/device-config.js';
import type { ResourceSection, ViewJsonAgent } from '../lib/view-types.js';
export type { ResourceItemJson, ResourceSection, SyncState, VersionResourcesJson, ViewJsonAgent, ViewJsonVersion } from '../lib/view-types.js';
import { type ProfileSummary } from '../lib/profiles.js';
import { type ByokUsageResult } from '../lib/byok-usage.js';
export declare function viewUsageSummaryOptions(agentId: AgentId, signedIn: boolean, usageInfo: UsageInfo | undefined, maxWindows: number | undefined, version?: string): FormatUsageSummaryOpts;
/** Shared account identity formatter, re-exported for the view-specific tests. */
export declare const accountColumnLabel: typeof accountDisplayLabel;
/**
 * The account column with the durable native-account name folded in: when the
 * signed-in identity of `agentId` has been named via `agents accounts name`,
 * render `work · email` instead of the bare email. Falls back to the plain
 * display label when the identity is unnamed.
 */
export declare function namedAccountColumnLabel(agentId: AgentId, info: AccountInfo | undefined): string;
export interface AccountOrderedVersion {
    version: string;
    email: string | null;
}
/**
 * Human `agents view` row order: selected default first, then email-bearing
 * accounts alphabetically, then installs whose account has no email. Version
 * descending is the deterministic tie-breaker and preserves the old order for
 * every non-email harness.
 */
export declare function compareAccountOrderedVersions(a: AccountOrderedVersion, b: AccountOrderedVersion, globalDefault: string | null): number;
/**
 * Join fixed view columns with a consistent two-space gutter. Empty trailing
 * columns are dropped so a row without an auth chip does not grow a dangling
 * gutter, but interior empties stay padded so later columns stay aligned.
 */
export declare function joinViewColumns(cols: string[]): string;
/** Per-section filter flags. When any are true, only those sections render. */
export interface ViewSectionFilter {
    commands?: boolean;
    skills?: boolean;
    mcp?: boolean;
    workflows?: boolean;
    plugins?: boolean;
    rules?: boolean;
    hooks?: boolean;
    promptcuts?: boolean;
    clis?: boolean;
}
/** Trim a description to a column-friendly snippet. Strips newlines, collapses whitespace. */
export declare function summarizeDescription(desc: string | undefined, maxLen?: number): string;
export declare function descriptionForPrefix(desc: string | undefined, prefix: string): string;
/**
 * Render custom harnesses as their own agent-type blocks — peers of the native
 * Claude/Codex blocks, not indented rows under the host CLI that executes them.
 * `agents run <name>` already treats a custom harness like a native agent id, so
 * `agents view` lists it the same way: a bold name header, then one row carrying
 * the model, the account/auth state, and the host it runs on.
 *
 * `installedHosts` is the set of agent ids with a usable install; a harness whose
 * host is missing is flagged rather than silently listed as runnable.
 */
export declare function renderHarnessBlocks(harnesses: ProfileSummary[], installedHosts: Set<AgentId>, showPaths: boolean, byokMap?: Map<string, ByokUsageResult>): void;
/**
 * The USAGE-READ-2 decision, isolated from its runtime inputs so it can be
 * tested directly: a usage read may fall through to the interactive OAuth login
 * ONLY for a foreground human render on a headed device (`personal` or
 * `desktop`). Both conditions are required — role alone is not sufficient.
 */
export declare function allowInteractiveUsageLogin(role: ConfiguredDeviceRole | undefined, isTTY: boolean): boolean;
/** Build the set of resource sections to include in `--json` from the
 *  `--resources` / `--detailed` flags, plus (in --json mode) the per-section
 *  boolean filters (`--skills` etc.) that plain `--json` historically ignored. */
export declare function parseResourceSections(options: {
    resources?: string | boolean;
    detailed?: boolean;
} & ViewSectionFilter, jsonMode: boolean): Set<ResourceSection>;
/**
 * Collect structured info for one or more agents without rendering to the
 * terminal. Used by `--json` output and any programmatic consumer (e.g. the
 * agents-cli extension's "resume current session in best available version"
 * command).
 */
export declare function collectAgentsJson(filterAgentId?: AgentId, resourceSections?: Set<ResourceSection>, opts?: {
    forceRefresh?: boolean;
}): Promise<ViewJsonAgent[]>;
/**
 * Identity key for duplicate-install detection. Prefers accountKey — which
 * encodes account AND org — over the bare email: two installs can share an
 * email yet belong to different orgs (a personal Max plan and a Team seat),
 * and grouping those by email alone would propose pruning a live account.
 * Falls back to the lowercased email for agents whose credentials expose no
 * identity key. Null when there is no usable identity.
 */
export declare function pruneGroupKey(info: Pick<AccountInfo, 'accountKey' | 'email'>): string | null;
/**
 * Prune older installed versions that share an email with a newer installed
 * version. Keeps the highest semver per email, skips the global default (with
 * a warning so the user can switch first).
 *
 * When filterAgentId is set, prunes that agent first, then cascades: after
 * each agent, offers the next agent with duplicates. User answering "no"
 * stops the chain.
 */
export declare function pruneDuplicates(filterAgentId: AgentId | undefined, yes: boolean, dryRun: boolean): Promise<void>;
/**
 * Main view action handler.
 * Exported for use by deprecated aliases.
 */
export declare function viewAction(agentArg?: string, options?: {
    json?: boolean;
    prune?: boolean;
    yes?: boolean;
    dryRun?: boolean;
    resources?: string | boolean;
    detailed?: boolean;
    refresh?: boolean;
    live?: boolean;
    merged?: boolean;
} & ViewSectionFilter): Promise<void>;
/** Register the `agents view` command. */
export declare function registerViewCommand(program: Command): void;
