import { CardEnvelope, CardContext, CardEvent } from '../primitives/card-contract'; export declare const CARD_WIRE_PROTOCOL: "kitn-card"; export interface WireFrame { protocol: typeof CARD_WIRE_PROTOCOL; /** The NEGOTIATED contract version (set by the per-bridge packer). */ version: string; /** Per-bridge instance nonce (host-minted, echoed on every up-frame). */ nonce: string; message: M; } export type DownMessage = { dir: 'down'; kind: 'hello'; supportedVersions: string[]; } | { dir: 'down'; kind: 'render'; envelope: CardEnvelope; } | { dir: 'down'; kind: 'context'; context: CardContext; } | { dir: 'down'; kind: 'teardown'; }; export type UpMessage = { dir: 'up'; kind: 'ready'; acceptedVersion: string; capabilities?: { types?: string[]; }; } | { dir: 'up'; kind: 'event'; event: CardEvent; } | { dir: 'up'; kind: 'focus-edge'; edge: 'start' | 'end'; } | { dir: 'up'; kind: 'fault'; code: WireFaultCode; message: string; }; export type WireFaultCode = 'version-unsupported' | 'bad-frame' | 'render-failed' | 'origin-rejected'; export type WireMessage = DownMessage | UpMessage; export declare function createPacker(version: string, nonce: string): (message: M) => WireFrame; /** Structural + direction guard. Host calls with 'up', runtime with 'down'. * STRUCTURAL only — nonce/version equality + schema validation happen after. */ export declare function isCardWireFrame(data: unknown, expectedDir: 'up' | 'down'): data is WireFrame;