ccman 3.1.1 → 3.1.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/dist/index.js +22 -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.
|
|
18
|
+
version: "3.1.2",
|
|
19
19
|
type: "module",
|
|
20
20
|
description: "Core business logic for ccman",
|
|
21
21
|
main: "./dist/index.js",
|
|
@@ -793,8 +793,28 @@ function writeGeminiConfig(provider) {
|
|
|
793
793
|
} else {
|
|
794
794
|
delete env.GEMINI_API_KEY;
|
|
795
795
|
}
|
|
796
|
+
let modelMeta = null;
|
|
796
797
|
if (provider.model && provider.model.trim().length > 0) {
|
|
797
|
-
|
|
798
|
+
try {
|
|
799
|
+
const parsed = JSON.parse(provider.model);
|
|
800
|
+
if (parsed && typeof parsed === "object") {
|
|
801
|
+
modelMeta = parsed;
|
|
802
|
+
}
|
|
803
|
+
} catch {
|
|
804
|
+
env.GEMINI_MODEL = provider.model;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
if (modelMeta) {
|
|
808
|
+
if (modelMeta.env && typeof modelMeta.env === "object") {
|
|
809
|
+
for (const [key, value] of Object.entries(modelMeta.env)) {
|
|
810
|
+
if (typeof value === "string") {
|
|
811
|
+
env[key] = value;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
if (!env.GEMINI_MODEL && modelMeta.defaultModel) {
|
|
816
|
+
env.GEMINI_MODEL = modelMeta.defaultModel;
|
|
817
|
+
}
|
|
798
818
|
}
|
|
799
819
|
saveEnvFile(envPath, env);
|
|
800
820
|
}
|