ccman 3.1.1 → 3.2.0

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.
Files changed (2) hide show
  1. package/dist/index.js +74 -44
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ var init_package = __esm({
15
15
  "../core/package.json"() {
16
16
  package_default = {
17
17
  name: "@ccman/core",
18
- version: "3.1.1",
18
+ version: "3.2.0",
19
19
  type: "module",
20
20
  description: "Core business logic for ccman",
21
21
  main: "./dist/index.js",
@@ -51,6 +51,7 @@ var init_package = __esm({
51
51
  url: "https://github.com/2ue/ccman/issues"
52
52
  },
53
53
  dependencies: {
54
+ "@ccman/types": "workspace:*",
54
55
  "@iarna/toml": "^2.2.5",
55
56
  "proper-lockfile": "^4.1.2",
56
57
  webdav: "^5.8.0"
@@ -65,10 +66,10 @@ var init_package = __esm({
65
66
  }
66
67
  });
67
68
 
68
- // ../core/dist/constants.js
69
+ // ../types/dist/index.js
69
70
  var TOOL_TYPES, MAIN_TOOL_TYPES, TOOL_CONFIG;
70
- var init_constants = __esm({
71
- "../core/dist/constants.js"() {
71
+ var init_dist = __esm({
72
+ "../types/dist/index.js"() {
72
73
  "use strict";
73
74
  TOOL_TYPES = {
74
75
  CODEX: "codex",
@@ -118,6 +119,15 @@ var init_constants = __esm({
118
119
  }
119
120
  });
120
121
 
122
+ // ../core/dist/constants.js
123
+ var init_constants = __esm({
124
+ "../core/dist/constants.js"() {
125
+ "use strict";
126
+ init_dist();
127
+ init_dist();
128
+ }
129
+ });
130
+
121
131
  // ../core/dist/paths.js
122
132
  import * as os from "os";
123
133
  import * as path from "path";
@@ -793,8 +803,28 @@ function writeGeminiConfig(provider) {
793
803
  } else {
794
804
  delete env.GEMINI_API_KEY;
795
805
  }
806
+ let modelMeta = null;
796
807
  if (provider.model && provider.model.trim().length > 0) {
797
- env.GEMINI_MODEL = provider.model;
808
+ try {
809
+ const parsed = JSON.parse(provider.model);
810
+ if (parsed && typeof parsed === "object") {
811
+ modelMeta = parsed;
812
+ }
813
+ } catch {
814
+ env.GEMINI_MODEL = provider.model;
815
+ }
816
+ }
817
+ if (modelMeta) {
818
+ if (modelMeta.env && typeof modelMeta.env === "object") {
819
+ for (const [key, value] of Object.entries(modelMeta.env)) {
820
+ if (typeof value === "string") {
821
+ env[key] = value;
822
+ }
823
+ }
824
+ }
825
+ if (!env.GEMINI_MODEL && modelMeta.defaultModel) {
826
+ env.GEMINI_MODEL = modelMeta.defaultModel;
827
+ }
798
828
  }
799
829
  saveEnvFile(envPath, env);
800
830
  }
@@ -2106,7 +2136,7 @@ var init_claude_clean = __esm({
2106
2136
 
2107
2137
  // ../core/dist/index.js
2108
2138
  var VERSION;
2109
- var init_dist = __esm({
2139
+ var init_dist2 = __esm({
2110
2140
  "../core/dist/index.js"() {
2111
2141
  "use strict";
2112
2142
  init_package();
@@ -2159,7 +2189,7 @@ function getSyncConfigPath() {
2159
2189
  var init_sync_config = __esm({
2160
2190
  "src/utils/sync-config.ts"() {
2161
2191
  "use strict";
2162
- init_dist();
2192
+ init_dist2();
2163
2193
  }
2164
2194
  });
2165
2195
 
@@ -2367,7 +2397,7 @@ var init_config2 = __esm({
2367
2397
  "src/commands/sync/config.ts"() {
2368
2398
  "use strict";
2369
2399
  init_sync_config();
2370
- init_dist();
2400
+ init_dist2();
2371
2401
  }
2372
2402
  });
2373
2403
 
@@ -2448,7 +2478,7 @@ function testCommand(program2) {
2448
2478
  var init_test = __esm({
2449
2479
  "src/commands/sync/test.ts"() {
2450
2480
  "use strict";
2451
- init_dist();
2481
+ init_dist2();
2452
2482
  init_helpers();
2453
2483
  }
2454
2484
  });
@@ -2526,7 +2556,7 @@ function uploadCommand(program2) {
2526
2556
  var init_upload = __esm({
2527
2557
  "src/commands/sync/upload.ts"() {
2528
2558
  "use strict";
2529
- init_dist();
2559
+ init_dist2();
2530
2560
  init_helpers();
2531
2561
  }
2532
2562
  });
@@ -2600,7 +2630,7 @@ function downloadCommand(program2) {
2600
2630
  var init_download = __esm({
2601
2631
  "src/commands/sync/download.ts"() {
2602
2632
  "use strict";
2603
- init_dist();
2633
+ init_dist2();
2604
2634
  init_helpers();
2605
2635
  }
2606
2636
  });
@@ -2666,7 +2696,7 @@ function mergeCommand(program2) {
2666
2696
  var init_merge2 = __esm({
2667
2697
  "src/commands/sync/merge.ts"() {
2668
2698
  "use strict";
2669
- init_dist();
2699
+ init_dist2();
2670
2700
  init_helpers();
2671
2701
  }
2672
2702
  });
@@ -2722,7 +2752,7 @@ function statusCommand(program2) {
2722
2752
  var init_status = __esm({
2723
2753
  "src/commands/sync/status.ts"() {
2724
2754
  "use strict";
2725
- init_dist();
2755
+ init_dist2();
2726
2756
  init_sync_config();
2727
2757
  }
2728
2758
  });
@@ -2842,7 +2872,7 @@ import { Command as Command3 } from "commander";
2842
2872
  import chalk40 from "chalk";
2843
2873
 
2844
2874
  // src/utils/logo.ts
2845
- init_dist();
2875
+ init_dist2();
2846
2876
  import chalk from "chalk";
2847
2877
  function printLogo() {
2848
2878
  console.log(
@@ -2863,12 +2893,12 @@ function printLogo() {
2863
2893
  }
2864
2894
 
2865
2895
  // src/commands/codex/add.ts
2866
- init_dist();
2896
+ init_dist2();
2867
2897
  import chalk12 from "chalk";
2868
2898
  import inquirer8 from "inquirer";
2869
2899
 
2870
2900
  // src/interactive.ts
2871
- init_dist();
2901
+ init_dist2();
2872
2902
  import inquirer7 from "inquirer";
2873
2903
  import chalk11 from "chalk";
2874
2904
 
@@ -3504,7 +3534,7 @@ function addCommand(program2) {
3504
3534
  }
3505
3535
 
3506
3536
  // src/commands/codex/list.ts
3507
- init_dist();
3537
+ init_dist2();
3508
3538
  import chalk13 from "chalk";
3509
3539
  function listCommand(program2) {
3510
3540
  program2.command("list").alias("ls").description("\u5217\u51FA\u6240\u6709 Codex \u670D\u52A1\u5546").action(async () => {
@@ -3530,7 +3560,7 @@ function listCommand(program2) {
3530
3560
  }
3531
3561
 
3532
3562
  // src/commands/codex/use.ts
3533
- init_dist();
3563
+ init_dist2();
3534
3564
  import chalk14 from "chalk";
3535
3565
  import inquirer9 from "inquirer";
3536
3566
  function useCommand(program2) {
@@ -3593,7 +3623,7 @@ function useCommand(program2) {
3593
3623
  }
3594
3624
 
3595
3625
  // src/commands/codex/current.ts
3596
- init_dist();
3626
+ init_dist2();
3597
3627
  import chalk15 from "chalk";
3598
3628
  function currentCommand(program2) {
3599
3629
  program2.command("current").description("\u663E\u793A\u5F53\u524D\u4F7F\u7528\u7684 Codex \u670D\u52A1\u5546").action(async () => {
@@ -3624,7 +3654,7 @@ function currentCommand(program2) {
3624
3654
  }
3625
3655
 
3626
3656
  // src/commands/codex/remove.ts
3627
- init_dist();
3657
+ init_dist2();
3628
3658
  import chalk16 from "chalk";
3629
3659
  import inquirer10 from "inquirer";
3630
3660
  function removeCommand(program2) {
@@ -3694,7 +3724,7 @@ function removeCommand(program2) {
3694
3724
  }
3695
3725
 
3696
3726
  // src/commands/codex/edit.ts
3697
- init_dist();
3727
+ init_dist2();
3698
3728
  import chalk17 from "chalk";
3699
3729
  import inquirer11 from "inquirer";
3700
3730
  function editCommand(program2) {
@@ -3782,7 +3812,7 @@ function editCommand(program2) {
3782
3812
  }
3783
3813
 
3784
3814
  // src/commands/codex/clone.ts
3785
- init_dist();
3815
+ init_dist2();
3786
3816
  import chalk18 from "chalk";
3787
3817
  import inquirer12 from "inquirer";
3788
3818
  function cloneCommand(program2) {
@@ -3860,7 +3890,7 @@ function createCodexCommands(program2) {
3860
3890
  }
3861
3891
 
3862
3892
  // src/commands/claude/add.ts
3863
- init_dist();
3893
+ init_dist2();
3864
3894
  import chalk19 from "chalk";
3865
3895
  import inquirer13 from "inquirer";
3866
3896
  function addCommand2(program2) {
@@ -3982,7 +4012,7 @@ function addCommand2(program2) {
3982
4012
  }
3983
4013
 
3984
4014
  // src/commands/claude/list.ts
3985
- init_dist();
4015
+ init_dist2();
3986
4016
  import chalk20 from "chalk";
3987
4017
  function listCommand2(program2) {
3988
4018
  program2.command("list").alias("ls").description("\u5217\u51FA\u6240\u6709 Claude Code \u670D\u52A1\u5546").action(async () => {
@@ -4008,7 +4038,7 @@ function listCommand2(program2) {
4008
4038
  }
4009
4039
 
4010
4040
  // src/commands/claude/use.ts
4011
- init_dist();
4041
+ init_dist2();
4012
4042
  import chalk21 from "chalk";
4013
4043
  import inquirer14 from "inquirer";
4014
4044
  function useCommand2(program2) {
@@ -4070,7 +4100,7 @@ function useCommand2(program2) {
4070
4100
  }
4071
4101
 
4072
4102
  // src/commands/claude/current.ts
4073
- init_dist();
4103
+ init_dist2();
4074
4104
  import chalk22 from "chalk";
4075
4105
  function currentCommand2(program2) {
4076
4106
  program2.command("current").description("\u663E\u793A\u5F53\u524D\u4F7F\u7528\u7684 Claude Code \u670D\u52A1\u5546").action(async () => {
@@ -4101,7 +4131,7 @@ function currentCommand2(program2) {
4101
4131
  }
4102
4132
 
4103
4133
  // src/commands/claude/remove.ts
4104
- init_dist();
4134
+ init_dist2();
4105
4135
  import chalk23 from "chalk";
4106
4136
  import inquirer15 from "inquirer";
4107
4137
  function removeCommand2(program2) {
@@ -4171,7 +4201,7 @@ function removeCommand2(program2) {
4171
4201
  }
4172
4202
 
4173
4203
  // src/commands/claude/edit.ts
4174
- init_dist();
4204
+ init_dist2();
4175
4205
  import chalk24 from "chalk";
4176
4206
  import inquirer16 from "inquirer";
4177
4207
  function editCommand2(program2) {
@@ -4259,7 +4289,7 @@ function editCommand2(program2) {
4259
4289
  }
4260
4290
 
4261
4291
  // src/commands/claude/clone.ts
4262
- init_dist();
4292
+ init_dist2();
4263
4293
  import chalk25 from "chalk";
4264
4294
  import inquirer17 from "inquirer";
4265
4295
  function cloneCommand2(program2) {
@@ -4326,7 +4356,7 @@ function cloneCommand2(program2) {
4326
4356
  }
4327
4357
 
4328
4358
  // src/commands/clean.ts
4329
- init_dist();
4359
+ init_dist2();
4330
4360
  import chalk26 from "chalk";
4331
4361
  import inquirer18 from "inquirer";
4332
4362
  function formatBytes2(bytes) {
@@ -4543,7 +4573,7 @@ function createClaudeCommands(program2) {
4543
4573
  }
4544
4574
 
4545
4575
  // src/commands/mcp/add.ts
4546
- init_dist();
4576
+ init_dist2();
4547
4577
  import chalk27 from "chalk";
4548
4578
  import inquirer19 from "inquirer";
4549
4579
  function addCommand3(program2) {
@@ -4704,7 +4734,7 @@ function addCommand3(program2) {
4704
4734
  }
4705
4735
 
4706
4736
  // src/commands/mcp/list.ts
4707
- init_dist();
4737
+ init_dist2();
4708
4738
  import chalk28 from "chalk";
4709
4739
  function listCommand3(program2) {
4710
4740
  program2.command("list").alias("ls").description("\u5217\u51FA\u6240\u6709 MCP \u670D\u52A1\u5668").action(async () => {
@@ -4750,7 +4780,7 @@ function listCommand3(program2) {
4750
4780
  }
4751
4781
 
4752
4782
  // src/commands/mcp/remove.ts
4753
- init_dist();
4783
+ init_dist2();
4754
4784
  import chalk29 from "chalk";
4755
4785
  import inquirer20 from "inquirer";
4756
4786
  function removeCommand3(program2) {
@@ -4825,7 +4855,7 @@ function removeCommand3(program2) {
4825
4855
  }
4826
4856
 
4827
4857
  // src/commands/mcp/edit.ts
4828
- init_dist();
4858
+ init_dist2();
4829
4859
  import chalk30 from "chalk";
4830
4860
  import inquirer21 from "inquirer";
4831
4861
  function editCommand3(program2) {
@@ -4944,7 +4974,7 @@ function createMCPCommands(program2) {
4944
4974
  }
4945
4975
 
4946
4976
  // src/commands/gemini/add.ts
4947
- init_dist();
4977
+ init_dist2();
4948
4978
  import chalk31 from "chalk";
4949
4979
  import inquirer22 from "inquirer";
4950
4980
  function addCommand4(program2) {
@@ -5063,7 +5093,7 @@ function addCommand4(program2) {
5063
5093
  }
5064
5094
 
5065
5095
  // src/commands/gemini/list.ts
5066
- init_dist();
5096
+ init_dist2();
5067
5097
  import chalk32 from "chalk";
5068
5098
  function listCommand4(program2) {
5069
5099
  program2.command("list").alias("ls").description("\u5217\u51FA\u6240\u6709 Gemini CLI \u670D\u52A1\u5546").action(async () => {
@@ -5089,7 +5119,7 @@ function listCommand4(program2) {
5089
5119
  }
5090
5120
 
5091
5121
  // src/commands/gemini/use.ts
5092
- init_dist();
5122
+ init_dist2();
5093
5123
  import chalk33 from "chalk";
5094
5124
  import inquirer23 from "inquirer";
5095
5125
  function useCommand3(program2) {
@@ -5152,7 +5182,7 @@ function useCommand3(program2) {
5152
5182
  }
5153
5183
 
5154
5184
  // src/commands/gemini/current.ts
5155
- init_dist();
5185
+ init_dist2();
5156
5186
  import chalk34 from "chalk";
5157
5187
  function currentCommand3(program2) {
5158
5188
  program2.command("current").description("\u663E\u793A\u5F53\u524D Gemini CLI \u670D\u52A1\u5546").action(async () => {
@@ -5178,7 +5208,7 @@ function currentCommand3(program2) {
5178
5208
  }
5179
5209
 
5180
5210
  // src/commands/gemini/remove.ts
5181
- init_dist();
5211
+ init_dist2();
5182
5212
  import chalk35 from "chalk";
5183
5213
  import inquirer24 from "inquirer";
5184
5214
  function removeCommand4(program2) {
@@ -5243,7 +5273,7 @@ function removeCommand4(program2) {
5243
5273
  }
5244
5274
 
5245
5275
  // src/commands/gemini/edit.ts
5246
- init_dist();
5276
+ init_dist2();
5247
5277
  import chalk36 from "chalk";
5248
5278
  import inquirer25 from "inquirer";
5249
5279
  function editCommand4(program2) {
@@ -5304,7 +5334,7 @@ function editCommand4(program2) {
5304
5334
  }
5305
5335
 
5306
5336
  // src/commands/gemini/clone.ts
5307
- init_dist();
5337
+ init_dist2();
5308
5338
  import chalk37 from "chalk";
5309
5339
  import inquirer26 from "inquirer";
5310
5340
  function cloneCommand3(program2) {
@@ -5383,7 +5413,7 @@ function createGeminiCommands(program2) {
5383
5413
  init_sync();
5384
5414
 
5385
5415
  // src/commands/export.ts
5386
- init_dist();
5416
+ init_dist2();
5387
5417
  import chalk38 from "chalk";
5388
5418
  import path10 from "path";
5389
5419
  function exportCommand(program2) {
@@ -5425,7 +5455,7 @@ function exportCommand(program2) {
5425
5455
  }
5426
5456
 
5427
5457
  // src/commands/import.ts
5428
- init_dist();
5458
+ init_dist2();
5429
5459
  import chalk39 from "chalk";
5430
5460
  import inquirer27 from "inquirer";
5431
5461
  import path11 from "path";
@@ -5507,7 +5537,7 @@ function importCommand(program2) {
5507
5537
  }
5508
5538
 
5509
5539
  // src/index.ts
5510
- init_dist();
5540
+ init_dist2();
5511
5541
  if (process.env.NODE_ENV === "development") {
5512
5542
  console.log(chalk40.gray("\n[\u5F00\u53D1\u6A21\u5F0F] \u914D\u7F6E\u76EE\u5F55:"));
5513
5543
  console.log(chalk40.gray(` ccman: ${getCcmanDir()}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccman",
3
- "version": "3.1.1",
3
+ "version": "3.2.0",
4
4
  "type": "module",
5
5
  "description": "Manage Codex and Claude Code API service provider configurations",
6
6
  "main": "./dist/index.js",