wb-browser-runtime 0.5.2 → 0.5.3

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.
@@ -49,7 +49,7 @@ const SUPPORTS = [
49
49
  ];
50
50
 
51
51
  const BB_BASE = "https://api.browserbase.com";
52
- const VERSION = "0.5.0";
52
+ const VERSION = "0.5.3";
53
53
 
54
54
  // --- Recording config -------------------------------------------------------
55
55
  //
@@ -682,9 +682,16 @@ async function runVerb(page, verb, index, ctx) {
682
682
  return `${selector} (${state})`;
683
683
  }
684
684
  case "screenshot": {
685
- const path = a.path ?? `screenshot-${Date.now()}.png`;
686
- await page.screenshot({ path, fullPage: !!a.full_page });
687
- return `→ ${path}`;
685
+ // Relative paths resolve into $WB_ARTIFACTS_DIR so wb's main-loop
686
+ // `artifacts.sync()` picks them up and uploads to R2. Absolute paths
687
+ // are respected as-is (escape hatch for one-off local dumps).
688
+ const requested = a.path ?? `screenshot-${Date.now()}.png`;
689
+ const artifactsDir = (process.env.WB_ARTIFACTS_DIR || "").trim();
690
+ const full = path.isAbsolute(requested)
691
+ ? requested
692
+ : path.join(artifactsDir || ".", requested);
693
+ await page.screenshot({ path: full, fullPage: !!a.full_page });
694
+ return `→ ${requested}`;
688
695
  }
689
696
  case "extract": {
690
697
  // Pull structured rows out of the page. Each `field` entry is either:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wb-browser-runtime",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Browser sidecar runtime for wb — Browserbase + Playwright over the wb-sidecar/1 line-framed JSON protocol.",
5
5
  "bin": {
6
6
  "wb-browser-runtime": "bin/wb-browser-runtime.js"