mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 03:03:24 +08:00
Merge remote-tracking branch 'upstream/main' into feat/per-bot-agent-preset
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # lib/index.js
This commit is contained in:
commit
a1bdf2c1f8
17 changed files with 438 additions and 144 deletions
|
|
@ -645,6 +645,20 @@ var EN = Object.freeze({
|
|||
"\u5FAE\u4FE1\u7ED1\u5B9A\u6CA1\u6709\u5B8C\u6210": "WeChat setup did not complete",
|
||||
"\u5FAE\u4FE1\u8FDE\u63A5\u6B63\u5E38": "WeChat connection is healthy",
|
||||
"\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA": "WeChat connection is not ready",
|
||||
"\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.",
|
||||
"\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.",
|
||||
"\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.",
|
||||
"\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.",
|
||||
"\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002": "The image could not be read. Send it again.",
|
||||
"\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.",
|
||||
"\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.",
|
||||
"\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.",
|
||||
"\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.",
|
||||
"\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002": "The image exceeds 5 MB. Compress it and try again.",
|
||||
"\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.",
|
||||
"\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002": "The image download failed. Send it again.",
|
||||
"\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.",
|
||||
"\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002": "Message processing failed. Try again later.",
|
||||
"\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u8D26\u53F7\u5217\u8868": "WeChat did not return a valid account list",
|
||||
"\u5C1A\u672A\u7ED1\u5B9A\u5FAE\u4FE1": "No WeChat account connected yet",
|
||||
"\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",
|
||||
|
|
@ -712,6 +726,12 @@ function translateDynamic(text5) {
|
|||
}
|
||||
match = /^二维码剩余 (.+)$/.exec(text5);
|
||||
if (match) return `QR code expires in ${match[1]}`;
|
||||
match = /^最近一条消息处理失败:(.+)$/.exec(text5);
|
||||
if (match) return `Latest message failed: ${localizeText(match[1])}`;
|
||||
match = /^图片下载失败(HTTP (.+)),请重新发送后再试。$/.exec(text5);
|
||||
if (match) return `The image download failed (HTTP ${match[1]}). Send it again.`;
|
||||
match = /^一次最多只能处理 (\d+) 张图片。$/.exec(text5);
|
||||
if (match) return `A message can contain at most ${match[1]} images.`;
|
||||
match = /^状态刷新失败:(.+)$/.exec(text5);
|
||||
if (match) return `Status refresh failed: ${match[1]}`;
|
||||
match = /^状态自动刷新失败:(.+)$/.exec(text5);
|
||||
|
|
@ -7654,6 +7674,14 @@ function normalizeTestMessage4(value) {
|
|||
const code = value.code === "test-target-unavailable" ? "test-target-unavailable" : "test-message-failed";
|
||||
return { sent: false, code };
|
||||
}
|
||||
function normalizeMessageError(value) {
|
||||
if (!isRecord6(value)) return null;
|
||||
const code = string(value.code).slice(0, 64);
|
||||
const reason = string(value.reason).slice(0, 128);
|
||||
const message = string(value.message).slice(0, 500);
|
||||
const at = timestamp5(value.at);
|
||||
return code && reason && message && at !== null ? { code, reason, message, at } : null;
|
||||
}
|
||||
function unwrapRpcResult8(result) {
|
||||
if (!isRecord6(result) || typeof result.ok !== "boolean") {
|
||||
throw new Error("\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94");
|
||||
|
|
@ -7728,6 +7756,7 @@ function normalizeBot5(value) {
|
|||
messagesReceived: Math.max(0, Number(value.stats?.messagesReceived) || 0),
|
||||
messagesReplied: Math.max(0, Number(value.stats?.messagesReplied) || 0)
|
||||
},
|
||||
lastMessageError: normalizeMessageError(value.lastMessageError),
|
||||
error: isRecord6(value.error) ? {
|
||||
code: string(value.error.code, "WEIXIN_ACCOUNT_ERROR"),
|
||||
message: string(value.error.message, "\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA")
|
||||
|
|
@ -8194,6 +8223,10 @@ function AccountCard4({
|
|||
"div",
|
||||
{ className: "dxw-accountFooter dim-cardFooter" },
|
||||
summary ? h2("div", { className: "dxw-summary dim-cardSummary" }, summary) : null,
|
||||
account.lastMessageError ? h2("div", {
|
||||
className: "dxw-summary dim-cardSummary",
|
||||
role: "status"
|
||||
}, `\u6700\u8FD1\u4E00\u6761\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF1A${account.lastMessageError.message}`) : null,
|
||||
feedback ? h2("div", {
|
||||
className: "dxw-summary dim-cardSummary",
|
||||
role: "status",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue