@corbat-tech/coco 2.3.0 → 2.4.0

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/index.js CHANGED
@@ -4001,8 +4001,10 @@ var init_pricing = __esm({
4001
4001
  deepseek: { inputPerMillion: 0.14, outputPerMillion: 0.28, contextWindow: 128e3 },
4002
4002
  // Very cheap
4003
4003
  together: { inputPerMillion: 0.2, outputPerMillion: 0.2, contextWindow: 32768 },
4004
- huggingface: { inputPerMillion: 0, outputPerMillion: 0, contextWindow: 32768 }
4004
+ huggingface: { inputPerMillion: 0, outputPerMillion: 0, contextWindow: 32768 },
4005
4005
  // Free tier
4006
+ qwen: { inputPerMillion: 0.3, outputPerMillion: 1.2, contextWindow: 131072 }
4007
+ // qwen-coder-plus pricing
4006
4008
  };
4007
4009
  }
4008
4010
  });
@@ -4496,6 +4498,8 @@ function getApiKey(provider) {
4496
4498
  return process.env["TOGETHER_API_KEY"];
4497
4499
  case "huggingface":
4498
4500
  return process.env["HF_TOKEN"] ?? process.env["HUGGINGFACE_API_KEY"];
4501
+ case "qwen":
4502
+ return process.env["DASHSCOPE_API_KEY"] ?? process.env["QWEN_API_KEY"];
4499
4503
  default:
4500
4504
  return void 0;
4501
4505
  }
@@ -4528,6 +4532,8 @@ function getBaseUrl(provider) {
4528
4532
  return process.env["TOGETHER_BASE_URL"] ?? "https://api.together.xyz/v1";
4529
4533
  case "huggingface":
4530
4534
  return process.env["HF_BASE_URL"] ?? "https://api-inference.huggingface.co/v1";
4535
+ case "qwen":
4536
+ return process.env["DASHSCOPE_BASE_URL"] ?? "https://dashscope.aliyuncs.com/compatible-mode/v1";
4531
4537
  default:
4532
4538
  return void 0;
4533
4539
  }
@@ -4562,6 +4568,8 @@ function getDefaultModel(provider) {
4562
4568
  return process.env["TOGETHER_MODEL"] ?? "Qwen/Qwen2.5-Coder-32B-Instruct";
4563
4569
  case "huggingface":
4564
4570
  return process.env["HF_MODEL"] ?? "Qwen/Qwen2.5-Coder-32B-Instruct";
4571
+ case "qwen":
4572
+ return process.env["QWEN_MODEL"] ?? "qwen-coder-plus";
4565
4573
  default:
4566
4574
  return "gpt-5.3-codex";
4567
4575
  }
@@ -4669,7 +4677,8 @@ var init_env = __esm({
4669
4677
  "mistral",
4670
4678
  "deepseek",
4671
4679
  "together",
4672
- "huggingface"
4680
+ "huggingface",
4681
+ "qwen"
4673
4682
  ];
4674
4683
  cachedPreferences = null;
4675
4684
  env = {
@@ -4780,6 +4789,10 @@ async function createProvider(type, config = {}) {
4780
4789
  provider = new OpenAIProvider("huggingface", "HuggingFace Inference");
4781
4790
  mergedConfig.baseUrl = mergedConfig.baseUrl ?? "https://api-inference.huggingface.co/v1";
4782
4791
  break;
4792
+ case "qwen":
4793
+ provider = new OpenAIProvider("qwen", "Alibaba Qwen");
4794
+ mergedConfig.baseUrl = mergedConfig.baseUrl ?? "https://dashscope.aliyuncs.com/compatible-mode/v1";
4795
+ break;
4783
4796
  default:
4784
4797
  throw new ProviderError(`Unknown provider type: ${type}`, {
4785
4798
  provider: type
@@ -4812,6 +4825,7 @@ function listProviders() {
4812
4825
  { id: "deepseek", name: "DeepSeek", configured: !!getApiKey("deepseek") },
4813
4826
  { id: "together", name: "Together AI", configured: !!getApiKey("together") },
4814
4827
  { id: "huggingface", name: "HuggingFace Inference", configured: !!getApiKey("huggingface") },
4828
+ { id: "qwen", name: "Alibaba Qwen (DashScope)", configured: !!getApiKey("qwen") },
4815
4829
  { id: "lmstudio", name: "LM Studio (Local)", configured: true },
4816
4830
  { id: "ollama", name: "Ollama (Local)", configured: true }
4817
4831
  ];
@@ -24175,6 +24189,70 @@ var PROVIDER_DEFINITIONS = {
24175
24189
  }
24176
24190
  ]
24177
24191
  },
24192
+ // Alibaba Qwen - DashScope API (OpenAI-compatible)
24193
+ qwen: {
24194
+ id: "qwen",
24195
+ name: "Alibaba Qwen",
24196
+ emoji: "\u{1F7E6}",
24197
+ description: "Qwen models via Alibaba DashScope \u2014 strong coding at low cost",
24198
+ envVar: "DASHSCOPE_API_KEY",
24199
+ apiKeyUrl: "https://dashscope.aliyuncs.com",
24200
+ docsUrl: "https://help.aliyun.com/zh/model-studio/developer-reference/",
24201
+ baseUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1",
24202
+ supportsCustomModels: true,
24203
+ openaiCompatible: true,
24204
+ paymentType: "api",
24205
+ features: {
24206
+ streaming: true,
24207
+ functionCalling: true,
24208
+ vision: true
24209
+ },
24210
+ models: [
24211
+ {
24212
+ id: "qwen-coder-plus",
24213
+ name: "Qwen Coder Plus",
24214
+ description: "Best coding model \u2014 Qwen3 based, 131K context",
24215
+ contextWindow: 131072,
24216
+ maxOutputTokens: 8192,
24217
+ recommended: true
24218
+ },
24219
+ {
24220
+ id: "qwen-max",
24221
+ name: "Qwen Max",
24222
+ description: "Most capable general model \u2014 32K context",
24223
+ contextWindow: 32768,
24224
+ maxOutputTokens: 8192
24225
+ },
24226
+ {
24227
+ id: "qwen-plus",
24228
+ name: "Qwen Plus",
24229
+ description: "Good balance of speed and quality \u2014 131K context",
24230
+ contextWindow: 131072,
24231
+ maxOutputTokens: 8192
24232
+ },
24233
+ {
24234
+ id: "qwen-turbo",
24235
+ name: "Qwen Turbo",
24236
+ description: "Fastest and cheapest \u2014 1M context",
24237
+ contextWindow: 1e6,
24238
+ maxOutputTokens: 8192
24239
+ },
24240
+ {
24241
+ id: "qwen2.5-coder-32b-instruct",
24242
+ name: "Qwen 2.5 Coder 32B",
24243
+ description: "Open weights coding model \u2014 32K context",
24244
+ contextWindow: 32768,
24245
+ maxOutputTokens: 8192
24246
+ },
24247
+ {
24248
+ id: "qwq-plus",
24249
+ name: "QwQ Plus",
24250
+ description: "Reasoning model \u2014 chain-of-thought, 131K context",
24251
+ contextWindow: 131072,
24252
+ maxOutputTokens: 8192
24253
+ }
24254
+ ]
24255
+ },
24178
24256
  // HuggingFace Inference - Free tier for open models
24179
24257
  huggingface: {
24180
24258
  id: "huggingface",
@@ -28725,7 +28803,6 @@ async function selectProviderInteractively(providers, currentProviderId) {
28725
28803
  let lastTotalLines = 0;
28726
28804
  const clearPrevious = () => {
28727
28805
  if (lastTotalLines === 0) return;
28728
- process.stdout.write("\x1B[2K\r");
28729
28806
  for (let i = 0; i < lastTotalLines; i++) {
28730
28807
  process.stdout.write("\x1B[1A\x1B[2K");
28731
28808
  }