@honor-claw/yoyo 1.0.0 → 1.0.2
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
|
},
|
|
@@ -306,7 +314,7 @@ export class ConfigManager {
|
|
|
306
314
|
// 处理 env 默认值(仅在未设置时设置)
|
|
307
315
|
const currentEnv =
|
|
308
316
|
currentConfig.plugins?.entries?.[pluginId]?.config?.env;
|
|
309
|
-
const shouldSetEnv = !currentEnv;
|
|
317
|
+
const shouldSetEnv = !isBetaVersion() || !currentEnv;
|
|
310
318
|
const defaultEnv = isBetaVersion() ? "test" : "production";
|
|
311
319
|
|
|
312
320
|
// 构建插件配置
|