stagehand 4.2.0a0.dev1540__tar.gz → 4.2.0a0.dev1541__tar.gz
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.
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/PKG-INFO +1 -1
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/pyproject.toml +1 -1
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_extension/content-script.js +32 -10
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_extension/service-worker.js +2 -2
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_generated/protocol_version.py +1 -1
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/README.md +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/__init__.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_extension/blank.html +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_extension/manifest.json +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_extension/offscreen/service-worker-heartbeat.html +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_extension/offscreen/service-worker-heartbeat.js +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_extension/wake-service-worker.html +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_extension/wake-service-worker.js +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_generated/__init__.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_generated/input_types.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_generated/models.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_sdk_identity.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_validation.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/browser.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/browser_clipboard.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/browser_context.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/browserbase_services.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/browserbase_session.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/cdp_client.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/client_models.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/client_types.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/extension_assets.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/file_upload.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/locator.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/page.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/py.typed +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/response.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/rpc_client.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/stagehand.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/timeouts.py +0 -0
- {stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/webmcp.py +0 -0
{stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_extension/content-script.js
RENAMED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
* - Attribute equality predicates (`[@attr='value']`, `[@attr="value"]`)
|
|
13
13
|
* - Attribute existence (`[@attr]`)
|
|
14
14
|
* - Attribute contains/starts-with (`contains(@attr,'v')`, `starts-with(@attr,'v')`)
|
|
15
|
-
* - Text equality/contains (`[text()='v']`, `[contains(text(),'v')]`, `[.='v']`)
|
|
15
|
+
* - Text equality/contains (`[text()='v']`, `[contains(text(),'v')]`, `[.='v']`),
|
|
16
|
+
* where `text()` reads direct child text nodes and `.` the whole subtree
|
|
16
17
|
* - normalize-space on text/attributes (`[normalize-space(text())='v']`)
|
|
17
18
|
* - Basic boolean predicates (`and`, `or`, `not(...)`)
|
|
18
19
|
* - Multiple predicates per step (`[@class='foo'][2]`)
|
|
@@ -159,11 +160,12 @@ function parseAtomicPredicate(input) {
|
|
|
159
160
|
value: normalizeAttrMatch[2] ?? normalizeAttrMatch[3] ?? "",
|
|
160
161
|
normalize: true
|
|
161
162
|
};
|
|
162
|
-
const normalizeTextMatch = input.match(new RegExp(`^normalize-space\\(\\s*(
|
|
163
|
+
const normalizeTextMatch = input.match(new RegExp(`^normalize-space\\(\\s*(text\\(\\)|\\.)\\s*\\)\\s*=\\s*${quoted}$`));
|
|
163
164
|
if (normalizeTextMatch) return {
|
|
164
165
|
type: "textEquals",
|
|
165
|
-
value: normalizeTextMatch[
|
|
166
|
-
normalize: true
|
|
166
|
+
value: normalizeTextMatch[2] ?? normalizeTextMatch[3] ?? "",
|
|
167
|
+
normalize: true,
|
|
168
|
+
source: textSource(normalizeTextMatch[1])
|
|
167
169
|
};
|
|
168
170
|
const attrEqualsMatch = input.match(new RegExp(`^@(${attrName})\\s*=\\s*${quoted}$`));
|
|
169
171
|
if (attrEqualsMatch) return {
|
|
@@ -188,15 +190,17 @@ function parseAtomicPredicate(input) {
|
|
|
188
190
|
name: attrStartsMatch[1],
|
|
189
191
|
value: attrStartsMatch[2] ?? attrStartsMatch[3] ?? ""
|
|
190
192
|
};
|
|
191
|
-
const textEqualsMatch = input.match(new RegExp(`^(
|
|
193
|
+
const textEqualsMatch = input.match(new RegExp(`^(text\\(\\)|\\.)\\s*=\\s*${quoted}$`));
|
|
192
194
|
if (textEqualsMatch) return {
|
|
193
195
|
type: "textEquals",
|
|
194
|
-
value: textEqualsMatch[
|
|
196
|
+
value: textEqualsMatch[2] ?? textEqualsMatch[3] ?? "",
|
|
197
|
+
source: textSource(textEqualsMatch[1])
|
|
195
198
|
};
|
|
196
|
-
const textContainsMatch = input.match(new RegExp(`^contains\\(\\s*(
|
|
199
|
+
const textContainsMatch = input.match(new RegExp(`^contains\\(\\s*(text\\(\\)|\\.)\\s*,\\s*${quoted}\\s*\\)$`));
|
|
197
200
|
if (textContainsMatch) return {
|
|
198
201
|
type: "textContains",
|
|
199
|
-
value: textContainsMatch[
|
|
202
|
+
value: textContainsMatch[2] ?? textContainsMatch[3] ?? "",
|
|
203
|
+
source: textSource(textContainsMatch[1])
|
|
200
204
|
};
|
|
201
205
|
if (valueMatch.test(input)) return null;
|
|
202
206
|
return null;
|
|
@@ -276,9 +280,23 @@ function hasBalancedParens(input) {
|
|
|
276
280
|
return depth === 0;
|
|
277
281
|
}
|
|
278
282
|
var normalizeSpace = (value) => value.replace(/\s+/g, " ").trim();
|
|
283
|
+
var TEXT_NODE = 3;
|
|
284
|
+
function textSource(token) {
|
|
285
|
+
return token === "text()" ? "text" : "self";
|
|
286
|
+
}
|
|
279
287
|
function textValue(element) {
|
|
280
288
|
return String(element.textContent ?? "");
|
|
281
289
|
}
|
|
290
|
+
/** The node-set `text()` selects: direct child text nodes, in document order. */
|
|
291
|
+
function childTextValues(element) {
|
|
292
|
+
const values = [];
|
|
293
|
+
for (const node of Array.from(element.childNodes)) if (node.nodeType === TEXT_NODE) values.push(String(node.nodeValue ?? ""));
|
|
294
|
+
return values;
|
|
295
|
+
}
|
|
296
|
+
/** `string(node-set)` is the string-value of its first node, or `""` when empty. */
|
|
297
|
+
function firstChildTextValue(element) {
|
|
298
|
+
return childTextValues(element)[0] ?? "";
|
|
299
|
+
}
|
|
282
300
|
function normalizeMaybe(value, normalize) {
|
|
283
301
|
return normalize ? normalizeSpace(value) : value;
|
|
284
302
|
}
|
|
@@ -303,8 +321,12 @@ function evaluatePredicate(element, predicate) {
|
|
|
303
321
|
if (attr === null) return false;
|
|
304
322
|
return normalizeMaybe(attr, predicate.normalize).startsWith(normalizeMaybe(predicate.value, predicate.normalize));
|
|
305
323
|
}
|
|
306
|
-
case "textEquals":
|
|
307
|
-
|
|
324
|
+
case "textEquals": {
|
|
325
|
+
const target = normalizeMaybe(predicate.value, predicate.normalize);
|
|
326
|
+
if (predicate.source === "text") return predicate.normalize ? normalizeSpace(firstChildTextValue(element)) === target : childTextValues(element).some((value) => value === target);
|
|
327
|
+
return normalizeMaybe(textValue(element), predicate.normalize) === target;
|
|
328
|
+
}
|
|
329
|
+
case "textContains": return normalizeMaybe(predicate.source === "text" ? firstChildTextValue(element) : textValue(element), predicate.normalize).includes(normalizeMaybe(predicate.value, predicate.normalize));
|
|
308
330
|
case "index": return true;
|
|
309
331
|
default: return true;
|
|
310
332
|
}
|
{stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_extension/service-worker.js
RENAMED
|
@@ -7359,7 +7359,7 @@ function isRecord$1(value) {
|
|
|
7359
7359
|
}
|
|
7360
7360
|
var package_default$1 = {
|
|
7361
7361
|
name: "@browserbasehq/stagehand-protocol",
|
|
7362
|
-
version: "2.1.0-alpha-
|
|
7362
|
+
version: "2.1.0-alpha-70f4e91f1983677c1e8ca9a86f0b738f828d059a",
|
|
7363
7363
|
"private": true,
|
|
7364
7364
|
type: "module",
|
|
7365
7365
|
exports: {
|
|
@@ -53961,7 +53961,7 @@ var WebTracerProvider = class extends BasicTracerProvider {
|
|
|
53961
53961
|
};
|
|
53962
53962
|
var package_default = {
|
|
53963
53963
|
name: "@browserbasehq/stagehand-extension",
|
|
53964
|
-
version: "1.1.0-alpha-
|
|
53964
|
+
version: "1.1.0-alpha-70f4e91f1983677c1e8ca9a86f0b738f828d059a",
|
|
53965
53965
|
"private": true,
|
|
53966
53966
|
type: "module",
|
|
53967
53967
|
scripts: {
|
{stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_generated/protocol_version.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"""Generated from packages/protocol/package.json. Do not edit."""
|
|
2
2
|
|
|
3
3
|
PROTOCOL_SEMVER_PATTERN = '^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\\+([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?$'
|
|
4
|
-
STAGEHAND_PROTOCOL_VERSION = '2.1.0-alpha-
|
|
4
|
+
STAGEHAND_PROTOCOL_VERSION = '2.1.0-alpha-70f4e91f1983677c1e8ca9a86f0b738f828d059a'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_extension/manifest.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_generated/__init__.py
RENAMED
|
File without changes
|
{stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/_generated/input_types.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/browserbase_services.py
RENAMED
|
File without changes
|
{stagehand-4.2.0a0.dev1540 → stagehand-4.2.0a0.dev1541}/src/stagehand/browserbase_session.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|