diff --git a/src/domain/browserObservation.ts b/src/domain/browserObservation.ts index 257a1bb739..80639dbbfa 100644 --- a/src/domain/browserObservation.ts +++ b/src/domain/browserObservation.ts @@ -230,9 +230,9 @@ const inspectWebPageInputFacts = { include_storage_fingerprints: z.boolean().default(false), } as const; -const inspectWebPageWithoutSourceSchema = z.strictObject({ +const inspectWebPageShapeSchema = z.strictObject({ ...inspectWebPageInputFacts, - include_script_sources: z.literal(false).optional().default(false), + include_script_sources: z.boolean().default(false), }); const inspectWebPageWithSourceShapeSchema = z.strictObject({ @@ -240,9 +240,7 @@ const inspectWebPageWithSourceShapeSchema = z.strictObject({ include_script_sources: z.literal(true).default(true), }); -type InspectWebPageShape = - | z.output - | z.output; +type InspectWebPageShape = z.output; const refineInspectWebPageInput = ( input: InspectWebPageShape, @@ -261,16 +259,8 @@ export const inspectWebPageWithSourceInputSchema = inspectWebPageWithSourceShapeSchema.superRefine(refineInspectWebPageInput); /** Caller-visible schema for one passive inspection. */ -export const inspectWebPageInputSchema = z.discriminatedUnion( - "include_script_sources", - [ - inspectWebPageWithoutSourceSchema.superRefine(refineInspectWebPageInput), - inspectWebPageWithSourceShapeSchema - .extend({ - include_script_sources: z.literal(true), - }) - .superRefine(refineInspectWebPageInput), - ], +export const inspectWebPageInputSchema = inspectWebPageShapeSchema.superRefine( + refineInspectWebPageInput, ); export type ListBrowserTargetsInput = z.infer<