yiyan-browser-agent 1.0.10 → 1.0.12

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 +14 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yiyan-browser-agent",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
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
@@ -507,10 +507,23 @@ class YiyanBrowser {
507
507
  _cleanText(text) {
508
508
  if (!text) return '';
509
509
 
510
+ // Remove everything before "准备输出结果" (Yiyan's thinking process)
511
+ const outputMarker = '准备输出结果';
512
+ const markerIndex = text.indexOf(outputMarker);
513
+ if (markerIndex !== -1) {
514
+ text = text.slice(markerIndex + outputMarker.length).trim();
515
+ }
516
+
510
517
  return text
518
+ // Strip any remaining AI thinking blocks
511
519
  .replace(/<think>[\s\S]*?<\/think>\n?/gi, '')
512
- .replace(/^Thinking\.{0,3}\n[\s\S]*?\n\n/m, '')
520
+ // Strip suggested follow-up questions
521
+ .replace(/请告诉我更多.*$/gm, '')
522
+ .replace(/再多给我一些.*$/gm, '')
523
+ .replace(/再多提供一些.*$/gm, '')
524
+ // Strip copy-code button artifacts
513
525
  .replace(/^\d+(?:Copy|Run|Insert|Edit)\b.*$/gm, '')
526
+ // Collapse multiple blank lines
514
527
  .replace(/\n{3,}/g, '\n\n')
515
528
  .trim();
516
529
  }