engine7 7.1.55 → 7.1.56
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/cli.mjs +9 -3
- package/dist/engine-startup.mjs +1 -1
- package/dist/main.mjs +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1866,6 +1866,7 @@ function getDefaultValues(stateDir) {
|
|
|
1866
1866
|
customBaseUrl: existing.customBaseUrl || "",
|
|
1867
1867
|
customModelId: existing.customModelId || "",
|
|
1868
1868
|
customApi: existing.customApi || "anthropic",
|
|
1869
|
+
customProviderId: existing.customProviderId || "",
|
|
1869
1870
|
tavilyKey: existing.tavilyKey || "",
|
|
1870
1871
|
apiPort: existing.apiPort || 16990
|
|
1871
1872
|
};
|
|
@@ -1880,7 +1881,13 @@ function loadExistingValues(stateDir) {
|
|
|
1880
1881
|
const providers = j.models?.providers || {};
|
|
1881
1882
|
const firstId = Object.keys(providers)[0];
|
|
1882
1883
|
if (firstId) {
|
|
1883
|
-
|
|
1884
|
+
const builtin = ["dashscope", "minimax", "zhipu", "deepseek"];
|
|
1885
|
+
if (builtin.includes(firstId)) {
|
|
1886
|
+
out.primaryProvider = firstId;
|
|
1887
|
+
} else {
|
|
1888
|
+
out.primaryProvider = "custom";
|
|
1889
|
+
out.customProviderId = firstId;
|
|
1890
|
+
}
|
|
1884
1891
|
const p = providers[firstId];
|
|
1885
1892
|
const keyRef = typeof p?.apiKey === "string" ? p.apiKey : "";
|
|
1886
1893
|
if (keyRef.startsWith("env:")) {
|
|
@@ -1967,8 +1974,7 @@ async function interactiveConfig(rl, defaults) {
|
|
|
1967
1974
|
v.customModelId = "";
|
|
1968
1975
|
v.customApi = "anthropic";
|
|
1969
1976
|
if (v.primaryProvider === "custom") {
|
|
1970
|
-
|
|
1971
|
-
v.primaryProvider = await ask(rl, "Provider ID\uFF08\u5C0F\u5199\u5B57\u6BCD\uFF0C\u5982 kimi / moonshot / openrouter / zai\uFF09", isKnownCustom ? defaults.primaryProvider : "custom");
|
|
1977
|
+
v.primaryProvider = await ask(rl, "Provider ID\uFF08\u5C0F\u5199\u5B57\u6BCD\uFF0C\u5982 kimi / moonshot / openrouter / zai\uFF09", defaults.customProviderId || "custom");
|
|
1972
1978
|
const apiOptions = ["anthropic (Anthropic \u517C\u5BB9\uFF0C\u63A8\u8350)", "openai-completions (OpenAI \u517C\u5BB9 /v1/chat/completions)"];
|
|
1973
1979
|
const chosenApi = await askChoice(rl, "API \u7C7B\u578B:", apiOptions, 0, defaults.customApi || void 0);
|
|
1974
1980
|
v.customApi = chosenApi.startsWith("anthropic") ? "anthropic" : "openai-completions";
|
package/dist/engine-startup.mjs
CHANGED
|
@@ -13167,7 +13167,7 @@ var AnthropicProvider = class {
|
|
|
13167
13167
|
this.config = config;
|
|
13168
13168
|
let u = (config.baseUrl || "https://api.anthropic.com").trim();
|
|
13169
13169
|
while (u.endsWith("/")) u = u.slice(0, -1);
|
|
13170
|
-
this.baseUrl = u
|
|
13170
|
+
this.baseUrl = u;
|
|
13171
13171
|
this.sessionId = randomUUID3();
|
|
13172
13172
|
}
|
|
13173
13173
|
config;
|
package/dist/main.mjs
CHANGED
|
@@ -13541,7 +13541,7 @@ var AnthropicProvider = class {
|
|
|
13541
13541
|
this.config = config2;
|
|
13542
13542
|
let u = (config2.baseUrl || "https://api.anthropic.com").trim();
|
|
13543
13543
|
while (u.endsWith("/")) u = u.slice(0, -1);
|
|
13544
|
-
this.baseUrl = u
|
|
13544
|
+
this.baseUrl = u;
|
|
13545
13545
|
this.sessionId = randomUUID3();
|
|
13546
13546
|
}
|
|
13547
13547
|
config;
|