@wu529778790/open-im 1.10.9-beta.12 → 1.10.9-beta.14
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/dist/clawbot/client.js
CHANGED
|
@@ -37,20 +37,21 @@ export async function initClawbot(config, eventHandler, onStateChange) {
|
|
|
37
37
|
stopped = false;
|
|
38
38
|
reconnectAttempt = 0;
|
|
39
39
|
lastUpdateId = 0;
|
|
40
|
-
// Verify connectivity
|
|
40
|
+
// Verify connectivity — non-fatal, reconnect loop will retry
|
|
41
41
|
try {
|
|
42
42
|
const res = await fetchApi('/ilink/bot/getupdates?timeout=1');
|
|
43
43
|
if (!res.ok) {
|
|
44
44
|
throw new Error(`API check failed: ${res.error ?? 'unknown'}`);
|
|
45
45
|
}
|
|
46
46
|
log.info(`ClawBot API reachable at ${apiUrl}`);
|
|
47
|
+
updateState('connected');
|
|
48
|
+
startPolling();
|
|
47
49
|
}
|
|
48
50
|
catch (err) {
|
|
49
|
-
log.
|
|
50
|
-
|
|
51
|
+
log.warn('ClawBot API not reachable, will retry:', err);
|
|
52
|
+
updateState('connecting');
|
|
53
|
+
scheduleReconnect();
|
|
51
54
|
}
|
|
52
|
-
updateState('connected');
|
|
53
|
-
startPolling();
|
|
54
55
|
log.info('ClawBot client initialized');
|
|
55
56
|
}
|
|
56
57
|
function startPolling() {
|
|
@@ -4,7 +4,7 @@ export declare const PAGE_TEXTS: {
|
|
|
4
4
|
readonly heroBadge: "open-im local control";
|
|
5
5
|
readonly heroTitle: "Local bridge control.";
|
|
6
6
|
readonly heroBody: "";
|
|
7
|
-
readonly heroBodyFull: "One local bridge for Telegram, Feishu, QQ, WeWork, DingTalk, and
|
|
7
|
+
readonly heroBodyFull: "One local bridge for Telegram, Feishu, QQ, WeWork, DingTalk, WorkBuddy, and ClawBot.";
|
|
8
8
|
readonly heroKicker: "Local AI bridge";
|
|
9
9
|
readonly langButton: "中文";
|
|
10
10
|
readonly darkModeToggle: "Toggle dark mode";
|
|
@@ -56,6 +56,10 @@ export declare const PAGE_TEXTS: {
|
|
|
56
56
|
readonly weworkSummary: "Corp ID and secret for enterprise delivery.";
|
|
57
57
|
readonly dingtalkSummary: "Client credentials plus optional card template.";
|
|
58
58
|
readonly workbuddySummary: "CodeBuddy OAuth for WeChat customer service.";
|
|
59
|
+
readonly clawbotSummary: "WeChat iLink API via ClawBot.";
|
|
60
|
+
readonly clawbotApiUrl: "API URL";
|
|
61
|
+
readonly clawbotApiToken: "API Token (Bearer)";
|
|
62
|
+
readonly clawbotHelp: "Scan QR code in <code>open-im init</code> or paste token from ClawBot iLink login.";
|
|
59
63
|
readonly platformCredentialsTitle: "Credentials";
|
|
60
64
|
readonly platformAccessTitle: "Routing and access";
|
|
61
65
|
readonly platformTestNote: "Checks required credentials against the platform.";
|
|
@@ -152,13 +156,14 @@ export declare const PAGE_TEXTS: {
|
|
|
152
156
|
readonly tipWeworkCorp: "WeCom admin → app → view Corp ID (or smart-bot Bot ID) and Secret.";
|
|
153
157
|
readonly tipDingtalkClient: "<a href=\"https://open-dev.dingtalk.com\" target=\"_blank\" rel=\"noopener\">DingTalk Open Platform</a> → internal app → App Key & App Secret.";
|
|
154
158
|
readonly tipWorkbuddyToken: "Use terminal <code>open-im init</code> for WorkBuddy OAuth, or paste tokens from CodeBuddy login.";
|
|
159
|
+
readonly tipClawbotApiToken: "Run <code>open-im init</code> and select ClawBot to scan QR code, or paste token from ClawBot iLink login.";
|
|
155
160
|
};
|
|
156
161
|
readonly zh: {
|
|
157
162
|
readonly pageTitle: "open-im 本地控制台";
|
|
158
163
|
readonly heroBadge: "open-im";
|
|
159
164
|
readonly heroTitle: "本地桥接控制台";
|
|
160
165
|
readonly heroBody: "";
|
|
161
|
-
readonly heroBodyFull: "一个本地桥接入口,统一连接 Telegram、Feishu、QQ、WeWork、DingTalk 和
|
|
166
|
+
readonly heroBodyFull: "一个本地桥接入口,统一连接 Telegram、Feishu、QQ、WeWork、DingTalk、WorkBuddy 和 ClawBot。";
|
|
162
167
|
readonly heroKicker: "本地 AI 桥接";
|
|
163
168
|
readonly langButton: "EN";
|
|
164
169
|
readonly darkModeToggle: "切换暗黑模式";
|
|
@@ -210,6 +215,10 @@ export declare const PAGE_TEXTS: {
|
|
|
210
215
|
readonly weworkSummary: "企业微信 Corp ID 与 Secret。";
|
|
211
216
|
readonly dingtalkSummary: "钉钉 Client 凭证,可选配置卡片模板 ID。";
|
|
212
217
|
readonly workbuddySummary: "CodeBuddy OAuth 连接微信客服。";
|
|
218
|
+
readonly clawbotSummary: "通过 ClawBot 连接微信 iLink API。";
|
|
219
|
+
readonly clawbotApiUrl: "API 地址";
|
|
220
|
+
readonly clawbotApiToken: "API Token (Bearer)";
|
|
221
|
+
readonly clawbotHelp: "在终端运行 <code>open-im init</code> 扫码登录,或粘贴 ClawBot iLink 登录后的 Token。";
|
|
213
222
|
readonly platformCredentialsTitle: "凭证";
|
|
214
223
|
readonly platformAccessTitle: "路由与访问";
|
|
215
224
|
readonly platformTestNote: "只会检查该平台的必填凭证是否可用。";
|
|
@@ -303,5 +312,6 @@ export declare const PAGE_TEXTS: {
|
|
|
303
312
|
readonly tipWeworkCorp: "企业微信管理后台 → 应用 → 查省 Corp ID / 智能机器人 Bot ID 与 Secret。";
|
|
304
313
|
readonly tipDingtalkClient: "<a href=\"https://open-dev.dingtalk.com\" target=\"_blank\" rel=\"noopener\">钉钉开放平台</a> → 企业内部应用 → AppKey / AppSecret。";
|
|
305
314
|
readonly tipWorkbuddyToken: "建议在终端运行 <code>open-im init</code> 完成 WorkBuddy 授权;或粘贴 CodeBuddy 登录后的 Token。";
|
|
315
|
+
readonly tipClawbotApiToken: "在终端运行 <code>open-im init</code> 选择 ClawBot 扫码登录,或从 ClawBot iLink 登录后复制 Token。";
|
|
306
316
|
};
|
|
307
317
|
};
|
|
@@ -4,7 +4,7 @@ export const PAGE_TEXTS = {
|
|
|
4
4
|
heroBadge: "open-im local control",
|
|
5
5
|
heroTitle: "Local bridge control.",
|
|
6
6
|
heroBody: "",
|
|
7
|
-
heroBodyFull: "One local bridge for Telegram, Feishu, QQ, WeWork, DingTalk, and
|
|
7
|
+
heroBodyFull: "One local bridge for Telegram, Feishu, QQ, WeWork, DingTalk, WorkBuddy, and ClawBot.",
|
|
8
8
|
heroKicker: "Local AI bridge",
|
|
9
9
|
langButton: "\u4e2d\u6587",
|
|
10
10
|
darkModeToggle: "Toggle dark mode",
|
|
@@ -56,6 +56,10 @@ export const PAGE_TEXTS = {
|
|
|
56
56
|
weworkSummary: "Corp ID and secret for enterprise delivery.",
|
|
57
57
|
dingtalkSummary: "Client credentials plus optional card template.",
|
|
58
58
|
workbuddySummary: "CodeBuddy OAuth for WeChat customer service.",
|
|
59
|
+
clawbotSummary: "WeChat iLink API via ClawBot.",
|
|
60
|
+
clawbotApiUrl: "API URL",
|
|
61
|
+
clawbotApiToken: "API Token (Bearer)",
|
|
62
|
+
clawbotHelp: 'Scan QR code in <code>open-im init</code> or paste token from ClawBot iLink login.',
|
|
59
63
|
platformCredentialsTitle: "Credentials",
|
|
60
64
|
platformAccessTitle: "Routing and access",
|
|
61
65
|
platformTestNote: "Checks required credentials against the platform.",
|
|
@@ -152,13 +156,14 @@ export const PAGE_TEXTS = {
|
|
|
152
156
|
tipWeworkCorp: "WeCom admin → app → view Corp ID (or smart-bot Bot ID) and Secret.",
|
|
153
157
|
tipDingtalkClient: '<a href="https://open-dev.dingtalk.com" target="_blank" rel="noopener">DingTalk Open Platform</a> → internal app → App Key & App Secret.',
|
|
154
158
|
tipWorkbuddyToken: 'Use terminal <code>open-im init</code> for WorkBuddy OAuth, or paste tokens from CodeBuddy login.',
|
|
159
|
+
tipClawbotApiToken: 'Run <code>open-im init</code> and select ClawBot to scan QR code, or paste token from ClawBot iLink login.',
|
|
155
160
|
},
|
|
156
161
|
zh: {
|
|
157
162
|
pageTitle: "open-im \u672c\u5730\u63a7\u5236\u53f0",
|
|
158
163
|
heroBadge: "open-im",
|
|
159
164
|
heroTitle: "\u672c\u5730\u6865\u63a5\u63a7\u5236\u53f0",
|
|
160
165
|
heroBody: "",
|
|
161
|
-
heroBodyFull: "\u4e00\u4e2a\u672c\u5730\u6865\u63a5\u5165\u53e3\uff0c\u7edf\u4e00\u8fde\u63a5 Telegram\u3001Feishu\u3001QQ\u3001WeWork\u3001DingTalk \u548c
|
|
166
|
+
heroBodyFull: "\u4e00\u4e2a\u672c\u5730\u6865\u63a5\u5165\u53e3\uff0c\u7edf\u4e00\u8fde\u63a5 Telegram\u3001Feishu\u3001QQ\u3001WeWork\u3001DingTalk\u3001WorkBuddy \u548c ClawBot\u3002",
|
|
162
167
|
heroKicker: "\u672c\u5730 AI \u6865\u63a5",
|
|
163
168
|
langButton: "EN",
|
|
164
169
|
darkModeToggle: "\u5207\u6362\u6697\u9ed1\u6a21\u5f0f",
|
|
@@ -210,6 +215,10 @@ export const PAGE_TEXTS = {
|
|
|
210
215
|
weworkSummary: "\u4f01\u4e1a\u5fae\u4fe1 Corp ID \u4e0e Secret\u3002",
|
|
211
216
|
dingtalkSummary: "\u9489\u9489 Client \u51ed\u8bc1\uff0c\u53ef\u9009\u914d\u7f6e\u5361\u7247\u6a21\u677f ID\u3002",
|
|
212
217
|
workbuddySummary: "CodeBuddy OAuth \u8fde\u63a5\u5fae\u4fe1\u5ba2\u670d\u3002",
|
|
218
|
+
clawbotSummary: "\u901a\u8fc7 ClawBot \u8fde\u63a5\u5fae\u4fe1 iLink API\u3002",
|
|
219
|
+
clawbotApiUrl: "API \u5730\u5740",
|
|
220
|
+
clawbotApiToken: "API Token (Bearer)",
|
|
221
|
+
clawbotHelp: '\u5728\u7ec8\u7aef\u8fd0\u884c <code>open-im init</code> \u626b\u7801\u767b\u5f55\uff0c\u6216\u7c98\u8d34 ClawBot iLink \u767b\u5f55\u540e\u7684 Token\u3002',
|
|
213
222
|
platformCredentialsTitle: "\u51ed\u8bc1",
|
|
214
223
|
platformAccessTitle: "\u8def\u7531\u4e0e\u8bbf\u95ee",
|
|
215
224
|
platformTestNote: "\u53ea\u4f1a\u68c0\u67e5\u8be5\u5e73\u53f0\u7684\u5fc5\u586b\u51ed\u8bc1\u662f\u5426\u53ef\u7528\u3002",
|
|
@@ -303,5 +312,6 @@ export const PAGE_TEXTS = {
|
|
|
303
312
|
tipWeworkCorp: "\u4f01\u4e1a\u5fae\u4fe1\u7ba1\u7406\u540e\u53f0 \u2192 \u5e94\u7528 \u2192 \u67e5\u7701 Corp ID / \u667a\u80fd\u673a\u5668\u4eba Bot ID \u4e0e Secret\u3002",
|
|
304
313
|
tipDingtalkClient: '<a href="https://open-dev.dingtalk.com" target="_blank" rel="noopener">\u9489\u9489\u5f00\u653e\u5e73\u53f0</a> \u2192 \u4f01\u4e1a\u5185\u90e8\u5e94\u7528 \u2192 AppKey / AppSecret\u3002',
|
|
305
314
|
tipWorkbuddyToken: "\u5efa\u8bae\u5728\u7ec8\u7aef\u8fd0\u884c <code>open-im init</code> \u5b8c\u6210 WorkBuddy \u6388\u6743\uff1b\u6216\u7c98\u8d34 CodeBuddy \u767b\u5f55\u540e\u7684 Token\u3002",
|
|
315
|
+
tipClawbotApiToken: '\u5728\u7ec8\u7aef\u8fd0\u884c <code>open-im init</code> \u9009\u62e9 ClawBot \u626b\u7801\u767b\u5f55\uff0c\u6216\u4ece ClawBot iLink \u767b\u5f55\u540e\u590d\u5236 Token\u3002',
|
|
306
316
|
}
|
|
307
317
|
};
|