/** * AI-resources discovery — finds ai-assets directories and monorepo root * by walking upward from a starting directory. */ /** * Directory names that hold assets of a kind directly under a content root * (the *flat* layout, e.g. `/skills/…`). They are never domain folders in * the *domain-nested* layout (`//skills/…`). The single source of * truth shared by every asset/flow walker so the two layouts are recognised * identically everywhere. * * @docLink packages/core/concepts#asset-layout */ export declare const ASSET_KIND_DIRS: ReadonlySet; /** * Resolve the directories to search for `kind` assets under a content `root`, * covering both layouts: the flat `//` and each domain-nested * `///`. Each entry carries its domain label (the root's * own basename for the flat layout, the subdir name for nested). Existence is * NOT checked — callers `existsSync`/read each dir. Dot-dirs, `node_modules`, * `external`, `tests`, and {@link ASSET_KIND_DIRS} are never treated as domains. * * The one layout primitive behind `findSkills`, `loadAllFlows`, and * `findFlowFile`; adding a *content-root* layout or asset kind is a change here * only. Layouts **within** a search dir are the walker's own business — flows, * for instance, also accept a per-flow directory (`flows//.flow.yaml`), * which lives in the flow loader. * * @docLink packages/core/concepts#asset-layout */ export declare function assetSearchDirs(root: string, kind: string): Array<{ dir: string; domain: string; }>; /** * Walk upward from `startDir` to find an `ai-assets/` subdirectory. * * @param startDir - Starting directory for the upward walk * @param maxLevels - Maximum number of parent levels to check (default: 10) * @returns Absolute path to the `ai-assets/` directory, or `null` if not found * @docLink packages/core/concepts#detect-ai-resources */ export declare function detectAiResources(startDir: string, maxLevels?: number): string | null; /** * Walk upward from `startDir` to find the monorepo root directory. * Uses `pnpm-workspace.yaml` as the marker file. * * @param startDir - Starting directory for the upward walk * @param maxLevels - Maximum number of parent levels to check (default: 10) * @returns Absolute path to the monorepo root, or `null` if not found * @docLink packages/core/concepts#detect-monorepo-root */ export declare function detectMonorepoRoot(startDir: string, maxLevels?: number): string | null; /** * Detect all domain directories within an `ai-assets/` root. * A domain qualifies when it contains at least one of `skills/`, `flows/`, or `agents/`. * Directories starting with `.` and `node_modules` are excluded. * * @param aiResourcesDir - Absolute path to the `ai-assets/` root * @returns Sorted array of domain descriptors with `id`, `path`, and content flags * @docLink packages/core/concepts#detect-domains */ export declare function detectDomains(aiResourcesDir: string): Array<{ id: string; path: string; hasFlows: boolean; hasSkills: boolean; hasAgents: boolean; }>; //# sourceMappingURL=discovery.d.ts.map