agent-browser-loop 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.ts +7 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-browser-loop",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Let your AI coding agent drive a browser to verify its own work",
5
5
  "license": "MIT",
6
6
  "author": "Jason Silberman",
package/src/cli.ts CHANGED
@@ -581,16 +581,20 @@ const screenshotCommand = command({
581
581
  process.exit(1);
582
582
  }
583
583
 
584
- const data = response.data as { base64: string };
584
+ // Handle both raw string (from executeCommand) and object format
585
+ const base64 =
586
+ typeof response.data === "string"
587
+ ? response.data
588
+ : (response.data as { base64: string }).base64;
585
589
 
586
590
  if (args.output) {
587
591
  // Write to file
588
- const buffer = Buffer.from(data.base64, "base64");
592
+ const buffer = Buffer.from(base64, "base64");
589
593
  await Bun.write(args.output, buffer);
590
594
  console.log(`Screenshot saved to ${args.output}`);
591
595
  } else {
592
596
  // Output base64
593
- console.log(data.base64);
597
+ console.log(base64);
594
598
  }
595
599
  },
596
600
  });