@wenathlan/extension 1.1.37 → 1.1.39
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 +6 -4
- package/dist/index.js +440 -8
- package/dist/index.js.map +2 -2
- package/dist/memory.d.ts +83 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/policy.d.ts +25 -1
- package/dist/policy.d.ts.map +1 -1
- package/dist/protocol.d.ts +46 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/types.d.ts +209 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/extension/dist/background.js +1540 -14
- package/extension/dist/background.js.map +4 -4
- package/extension/dist/manifest.json +1 -1
- package/extension/dist/pagebridge.js +199 -2
- package/extension/dist/pagebridge.js.map +4 -4
- package/extension/dist/popup.html +1 -1
- package/extension/dist/popup.js +41 -2
- package/extension/dist/popup.js.map +2 -2
- package/extension/dist/sidepanel.html +1 -1
- package/extension/dist/sidepanel.js +340 -2
- package/extension/dist/sidepanel.js.map +4 -4
- package/extension/manifest.json +1 -1
- 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.39</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><div id="windowcontrols" 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
|
@@ -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"]);
|
|
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"]);
|
|
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"]);
|
|
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"]);
|
|
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"]);
|
|
5
5
|
var allowedactions = /* @__PURE__ */ new Set([...sensitiveactions, ...interactionactions, ...readactions]);
|
|
6
6
|
function normalizeendpoint(value) {
|
|
7
7
|
const endpoint = new URL(value.trim());
|
|
@@ -23,6 +23,9 @@ var livenode = document.querySelector("#livelogic");
|
|
|
23
23
|
var navstatenode = document.querySelector("#navstate");
|
|
24
24
|
var windowlayoutnode = document.querySelector("#windowlayout");
|
|
25
25
|
var captchastatenode = document.querySelector("#captchastate");
|
|
26
|
+
var datasetstatenode = document.querySelector("#datasetstate");
|
|
27
|
+
var downloadstatenode = document.querySelector("#downloadstate");
|
|
28
|
+
var clipboardstatenode = document.querySelector("#clipboardstate");
|
|
26
29
|
var windowcontrols = document.querySelector("#windowcontrols");
|
|
27
30
|
var connectbutton = document.querySelector("#connect");
|
|
28
31
|
var sessionbutton = document.querySelector("#session");
|
|
@@ -97,6 +100,39 @@ function rendercaptchastate(captchas) {
|
|
|
97
100
|
delete captchastatenode.dataset.state;
|
|
98
101
|
captchastatenode.textContent = "Captcha handoff: none.";
|
|
99
102
|
}
|
|
103
|
+
function renderdatasetstate(datasets, streams) {
|
|
104
|
+
if (!datasetstatenode) return;
|
|
105
|
+
const rows = (datasets ?? []).reduce((total, datasetvalue) => total + datasetvalue.rows.length, 0);
|
|
106
|
+
const count = datasets?.length ?? 0;
|
|
107
|
+
const stream = (streams ?? []).find((item) => item.done !== true) ?? (streams ?? [])[0];
|
|
108
|
+
const streamsummary = stream ? ` \xB7 stream ${stream.name} chunk ${stream.chunk} of ${stream.chunks}${stream.done ? " complete" : ""}` : "";
|
|
109
|
+
datasetstatenode.textContent = count === 0 ? "Datasets: none collected yet." : `Datasets: ${count} collected (${rows} row${rows === 1 ? "" : "s"})${streamsummary}.`;
|
|
110
|
+
}
|
|
111
|
+
function renderdownloadstate(downloads, quarantines) {
|
|
112
|
+
if (!downloadstatenode) return;
|
|
113
|
+
const states = (downloads ?? []).filter((record) => record.state === "running" || record.state === "queued" || record.state === "paused");
|
|
114
|
+
const completed = (downloads ?? []).filter((record) => record.state === "complete").length;
|
|
115
|
+
const failed = (downloads ?? []).filter((record) => record.state === "failed").length;
|
|
116
|
+
const pending = (quarantines ?? []).filter((entry) => entry.scan === "pending").length;
|
|
117
|
+
const parts = [
|
|
118
|
+
states.length > 0 ? `${states.length} in flight (${states.map((record) => record.state).join(" \xB7 ")})` : "",
|
|
119
|
+
completed > 0 ? `${completed} completed` : "",
|
|
120
|
+
failed > 0 ? `${failed} failed` : "",
|
|
121
|
+
pending > 0 ? `${pending} quarantined awaiting scan` : ""
|
|
122
|
+
].filter(Boolean);
|
|
123
|
+
downloadstatenode.textContent = (downloads ?? []).length === 0 && pending === 0 ? "Downloads: none." : `Downloads: ${parts.join(" \xB7 ") || "none active"}.`;
|
|
124
|
+
}
|
|
125
|
+
function renderclipboardstate(consents) {
|
|
126
|
+
if (!clipboardstatenode) return;
|
|
127
|
+
const waiting = (consents ?? []).filter((record) => record.approved === void 0);
|
|
128
|
+
if (waiting.length > 0) {
|
|
129
|
+
clipboardstatenode.dataset.state = "error";
|
|
130
|
+
clipboardstatenode.textContent = `Clipboard consent: ${waiting.length} read prompt${waiting.length === 1 ? "" : "s"} waiting for your approval in the review panel.`;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
delete clipboardstatenode.dataset.state;
|
|
134
|
+
clipboardstatenode.textContent = "Clipboard consent: none waiting.";
|
|
135
|
+
}
|
|
100
136
|
async function restore() {
|
|
101
137
|
const context = await request({ kind: "context" });
|
|
102
138
|
if (endpointinput && context.config) endpointinput.value = context.config.endpoint;
|
|
@@ -105,6 +141,9 @@ async function restore() {
|
|
|
105
141
|
rendernavstate(context.navstate, context.offline, context.waitprofile, context.navqueues);
|
|
106
142
|
renderwindowlayout(context.windows, context.badges);
|
|
107
143
|
rendercaptchastate(context.captchas);
|
|
144
|
+
renderdatasetstate(context.datasets, context.streams);
|
|
145
|
+
renderdownloadstate(context.downloads, context.quarantines);
|
|
146
|
+
renderclipboardstate(context.clipconsents);
|
|
108
147
|
const active = context.session && !context.session.stoppedat && context.session.expiresat > Date.now();
|
|
109
148
|
if (pausebutton) {
|
|
110
149
|
pausebutton.disabled = !active;
|