@agent-scope/render 1.19.0 → 1.20.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/README.md CHANGED
@@ -192,8 +192,13 @@ interface BrowserPoolConfig {
192
192
  preset?: 'local' | 'ci-standard' | 'ci-large';
193
193
  /** Custom size config — overrides preset when provided. */
194
194
  size?: { browsers: number; pagesPerBrowser: number };
195
- viewportWidth?: number; // default: 1440
196
- viewportHeight?: number; // default: 900
195
+ viewportWidth?: number; // default: 1440
196
+ viewportHeight?: number; // default: 900
197
+ /**
198
+ * Device pixel ratio for retina screenshots. Default: 2.
199
+ * Renders at 2× physical pixels; display at CSS px dimensions for sharp HiDPI output.
200
+ */
201
+ deviceScaleFactor?: number; // default: 2
197
202
  /** Max ms to wait for a free slot before acquire() rejects. Default: 30_000. */
198
203
  acquireTimeoutMs?: number;
199
204
  }
@@ -550,9 +555,9 @@ Shared return type for both render paths.
550
555
 
551
556
  ```typescript
552
557
  interface RenderResult {
553
- screenshot: Buffer; // PNG as a Buffer
554
- width: number; // pixel width of the rendered component
555
- height: number; // pixel height
558
+ screenshot: Buffer; // PNG as a Buffer (2× physical pixels at default deviceScaleFactor: 2)
559
+ width: number; // CSS pixel width of the rendered component (layout size)
560
+ height: number; // CSS pixel height
556
561
  renderTimeMs: number; // wall-clock render time in ms
557
562
  computedStyles: Record<string, Record<string, string>>;
558
563
  // BrowserPool only (when captureXxx options enabled):
package/dist/index.cjs CHANGED
@@ -683,6 +683,12 @@ function detectHeuristicFlags(errorMessage, componentStack) {
683
683
  if (combined.includes("hydrat") || combined.includes("did not match") || combined.includes("server rendered html")) {
684
684
  flags.add("HYDRATION_MISMATCH");
685
685
  }
686
+ if (combined.includes("executable doesn't exist") || combined.includes("browserType.launch") || combined.includes("could not find chromium") || combined.includes("please run the following command to download new browsers")) {
687
+ flags.add("MISSING_BROWSER_BINARY");
688
+ }
689
+ if (combined.includes("could not resolve") || combined.includes("cannot find module") || combined.includes("module not found")) {
690
+ flags.add("MISSING_PROJECT_DEPENDENCY");
691
+ }
686
692
  if (combined.includes("circular") || combined.includes("maximum call stack") || combined.includes("stack overflow")) {
687
693
  flags.add("CIRCULAR_DEPENDENCY");
688
694
  }