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.
- package/package.json +1 -1
- package/src/cli.ts +7 -3
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -581,16 +581,20 @@ const screenshotCommand = command({
|
|
|
581
581
|
process.exit(1);
|
|
582
582
|
}
|
|
583
583
|
|
|
584
|
-
|
|
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(
|
|
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(
|
|
597
|
+
console.log(base64);
|
|
594
598
|
}
|
|
595
599
|
},
|
|
596
600
|
});
|