pi-freeflow 1.23.3 → 1.26.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/CHANGELOG.md +31 -0
- package/README.md +381 -379
- package/package.json +1 -1
- package/src/catalog.ts +19 -13
- package/src/cline-accounts.ts +891 -634
- package/src/index.ts +1 -1
- package/src/models.ts +58 -30
- package/src/proxy.ts +1509 -1466
- package/src/upstream-health.ts +507 -492
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-freeflow",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.26.0",
|
|
5
5
|
"description": "Thin provider for OMP/Pi — model list + dumb relay proxy + log; host pi-ai owns thinking/normalization",
|
|
6
6
|
"main": "extensions/index.ts",
|
|
7
7
|
"types": "src/index.ts",
|
package/src/catalog.ts
CHANGED
|
@@ -30,8 +30,13 @@ import type {
|
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Pruned model IDs that must never re-enter the catalog via disk cache or upstream merge.
|
|
33
|
+
* - jev-1.13-free: non-chat decision model, chat-incompatible — never registered.
|
|
34
|
+
* - deepseek-v4-flash-free: listed but currently unserved upstream — stays out until it answers.
|
|
35
|
+
* - stepfun/step-3.7-flash:free: gone from the live Kilo free list — only the paid counterpart remains.
|
|
36
|
+
* - inclusionai/ling-3.0-flash-vl:free: gone from the live Kilo free list — only the paid counterpart remains.
|
|
33
37
|
*/
|
|
34
38
|
export const DEAD_MODEL_IDS = new Set<string>([
|
|
39
|
+
"jev-1.13-free",
|
|
35
40
|
"deepseek-v4-flash-free",
|
|
36
41
|
"x-preview-f-free",
|
|
37
42
|
"hy3-free",
|
|
@@ -41,6 +46,9 @@ export const DEAD_MODEL_IDS = new Set<string>([
|
|
|
41
46
|
"minimax/minimax-m2.7:free",
|
|
42
47
|
"minimax/minimax-m3:free",
|
|
43
48
|
"thinkingmachines/inkling:free",
|
|
49
|
+
"union-alpha",
|
|
50
|
+
"stepfun/step-3.7-flash:free",
|
|
51
|
+
"inclusionai/ling-3.0-flash-vl:free",
|
|
44
52
|
]);
|
|
45
53
|
/**
|
|
46
54
|
* Free-tier allowlist for anything entering the picker via network or stale disk.
|
|
@@ -80,7 +88,7 @@ export function sanitizeCatalogModels(models: RegisteredModel[]): RegisteredMode
|
|
|
80
88
|
}
|
|
81
89
|
/**
|
|
82
90
|
* In-memory cache of currently active/available free models.
|
|
83
|
-
* Initialized with all
|
|
91
|
+
* Initialized with all 33 verified models for 0ms instant availability.
|
|
84
92
|
*/
|
|
85
93
|
let aliveCatalog: RegisteredModel[] = ALL_MODELS.map((m) => ({
|
|
86
94
|
...m,
|
|
@@ -389,13 +397,14 @@ export async function refreshCatalog(force = false): Promise<RegisteredModel[]>
|
|
|
389
397
|
}
|
|
390
398
|
}
|
|
391
399
|
|
|
392
|
-
// Stale cache still better than empty —
|
|
400
|
+
// Stale cache still better than empty — overlay it on the static base rather
|
|
401
|
+
// than returning it as the catalog. A cache written before an id existed in
|
|
402
|
+
// the static list can hold as many entries as the static set while missing
|
|
403
|
+
// ids we ship today, so no "the cache is big enough" guard can be trusted;
|
|
404
|
+
// the overlay keeps the static ids and adds whatever the cache knows.
|
|
393
405
|
if (disk && Array.isArray(disk.models) && disk.models.length > 0) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
aliveCatalog = filtered;
|
|
397
|
-
return aliveCatalog;
|
|
398
|
-
}
|
|
406
|
+
aliveCatalog = mergeCatalog(staticBase, sanitizeCatalogModels(disk.models));
|
|
407
|
+
return aliveCatalog;
|
|
399
408
|
}
|
|
400
409
|
// No valid fresh cache — try stale disk cache directly (readCatalogCache returns null when expired)
|
|
401
410
|
try {
|
|
@@ -403,16 +412,13 @@ export async function refreshCatalog(force = false): Promise<RegisteredModel[]>
|
|
|
403
412
|
const raw = fs.readFileSync(CATALOG_CACHE_FILE, "utf8");
|
|
404
413
|
const stale = JSON.parse(raw) as CatalogCacheData;
|
|
405
414
|
if (Array.isArray(stale.models) && stale.models.length > 0) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
aliveCatalog = filtered;
|
|
409
|
-
return aliveCatalog;
|
|
410
|
-
}
|
|
415
|
+
aliveCatalog = mergeCatalog(staticBase, sanitizeCatalogModels(stale.models));
|
|
416
|
+
return aliveCatalog;
|
|
411
417
|
}
|
|
412
418
|
}
|
|
413
419
|
} catch (err) {
|
|
414
420
|
logDebug("Failed reading stale catalog cache", { error: String(err) });
|
|
415
421
|
}
|
|
416
|
-
// No
|
|
422
|
+
// No usable cache — return the in-memory static-backed catalog (host will refresh if needed)
|
|
417
423
|
return aliveCatalog;
|
|
418
424
|
}
|