agent-bridge-doubao 1.0.11 → 1.0.13

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.
@@ -6,17 +6,19 @@ exports.requestBody = requestBody;
6
6
  const node_crypto_1 = require("node:crypto");
7
7
  function doubaoStreamErrorMessage(data) {
8
8
  let code = "";
9
- let subtype = "";
9
+ let message = "";
10
10
  try {
11
11
  const value = JSON.parse(data);
12
- code = String(value.code ?? value.error?.code ?? "");
13
- subtype = String(value.subtype ?? value.error?.subtype ?? "").toLowerCase();
12
+ code = String(value.error_code ?? value.code ?? value.error?.error_code ?? value.error?.code ?? "");
13
+ message = String(value.error_msg ?? value.message ?? value.error?.message ?? "").trim();
14
14
  }
15
15
  catch { /* 平台可能返回非 JSON 错误 */ }
16
- if (code === "710022004" || subtype === "slide" || /rate limited|verify|slide/i.test(data)) {
17
- return `豆包平台触发滑块验证${code ? `(错误码 ${code})` : ""},请在豆包客户端完成验证后重试`;
18
- }
19
- return `豆包平台返回流式错误${code ? `(错误码 ${code})` : ""},请稍后重试`;
16
+ if (message.length > 300)
17
+ message = message.slice(0, 300);
18
+ message = message.replace(/[\r\n\t]+/g, " ");
19
+ if (message)
20
+ return `豆包平台返回错误${code ? `(错误码 ${code})` : ""}:${message}`;
21
+ return `豆包平台返回流式错误${code ? `(错误码 ${code})` : ""}`;
20
22
  }
21
23
  const defaults = { port: Number(process.env.DOUBAO_CDP_PORT ?? "9227"), conversationId: process.env.DOUBAO_CONVERSATION_ID ?? "759450172544514", botId: process.env.DOUBAO_BOT_ID ?? "7338286299411103781", timeoutMs: Number(process.env.DOUBAO_TIMEOUT_MS ?? "180000") };
22
24
  function sleep(ms, signal) {
@@ -6,7 +6,7 @@ const plugin_1 = require("../../plugin");
6
6
  const desktop_launch_1 = require("../desktop-launch");
7
7
  exports.doubaoManifest = {
8
8
  id: "doubao",
9
- version: "1.0.11",
9
+ version: "1.0.12",
10
10
  displayName: "豆包",
11
11
  entry: "dist/index.js",
12
12
  apiVersion: "1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-bridge-doubao",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "agent-bridge 的豆包插件。",
5
5
  "keywords": [
6
6
  "mu-agent-bridge-plugin",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "doubao",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "type": "agent",
5
5
  "displayName": "豆包",
6
6
  "entry": "dist/src-ts/plugins/doubao/index.js",