@wenathlan/extension 1.1.59 → 1.1.61
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 +5 -3
- package/dist/cli.js +19 -2
- package/dist/environments.d.ts +96 -0
- package/dist/environments.d.ts.map +1 -0
- package/dist/immutablelog.d.ts +73 -0
- package/dist/immutablelog.d.ts.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1092 -1
- package/dist/index.js.map +4 -4
- package/dist/maskinputs.d.ts +52 -0
- package/dist/maskinputs.d.ts.map +1 -0
- package/dist/memory.d.ts +119 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/originpolicy.d.ts +150 -0
- package/dist/originpolicy.d.ts.map +1 -0
- package/dist/policy.d.ts +87 -1
- package/dist/policy.d.ts.map +1 -1
- package/dist/protocol.d.ts +121 -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 +312 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/extension/dist/background.js +1629 -50
- 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 +98 -28
- package/extension/dist/pagebridge.js.map +3 -3
- package/extension/dist/popup.html +1 -1
- package/extension/dist/popup.js +77 -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 +572 -0
- package/extension/dist/sidepanel.js.map +4 -4
- package/extension/manifest.json +16 -2
- package/package.json +1 -1
|
@@ -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</title><link rel="stylesheet" href="style.css"></head>
|
|
4
|
-
<body><main><header><p class="eyebrow">DEVTHINK 1.1.
|
|
4
|
+
<body><main><header><p class="eyebrow">DEVTHINK 1.1.61</p><h1>Browser bridge</h1><p>Consent is required before page access or action.</p></header><label for="endpoint">Optional agent endpoint</label><input id="endpoint" type="url" inputmode="url" placeholder="https://agent.example/proposal" autocomplete="off"><button id="connect">Approve endpoint origin</button><div class="actions"><button id="session">Start active tab session</button><button id="pause" class="secondary">Pause session</button><button id="openpanel" class="secondary">Review plans</button><button id="stop" class="danger">Stop</button></div><p id="capabilities" role="status" class="muted">Optional capabilities: loading.</p><p id="livelogic" role="status" class="muted">Held keys: none · Open dialogs answered: none.</p><p id="navstate" role="status" class="muted">Navigation: unknown.</p><p id="windowlayout" role="status" class="muted">Window layout: unknown.</p><p id="captchastate" role="status" class="muted">Captcha handoff: none.</p><p id="datasetstate" role="status" class="muted">Datasets: none collected yet.</p><p id="downloadstate" role="status" class="muted">Downloads: none.</p><p id="clipboardstate" role="status" class="muted">Clipboard consent: none waiting.</p><p id="capturestate" role="status" class="muted">Captures: none.</p><p id="mediastate" role="status" class="muted">Media: none.</p><p id="callstate" role="status" class="muted">Outbound calls: none.</p><p id="netstate" role="status" class="muted">Observed requests: none.</p><p id="rulestate" role="status" class="muted">Traffic rules: none active.</p><p id="debugstate" role="status" class="muted">Timeline: no errors captured.</p><p id="emulationstate" role="status" class="muted">Emulation: no active layer.</p><p id="sessionstate" role="status" class="muted">Sessions: none saved yet.</p><p id="workflowstate" role="status" class="muted">Workflows: none running.</p><p id="triggerstate" role="status" class="muted">Triggers: none armed.</p><p id="mcpstate" role="status" class="muted">Mcp server: stopped.</p><p id="modelstate" role="status" class="muted">Models: none connected.</p><p id="swarmstate" role="status" class="muted">Swarm: no agents.</p><p id="environmentstate" role="status" class="muted">Environments: no run state.</p><p id="securitystate" role="status" class="muted">Security: denydefault posture.</p><div id="workflowcontrols" class="actions"></div><div id="windowcontrols" class="actions"></div><div id="environmentcontrols" class="actions"></div><div id="securitycontrols" class="actions"></div><p id="status" role="status">Loading session state.</p></main><script type="module" src="popup.js"></script></body>
|
|
5
5
|
</html>
|
package/extension/dist/popup.js
CHANGED
|
@@ -39,6 +39,10 @@ var triggerstatenode = document.querySelector("#triggerstate");
|
|
|
39
39
|
var mcpstatenode = document.querySelector("#mcpstate");
|
|
40
40
|
var modelstatenode = document.querySelector("#modelstate");
|
|
41
41
|
var swarmstatenode = document.querySelector("#swarmstate");
|
|
42
|
+
var environmentstatenode = document.querySelector("#environmentstate");
|
|
43
|
+
var securitystatenode = document.querySelector("#securitystate");
|
|
44
|
+
var securitycontrols = document.querySelector("#securitycontrols");
|
|
45
|
+
var environmentcontrols = document.querySelector("#environmentcontrols");
|
|
42
46
|
var workflowcontrols = document.querySelector("#workflowcontrols");
|
|
43
47
|
var windowcontrols = document.querySelector("#windowcontrols");
|
|
44
48
|
var connectbutton = document.querySelector("#connect");
|
|
@@ -268,6 +272,77 @@ function rendermodelstate(state) {
|
|
|
268
272
|
const routed = state.tasks.filter((task) => task.provider !== void 0);
|
|
269
273
|
modelstatenode.textContent = `Models: ${routed.length > 0 ? routed.slice(0, 3).map((task) => `${task.kind} ${task.model}`).join(" \xB7 ") : "no route yet"} \xB7 ${state.usage.calls} call${state.usage.calls === 1 ? "" : "s"} \xB7 ${state.usage.totaltokens} tokens.`;
|
|
270
274
|
}
|
|
275
|
+
function renderenvironmentstate(view) {
|
|
276
|
+
if (!environmentstatenode) return;
|
|
277
|
+
if (!view) {
|
|
278
|
+
environmentstatenode.textContent = "Environments: no run state.";
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const counted = /* @__PURE__ */ new Map();
|
|
282
|
+
for (const entry of view.report.environments) counted.set(entry.environment, (counted.get(entry.environment) ?? 0) + 1);
|
|
283
|
+
const breakdown = [...counted.entries()].map(([environment, count]) => `${environment} ${count}`).join(" \xB7 ");
|
|
284
|
+
const keepalive = view.report.keepalive;
|
|
285
|
+
environmentstatenode.textContent = `Environments: ${breakdown.length > 0 ? breakdown : "no step executed"} \xB7 offscreen ${view.offscreengranted ? "granted" : "absent"} \xB7 offload ${view.parseoffload ? "on" : "off"}${view.report.workers > 0 ? ` \xB7 workers ${view.report.workers}` : ""} \xB7 keepalive ${keepalive ? `${keepalive.state === "active" && keepalive.portopen ? "\u2665" : "closed"} ${keepalive.beats} beat${keepalive.beats === 1 ? "" : "s"}` : "none"}${view.zombies.length > 0 ? ` \xB7 zombie runs ${view.zombies.join(", ")}` : ""}${view.grants !== void 0 ? ` \xB7 grants ${view.grants.length > 0 ? view.grants.join(", ") : "default"}` : ""}.`;
|
|
286
|
+
if (keepalive?.state === "active" && keepalive.portopen) environmentstatenode.dataset.state = "active";
|
|
287
|
+
else delete environmentstatenode.dataset.state;
|
|
288
|
+
if (environmentcontrols) {
|
|
289
|
+
environmentcontrols.replaceChildren();
|
|
290
|
+
if (view.zombies.length > 0) {
|
|
291
|
+
const reap = document.createElement("button");
|
|
292
|
+
reap.className = "secondary";
|
|
293
|
+
reap.textContent = "Reap zombie runs";
|
|
294
|
+
reap.addEventListener("click", () => {
|
|
295
|
+
void request({ kind: "runstate", reap: true }).then(() => restore()).catch((error) => status(error instanceof Error ? error.message : String(error), true));
|
|
296
|
+
});
|
|
297
|
+
environmentcontrols.append(reap);
|
|
298
|
+
}
|
|
299
|
+
if (!view.offscreengranted) {
|
|
300
|
+
const grant = document.createElement("button");
|
|
301
|
+
grant.className = "secondary";
|
|
302
|
+
grant.textContent = "Request offscreen grant";
|
|
303
|
+
grant.addEventListener("click", () => {
|
|
304
|
+
void request({ kind: "environments", requestcapability: true }).then(() => restore()).catch((error) => status(error instanceof Error ? error.message : String(error), true));
|
|
305
|
+
});
|
|
306
|
+
environmentcontrols.append(grant);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function rendersecuritystate(view, activeorigin) {
|
|
311
|
+
if (!securitystatenode) return;
|
|
312
|
+
if (!view) {
|
|
313
|
+
securitystatenode.textContent = "Security: state unknown.";
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const origin = activeorigin ?? view.sessionorigin ?? "the active tab";
|
|
317
|
+
const granted = view.allowlist.some((entry) => entry.origin === origin);
|
|
318
|
+
const profile = view.profiles.find((candidate) => candidate.origin === origin);
|
|
319
|
+
const windowstate = view.windows.find((candidate) => candidate.origin === origin && candidate.state === "active");
|
|
320
|
+
const verified = view.chain.filter((chain) => chain.valid).length;
|
|
321
|
+
securitystatenode.textContent = `Security: ${origin} ${granted ? "allowlisted" : "ungranted (denydefault)"}${profile !== void 0 ? ` \xB7 profile ${profile.grants.length} granted / ${profile.denials.length} denied` : " \xB7 no origin profile"}${windowstate !== void 0 ? ` \xB7 consent window until ${new Date(windowstate.expiresat).toLocaleTimeString()}` : " \xB7 no active consent window"} \xB7 ${verified}/${view.chain.length} log chain${view.chain.length === 1 ? "" : "s"} verified.`;
|
|
322
|
+
if (granted) delete securitystatenode.dataset.state;
|
|
323
|
+
else securitystatenode.dataset.state = "error";
|
|
324
|
+
if (securitycontrols) {
|
|
325
|
+
securitycontrols.replaceChildren();
|
|
326
|
+
if (!granted) {
|
|
327
|
+
const grant = document.createElement("button");
|
|
328
|
+
grant.className = "secondary";
|
|
329
|
+
grant.textContent = `Grant ${origin} allowlist entry`;
|
|
330
|
+
grant.addEventListener("click", () => {
|
|
331
|
+
void request({ kind: "security", allowlist: { add: { origin } } }).then(() => restore()).catch((error) => status(error instanceof Error ? error.message : String(error), true));
|
|
332
|
+
});
|
|
333
|
+
securitycontrols.append(grant);
|
|
334
|
+
}
|
|
335
|
+
if (view.chain.length > 0) {
|
|
336
|
+
const seal = view.chain.find((chain) => chain.sealhash !== void 0);
|
|
337
|
+
if (seal?.sealhash !== void 0) {
|
|
338
|
+
const sealinfo = document.createElement("span");
|
|
339
|
+
sealinfo.className = "muted";
|
|
340
|
+
sealinfo.textContent = `Seal ${seal.sealhash.slice(0, 10)}\u2026`;
|
|
341
|
+
securitycontrols.append(sealinfo);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
271
346
|
function renderswarmstate(state) {
|
|
272
347
|
if (!swarmstatenode) return;
|
|
273
348
|
if (!state) {
|
|
@@ -323,6 +398,8 @@ async function restore() {
|
|
|
323
398
|
rendermcpstate(context.mcp);
|
|
324
399
|
rendermodelstate(context.llm);
|
|
325
400
|
renderswarmstate(context.swarm);
|
|
401
|
+
renderenvironmentstate(context.environments);
|
|
402
|
+
rendersecuritystate(context.security, context.session?.origin);
|
|
326
403
|
renderrulestate(context.activerules, (context.traffic?.blocks ?? []).filter((rule) => rule.revertedat === void 0).reduce((total, rule) => total + rule.hits, 0), (context.traffic?.mocks ?? []).filter((spec) => spec.revertedat === void 0).reduce((total, spec) => total + spec.hits, 0));
|
|
327
404
|
const active = context.session && !context.session.stoppedat && context.session.expiresat > Date.now();
|
|
328
405
|
if (pausebutton) {
|