@lightcone-ai/daemon 0.9.64 → 0.9.65

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.64",
3
+ "version": "0.9.65",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -317,17 +317,32 @@ export class BrowserLoginSession {
317
317
  const textHit = hit(textEl, textEl ? 'text:' + (textEl.innerText || textEl.textContent || '').trim() : '');
318
318
  if (textHit) return textHit;
319
319
 
320
- ${this._config.qrFallbackScript ?? 'return null;'}
320
+ const fallbackHit = (function() {
321
+ ${this._config.qrFallbackScript ?? 'return null;'}
322
+ })();
323
+ if (fallbackHit) return fallbackHit;
324
+
325
+ if (location.hostname.includes('xiaohongshu.com')) {
326
+ return {
327
+ via: 'xhs-calibrated-corner',
328
+ point: {
329
+ x: Math.round(window.innerWidth * 0.897),
330
+ y: Math.round(window.innerHeight * 0.339)
331
+ }
332
+ };
333
+ }
334
+ return null;
321
335
  })()`,
322
336
  returnByValue: true,
323
337
  });
324
338
 
325
339
  const hit = result.result?.value;
326
340
  const rect = hit?.rect;
327
- if (!rect) return null;
341
+ const point = hit?.point;
342
+ if (!rect && !point) return null;
328
343
 
329
- const x = Math.round(rect.left + rect.width / 2);
330
- const y = Math.round(rect.top + rect.height / 2);
344
+ const x = point?.x ?? Math.round(rect.left + rect.width / 2);
345
+ const y = point?.y ?? Math.round(rect.top + rect.height / 2);
331
346
  await this.send('Input.dispatchMouseEvent', { type: 'mouseMoved', x, y }, 5_000);
332
347
  await this.send('Input.dispatchMouseEvent', { type: 'mousePressed', x, y, button: 'left', clickCount: 1 }, 5_000);
333
348
  await this.send('Input.dispatchMouseEvent', { type: 'mouseReleased', x, y, button: 'left', clickCount: 1 }, 5_000);