engine7 7.1.47 → 7.1.49
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 +18 -10
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -1859,6 +1859,7 @@ function getDefaultValues(stateDir) {
|
|
|
1859
1859
|
wechatAccountId: "",
|
|
1860
1860
|
customBaseUrl: "",
|
|
1861
1861
|
customModelId: "",
|
|
1862
|
+
customApi: "anthropic",
|
|
1862
1863
|
tavilyKey: "",
|
|
1863
1864
|
apiPort: 16990
|
|
1864
1865
|
};
|
|
@@ -1885,11 +1886,15 @@ async function interactiveConfig(rl, defaults) {
|
|
|
1885
1886
|
}
|
|
1886
1887
|
v.customBaseUrl = "";
|
|
1887
1888
|
v.customModelId = "";
|
|
1889
|
+
v.customApi = "anthropic";
|
|
1888
1890
|
if (v.primaryProvider === "custom") {
|
|
1889
|
-
v.primaryProvider = await ask(rl, "Provider ID\uFF08\u5C0F\u5199\u5B57\u6BCD\uFF0C\u5982 kimi / moonshot / openrouter\uFF09", "custom");
|
|
1890
|
-
|
|
1891
|
-
const
|
|
1892
|
-
v.
|
|
1891
|
+
v.primaryProvider = await ask(rl, "Provider ID\uFF08\u5C0F\u5199\u5B57\u6BCD\uFF0C\u5982 kimi / moonshot / openrouter / zai\uFF09", "custom");
|
|
1892
|
+
const apiOptions = ["anthropic (Anthropic \u517C\u5BB9\uFF0C\u63A8\u8350)", "openai-completions (OpenAI \u517C\u5BB9 /v1/chat/completions)"];
|
|
1893
|
+
const chosenApi = await askChoice(rl, "API \u7C7B\u578B:", apiOptions, 0);
|
|
1894
|
+
v.customApi = chosenApi.startsWith("anthropic") ? "anthropic" : "openai-completions";
|
|
1895
|
+
const baseUrlExample = v.customApi === "anthropic" ? "\uFF08\u5982 https://api.moonshot.cn/anthropic\uFF09" : "\uFF08\u5982 https://api.deepinfra.com/v1/openai\uFF09";
|
|
1896
|
+
v.customBaseUrl = await ask(rl, "baseUrl " + baseUrlExample);
|
|
1897
|
+
v.customModelId = await ask(rl, "\u6A21\u578B ID\uFF08\u5982 kimi-k2-turbo-preview\uFF09");
|
|
1893
1898
|
}
|
|
1894
1899
|
const keyMap = {
|
|
1895
1900
|
dashscope: "DashScope API Key",
|
|
@@ -1898,18 +1903,21 @@ async function interactiveConfig(rl, defaults) {
|
|
|
1898
1903
|
deepseek: "DeepSeek API Key"
|
|
1899
1904
|
};
|
|
1900
1905
|
v.primaryApiKey = await ask(rl, keyMap[v.primaryProvider] || v.primaryProvider + " API Key");
|
|
1901
|
-
if (v.customModelId) {
|
|
1902
|
-
v.primaryModel = v.primaryProvider + "/" + v.customModelId;
|
|
1903
|
-
}
|
|
1904
1906
|
const modelMap = {
|
|
1905
1907
|
dashscope: ["dashscope/qwen3.7-max", "dashscope/qwen3.7-plus"],
|
|
1906
1908
|
minimax: ["minimax/MiniMax-M3", "minimax/MiniMax-M2.7"],
|
|
1907
1909
|
zhipu: ["zhipu/glm-5.3", "zhipu/glm-5v-turbo"],
|
|
1908
1910
|
deepseek: ["deepseek/deepseek-v4-pro", "deepseek/deepseek-v4-flash"]
|
|
1909
1911
|
};
|
|
1910
|
-
if (
|
|
1911
|
-
|
|
1912
|
+
if (v.customModelId) {
|
|
1913
|
+
v.primaryModel = v.primaryProvider + "/" + v.customModelId;
|
|
1914
|
+
} else if (modelMap[v.primaryProvider]) {
|
|
1915
|
+
const models = modelMap[v.primaryProvider];
|
|
1912
1916
|
v.primaryModel = await askChoice(rl, "\u4E3B\u6A21\u578B:", models, 0);
|
|
1917
|
+
} else {
|
|
1918
|
+
console.log("\u26A0\uFE0F \u8FD8\u7F3A\u6A21\u578B ID\uFF0C\u8865\u4E00\u4E0B\uFF1A");
|
|
1919
|
+
v.customModelId = await ask(rl, "\u6A21\u578B ID\uFF08\u5982 glm-5.3 / kimi-k2-turbo-preview\uFF09");
|
|
1920
|
+
v.primaryModel = v.primaryProvider + "/" + v.customModelId;
|
|
1913
1921
|
}
|
|
1914
1922
|
const visionCapableMap = {
|
|
1915
1923
|
"dashscope/qwen3.7-max": true,
|
|
@@ -2156,7 +2164,7 @@ function generateConfig(v) {
|
|
|
2156
2164
|
if (!providerDefs[v.primaryProvider] && v.customModelId) {
|
|
2157
2165
|
config.models.providers[v.primaryProvider] = {
|
|
2158
2166
|
baseUrl: (v.customBaseUrl || "").trim(),
|
|
2159
|
-
api:
|
|
2167
|
+
api: v.customApi,
|
|
2160
2168
|
apiKey: "env:" + v.primaryProvider.toUpperCase().replace(/[^A-Z0-9_]/g, "_") + "_API_KEY",
|
|
2161
2169
|
models: [
|
|
2162
2170
|
{ id: v.customModelId, name: v.customModelId, reasoning: false, input: ["text"], contextWindow: 2e5, maxTokens: 8192 }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "engine7",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.49",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Engine 7 — 给助手一个家 / A home for your AI assistant",
|
|
6
6
|
"main": "dist/main.mjs",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"typescript": "^6.0.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@discordjs/opus": "^0.10.0",
|
|
34
33
|
"@larksuiteoapi/node-sdk": "^1.66.1",
|
|
35
34
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
36
35
|
"chokidar": "^5.0.0",
|
|
@@ -44,6 +43,7 @@
|
|
|
44
43
|
"typebox": "^1.1.38"
|
|
45
44
|
},
|
|
46
45
|
"optionalDependencies": {
|
|
46
|
+
"@discordjs/opus": "^0.10.0",
|
|
47
47
|
"sqlite-vec-darwin-arm64": "^0.1.9",
|
|
48
48
|
"sqlite-vec-darwin-x64": "^0.1.9",
|
|
49
49
|
"sqlite-vec-linux-arm64": "^0.1.9",
|