export { R as RenderCheckIssue, a as RenderCheckResult, r as runRenderCheck } from '../../../render-check-WfOVO9kU.js'; import { WireConfig } from '@ggui-ai/wire'; import { JsonObject, DataContract } from '@ggui-ai/protocol'; import { RuntimeRenderCheck } from '../../types-public.js'; import '../../../axes-CzLEMDeB.js'; import '../../../types-public-DIpjC-OA.js'; import '../../../types-BOvHNG7K.js'; import '../../../llm.js'; import '../../../policy.js'; interface ActionFiredEvent { readonly kind: "action.fired"; readonly name: string; readonly payload?: unknown; readonly ts: number; } /** * A `ui/open-link` envelope was emitted toward the parent — fired when * the iframe-runtime's anchor interceptor catches an external link * click and routes through the host. CHECK tier observes this when * the generated component renders a plain ``. */ interface LinkOpenedEvent { readonly kind: "link.opened"; readonly url: string; readonly ts: number; } /** * A `ui/request-display-mode` envelope was emitted toward the parent * — fired when the iframe-runtime's native-API interceptor catches * a `requestFullscreen()` / `exitFullscreen()` call and routes it * through the host. */ interface DisplayModeRequestedEvent { readonly kind: "displayMode.requested"; readonly mode: string; readonly ts: number; } type ProbeEvent = ActionFiredEvent | LinkOpenedEvent | DisplayModeRequestedEvent; interface RegisteredHooks { /** Stream event names that received at least one subscribe() call. */ readonly streams: readonly string[]; } interface Probe { /** Push a stream event payload. Calls all current subscribers for `eventName`. */ emitStream(eventName: string, payload: T): void; getFireLog(): readonly ProbeEvent[]; getRegistered(): RegisteredHooks; /** Convenience: did any action.fired event match this name? */ fired(actionName: string): boolean; /** * Install a spy on `window.parent.postMessage` so envelopes emitted * by the iframe-runtime interceptors (anchor click → `ui/open-link`, * `requestFullscreen()` → `ui/request-display-mode`) are recorded * into the probe's fire log. Returns an uninstall function. * * Safe to call multiple times — each call replaces the previous spy. * The render-check harness installs the spy at render boot and * uninstalls during teardown. */ installPostMessageSpy(): () => void; reset(): void; } interface ProbeInternals { fireLog: ProbeEvent[]; streamHandlers: Map void>>; registeredStreams: Set; } declare function createProbe(): Probe & { /** @internal — used by createProbeWireConfig to share state. Do not call from tests. */ __internals: ProbeInternals; }; /** * Build a WireConfig backed by the given Probe. Use as the `config` prop of * GguiWireProvider in render-check tests. * * The WireConfig holds a closure over `probe.__internals` so that calls from * inside the React tree (via the real useAction/useStream/etc. hooks) flow * straight into the same probe state the test inspects from outside. */ declare function createProbeWireConfig(probe: Probe & { __internals: ProbeInternals; }): WireConfig; interface MockupPropsResult { /** The synthesized props object — pass directly into render(). */ readonly props: JsonObject; /** How each field was sourced — useful for debugging eval failures. */ readonly source: Readonly>; /** Synthesis warnings (missing required fields, unsupported schemas, etc.). */ readonly warnings: readonly string[]; } type MockupSource = "fixture" | "entry-example" | "entry-default" | "schema-default" | "schema-example" | "schema-enum" | "schema-synth" | "empty"; interface PrepareMockupInput { readonly contract: DataContract | undefined; /** * Pre-supplied fixture props (e.g., from a benchmark commit's `props` field). * Wins over schema synthesis when keys match. */ readonly fixtureProps?: JsonObject; } /** * Synthesize a JsonObject of props matching the contract.propsSpec shape. * * Deterministic — no LLM call. Returns even if the contract is missing * (in which case `props` is just the fixtureProps or `{}`). */ declare function prepareMockupProps(input: PrepareMockupInput): MockupPropsResult; declare const DEFAULT_RUNTIME_RENDER_CHECK: RuntimeRenderCheck; declare function isRecoverableRenderCrash(reason: string): boolean; declare function classifyRenderCrashFix(reason: string): string; /** * Pre-warm the runtime-render probe's runtime dependencies so the first * actual probe call hits a warm Node module cache. * * The probe lazily loads `happy-dom`, `@testing-library/react`, * `@testing-library/user-event`, and `@ggui-ai/wire` on first invocation * — total cold cost ~700-1500ms. Bench runners can call this once at * startup to amortize that cost; subsequent per-cell probe calls fall * to ~50-200ms. * * Resolves these specifiers from THIS module's filesystem location, so * Node walks up from `packages/ui-gen/dist/harness/check/runtime-render/` * to find them in `packages/ui-gen/node_modules/...`. Bench callers * cannot pre-import them directly — they aren't in the bench package's * own `node_modules`. * * Fire-and-forget. If a dep is missing the per-cell probe will surface * the error on first use; pre-warm just no-ops on import failure. * * Returns the wall-clock spent loading. */ declare function warmupRuntimeRenderProbe(): Promise<{ ms: number; loaded: number; missing: number; }>; export { DEFAULT_RUNTIME_RENDER_CHECK, type MockupPropsResult, type Probe, classifyRenderCrashFix, createProbe, createProbeWireConfig, isRecoverableRenderCrash, prepareMockupProps, warmupRuntimeRenderProbe };