@lingyao037/openclaw-lingyao-cli 1.1.0 → 1.1.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.
Files changed (2) hide show
  1. package/cli.mjs +13 -39
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -37,23 +37,20 @@ const NC = '\x1b[0m';
37
37
  function getMachineId() {
38
38
  try {
39
39
  const interfaces = os.networkInterfaces();
40
- let macStr = '';
41
-
42
- for (const name of Object.keys(interfaces)) {
43
- const iface = interfaces[name];
40
+ const macs = [];
41
+
42
+ for (const iface of Object.values(interfaces)) {
44
43
  if (!iface) continue;
45
-
46
44
  for (const alias of iface) {
47
45
  if (!alias.internal && alias.mac && alias.mac !== '00:00:00:00:00:00') {
48
- macStr += alias.mac;
46
+ macs.push(alias.mac);
49
47
  }
50
48
  }
51
49
  }
52
-
53
- if (macStr) {
54
- import('crypto').then(crypto => {
55
- // this is async, but we want sync, so we just use require if possible
56
- });
50
+
51
+ if (macs.length > 0) {
52
+ macs.sort();
53
+ const macStr = macs.join('');
57
54
  // fallback to simple hash since we can't use top level await here easily in older nodes
58
55
  let hash = 0;
59
56
  for (let i = 0; i < macStr.length; i++) {
@@ -395,11 +392,6 @@ class LingyaoInstaller {
395
392
 
396
393
  config.plugins.entries.lingyao = {
397
394
  enabled: true,
398
- config: {
399
- maxOfflineMessages: 100,
400
- tokenExpiryDays: 30,
401
- gatewayId,
402
- }
403
395
  };
404
396
 
405
397
  // 写回配置文件
@@ -678,29 +670,11 @@ class LingyaoInstaller {
678
670
  }
679
671
  }
680
672
 
681
- // Save paired device info to OpenClaw config
682
- saveDeviceInfo(deviceInfo) {
683
- if (!this.openclawPath) return;
684
-
685
- const configFiles = [
686
- join(this.openclawPath, 'openclaw.json'),
687
- join(this.openclawPath, 'config.json'),
688
- ];
689
-
690
- for (const file of configFiles) {
691
- if (!existsSync(file)) continue;
692
- try {
693
- const config = JSON.parse(readFileSync(file, 'utf-8'));
694
- if (config.plugins?.entries?.lingyao?.config) {
695
- config.plugins.entries.lingyao.config.pairedDevice = deviceInfo;
696
- writeFileSync(file, JSON.stringify(config, null, 2), 'utf-8');
697
- this.success('设备信息已保存到配置');
698
- }
699
- } catch {
700
- // Ignore config write errors
701
- }
702
- break; // Only write to first found config file
703
- }
673
+ // Save paired device info (no longer writes to openclaw.json — device info
674
+ // is managed server-side via the relay, not in plugin config).
675
+ saveDeviceInfo(_deviceInfo) {
676
+ // No-op: pairedDevice was previously written to plugins.entries.lingyao.config
677
+ // which violates OpenClaw's additionalProperties:false constraint.
704
678
  }
705
679
 
706
680
  // 主安装流程
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingyao037/openclaw-lingyao-cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Lingyao Channel Plugin for OpenClaw - bidirectional sync via lingyao.live server relay",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",