@agent-scope/render 1.18.0 → 1.19.0

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/dist/index.d.cts CHANGED
@@ -209,6 +209,12 @@ interface BrowserPoolConfig {
209
209
  * @default 900
210
210
  */
211
211
  viewportHeight?: number;
212
+ /**
213
+ * Device pixel ratio for high-DPI screenshots.
214
+ * Set to 2 for retina-quality output; display images at 0.5× CSS dimensions.
215
+ * @default 1
216
+ */
217
+ deviceScaleFactor?: number;
212
218
  /**
213
219
  * Maximum milliseconds to wait for an available page before
214
220
  * `acquire()` rejects.
package/dist/index.d.ts CHANGED
@@ -209,6 +209,12 @@ interface BrowserPoolConfig {
209
209
  * @default 900
210
210
  */
211
211
  viewportHeight?: number;
212
+ /**
213
+ * Device pixel ratio for high-DPI screenshots.
214
+ * Set to 2 for retina-quality output; display images at 0.5× CSS dimensions.
215
+ * @default 1
216
+ */
217
+ deviceScaleFactor?: number;
212
218
  /**
213
219
  * Maximum milliseconds to wait for an available page before
214
220
  * `acquire()` rejects.
package/dist/index.js CHANGED
@@ -136,12 +136,14 @@ var BrowserPool = class {
136
136
  const viewportWidth = config.viewportWidth ?? 1440;
137
137
  const viewportHeight = config.viewportHeight ?? 900;
138
138
  const acquireTimeoutMs = config.acquireTimeoutMs ?? 3e4;
139
+ const deviceScaleFactor = config.deviceScaleFactor ?? 2;
139
140
  const preset = config.preset ?? "local";
140
141
  this.config = {
141
142
  preset,
142
143
  size: config.size ?? { browsers: 1, pagesPerBrowser: 5 },
143
144
  viewportWidth,
144
145
  viewportHeight,
146
+ deviceScaleFactor,
145
147
  acquireTimeoutMs
146
148
  };
147
149
  if (config.size) {
@@ -167,7 +169,8 @@ var BrowserPool = class {
167
169
  this.browsers.push(browser);
168
170
  for (let p = 0; p < pagesPerBrowser; p++) {
169
171
  const page = await browser.newPage({
170
- viewport: { width: this.config.viewportWidth, height: this.config.viewportHeight }
172
+ viewport: { width: this.config.viewportWidth, height: this.config.viewportHeight },
173
+ deviceScaleFactor: this.config.deviceScaleFactor
171
174
  });
172
175
  await page.setContent(skeleton, { waitUntil: "load" });
173
176
  const index = this.slots.length;