import type { DetectedFramework } from '../core/types.js'; interface PackageJson { name?: string; version?: string; description?: string; keywords?: string[]; dependencies?: Record; devDependencies?: Record; scripts?: Record; type?: string; main?: string; types?: string; exports?: unknown; bin?: string | Record; private?: boolean; workspaces?: string[] | { packages?: string[]; }; files?: string[]; } /** One app component discovered directly under the repo root. */ export interface SubdirStack { /** basename */ name: string; /** detectLanguage() of the subdir */ language: string; /** highest-confidence real-stack framework in the subdir (never Docker/CI/etc.) */ topFramework: string | null; frontend: boolean; backend: boolean; /** a real-stack framework (not infra) was detected — ranks it as the "primary" */ hasFramework: boolean; /** a "this dir IS the app" marker (manage.py / config.ru / bin/rails) */ appRoot: boolean; } /** Shallow (depth-1) scan for per-subdirectory app stacks. Feeds the polyglot * classifier + `main_language` aggregation. A dir counts only when it carries a * real language manifest. This is NOT monorepo tooling — it only exists to stop * a repo whose real stack lives in subdirs from falling to the `library` lie. */ export declare function detectSubdirStacks(dir: string): SubdirStack[]; /** Polyglot signal — ≥2 sibling app dirs, ≥2 distinct languages, a frontend AND * a backend among them. Returns the `# found:` evidence string, or null. */ export declare function detectPolyglotSignal(dir: string, pkg: PackageJson | null): string | null; /** Aggregate the polyglot `main_language` string — primary first (a framework- * bearing backend dir wins), deduped by language, roles annotated. * e.g. "Python (Django · backend); JavaScript (React · frontend); Go (service)" */ export declare function detectPolyglotLanguage(dir: string): string | null; /** Read and parse package.json from a directory */ export declare function readPackageJson(dir: string): PackageJson | null; /** Detect frameworks in a directory */ export declare function detectFrameworks(dir: string): DetectedFramework[]; /** Detect the primary language of a project from its manifests — `''` when * there is no evidence. */ export declare function detectLanguage(dir: string): string; /** Project-type detection result + rationale (the #found list). * Each `found` entry is a human-readable signal that contributed to the * classification — emitted as a YAML comment by `writeFaf` for transparency * ("Glass Hood" doctrine: the user sees WHY the cli classified as it did). */ export interface ProjectTypeDetection { type: string; /** Signals that matched, in order observed. */ found: string[]; } /** Detect the project type with rationale. The `found` list captures every * positive signal that contributed to the classification — used downstream * by `writeFaf` to render `# found: ` next to `type:` in the .faf. * * Priority order per v6.6.md doctrine (most-specific first). About is a * repo role (`about.represents`), not an app_type — never matches here. * Rule: SDK keyword takes priority (sdk wins over library/cli/wasm). */ export declare function detectProjectTypeWithRationale(dir: string): ProjectTypeDetection; /** Detect the project type for slot mapping. Backward-compatible wrapper — * returns just the type string. New code should prefer * `detectProjectTypeWithRationale` to access the `#found` rationale. */ export declare function detectProjectType(dir: string): string; /** Detect the runtime from a runtime file or manifest — `''` when there is * no evidence. */ export declare function detectRuntime(dir: string): string; /** Detect the package manager from repo facts — a manifest that implies one, * package.json's `packageManager` field, then a lockfile. `''` when there is * no evidence: a package.json alone does not say which manager installs it. */ export declare function detectPackageManager(dir: string): string; /** Detect CI/CD */ export declare function detectCicd(dir: string): string | null; /** Detect hosting platform — from a platform's own config file. A bare * Dockerfile is not one: it shows a container build, not where the app runs. */ export declare function detectHosting(dir: string): string | null; /** Detect SvelteKit adapter from svelte.config.js */ export declare function detectSvelteAdapter(dir: string): string | null; /** Detect build tool */ export declare function detectBuildTool(dir: string): string | null; /** Detect a list of important file paths for the `key_files` chunk. * Returns up to ~10 entries, ordered by canonical importance. */ export declare function detectKeyFiles(dir: string): string[]; /** Detect build/test/lint commands for the `commands` chunk. * Returns a Record mapping command name → shell command. */ export declare function detectCommands(dir: string, pkg: PackageJson | null): Record; /** Detect a tech-stack list for the `tech_stack` chunk. * Combines language + frameworks + runtime into a flat list of strings. */ export declare function detectTechStack(dir: string, pkg: PackageJson | null, frameworks: DetectedFramework[], language: string): string[]; export {};