@lightcone-ai/daemon 0.9.18 → 0.9.19

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightcone-ai/daemon",
3
- "version": "0.9.18",
3
+ "version": "0.9.19",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -173,18 +173,18 @@ export class BrowserLoginSession {
173
173
  });
174
174
  }
175
175
 
176
- send(method, params = {}) {
176
+ send(method, params = {}, timeoutMs = 10_000) {
177
177
  return new Promise((resolve, reject) => {
178
178
  if (!this._ws) return reject(new Error('WebSocket not connected'));
179
179
  const id = this._nextId++;
180
- const timer = setTimeout(() => { this._pending.delete(id); reject(new Error(`CDP timeout for ${method}`)); }, 10_000);
180
+ const timer = setTimeout(() => { this._pending.delete(id); reject(new Error(`CDP timeout for ${method}`)); }, timeoutMs);
181
181
  this._pending.set(id, { resolve, reject, timer });
182
182
  this._ws.send(JSON.stringify({ id, method, params }));
183
183
  });
184
184
  }
185
185
 
186
186
  async screenshot() {
187
- const result = await this.send('Page.captureScreenshot', { format: 'jpeg', quality: 70 });
187
+ const result = await this.send('Page.captureScreenshot', { format: 'jpeg', quality: 50, clip: { x: 0, y: 0, width: 800, height: 900, scale: 0.75 } }, 30_000);
188
188
  return result.data;
189
189
  }
190
190