/** * GitWand Conflict Resolver — orchestration. * * Moteur de résolution automatique des conflits. Pour chaque hunk : * 1. applique la pénalité « zone chaude » (v1.4) si nécessaire, * 2. reclassifie les hunks complex en `generated_file` si le chemin matche, * 3. tente un résolveur format-aware (JSON/MD/YAML/Vue/CSS/imports…), * 4. à défaut, applique la politique de merge et le seuil de confiance, * 5. invoque le moteur textuel (`assembleResolution`), * 6. valide le contenu fusionné en sortie (marqueurs résiduels, JSON). * * Issu du split P1.1 de `resolver.ts`. Le fichier `packages/core/src/resolver.ts` * reste en place comme shim de re-export pour les consommateurs qui importent * `resolve` depuis `../resolver.js`. */ import type { GitWandOptions, MergeResult } from "../types.js"; import { type StructuralLoaderOptions } from "../structural/index.js"; /** * Analyse et résout automatiquement les conflits d'un fichier. * * @param conflictedContent - Le contenu du fichier avec marqueurs de conflit Git * @param filePath - Le chemin du fichier (pour le reporting) * @param userOptions - Options de configuration * @returns Le résultat de la résolution avec traces et validation */ export declare function resolve(conflictedContent: string, filePath: string, userOptions?: GitWandOptions): MergeResult; /** * Async variant of `resolve()` — attempts structural (AST-based) merge for * TypeScript/TSX files before falling back to the standard hunk-by-hunk engine. * Additionally runs parse-tree validation (v2.4) and optionally strict validation * (tsc/eslint) when `validationLevel: "strict"` is configured. * * Structural merge requires `web-tree-sitter` as an **optional** peer dependency. * If it is not installed, `resolveAsync()` behaves identically to `resolve()` with * the addition of the parse-tree validation pass. * * ### v2.4 — Parse-tree validation & retraction * * After hunk-based resolution produces a `mergedContent`, `resolveAsync()` re-parses * it with tree-sitter. If the tree contains ERROR nodes (indicating the merged code is * syntactically broken), every auto-resolved hunk is **retracted**: * * - `resolution.autoResolved` → `false` * - `resolution.resolvedLines` → `null` * - `hunk.confidence.dimensions.postMergeRisk` → `100` * - `validation.parseTreeValid` → `false` * - `mergedContent` → `null` (conflicts restored as markers) * * This eliminates the class of false-positives where the resolver auto-merged code * that compiles/runs fine locally but is syntactically invalid (e.g. from two hunks * interacting unexpectedly). * * @param conflictedContent - File content with Git conflict markers * @param filePath - File path (format detection + grammar selection) * @param userOptions - GitWand options (same as `resolve()`) * @param structuralOpts - Optional tree-sitter loader overrides */ export declare function resolveAsync(conflictedContent: string, filePath: string, userOptions?: GitWandOptions, structuralOpts?: StructuralLoaderOptions): Promise; //# sourceMappingURL=index.d.ts.map