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

View File

@@ -250,6 +250,10 @@ export async function browserSnapshot(
targetId?: string;
limit?: number;
maxChars?: number;
interactive?: boolean;
compact?: boolean;
depth?: number;
selector?: string;
profile?: string;
},
): Promise<SnapshotResult> {
@@ -260,6 +264,12 @@ export async function browserSnapshot(
if (typeof opts.maxChars === "number" && Number.isFinite(opts.maxChars)) {
q.set("maxChars", String(opts.maxChars));
}
if (typeof opts.interactive === "boolean")
q.set("interactive", String(opts.interactive));
if (typeof opts.compact === "boolean") q.set("compact", String(opts.compact));
if (typeof opts.depth === "number" && Number.isFinite(opts.depth))
q.set("depth", String(opts.depth));
if (opts.selector?.trim()) q.set("selector", opts.selector.trim());
if (opts.profile) q.set("profile", opts.profile);
return await fetchBrowserJson<SnapshotResult>(
`${baseUrl}/snapshot?${q.toString()}`,