/** * Conflict-report markdown PARSER (sister to {@link writeConflictReport} in * `restore-conflict-report.ts`). * * Extracted from `packages/cleo/src/cli/commands/restore.ts` per the * AGENTS.md Package-Boundary Check (T9985 / E8-CLI-LAYERING). The parser is * a pure string transformation — it has no citty / process / fs deps — so it * belongs in core where it can be unit-tested without spinning up the CLI * and reused by any consumer (Studio routes, programmatic restore tooling, * scripts) that needs to read the `restore-conflicts.md` produced by the * T311 restore engine. * * @task T9985 * @epic T9985 (E8-CLI-LAYERING) * @saga T9977 (SG-WORKTRUNK-OWN) * @see packages/core/src/store/restore-conflict-report.ts — formatter (sister) */ /** * Canonical set of JSON config filenames that are valid restore-conflict * targets. Used by both the parser and by `cleo restore finalize` to * validate caller-supplied filenames. * * @public */ export declare const RESTORE_VALID_JSON_FILENAMES: ReadonlySet; /** * Filenames recognised by the conflict-report parser, as a union type so * downstream code can narrow safely. * * @public */ export type RestoreConflictFilename = 'config.json' | 'project-info.json' | 'project-context.json'; /** * A single field entry parsed from the conflict report. * * @public */ export interface ParsedResolution { /** Which section of the report this came from. */ section: 'auto' | 'manual'; /** The target JSON file on disk. */ filename: RestoreConflictFilename; /** Dot-separated field path (e.g. "hooks.preCommit"). */ fieldPath: string; /** The local (A) value, may be undefined if not present. */ localValue: unknown; /** The imported (B) value, may be undefined if not present. */ importedValue: unknown; /** The chosen resolution. */ resolution: 'A' | 'B' | 'manual-review'; } /** * Parse a backtick-quoted value from a markdown line such as: * `"openai"` → "openai" * `true` → true * `42` → 42 * _(not present)_ → undefined * * @public */ export declare function parseMarkdownValue(raw: string): unknown; /** * Set a value at a dot-separated path within a plain object tree, * creating intermediate objects as needed. * * @public */ export declare function setAtPath(obj: Record, dotPath: string, value: unknown): void; /** * Parse a restore-conflicts.md markdown report into an array of * {@link ParsedResolution} entries. * * The format produced by T357 is: * ``` * ## config.json * ### Resolved (auto-applied) * - `field.path` * - Local (A): `value` * - Imported (B): `value` * - Resolution: **A** * - Rationale: ... * ### Manual review needed * - `field.path` * - Local (A): `value` * - Imported (B): `value` * - Resolution: **manual-review** * - Rationale: ... * ``` * * @task T365 * @epic T311 * @public */ export declare function parseConflictReport(md: string): ParsedResolution[]; //# sourceMappingURL=restore-conflict-parser.d.ts.map