@quanta-intellect/vessel-browser 0.1.104 → 0.1.114
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 -5
- package/out/main/index.js +867 -557
- package/out/preload/content-script.js +20 -3
- package/out/preload/index.js +7 -0
- package/out/renderer/assets/{index-D3ABnKy4.js → index-CT4KWUML.js} +527 -357
- package/out/renderer/index.html +1 -1
- package/package.json +1 -1
|
@@ -2151,13 +2151,30 @@ const PAGE_DIFF_MUTATION_DEBOUNCE_MS = 1200;
|
|
|
2151
2151
|
function normalizeSignatureText(value) {
|
|
2152
2152
|
return (value || "").replace(/\s+/g, " ").trim();
|
|
2153
2153
|
}
|
|
2154
|
+
function collectBoundedVisibleText(root, maxLength) {
|
|
2155
|
+
if (!root) return "";
|
|
2156
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
|
|
2157
|
+
const parts = [];
|
|
2158
|
+
let length = 0;
|
|
2159
|
+
while (length < maxLength) {
|
|
2160
|
+
const node = walker.nextNode();
|
|
2161
|
+
if (!node) break;
|
|
2162
|
+
const parent = node.parentElement;
|
|
2163
|
+
if (!parent || parent.closest("script, style, noscript, [hidden], [aria-hidden='true']")) {
|
|
2164
|
+
continue;
|
|
2165
|
+
}
|
|
2166
|
+
const text = normalizeSignatureText(node.textContent);
|
|
2167
|
+
if (!text) continue;
|
|
2168
|
+
parts.push(text);
|
|
2169
|
+
length += text.length + 1;
|
|
2170
|
+
}
|
|
2171
|
+
return parts.join(" ").slice(0, maxLength);
|
|
2172
|
+
}
|
|
2154
2173
|
function getPageDiffSignature() {
|
|
2155
2174
|
const title = normalizeSignatureText(document.title);
|
|
2156
2175
|
const headings = Array.from(document.querySelectorAll("h1, h2, h3")).slice(0, 8).map((el) => normalizeSignatureText(el.textContent)).filter(Boolean).join(" | ");
|
|
2157
2176
|
const mainRoot = document.querySelector("main, article, [role='main']") || document.body;
|
|
2158
|
-
const visibleText =
|
|
2159
|
-
mainRoot instanceof HTMLElement ? mainRoot.innerText : document.body?.innerText || ""
|
|
2160
|
-
).slice(0, 1200);
|
|
2177
|
+
const visibleText = collectBoundedVisibleText(mainRoot, 1200);
|
|
2161
2178
|
return [window.location.href, title, headings, visibleText].join("\n");
|
|
2162
2179
|
}
|
|
2163
2180
|
function asElement(node) {
|
package/out/preload/index.js
CHANGED
|
@@ -55,6 +55,8 @@ const Channels = {
|
|
|
55
55
|
SETTINGS_HEALTH_GET: "settings:health:get",
|
|
56
56
|
SETTINGS_HEALTH_UPDATE: "settings:health:update",
|
|
57
57
|
MCP_REGENERATE_TOKEN: "mcp:regenerate-token",
|
|
58
|
+
// Support
|
|
59
|
+
SUPPORT_SUBMIT_FEEDBACK: "support:submit-feedback",
|
|
58
60
|
// Bookmarks
|
|
59
61
|
BOOKMARKS_GET: "bookmarks:get",
|
|
60
62
|
BOOKMARKS_UPDATE: "bookmarks:update",
|
|
@@ -125,6 +127,7 @@ const Channels = {
|
|
|
125
127
|
FIND_IN_PAGE_RESULT: "find:result",
|
|
126
128
|
// Browsing history
|
|
127
129
|
HISTORY_GET: "history:get",
|
|
130
|
+
HISTORY_LIST: "history:list",
|
|
128
131
|
HISTORY_SEARCH: "history:search",
|
|
129
132
|
HISTORY_CLEAR: "history:clear",
|
|
130
133
|
HISTORY_UPDATE: "history:update",
|
|
@@ -398,6 +401,9 @@ const api = {
|
|
|
398
401
|
return () => electron.ipcRenderer.removeListener(Channels.SETTINGS_UPDATE, handler);
|
|
399
402
|
}
|
|
400
403
|
},
|
|
404
|
+
support: {
|
|
405
|
+
submitFeedback: (email, message) => electron.ipcRenderer.invoke(Channels.SUPPORT_SUBMIT_FEEDBACK, email, message)
|
|
406
|
+
},
|
|
401
407
|
bookmarks: {
|
|
402
408
|
get: () => electron.ipcRenderer.invoke(Channels.BOOKMARKS_GET),
|
|
403
409
|
saveBookmark: (url, title, folderId, note, intent, expectedContent, keyFields, agentHints) => electron.ipcRenderer.invoke(
|
|
@@ -457,6 +463,7 @@ const api = {
|
|
|
457
463
|
},
|
|
458
464
|
history: {
|
|
459
465
|
get: () => electron.ipcRenderer.invoke(Channels.HISTORY_GET),
|
|
466
|
+
list: (offset, limit) => electron.ipcRenderer.invoke(Channels.HISTORY_LIST, offset, limit),
|
|
460
467
|
search: (query) => electron.ipcRenderer.invoke(Channels.HISTORY_SEARCH, query),
|
|
461
468
|
clear: () => electron.ipcRenderer.invoke(Channels.HISTORY_CLEAR),
|
|
462
469
|
exportHtml: () => electron.ipcRenderer.invoke(Channels.HISTORY_EXPORT_HTML),
|