@edlsh/browse-core 0.6.1 → 0.6.2
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/schema.js +2 -2
- package/dist/session.js +4 -0
- package/package.json +1 -1
package/dist/schema.js
CHANGED
|
@@ -54,11 +54,11 @@ const browserFields = {
|
|
|
54
54
|
return false;
|
|
55
55
|
const url = new URL(value);
|
|
56
56
|
return !url.username && !url.password && !url.hash;
|
|
57
|
-
}, "cdpUrl must be an http(s) or ws(s) endpoint without credentials or a fragment; send credentials in headers").optional().describe("Only for start with backend local. Attach to this explicitly supplied DevTools endpoint, on this machine or another; close disconnects without terminating the browser. Omit
|
|
57
|
+
}, "cdpUrl must be an http(s) or ws(s) endpoint without credentials or a fragment; send credentials in headers").optional().describe("Only for start with backend local. Attach to this explicitly supplied DevTools endpoint, on this machine or another; close disconnects without terminating the browser. Omit for the profile's local browser."),
|
|
58
58
|
headers: z.record(z.string().regex(/^[A-Za-z0-9-]{1,64}$/), z.string().min(1).max(4096)).optional().describe("Only with cdpUrl: HTTP headers an authenticated DevTools gateway needs, e.g. {\"Authorization\":\"Bearer <token>\"}. Sent only to cdpUrl's host; values never appear in results."),
|
|
59
59
|
extensionCdpUrl: z.url({ protocol: /^wss?$/ }).optional().describe("Only with cdpUrl for a browser on another machine or behind a gateway: the browser-level DevTools WebSocket URL the browser itself reaches without headers, e.g. ws://127.0.0.1:9222/devtools/browser/<id>. Default: the URL the browser reports."),
|
|
60
60
|
endpoint: z.string().regex(/^[A-Za-z0-9_-]{1,64}$/).optional().describe("Only for start with backend local: attach to the remote browser this profile configures under that name, which supplies its cdpUrl, headers, and extensionCdpUrl."),
|
|
61
|
-
headless: z.boolean().optional().describe("Only for
|
|
61
|
+
headless: z.boolean().optional().describe("Only for start with backend local: launch a browser of this tool's own, false for a visible window or true for none; cannot be used with cdpUrl or endpoint. Where the profile's local browser is the user's own, omit it to open tabs there: any value launches the separate browser instead, and its tabs never appear in the user's browser."),
|
|
62
62
|
tabId: z.string().min(1).optional().describe("Target tab ID; defaults to the selected tab. Required for tab_select/tab_close."),
|
|
63
63
|
// Other schemes are unsafe or unsupported: javascript: hangs navigation and file: reads the remote machine.
|
|
64
64
|
url: z.url({ protocol: /^https?$/, error: "url must be an http or https URL" }).optional().describe("An http or https URL. Required for open; optional for start/tab_new."),
|
package/dist/session.js
CHANGED
|
@@ -663,6 +663,10 @@ export class BrowseSession {
|
|
|
663
663
|
// Listing the cookie sources needs no browser.
|
|
664
664
|
if (p.action === "cookie_profiles")
|
|
665
665
|
return this.browse(p, context);
|
|
666
|
+
// The person's logins are already here; an import is for a browser this tool launches.
|
|
667
|
+
if (p.action === "cookie_import") {
|
|
668
|
+
throw new BrowseToolError("unsupported_backend", "cookie_import is not needed in the user's real browser: their logins are already there. Open the page, and call handoff if it asks to sign in. To import into a browser of this tool's own instead, close this one, then start with headless set or backend \"browserbase\".");
|
|
669
|
+
}
|
|
666
670
|
if (p.action === "ask" || p.target !== undefined)
|
|
667
671
|
return this.classifyInRealBrowser(real, p, context);
|
|
668
672
|
if (p.action === "har_stop") {
|
package/package.json
CHANGED