@xmanrui/dsh-im 0.17.0 → 0.17.1

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/lib/client.js CHANGED
@@ -839,6 +839,20 @@ var EN = Object.freeze({
839
839
  "\u5FAE\u4FE1\u7ED1\u5B9A\u6CA1\u6709\u5B8C\u6210": "WeChat setup did not complete",
840
840
  "\u5FAE\u4FE1\u8FDE\u63A5\u6B63\u5E38": "WeChat connection is healthy",
841
841
  "\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA": "WeChat connection is not ready",
842
+ "\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002": "The current model does not support images. Use /models to list models, then /model <number> to switch and resend.",
843
+ "\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002": "The image exceeds the Host size limit. Compress it and try again.",
844
+ "\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002": "The image resolution is too high. Compress it and try again.",
845
+ "\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002": "The image is invalid or unsupported. Send it again.",
846
+ "\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002": "The image could not be read. Send it again.",
847
+ "\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002": "The declared image format does not match its content. Send it again.",
848
+ "\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002": "The message exceeds the Host image-count limit. Remove some images and try again.",
849
+ "\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002": "The images exceed the Host total-size limit. Remove or compress some images and try again.",
850
+ "\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002": "The image download redirected and cannot be read.",
851
+ "\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002": "The image exceeds 5 MB. Compress it and try again.",
852
+ "\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002": "The images are too large in total. Remove or compress some images and try again.",
853
+ "\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002": "The image download failed. Send it again.",
854
+ "\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002": "This image format is unsupported. Send a JPEG, PNG, WebP, or GIF image.",
855
+ "\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002": "Message processing failed. Try again later.",
842
856
  "\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u8D26\u53F7\u5217\u8868": "WeChat did not return a valid account list",
843
857
  "\u5C1A\u672A\u7ED1\u5B9A\u5FAE\u4FE1": "No WeChat account connected yet",
844
858
  "\u7528\u4E8E\u628A\u5FAE\u4FE1\u673A\u5668\u4EBA\u7ED1\u5B9A\u5230 DeepSeek Harness \u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801": "One-time QR code for connecting a WeChat bot to DeepSeek Harness",
@@ -906,6 +920,12 @@ function translateDynamic(text5) {
906
920
  }
907
921
  match = /^二维码剩余 (.+)$/.exec(text5);
908
922
  if (match) return `QR code expires in ${match[1]}`;
923
+ match = /^最近一条消息处理失败:(.+)$/.exec(text5);
924
+ if (match) return `Latest message failed: ${localizeText(match[1])}`;
925
+ match = /^图片下载失败(HTTP (.+)),请重新发送后再试。$/.exec(text5);
926
+ if (match) return `The image download failed (HTTP ${match[1]}). Send it again.`;
927
+ match = /^一次最多只能处理 (\d+) 张图片。$/.exec(text5);
928
+ if (match) return `A message can contain at most ${match[1]} images.`;
909
929
  match = /^状态刷新失败:(.+)$/.exec(text5);
910
930
  if (match) return `Status refresh failed: ${match[1]}`;
911
931
  match = /^状态自动刷新失败:(.+)$/.exec(text5);
@@ -7360,6 +7380,14 @@ function normalizeTestMessage4(value) {
7360
7380
  const code = value.code === "test-target-unavailable" ? "test-target-unavailable" : "test-message-failed";
7361
7381
  return { sent: false, code };
7362
7382
  }
7383
+ function normalizeMessageError(value) {
7384
+ if (!isRecord6(value)) return null;
7385
+ const code = string(value.code).slice(0, 64);
7386
+ const reason = string(value.reason).slice(0, 128);
7387
+ const message = string(value.message).slice(0, 500);
7388
+ const at = timestamp5(value.at);
7389
+ return code && reason && message && at !== null ? { code, reason, message, at } : null;
7390
+ }
7363
7391
  function unwrapRpcResult8(result) {
7364
7392
  if (!isRecord6(result) || typeof result.ok !== "boolean") {
7365
7393
  throw new Error("\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94");
@@ -7433,6 +7461,7 @@ function normalizeBot5(value) {
7433
7461
  messagesReceived: Math.max(0, Number(value.stats?.messagesReceived) || 0),
7434
7462
  messagesReplied: Math.max(0, Number(value.stats?.messagesReplied) || 0)
7435
7463
  },
7464
+ lastMessageError: normalizeMessageError(value.lastMessageError),
7436
7465
  error: isRecord6(value.error) ? {
7437
7466
  code: string(value.error.code, "WEIXIN_ACCOUNT_ERROR"),
7438
7467
  message: string(value.error.message, "\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA")
@@ -7892,6 +7921,10 @@ function AccountCard4({
7892
7921
  "div",
7893
7922
  { className: "dxw-accountFooter dim-cardFooter" },
7894
7923
  summary ? h2("div", { className: "dxw-summary dim-cardSummary" }, summary) : null,
7924
+ account.lastMessageError ? h2("div", {
7925
+ className: "dxw-summary dim-cardSummary",
7926
+ role: "status"
7927
+ }, `\u6700\u8FD1\u4E00\u6761\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF1A${account.lastMessageError.message}`) : null,
7895
7928
  feedback ? h2("div", {
7896
7929
  className: "dxw-summary dim-cardSummary",
7897
7930
  role: "status",