/** * Pre-existing file classification for `opensip init`. * * Walks `opensip-cli/` (skipping `.runtime/`) and tags each file as * 'scaffolded', 'stale-scaffolded', or 'custom' so `--keep` / `--remove` * can decide what to overwrite and what to preserve. */ import type { InitAuthoredSnapshotRecord } from './init-authored-plan-types.js'; import type { SupportedLanguage } from './language-detection.js'; import type { RenderedToolScaffold, ToolScaffold } from '../shared.js'; import type { PreExistingFile } from '@opensip-cli/contracts'; import type { ProjectPaths } from '@opensip-cli/core'; /** * Walk every authored file under `opensip-cli/` (excluding runtime, dependency, * and generated-output directories) and tag each one. * * Classification rules: * * - 'scaffolded' — content matches a current-template byte-for-byte. * - 'stale-scaffolded' — file shape matches a previous-language scaffold: * filename `example-check-.mjs` for * NOT in the current detection set, OR the file * carries a pinned EXAMPLE_CHECK_IDS UUID for a * language not in the current set. * - 'custom' — anything else (user-authored). * * The walk is bounded to the `opensip-cli/` subtree and deliberately avoids * following symlinks. The `.runtime/` subdir is skipped so caches/logs/sessions * don't pollute the file list; generated directories such as node_modules, * dist, coverage, and .turbo are skipped for the same reason. * * Note on hash-based scaffolded detection: a scaffolded file that has * been line-ending normalized (CRLF↔LF) or stripped of a trailing * newline by an editor will not byte-for-byte match the template. In * that case it falls back to 'custom' or 'stale-scaffolded' (when the * UUID still matches but content drifted). The UUID-based fallback * catches the common "stale language" case; cosmetic drift on a * current-language file is treated as custom — which is the safer * outcome (won't silently overwrite). */ export declare function classifyFiles(paths: ProjectPaths, currentLanguages: readonly SupportedLanguage[], toolScaffolds: readonly ToolScaffold[]): PreExistingFile[]; /** * Classify authored files from a callback-free scaffold snapshot. The durable * Init planner can evaluate Tool hooks once and reuse the exact rendered files * for config generation, planning, and stale-file classification. */ export declare function classifyFilesFromRenderedScaffolds(paths: ProjectPaths, currentLanguages: readonly SupportedLanguage[], toolScaffolds: readonly RenderedToolScaffold[]): PreExistingFile[]; /** * Classify the exact authored bytes captured by the durable Init snapshot. * * This is the planner-facing counterpart to the filesystem walker above. It * deliberately performs no filesystem I/O: presentation must describe the * same bounded preimage used to construct the replay plan, even if a customer * path changes after snapshot capture. Generated-output subtrees retain the * same exclusions as the legacy walker. */ export declare function classifySnapshotFilesFromRenderedScaffolds(paths: ProjectPaths, currentLanguages: readonly SupportedLanguage[], toolScaffolds: readonly RenderedToolScaffold[], records: ReadonlyMap): PreExistingFile[]; //# sourceMappingURL=file-classifier.d.ts.map