fix(cli): retain correction details across adjacent browser commands (#2294)
* fix(cli): retain correction details across browser commands Fold the complementary implementation from #2247 into the earlier #2230 proposal, retaining the original contribution history. Co-authored-by: LouisChen <3361008+chqcjq@users.noreply.github.com> * fix(browser): retain diagnostics from the selected input branch * fix(cli): recognize incomplete browser scenarios by their owned fields --------- Co-authored-by: LouisChen <3361008+chqcjq@users.noreply.github.com>
This commit is contained in:
@@ -105,7 +105,7 @@ const inspectWebPageInputFacts = {
|
||||
|
||||
const inspectWebPageWithoutSourceSchema = z.strictObject({
|
||||
...inspectWebPageInputFacts,
|
||||
include_script_sources: z.literal(false).default(false),
|
||||
include_script_sources: z.literal(false).optional().default(false),
|
||||
});
|
||||
|
||||
const inspectWebPageWithSourceShapeSchema = z.strictObject({
|
||||
@@ -134,10 +134,17 @@ export const inspectWebPageWithSourceInputSchema =
|
||||
inspectWebPageWithSourceShapeSchema.superRefine(refineInspectWebPageInput);
|
||||
|
||||
/** Caller-visible schema for one passive inspection. */
|
||||
export const inspectWebPageInputSchema = z.union([
|
||||
inspectWebPageWithoutSourceSchema.superRefine(refineInspectWebPageInput),
|
||||
inspectWebPageWithSourceInputSchema,
|
||||
]);
|
||||
export const inspectWebPageInputSchema = z.discriminatedUnion(
|
||||
"include_script_sources",
|
||||
[
|
||||
inspectWebPageWithoutSourceSchema.superRefine(refineInspectWebPageInput),
|
||||
inspectWebPageWithSourceShapeSchema
|
||||
.extend({
|
||||
include_script_sources: z.literal(true),
|
||||
})
|
||||
.superRefine(refineInspectWebPageInput),
|
||||
],
|
||||
);
|
||||
|
||||
export type ListBrowserTargetsInput = z.infer<
|
||||
typeof listBrowserTargetsInputSchema
|
||||
|
||||
Reference in New Issue
Block a user