@nick848/sf-cli 1.0.13 → 1.0.14

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.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: (config) => adapter.initialize(config),
2017
- sendMessage: (messages, options) => adapter.sendMessage(messages, options),
2018
- streamMessage: (messages, options) => adapter.streamMessage(messages, options),
2019
- countTokens: (text) => adapter.countTokens(text),
2020
- validateApiKey: (apiKey) => adapter.validateApiKey(apiKey),
2021
- isInitialized: () => adapter.isInitialized()
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 {