@wenathlan/extension 1.1.59 → 1.1.60
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.
- package/README.md +4 -3
- package/dist/cli.js +19 -2
- package/dist/environments.d.ts +96 -0
- package/dist/environments.d.ts.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +559 -1
- package/dist/index.js.map +4 -4
- package/dist/memory.d.ts +55 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/policy.d.ts +32 -1
- package/dist/policy.d.ts.map +1 -1
- package/dist/protocol.d.ts +46 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/runstate.d.ts +127 -0
- package/dist/runstate.d.ts.map +1 -0
- package/dist/sandboxframe.d.ts +45 -0
- package/dist/sandboxframe.d.ts.map +1 -0
- package/dist/types.d.ts +168 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/extension/dist/background.js +919 -4
- package/extension/dist/background.js.map +4 -4
- package/extension/dist/manifest.json +16 -2
- package/extension/dist/offscreen.html +7 -0
- package/extension/dist/offscreen.js +87 -0
- package/extension/dist/offscreen.js.map +7 -0
- package/extension/dist/pagebridge.js +7 -0
- package/extension/dist/pagebridge.js.map +2 -2
- package/extension/dist/popup.html +1 -1
- package/extension/dist/popup.js +38 -0
- package/extension/dist/popup.js.map +2 -2
- package/extension/dist/sandbox.html +28 -0
- package/extension/dist/sidepanel.html +1 -1
- package/extension/dist/sidepanel.js +293 -0
- package/extension/dist/sidepanel.js.map +3 -3
- package/extension/manifest.json +16 -2
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head><meta charset="utf-8"><title>Devthink sandbox frame</title></head>
|
|
4
|
+
<body>
|
|
5
|
+
<script>
|
|
6
|
+
/** The sandbox frame host: this page runs under the manifest sandbox key with no extension privileges, so the untrusted markup it renders never touches extension surfaces; scripts and event handlers are already stripped before arrival and the inner iframe stays fully sandboxed. */
|
|
7
|
+
window.addEventListener("message", event => {
|
|
8
|
+
const data = event.data || {};
|
|
9
|
+
if (data.channel !== "devthinksandbox" || data.type !== "render") return;
|
|
10
|
+
var nonce = data.nonce;
|
|
11
|
+
var frame = document.getElementById("devthinksandboxframe");
|
|
12
|
+
if (frame) frame.remove();
|
|
13
|
+
frame = document.createElement("iframe");
|
|
14
|
+
frame.id = "devthinksandboxframe";
|
|
15
|
+
frame.setAttribute("sandbox", "");
|
|
16
|
+
frame.setAttribute("aria-hidden", "true");
|
|
17
|
+
frame.style.display = "none";
|
|
18
|
+
frame.srcdoc = "<!doctype html><html><body>" + data.markup + "</body></html>";
|
|
19
|
+
frame.onload = function () {
|
|
20
|
+
var text = "";
|
|
21
|
+
try { text = (frame.contentDocument && frame.contentDocument.body ? frame.contentDocument.body.textContent : "") || ""; } catch (error) { text = ""; }
|
|
22
|
+
event.source.postMessage({ channel: "devthinksandbox", type: "renderresult", nonce: nonce, ok: true, text: text, summary: "The sandbox frame rendered the inert markup and returned its text." }, "*");
|
|
23
|
+
};
|
|
24
|
+
document.body.appendChild(frame);
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
27
|
+
</body>
|
|
28
|
+
</html>
|
|
@@ -3,5 +3,5 @@
|
|
|
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
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>
|
|
5
5
|
<div class="actions"><input id="command" placeholder="Ask any connected model in plain language" aria-label="Natural language command"><button id="commandsend" class="secondary">Ask model</button><span id="intentbadge" class="muted"></span></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>Sessions</h2><div id="sessions" class="panel"></div></section><section><h2>Workflows</h2><div id="workflows" class="panel"></div></section><section><h2>Workflow editor</h2><div id="workfloweditor" class="panel"></div></section><section><h2>Triggers</h2><div id="triggers" class="panel"></div></section><section><h2>Agent protocol</h2><div id="agentprotocol" class="panel"></div></section>
|
|
6
|
-
<section><h2>Models</h2><div id="models" class="panel"></div></section><section><h2>Agents</h2><div id="agents" 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>
|
|
6
|
+
<section><h2>Models</h2><div id="models" class="panel"></div></section><section><h2>Agents</h2><div id="agents" class="panel"></div></section><section><h2>Execution environments</h2><div id="environments" 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>
|
|
7
7
|
</html>
|
|
@@ -319,6 +319,12 @@ function redoedit(model) {
|
|
|
319
319
|
return { ...next, redo: redo.slice(0, -1), undo: [...model.undo ?? [], current] };
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
+
// progress.ts
|
|
323
|
+
function environmentof(progress, planid, stepid) {
|
|
324
|
+
if (!progress || progress.planid !== planid) return void 0;
|
|
325
|
+
return (progress.environments ?? {})[stepid];
|
|
326
|
+
}
|
|
327
|
+
|
|
322
328
|
// extension/tabscommand.ts
|
|
323
329
|
function switcherlist(tabs, recency, filter) {
|
|
324
330
|
const needle = filter.trim().toLowerCase();
|
|
@@ -395,6 +401,7 @@ var triggersroot = document.querySelector("#triggers");
|
|
|
395
401
|
var agentprotocolroot = document.querySelector("#agentprotocol");
|
|
396
402
|
var modelsroot = document.querySelector("#models");
|
|
397
403
|
var agentsroot = document.querySelector("#agents");
|
|
404
|
+
var environmentsroot = document.querySelector("#environments");
|
|
398
405
|
var commandinput = document.querySelector("#command");
|
|
399
406
|
var commandbutton = document.querySelector("#commandsend");
|
|
400
407
|
var intentbadge = document.querySelector("#intentbadge");
|
|
@@ -585,6 +592,13 @@ function stepitem(plan, step, completed, outcomes, retries, progress) {
|
|
|
585
592
|
const item = document.createElement("li");
|
|
586
593
|
const done = completed.includes(step.id);
|
|
587
594
|
item.textContent = `${done ? "\u2713" : ""} ${step.summary}${holddetail(step)}`;
|
|
595
|
+
const environmentbadge = progress?.planid === plan.id ? environmentof(progress, plan.id, step.id) ?? step.environment : step.environment;
|
|
596
|
+
if (environmentbadge !== void 0) {
|
|
597
|
+
const badge = document.createElement("span");
|
|
598
|
+
badge.className = "muted";
|
|
599
|
+
badge.textContent = ` [${environmentbadge}]`;
|
|
600
|
+
item.append(badge);
|
|
601
|
+
}
|
|
588
602
|
const outcome = renderoutcome(step, outcomes);
|
|
589
603
|
if (outcome) item.append(outcome);
|
|
590
604
|
const timeline = step.kind === "retryaction" ? retrydetail(step, retries) : quietdetail(step, outcomes);
|
|
@@ -2883,6 +2897,7 @@ async function refresh() {
|
|
|
2883
2897
|
renderagentprotocol(context);
|
|
2884
2898
|
rendermodels(context);
|
|
2885
2899
|
renderagents(context);
|
|
2900
|
+
renderenvironments(context);
|
|
2886
2901
|
renderconsolediff();
|
|
2887
2902
|
renderaudit(context.audit);
|
|
2888
2903
|
rendercapabilities(context.capabilities);
|
|
@@ -5543,6 +5558,257 @@ function rendermodels(context) {
|
|
|
5543
5558
|
}
|
|
5544
5559
|
modelsroot.append(guardbox);
|
|
5545
5560
|
}
|
|
5561
|
+
function renderenvironments(context) {
|
|
5562
|
+
if (!environmentsroot) return;
|
|
5563
|
+
environmentsroot.replaceChildren();
|
|
5564
|
+
const view = context.environments;
|
|
5565
|
+
if (!view) {
|
|
5566
|
+
environmentsroot.textContent = "The execution environment state is unknown.";
|
|
5567
|
+
return;
|
|
5568
|
+
}
|
|
5569
|
+
const head = document.createElement("p");
|
|
5570
|
+
head.textContent = `Steps by environment: ${view.report.environments.length} executed \xB7 offscreen ${view.offscreengranted ? "granted" : "not granted"} \xB7 parse offload ${view.parseoffload ? "on" : "off"} \xB7 workers ${view.report.workers} \xB7 sandbox origins ${view.sandboxorigins?.length ?? 0} configured.`;
|
|
5571
|
+
environmentsroot.append(head);
|
|
5572
|
+
const keepalive = view.report.keepalive;
|
|
5573
|
+
const keepbox = document.createElement("div");
|
|
5574
|
+
keepbox.className = "actions";
|
|
5575
|
+
const beatinfo = document.createElement("span");
|
|
5576
|
+
beatinfo.textContent = keepalive ? `Keepalive ${keepalive.state}: ${keepalive.beats} beat${keepalive.beats === 1 ? "" : "s"}, port ${keepalive.portopen ? "open" : "closed"}, last beat ${new Date(keepalive.lastbeatat).toLocaleTimeString()}${view.workerpoolsize !== void 0 ? ` \xB7 pool size ${view.workerpoolsize}` : ""}.` : "No run state holds a keepalive port.";
|
|
5577
|
+
keepbox.append(beatinfo);
|
|
5578
|
+
if (keepalive?.state === "active") {
|
|
5579
|
+
keepbox.append(button("Beat now", async () => {
|
|
5580
|
+
await request({ kind: "runstate", beat: true });
|
|
5581
|
+
await refresh();
|
|
5582
|
+
}), button("Close run state", async () => {
|
|
5583
|
+
await request({ kind: "runstate", stop: true });
|
|
5584
|
+
await refresh();
|
|
5585
|
+
}));
|
|
5586
|
+
}
|
|
5587
|
+
environmentsroot.append(keepbox);
|
|
5588
|
+
const keepnote = document.createElement("p");
|
|
5589
|
+
keepnote.className = "muted";
|
|
5590
|
+
keepnote.textContent = "Keepalive runs only during active reviewed plans: the port opens behind an approved plan of an active session and closes at every terminal state.";
|
|
5591
|
+
environmentsroot.append(keepnote);
|
|
5592
|
+
if (view.restartnotice !== void 0 || view.recovery !== void 0) {
|
|
5593
|
+
const notice = document.createElement("p");
|
|
5594
|
+
notice.textContent = view.restartnotice ?? view.recovery?.reason ?? "";
|
|
5595
|
+
if (view.recovery?.recoverable === true) notice.append(" ", button("Resume pending step", async () => {
|
|
5596
|
+
const result = await request({ kind: "runstate", recover: true });
|
|
5597
|
+
status(result.resumed ?? result.recovery?.reason ?? "The recovery finished.");
|
|
5598
|
+
await refresh();
|
|
5599
|
+
}));
|
|
5600
|
+
environmentsroot.append(notice);
|
|
5601
|
+
}
|
|
5602
|
+
if (view.zombies.length > 0) {
|
|
5603
|
+
const warning = document.createElement("p");
|
|
5604
|
+
warning.textContent = `Zombie run${view.zombies.length === 1 ? "" : "s"} whose heartbeat fell silent: ${view.zombies.join(", ")}.`;
|
|
5605
|
+
warning.append(" ", button("Reap zombie runs", async () => {
|
|
5606
|
+
const result = await request({ kind: "runstate", reap: true });
|
|
5607
|
+
status(`The reaper closed ${result.reaped?.length ?? 0} zombie run${result.reaped?.length === 1 ? "" : "s"}.`);
|
|
5608
|
+
await refresh();
|
|
5609
|
+
}));
|
|
5610
|
+
environmentsroot.append(warning);
|
|
5611
|
+
}
|
|
5612
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
5613
|
+
for (const entry of view.report.environments) grouped.set(entry.environment, [...grouped.get(entry.environment) ?? [], entry.stepid]);
|
|
5614
|
+
const groupbox = document.createElement("details");
|
|
5615
|
+
groupbox.className = "sessiongroup";
|
|
5616
|
+
const groupsummary = document.createElement("summary");
|
|
5617
|
+
groupsummary.textContent = "Steps grouped by execution environment";
|
|
5618
|
+
groupbox.append(groupsummary);
|
|
5619
|
+
if (grouped.size === 0) {
|
|
5620
|
+
const none = document.createElement("p");
|
|
5621
|
+
none.textContent = "No step of the open run has executed yet.";
|
|
5622
|
+
groupbox.append(none);
|
|
5623
|
+
}
|
|
5624
|
+
for (const [environment, stepids] of grouped) {
|
|
5625
|
+
const line = document.createElement("p");
|
|
5626
|
+
line.textContent = `${environment}: ${stepids.length} step${stepids.length === 1 ? "" : "s"}${view.report.turnarounds.filter((entry) => stepids.includes(entry.stepid)).length > 0 ? ` \xB7 worker turnaround ${view.report.turnarounds.filter((entry) => stepids.includes(entry.stepid)).map((entry) => `${entry.stepid}: ${entry.milliseconds} ms`).join(", ")}` : ""}`;
|
|
5627
|
+
groupbox.append(line);
|
|
5628
|
+
}
|
|
5629
|
+
environmentsroot.append(groupbox);
|
|
5630
|
+
const grantbox = document.createElement("div");
|
|
5631
|
+
grantbox.className = "actions";
|
|
5632
|
+
const grantinfo = document.createElement("span");
|
|
5633
|
+
grantinfo.textContent = view.grants !== void 0 ? `Session environment grants: ${view.grants.length > 0 ? view.grants.join(", ") : "the documented default posture"}.` : "Session environment grants: the documented default posture (no grant list configured).";
|
|
5634
|
+
grantbox.append(grantinfo);
|
|
5635
|
+
const allenvironments = ["pagecontext", "isolatedworld", "offscreenworker", "sandboxframe"];
|
|
5636
|
+
for (const environment of allenvironments) {
|
|
5637
|
+
const active = view.grants?.includes(environment) ?? false;
|
|
5638
|
+
grantbox.append(" ", button(`${active ? "Revoke" : "Grant"} ${environment}`, async () => {
|
|
5639
|
+
const current = view.grants ?? [];
|
|
5640
|
+
const next = active ? current.filter((entry) => entry !== environment) : [...current, environment];
|
|
5641
|
+
await request({ kind: "environments", grants: next });
|
|
5642
|
+
await refresh();
|
|
5643
|
+
}));
|
|
5644
|
+
}
|
|
5645
|
+
environmentsroot.append(grantbox);
|
|
5646
|
+
const grantnote = document.createElement("p");
|
|
5647
|
+
grantnote.className = "muted";
|
|
5648
|
+
grantnote.textContent = "Environment grants join the origin grants of the session record: a configured list narrows every step to its entries and the request links to the same consent flow the origins use.";
|
|
5649
|
+
environmentsroot.append(grantnote);
|
|
5650
|
+
const capabilitybox = document.createElement("div");
|
|
5651
|
+
capabilitybox.className = "actions";
|
|
5652
|
+
const capabilityinfo = document.createElement("span");
|
|
5653
|
+
capabilityinfo.textContent = `Offscreen capability: ${view.offscreengranted ? "granted" : "absent \u2014 heavy parses keep their inline fallback inside the page"}.`;
|
|
5654
|
+
capabilitybox.append(capabilityinfo);
|
|
5655
|
+
if (!view.offscreengranted) capabilitybox.append(" ", button("Request offscreen capability", async () => {
|
|
5656
|
+
const result = await request({ kind: "environments", requestcapability: true });
|
|
5657
|
+
status(result.requested === true ? "The offscreen capability was granted; the worker pool may spawn." : "The capability request stayed refused; the inline fallback holds.");
|
|
5658
|
+
await refresh();
|
|
5659
|
+
}));
|
|
5660
|
+
else capabilitybox.append(" ", button("Close offscreen document", async () => {
|
|
5661
|
+
await request({ kind: "environments", offscreenclose: true });
|
|
5662
|
+
await refresh();
|
|
5663
|
+
}));
|
|
5664
|
+
environmentsroot.append(capabilitybox);
|
|
5665
|
+
const optionsbox = document.createElement("details");
|
|
5666
|
+
optionsbox.className = "sessiongroup";
|
|
5667
|
+
const optionssummary = document.createElement("summary");
|
|
5668
|
+
optionssummary.textContent = "Environment options";
|
|
5669
|
+
optionsbox.append(optionssummary);
|
|
5670
|
+
const offloadrow = document.createElement("div");
|
|
5671
|
+
offloadrow.className = "actions";
|
|
5672
|
+
offloadrow.append(button(`Parse offload: ${view.parseoffload ? "on" : "off"}`, async () => {
|
|
5673
|
+
await request({ kind: "environments", settings: { parseoffload: !view.parseoffload } });
|
|
5674
|
+
await refresh();
|
|
5675
|
+
}));
|
|
5676
|
+
const poolinput = document.createElement("input");
|
|
5677
|
+
poolinput.type = "number";
|
|
5678
|
+
poolinput.min = "1";
|
|
5679
|
+
poolinput.placeholder = "worker pool size (no cap)";
|
|
5680
|
+
poolinput.value = view.workerpoolsize !== void 0 ? String(view.workerpoolsize) : "";
|
|
5681
|
+
offloadrow.append(" ", poolinput, " ", button("Set pool size", async () => {
|
|
5682
|
+
const value = poolinput.value.trim();
|
|
5683
|
+
await request({ kind: "environments", settings: { ...value !== "" ? { workerpoolsize: Number(value) } : {} } });
|
|
5684
|
+
await refresh();
|
|
5685
|
+
}));
|
|
5686
|
+
optionsbox.append(offloadrow);
|
|
5687
|
+
const origininput = document.createElement("input");
|
|
5688
|
+
origininput.type = "url";
|
|
5689
|
+
origininput.placeholder = "https://origin.example to allow sandbox renders";
|
|
5690
|
+
const originrow = document.createElement("div");
|
|
5691
|
+
originrow.className = "actions";
|
|
5692
|
+
originrow.append(origininput, " ", button("Add sandbox origin", async () => {
|
|
5693
|
+
const value = origininput.value.trim();
|
|
5694
|
+
if (value === "") return;
|
|
5695
|
+
const next = [...view.sandboxorigins ?? [], value];
|
|
5696
|
+
await request({ kind: "environments", settings: { sandboxorigins: next } });
|
|
5697
|
+
await refresh();
|
|
5698
|
+
}));
|
|
5699
|
+
optionsbox.append(originrow);
|
|
5700
|
+
if ((view.sandboxorigins ?? []).length > 0) {
|
|
5701
|
+
const originlist = document.createElement("ul");
|
|
5702
|
+
originlist.className = "audit";
|
|
5703
|
+
for (const origin of view.sandboxorigins ?? []) {
|
|
5704
|
+
const item = document.createElement("li");
|
|
5705
|
+
item.textContent = origin;
|
|
5706
|
+
item.append(" ", button("Remove", async () => {
|
|
5707
|
+
await request({ kind: "environments", settings: { sandboxorigins: (view.sandboxorigins ?? []).filter((entry) => entry !== origin) } });
|
|
5708
|
+
await refresh();
|
|
5709
|
+
}));
|
|
5710
|
+
originlist.append(item);
|
|
5711
|
+
}
|
|
5712
|
+
optionsbox.append(originlist);
|
|
5713
|
+
}
|
|
5714
|
+
const intervalinput = document.createElement("input");
|
|
5715
|
+
intervalinput.type = "number";
|
|
5716
|
+
intervalinput.min = "1";
|
|
5717
|
+
intervalinput.placeholder = "keepalive interval ms (roadmap: 30000)";
|
|
5718
|
+
const intervalrow = document.createElement("div");
|
|
5719
|
+
intervalrow.className = "actions";
|
|
5720
|
+
intervalrow.append(intervalinput, " ", button("Set interval", async () => {
|
|
5721
|
+
const value = intervalinput.value.trim();
|
|
5722
|
+
if (value === "") return;
|
|
5723
|
+
await request({ kind: "environments", settings: { keepaliveinterval: Number(value) } });
|
|
5724
|
+
await refresh();
|
|
5725
|
+
}));
|
|
5726
|
+
optionsbox.append(intervalrow);
|
|
5727
|
+
environmentsroot.append(optionsbox);
|
|
5728
|
+
if (view.registry.length > 0) {
|
|
5729
|
+
const registrybox = document.createElement("details");
|
|
5730
|
+
registrybox.className = "sessiongroup";
|
|
5731
|
+
const registrysummary = document.createElement("summary");
|
|
5732
|
+
registrysummary.textContent = "Executor registry";
|
|
5733
|
+
registrybox.append(registrysummary);
|
|
5734
|
+
const registrylist = document.createElement("ul");
|
|
5735
|
+
registrylist.className = "audit";
|
|
5736
|
+
for (const adapter of view.registry) {
|
|
5737
|
+
const item = document.createElement("li");
|
|
5738
|
+
item.textContent = `${adapter.environment} \u2192 ${adapter.adapter}: ${adapter.description}`;
|
|
5739
|
+
registrylist.append(item);
|
|
5740
|
+
}
|
|
5741
|
+
registrybox.append(registrylist);
|
|
5742
|
+
environmentsroot.append(registrybox);
|
|
5743
|
+
}
|
|
5744
|
+
if (view.report.offscreen.length > 0) {
|
|
5745
|
+
const offbox = document.createElement("details");
|
|
5746
|
+
offbox.className = "sessiongroup";
|
|
5747
|
+
const offsummary = document.createElement("summary");
|
|
5748
|
+
offsummary.textContent = `Offscreen documents (${view.report.offscreen.length})`;
|
|
5749
|
+
offbox.append(offsummary);
|
|
5750
|
+
const offlist = document.createElement("ul");
|
|
5751
|
+
offlist.className = "audit";
|
|
5752
|
+
for (const entry of view.report.offscreen) {
|
|
5753
|
+
const item = document.createElement("li");
|
|
5754
|
+
item.textContent = `${entry.document} for the run ${entry.runid}: ${entry.reasons.join(", ")}${entry.closedat !== void 0 ? ` \xB7 closed ${new Date(entry.closedat).toLocaleTimeString()}` : " \xB7 open"} \u2014 ${entry.justification}`;
|
|
5755
|
+
offlist.append(item);
|
|
5756
|
+
}
|
|
5757
|
+
offbox.append(offlist);
|
|
5758
|
+
environmentsroot.append(offbox);
|
|
5759
|
+
}
|
|
5760
|
+
if (view.workerevents.length > 0) {
|
|
5761
|
+
const workerbox = document.createElement("details");
|
|
5762
|
+
workerbox.className = "sessiongroup";
|
|
5763
|
+
const workersummary = document.createElement("summary");
|
|
5764
|
+
workersummary.textContent = `Worker activity (${view.workerevents.length})`;
|
|
5765
|
+
workerbox.append(workersummary);
|
|
5766
|
+
const workerlist = document.createElement("ul");
|
|
5767
|
+
workerlist.className = "audit";
|
|
5768
|
+
for (const event of view.workerevents.slice(0, 10)) {
|
|
5769
|
+
const item = document.createElement("li");
|
|
5770
|
+
item.textContent = `${event.kind} ${event.workers} worker${event.workers === 1 ? "" : "s"}: ${event.reason}`;
|
|
5771
|
+
workerlist.append(item);
|
|
5772
|
+
}
|
|
5773
|
+
workerbox.append(workerlist);
|
|
5774
|
+
environmentsroot.append(workerbox);
|
|
5775
|
+
}
|
|
5776
|
+
if (view.urls.length > 0) {
|
|
5777
|
+
const urlbox = document.createElement("details");
|
|
5778
|
+
urlbox.className = "sessiongroup";
|
|
5779
|
+
const urlsummary = document.createElement("summary");
|
|
5780
|
+
urlsummary.textContent = `Url history of the open run (${view.urls.length})`;
|
|
5781
|
+
urlbox.append(urlsummary);
|
|
5782
|
+
const urllist = document.createElement("ol");
|
|
5783
|
+
urllist.className = "audit";
|
|
5784
|
+
for (const entry of view.urls) {
|
|
5785
|
+
const item = document.createElement("li");
|
|
5786
|
+
item.textContent = `${new Date(entry.at).toLocaleTimeString()} ${entry.url} (step ${entry.stepid})`;
|
|
5787
|
+
urllist.append(item);
|
|
5788
|
+
}
|
|
5789
|
+
urlbox.append(urllist);
|
|
5790
|
+
environmentsroot.append(urlbox);
|
|
5791
|
+
}
|
|
5792
|
+
const locksbox = document.createElement("details");
|
|
5793
|
+
locksbox.className = "sessiongroup";
|
|
5794
|
+
const lockssummary = document.createElement("summary");
|
|
5795
|
+
lockssummary.textContent = `Run locks (${view.locks.length})`;
|
|
5796
|
+
locksbox.append(lockssummary);
|
|
5797
|
+
if (view.locks.length === 0) {
|
|
5798
|
+
const none = document.createElement("p");
|
|
5799
|
+
none.textContent = "No session holds a run lock; one session never carries two concurrent runs.";
|
|
5800
|
+
locksbox.append(none);
|
|
5801
|
+
}
|
|
5802
|
+
const locklist = document.createElement("ul");
|
|
5803
|
+
locklist.className = "audit";
|
|
5804
|
+
for (const lock of view.locks) {
|
|
5805
|
+
const item = document.createElement("li");
|
|
5806
|
+
item.textContent = `Session ${lock.sessionid} \u2192 run ${lock.runid} (${lock.holder})${lock.expiresat !== void 0 ? ` \xB7 expires ${new Date(lock.expiresat).toLocaleTimeString()}` : " \xB7 no expiry"}`;
|
|
5807
|
+
locklist.append(item);
|
|
5808
|
+
}
|
|
5809
|
+
locksbox.append(locklist);
|
|
5810
|
+
environmentsroot.append(locksbox);
|
|
5811
|
+
}
|
|
5546
5812
|
function renderagents(context) {
|
|
5547
5813
|
if (!agentsroot) return;
|
|
5548
5814
|
agentsroot.replaceChildren();
|
|
@@ -6430,4 +6696,31 @@ function renderagents(context) {
|
|
|
6430
6696
|
agentsroot.append(eventbox);
|
|
6431
6697
|
}
|
|
6432
6698
|
}
|
|
6699
|
+
{
|
|
6700
|
+
let sandboxframe;
|
|
6701
|
+
chrome.runtime.onMessage.addListener((message, _sender, sendresponse) => {
|
|
6702
|
+
if (!message || message.kind !== "environments" || message.action !== "sandboxhost" || !message.render?.nonce) return false;
|
|
6703
|
+
try {
|
|
6704
|
+
if (!sandboxframe) {
|
|
6705
|
+
sandboxframe = document.createElement("iframe");
|
|
6706
|
+
sandboxframe.src = chrome.runtime.getURL("sandbox.html");
|
|
6707
|
+
sandboxframe.style.display = "none";
|
|
6708
|
+
sandboxframe.setAttribute("aria-hidden", "true");
|
|
6709
|
+
document.body.append(sandboxframe);
|
|
6710
|
+
}
|
|
6711
|
+
sandboxframe.contentWindow?.postMessage({ channel: "devthinksandbox", type: "render", nonce: message.render.nonce, markup: message.render.markup ?? "" }, "*");
|
|
6712
|
+
const waitfor = (event) => {
|
|
6713
|
+
const data = event.data;
|
|
6714
|
+
if (data?.channel !== "devthinksandbox" || data.type !== "renderresult" || data.nonce !== message.render?.nonce) return;
|
|
6715
|
+
window.removeEventListener("message", waitfor);
|
|
6716
|
+
sendresponse({ ok: data.ok !== false, text: data.text ?? "", summary: data.summary ?? "The sandbox frame returned its render result." });
|
|
6717
|
+
};
|
|
6718
|
+
window.addEventListener("message", waitfor);
|
|
6719
|
+
return true;
|
|
6720
|
+
} catch {
|
|
6721
|
+
sendresponse({ ok: false, text: "", summary: "The sandbox host could not open the sandboxed page." });
|
|
6722
|
+
return true;
|
|
6723
|
+
}
|
|
6724
|
+
});
|
|
6725
|
+
}
|
|
6433
6726
|
//# sourceMappingURL=sidepanel.js.map
|