@honor-claw/yoyo 1.0.1 → 1.0.3
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
|
@@ -121,10 +121,10 @@ export class ConfigManager {
|
|
|
121
121
|
| "test"
|
|
122
122
|
| "production"
|
|
123
123
|
| undefined;
|
|
124
|
-
return env || "
|
|
124
|
+
return env || "production";
|
|
125
125
|
} catch (error) {
|
|
126
126
|
console.error(`[claw-configs] Failed to read env config: ${error}`);
|
|
127
|
-
return "
|
|
127
|
+
return "production";
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -224,6 +224,8 @@ export class ConfigManager {
|
|
|
224
224
|
async updateUserConfig(userConfig: UserConfig): Promise<void> {
|
|
225
225
|
try {
|
|
226
226
|
const currentConfig = this.loadConfig();
|
|
227
|
+
const currentEnv = currentConfig.plugins?.entries?.[PLUGIN_YOYO_ID]?.config?.env;
|
|
228
|
+
const currentGrayTag = currentConfig.plugins?.entries?.[PLUGIN_YOYO_ID]?.config?.gray;
|
|
227
229
|
|
|
228
230
|
const updatedConfig: OpenClawConfig = {
|
|
229
231
|
...currentConfig,
|
|
@@ -236,6 +238,8 @@ export class ConfigManager {
|
|
|
236
238
|
enabled: true,
|
|
237
239
|
config: {
|
|
238
240
|
user: userConfig,
|
|
241
|
+
env: currentEnv,
|
|
242
|
+
...(currentGrayTag && { gray: currentGrayTag }),
|
|
239
243
|
},
|
|
240
244
|
},
|
|
241
245
|
},
|
|
@@ -257,6 +261,8 @@ export class ConfigManager {
|
|
|
257
261
|
async clearUserConfig(): Promise<void> {
|
|
258
262
|
try {
|
|
259
263
|
const currentConfig = this.loadConfig();
|
|
264
|
+
const currentEnv = currentConfig.plugins?.entries?.[PLUGIN_YOYO_ID]?.config?.env;
|
|
265
|
+
const currentGrayTag = currentConfig.plugins?.entries?.[PLUGIN_YOYO_ID]?.config?.gray;
|
|
260
266
|
|
|
261
267
|
const updatedConfig: OpenClawConfig = {
|
|
262
268
|
...currentConfig,
|
|
@@ -268,6 +274,8 @@ export class ConfigManager {
|
|
|
268
274
|
...currentConfig.plugins?.entries?.[PLUGIN_YOYO_ID],
|
|
269
275
|
config: {
|
|
270
276
|
user: undefined,
|
|
277
|
+
env: currentEnv,
|
|
278
|
+
...(currentGrayTag && { gray: currentGrayTag }),
|
|
271
279
|
},
|
|
272
280
|
},
|
|
273
281
|
},
|
|
@@ -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
|
}
|