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:
morluto
2026-10-13 02:55:59 +08:00
committed by GitHub
co-authored by LouisChen
parent 0365454a57
commit bb26622670
5 changed files with 269 additions and 23 deletions
+12 -5
View File
@@ -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