@edlsh/browse-core 0.6.2 → 0.6.4
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/dist/real-browser-session.js +2 -2
- package/dist/session.js +3 -2
- package/package.json +4 -4
|
@@ -233,8 +233,8 @@ export class RealBrowserSession {
|
|
|
233
233
|
if (signal.aborted || !(error instanceof BrowseToolError))
|
|
234
234
|
throw error;
|
|
235
235
|
progress.failedIndex = results.length;
|
|
236
|
-
// A script
|
|
237
|
-
progress.outcomeUnknown = error.code === "real_browser_unreachable";
|
|
236
|
+
// A script can act before throwing or losing its reply. Only local preflight failures are safe to retry.
|
|
237
|
+
progress.outcomeUnknown = error.code === "real_browser_error" || error.code === "real_browser_unreachable";
|
|
238
238
|
progress.error = { code: error.code, message: error.message.slice(0, 4000) };
|
|
239
239
|
break;
|
|
240
240
|
}
|
package/dist/session.js
CHANGED
|
@@ -13,7 +13,7 @@ import { BrokerConnection } from "./broker-client.js";
|
|
|
13
13
|
import { RealBrowserSession } from "./real-browser-session.js";
|
|
14
14
|
import { extractPage, observePage } from "./real-browser-ai.js";
|
|
15
15
|
import { extensionCacheKey, extensionCachePath, provisionExtension } from "./extension-cache.js";
|
|
16
|
-
import { randomUUID } from "node:crypto";
|
|
16
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
17
17
|
import { cancelPageBatch, pageOperation, readOperation, tabsOperation, viewOperation } from "./page-operations.js";
|
|
18
18
|
import { CookieSourceError, localCookieProvider, normalizeCookieDomains } from "./browser-cookies.js";
|
|
19
19
|
import { fitsAction, JEV_MIN_CONFIDENCE, jevChooser, outlineCandidates, pickTarget, treeCandidates } from "./jev.js";
|
|
@@ -650,7 +650,8 @@ export class BrowseSession {
|
|
|
650
650
|
if (policy?.blockedDomains?.length) {
|
|
651
651
|
throw new BrowseToolError("unsupported_backend", "Blocked domains cannot be enforced in the user's real browser. Start with headless true or backend \"browserbase\" to keep them.");
|
|
652
652
|
}
|
|
653
|
-
|
|
653
|
+
const groupId = createHash("sha256").update(JSON.stringify([this.identity.integration, context.profile, context.sessionId])).digest("hex").slice(0, 24);
|
|
654
|
+
return RealBrowserSession.open(config.realBrowser.command, { name: this.identity.integration, version: "1" }, this.owner(context), `${this.identity.name} ${groupId}`, policy?.allowedDomains?.flatMap(domain => [domain, `*.${domain}`]));
|
|
654
655
|
}
|
|
655
656
|
async inRealBrowser(real, params, context, ai) {
|
|
656
657
|
// SAFETY: `ai` marks a browse_ai call, whose arguments are AIParams; every other call's are BrowserParams.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edlsh/browse-core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Host-neutral browser core (Browserbase, local Chrome, remote CDP, Stagehand) shared by omp-browse, pi-browse, and hermes-browse",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"browser",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"bun": ">=1.3.14"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@browserbasehq/sdk": "2.
|
|
56
|
+
"@browserbasehq/sdk": "2.29.0",
|
|
57
57
|
"@browserbasehq/stagehand": "4.4.0",
|
|
58
|
-
"tldts": "7.5.
|
|
58
|
+
"tldts": "7.5.5",
|
|
59
59
|
"ws": "8.23.0",
|
|
60
60
|
"zod": "4.6.6"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@types/bun": "1.4.
|
|
63
|
+
"@types/bun": "1.4.5",
|
|
64
64
|
"@types/ws": "8.18.2",
|
|
65
65
|
"typescript": "7.0.2"
|
|
66
66
|
}
|