@nick848/sf-cli 1.0.13 → 1.0.15
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/CHANGELOG.md +16 -0
- package/dist/cli/index.js +40 -10
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +39 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1985,6 +1985,7 @@ var ClaudeAdapter = class extends BaseAdapter {
|
|
|
1985
1985
|
};
|
|
1986
1986
|
|
|
1987
1987
|
// src/services/adapters/index.ts
|
|
1988
|
+
var DEEPSEEK_API_ENDPOINT = "https://api.deepseek.com/v1";
|
|
1988
1989
|
function createAdapter(provider) {
|
|
1989
1990
|
switch (provider) {
|
|
1990
1991
|
case "glm":
|
|
@@ -2003,6 +2004,8 @@ function createAdapter(provider) {
|
|
|
2003
2004
|
}
|
|
2004
2005
|
function createDeepSeekAdapter() {
|
|
2005
2006
|
const adapter = new OpenAIAdapter();
|
|
2007
|
+
let initialized = false;
|
|
2008
|
+
let config = null;
|
|
2006
2009
|
return {
|
|
2007
2010
|
get name() {
|
|
2008
2011
|
return "DeepSeek";
|
|
@@ -2013,12 +2016,38 @@ function createDeepSeekAdapter() {
|
|
|
2013
2016
|
get models() {
|
|
2014
2017
|
return adapter.models;
|
|
2015
2018
|
},
|
|
2016
|
-
initialize
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2019
|
+
async initialize(modelConfig) {
|
|
2020
|
+
config = {
|
|
2021
|
+
...modelConfig,
|
|
2022
|
+
apiEndpoint: DEEPSEEK_API_ENDPOINT
|
|
2023
|
+
};
|
|
2024
|
+
await adapter.initialize(config);
|
|
2025
|
+
initialized = true;
|
|
2026
|
+
},
|
|
2027
|
+
async sendMessage(messages, options) {
|
|
2028
|
+
return adapter.sendMessage(messages, options);
|
|
2029
|
+
},
|
|
2030
|
+
async *streamMessage(messages, options) {
|
|
2031
|
+
yield* adapter.streamMessage(messages, options);
|
|
2032
|
+
},
|
|
2033
|
+
countTokens(text) {
|
|
2034
|
+
return adapter.countTokens(text);
|
|
2035
|
+
},
|
|
2036
|
+
async validateApiKey(apiKey) {
|
|
2037
|
+
try {
|
|
2038
|
+
const response = await fetch(`${DEEPSEEK_API_ENDPOINT}/models`, {
|
|
2039
|
+
headers: {
|
|
2040
|
+
"Authorization": `Bearer ${apiKey}`
|
|
2041
|
+
}
|
|
2042
|
+
});
|
|
2043
|
+
return response.ok;
|
|
2044
|
+
} catch {
|
|
2045
|
+
return false;
|
|
2046
|
+
}
|
|
2047
|
+
},
|
|
2048
|
+
isInitialized() {
|
|
2049
|
+
return initialized;
|
|
2050
|
+
}
|
|
2022
2051
|
};
|
|
2023
2052
|
}
|
|
2024
2053
|
var ModelService = class {
|
|
@@ -8959,15 +8988,15 @@ var ALWAYS_ALLOWED = [
|
|
|
8959
8988
|
"clear",
|
|
8960
8989
|
"c",
|
|
8961
8990
|
"version",
|
|
8962
|
-
"v"
|
|
8991
|
+
"v",
|
|
8992
|
+
"update",
|
|
8993
|
+
"u"
|
|
8963
8994
|
];
|
|
8964
8995
|
var REQUIRES_API_KEY = [
|
|
8965
8996
|
"new",
|
|
8966
8997
|
"n",
|
|
8967
8998
|
"init",
|
|
8968
|
-
"i"
|
|
8969
|
-
"update",
|
|
8970
|
-
"u"
|
|
8999
|
+
"i"
|
|
8971
9000
|
];
|
|
8972
9001
|
var CommandExecutor = class {
|
|
8973
9002
|
async execute(parseResult, ctx) {
|