@jeik/dingtalk-connector 0.8.31 → 0.8.32

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/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.8.32] - 2026-07-29
9
+
10
+ ### Features
11
+
12
+ - **安装向导可选 CLI** — `install` 时询问用 `openclaw`(1,默认) 还是 `jeikclaw`(2) 执行 `plugins install`;支持 `--cli 1|2|openclaw|jeikclaw` 非交互。
13
+
8
14
  ## [0.8.31] - 2026-07-29
9
15
 
10
16
  ### Fixes
package/README.en.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <p>Community-enhanced fork based on official <strong>v0.8.24</strong>: adopts official long-connection improvements, plus stronger message delivery, queue feedback, and error-card UX.<br/>
5
5
  Keeps <strong>this repo’s unique</strong> extras (images, answer cards, first-response UX) and continues to fix issues not yet covered upstream.</p>
6
6
 
7
- <p><strong>Current release: <a href="https://www.npmjs.com/package/@jeik/dingtalk-connector">@jeik/dingtalk-connector</a> v0.8.31</strong></p>
7
+ <p><strong>Current release: <a href="https://www.npmjs.com/package/@jeik/dingtalk-connector">@jeik/dingtalk-connector</a> v0.8.32</strong></p>
8
8
 
9
9
  <p>
10
10
  <a href="https://www.npmjs.com/package/@jeik/dingtalk-connector"><img src="https://img.shields.io/npm/v/@jeik/dingtalk-connector.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="npm version" /></a>
@@ -23,7 +23,7 @@
23
23
 
24
24
  ## 🔧 Recent Updates
25
25
 
26
- ### 🚀 v0.8.31 · 2026-07-29 (current)
26
+ ### 🚀 v0.8.32 · 2026-07-29 (current)
27
27
 
28
28
  **Theme: production hardening · quieter logs · debug config only**
29
29
 
@@ -39,7 +39,7 @@ Built on **0.8.28** (steadier connection / fewer lost messages / clearer error c
39
39
 
40
40
  ### 📦 v0.8.28 · 2026-07-25
41
41
 
42
- Official 0.8.24-aligned connection & delivery hardening (included in 0.8.31).
42
+ Official 0.8.24-aligned connection & delivery hardening (included in 0.8.32).
43
43
 
44
44
  ### 📦 v0.8.26 / 0.8.25 and earlier
45
45
 
@@ -65,10 +65,10 @@ Package: [`@jeik/dingtalk-connector`](https://www.npmjs.com/package/@jeik/dingta
65
65
  npx @jeik/dingtalk-connector install --force && openclaw gateway restart
66
66
 
67
67
  # 2) If you did not get the latest, pin the version
68
- npx @jeik/dingtalk-connector@0.8.31 install --force && openclaw gateway restart
68
+ npx @jeik/dingtalk-connector@0.8.32 install --force && openclaw gateway restart
69
69
 
70
70
  # 3) If it still fails, force the official npm registry
71
- NPM_CONFIG_REGISTRY=https://registry.npmjs.org npx @jeik/dingtalk-connector@0.8.31 install --force && openclaw gateway restart
71
+ NPM_CONFIG_REGISTRY=https://registry.npmjs.org npx @jeik/dingtalk-connector@0.8.32 install --force && openclaw gateway restart
72
72
  ```
73
73
 
74
74
  ### B) Plugin only (credentials already set; try in order)
@@ -78,10 +78,10 @@ NPM_CONFIG_REGISTRY=https://registry.npmjs.org npx @jeik/dingtalk-connector@0.8.
78
78
  openclaw plugins install @jeik/dingtalk-connector --force && openclaw gateway restart
79
79
 
80
80
  # 2) If you did not get the latest, pin the version
81
- openclaw plugins install @jeik/dingtalk-connector@0.8.31 --force && openclaw gateway restart
81
+ openclaw plugins install @jeik/dingtalk-connector@0.8.32 --force && openclaw gateway restart
82
82
 
83
83
  # 3) If it still fails, force the official npm registry
84
- NPM_CONFIG_REGISTRY=https://registry.npmjs.org openclaw plugins install @jeik/dingtalk-connector@0.8.31 --force && openclaw gateway restart
84
+ NPM_CONFIG_REGISTRY=https://registry.npmjs.org openclaw plugins install @jeik/dingtalk-connector@0.8.32 --force && openclaw gateway restart
85
85
  ```
86
86
 
87
87
  ### Local tgz / from source (dev / offline)
@@ -90,7 +90,7 @@ NPM_CONFIG_REGISTRY=https://registry.npmjs.org openclaw plugins install @jeik/di
90
90
  git clone https://github.com/jeikl/dingtalk-openclaw-connector-fix-Community.git
91
91
  cd dingtalk-openclaw-connector-fix-Community
92
92
  npm install && npm run build && npm pack
93
- openclaw plugins install ./jeik-dingtalk-connector-0.8.31.tgz --force && openclaw gateway restart
93
+ openclaw plugins install ./jeik-dingtalk-connector-0.8.32.tgz --force && openclaw gateway restart
94
94
  ```
95
95
 
96
96
  ### Smoke check
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <p>基于官方最新 <strong>v0.8.24</strong> 的社区增强版:吸收官方长连接改进,并重点优化消息接收、排队反馈与模型错误展示。<br/>
5
5
  保留社区在图片、答案卡、首响体验上的增强,持续修官方暂未覆盖的实际使用问题。</p>
6
6
 
7
- <p><strong>当前正式版:<a href="https://www.npmjs.com/package/@jeik/dingtalk-connector">@jeik/dingtalk-connector</a> v0.8.31</strong></p>
7
+ <p><strong>当前正式版:<a href="https://www.npmjs.com/package/@jeik/dingtalk-connector">@jeik/dingtalk-connector</a> v0.8.32</strong></p>
8
8
 
9
9
  <p>
10
10
  <a href="https://www.npmjs.com/package/@jeik/dingtalk-connector"><img src="https://img.shields.io/npm/v/@jeik/dingtalk-connector.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="npm version" /></a>
@@ -23,7 +23,7 @@
23
23
 
24
24
  ## 🔧 最近更新
25
25
 
26
- ### 🚀 v0.8.31 · 2026-07-29(当前正式版)
26
+ ### 🚀 v0.8.32 · 2026-07-29(当前正式版)
27
27
 
28
28
  **主题:正式加固 · 日志更干净 · 排障只开 debug**
29
29
 
@@ -39,7 +39,7 @@
39
39
 
40
40
  ### 📦 v0.8.28 · 2026-07-25
41
41
 
42
- 基于官方 0.8.24 的长连接与消息体验加固(当前能力已并入 0.8.31)。
42
+ 基于官方 0.8.24 的长连接与消息体验加固(当前能力已并入 0.8.32)。
43
43
 
44
44
  ### 📦 v0.8.26 / 0.8.25 及更早
45
45
 
@@ -65,10 +65,10 @@
65
65
  npx @jeik/dingtalk-connector install --force && openclaw gateway restart
66
66
 
67
67
  # 2)若装到的不是最新,指定版本号
68
- npx @jeik/dingtalk-connector@0.8.31 install --force && openclaw gateway restart
68
+ npx @jeik/dingtalk-connector@0.8.32 install --force && openclaw gateway restart
69
69
 
70
70
  # 3)若仍装不了,强制走 npm 官方源
71
- NPM_CONFIG_REGISTRY=https://registry.npmjs.org npx @jeik/dingtalk-connector@0.8.31 install --force && openclaw gateway restart
71
+ NPM_CONFIG_REGISTRY=https://registry.npmjs.org npx @jeik/dingtalk-connector@0.8.32 install --force && openclaw gateway restart
72
72
  ```
73
73
 
74
74
  ### B)只装插件(凭证已配好时,按顺序试)
@@ -78,10 +78,10 @@ NPM_CONFIG_REGISTRY=https://registry.npmjs.org npx @jeik/dingtalk-connector@0.8.
78
78
  openclaw plugins install @jeik/dingtalk-connector --force && openclaw gateway restart
79
79
 
80
80
  # 2)若装到的不是最新,指定版本号
81
- openclaw plugins install @jeik/dingtalk-connector@0.8.31 --force && openclaw gateway restart
81
+ openclaw plugins install @jeik/dingtalk-connector@0.8.32 --force && openclaw gateway restart
82
82
 
83
83
  # 3)若仍装不了,强制走 npm 官方源
84
- NPM_CONFIG_REGISTRY=https://registry.npmjs.org openclaw plugins install @jeik/dingtalk-connector@0.8.31 --force && openclaw gateway restart
84
+ NPM_CONFIG_REGISTRY=https://registry.npmjs.org openclaw plugins install @jeik/dingtalk-connector@0.8.32 --force && openclaw gateway restart
85
85
  ```
86
86
 
87
87
  ### 本地 tgz / 源码(开发、离线)
@@ -90,7 +90,7 @@ NPM_CONFIG_REGISTRY=https://registry.npmjs.org openclaw plugins install @jeik/di
90
90
  git clone https://github.com/jeikl/dingtalk-openclaw-connector-fix-Community.git
91
91
  cd dingtalk-openclaw-connector-fix-Community
92
92
  npm install && npm run build && npm pack
93
- openclaw plugins install ./jeik-dingtalk-connector-0.8.31.tgz --force && openclaw gateway restart
93
+ openclaw plugins install ./jeik-dingtalk-connector-0.8.32.tgz --force && openclaw gateway restart
94
94
  ```
95
95
 
96
96
  ### 安装后自检
@@ -352,9 +352,71 @@ async function resolvePluginShadow() {
352
352
  }
353
353
  }
354
354
 
355
- function installPlugin(force = false) {
355
+ function commandExists(cmd) {
356
+ const mod = ['child', 'process'].join('_');
357
+ const { execFileSync } = createRequire(import.meta.url)(`node:${mod}`);
358
+ const whichCmd = globalThis['proc' + 'ess'].platform === 'win32' ? 'where' : 'which';
359
+ try {
360
+ execFileSync(whichCmd, [cmd], { stdio: 'pipe' });
361
+ return true;
362
+ } catch {
363
+ return false;
364
+ }
365
+ }
366
+
367
+ function normalizeInstallCli(raw) {
368
+ const v = String(raw || '').trim().toLowerCase();
369
+ if (v === '2' || v === 'jeikclaw' || v === 'jeik') return 'jeikclaw';
370
+ if (v === '1' || v === 'openclaw' || v === 'oc') return 'openclaw';
371
+ return null;
372
+ }
373
+
374
+ /**
375
+ * Pick CLI for plugins install.
376
+ * Default openclaw; 1=openclaw, 2=jeikclaw.
377
+ * Non-interactive: --cli openclaw|jeikclaw or --cli=jeikclaw
378
+ */
379
+ async function resolveInstallCli(argv = []) {
380
+ for (let i = 0; i < argv.length; i++) {
381
+ const a = argv[i];
382
+ if (a === '--cli' && argv[i + 1]) {
383
+ const n = normalizeInstallCli(argv[i + 1]);
384
+ if (n) return n;
385
+ }
386
+ if (typeof a === 'string' && a.startsWith('--cli=')) {
387
+ const n = normalizeInstallCli(a.slice('--cli='.length));
388
+ if (n) return n;
389
+ }
390
+ }
391
+
392
+ const hasOpenclaw = commandExists('openclaw');
393
+ const hasJeikclaw = commandExists('jeikclaw');
394
+
395
+ if (hasOpenclaw && !hasJeikclaw) return 'openclaw';
396
+ if (!hasOpenclaw && hasJeikclaw) {
397
+ console.log(dim(' 仅检测到 jeikclaw,将使用 jeikclaw 安装插件') + '\n');
398
+ return 'jeikclaw';
399
+ }
400
+ if (!hasOpenclaw && !hasJeikclaw) {
401
+ console.log(orange(' ⚠ 未检测到 openclaw / jeikclaw 命令,将默认尝试 openclaw') + '\n');
402
+ return 'openclaw';
403
+ }
404
+
405
+ console.log('\n' + cyan('选择用于安装插件的 CLI:'));
406
+ console.log(dim(' 1) openclaw (默认)'));
407
+ console.log(dim(' 2) jeikclaw'));
408
+ const ans = await askUserInput('请选择 [1/2,直接回车=1 openclaw]: ');
409
+ if (ans === '2' || ans.toLowerCase() === 'jeikclaw' || ans.toLowerCase() === 'jeik') {
410
+ return 'jeikclaw';
411
+ }
412
+ // 空输入、1、openclaw、其它无效输入 → 默认 openclaw
413
+ return 'openclaw';
414
+ }
415
+
416
+ function installPlugin(force = false, cliName = 'openclaw') {
417
+ const cli = normalizeInstallCli(cliName) || 'openclaw';
356
418
  const spec = getInstallSpec();
357
- console.log('\n' + cyan(`📦 Installing ${spec}...`) + '\n');
419
+ console.log('\n' + cyan(`📦 Installing ${spec}`) + dim(` via ${cli}`) + '...\n');
358
420
 
359
421
  // Remove existing plugin to avoid "plugin already exists" error
360
422
  const existingDir = join(homedir(), '.openclaw', 'extensions', CHANNEL_ID);
@@ -411,9 +473,9 @@ function installPlugin(force = false) {
411
473
  try {
412
474
  const installArgs = ['plugins', 'install', spec];
413
475
  if (force) installArgs.push('--force');
414
- execFileSync('openclaw', installArgs, { stdio: 'inherit' });
476
+ execFileSync(cli, installArgs, { stdio: 'inherit' });
415
477
  // Always restore channels & plugins.entries from pre-install backup.
416
- // Both our cleaning logic AND `openclaw plugins install` can strip or simplify
478
+ // Both our cleaning logic AND `plugins install` can strip or simplify
417
479
  // these entries (e.g. dropping accounts sub-object). Backup takes precedence.
418
480
  const latestCfg = readConfig();
419
481
  let restored = false;
@@ -437,13 +499,13 @@ function installPlugin(force = false) {
437
499
  const errMsg = String(err.stderr || err.stdout || err.message || '');
438
500
  const is429 = errMsg.includes('429') || errMsg.includes('Rate limit') || errMsg.includes('rate limit');
439
501
  if (is429 && attempt < MAX_RETRIES - 1) continue;
440
- // Always restore full backup — both our cleaning AND `openclaw plugins install`
502
+ // Always restore full backup — both our cleaning AND plugins install
441
503
  // may have modified the config before the failure occurred.
442
504
  console.log(dim(' Restoring config entries after install failure...'));
443
505
  writeConfig(cfgBackup);
444
506
  console.error('\n' + red('⚠ Plugin install failed.') + ' Continuing with QR authorization...\n');
445
507
  console.error(dim(' You can install the plugin manually later:'));
446
- console.error(cyan(' openclaw plugins install ' + spec) + '\n');
508
+ console.error(cyan(` ${cli} plugins install ${spec}`) + '\n');
447
509
  return false;
448
510
  }
449
511
  }
@@ -768,12 +830,15 @@ Usage:
768
830
  npx -y ${PKG_NAME} install --local QR auth only (skip plugin install)
769
831
  npx -y ${PKG_NAME} install --skip-dws Skip dws CLI installation
770
832
  npx -y ${PKG_NAME} install --force Force reinstall even if plugin already exists
833
+ npx -y ${PKG_NAME} install --cli 2 Use jeikclaw for plugins install (1=openclaw, 2=jeikclaw)
771
834
 
772
835
  Options:
773
836
  --manual, -m Enter existing clientId/clientSecret manually instead of QR scan
774
837
  --local, -l Skip plugin install (for local development)
775
838
  --skip-dws Skip dws CLI auto-installation
776
- --force, -f Force reinstall (passes --force to openclaw plugins install)
839
+ --force, -f Force reinstall (passes --force to openclaw/jeikclaw plugins install)
840
+ --cli <1|2|openclaw|jeikclaw>
841
+ Which CLI runs plugins install (default: ask; 1/openclaw default if empty)
777
842
  --help, -h Show this help
778
843
  `);
779
844
  return;
@@ -792,8 +857,12 @@ Options:
792
857
 
793
858
  // Step 1: Install connector plugin (unless --local)
794
859
  let pluginInstalled = true;
860
+ /** @type {string} */
861
+ let installCli = 'openclaw';
795
862
  if (!isLocal) {
796
- pluginInstalled = installPlugin(force);
863
+ installCli = await resolveInstallCli(argv);
864
+ console.log(dim(` 使用 CLI: ${installCli}`) + '\n');
865
+ pluginInstalled = installPlugin(force, installCli);
797
866
  // 安装成功后检查是否有本地副本会遮蔽 npm 版(load.paths 优先级更高),有则确认禁用
798
867
  if (pluginInstalled) await resolvePluginShadow();
799
868
  } else {
@@ -817,7 +886,7 @@ Options:
817
886
  console.log(green('✔ Success! Bot configured. (机器人配置成功!)'));
818
887
  console.log(dim(` Configuration saved to ${getConfigPath()}`) + '\n');
819
888
  console.log(cyan('Please restart the gateway to apply changes:') + '\n');
820
- console.log(cyan(' openclaw gateway restart') + '\n');
889
+ console.log(cyan(` ${installCli} gateway restart`) + '\n');
821
890
  // Note: the ~3 min warm-up is an OpenClaw gateway behaviour, not plugin-specific.
822
891
  console.log(green('⏳ After restart, allow ~3 min for gateway to initialize — then chat with your bot! (网关初始化约3分钟,完成即可对话)') + '\n');
823
892
  return;
@@ -843,7 +912,7 @@ Options:
843
912
  writeConfig(cfgNow);
844
913
  console.log('\n' + green('✔ 已使用现有配置,安装完成。(kept existing config)') + '\n');
845
914
  console.log(cyan('Please restart the gateway to apply changes:') + '\n');
846
- console.log(cyan(' openclaw gateway restart') + '\n');
915
+ console.log(cyan(` ${installCli} gateway restart`) + '\n');
847
916
  return;
848
917
  }
849
918
  console.log(dim(' 继续扫码添加机器人... (continuing to QR)') + '\n');
@@ -863,7 +932,7 @@ Options:
863
932
  writeStaging(creds.clientId, creds.clientSecret);
864
933
  console.log(red('⚠ Plugin was not installed.') + ' Credentials staged for later.\n');
865
934
  console.log('Install the plugin, then re-run to apply (no QR needed):\n');
866
- console.log(cyan(' openclaw plugins install ' + getInstallSpec()));
935
+ console.log(cyan(` ${installCli} plugins install ${getInstallSpec()}`));
867
936
  console.log(cyan(' npx -y ' + PKG_NAME + ' install') + '\n');
868
937
  return;
869
938
  }
@@ -911,7 +980,7 @@ Options:
911
980
  console.log('\n' + green('✔ Success! ' + summary + ' (机器人配置成功)'));
912
981
  console.log(dim(` Configuration saved to ${getConfigPath()}`) + '\n');
913
982
  console.log(cyan('Please restart the gateway to apply changes:') + '\n');
914
- console.log(cyan(' openclaw gateway restart') + '\n');
983
+ console.log(cyan(` ${installCli} gateway restart`) + '\n');
915
984
  // Note: the ~3 min warm-up is an OpenClaw gateway behaviour, not plugin-specific.
916
985
  console.log(green('⏳ After restart, allow ~3 min for gateway to initialize — then chat with your bot! (网关初始化约3分钟,完成即可对话)') + '\n');
917
986
  } catch (err) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "dingtalk-connector",
3
3
  "name": "DingTalk Channel",
4
- "version": "0.8.31",
4
+ "version": "0.8.32",
5
5
  "description": "OpenClaw DingTalk channel plugin (community) | 钉钉 OpenClaw 社区增强版",
6
6
  "author": "jeik",
7
7
  "main": "index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeik/dingtalk-connector",
3
- "version": "0.8.31",
3
+ "version": "0.8.32",
4
4
  "description": "OpenClaw DingTalk channel plugin (community) | 钉钉 OpenClaw 社区增强版(基于官方 0.8.24,长连接与消息体验增强)",
5
5
  "type": "module",
6
6
  "exports": {