import type { Client } from "@libsql/client"; import { type MeshRow } from "../registry/meshes-repo.js"; import { type GitRunner as OriginGitRunner } from "./repair-vault-origin-owner.js"; import { type GitExecutor } from "../util/git-history.js"; export type RepairMode = "dry-run" | "apply"; export type RepairActionKind = "remove-edge" | "restore-mesh-yon-from-git" | "reattach-orphan-vault" | "reconcile-mesh-link" | "rebuild-vault-index" | "migrate-agent-files" | "reconnect-pod" | "inspect-pod-origin" | "repoint-origin-owner"; export type RepairFindingClass = "broken-mesh-edge" | "mesh-yon-parse-error" | "orphan-vault" | "mesh-link-drift" | "corrupt-vault-index" | "legacy-agent-files" | "missing-pod-origin" | "noncanonical-pod-origin" | "mis-owned-origin"; export interface RepairFinding { class: RepairFindingClass; meshName: string; targetId: string; reason: string; remediation: string; details: Record; } export interface RepairAction { kind: RepairActionKind; meshName: string; targetId: string; status: "applied" | "skipped" | "error"; message: string; details: Record; } export interface RepairArgs { target?: string | undefined; mesh?: string | undefined; mode?: RepairMode | undefined; fromRevision?: string | undefined; registryDb?: Client | undefined; gitExecutor?: GitExecutor | undefined; originRunGit?: OriginGitRunner | undefined; } export interface RepairResult { mode: RepairMode; findings: RepairFinding[]; actions: RepairAction[]; summary: { findingsCount: number; actionsApplied: number; actionsSkipped: number; actionsErrored: number; }; exitCode: 0 | 2; durationMs: number; } export declare class RepairTargetNotFoundError extends Error { readonly errorCode = "repair-target-not-found"; readonly target: string; constructor(target: string); } export declare class GitHistoryEmptyError extends Error { readonly errorCode = "git-history-empty"; readonly meshName: string; constructor(meshName: string); } export declare class RestoreParseFailedError extends Error { readonly errorCode = "restore-parse-failed"; readonly meshName: string; readonly sha: string | null; readonly parseCause: string; constructor(meshName: string, sha: string | null, parseCause: string); } export declare class OrphanReattachMeshNotFoundError extends Error { readonly errorCode = "orphan-reattach-mesh-not-found"; readonly meshName: string; constructor(meshName: string); } export declare class OrphanReattachMissingArgError extends Error { readonly errorCode = "orphan-reattach-missing-mesh"; constructor(); } export declare function repairFlow(args?: RepairArgs): Promise; export declare function applyRemoveEdge(_db: Client, f: RepairFinding): Promise; export declare function resolveTargetMeshOrThrow(db: Client, meshName: string): Promise; export declare function resolveVaultTarget(db: Client, target: string): Promise<{ ridHex: string; name: string; } | null>; export declare function listRegisteredMeshNames(db: Client): Promise; //# sourceMappingURL=repair.d.ts.map