@lingyao037/openclaw-lingyao-cli 1.3.4 → 1.3.5
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/cli.mjs +2 -17
- package/dist/index.js +3 -15
- package/dist/index.js.map +1 -1
- package/dist/setup-entry.js +3 -15
- package/dist/setup-entry.js.map +1 -1
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -37,23 +37,8 @@ const NC = '\x1b[0m';
|
|
|
37
37
|
*/
|
|
38
38
|
function getMachineId() {
|
|
39
39
|
try {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
for (const iface of Object.values(interfaces)) {
|
|
44
|
-
if (!iface) continue;
|
|
45
|
-
for (const alias of iface) {
|
|
46
|
-
if (!alias.internal && alias.mac && alias.mac !== '00:00:00:00:00:00') {
|
|
47
|
-
macSet.add(alias.mac);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (macSet.size > 0) {
|
|
53
|
-
const macStr = [...macSet].sort().join('');
|
|
54
|
-
// MD5 哈希,与 orchestrator.ts 保持一致
|
|
55
|
-
return createHash('md5').update(macStr).digest('hex').substring(0, 8);
|
|
56
|
-
}
|
|
40
|
+
// hostname 在单台机器上跨重启稳定
|
|
41
|
+
return createHash('md5').update(os.hostname()).digest('hex').substring(0, 8);
|
|
57
42
|
} catch (e) {
|
|
58
43
|
// ignore
|
|
59
44
|
}
|
package/dist/index.js
CHANGED
|
@@ -412,7 +412,7 @@ function createSetupAdapter() {
|
|
|
412
412
|
}
|
|
413
413
|
|
|
414
414
|
// src/orchestrator.ts
|
|
415
|
-
import { hostname
|
|
415
|
+
import { hostname } from "os";
|
|
416
416
|
import { createHash } from "crypto";
|
|
417
417
|
|
|
418
418
|
// src/types.ts
|
|
@@ -2233,20 +2233,8 @@ var ErrorHandler = class {
|
|
|
2233
2233
|
// src/orchestrator.ts
|
|
2234
2234
|
function getMachineId() {
|
|
2235
2235
|
try {
|
|
2236
|
-
const
|
|
2237
|
-
|
|
2238
|
-
for (const iface of Object.values(interfaces)) {
|
|
2239
|
-
if (!iface) continue;
|
|
2240
|
-
for (const alias of iface) {
|
|
2241
|
-
if (!alias.internal && alias.mac && alias.mac !== "00:00:00:00:00:00") {
|
|
2242
|
-
macSet.add(alias.mac);
|
|
2243
|
-
}
|
|
2244
|
-
}
|
|
2245
|
-
}
|
|
2246
|
-
const macs = [...macSet].sort();
|
|
2247
|
-
if (macs.length > 0) {
|
|
2248
|
-
return createHash("md5").update(macs.join("")).digest("hex").substring(0, 8);
|
|
2249
|
-
}
|
|
2236
|
+
const host = hostname();
|
|
2237
|
+
return createHash("md5").update(host).digest("hex").substring(0, 8);
|
|
2250
2238
|
} catch (e) {
|
|
2251
2239
|
}
|
|
2252
2240
|
return Math.random().toString(36).substring(2, 10);
|