@wenathlan/extension 1.1.47 → 1.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  <!doctype html>
2
2
  <html lang="en">
3
3
  <head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Devthink review</title><link rel="stylesheet" href="style.css"></head>
4
- <body><main class="wide"><header><p class="eyebrow">REVIEW GATE</p><h1>Plan before action</h1><p>Every browser operation remains blocked until the user reviews and approves it here.</p></header><label for="objective">Objective</label><textarea id="objective" rows="4" placeholder="Describe a browser task to turn into a reviewable plan."></textarea><div class="actions"><button id="localplan">Create local observation plan</button><button id="remoteplan" class="secondary">Ask configured endpoint</button><button id="diagnostic" class="secondary">Capture local diagnostics</button></div><p id="status" role="status">Loading session state.</p><p id="capabilitiestext" role="status" class="muted">Optional capabilities unknown.</p><section><h2>Current plan</h2><progress id="planprogress" max="1" value="0"></progress><div id="plan" class="panel"></div></section><section><h2>Clickable map</h2><ol id="map" class="audit maplist"></ol></section><section><h2>Navigation trail</h2><ol id="trail" class="audit"></ol></section><section><h2>Navigation state</h2><div id="navigation" class="panel"></div></section><section><h2>Tabs and windows</h2><div id="tabswindows" class="panel"></div></section><section><h2>Forms and data</h2><div id="forms" class="panel"></div></section><section><h2>Files and downloads</h2><div id="files" class="panel"></div></section><section><h2>Capture gallery</h2><div id="captures" class="panel"></div></section><section><h2>Media</h2><div id="media" class="panel"></div></section><section><h2>Network calls</h2><div id="calls" class="panel"></div></section><section><h2>Network view</h2><div id="netview" class="panel"></div></section><section><h2>Traffic control</h2><div id="traffic" class="panel"></div></section><section><h2>Run timeline</h2><div id="timeline" class="panel"></div></section><section><h2>Debugger</h2><div id="debugger" class="panel"></div></section><section><h2>Profiling</h2><div id="profiling" class="panel"></div></section><section><h2>Console diff</h2><div id="consolediff" class="panel"></div></section><section><h2>Datasets</h2><div id="datasets" class="panel"></div></section><section><h2>Consent banners</h2><div id="banners" class="panel"></div></section><section><h2>Accessibility tree</h2><div id="a11y" class="panel"></div></section><section><h2>Reader view</h2><div id="reader" class="panel"></div></section><section><h2>Detected shapes</h2><ol id="detections" class="audit maplist"></ol></section><section><h2>Watch stream</h2><ol id="stream" class="audit"></ol></section><section><h2>Snapshot diffs</h2><div id="diffs" class="panel"></div></section><section><h2>Derived selectors</h2><ol id="selectors" class="audit maplist"></ol></section><section><h2>Structured diagnostics</h2><ul id="diagnostics" class="audit"></ul></section><section><h2>Local audit</h2><ol id="audit" class="audit"></ol></section></main><script type="module" src="sidepanel.js"></script></body>
4
+ <body><main class="wide"><header><p class="eyebrow">REVIEW GATE</p><h1>Plan before action</h1><p>Every browser operation remains blocked until the user reviews and approves it here.</p></header><label for="objective">Objective</label><textarea id="objective" rows="4" placeholder="Describe a browser task to turn into a reviewable plan."></textarea><div class="actions"><button id="localplan">Create local observation plan</button><button id="remoteplan" class="secondary">Ask configured endpoint</button><button id="diagnostic" class="secondary">Capture local diagnostics</button></div><p id="status" role="status">Loading session state.</p><p id="capabilitiestext" role="status" class="muted">Optional capabilities unknown.</p><section><h2>Current plan</h2><progress id="planprogress" max="1" value="0"></progress><div id="plan" class="panel"></div></section><section><h2>Clickable map</h2><ol id="map" class="audit maplist"></ol></section><section><h2>Navigation trail</h2><ol id="trail" class="audit"></ol></section><section><h2>Navigation state</h2><div id="navigation" class="panel"></div></section><section><h2>Tabs and windows</h2><div id="tabswindows" class="panel"></div></section><section><h2>Forms and data</h2><div id="forms" class="panel"></div></section><section><h2>Files and downloads</h2><div id="files" class="panel"></div></section><section><h2>Capture gallery</h2><div id="captures" class="panel"></div></section><section><h2>Media</h2><div id="media" class="panel"></div></section><section><h2>Network calls</h2><div id="calls" class="panel"></div></section><section><h2>Network view</h2><div id="netview" class="panel"></div></section><section><h2>Traffic control</h2><div id="traffic" class="panel"></div></section><section><h2>Run timeline</h2><div id="timeline" class="panel"></div></section><section><h2>Debugger</h2><div id="debugger" class="panel"></div></section><section><h2>Profiling</h2><div id="profiling" class="panel"></div></section><section><h2>Emulation</h2><div id="emulation" class="panel"></div></section><section><h2>Console diff</h2><div id="consolediff" class="panel"></div></section><section><h2>Datasets</h2><div id="datasets" class="panel"></div></section><section><h2>Consent banners</h2><div id="banners" class="panel"></div></section><section><h2>Accessibility tree</h2><div id="a11y" class="panel"></div></section><section><h2>Reader view</h2><div id="reader" class="panel"></div></section><section><h2>Detected shapes</h2><ol id="detections" class="audit maplist"></ol></section><section><h2>Watch stream</h2><ol id="stream" class="audit"></ol></section><section><h2>Snapshot diffs</h2><div id="diffs" class="panel"></div></section><section><h2>Derived selectors</h2><ol id="selectors" class="audit maplist"></ol></section><section><h2>Structured diagnostics</h2><ul id="diagnostics" class="audit"></ul></section><section><h2>Local audit</h2><ol id="audit" class="audit"></ol></section></main><script type="module" src="sidepanel.js"></script></body>
5
5
  </html>
@@ -1,7 +1,7 @@
1
1
  // policy.ts
2
- var sensitiveactions = /* @__PURE__ */ new Set(["click", "type", "navigate", "select", "presskey", "drag", "drop", "upload", "clear", "check", "uncheck", "toggle", "submit", "reload", "back", "forward", "writestorage", "setattribute", "removeattribute", "evaluate", "tabcreate", "tabactivate", "tabclose", "tabreload", "windowcreate", "windowclose", "windowresize", "downloadfile", "clickpoint", "shiftclick", "dismissdialog", "enterframe", "typetime", "appendtext", "setvalue", "typeedit", "keyhold", "keyrelease", "submitsearch", "selectmulti", "chooseradio", "setslider", "setdate", "setcolor", "openlink", "openprivate", "reloadcache", "stopnav", "followlink", "spanav", "rewritequery", "setfragment", "navlist", "navprofile", "handleauth", "printpdf", "prefetch", "preconnect", "deeplink", "reopentab", "pausenav", "navrate", "openclipboard", "batchopen", "duplicatetab", "closepattern", "pintab", "mutetab", "movetab", "movetabwindow", "grouptabs", "colorgroup", "collapsegroup", "discardtab", "reloadtabs", "zoomin", "zoomout", "switchtab", "maximizewindow", "minimizewindow", "restorewindow", "focuswindow", "scratchwindow", "incognitowindow", "restoretab", "restorelayout", "reopenrun", "badgetab", "fillform", "filllabel", "fillplaceholder", "submitform", "retryform", "runwizard", "selectchain", "picktypeahead", "pickdate", "attachfile", "fillcard", "fillcode", "consentpassword", "exportcsv", "exportjson", "exportexcel", "copytable", "pushsheets", "streamdisk", "paginateextract", "resumeextract", "batchdownload", "pausedownload", "resumedownload", "interceptmime", "readclipboard", "writeclipboard", "copyscreen", "quarantinedownload", "scanvirus", "cleanupartifacts", "recordscreen", "captureaudio", "downloadimages", "callrest", "callgraphql", "sendmessage", "blockrequest", "mockresponse", "rewriteheaders", "setcookies", "clearcookies", "authflow", "saveapikey", "routeproxy", "postform", "postfiles", "attachcdp", "detachcdp", "cdpcmd", "overridescript", "heapshot", "profilecpu", "capturesourcemaps"]);
2
+ var sensitiveactions = /* @__PURE__ */ new Set(["click", "type", "navigate", "select", "presskey", "drag", "drop", "upload", "clear", "check", "uncheck", "toggle", "submit", "reload", "back", "forward", "writestorage", "setattribute", "removeattribute", "evaluate", "tabcreate", "tabactivate", "tabclose", "tabreload", "windowcreate", "windowclose", "windowresize", "downloadfile", "clickpoint", "shiftclick", "dismissdialog", "enterframe", "typetime", "appendtext", "setvalue", "typeedit", "keyhold", "keyrelease", "submitsearch", "selectmulti", "chooseradio", "setslider", "setdate", "setcolor", "openlink", "openprivate", "reloadcache", "stopnav", "followlink", "spanav", "rewritequery", "setfragment", "navlist", "navprofile", "handleauth", "printpdf", "prefetch", "preconnect", "deeplink", "reopentab", "pausenav", "navrate", "openclipboard", "batchopen", "duplicatetab", "closepattern", "pintab", "mutetab", "movetab", "movetabwindow", "grouptabs", "colorgroup", "collapsegroup", "discardtab", "reloadtabs", "zoomin", "zoomout", "switchtab", "maximizewindow", "minimizewindow", "restorewindow", "focuswindow", "scratchwindow", "incognitowindow", "restoretab", "restorelayout", "reopenrun", "badgetab", "fillform", "filllabel", "fillplaceholder", "submitform", "retryform", "runwizard", "selectchain", "picktypeahead", "pickdate", "attachfile", "fillcard", "fillcode", "consentpassword", "exportcsv", "exportjson", "exportexcel", "copytable", "pushsheets", "streamdisk", "paginateextract", "resumeextract", "batchdownload", "pausedownload", "resumedownload", "interceptmime", "readclipboard", "writeclipboard", "copyscreen", "quarantinedownload", "scanvirus", "cleanupartifacts", "recordscreen", "captureaudio", "downloadimages", "callrest", "callgraphql", "sendmessage", "blockrequest", "mockresponse", "rewriteheaders", "setcookies", "clearcookies", "authflow", "saveapikey", "routeproxy", "postform", "postfiles", "attachcdp", "detachcdp", "cdpcmd", "overridescript", "heapshot", "profilecpu", "capturesourcemaps", "emulatedevice", "emulatenetwork", "emulatelocate", "setuseragent", "overridepermission"]);
3
3
  var interactionactions = /* @__PURE__ */ new Set(["focus", "scroll", "hover", "clickdeep", "rightclick", "doubleclick", "scrollpage", "scrollby", "scrollend", "scrolltop", "fullscreen", "zoomset", "movepointer", "clicktext", "clickaria", "clickname", "expanddetails", "pierceshadow", "retryaction", "capturebodies", "setbreakpoint", "stepcode", "watchexpr"]);
4
- var readactions = /* @__PURE__ */ new Set(["observe", "inspect", "extract", "wait", "waitfor", "waittext", "readattribute", "readstyle", "readgeometry", "readvalue", "readtext", "readhtml", "countelements", "readtable", "readlinks", "readimages", "readmeta", "readforms", "readstorage", "highlight", "tablist", "windowlist", "tabsnapshot", "mapclicks", "verifyvisible", "verifyenabled", "resolvexpath", "a11ytree", "readvisible", "readertree", "detectlists", "detecttables", "readjson", "watchmutate", "waitquiet", "watchbanner", "detectinfinitescroll", "detectvirtual", "detectlazy", "readscrollpos", "readlang", "readoutline", "countpages", "listshadow", "listframes", "classifypage", "fingerprintsection", "diffsnapshots", "readselection", "watchfocus", "detectsticky", "detectscrolllock", "readopengraph", "detectlanguage", "deriveselector", "waitload", "waiturl", "spawait", "detecthttp", "readredirects", "readfinalurl", "trailaudit", "navintent", "checksafe", "querytabs", "watchtab", "findclones", "searchtabs", "listaudio", "snapshotsession", "savelayout", "attachmeta", "detectfields", "generatevalues", "saveprofiles", "asksubmit", "readerrors", "skiphoneypot", "detectlogin", "detecttemplate", "handoffcaptcha", "scrapetable", "importcsv", "looprows", "transformvalues", "deduperows", "mergepages", "stamplerows", "previewgrid", "logprovenance", "verifydownload", "exportnetlog", "namecaptures", "shotview", "shotfullpage", "shotelement", "shotregion", "contactsheet", "capturepdf", "captureframe", "readmedia", "readassets", "probestream", "timelapse", "shotcanvas", "convertimage", "makethumbs", "fetchurl", "parsejson", "parsehtml", "opensocket", "waitmessage", "watchrequests", "readheaders", "mapapi", "subscribesse", "longpoll", "extractapi", "readcookies", "watchconsole", "watcherrors", "watchtasks", "watchcdp", "measureflow", "trackmemory", "watchshifts", "traceload", "annotatetrace", "replaytrace"]);
4
+ var readactions = /* @__PURE__ */ new Set(["observe", "inspect", "extract", "wait", "waitfor", "waittext", "readattribute", "readstyle", "readgeometry", "readvalue", "readtext", "readhtml", "countelements", "readtable", "readlinks", "readimages", "readmeta", "readforms", "readstorage", "highlight", "tablist", "windowlist", "tabsnapshot", "mapclicks", "verifyvisible", "verifyenabled", "resolvexpath", "a11ytree", "readvisible", "readertree", "detectlists", "detecttables", "readjson", "watchmutate", "waitquiet", "watchbanner", "detectinfinitescroll", "detectvirtual", "detectlazy", "readscrollpos", "readlang", "readoutline", "countpages", "listshadow", "listframes", "classifypage", "fingerprintsection", "diffsnapshots", "readselection", "watchfocus", "detectsticky", "detectscrolllock", "readopengraph", "detectlanguage", "deriveselector", "waitload", "waiturl", "spawait", "detecthttp", "readredirects", "readfinalurl", "trailaudit", "navintent", "checksafe", "querytabs", "watchtab", "findclones", "searchtabs", "listaudio", "snapshotsession", "savelayout", "attachmeta", "detectfields", "generatevalues", "saveprofiles", "asksubmit", "readerrors", "skiphoneypot", "detectlogin", "detecttemplate", "handoffcaptcha", "scrapetable", "importcsv", "looprows", "transformvalues", "deduperows", "mergepages", "stamplerows", "previewgrid", "logprovenance", "verifydownload", "exportnetlog", "namecaptures", "shotview", "shotfullpage", "shotelement", "shotregion", "contactsheet", "capturepdf", "captureframe", "readmedia", "readassets", "probestream", "timelapse", "shotcanvas", "convertimage", "makethumbs", "fetchurl", "parsejson", "parsehtml", "opensocket", "waitmessage", "watchrequests", "readheaders", "mapapi", "subscribesse", "longpoll", "extractapi", "readcookies", "watchconsole", "watcherrors", "watchtasks", "watchcdp", "measureflow", "trackmemory", "watchshifts", "traceload", "annotatetrace", "replaytrace", "blackboxscripts"]);
5
5
  var allowedactions = /* @__PURE__ */ new Set([...sensitiveactions, ...interactionactions, ...readactions]);
6
6
 
7
7
  // extension/tabscommand.ts
@@ -71,6 +71,7 @@ var timelineroot = document.querySelector("#timeline");
71
71
  var consolediffroot = document.querySelector("#consolediff");
72
72
  var debuggerroot = document.querySelector("#debugger");
73
73
  var profilingroot = document.querySelector("#profiling");
74
+ var emulationroot = document.querySelector("#emulation");
74
75
  var netviewroot = document.querySelector("#netview");
75
76
  var statusnode = document.querySelector("#status");
76
77
  var progressnode = document.querySelector("#planprogress");
@@ -2347,6 +2348,164 @@ function renderdebugger(context) {
2347
2348
  ceilinginput.value = context.breakpointceiling !== void 0 ? String(context.breakpointceiling) : "";
2348
2349
  debuggerroot.append(settingsline, retentioninput, ceilinginput, button("Save debugger settings", () => Promise.all([request({ kind: "setpauseretention", retention: retentioninput.value === "" ? void 0 : Number(retentioninput.value) }), request({ kind: "setbreakpointceiling", ceiling: ceilinginput.value === "" ? void 0 : Number(ceilinginput.value) })]).then(() => status(`Debugger settings saved: pause retention ${retentioninput.value === "" ? "keeps every capture" : retentioninput.value} and breakpoint ceiling ${ceilinginput.value === "" ? "none" : ceilinginput.value}.`)).then(refresh)));
2349
2350
  }
2351
+ function renderemulation(context) {
2352
+ if (!emulationroot) return;
2353
+ emulationroot.replaceChildren();
2354
+ const emulation = context.emulation;
2355
+ if (!emulation) {
2356
+ emulationroot.textContent = "No emulation state is available yet; start a session and review a plan with emulation steps.";
2357
+ return;
2358
+ }
2359
+ const pending = emulation.consents.filter((consent) => consent.approved === void 0 && consent.revokedat === void 0);
2360
+ for (const consent of pending) {
2361
+ const card = document.createElement("div");
2362
+ card.className = "bannercard";
2363
+ const title = document.createElement("p");
2364
+ title.textContent = `Location consent needed on ${consent.origin}`;
2365
+ const coordinates = document.createElement("p");
2366
+ coordinates.textContent = `Reviewed coordinates: ${consent.latitude}, ${consent.longitude}; the override applies through a page-injected geolocation mask and the true browser location stays untouched.`;
2367
+ card.append(title, coordinates, button("Approve location consent", () => request({ kind: "approvelocationconsent", id: consent.id }).then(() => {
2368
+ status(`Approved the location consent for ${consent.latitude}, ${consent.longitude} on ${consent.origin}.`);
2369
+ return refresh();
2370
+ })));
2371
+ emulationroot.append(card);
2372
+ }
2373
+ const active = emulation.layers.filter((layer) => layer.revertedat === void 0);
2374
+ const state = document.createElement("p");
2375
+ state.textContent = `${active.length} active emulation layer${active.length === 1 ? "" : "s"} of run ${active[0]?.runid ?? "none"}${active.length > 1 ? "; the last applied layer wins conflicts" : ""}.`;
2376
+ emulationroot.append(state);
2377
+ if (active.length > 1) {
2378
+ const warn = document.createElement("p");
2379
+ warn.textContent = `Warning: ${active.length} layers stack on one tab (${active.map((layer) => layer.name).join(", ")}); every mask reverts at run end in reverse order.`;
2380
+ warn.className = "muted";
2381
+ emulationroot.append(warn);
2382
+ }
2383
+ const offlinelayer = active.find((layer) => layer.family === "network" && emulation.networks.some((preset) => preset.name === layer.name && preset.offline));
2384
+ if (offlinelayer !== void 0) {
2385
+ const offline = document.createElement("p");
2386
+ offline.textContent = `Offline: the network layer ${offlinelayer.name} cuts the traffic the extension initiates; page traffic stays observed only.`;
2387
+ offline.className = "muted";
2388
+ emulationroot.append(offline);
2389
+ }
2390
+ for (const layer of active) {
2391
+ const row = document.createElement("div");
2392
+ row.className = "emulationrow";
2393
+ row.dataset.stacked = active.length > 1 ? "true" : "false";
2394
+ const line = document.createElement("p");
2395
+ line.textContent = `${layer.family} layer ${layer.name} on ${layer.originscope} applied ${new Date(layer.appliedat).toLocaleTimeString()} with the revert plan ${layer.revertplan.join(", ")}.`;
2396
+ row.append(line, button("Revert now", () => request({ kind: "revertemulation" }).then(() => {
2397
+ status("Reverted every active emulation layer of the run on review panel demand.");
2398
+ return refresh();
2399
+ })));
2400
+ emulationroot.append(row);
2401
+ }
2402
+ if (active.length > 0) {
2403
+ emulationroot.append(button("Restore stored layers after a crash", () => request({ kind: "restoreemulation" }).then(() => {
2404
+ status("Restored the stored emulation layers of the run record.");
2405
+ return refresh();
2406
+ })));
2407
+ }
2408
+ const families = [
2409
+ { label: "device presets", presets: emulation.devices.map((preset) => ({ label: `${preset.name}: ${preset.width}x${preset.height} @${preset.pixelratio}${preset.mobile ? " mobile" : ""}`, kind: "device" })) },
2410
+ { label: "network presets", presets: emulation.networks.map((preset) => ({ label: `${preset.name}: ${preset.latency}ms, ${preset.download}/${preset.upload} kbps${preset.offline ? ", offline" : ""}`, kind: "network" })) },
2411
+ { label: "location presets", presets: emulation.locations.map((preset) => ({ label: `${preset.name}: ${preset.latitude}, ${preset.longitude} \xB1${preset.accuracy}m`, kind: "location" })) },
2412
+ { label: "agent presets", presets: emulation.agents.map((preset) => ({ label: `${preset.name}: ${preset.platform} with ${preset.brands.length} brands`, kind: "agent" })) }
2413
+ ];
2414
+ for (const family of families) {
2415
+ const head = document.createElement("h4");
2416
+ head.textContent = family.label;
2417
+ emulationroot.append(head);
2418
+ if (family.presets.length === 0) {
2419
+ const empty = document.createElement("p");
2420
+ empty.className = "muted";
2421
+ empty.textContent = "No user curated preset yet; the library stays user data instead of a hardcoded list.";
2422
+ emulationroot.append(empty);
2423
+ continue;
2424
+ }
2425
+ for (const preset of family.presets) {
2426
+ const line = document.createElement("p");
2427
+ line.textContent = preset.label;
2428
+ emulationroot.append(line);
2429
+ }
2430
+ }
2431
+ const editor = document.createElement("details");
2432
+ const summary = document.createElement("summary");
2433
+ summary.textContent = "Preset editor";
2434
+ editor.append(summary);
2435
+ const nameinput = document.createElement("input");
2436
+ nameinput.placeholder = "preset name";
2437
+ const valueinput = document.createElement("input");
2438
+ valueinput.placeholder = 'preset json, for example {"name":"phone","width":390,"height":844,"pixelratio":3,"mobile":true}';
2439
+ const familyselect = document.createElement("select");
2440
+ for (const family of ["device", "network", "location", "agent"]) {
2441
+ const option = document.createElement("option");
2442
+ option.value = family;
2443
+ option.textContent = family;
2444
+ familyselect.append(option);
2445
+ }
2446
+ editor.append(nameinput, valueinput, familyselect, button("Save preset", async () => {
2447
+ let payload;
2448
+ try {
2449
+ payload = JSON.parse(valueinput.value);
2450
+ } catch {
2451
+ throw new Error("The preset payload must be reviewed JSON.");
2452
+ }
2453
+ if (payload && typeof payload === "object" && !Array.isArray(payload) && nameinput.value.trim()) payload = { ...payload, name: nameinput.value.trim() };
2454
+ const kind = familyselect.value === "device" ? "setdevicepreset" : familyselect.value === "network" ? "setnetworkpreset" : familyselect.value === "location" ? "setlocationpreset" : "setagentpreset";
2455
+ const field = familyselect.value;
2456
+ await request({ kind, [field]: payload });
2457
+ status(`Stored the ${familyselect.value} preset in the user curated library.`);
2458
+ await refresh();
2459
+ }));
2460
+ const exportrow = document.createElement("div");
2461
+ exportrow.className = "actions";
2462
+ exportrow.append(button("Export preset file", () => request({ kind: "exportpresets" }).then((value) => {
2463
+ const parsed = value;
2464
+ status(`Exported ${parsed.exported} preset${parsed.exported === 1 ? "" : "s"} through the reviewed download flow.`);
2465
+ return refresh();
2466
+ })));
2467
+ const importinput = document.createElement("input");
2468
+ importinput.type = "file";
2469
+ importinput.accept = "application/json";
2470
+ importinput.addEventListener("change", () => {
2471
+ const file = importinput.files?.[0];
2472
+ if (!file) return;
2473
+ void file.text().then((content) => JSON.parse(content)).then((filevalue) => request({ kind: "importpresets", file: filevalue })).then((value) => {
2474
+ const parsed = value;
2475
+ status(`Imported ${parsed.imported} reviewed preset${parsed.imported === 1 ? "" : "s"} into the library.`);
2476
+ return refresh();
2477
+ }).catch((error) => status(error instanceof Error ? error.message : String(error), true));
2478
+ });
2479
+ exportrow.append(importinput);
2480
+ editor.append(exportrow);
2481
+ emulationroot.append(editor);
2482
+ const blackbox = emulation.blackbox.filter((entry) => entry.rules.length > 0);
2483
+ if (blackbox.length > 0) {
2484
+ const head = document.createElement("h4");
2485
+ head.textContent = "blackboxed patterns of the run";
2486
+ emulationroot.append(head);
2487
+ for (const entry of blackbox) {
2488
+ const line = document.createElement("p");
2489
+ line.textContent = `${entry.origin}: ${entry.rules.flatMap((rule) => rule.urlpatterns).join(", ")} (${entry.rules.map((rule) => rule.tracescope).join(", ")} scope)`;
2490
+ emulationroot.append(line);
2491
+ }
2492
+ }
2493
+ const restored = emulation.permissions.filter((record) => record.restoredat === void 0);
2494
+ if (restored.length > 0) {
2495
+ const head = document.createElement("h4");
2496
+ head.textContent = "permission overrides pending restore";
2497
+ emulationroot.append(head);
2498
+ for (const record of restored) {
2499
+ const line = document.createElement("p");
2500
+ line.textContent = `${record.name} of ${record.origin} answered ${record.state} for run ${record.runid}; the prior ${record.priorstate} state restores at run end.`;
2501
+ emulationroot.append(line);
2502
+ }
2503
+ }
2504
+ const retentionrow = document.createElement("p");
2505
+ retentionrow.className = "muted";
2506
+ retentionrow.textContent = `Reverted layer state retention: ${context.emulationretention === void 0 ? "keep every prior state" : `${context.emulationretention} layer${context.emulationretention === 1 ? "" : "s"}`}; the layer history itself always survives.`;
2507
+ emulationroot.append(retentionrow);
2508
+ }
2350
2509
  async function refresh() {
2351
2510
  const context = await request({ kind: "context" });
2352
2511
  renderplan(context.plan, context.progress, context.outcomes ?? [], context.retries ?? []);
@@ -2373,6 +2532,7 @@ async function refresh() {
2373
2532
  rendertimeline(context);
2374
2533
  renderdebugger(context);
2375
2534
  renderprofiling(context);
2535
+ renderemulation(context);
2376
2536
  renderconsolediff();
2377
2537
  renderaudit(context.audit);
2378
2538
  rendercapabilities(context.capabilities);