@parcha/pi-browser 0.1.0-beta.68 → 0.1.0-beta.69
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/CHANGELOG.md +4 -0
- package/dist/driver/stagehand.d.ts +3 -1
- package/dist/driver/stagehand.js +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.0-beta.69 (2026-11-28)
|
|
6
|
+
|
|
7
|
+
- `@parcha/pi-browser/driver/stagehand` exports `DEFAULT_BATCH_TIMEOUT_MS` (60 000), the batch deadline the Stagehand driver uses when it is given none. <!-- changes/pi-browser-default-batch-timeout-export.md -->
|
|
8
|
+
|
|
5
9
|
## 0.1.0-beta.66 (2026-11-27)
|
|
6
10
|
|
|
7
11
|
- The browser's `screenshot` tool takes an optional `save_as`: a path relative to the workspace, its folders separated by `/`, ending `.png`, `.jpg` or `.jpeg` (`shots/home.png`). The capture is filed as evidence as before, and the same bytes are also written to that path. Missing folders are created and an existing file is replaced. The answer gets a `saved: <path>` line, and its details get `save_as: { path, saved: true }`. A `.png` name captures a PNG. An absolute path, a `..` segment, a backslash, a name that is not an image, or a name whose format contradicts `type` is refused before the browser is called, so nothing is captured or filed. If the size budget retakes a PNG as a JPEG, the capture still comes back and is filed, but nothing is written under the `.png` name: the answer says `not saved: ...` and its details give `save_as: { path, saved: false, reason: "format_changed", message }`. Without `save_as`, the tool behaves as before. <!-- changes/browser-screenshot-save-as.md -->
|
|
@@ -12,7 +12,9 @@ export declare const SEALED_STAGEHAND: {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
type StagehandModule = Pick<typeof import("@browserbasehq/stagehand"), "localBrowser" | "Stagehand">;
|
|
15
|
-
/** The batch deadline
|
|
15
|
+
/** The batch deadline a caller that passes none in `DriverOptions` gets: 60 s, the facade's. */
|
|
16
|
+
export declare const DEFAULT_BATCH_TIMEOUT_MS = 60000;
|
|
17
|
+
/** The batch deadline comes from `DriverOptions`; a caller that passes none gets `DEFAULT_BATCH_TIMEOUT_MS`. Stagehand allows one
|
|
16
18
|
* client per browser: an attach that fails or is cancelled after it connected disconnects again, and only then fails, so
|
|
17
19
|
* the next attach never meets its slot still taken (Stagehand bounds the disconnect: 10 s for the detach). `internals` is
|
|
18
20
|
* for tests: the Stagehand module the driver uses. */
|
package/dist/driver/stagehand.js
CHANGED
|
@@ -7,7 +7,9 @@ export const SEALED_STAGEHAND = {
|
|
|
7
7
|
cache: false,
|
|
8
8
|
model: { generate: async () => { throw new Error(STAGEHAND_INFERENCE_REFUSED); } },
|
|
9
9
|
};
|
|
10
|
-
/** The batch deadline
|
|
10
|
+
/** The batch deadline a caller that passes none in `DriverOptions` gets: 60 s, the facade's. */
|
|
11
|
+
export const DEFAULT_BATCH_TIMEOUT_MS = 60_000;
|
|
12
|
+
/** The batch deadline comes from `DriverOptions`; a caller that passes none gets `DEFAULT_BATCH_TIMEOUT_MS`. Stagehand allows one
|
|
11
13
|
* client per browser: an attach that fails or is cancelled after it connected disconnects again, and only then fails, so
|
|
12
14
|
* the next attach never meets its slot still taken (Stagehand bounds the disconnect: 10 s for the detach). `internals` is
|
|
13
15
|
* for tests: the Stagehand module the driver uses. */
|
|
@@ -20,7 +22,7 @@ export function stagehandDriver(internals = {}) {
|
|
|
20
22
|
const browser = await untilCancelled(attachStep(host)(connecting), signal, (late) => late.disconnect());
|
|
21
23
|
try {
|
|
22
24
|
const stagehand = await untilCancelled(Stagehand.create({ browser, ...SEALED_STAGEHAND }), signal, () => undefined);
|
|
23
|
-
return pageDriver(stagehand, { batchMs: options?.batchTimeoutMs ??
|
|
25
|
+
return pageDriver(stagehand, { batchMs: options?.batchTimeoutMs ?? DEFAULT_BATCH_TIMEOUT_MS });
|
|
24
26
|
}
|
|
25
27
|
catch (error) {
|
|
26
28
|
await browser.disconnect().catch(() => undefined);
|