pi-freeflow 1.44.0 → 1.45.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 (46) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +11 -13
  3. package/package.json +1 -1
  4. package/src/catalog.ts +38 -14
  5. package/src/client-recovery.ts +238 -0
  6. package/src/client-staging.ts +316 -0
  7. package/src/client.ts +117 -472
  8. package/src/cline-accounts.ts +26 -1223
  9. package/src/cline-device-auth.ts +5 -3
  10. package/src/cline-pool.ts +691 -0
  11. package/src/cline-roll.ts +642 -0
  12. package/src/commands-cline.ts +283 -0
  13. package/src/commands-relay.ts +808 -0
  14. package/src/commands-startup.ts +264 -0
  15. package/src/commands.ts +119 -1202
  16. package/src/config-paths.ts +254 -0
  17. package/src/config.ts +6 -687
  18. package/src/daemon.ts +16 -1
  19. package/src/deploy.ts +3 -1
  20. package/src/fingerprint-env.ts +334 -0
  21. package/src/fingerprint-tools.ts +348 -0
  22. package/src/index.ts +10 -6
  23. package/src/lane-translation.ts +263 -0
  24. package/src/models.ts +70 -112
  25. package/src/opencode-fingerprint.ts +29 -1310
  26. package/src/opencode-identity.ts +464 -0
  27. package/src/proxy-lanes.ts +1125 -0
  28. package/src/proxy-ports.ts +317 -0
  29. package/src/proxy.ts +74 -1385
  30. package/src/relay-codec.ts +365 -0
  31. package/src/relay-state.ts +10 -367
  32. package/src/relay.ts +78 -31
  33. package/src/sse-aggregator.ts +659 -0
  34. package/src/stream-cloak.ts +882 -0
  35. package/src/stream-pipe.ts +22 -871
  36. package/src/system-ca-fetch.ts +15 -4
  37. package/src/token.ts +7 -2
  38. package/src/tool-args.ts +10 -3
  39. package/src/tool-translation.ts +1 -236
  40. package/src/toolcall-audit.ts +20 -7
  41. package/src/update-checker.ts +17 -1
  42. package/src/update-core.ts +5 -2
  43. package/src/updater.ts +8 -3
  44. package/src/upstream-health.ts +22 -2
  45. package/src/zen-sidecar.ts +1 -0
  46. package/src/zen-transport.ts +48 -18
package/src/models.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Static model definitions and upstream routing catalogs for pi-freeflow
3
3
  *
4
- * Defines the 32 verified free models (live-verified 2026-10-26):
5
- * - 8 OpenCode Zen models (all Chat Completions)
6
- * - 15 KiloCode Keyless Gateway models (OpenRouter format)
4
+ * Defines the 30 verified free models (live-verified 2026-11-09):
5
+ * - 11 OpenCode Zen models (all Chat Completions / Responses)
6
+ * - 10 KiloCode Keyless Gateway models (OpenRouter format)
7
7
  * - 1 Cline direct-only model (per-user pool; z-ai/glm-5.3-flash)
8
8
  * - 8 OVHcloud AI Endpoints models (keyless, direct-only)
9
9
  *
@@ -273,6 +273,64 @@ export const OPENCODE_MODELS: ModelDef[] = [
273
273
  max: "max",
274
274
  },
275
275
  },
276
+ {
277
+ // Added 2026-11-03: Stealth reasoning model on OpenCode Zen (/zen/v1/models: crouton-alpha-free).
278
+ // 1,048,576 context, 270,000 max output. Modalities: text and image.
279
+ id: "crouton-alpha-free",
280
+ name: "Crouton Alpha [OpenCode]",
281
+ reasoning: true,
282
+ contextWindow: 1_048_576,
283
+ maxTokens: 270_000,
284
+ input: ["text", "image"],
285
+ thinkingLevelMap: {
286
+ off: null,
287
+ minimal: "minimal",
288
+ low: "low",
289
+ medium: "medium",
290
+ high: "high",
291
+ xhigh: "xhigh",
292
+ max: "max",
293
+ },
294
+ },
295
+ {
296
+ // Added 2026-11-06: Stealth model on OpenCode Zen (/zen/v1/models: iceman-free).
297
+ // 262,144 context, 131,072 max output. Modalities: text.
298
+ id: "iceman-free",
299
+ name: "Iceman Free [OpenCode]",
300
+ reasoning: true,
301
+ contextWindow: 262_144,
302
+ maxTokens: 131_072,
303
+ input: ["text"],
304
+ thinkingLevelMap: {
305
+ off: null,
306
+ minimal: null,
307
+ low: "low",
308
+ medium: null,
309
+ high: "high",
310
+ xhigh: null,
311
+ max: "max",
312
+ },
313
+ },
314
+ {
315
+ // Added 2026-11-05: Thinking Machines Inkling 2 Small on OpenCode Zen (/zen/v1/models: inkling-2-small-free).
316
+ // 1,048,576 context, 131,072 max output. Modalities: text and image.
317
+ id: "inkling-2-small-free",
318
+ name: "Inkling 2 Small [OpenCode]",
319
+ reasoning: true,
320
+ requiresReasoningContentOnAssistantMessages: true,
321
+ contextWindow: 1_048_576,
322
+ maxTokens: 131_072,
323
+ input: ["text", "image"],
324
+ thinkingLevelMap: {
325
+ off: null,
326
+ minimal: "minimal",
327
+ low: "low",
328
+ medium: "medium",
329
+ high: "high",
330
+ xhigh: "high",
331
+ max: "max",
332
+ },
333
+ },
276
334
  ];
277
335
 
278
336
  /**
@@ -360,36 +418,11 @@ export const KILO_MODELS: ModelDef[] = [
360
418
  thinkingLevelMap: KILO_REASONING_MAP,
361
419
  },
362
420
  {
363
- id: "poolside/laguna-s-2.1:free",
364
- name: "Laguna S 2.1 [Kilo]",
365
- reasoning: true,
366
- // Built-in catalog spec: 1,048,576 context. The free gateway's runtime cap
367
- // is 262,144; the catalog follows the model's built-in highest spec and
368
- // surfaces the upstream error above that cap.
369
- contextWindow: 1_048_576,
370
- maxTokens: 131_072,
371
- input: ["text"],
372
- thinkingFormat: "openrouter",
373
- thinkingLevelMap: KILO_REASONING_MAP,
374
- },
375
- {
376
- id: "poolside/laguna-xs-2.1:free",
377
- name: "Laguna XS 2.1 [Kilo]",
421
+ id: "liquid/lfm-3-1.7b:free",
422
+ name: "Liquid LFM3 1.7B [Kilo]",
378
423
  reasoning: true,
379
424
  contextWindow: 262_144,
380
- maxTokens: 32_768,
381
- input: ["text"],
382
- thinkingFormat: "openrouter",
383
- thinkingLevelMap: KILO_REASONING_MAP,
384
- },
385
- {
386
- id: "liquid/lfm-2.5-2.6b:free",
387
- name: "Liquid LFM 2.5 [Kilo]",
388
- reasoning: true,
389
- // Raised 2026-10-20 to the 128,000 ctx the published twin advertises; the
390
- // 32,768 output ceiling is unchanged.
391
- contextWindow: 128_000,
392
- maxTokens: 32_768,
425
+ maxTokens: 8_192,
393
426
  input: ["text"],
394
427
  thinkingFormat: "openrouter",
395
428
  thinkingLevelMap: KILO_REASONING_MAP,
@@ -449,79 +482,6 @@ export const KILO_MODELS: ModelDef[] = [
449
482
  thinkingFormat: "openrouter",
450
483
  thinkingLevelMap: KILO_REASONING_MAP,
451
484
  },
452
- {
453
- // Added 2026-10-22: this is the Kilo twin of the Zen `beam-free` entry
454
- // (same Reflection AI weights). 1,048,576 / 131,072 agrees across the
455
- // gateway, models.dev (kilo, vercel and opencode rows) and the vendor docs,
456
- // so no reconciliation was needed. Tool call + agent loop verified on chat
457
- // and /v1/responses.
458
- // Always-on reasoning: the model thinks even with `none`/`off`, so the
459
- // toggle cannot disable it and only the effort ladder is exposed. `minimal`
460
- // is accepted but ignored upstream, hence null. `max` is a real level.
461
- // Upstream echoes the bare model id `reflection/beam` without a provider
462
- // field; the catalog keeps the `reflection/beam-free` listing id here so
463
- // alongside `beam-kilo` routing stays unambiguous against the Zen `beam`.
464
- id: "reflection/beam-free",
465
- name: "Beam 1.0 [Kilo]",
466
- reasoning: true,
467
- contextWindow: 1_048_576,
468
- maxTokens: 131_072,
469
- input: ["text"],
470
- thinkingFormat: "openrouter",
471
- thinkingLevelMap: {
472
- off: null,
473
- minimal: null,
474
- low: "low",
475
- medium: "medium",
476
- high: "high",
477
- xhigh: "xhigh",
478
- max: "max",
479
- },
480
- },
481
- {
482
- // Added 2026-10-22: exact gateway id, tool call + agent loop verified on
483
- // both the chat and /v1/responses paths. Same weights as the Zen
484
- // `flint-40b-free` entry, which publishes 65,536 output for them, so the
485
- // declared output is the conservative published figure.
486
- // Context: the vendor card says prompt and output SHARE the 262,144 window.
487
- // The gateway reports 235,929 for this id, which is its 0.9x-window
488
- // convention rather than a measured cap; the shared published window is the
489
- // declared value.
490
- // Thinking is mandatory: `none` answers 400, so `off` stays null. Reasoning
491
- // is verbose — on a tight max_tokens budget the thinking can consume the
492
- // whole allowance and end the turn with empty content, which is a budget
493
- // symptom, not a dead model.
494
- id: "recursive/flint-v1.0:free",
495
- name: "Flint 40B [Kilo]",
496
- reasoning: true,
497
- contextWindow: 262_144,
498
- maxTokens: 65_536,
499
- input: ["text"],
500
- thinkingFormat: "openrouter",
501
- thinkingLevelMap: KILO_REASONING_MAP,
502
- },
503
- {
504
- // Added 2026-10-22: exact gateway id, tool call + agent loop verified on
505
- // both the chat and /v1/responses paths. 262,144 / 235,929 is the pair this
506
- // lane publishes through the gateway `top_provider`, and no cross-lane cap
507
- // exists for the id — there is no twin elsewhere to reconcile against.
508
- // Both figures follow the same 0.9x-window convention: prompt and output
509
- // share the 262,144 window, so 235,929 is the output budget that still
510
- // leaves prompt headroom.
511
- // `none` disables thinking and answers 200, but like `off` everywhere else
512
- // it maps nowhere here, so the shared Kilo ladder is declared.
513
- // Reliability: roughly 60 percent of attempts hit the shared Phala 429
514
- // quota. A 429 means the model is alive and rate-limited — never prune on
515
- // it; the same id answers 200 once the shared pool frees up.
516
- id: "xingchen-agi/xing4.0-29b-a4b:free",
517
- name: "Xing4.0 29B A4B [Kilo]",
518
- reasoning: true,
519
- contextWindow: 262_144,
520
- maxTokens: 235_929,
521
- input: ["text"],
522
- thinkingFormat: "openrouter",
523
- thinkingLevelMap: KILO_REASONING_MAP,
524
- },
525
485
  ];
526
486
 
527
487
  /**
@@ -730,7 +690,7 @@ export const MODEL_ALIASES: Record<string, string> = {
730
690
  "nemotron-3-ultra-550b": "nvidia/nemotron-3-ultra-550b-a55b:free",
731
691
  "nemotron-3.5-lightning": "nvidia/nemotron-3.5-lightning:free",
732
692
  "north-mini-code": "cohere/north-mini-code:free",
733
- "lfm-2.5": "liquid/lfm-2.5-2.6b:free",
693
+ "lfm-3": "liquid/lfm-3-1.7b:free",
734
694
  "glm-5.3-flash": "glm-5.3-flash-free",
735
695
  "glyph-cluster": "stealth/glyph-cluster",
736
696
  "mimo-v2.6-flash": "mimo-v2.6-flash-free",
@@ -738,12 +698,10 @@ export const MODEL_ALIASES: Record<string, string> = {
738
698
  "beam": "beam-free",
739
699
  "deepseek-v4.1-flash": "deepseek-v4.1-flash-free",
740
700
  "flint": "flint-40b-free",
741
- "flint-kilo": "recursive/flint-v1.0:free",
742
- "beam-kilo": "reflection/beam-free",
743
- "xing4.0": "xingchen-agi/xing4.0-29b-a4b:free",
744
- // provider-prefixed short aliases (slash-normalized)
745
- "laguna-s-2.1:free": "poolside/laguna-s-2.1:free",
746
- "laguna-xs-2.1:free": "poolside/laguna-xs-2.1:free",
701
+ "crouton": "crouton-alpha-free",
702
+ "iceman": "iceman-free",
703
+ "inkling-2-small": "inkling-2-small-free",
704
+ "nemotron-3.5-super-vl-kilo": "nvidia/nemotron-3.5-super-vl:free",
747
705
  "kilo-auto": "kilo-auto/free",
748
706
  "openrouter": "openrouter/free",
749
707
  // OVHcloud AI Endpoints — slash-free spellings of the `ovh-free/` ids.
@@ -795,7 +753,7 @@ export const OVH_MODEL_IDS = new Set<string>([
795
753
  .map(([alias]) => alias),
796
754
  ]);
797
755
  /**
798
- * Combined list of all 32 static free models (canonical)
756
+ * Combined list of all 30 static free models (canonical)
799
757
  */
800
758
  export const ALL_MODELS: ModelDef[] = [...OPENCODE_MODELS, ...KILO_MODELS, ...CLINE_MODELS, ...OVH_MODELS];
801
759