feat: role snapshot refs for browser

This commit is contained in:
Peter Steinberger
2026-01-12 08:36:20 +00:00
parent 6a7b812513
commit fadad6e061
10 changed files with 480 additions and 19 deletions
+8
View File
@@ -55,6 +55,10 @@ export function registerBrowserInspectCommands(
.option("--limit <n>", "Max nodes (default: 500/800)", (v: string) =>
Number(v),
)
.option("--interactive", "Role snapshot: interactive elements only", false)
.option("--compact", "Role snapshot: compact output", false)
.option("--depth <n>", "Role snapshot: max depth", (v: string) => Number(v))
.option("--selector <sel>", "Role snapshot: scope to CSS selector")
.option("--out <path>", "Write snapshot to a file")
.action(async (opts, cmd) => {
const parent = parentOpts(cmd);
@@ -66,6 +70,10 @@ export function registerBrowserInspectCommands(
format,
targetId: opts.targetId?.trim() || undefined,
limit: Number.isFinite(opts.limit) ? opts.limit : undefined,
interactive: Boolean(opts.interactive) || undefined,
compact: Boolean(opts.compact) || undefined,
depth: Number.isFinite(opts.depth) ? opts.depth : undefined,
selector: opts.selector?.trim() || undefined,
profile,
});