yiyan-browser-agent 1.7.8 → 1.7.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/browser.js +13 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yiyan-browser-agent",
3
- "version": "1.7.8",
3
+ "version": "1.7.9",
4
4
  "description": "AI coding agent powered by Yiyan (文心一言) via browser automation — no API key needed",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/browser.js CHANGED
@@ -472,7 +472,19 @@ class YiyanBrowser {
472
472
  return result.trim();
473
473
  }
474
474
 
475
- // ── 仅从 answer_text_id 提取内容,不使用任何 fallback ──
475
+ // ── 先检查思考区域是否有内容 ──
476
+ const thinkingEl = document.querySelector('.container__SPpahQHm, [class*="container__SPpah"]');
477
+ if (thinkingEl) {
478
+ const s = window.getComputedStyle(thinkingEl);
479
+ const isVisible = s.display !== 'none' && s.visibility !== 'hidden';
480
+ const thinkingText = thinkingEl.innerText || '';
481
+ if (isVisible && thinkingText.length > 5) {
482
+ // 思考区域有内容,返回空字符串(等待思考完成)
483
+ return '';
484
+ }
485
+ }
486
+
487
+ // ── 思考区域无内容,从 answer_text_id 提取 ──
476
488
  const answerEl = document.querySelector('#answer_text_id');
477
489
  if (answerEl) {
478
490
  return getFullText(answerEl);