/** * Shared marker-path resolver for cross-system scan parity. * * Both the CLI's `scanLocalRepository` (filesystem walker) and the webapp's * `scanInfrastructureFiles` (GitHub tree API) need the same answer to: * * "Given a path, is it an `infrastructure.ts` inside a `fjall/` boundary, * and if so, what is its `configPath` + `boundaryPath`?" * * This module is the single source of truth for that resolution. Each * scanner is responsible for its own I/O (walk filesystem / list GitHub * tree); both hand the resulting iterable of `{ path }` entries to * `findInfrastructurePaths`, optionally pre-filtered via the options below. * * No I/O. Pure path classification. The structural contract is the function * signature; review-time agreement is not load-bearing. * * See the fjall-marker convention pattern for the convention and the * 2026-05-11 scan-parity decision (contract vs structural) for the * rationale behind extracting this module. */ import type { ScanPath } from "./scanTypes.js"; export declare const INFRASTRUCTURE_FILE = "infrastructure.ts"; export declare const MARKER_DIRECTORY = "fjall"; export interface MarkerEntry { /** POSIX-style path relative to the repo root. */ path: string; } export interface FindInfrastructurePathsOptions { /** * Reject entries whose path starts with any of these prefixes. Use for * exclusion sets that span subtrees (e.g. `"node_modules/"`, * `".fjall/history/"`). Each prefix MUST end with `/` to keep the match * directory-aware. */ excludedPathPrefixes?: readonly string[]; /** * Reject entries that include any of these path segments anywhere in their * path (excluding the filename segment). Use for build-output directories * the consumer's I/O layer cannot prune at walk time (e.g. `"dist"`, * `".turbo"`). Match is segment-exact. */ excludedPathSegments?: ReadonlySet; } /** * Resolve an iterable of repo-relative paths to the subset that are * `infrastructure.ts` files inside a `fjall/` boundary. Returns one * `{ configPath, boundaryPath }` per match. * * Boundary rule: the **leftmost** path segment named exactly `fjall` wins. * Nested `fjall/` folders inside the boundary do not redefine it. * * The caller is responsible for any cap or ranking; this function applies * neither. Exclusion via `options` is OPTIONAL — consumers that pre-filter * at their I/O layer may omit it. */ export declare function findInfrastructurePaths(entries: Iterable, options?: FindInfrastructurePathsOptions): ScanPath[]; export declare function isInfrastructureFile(path: string): boolean; /** * Return the path to the leftmost `fjall/` ancestor, or `null` if the path * does not cross a `fjall/` boundary. The result excludes the file segment. */ export declare function findBoundaryPath(path: string): string | null;