export declare const NATIVE_DRIFT_RECEIPT_SCHEMA = "hasna.skills.native-drift-receipt.v1"; export declare const NATIVE_DRIFT_RECEIPT_DIRECTORY = "native-drift"; /** A native tool-policy refusal: denying a native payload skill is the * protection that keeps a drifted station safe, so it is never failed open. */ export declare class NativeSkillPolicyRefusal extends Error { } /** The skills-cli bridge itself could not be verified: it is missing or * modified, or the managed binding that names it is missing, incompatible or * no longer resolves. A tool call that would load the bridge is refused; a * prompt, session or subagent event fails open with NATIVE_DRIFT_BRIDGE_NOTICE. */ export declare class NativeBridgeIntegrityRefusal extends NativeSkillPolicyRefusal { } export declare function isNativeSkillDrift(error: unknown): error is Error; export declare function isNativeBridgeIntegrityRefusal(error: unknown): error is NativeBridgeIntegrityRefusal; /** Escape controls, format characters and line separators as \uXXXX so a path * from the file system cannot hide or reorder warning text, then bound it. */ export declare function boundedDriftReason(message: string, limit?: number): string; export declare function nativeDriftRepair(agent: string): string; /** One visible line: what happened, the bounded drift reason (it names the * changed path or copies), the repair command and the receipt path. */ export declare function nativeDriftWarning(agent: string, message: string, receiptPath: string | null): string; /** Fixed agent-facing notice for the turn whose Skills context was omitted. */ export declare const NATIVE_DRIFT_AGENT_NOTICE = "Skills context is unavailable for this turn because the station's native skill discovery changed; the change was reported to the operator. Continue the user's task. Load a selected skill explicitly with `skills load ` if one is needed, and do not load native skill copies."; /** Fixed agent-facing notice when the skills-cli bridge itself is unverified: * the bridge tool is refused this turn, so the agent uses the CLI instead. */ export declare const NATIVE_DRIFT_BRIDGE_NOTICE = "Skills context is unavailable for this turn because the station's skills-cli bridge could not be verified; the change was reported to the operator. Continue the user's task, but do not invoke the skills-cli native skill until it is repaired. Run the `skills` command directly (for example `skills load `) if a skill is needed, and do not load native skill copies."; export interface NativeDriftReceipt { schema: typeof NATIVE_DRIFT_RECEIPT_SCHEMA; agent: string; status: "active" | "cleared"; code: "NATIVE_SKILL_DRIFT"; event: string; promptBlocked: false; skillsContext: "omitted"; reason: string; reasonSha256: string; repair: string; firstSeenAt: string; lastSeenAt: string; occurrences: number; clearedAt?: string; } export declare function nativeDriftReceiptPath(dataDir: string, agent: string): string; /** Record or refresh the active receipt for this agent. Never throws: the * warning says when the receipt could not be recorded. */ export declare function recordNativeDriftReceipt(dataDir: string, agent: string, event: string, message: string, now?: Date): string | null; /** After a clean verification: mark an active receipt cleared, keeping its * history. Absent or already cleared receipts are left untouched. */ export declare function clearNativeDriftReceipt(dataDir: string, agent: string, now?: Date): void; /** Every readable receipt, for operators and monitors. */ export declare function readNativeDriftReceipts(dataDir: string): NativeDriftReceipt[]; /** The non-blocking envelope for drift, in each native adapter's own shape. */ export declare function nativeDriftFailOpen(dataDir: string, agent: string, event: string, nativeEvent: string, message: string, options?: { bridgeUnverified?: boolean; }): Record;