/** * Composite snapshot for verify-fix loops: capture a memgraph + screenshot + * UI tree from the current simulator state into one labeled bundle. The * intended workflow is `captureScenarioState({label:"before"})` → run a fix * (or further repro via replayScenario) → `captureScenarioState({label:"after"})` * → diffMemgraphs across the two outputs. * * Each sub-capture (memgraph, screenshot, uiTree) is best-effort: if one * fails, the others still proceed and the failure is surfaced via * `subFailures` so the caller has partial state instead of nothing. */ import { z } from "zod"; import { type WorkaroundNotice } from "./captureMemgraph.js"; import { type PlatformAdvisory } from "../runtime/platformCheck.js"; export declare const captureScenarioStateShape: { readonly simulatorUDID: z.ZodString; readonly pid: z.ZodOptional; readonly appName: z.ZodOptional; readonly outputDir: z.ZodString; readonly label: z.ZodDefault; readonly include: z.ZodDefault, "many">>; }; export declare const captureScenarioStateSchema: z.ZodEffects; readonly appName: z.ZodOptional; readonly outputDir: z.ZodString; readonly label: z.ZodDefault; readonly include: z.ZodDefault, "many">>; }, "strip", z.ZodTypeAny, { outputDir: string; label: string; simulatorUDID: string; include: ("screenshot" | "memgraph" | "uiTree")[]; pid?: number | undefined; appName?: string | undefined; }, { outputDir: string; simulatorUDID: string; pid?: number | undefined; appName?: string | undefined; label?: string | undefined; include?: ("screenshot" | "memgraph" | "uiTree")[] | undefined; }>, { outputDir: string; label: string; simulatorUDID: string; include: ("screenshot" | "memgraph" | "uiTree")[]; pid?: number | undefined; appName?: string | undefined; }, { outputDir: string; simulatorUDID: string; pid?: number | undefined; appName?: string | undefined; label?: string | undefined; include?: ("screenshot" | "memgraph" | "uiTree")[] | undefined; }>; export type CaptureScenarioStateInput = z.infer; export interface CaptureScenarioSubFailure { kind: "memgraph" | "screenshot" | "uiTree"; reason: string; } export interface CaptureScenarioStateResult { ok: boolean; label: string; outputDir: string; memgraphPath?: string; screenshotPath?: string; uiTreePath?: string; /** Surfaced from captureMemgraph when leaks fails with a known issue. */ memgraphWorkaroundNotice?: WorkaroundNotice; subFailures: CaptureScenarioSubFailure[]; warnings?: string[]; /** * Present on hosts where a platform-side regression affects the memgraph * sub-capture (today: macOS 26.x `task_for_pid` kernel regression). * Surfaced even when the screenshot + uiTree sub-captures succeed, so the * caller knows the memgraph failure is not a misconfiguration on their end. */ platformAdvisory?: PlatformAdvisory; } export declare function captureScenarioState(input: CaptureScenarioStateInput): Promise; /** Pure: replace filesystem-unsafe characters in a label. Exposed for tests. */ export declare function sanitizeLabel(label: string): string;