@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/dist/index.js CHANGED
@@ -2010,6 +2010,7 @@ var ClaudeAdapter = class extends BaseAdapter {
2010
2010
  };
2011
2011
 
2012
2012
  // src/services/adapters/index.ts
2013
+ var DEEPSEEK_API_ENDPOINT = "https://api.deepseek.com/v1";
2013
2014
  function createAdapter(provider) {
2014
2015
  switch (provider) {
2015
2016
  case "glm":
@@ -2028,6 +2029,8 @@ function createAdapter(provider) {
2028
2029
  }
2029
2030
  function createDeepSeekAdapter() {
2030
2031
  const adapter = new OpenAIAdapter();
2032
+ let initialized = false;
2033
+ let config = null;
2031
2034
  return {
2032
2035
  get name() {
2033
2036
  return "DeepSeek";
@@ -2038,12 +2041,38 @@ function createDeepSeekAdapter() {
2038
2041
  get models() {
2039
2042
  return adapter.models;
2040
2043
  },
2041
- initialize: (config) => adapter.initialize(config),
2042
- sendMessage: (messages, options) => adapter.sendMessage(messages, options),
2043
- streamMessage: (messages, options) => adapter.streamMessage(messages, options),
2044
- countTokens: (text) => adapter.countTokens(text),
2045
- validateApiKey: (apiKey) => adapter.validateApiKey(apiKey),
2046
- isInitialized: () => adapter.isInitialized()
2044
+ async initialize(modelConfig) {
2045
+ config = {
2046
+ ...modelConfig,
2047
+ apiEndpoint: DEEPSEEK_API_ENDPOINT
2048
+ };
2049
+ await adapter.initialize(config);
2050
+ initialized = true;
2051
+ },
2052
+ async sendMessage(messages, options) {
2053
+ return adapter.sendMessage(messages, options);
2054
+ },
2055
+ async *streamMessage(messages, options) {
2056
+ yield* adapter.streamMessage(messages, options);
2057
+ },
2058
+ countTokens(text) {
2059
+ return adapter.countTokens(text);
2060
+ },
2061
+ async validateApiKey(apiKey) {
2062
+ try {
2063
+ const response = await fetch(`${DEEPSEEK_API_ENDPOINT}/models`, {
2064
+ headers: {
2065
+ "Authorization": `Bearer ${apiKey}`
2066
+ }
2067
+ });
2068
+ return response.ok;
2069
+ } catch {
2070
+ return false;
2071
+ }
2072
+ },
2073
+ isInitialized() {
2074
+ return initialized;
2075
+ }
2047
2076
  };
2048
2077
  }
2049
2078
  var ModelService = class {
@@ -8984,15 +9013,15 @@ var ALWAYS_ALLOWED = [
8984
9013
  "clear",
8985
9014
  "c",
8986
9015
  "version",
8987
- "v"
9016
+ "v",
9017
+ "update",
9018
+ "u"
8988
9019
  ];
8989
9020
  var REQUIRES_API_KEY = [
8990
9021
  "new",
8991
9022
  "n",
8992
9023
  "init",
8993
- "i",
8994
- "update",
8995
- "u"
9024
+ "i"
8996
9025
  ];
8997
9026
  var CommandExecutor = class {
8998
9027
  async execute(parseResult, ctx) {