{"version":3,"sources":["../../../../src/server/app-render/dev-validation-events.ts"],"sourcesContent":["/**\n * The lifecycle events Cache Components validation emits so E2E tests can\n * locate the validation window in the CLI output. Each is serialized between\n * `<VALIDATION_MESSAGE>` delimiters (see `formatValidationEvent`) and parsed\n * back by the test harness. Produced by the in-process validation in\n * `app-render.tsx` (both dev and build) and by the validation worker, which is\n * why the shape lives here rather than in a single producer.\n *\n * `requestId` correlates a start with its matching end/aborted. Dev and worker\n * validation use the render's request id; build validation, which has no such\n * id, uses a stringified timestamp instead.\n */\nexport type ValidationEvent =\n  | ValidationStartEvent\n  | ValidationEndEvent\n  | ValidationAbortedEvent\n\nexport type ValidationStartEvent = {\n  type: 'validation_start'\n  requestId: string\n  url: string\n  /**\n   * Only reported for development validation.\n   */\n  responseFinished?: boolean\n}\n\nexport type ValidationEndEvent = {\n  type: 'validation_end'\n  requestId: string\n  url: string\n}\n\n/**\n * Emitted when detached validation is aborted. It can appear without a start\n * when cancellation happens before validation runs, or after a start instead of\n * an end when in-flight validation is cancelled.\n */\nexport type ValidationAbortedEvent = {\n  type: 'validation_aborted'\n  requestId: string\n  url: string\n}\n\n/**\n * Wraps a validation event in the `<VALIDATION_MESSAGE>` delimiters the test\n * harness scans for. The caller chooses the output stream (dev validation logs\n * to stdout; build validation uses stderr for deterministic ordering).\n */\nexport function formatValidationEvent(event: ValidationEvent): string {\n  return (\n    '<VALIDATION_MESSAGE>' + JSON.stringify(event) + '</VALIDATION_MESSAGE>'\n  )\n}\n"],"names":["formatValidationEvent","event","JSON","stringify"],"mappings":"AAAA;;;;;;;;;;;CAWC,GAiCD;;;;CAIC,GACD,OAAO,SAASA,sBAAsBC,KAAsB;IAC1D,OACE,yBAAyBC,KAAKC,SAAS,CAACF,SAAS;AAErD","ignoreList":[0]}