/** Artifact-index types that map to a catalog layout directory. */ declare const CATALOG_TYPES: readonly ["skills", "references", "mcp", "plugins", "roots", "hooks"]; type CatalogType = (typeof CATALOG_TYPES)[number]; export interface DiscoveredCatalog { /** Absolute path to the catalog directory. */ path: string; /** Path relative to the discovery anchor. */ relPath: string; /** Artifact types found under the catalog that match the `/.json` layout. */ types: CatalogType[]; /** Count of entries per discovered type, for prompt summaries. */ entryCounts: Partial>; } export interface DiscoveredLooseIndex { /** Artifact type inferred from the filename and/or `$schema`. */ type: CatalogType; /** Absolute path to the index file. */ path: string; /** Path relative to the discovery anchor. */ relPath: string; /** Count of top-level entries in the index (excluding `$schema`). */ entryCount: number; } export interface DiscoveredAirJson { /** Absolute path to the air.json file. */ path: string; /** Path relative to the discovery anchor. */ relPath: string; } export interface DiscoveryResult { /** Absolute path to the directory discovery was anchored at (git root or fallback). */ anchor: string; /** Whether the anchor was determined via `git rev-parse` (true) or a cwd fallback (false). */ anchorIsGitRoot: boolean; /** Catalog directories — `//.json` layouts. */ catalogs: DiscoveredCatalog[]; /** Bare artifact index files that are not part of a full catalog layout. */ looseIndexes: DiscoveredLooseIndex[]; /** Nested `air.json` files. */ airJsons: DiscoveredAirJson[]; } export interface DiscoverIndexesOptions { /** Maximum walk depth below the anchor. Default: 3. */ maxDepth?: number; /** Override the skiplist. Default: common build/output dirs + node_modules/.git. */ skipDirs?: Set; } /** * Resolve the discovery anchor for a target directory. * Returns the git root when inside a repo, otherwise the target itself. */ export declare function resolveAnchor(targetDir: string): { anchor: string; isGitRoot: boolean; }; /** * Discover AIR index files and `air.json` configs under `targetDir`. * * Anchor is the enclosing git root (via `git rev-parse --show-toplevel`) * if one exists, else `targetDir` itself. Walks up to `maxDepth` levels * deep, skipping `node_modules/`, `.git/`, build output dirs, and anything * starting with `.`. Every candidate file is validated via filename-based * schema detection plus optional `$schema` cross-check; unparseable or * non-AIR JSON files are silently skipped. * * Files found via a catalog layout are excluded from `looseIndexes` — the * catalog entry already covers them. */ export declare function discoverIndexes(targetDir: string, options?: DiscoverIndexesOptions): DiscoveryResult; export type { CatalogType }; export { CATALOG_TYPES }; //# sourceMappingURL=discover-indexes.d.ts.map