/**
 * `agents inspect <target>` — detail view for one agent+version or one DotAgents repo.
 *
 * Agent targets (`claude`, `claude@2.1.170`) show the per-version header (paths,
 * shim, capabilities, resource counts, sessions). Repo targets (`user`, `system`,
 * `project`, a registered extra-repo alias, or a filesystem path to a repo with a
 * `.agents/` dir or to a DotAgents root itself) show the repo root, git state, and
 * per-kind resource counts. Drill-down flags (`--skills`, `--hooks`, `--mcp`, ...)
 * list one resource kind for either target form; passing a positional query to the
 * same flag fuzzy-searches for a single resource and prints its detail. Resource
 * names render as OSC-8 hyperlinks to the marker file (SKILL.md / WORKFLOW.md /
 * AGENT.md / the file itself) so users can click straight to the source.
 */
import { Command } from 'commander';
import type { ManifestHook } from '../lib/types.js';
import { type McpYamlConfig } from '../lib/mcp.js';
import { type PluginResourceGroup } from '../lib/plugins/plugins.js';
import { type JobConfig, type RunMeta } from '../lib/scheduling/routines.js';
/** Resource kinds the inspect command can drill into. */
declare const DRILLABLE_KINDS: readonly ["commands", "skills", "hooks", "mcp", "rules", "plugins", "workflows", "subagents", "routines"];
type DrillableKind = typeof DRILLABLE_KINDS[number];
/** Wrap a separator-joined value list under `prefix`, preserving a hanging indent. */
export declare function wrapJoined(prefix: string, items: string[], sep: string, width: number): string[];
interface ResourceItem {
    name: string;
    source: string;
    /** Absolute path to the resource entry (file or directory). */
    path: string;
    /** Path the OSC-8 link should point at — marker file inside bundles, else `path`. */
    linkTarget: string;
    /** One-line description (frontmatter `description:` or first non-frontmatter line). */
    description: string;
    /** Scalar detail rows surfaced in detail mode (e.g. a plugin's version). */
    extra?: Array<[string, string]>;
    /** For plugins: the resource categories (skills, commands, …) the bundle packages. */
    groups?: PluginResourceGroup[];
    /**
     * Machine-shaped fields for `--json`, when the display strings in `extra` would
     * lose information a script needs (a routine's raw cron, its device arrays).
     */
    json?: Record<string, unknown>;
}
export interface InspectOptions {
    brief?: boolean;
    json?: boolean;
    commands?: boolean | string;
    skills?: boolean | string;
    hooks?: boolean | string;
    mcp?: boolean | string;
    rules?: boolean | string;
    plugins?: boolean | string;
    workflows?: boolean | string;
    subagents?: boolean | string;
    routines?: boolean | string;
    command?: string;
    skill?: string;
    hook?: string;
    rule?: string;
    plugin?: string;
    workflow?: string;
    subagent?: string;
    routine?: string;
}
export declare function registerInspectCommand(program: Command): void;
export declare function inspectAction(target: string, options: InspectOptions): Promise<void>;
export interface RepoTarget {
    /** Display label: 'user' | 'system' | 'project', an extra-repo alias, or a path-derived name. */
    label: string;
    /** Absolute path to the DotAgents root (the dir holding commands/, skills/, ...). */
    root: string;
}
/**
 * Resolve a non-agent target as a DotAgents repo: the built-in layer names,
 * a registered extra-repo alias, or a filesystem path. Paths accept either a
 * DotAgents root itself or a repo whose `.agents/` dir should be inspected.
 * Returns null when the target is none of these.
 */
export declare function resolveRepoTarget(target: string, cwd?: string): RepoTarget | null;
export declare function inspectRepo(repo: RepoTarget, options: InspectOptions): Promise<void>;
/** List one resource kind from a single repo root — no layering, no overrides. */
export declare function collectRepoKind(repo: RepoTarget, kind: DrillableKind): ResourceItem[];
/** The live answers about one routine — what the YAML alone cannot say. */
export interface RoutineLiveState {
    /** Devices whose `routines:` allowlist names it. Empty means it fires nowhere. */
    devices: string[];
    /** False until some device has materialized an allowlist at all. */
    materialized: boolean;
    /** This machine's name, for reporting whether the routine is enabled here. */
    thisDevice: string;
    /**
     * THIS machine's activation answer, from `routineEnabledOnThisDevice` — the
     * same call `applyDeviceActivation` makes. `null` means this device has not
     * materialized its own allowlist, so the file's `enabled:` still governs.
     *
     * Deliberately separate from `materialized`, which is fleet-wide: a box whose
     * own device doc has no `routines:` key while a synced peer's does is the
     * normal state of a freshly-joined machine, and conflating the two reported
     * `enabled: no` for routines the daemon was actively firing.
     */
    enabledHere: boolean | null;
    /** Last run's status, or null if it has never run on a device we can see. */
    lastStatus: RunMeta['status'] | null;
    /** ISO timestamp of that run's start. */
    lastAt: string | null;
}
/** `2h` / `3d` / `just now` — compact enough for a 10-column cell. */
export declare function compactAge(iso: string | null, now?: Date): string;
/** What makes this routine fire: a humanized cron, an event trigger, or nothing. */
export declare function routineFireLabel(job: JobConfig, now?: Date): string;
/** What the routine actually executes. Exactly one of agent/workflow/command is set. */
export declare function routineTargetLabel(job: JobConfig): string;
/**
 * A routine's one-line intent.
 *
 * Routine YAML has no `description:` key, so the generic first-prose-line reader
 * returns `name: growth-metrics` for one file and a real sentence for the next.
 * Prefer the prompt's first sentence, then the file's leading comment block, then
 * the first meaningful line of a shell command.
 */
export declare function routineDescription(job: JobConfig | null, raw: string): string;
/**
 * Read every routine one DotAgents repo declares.
 *
 * Reads exactly `<root>/routines/`, never the layered `listJobs` — `collectRepoKind`
 * is a single-root view, and returning `~/.agents` routines while inspecting a
 * project repo would be a lie. `live` is injectable because `getUserAgentsDir()`
 * and `getRunsDir()` have no env override, so tests cannot otherwise keep this
 * off the developer's real fleet state.
 */
export declare function collectRepoRoutines(repo: RepoTarget, live?: (name: string) => RoutineLiveState, now?: Date): ResourceItem[];
/** Recursive size + file count of a path; symlinks are not followed. */
export declare function pathSize(p: string): {
    bytes: number;
    files: number;
};
/** Human byte size: "84 KB", "3.1 MB". */
export interface ManifestSummary {
    /** `run.<agent>.strategy` pairs from agents.yaml. */
    strategies: Array<{
        agent: string;
        strategy: string;
    }>;
    /** `agents.<agent>` version pins from agents.yaml, when present. */
    versions: Array<{
        agent: string;
        version: string;
    }>;
}
/** Parse the repo's own agents.yaml into the version pins + run strategies it declares. */
export declare function repoManifestSummary(root: string): ManifestSummary | null;
export interface RepoGitInfo {
    branch: string;
    dirty: number;
    dirtyFiles: string[];
    url: string | null;
    lastCommit: {
        sha: string;
        subject: string;
        relative: string;
    } | null;
    ahead: number | null;
    behind: number | null;
}
export declare function repoGitInfo(root: string): RepoGitInfo | null;
/**
 * The scannable half of a description: everything before the trigger clause, and
 * only the first sentence of that. 15 of 20 skills in .system lead with their
 * purpose and then append "Triggers on: …" — in a one-line row that boilerplate
 * is what survives truncation, so the row says nothing. The full text still
 * renders in the preview pane.
 */
export declare function summaryLine(description: string): string;
/**
 * The preview pane for one row, refreshed as the selection moves.
 *
 * Adaptive on purpose — the sessions picker sets the precedent: a Cursor
 * session shows Dirs/Repos/Artifacts, a Codex one shows a different set, and
 * empty fields simply do not render. A hook's useful metadata (what fires it,
 * whether it is wired) has nothing in common with a skill's (what invokes it,
 * where it is synced), so each kind contributes its own rows and blanks drop out.
 */
export declare function previewFor(kind: DrillableKind, item: ResourceItem, hookManifest: Map<string, ManifestHook>): string;
/**
 * Compact one-liner for a hook from its manifest entry: the firing events (with
 * the matcher/tool-name in parens), then a `·`-separated predicate summary, then
 * an optional cache tail. Plain text — the caller applies color.
 */
export declare function summarizeHook(hook: ManifestHook): string;
/** Compact one-liner for an MCP server: padded transport + the url (http) or command line (stdio). */
export declare function summarizeMcp(cfg: McpYamlConfig): string;
/**
 * Index a hook manifest by script basename (no extension). Installed hooks are
 * named after their script file (`04-capture-…`), while the manifest is keyed by
 * logical name (`capture-…`) with the filename in `script:` — so we join on the
 * script basename, not the manifest key.
 */
export declare function hookManifestByScript(manifest: Record<string, ManifestHook>): Map<string, ManifestHook>;
/**
 * Health tier for the section ordering. Lower sorts first.
 *
 * `printExpandedSection` shows only the first handful before a `…(+N)` tail, so
 * for a repo with 24 routines the sort IS the section. Same reasoning as
 * `hookRows` putting wired hooks first: a routine that fires nowhere is exactly
 * what the reader opened this for, and must never hide behind the tail.
 */
export declare function routineHealthTier(item: ResourceItem): number;
/**
 * The one-line warning under the Routines section, or null when it would mislead.
 *
 * Silent until some device has materialized a `routines:` list — before that,
 * every routine is legitimately unpinned and "will not fire" would be noise.
 */
export declare function routineDarkWarning(items: ResourceItem[]): string | null;
/** Read a repo/agents.yaml `hooks:` section into a name→ManifestHook map (best-effort). */
export declare function hookManifestFromFile(agentsYamlPath: string): Record<string, ManifestHook>;
export {};
