@honor-claw/yoyo 1.0.7-beta.0 → 1.0.7-beta.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@honor-claw/yoyo",
|
|
3
|
-
"version": "1.0.7-beta.
|
|
3
|
+
"version": "1.0.7-beta.1",
|
|
4
4
|
"description": "OpenClaw Honor Yoyo connection plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"test:unit": "vitest run",
|
|
24
24
|
"test:unit:watch": "vitest",
|
|
25
25
|
"test:coverage": "vitest run --coverage",
|
|
26
|
-
"ci:check": "npx tsc --noEmit && npm run test:coverage"
|
|
26
|
+
"ci:check": "npx tsc --noEmit && npm run test:coverage",
|
|
27
|
+
"publish:beta": "node scripts/publish.js",
|
|
28
|
+
"publish:latest": "node scripts/publish.js --release"
|
|
27
29
|
},
|
|
28
30
|
"dependencies": {
|
|
29
31
|
"http-proxy-agent": "^8.0.0",
|
|
@@ -89,10 +89,33 @@ export class WindowsDeviceInfoProvider implements DeviceInfoProvider {
|
|
|
89
89
|
*/
|
|
90
90
|
getDeviceBrand(): string {
|
|
91
91
|
try {
|
|
92
|
-
|
|
92
|
+
// 方法1:检查注册表(快速但可能不准确)
|
|
93
|
+
const honorRegistry = this.execPowerShell(
|
|
93
94
|
'Get-ItemProperty "HKLM:\\SOFTWARE\\HONOR" -ErrorAction SilentlyContinue'
|
|
94
95
|
);
|
|
95
|
-
|
|
96
|
+
if (honorRegistry.length > 0) {
|
|
97
|
+
return 'HONOR';
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// 方法2:通过计算机系统制造商判断(更可靠)
|
|
101
|
+
const manufacturer = this.execPowerShell(
|
|
102
|
+
"(Get-CimInstance -ClassName Win32_ComputerSystem).Manufacturer"
|
|
103
|
+
);
|
|
104
|
+
console.log(manufacturer)
|
|
105
|
+
if (manufacturer && manufacturer.toLowerCase().includes('honor')) {
|
|
106
|
+
return 'HONOR';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// 方法3:通过BIOS信息判断(最可靠)
|
|
110
|
+
const biosManufacturer = this.execPowerShell(
|
|
111
|
+
"(Get-CimInstance -ClassName Win32_BIOS).Manufacturer"
|
|
112
|
+
);
|
|
113
|
+
console.log(biosManufacturer)
|
|
114
|
+
if (biosManufacturer && biosManufacturer.toLowerCase().includes('honor')) {
|
|
115
|
+
return 'HONOR';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return '';
|
|
96
119
|
} catch {
|
|
97
120
|
return '';
|
|
98
121
|
}
|