pi-free 2.0.14 → 2.1.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +64 -78
  3. package/banner.svg +21 -36
  4. package/config.ts +123 -9
  5. package/constants.ts +3 -9
  6. package/index.ts +14 -15
  7. package/lib/built-in-toggle.ts +29 -16
  8. package/lib/json-persistence.ts +90 -22
  9. package/lib/logger.ts +21 -12
  10. package/lib/model-detection.ts +2 -12
  11. package/lib/model-enhancer.ts +11 -2
  12. package/lib/model-metadata.ts +387 -0
  13. package/lib/open-browser.ts +74 -24
  14. package/lib/paths.ts +90 -0
  15. package/lib/probe-cache.ts +19 -19
  16. package/lib/provider-cache.ts +74 -28
  17. package/lib/provider-compat.ts +58 -9
  18. package/lib/provider-probe.ts +188 -0
  19. package/lib/registry.ts +1 -5
  20. package/lib/session-start-metrics.ts +46 -0
  21. package/lib/telemetry.ts +115 -86
  22. package/lib/types.ts +22 -2
  23. package/lib/util.ts +80 -21
  24. package/package.json +7 -2
  25. package/provider-failover/benchmark-lookup.ts +17 -5
  26. package/provider-helper.ts +11 -2
  27. package/providers/cline/cline-models.ts +12 -2
  28. package/providers/cline/cline-xml-bridge.ts +974 -0
  29. package/providers/cline/cline.ts +67 -176
  30. package/providers/crofai/crofai.ts +6 -1
  31. package/providers/deepinfra/deepinfra.ts +69 -2
  32. package/providers/dynamic-built-in/index.ts +237 -2
  33. package/providers/kilo/kilo-models.ts +3 -1
  34. package/providers/kilo/kilo.ts +268 -41
  35. package/providers/model-fetcher.ts +18 -55
  36. package/providers/novita/novita.ts +69 -2
  37. package/providers/ollama/ollama.ts +48 -24
  38. package/providers/opencode-session.ts +67 -2
  39. package/providers/routeway/routeway.ts +188 -2
  40. package/providers/sambanova/sambanova.ts +67 -1
  41. package/providers/together/together.ts +69 -2
  42. package/providers/tokenrouter/tokenrouter.ts +378 -0
  43. package/providers/zenmux/zenmux.ts +6 -1
  44. package/scripts/check-extensions.mjs +32 -16
  45. package/providers/nvidia/nvidia.ts +0 -504
@@ -14,6 +14,8 @@ import {
14
14
  PROVIDER_CLINE,
15
15
  } from "../../constants.ts";
16
16
  import type { ProviderModelConfig } from "../../lib/types.ts";
17
+ import { safeEnrichModelsWithModelsDev } from "../../lib/model-metadata.ts";
18
+ import { getProxyModelCompat } from "../../lib/provider-compat.ts";
17
19
  import { cleanModelName, fetchWithRetry } from "../../lib/util.ts";
18
20
 
19
21
  interface ClineRaw {
@@ -164,8 +166,11 @@ function modelFromCatalog(
164
166
  contextWindow:
165
167
  info.context_length ?? info.top_provider?.context_length ?? 128_000,
166
168
  maxTokens: info.top_provider?.max_completion_tokens ?? 8_192,
169
+ ...(getProxyModelCompat({ id: info.id, name: info.name })
170
+ ? { compat: getProxyModelCompat({ id: info.id, name: info.name }) }
171
+ : {}),
167
172
  _pricingKnown: info.pricing !== null && info.pricing !== undefined,
168
- };
173
+ } as ProviderModelConfig & { _pricingKnown?: boolean; compat?: any };
169
174
  }
170
175
 
171
176
  async function fetchClineRecommendedFreeModels(): Promise<
@@ -239,7 +244,12 @@ export async function fetchClineModels(
239
244
  ? models.filter((m) => m.cost.input === 0 && m.cost.output === 0)
240
245
  : models;
241
246
 
242
- return applyHidden(filtered, PROVIDER_CLINE);
247
+ return applyHidden(
248
+ await safeEnrichModelsWithModelsDev(filtered, {
249
+ providerId: PROVIDER_CLINE,
250
+ }),
251
+ PROVIDER_CLINE,
252
+ );
243
253
  }
244
254
 
245
255
  /**