@browserbasehq/stagehand 2.4.1 → 2.4.2-alpha-1d9b74c97c3eb42fc2eafbb95e3008613bde3d8d
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/index.js +8 -8
- package/dist/lib/a11y/utils.d.ts +0 -2
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -473,7 +473,7 @@ __export(index_exports, {
|
|
|
473
473
|
});
|
|
474
474
|
module.exports = __toCommonJS(index_exports);
|
|
475
475
|
var import_sdk4 = require("@browserbasehq/sdk");
|
|
476
|
-
var
|
|
476
|
+
var import_playwright4 = require("playwright");
|
|
477
477
|
var import_dotenv = __toESM(require("dotenv"));
|
|
478
478
|
var import_fs2 = __toESM(require("fs"));
|
|
479
479
|
var import_os = __toESM(require("os"));
|
|
@@ -490,7 +490,7 @@ var StagehandFunctionName = /* @__PURE__ */ ((StagehandFunctionName2) => {
|
|
|
490
490
|
|
|
491
491
|
// lib/StagehandPage.ts
|
|
492
492
|
var import_sdk = require("@browserbasehq/sdk");
|
|
493
|
-
var
|
|
493
|
+
var import_playwright3 = require("playwright");
|
|
494
494
|
|
|
495
495
|
// types/page.ts
|
|
496
496
|
var import_zod = require("zod");
|
|
@@ -673,7 +673,7 @@ ${goal}
|
|
|
673
673
|
}
|
|
674
674
|
|
|
675
675
|
// lib/version.ts
|
|
676
|
-
var STAGEHAND_VERSION = "2.4.
|
|
676
|
+
var STAGEHAND_VERSION = "2.4.2-alpha-1d9b74c97c3eb42fc2eafbb95e3008613bde3d8d";
|
|
677
677
|
|
|
678
678
|
// types/stagehandErrors.ts
|
|
679
679
|
var StagehandError = class extends Error {
|
|
@@ -2351,7 +2351,7 @@ function loadApiKeyFromEnv(provider, logger) {
|
|
|
2351
2351
|
return void 0;
|
|
2352
2352
|
}
|
|
2353
2353
|
function trimTrailingTextNode(path4) {
|
|
2354
|
-
return path4.replace(/\/text\(\)(\[\d+\])?$/iu, "");
|
|
2354
|
+
return path4 == null ? void 0 : path4.replace(/\/text\(\)(\[\d+\])?$/iu, "");
|
|
2355
2355
|
}
|
|
2356
2356
|
|
|
2357
2357
|
// lib/a11y/utils.ts
|
|
@@ -3542,7 +3542,7 @@ var StagehandPage = class _StagehandPage {
|
|
|
3542
3542
|
});
|
|
3543
3543
|
const sessionStatus = yield browserbase.sessions.retrieve(sessionId);
|
|
3544
3544
|
const connectUrl = sessionStatus.connectUrl;
|
|
3545
|
-
const browser = yield
|
|
3545
|
+
const browser = yield import_playwright3.chromium.connectOverCDP(connectUrl);
|
|
3546
3546
|
const context = browser.contexts()[0];
|
|
3547
3547
|
const newPage = context.pages()[0];
|
|
3548
3548
|
const newStagehandPage = yield new _StagehandPage(
|
|
@@ -21983,7 +21983,7 @@ function getBrowser(apiKey, projectId, env = "LOCAL", headless = false, logger,
|
|
|
21983
21983
|
}
|
|
21984
21984
|
});
|
|
21985
21985
|
}
|
|
21986
|
-
const browser = yield
|
|
21986
|
+
const browser = yield import_playwright4.chromium.connectOverCDP(connectUrl);
|
|
21987
21987
|
const { debuggerUrl } = yield browserbase.sessions.debug(sessionId);
|
|
21988
21988
|
debugUrl = debuggerUrl;
|
|
21989
21989
|
sessionUrl = `https://www.browserbase.com/sessions/${sessionId}`;
|
|
@@ -22022,7 +22022,7 @@ function getBrowser(apiKey, projectId, env = "LOCAL", headless = false, logger,
|
|
|
22022
22022
|
}
|
|
22023
22023
|
});
|
|
22024
22024
|
}
|
|
22025
|
-
const browser2 = yield
|
|
22025
|
+
const browser2 = yield import_playwright4.chromium.connectOverCDP(
|
|
22026
22026
|
localBrowserLaunchOptions.cdpUrl
|
|
22027
22027
|
);
|
|
22028
22028
|
const context2 = browser2.contexts()[0];
|
|
@@ -22052,7 +22052,7 @@ function getBrowser(apiKey, projectId, env = "LOCAL", headless = false, logger,
|
|
|
22052
22052
|
downloadsPath = import_path2.default.join(process.cwd(), "downloads");
|
|
22053
22053
|
import_fs2.default.mkdirSync(downloadsPath, { recursive: true });
|
|
22054
22054
|
}
|
|
22055
|
-
const context = yield
|
|
22055
|
+
const context = yield import_playwright4.chromium.launchPersistentContext(userDataDir, {
|
|
22056
22056
|
acceptDownloads: (_a15 = localBrowserLaunchOptions == null ? void 0 : localBrowserLaunchOptions.acceptDownloads) != null ? _a15 : true,
|
|
22057
22057
|
headless: (_b = localBrowserLaunchOptions == null ? void 0 : localBrowserLaunchOptions.headless) != null ? _b : headless,
|
|
22058
22058
|
viewport: {
|
package/dist/lib/a11y/utils.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AccessibilityNode, TreeResult, BackendIdMaps, CombinedA11yResult, EncodedId } from "../../types/context";
|
|
2
2
|
import { StagehandPage } from "../StagehandPage";
|
|
3
3
|
import { LogLine } from "../../types/log";
|
|
4
|
-
import { Page } from "playwright";
|
|
5
4
|
import { Frame } from "playwright";
|
|
6
5
|
/**
|
|
7
6
|
* Clean a string by removing private-use unicode characters, normalizing whitespace,
|
|
@@ -141,4 +140,3 @@ export declare function resolveFrameChain(sp: StagehandPage, absPath: string): P
|
|
|
141
140
|
frames: Frame[];
|
|
142
141
|
rest: string;
|
|
143
142
|
}>;
|
|
144
|
-
export declare function performPlaywrightMethod(stagehandPage: Page, logger: (logLine: LogLine) => void, method: string, args: unknown[], xpath: string): Promise<void>;
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -46,4 +46,4 @@ export declare const providerEnvVarMap: Partial<Record<ModelProvider | string, s
|
|
|
46
46
|
* @returns The API key if found, undefined otherwise
|
|
47
47
|
*/
|
|
48
48
|
export declare function loadApiKeyFromEnv(provider: string | undefined, logger: (logLine: LogLine) => void): string | undefined;
|
|
49
|
-
export declare function trimTrailingTextNode(path: string): string;
|
|
49
|
+
export declare function trimTrailingTextNode(path: string | undefined): string | undefined;
|
package/dist/lib/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@browserbasehq/stagehand",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2-alpha-1d9b74c97c3eb42fc2eafbb95e3008613bde3d8d",
|
|
4
4
|
"description": "An AI web browsing framework focused on simplicity and extensibility.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|