/**
 * Detection utilities shared across framework detectors.
 */
import type { PackageJsonData, PackageManager } from './types.ts';
/**
 * Check if a file exists (any of the given names) in a directory.
 * Returns the first matching filename, or null.
 */
export declare function findFile(dir: string, names: string[]): Promise<string | null>;
/**
 * Check if a dependency exists in package.json (dependencies or devDependencies).
 */
export declare function hasDependency(pkg: PackageJsonData, name: string): boolean;
/**
 * Get the version of a dependency from package.json.
 * Returns the version range string, or null if not found.
 */
export declare function getDependencyVersion(pkg: PackageJsonData, name: string): string | null;
/**
 * Check if any dependency matching a pattern exists.
 */
export declare function hasDependencyMatching(pkg: PackageJsonData, pattern: RegExp): boolean;
/**
 * Match a shell command that, when executed, would invoke the agentuity
 * CLI itself. We use this to refuse to honor `package.json` scripts that
 * just shell out to `agentuity build` / `agentuity dev` (a leftover from
 * v2 scaffolds) — running them from inside `agentuity build` recurses
 * forever.
 *
 * Recognised forms (case-insensitive on the binary name):
 *
 *   agentuity ...
 *   ./node_modules/.bin/agentuity ...
 *   npx agentuity ... / npx --yes agentuity ... / npx -y agentuity ...
 *   bunx agentuity ... / bun x agentuity ...
 *   pnpm dlx agentuity ... / pnpm exec agentuity ...
 *   yarn agentuity ... / yarn dlx agentuity ...
 *
 * Leading `cross-env FOO=bar` / `FOO=bar` env-var prefixes are stripped
 * before matching so the check survives the usual real-world wrappers.
 */
export declare function isAgentuityCliInvocation(cmd: string | undefined | null): boolean;
/**
 * Detect which package manager the project uses by checking lockfiles.
 */
export declare function detectPackageManager(projectDir: string): Promise<PackageManager>;
/**
 * Get the run command prefix for a package manager.
 * e.g., 'npm run', 'bun run', 'pnpm run', 'yarn'
 */
export declare function getRunCommand(pm: PackageManager): string;
/**
 * Get the exec command prefix for a package manager (npx/bunx/etc.).
 */
export declare function getExecCommand(pm: PackageManager): string;
/**
 * Read and parse package.json from a directory.
 * Returns null if not found or unparseable.
 */
export declare function readPackageJson(dir: string): Promise<PackageJsonData | null>;
//# sourceMappingURL=util.d.ts.map