@honor-claw/yoyo 1.0.2 → 1.0.4
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.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "OpenClaw Honor Yoyo connection plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"@vitest/coverage-v8": "^2.1.8",
|
|
44
44
|
"commander": "^14.0.3",
|
|
45
45
|
"openclaw": "2026.3.8",
|
|
46
|
-
"tsx": "^4.21.0",
|
|
47
46
|
"typescript": "^5.7.0",
|
|
48
47
|
"vitest": "^2.1.8"
|
|
49
48
|
},
|
|
@@ -54,5 +53,8 @@
|
|
|
54
53
|
"extensions": [
|
|
55
54
|
"./index.ts"
|
|
56
55
|
]
|
|
56
|
+
},
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"registry": "https://registry.npmjs.org/"
|
|
57
59
|
}
|
|
58
60
|
}
|
|
@@ -29,7 +29,7 @@ export async function performOAuth2AuthWithBrowser(_: DeviceInfo, configOverride
|
|
|
29
29
|
let receivedCode: string | null = null;
|
|
30
30
|
const serverPromise = startCallbackServer({
|
|
31
31
|
port: config.localPort,
|
|
32
|
-
timeout:
|
|
32
|
+
timeout: 600000,
|
|
33
33
|
onCodeReceived: code => {
|
|
34
34
|
receivedCode = code;
|
|
35
35
|
},
|
|
@@ -24,7 +24,7 @@ export interface CallbackServerOptions {
|
|
|
24
24
|
*/
|
|
25
25
|
export function startCallbackServer(options: CallbackServerOptions): Promise<void> {
|
|
26
26
|
return new Promise((resolve, reject) => {
|
|
27
|
-
const { port, timeout =
|
|
27
|
+
const { port, timeout = 600000, onCodeReceived, onError } = options;
|
|
28
28
|
let timeoutId: NodeJS.Timeout | null = null;
|
|
29
29
|
let serverClosed = false;
|
|
30
30
|
let hasReceivedCode = false;
|
package/src/honor-auth/cloud.ts
CHANGED
|
@@ -14,8 +14,15 @@ export class MacOSDeviceInfoProvider implements DeviceInfoProvider {
|
|
|
14
14
|
*/
|
|
15
15
|
private execCommand(command: string): string {
|
|
16
16
|
try {
|
|
17
|
-
return execSync(command, {
|
|
18
|
-
|
|
17
|
+
return execSync(command, {
|
|
18
|
+
encoding: 'utf-8',
|
|
19
|
+
shell: '/bin/zsh', // 明确指定 shell
|
|
20
|
+
timeout: 10000, // 10秒超时
|
|
21
|
+
stdio: ['ignore', 'pipe', 'pipe'] // 捕获错误输出
|
|
22
|
+
}).trim();
|
|
23
|
+
} catch (error) {
|
|
24
|
+
// 记录错误信息以便调试
|
|
25
|
+
console.error(`Command failed: ${command}`, error);
|
|
19
26
|
return '';
|
|
20
27
|
}
|
|
21
28
|
}
|