@shun-js/aibaiban-server 1.4.5 → 1.4.6

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": "@shun-js/aibaiban-server",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "description": "aibaiban.com server",
5
5
  "keywords": [
6
6
  "ai aibaiban"
@@ -46,5 +46,5 @@
46
46
  "access": "public",
47
47
  "registry": "https://registry.npmjs.org/"
48
48
  },
49
- "gitHead": "294b7f7d09aec1d24318dabe5366ec0834e1488d"
49
+ "gitHead": "db63ae30bdb80c743746bdb4727bf3b9f0b62b83"
50
50
  }
@@ -52,10 +52,22 @@ exports.drawCC = async (req, res) => {
52
52
  clearInterval(keepalive);
53
53
  const duration = Date.now() - startTime;
54
54
 
55
- // 解析 Claude Code 返回结果:[MERMAID]、[REPLY]、[IRRELEVANT] 前缀
55
+ // 解析 Claude Code 返回结果:[MERMAID]、[CLEAR_AND_MERMAID]、[REPLY]、[IRRELEVANT] 前缀
56
56
  const trimmed = result.trim();
57
57
 
58
- if (trimmed.startsWith("[MERMAID]")) {
58
+ if (trimmed.startsWith("[CLEAR_AND_MERMAID]")) {
59
+ const code = trimmed.slice("[CLEAR_AND_MERMAID]".length).trim();
60
+ req.logger.info(
61
+ methodName,
62
+ "clear_and_mermaid",
63
+ code.length,
64
+ `${duration}ms`,
65
+ );
66
+ chatFeishuMsg(req, `cc-clear-mermaid-${code.length}chars`);
67
+ res.streaming(
68
+ `data: ${JSON.stringify({ type: "clear_and_mermaid", code, duration })}\n\n`,
69
+ );
70
+ } else if (trimmed.startsWith("[MERMAID]")) {
59
71
  const code = trimmed.slice("[MERMAID]".length).trim();
60
72
  req.logger.info(methodName, "mermaid", code.length, `${duration}ms`);
61
73
  chatFeishuMsg(req, `cc-mermaid-${code.length}chars`);