/**
* Bounded downward scan for fjall projects in child directories.
*
* The complement of `findRepoRoot`: config discovery walks UP from the
* current directory, so a user sitting one level ABOVE their project (a
* container directory holding several checkouts) gets no signal that the
* project they meant is right below them. This scanner powers the
* "did you mean cd
?" guidance in CLI error messages.
*/
export interface DiscoveredProject {
/** Absolute path of the project directory (the one to cd into). */
projectDir: string;
/** Absolute path of the project's fjall-config.json. */
configPath: string;
/** The config's activeTarget, when the file is readable and carries one. */
activeTarget: string | undefined;
/**
* App directory names carrying an infrastructure.ts marker — direct
* subdirectories of the config's directory, plus one monorepo container
* level (`//fjall/`). Deeper nesting is not
* enumerated; the list is a sample, not a census.
*/
apps: string[];
}
export interface FindProjectsBelowOptions {
/** How many levels below startDir to descend (default 3). */
maxDepth?: number;
/** Total child directories to inspect before giving up (default 2000). */
maxDirectories?: number;
}
/**
* Find fjall projects strictly below `startDir`. A project is a directory
* containing `fjall/fjall-config.json` or a direct `fjall-config.json` —
* the same two shapes Config.loadConfig discovers when walking upward.
* Breadth-first with alphabetical siblings, so results are deterministic
* and shallower projects come first; found projects are not descended into.
*/
export declare function findProjectsBelow(startDir: string, options?: FindProjectsBelowOptions): Promise;
/**
* True when `dir` has the scaffolded app layout `fjall//infrastructure.ts`
* — the signal that config creation at `dir/fjall/fjall-config.json` lands in
* a real project rather than planting a stray file in an unrelated tree.
*/
export declare function hasFjallAppLayout(dir: string): Promise;