/**
 * Unified resource discovery for agents.
 * Scans filesystem (source of truth) to find all installed resources for an agent.
 */
import type { AgentId } from './types.js';
import { type SkillParseError } from './plugins/skills.js';
/** Resource kind — matches the subdirectory name under each repo root. */
export type ResourceKind = 'commands' | 'skills' | 'hooks' | 'rules' | 'mcp' | 'clis' | 'permissions' | 'subagents' | 'workflows' | 'profiles' | 'routers' | 'secrets';
/** A resource resolved with its origin. */
export interface ResolvedResource {
    name: string;
    /** Absolute path to the resource file or directory. */
    path: string;
    /**
     * Source layer: 'project' | 'user' | 'system' for built-in layers,
     * or the alias name (e.g. 'rush') for extra repos registered in agents.yaml.
     */
    source: string;
    /**
     * Absolute path to the DotAgents repo root this resource resolved from (the
     * project/user/system/extra-repo dir — one level above the `kind`
     * subdirectory). DotAgents repos are git-tracked (plugins.ts), so this pairs
     * with {@link snapshotSha} to answer "which commit of which repo".
     */
    repoRoot: string;
    /**
     * Short HEAD sha of `repoRoot`'s git checkout, lazily resolved (a getter,
     * not computed at construction) and memoized per repoRoot
     * (`git.ts` `resolveSnapshotSha`) — a caller that never inspects provenance
     * never pays for the git shell-out, and resolving many resources from the
     * same repo pays for exactly one. `undefined` when `repoRoot` isn't a git
     * repo (or has no commits).
     */
    readonly snapshotSha: string | undefined;
    /**
     * Alternate names this resource declares in its frontmatter `aliases:`, which
     * {@link resolveResource} matches in addition to the canonical name. Lazily
     * read from disk on first access and memoized, so listing resources never pays
     * for it unless a caller inspects an alias. `undefined` when the resource
     * declares none (or for a kind that doesn't support aliases — only `skills` and
     * `commands` do), mirroring {@link snapshotSha} so a strict `toEqual` on a
     * ResolvedResource ignores the absent field.
     */
    readonly aliases: string[] | undefined;
}
/**
 * The declared frontmatter `aliases:` of a single resource, or `[]` for a kind
 * that doesn't support aliases. Only `skills` (SKILL.md) and `commands` carry
 * them today. `resourcePath` is the skill directory or the command file.
 */
export declare function resourceAliases(kind: ResourceKind, resourcePath: string): string[];
/**
 * True when `rawName` (a filename with its extension already stripped) names a
 * directory doc rather than a resource of `kind`. Exported so every enumerator
 * shares one definition — `listCentralCommands` and `discoverCommands` in
 * `commands.ts` do their own `readdirSync` scans, and without this they would
 * list a `README` that `resolveResource` then refuses to open.
 */
export declare function isDirectoryDoc(kind: ResourceKind, rawName: string): boolean;
/**
 * Resolve a single resource by kind + name using project > user > system precedence.
 * For file-based resources the path ends in `.md`, `.yaml`, or `.yml` as appropriate.
 * Returns null when the resource does not exist in any scope.
 *
 * Extra repos are searched last (after system) to match syncResourcesToVersion order.
 */
export declare function resolveResource(kind: ResourceKind, name: string, cwd?: string): ResolvedResource | null;
/**
 * List all resources of a given kind across project, user, and system scopes.
 * Returns a deduplicated union (project wins on name collision), each entry
 * annotated with its origin source.
 */
export declare function listResources(kind: ResourceKind, cwd?: string): ResolvedResource[];
/** A single installed resource (command, skill, memory file, or hook). */
export interface ResourceEntry {
    name: string;
    path: string;
    scope: 'user' | 'project';
    /** One-line description pulled from frontmatter; not all resource kinds have one. */
    description?: string;
}
/** A skill resource entry with optional rule count. */
export interface SkillResourceEntry extends ResourceEntry {
    ruleCount?: number;
}
/** An MCP server resource entry. */
export interface McpResourceEntry {
    name: string;
    scope: 'user' | 'project';
    version?: string;
}
/** All resources installed for a specific agent. */
export interface AgentResources {
    agentId: AgentId;
    commands: ResourceEntry[];
    skills: SkillResourceEntry[];
    skillErrors: SkillParseError[];
    mcp: McpResourceEntry[];
    memory: ResourceEntry[];
    hooks: ResourceEntry[];
    workflows: ResourceEntry[];
}
/** Options for resource discovery. */
export interface GetAgentResourcesOptions {
    cwd?: string;
    scope?: 'user' | 'project' | 'all';
    /** For MCP scanning - whether the CLI is installed */
    cliInstalled?: boolean;
    /** Version home to scan for user-scoped resources */
    home?: string;
}
/**
 * Get all resources installed for a specific agent by scanning the filesystem.
 * This is the source of truth - not the tracking data in agents.yaml.
 */
export declare function getAgentResources(agentId: AgentId, options?: GetAgentResourcesOptions): AgentResources;
