pi-free 2.2.5 → 2.2.6

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/constants.ts CHANGED
@@ -16,7 +16,6 @@ export const PROVIDER_QWEN = "qwen";
16
16
  export const PROVIDER_MODAL = "modal";
17
17
  export const PROVIDER_ZENMUX = "zenmux";
18
18
  export const PROVIDER_CROFAI = "crofai";
19
- export const PROVIDER_CODESTRAL = "codestral";
20
19
  export const PROVIDER_LLM7 = "llm7";
21
20
  export const PROVIDER_DEEPINFRA = "deepinfra";
22
21
  export const PROVIDER_SAMBANOVA = "sambanova";
@@ -42,7 +41,6 @@ export const ALL_UNIQUE_PROVIDERS = [
42
41
  PROVIDER_OLLAMA,
43
42
  PROVIDER_ZENMUX,
44
43
  PROVIDER_CROFAI,
45
- PROVIDER_CODESTRAL,
46
44
  PROVIDER_LLM7,
47
45
  PROVIDER_DEEPINFRA,
48
46
  PROVIDER_SAMBANOVA,
@@ -68,7 +66,6 @@ export const BASE_URL_QWEN =
68
66
  "https://dashscope.aliyuncs.com/compatible-mode/v1";
69
67
  export const BASE_URL_ZENMUX = "https://zenmux.ai/api/v1";
70
68
  export const BASE_URL_CROFAI = "https://crof.ai/v1";
71
- export const BASE_URL_CODESTRAL = "https://codestral.mistral.ai/v1";
72
69
  export const BASE_URL_LLM7 = "https://api.llm7.io/v1";
73
70
  export const BASE_URL_DEEPINFRA = "https://api.deepinfra.com/v1/openai";
74
71
  export const BASE_URL_SAMBANOVA = "https://api.sambanova.ai/v1";
package/index.ts CHANGED
@@ -31,7 +31,6 @@ import {
31
31
  } from "./lib/registry.ts";
32
32
  // Import unique provider extensions (only providers NOT built into pi)
33
33
  import cline from "./providers/cline/cline.ts";
34
- import codestral from "./providers/codestral/codestral.ts";
35
34
  import crofai from "./providers/crofai/crofai.ts";
36
35
  import kilo from "./providers/kilo/kilo.ts";
37
36
  import llm7 from "./providers/llm7/llm7.ts";
@@ -61,7 +60,6 @@ const UNIQUE_PROVIDERS: ReadonlyArray<(pi: ExtensionAPI) => Promise<void>> = [
61
60
  cline,
62
61
  zenmux,
63
62
  crofai,
64
- codestral,
65
63
  llm7,
66
64
  deepinfra,
67
65
  sambanova,
@@ -386,28 +384,36 @@ export default async function piFreeEntry(pi: ExtensionAPI) {
386
384
  // Setup model telemetry (tracks real-world performance)
387
385
  setupTelemetry(pi);
388
386
 
389
- // Load all unique providers
390
- // Each provider will register itself with the global toggle system
391
- await Promise.allSettled(UNIQUE_PROVIDERS.map((setup) => setup(pi)));
392
-
393
- // Setup dynamic built-in providers (Mistral, Groq, Cerebras, xAI, Hugging Face,
394
- // OpenRouter/OpenCode from Pi auth, and FastRouter public model discovery)
395
- try {
396
- const { setupDynamicBuiltInProviders } = await import(
397
- "./providers/dynamic-built-in/index.ts"
398
- );
399
- await setupDynamicBuiltInProviders(pi);
400
- } catch (err) {
401
- // Dynamic providers are a best-effort enhancement if the import
402
- // or init fails (e.g. upstream API change), continue with the
403
- // already-registered static providers rather than failing the whole
404
- // extension load. Log full error (message + stack) to the structured
405
- // log so the user can investigate, but never block startup.
406
- _logger.error("[pi-free] Dynamic built-in providers failed to load", {
407
- error: err instanceof Error ? err.message : String(err),
408
- stack: err instanceof Error ? err.stack : undefined,
409
- });
410
- }
387
+ // Load all unique providers + dynamic built-in providers CONCURRENTLY.
388
+ // Running the dynamic phase (e.g. FastRouter) in parallel with the static
389
+ // providers avoids serializing two independent network windows at startup.
390
+ // Each provider registers itself with the global toggle system.
391
+ const dynamicSetup = (async () => {
392
+ try {
393
+ const { setupDynamicBuiltInProviders } = await import(
394
+ "./providers/dynamic-built-in/index.ts"
395
+ );
396
+ await setupDynamicBuiltInProviders(pi);
397
+ } catch (err) {
398
+ // Dynamic providers are a best-effort enhancement — if the import
399
+ // or init fails (e.g. upstream API change), continue with the
400
+ // already-registered static providers rather than failing the whole
401
+ // extension load. Log full error (message + stack) to the structured
402
+ // log so the user can investigate, but never block startup.
403
+ _logger.error(
404
+ "[pi-free] Dynamic built-in providers failed to load",
405
+ {
406
+ error: err instanceof Error ? err.message : String(err),
407
+ stack: err instanceof Error ? err.stack : undefined,
408
+ },
409
+ );
410
+ }
411
+ })();
412
+
413
+ await Promise.allSettled([
414
+ ...UNIQUE_PROVIDERS.map((setup) => setup(pi)),
415
+ dynamicSetup,
416
+ ]);
411
417
 
412
418
  // Setup toggles for pi's built-in providers (e.g., OpenCode)
413
419
  setupBuiltInProviderToggles(pi);