@ia-ccun/code-agent-cli 0.0.58-beta.2 → 0.0.58

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": "@ia-ccun/code-agent-cli",
3
- "version": "0.0.58-beta.2",
3
+ "version": "0.0.58",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -294,6 +294,9 @@ const FORCE_OVERWRITE_LIST = [
294
294
  "APPEND_SYSTEM.md",
295
295
  "SYSTEM.md",
296
296
  "help.md",
297
+ // 强制覆盖 settings.json:升级后必须拿到新的 packages / extensions / defaultProvider 配置。
298
+ // 覆盖前会把用户旧配置备份成 settings.json.bak,避免丢掉本地自定义(packages 等)。
299
+ "settings.json",
297
300
  "extensions/*.ts",
298
301
  "prompts/*.md",
299
302
  "skills/*/SKILL.md",
@@ -379,6 +382,17 @@ function forceOverwriteList(relativePaths) {
379
382
  if (!existsSync(parentDir)) {
380
383
  mkdirSync(parentDir, { recursive: true });
381
384
  }
385
+ // settings.json 里通常有用户自己的 packages / extensions / memory 配置,覆盖前先备份。
386
+ if (relativePath === "settings.json" && existsSync(destPath)) {
387
+ try {
388
+ copyFileSync(destPath, `${destPath}.bak`);
389
+ console.log(
390
+ `✓ Backed up existing settings.json -> settings.json.bak`,
391
+ );
392
+ } catch (e) {
393
+ console.log(`⚠ Could not back up settings.json: ${e.message}`);
394
+ }
395
+ }
382
396
  copyFileSync(srcPath, destPath);
383
397
  console.log(`✓ Force overwritten: ${relativePath}`);
384
398
  }