import { type SyncAgent } from "./agent-sync.js"; /** * The wire schema of the per-station hydration manifest; keeps the * fleet-resources spelling for the same wire-compat reason as the * sync-manifest. */ export declare const STATION_HYDRATION_MANIFEST_SCHEMA = "hasna.fleet-resources.skills-hydration-manifest/v1"; /** Package identity recorded in the manifest's producer field. */ export declare const STATION_HYDRATION_PRODUCER: { name: string; version: string; }; export interface HydrationCandidate { ident: string; agent: SyncAgent; /** Ident-relative portable path, e.g. `scripts/run.sh`. */ withinIdent: string; fullPath: string; size: number; mtimeMs: number; /** The manifest's recorded sha256 for (agent, home-relative path), if any. */ manifestHash: string | null; /** True when the candidate's bytes hash to the manifest record (verified match). */ verified: boolean; } export interface HydrationWinnerFile { withinIdent: string; winner: HydrationCandidate; /** The losing copies' agents, for reporting. */ alternates: SyncAgent[]; } export interface HydrationWinnerSkill { ident: string; files: HydrationWinnerFile[]; } export interface StationHydrationOptions { stationId: string; /** Repo root holding resources//skills and its sync-manifest. */ repoRoot?: string; /** Destination corpus cache; defaults to the canonical corpus root. */ cacheRoot?: string; /** Report without writing anything (the default, as in the source script). */ dryRun?: boolean; } export interface StationHydrationResult { stationId: string; mode: "dry-run" | "apply"; cacheRoot: string; snapshotRoot: string; sourceSnapshotSha: string; stats: { idents: number; files: number; bytes: number; written?: number; unchanged?: number; }; /** The full winner plan, for reporting (never written to the manifest). */ winners: HydrationWinnerSkill[]; /** The manifest payload shape: per-skill files plus the skill's sha256. */ skills: Array<{ ident: string; files: Array<{ relativePath: string; sourceAgent: SyncAgent; sourceMtimeMs: number; size: number; }>; sha256: string | null; }>; manifestPath?: string; } interface SnapshotManifestFile { relativePath: string; agent: string | null; sha256: string; } interface SnapshotManifest { files?: SnapshotManifestFile[]; } interface HydrationPlan { manifest: SnapshotManifest; sourceSnapshotSha: string; winners: HydrationWinnerSkill[]; skippedByRule: Array<{ ident: string; agent: SyncAgent; relativePath: string; reason: string; }>; totalFiles: number; totalBytes: number; } /** * Build the dedup winner plan from the snapshot. Fails closed on symlinks and * on a missing or unreadable sync-manifest. */ export declare function planStationHydration(stationId: string, repoRoot: string): HydrationPlan; /** * Run the hydration. Dry-run reports and writes nothing; apply detects * conflicts across the whole plan first and only then writes, so the terminal * refusal genuinely writes nothing. */ export declare function writeStationHydration(options: StationHydrationOptions): StationHydrationResult; export {};