@quanta-intellect/vessel-browser 0.1.133 → 0.1.134
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/out/main/index.js +28 -72
- package/package.json +1 -1
package/out/main/index.js
CHANGED
|
@@ -1535,7 +1535,7 @@ function applyTextRangeMatch(match, solidColor, bgColor, fullText) {
|
|
|
1535
1535
|
try {
|
|
1536
1536
|
var mark = markTextSegment(segments[i], solidColor, bgColor, fullText);
|
|
1537
1537
|
if (mark) marks.unshift(mark);
|
|
1538
|
-
} catch (_e) {}
|
|
1538
|
+
} catch (_e) { /* text segment couldn't be marked — it may overlap other highlights */ }
|
|
1539
1539
|
}
|
|
1540
1540
|
return marks;
|
|
1541
1541
|
}
|
|
@@ -1875,7 +1875,7 @@ async function highlightBatchOnPage(wc, entries) {
|
|
|
1875
1875
|
el.style.setProperty('outline-color', c.solid, 'important');
|
|
1876
1876
|
el.style.setProperty('box-shadow', '0 0 8px ' + c.glow, 'important');
|
|
1877
1877
|
}
|
|
1878
|
-
} catch (_e) {}
|
|
1878
|
+
} catch (_e) { /* selector may not exist on current page */ }
|
|
1879
1879
|
}
|
|
1880
1880
|
}
|
|
1881
1881
|
})()
|
|
@@ -5673,6 +5673,7 @@ const PRELOAD_EXTRACTION_SCRIPT = String.raw`
|
|
|
5673
5673
|
}
|
|
5674
5674
|
}
|
|
5675
5675
|
} catch (_error) {
|
|
5676
|
+
// Structured extraction unavailable, fall through to direct extraction
|
|
5676
5677
|
}
|
|
5677
5678
|
return null;
|
|
5678
5679
|
})()
|
|
@@ -6312,9 +6313,9 @@ const DIRECT_EXTRACTION_SCRIPT = String.raw`
|
|
|
6312
6313
|
} else if (parsed && typeof parsed === "object") {
|
|
6313
6314
|
jsonLd.push(parsed);
|
|
6314
6315
|
}
|
|
6315
|
-
} catch (_e) {}
|
|
6316
|
+
} catch (_e) { /* skip malformed JSON-LD block */ }
|
|
6316
6317
|
});
|
|
6317
|
-
} catch (_e) {}
|
|
6318
|
+
} catch (_e) { /* no JSON-LD scripts found or querySelectorAll failed */ }
|
|
6318
6319
|
|
|
6319
6320
|
// Extract meta tags as fallback
|
|
6320
6321
|
var metaTags = {};
|
|
@@ -6327,8 +6328,7 @@ const DIRECT_EXTRACTION_SCRIPT = String.raw`
|
|
|
6327
6328
|
});
|
|
6328
6329
|
var canonical = document.querySelector('link[rel="canonical"]');
|
|
6329
6330
|
if (canonical && canonical.getAttribute("href")) metaTags["canonical"] = canonical.getAttribute("href");
|
|
6330
|
-
} catch (_e) {}
|
|
6331
|
-
|
|
6331
|
+
} catch (_e) { /* meta tag extraction failed — non-critical */ }
|
|
6332
6332
|
return {
|
|
6333
6333
|
title: document.title,
|
|
6334
6334
|
content: getCleanBodyText(),
|
|
@@ -9141,6 +9141,9 @@ class OpenAICompatProvider {
|
|
|
9141
9141
|
this.abortController?.abort();
|
|
9142
9142
|
}
|
|
9143
9143
|
}
|
|
9144
|
+
function escapeHtml(value) {
|
|
9145
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
9146
|
+
}
|
|
9144
9147
|
async function openExternalAllowlisted(url, rule) {
|
|
9145
9148
|
const parsed = new URL(url);
|
|
9146
9149
|
const schemes = rule.schemes ?? ["https:"];
|
|
@@ -9451,9 +9454,6 @@ async function refreshAccessToken(tokens) {
|
|
|
9451
9454
|
};
|
|
9452
9455
|
return refreshedTokens;
|
|
9453
9456
|
}
|
|
9454
|
-
function escapeHtml$1(text) {
|
|
9455
|
-
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
9456
|
-
}
|
|
9457
9457
|
const codexOAuth = createLocalPkceOAuthFlow({
|
|
9458
9458
|
name: "Codex",
|
|
9459
9459
|
logger: logger$p,
|
|
@@ -9465,7 +9465,7 @@ const codexOAuth = createLocalPkceOAuthFlow({
|
|
|
9465
9465
|
buildAuthorizeUrl: ({ callbackUrl, pkce, state: state2 }) => buildAuthorizeUrl(callbackUrl, pkce, state2),
|
|
9466
9466
|
exchangeCode: ({ code, callbackUrl, codeVerifier }) => exchangeCodeForTokens(code, callbackUrl, codeVerifier),
|
|
9467
9467
|
successHtml: (tokens) => {
|
|
9468
|
-
const label = escapeHtml
|
|
9468
|
+
const label = escapeHtml(tokens.accountEmail || tokens.accountId);
|
|
9469
9469
|
return `<!DOCTYPE html>
|
|
9470
9470
|
<html><head><meta charset="utf-8"><title>Vessel — Signed In</title>
|
|
9471
9471
|
<style>body{font-family:system-ui,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#111;color:#eee}</style></head>
|
|
@@ -17844,60 +17844,7 @@ WARNING: This page shows no results. You likely clicked a filter or category lin
|
|
|
17844
17844
|
}
|
|
17845
17845
|
return "";
|
|
17846
17846
|
}
|
|
17847
|
-
const KNOWN_TOOLS =
|
|
17848
|
-
"current_tab",
|
|
17849
|
-
"list_tabs",
|
|
17850
|
-
"switch_tab",
|
|
17851
|
-
"create_tab",
|
|
17852
|
-
"navigate",
|
|
17853
|
-
"go_back",
|
|
17854
|
-
"go_forward",
|
|
17855
|
-
"reload",
|
|
17856
|
-
"click",
|
|
17857
|
-
"inspect_element",
|
|
17858
|
-
"type_text",
|
|
17859
|
-
"select_option",
|
|
17860
|
-
"submit_form",
|
|
17861
|
-
"press_key",
|
|
17862
|
-
"scroll",
|
|
17863
|
-
"hover",
|
|
17864
|
-
"focus",
|
|
17865
|
-
"set_ad_blocking",
|
|
17866
|
-
"dismiss_popup",
|
|
17867
|
-
"clear_overlays",
|
|
17868
|
-
"read_page",
|
|
17869
|
-
"screenshot",
|
|
17870
|
-
"wait_for",
|
|
17871
|
-
"create_checkpoint",
|
|
17872
|
-
"restore_checkpoint",
|
|
17873
|
-
"save_session",
|
|
17874
|
-
"load_session",
|
|
17875
|
-
"list_sessions",
|
|
17876
|
-
"delete_session",
|
|
17877
|
-
"list_bookmarks",
|
|
17878
|
-
"search_bookmarks",
|
|
17879
|
-
"create_bookmark_folder",
|
|
17880
|
-
"save_bookmark",
|
|
17881
|
-
"organize_bookmark",
|
|
17882
|
-
"archive_bookmark",
|
|
17883
|
-
"open_bookmark",
|
|
17884
|
-
"highlight",
|
|
17885
|
-
"clear_highlights",
|
|
17886
|
-
"flow_start",
|
|
17887
|
-
"flow_advance",
|
|
17888
|
-
"flow_status",
|
|
17889
|
-
"flow_end",
|
|
17890
|
-
"suggest",
|
|
17891
|
-
"fill_form",
|
|
17892
|
-
"login",
|
|
17893
|
-
"search",
|
|
17894
|
-
"paginate",
|
|
17895
|
-
"accept_cookies",
|
|
17896
|
-
"extract_table",
|
|
17897
|
-
"scroll_to_element",
|
|
17898
|
-
"metrics",
|
|
17899
|
-
"wait_for_navigation"
|
|
17900
|
-
]);
|
|
17847
|
+
const KNOWN_TOOLS = new Set(TOOL_DEFINITIONS.map((d) => d.name));
|
|
17901
17848
|
async function executeAction(name, args, ctx) {
|
|
17902
17849
|
name = normalizeToolAlias(name);
|
|
17903
17850
|
if (ctx.tabId && ctx._tabMutex) {
|
|
@@ -21717,9 +21664,6 @@ function renderReaderContent(page) {
|
|
|
21717
21664
|
}
|
|
21718
21665
|
return source.split(/\n{2,}/).map((block) => block.trim()).filter(Boolean).map((block) => `<p>${escapeHtml(block).replace(/\n/g, "<br>")}</p>`).join("\n");
|
|
21719
21666
|
}
|
|
21720
|
-
function escapeHtml(str) {
|
|
21721
|
-
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
21722
|
-
}
|
|
21723
21667
|
function registerContentHandlers(windowState2) {
|
|
21724
21668
|
const { tabManager } = windowState2;
|
|
21725
21669
|
electron.ipcMain.handle(Channels.CONTENT_EXTRACT, async (event) => {
|
|
@@ -23518,6 +23462,7 @@ function registerBookmarkTools(server, tabManager, runtime2) {
|
|
|
23518
23462
|
return `Opened bookmark "${bookmark.title}" in new tab ${createdId}`;
|
|
23519
23463
|
}
|
|
23520
23464
|
const activeId = tabManager.getActiveTabId();
|
|
23465
|
+
if (!activeId) return "No active tab to open bookmark in";
|
|
23521
23466
|
const activeTab = tabManager.getActiveTab();
|
|
23522
23467
|
tabManager.navigateTab(activeId, bookmark.url);
|
|
23523
23468
|
if (activeTab) {
|
|
@@ -24008,9 +23953,12 @@ async function requestConsent(request) {
|
|
|
24008
23953
|
if (sessionTrustedDomains.has(domain)) {
|
|
24009
23954
|
return { approved: true, trustForSession: true };
|
|
24010
23955
|
}
|
|
24011
|
-
const
|
|
23956
|
+
const parentWindow = electron.BrowserWindow.getFocusedWindow() ?? electron.BrowserWindow.getAllWindows()[0];
|
|
23957
|
+
if (!parentWindow) {
|
|
23958
|
+
return { approved: false, trustForSession: false };
|
|
23959
|
+
}
|
|
24012
23960
|
const { response } = await electron.dialog.showMessageBox(
|
|
24013
|
-
|
|
23961
|
+
parentWindow,
|
|
24014
23962
|
{
|
|
24015
23963
|
type: "question",
|
|
24016
23964
|
title: "Agent Credential Access",
|
|
@@ -24643,6 +24591,7 @@ ${buildScopedContext(pageContent, mode)}`;
|
|
|
24643
24591
|
}
|
|
24644
24592
|
return withAction(runtime2, tabManager, "navigate", { url }, async () => {
|
|
24645
24593
|
const id = tabManager.getActiveTabId();
|
|
24594
|
+
if (!id) return asNoActiveTabResponse();
|
|
24646
24595
|
const navError = tabManager.navigateTab(id, url, postBody);
|
|
24647
24596
|
if (navError) return navError;
|
|
24648
24597
|
const { httpStatus } = await waitForLoadWithStatus(
|
|
@@ -24766,7 +24715,9 @@ ${buildScopedContext(pageContent, mode)}`;
|
|
|
24766
24715
|
return "No previous page in history";
|
|
24767
24716
|
}
|
|
24768
24717
|
const beforeUrl = tab.view.webContents.getURL();
|
|
24769
|
-
tabManager.
|
|
24718
|
+
const backId = tabManager.getActiveTabId();
|
|
24719
|
+
if (!backId) return asNoActiveTabResponse();
|
|
24720
|
+
tabManager.goBack(backId);
|
|
24770
24721
|
await waitForLoad(tab.view.webContents);
|
|
24771
24722
|
const afterUrl = tab.view.webContents.getURL();
|
|
24772
24723
|
return afterUrl !== beforeUrl ? `Went back to ${afterUrl}` : `Back action completed but page stayed on ${afterUrl}`;
|
|
@@ -24787,7 +24738,9 @@ ${buildScopedContext(pageContent, mode)}`;
|
|
|
24787
24738
|
return "No forward page in history";
|
|
24788
24739
|
}
|
|
24789
24740
|
const beforeUrl = tab.view.webContents.getURL();
|
|
24790
|
-
tabManager.
|
|
24741
|
+
const forwardId = tabManager.getActiveTabId();
|
|
24742
|
+
if (!forwardId) return asNoActiveTabResponse();
|
|
24743
|
+
tabManager.goForward(forwardId);
|
|
24791
24744
|
await waitForLoad(tab.view.webContents);
|
|
24792
24745
|
const afterUrl = tab.view.webContents.getURL();
|
|
24793
24746
|
return afterUrl !== beforeUrl ? `Went forward to ${afterUrl}` : `Forward action completed but page stayed on ${afterUrl}`;
|
|
@@ -24804,7 +24757,9 @@ ${buildScopedContext(pageContent, mode)}`;
|
|
|
24804
24757
|
const tab = tabManager.getActiveTab();
|
|
24805
24758
|
if (!tab) return asNoActiveTabResponse();
|
|
24806
24759
|
return withAction(runtime2, tabManager, "reload", {}, async () => {
|
|
24807
|
-
tabManager.
|
|
24760
|
+
const reloadId = tabManager.getActiveTabId();
|
|
24761
|
+
if (!reloadId) return asNoActiveTabResponse();
|
|
24762
|
+
tabManager.reloadTab(reloadId);
|
|
24808
24763
|
await waitForLoad(tab.view.webContents);
|
|
24809
24764
|
return `Reloaded ${tab.view.webContents.getURL()}`;
|
|
24810
24765
|
});
|
|
@@ -26114,6 +26069,7 @@ ${results.join("\n")}`;
|
|
|
26114
26069
|
const steps = [];
|
|
26115
26070
|
if (url) {
|
|
26116
26071
|
const id = tabManager.getActiveTabId();
|
|
26072
|
+
if (!id) return asNoActiveTabResponse();
|
|
26117
26073
|
tabManager.navigateTab(id, url);
|
|
26118
26074
|
await waitForLoad(wc);
|
|
26119
26075
|
steps.push(`Navigated to ${wc.getURL()}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quanta-intellect/vessel-browser",
|
|
3
3
|
"mcpName": "io.github.unmodeled-tyler/vessel-browser",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.134",
|
|
5
5
|
"description": "AI-native web browser runtime for autonomous agents with human supervision",
|
|
6
6
|
"main": "./out/main/index.js",
|
|
7
7
|
"bin": {
|