@wu529778790/open-im 1.6.6-beta.0 → 1.6.6-beta.2

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/cli.js CHANGED
@@ -111,20 +111,32 @@ async function cmdDev() {
111
111
  }
112
112
  await main();
113
113
  }
114
+ async function cmdDashboard() {
115
+ // Start web config server in persistent mode (no timeout)
116
+ const { startWebConfigServer, openWebConfigUrl } = await import("./config-web.js");
117
+ const server = await startWebConfigServer({ mode: "dev", cwd: process.cwd(), persistent: true });
118
+ console.log(`\nDashboard: ${server.url}`);
119
+ console.log("Press Ctrl+C to close.\n");
120
+ openWebConfigUrl();
121
+ await server.waitForResult;
122
+ }
114
123
  function showHelp(exitCode = 0) {
115
124
  console.log(`
116
125
  Usage: open-im <command>
117
126
 
118
127
  Commands:
119
- start Run the full app in the background and serve the local config page
120
- stop Stop the full app
121
- restart Restart the full app in the background
122
- init Run CLI setup
123
- dev Run in the foreground for debugging
128
+ start Run the full app in the background and serve the dashboard
129
+ stop Stop the full app
130
+ restart Restart the full app in the background
131
+ init Run CLI setup
132
+ dev Run in the foreground for debugging
133
+ dashboard Open the web dashboard (keeps running until Ctrl+C)
124
134
 
125
- Local config page:
135
+ Local dashboard:
126
136
  http://127.0.0.1:39282
127
- start keeps it available; dev opens it only during initial setup
137
+ - "start" keeps it available while the service runs
138
+ - "dashboard" opens it standalone (use to modify existing config)
139
+ - "dev" opens it only during initial setup
128
140
 
129
141
  Options:
130
142
  -h, --help Show this help message
@@ -138,6 +150,7 @@ const commands = {
138
150
  restart: cmdRestart,
139
151
  init: cmdInit,
140
152
  dev: cmdDev,
153
+ dashboard: cmdDashboard,
141
154
  };
142
155
  if (cmd === "--help" || cmd === "-h") {
143
156
  showHelp(0);
@@ -7,6 +7,7 @@ export declare const PAGE_TEXTS: {
7
7
  readonly heroBodyFull: "One local bridge for Telegram, Feishu, QQ, WeWork, and DingTalk.";
8
8
  readonly heroKicker: "Local AI bridge";
9
9
  readonly langButton: "中文";
10
+ readonly darkModeToggle: "Toggle dark mode";
10
11
  readonly controlCenter: "Control center";
11
12
  readonly sidebarNoteTitle: "Local workflow";
12
13
  readonly sidebarNoteBody: "Configure at least one platform, save the config, then start the bridge from Service.";
@@ -41,6 +42,17 @@ export declare const PAGE_TEXTS: {
41
42
  readonly platformsTitle: "Platforms";
42
43
  readonly platformsHint: "Disabled platforms keep their saved values.";
43
44
  readonly enabled: "Enabled";
45
+ readonly readyState: "Ready";
46
+ readonly setupRequired: "Setup required";
47
+ readonly credentialProgress: "{done}/{total} credentials";
48
+ readonly telegramSummary: "Bot token and optional proxy.";
49
+ readonly feishuSummary: "App ID, App Secret, and allowed user scope.";
50
+ readonly qqSummary: "App ID and secret for bot access.";
51
+ readonly weworkSummary: "Corp ID and secret for enterprise delivery.";
52
+ readonly dingtalkSummary: "Client credentials plus optional card template.";
53
+ readonly platformCredentialsTitle: "Credentials";
54
+ readonly platformAccessTitle: "Routing and access";
55
+ readonly platformTestNote: "Checks required credentials against the platform.";
44
56
  readonly platformAiTool: "AI tool override";
45
57
  readonly inheritDefaultAi: "Use default AI tool";
46
58
  readonly botToken: "Bot token";
@@ -57,7 +69,7 @@ export declare const PAGE_TEXTS: {
57
69
  readonly weworkHelp: "Get credentials: visit <a href=\"https://work.weixin.qq.com/\" target=\"_blank\">WeWork Admin Console</a>, create an app, and copy the Bot ID (Corp ID) / Secret";
58
70
  readonly clientId: "Client ID / AppKey";
59
71
  readonly clientSecret: "Client Secret / AppSecret";
60
- readonly dingtalkHelp: "Get credentials: Create an enterprise internal app on DingTalk Open Platform, enable Stream Mode, and get Client ID / Client Secret";
72
+ readonly dingtalkHelp: "Get credentials: Create an enterprise internal app on <a href=\"https://open-dev.dingtalk.com/\" target=\"_blank\">DingTalk Open Platform</a>, enable Stream Mode, and get Client ID / Client Secret";
61
73
  readonly secret: "Secret";
62
74
  readonly cardTemplateId: "Card template ID";
63
75
  readonly optional: "Optional";
@@ -78,14 +90,17 @@ export declare const PAGE_TEXTS: {
78
90
  readonly codebuddyCli: "CodeBuddy CLI path";
79
91
  readonly codexProxy: "Codex proxy";
80
92
  readonly claudeTimeout: "Claude timeout (ms)";
93
+ readonly claudeConfigPath: "Config file location";
94
+ readonly claudeAuthToken: "ANTHROPIC_AUTH_TOKEN";
95
+ readonly claudeBaseUrl: "ANTHROPIC_BASE_URL";
96
+ readonly claudeModel: "ANTHROPIC_MODEL";
97
+ readonly claudeProxy: "Proxy (optional)";
81
98
  readonly codexTimeout: "Codex timeout (ms)";
82
99
  readonly codebuddyTimeout: "CodeBuddy timeout (ms)";
83
- readonly claudeModel: "Claude model";
100
+ readonly cursorProxy: "Proxy (optional)";
84
101
  readonly hookPort: "Hook port";
85
102
  readonly logLevel: "Log level";
86
103
  readonly logLevelDefault: "default (app default)";
87
- readonly autoApprove: "Auto-approve tool permissions";
88
- readonly sdkMode: "Use Claude SDK mode";
89
104
  readonly validate: "Validate";
90
105
  readonly test: "Check config";
91
106
  readonly testing: "Checking...";
@@ -114,6 +129,7 @@ export declare const PAGE_TEXTS: {
114
129
  readonly heroBodyFull: "一个本地桥接入口,统一连接 Telegram、Feishu、QQ、WeWork 和 DingTalk。";
115
130
  readonly heroKicker: "本地 AI 桥接";
116
131
  readonly langButton: "EN";
132
+ readonly darkModeToggle: "切换暗黑模式";
117
133
  readonly controlCenter: "控制中心";
118
134
  readonly sidebarNoteTitle: "本地工作流";
119
135
  readonly sidebarNoteBody: "至少配置一个平台,保存配置,然后在服务控制区启动桥接。";
@@ -146,6 +162,17 @@ export declare const PAGE_TEXTS: {
146
162
  readonly platformsTitle: "平台配置";
147
163
  readonly platformsHint: "禁用的平台会保留已保存的值。";
148
164
  readonly enabled: "启用";
165
+ readonly readyState: "已就绪";
166
+ readonly setupRequired: "需要完成配置";
167
+ readonly credentialProgress: "凭证 {done}/{total}";
168
+ readonly telegramSummary: "Bot Token 与可选代理。";
169
+ readonly feishuSummary: "App ID、App Secret 以及可访问用户范围。";
170
+ readonly qqSummary: "QQ 机器人 App ID 与 Secret。";
171
+ readonly weworkSummary: "企业微信 Corp ID 与 Secret。";
172
+ readonly dingtalkSummary: "钉钉 Client 凭证,可选配置卡片模板 ID。";
173
+ readonly platformCredentialsTitle: "凭证";
174
+ readonly platformAccessTitle: "路由与访问";
175
+ readonly platformTestNote: "只会检查该平台的必填凭证是否可用。";
149
176
  readonly platformAiTool: "平台 AI 工具覆盖";
150
177
  readonly inheritDefaultAi: "使用默认 AI 工具";
151
178
  readonly botToken: "Bot Token";
@@ -162,7 +189,7 @@ export declare const PAGE_TEXTS: {
162
189
  readonly weworkHelp: "获取凭证:访问 <a href=\"https://work.weixin.qq.com/\" target=\"_blank\">企业微信管理后台</a>,创建应用并拿到 Bot ID(Corp ID)/ Secret";
163
190
  readonly clientId: "Client ID / AppKey";
164
191
  readonly clientSecret: "Client Secret / AppSecret";
165
- readonly dingtalkHelp: "获取凭证:在钉钉开放平台创建企业内部应用,启用 Stream Mode,并拿到 Client ID / Client Secret";
192
+ readonly dingtalkHelp: "获取凭证:在 <a href=\"https://open-dev.dingtalk.com/\" target=\"_blank\">钉钉开放平台</a> 创建企业内部应用,启用 Stream Mode,并拿到 Client ID / Client Secret";
166
193
  readonly cardTemplateId: "卡片模板 ID";
167
194
  readonly optional: "可选";
168
195
  readonly commaSeparatedIds: "多个 ID 用逗号分隔";
@@ -182,14 +209,17 @@ export declare const PAGE_TEXTS: {
182
209
  readonly codebuddyCli: "CodeBuddy CLI 路径";
183
210
  readonly codexProxy: "Codex 代理";
184
211
  readonly claudeTimeout: "Claude 超时(毫秒)";
212
+ readonly claudeConfigPath: "配置文件位置";
213
+ readonly claudeAuthToken: "ANTHROPIC_AUTH_TOKEN";
214
+ readonly claudeBaseUrl: "ANTHROPIC_BASE_URL";
215
+ readonly claudeModel: "ANTHROPIC_MODEL";
216
+ readonly claudeProxy: "代理(可选)";
185
217
  readonly codexTimeout: "Codex 超时(毫秒)";
186
218
  readonly codebuddyTimeout: "CodeBuddy 超时(毫秒)";
187
- readonly claudeModel: "Claude 模型";
219
+ readonly cursorProxy: "代理(可选)";
188
220
  readonly hookPort: "Hook 端口";
189
221
  readonly logLevel: "日志级别";
190
222
  readonly logLevelDefault: "default(程序默认)";
191
- readonly autoApprove: "自动批准工具权限";
192
- readonly sdkMode: "使用 Claude SDK 模式";
193
223
  readonly validate: "校验配置";
194
224
  readonly test: "校验配置";
195
225
  readonly testing: "校验中...";
@@ -7,6 +7,7 @@ export const PAGE_TEXTS = {
7
7
  heroBodyFull: "One local bridge for Telegram, Feishu, QQ, WeWork, and DingTalk.",
8
8
  heroKicker: "Local AI bridge",
9
9
  langButton: "\u4e2d\u6587",
10
+ darkModeToggle: "Toggle dark mode",
10
11
  controlCenter: "Control center",
11
12
  sidebarNoteTitle: "Local workflow",
12
13
  sidebarNoteBody: "Configure at least one platform, save the config, then start the bridge from Service.",
@@ -41,6 +42,17 @@ export const PAGE_TEXTS = {
41
42
  platformsTitle: "Platforms",
42
43
  platformsHint: "Disabled platforms keep their saved values.",
43
44
  enabled: "Enabled",
45
+ readyState: "Ready",
46
+ setupRequired: "Setup required",
47
+ credentialProgress: "{done}/{total} credentials",
48
+ telegramSummary: "Bot token and optional proxy.",
49
+ feishuSummary: "App ID, App Secret, and allowed user scope.",
50
+ qqSummary: "App ID and secret for bot access.",
51
+ weworkSummary: "Corp ID and secret for enterprise delivery.",
52
+ dingtalkSummary: "Client credentials plus optional card template.",
53
+ platformCredentialsTitle: "Credentials",
54
+ platformAccessTitle: "Routing and access",
55
+ platformTestNote: "Checks required credentials against the platform.",
44
56
  platformAiTool: "AI tool override",
45
57
  inheritDefaultAi: "Use default AI tool",
46
58
  botToken: "Bot token",
@@ -57,7 +69,7 @@ export const PAGE_TEXTS = {
57
69
  weworkHelp: 'Get credentials: visit <a href="https://work.weixin.qq.com/" target="_blank">WeWork Admin Console</a>, create an app, and copy the Bot ID (Corp ID) / Secret',
58
70
  clientId: "Client ID / AppKey",
59
71
  clientSecret: "Client Secret / AppSecret",
60
- dingtalkHelp: 'Get credentials: Create an enterprise internal app on DingTalk Open Platform, enable Stream Mode, and get Client ID / Client Secret',
72
+ dingtalkHelp: 'Get credentials: Create an enterprise internal app on <a href="https://open-dev.dingtalk.com/" target="_blank">DingTalk Open Platform</a>, enable Stream Mode, and get Client ID / Client Secret',
61
73
  secret: "Secret",
62
74
  cardTemplateId: "Card template ID",
63
75
  optional: "Optional",
@@ -78,14 +90,17 @@ export const PAGE_TEXTS = {
78
90
  codebuddyCli: "CodeBuddy CLI path",
79
91
  codexProxy: "Codex proxy",
80
92
  claudeTimeout: "Claude timeout (ms)",
93
+ claudeConfigPath: "Config file location",
94
+ claudeAuthToken: "ANTHROPIC_AUTH_TOKEN",
95
+ claudeBaseUrl: "ANTHROPIC_BASE_URL",
96
+ claudeModel: "ANTHROPIC_MODEL",
97
+ claudeProxy: "Proxy (optional)",
81
98
  codexTimeout: "Codex timeout (ms)",
82
99
  codebuddyTimeout: "CodeBuddy timeout (ms)",
83
- claudeModel: "Claude model",
100
+ cursorProxy: "Proxy (optional)",
84
101
  hookPort: "Hook port",
85
102
  logLevel: "Log level",
86
103
  logLevelDefault: "default (app default)",
87
- autoApprove: "Auto-approve tool permissions",
88
- sdkMode: "Use Claude SDK mode",
89
104
  validate: "Validate",
90
105
  test: "Check config",
91
106
  testing: "Checking...",
@@ -114,6 +129,7 @@ export const PAGE_TEXTS = {
114
129
  heroBodyFull: "\u4e00\u4e2a\u672c\u5730\u6865\u63a5\u5165\u53e3\uff0c\u7edf\u4e00\u8fde\u63a5 Telegram\u3001Feishu\u3001QQ\u3001WeWork \u548c DingTalk\u3002",
115
130
  heroKicker: "\u672c\u5730 AI \u6865\u63a5",
116
131
  langButton: "EN",
132
+ darkModeToggle: "\u5207\u6362\u6697\u9ed1\u6a21\u5f0f",
117
133
  controlCenter: "\u63a7\u5236\u4e2d\u5fc3",
118
134
  sidebarNoteTitle: "\u672c\u5730\u5de5\u4f5c\u6d41",
119
135
  sidebarNoteBody: "\u81f3\u5c11\u914d\u7f6e\u4e00\u4e2a\u5e73\u53f0\uff0c\u4fdd\u5b58\u914d\u7f6e\uff0c\u7136\u540e\u5728\u670d\u52a1\u63a7\u5236\u533a\u542f\u52a8\u6865\u63a5\u3002",
@@ -146,6 +162,17 @@ export const PAGE_TEXTS = {
146
162
  platformsTitle: "\u5e73\u53f0\u914d\u7f6e",
147
163
  platformsHint: "\u7981\u7528\u7684\u5e73\u53f0\u4f1a\u4fdd\u7559\u5df2\u4fdd\u5b58\u7684\u503c\u3002",
148
164
  enabled: "\u542f\u7528",
165
+ readyState: "\u5df2\u5c31\u7eea",
166
+ setupRequired: "\u9700\u8981\u5b8c\u6210\u914d\u7f6e",
167
+ credentialProgress: "\u51ed\u8bc1 {done}/{total}",
168
+ telegramSummary: "Bot Token \u4e0e\u53ef\u9009\u4ee3\u7406\u3002",
169
+ feishuSummary: "App ID\u3001App Secret \u4ee5\u53ca\u53ef\u8bbf\u95ee\u7528\u6237\u8303\u56f4\u3002",
170
+ qqSummary: "QQ \u673a\u5668\u4eba App ID \u4e0e Secret\u3002",
171
+ weworkSummary: "\u4f01\u4e1a\u5fae\u4fe1 Corp ID \u4e0e Secret\u3002",
172
+ dingtalkSummary: "\u9489\u9489 Client \u51ed\u8bc1\uff0c\u53ef\u9009\u914d\u7f6e\u5361\u7247\u6a21\u677f ID\u3002",
173
+ platformCredentialsTitle: "\u51ed\u8bc1",
174
+ platformAccessTitle: "\u8def\u7531\u4e0e\u8bbf\u95ee",
175
+ platformTestNote: "\u53ea\u4f1a\u68c0\u67e5\u8be5\u5e73\u53f0\u7684\u5fc5\u586b\u51ed\u8bc1\u662f\u5426\u53ef\u7528\u3002",
149
176
  platformAiTool: "\u5e73\u53f0 AI \u5de5\u5177\u8986\u76d6",
150
177
  inheritDefaultAi: "\u4f7f\u7528\u9ed8\u8ba4 AI \u5de5\u5177",
151
178
  botToken: "Bot Token",
@@ -162,7 +189,7 @@ export const PAGE_TEXTS = {
162
189
  weworkHelp: '\u83b7\u53d6\u51ed\u8bc1\uff1a\u8bbf\u95ee <a href="https://work.weixin.qq.com/" target="_blank">\u4f01\u4e1a\u5fae\u4fe1\u7ba1\u7406\u540e\u53f0</a>\uff0c\u521b\u5efa\u5e94\u7528\u5e76\u62ff\u5230 Bot ID\uff08Corp ID\uff09/ Secret',
163
190
  clientId: "Client ID / AppKey",
164
191
  clientSecret: "Client Secret / AppSecret",
165
- dingtalkHelp: "\u83b7\u53d6\u51ed\u8bc1\uff1a\u5728\u9489\u9489\u5f00\u653e\u5e73\u53f0\u521b\u5efa\u4f01\u4e1a\u5185\u90e8\u5e94\u7528\uff0c\u542f\u7528 Stream Mode\uff0c\u5e76\u62ff\u5230 Client ID / Client Secret",
192
+ dingtalkHelp: '\u83b7\u53d6\u51ed\u8bc1\uff1a\u5728 <a href="https://open-dev.dingtalk.com/" target="_blank">\u9489\u9489\u5f00\u653e\u5e73\u53f0</a> \u521b\u5efa\u4f01\u4e1a\u5185\u90e8\u5e94\u7528\uff0c\u542f\u7528 Stream Mode\uff0c\u5e76\u62ff\u5230 Client ID / Client Secret',
166
193
  cardTemplateId: "\u5361\u7247\u6a21\u677f ID",
167
194
  optional: "\u53ef\u9009",
168
195
  commaSeparatedIds: "\u591a\u4e2a ID \u7528\u9017\u53f7\u5206\u9694",
@@ -182,14 +209,17 @@ export const PAGE_TEXTS = {
182
209
  codebuddyCli: "CodeBuddy CLI \u8def\u5f84",
183
210
  codexProxy: "Codex \u4ee3\u7406",
184
211
  claudeTimeout: "Claude \u8d85\u65f6\uff08\u6beb\u79d2\uff09",
212
+ claudeConfigPath: "\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e",
213
+ claudeAuthToken: "ANTHROPIC_AUTH_TOKEN",
214
+ claudeBaseUrl: "ANTHROPIC_BASE_URL",
215
+ claudeModel: "ANTHROPIC_MODEL",
216
+ claudeProxy: "\u4ee3\u7406\uff08\u53ef\u9009\uff09",
185
217
  codexTimeout: "Codex \u8d85\u65f6\uff08\u6beb\u79d2\uff09",
186
218
  codebuddyTimeout: "CodeBuddy \u8d85\u65f6\uff08\u6beb\u79d2\uff09",
187
- claudeModel: "Claude \u6a21\u578b",
219
+ cursorProxy: "\u4ee3\u7406\uff08\u53ef\u9009\uff09",
188
220
  hookPort: "Hook \u7aef\u53e3",
189
221
  logLevel: "\u65e5\u5fd7\u7ea7\u522b",
190
222
  logLevelDefault: "default\uff08\u7a0b\u5e8f\u9ed8\u8ba4\uff09",
191
- autoApprove: "\u81ea\u52a8\u6279\u51c6\u5de5\u5177\u6743\u9650",
192
- sdkMode: "\u4f7f\u7528 Claude SDK \u6a21\u5f0f",
193
223
  validate: "\u6821\u9a8c\u914d\u7f6e",
194
224
  test: "\u6821\u9a8c\u914d\u7f6e",
195
225
  testing: "\u6821\u9a8c\u4e2d...",