import type { Policy } from "@iota-policy/core"; export type BlessDecision = "approved" | "rejected"; export interface ApprovedVersion { sha256: string; decidedAt: string; /** Exact approved text — parseable, so it can keep governing as a fallback. */ text: string; } export interface BlessRecord { sha256: string; decision: BlessDecision; decidedAt: string; /** Exact policy text the decision was made on — enables diff on re-bless. */ text: string; /** * The last APPROVED version, preserved across rejections of later * versions. This is the continuity anchor: when the file changes under * you (e.g. a git pull in a shared repo), the version you approved keeps * governing until you approve a new one — an unapproved edit can never * downgrade you from "governed" to "ungoverned". */ lastApproved?: ApprovedVersion; } export interface BlessStore { version: 1; entries: Record; } export type BlessStatus = { kind: "approved"; } /** Current file was rejected; fallback = last approved version, if any. */ | { kind: "rejected"; fallback?: ApprovedVersion; } /** File differs from the decided version; previous enables a diff, fallback keeps governing. */ | { kind: "stale"; previous: BlessRecord; fallback?: ApprovedVersion; } | { kind: "unblessed"; }; export declare function defaultBlessStorePath(): string; export declare function readBlessStore(storePath: string): BlessStore; export declare function blessStatus(store: BlessStore, policyPath: string, sha256: string): BlessStatus; export declare function recordBless(storePath: string, policyPath: string, sha256: string, decision?: BlessDecision, text?: string): void; /** * Line diff for the re-bless prompt: what left, what arrived. Order-aware * enough for policy review (multiset line comparison), deliberately not a * full LCS — policies are small and the goal is "what changed", not patch * fidelity. */ export declare function diffPolicyText(oldText: string, newText: string): string; /** * Human-readable grant summary for the bless prompt. Every best_effort * pattern is called out — this is the built-in review moment (SPEC §8.2). */ export declare function summarizePolicy(policy: Policy): string;