free-pi-cli 0.4.8 → 0.4.9
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/index.js
CHANGED
|
@@ -46,7 +46,7 @@ function openBrowser(url, platform = process.platform, spawnImpl = spawn) {
|
|
|
46
46
|
// package.json
|
|
47
47
|
var package_default = {
|
|
48
48
|
name: "free-pi-cli",
|
|
49
|
-
version: "0.4.
|
|
49
|
+
version: "0.4.9",
|
|
50
50
|
description: "Free, ad-supported distribution of the pi coding agent. Inference paid for by ads.",
|
|
51
51
|
license: "MIT",
|
|
52
52
|
type: "module",
|
|
@@ -4906,7 +4906,8 @@ var ClientVersionResponseSchema = object({
|
|
|
4906
4906
|
latest: string2(),
|
|
4907
4907
|
model: string2().optional(),
|
|
4908
4908
|
notice: string2().optional(),
|
|
4909
|
-
models: array(object({ id: string2(), name: string2() })).optional()
|
|
4909
|
+
models: array(object({ id: string2(), name: string2() })).optional(),
|
|
4910
|
+
fusion: object({ planner: string2(), executor: string2() }).optional()
|
|
4910
4911
|
});
|
|
4911
4912
|
var SessionResetResponseSchema = object({
|
|
4912
4913
|
released: boolean2()
|
|
@@ -9458,6 +9459,12 @@ function installFooterRightAlign(mode) {
|
|
|
9458
9459
|
|
|
9459
9460
|
// src/changelog.ts
|
|
9460
9461
|
var CHANGELOG_HIGHLIGHTS = [
|
|
9462
|
+
{
|
|
9463
|
+
version: "0.4.9",
|
|
9464
|
+
highlights: [
|
|
9465
|
+
"\uD83E\uDDE8 Fusion is now much cheaper: DeepSeek V4 Pro plans and DeepSeek V4 Flash builds, so each Fusion turn uses a small fraction of the allowance it used to. Fusion is also listed first in /model."
|
|
9466
|
+
]
|
|
9467
|
+
},
|
|
9461
9468
|
{
|
|
9462
9469
|
version: "0.4.8",
|
|
9463
9470
|
highlights: [
|
|
@@ -9896,9 +9903,18 @@ function createHeaderExtension(opts) {
|
|
|
9896
9903
|
|
|
9897
9904
|
// src/fusion.ts
|
|
9898
9905
|
var FUSION_ID = "fusion";
|
|
9899
|
-
var
|
|
9900
|
-
var
|
|
9906
|
+
var FUSION_PICKER_ID = "\uD83E\uDDE8 fusion";
|
|
9907
|
+
var FUSION_NAME = "\uD83E\uDDE8 Fusion · DeepSeek Pro plans, Flash builds";
|
|
9908
|
+
var FUSION_FALLBACK_NAME = "\uD83E\uDDE8 Fusion · Argon plans, DeepSeek builds";
|
|
9909
|
+
var FUSION_PLANNER_ID = "deepseek-v4-pro";
|
|
9901
9910
|
var FUSION_EXECUTOR_ID = "deepseek-v4-flash";
|
|
9911
|
+
var FUSION_FALLBACK_PLANNER_ID = "gemini-4-argon-flex";
|
|
9912
|
+
function resolveFusionIds(catalogIds, server) {
|
|
9913
|
+
const has = (id) => catalogIds.includes(id);
|
|
9914
|
+
if (server && has(server.planner) && has(server.executor))
|
|
9915
|
+
return server;
|
|
9916
|
+
return { planner: has(FUSION_PLANNER_ID) ? FUSION_PLANNER_ID : FUSION_FALLBACK_PLANNER_ID, executor: FUSION_EXECUTOR_ID };
|
|
9917
|
+
}
|
|
9902
9918
|
function editedThisTurn(messages) {
|
|
9903
9919
|
for (let i = messages.length - 1;i >= 0; i--) {
|
|
9904
9920
|
const message = messages[i];
|
|
@@ -9943,7 +9959,7 @@ function routeFusion(request, models) {
|
|
|
9943
9959
|
if (restartPlan)
|
|
9944
9960
|
return route(models.planner, "plan");
|
|
9945
9961
|
const failed = request.failed;
|
|
9946
|
-
if (!failed || failed.model.provider === PROVIDER_NAME && failed.model.id ===
|
|
9962
|
+
if (!failed || failed.model.provider === PROVIDER_NAME && failed.model.id === models.planner?.id) {
|
|
9947
9963
|
return route(models.executor, "build");
|
|
9948
9964
|
}
|
|
9949
9965
|
return { ...route(failed.model), thinkingLevel: failed.thinkingLevel ?? request.thinkingLevel };
|
|
@@ -9952,21 +9968,24 @@ function routeFusion(request, models) {
|
|
|
9952
9968
|
return phase === "build" || editedThisTurn(request.messages) ? route(models.executor, "build") : route(models.planner, "plan");
|
|
9953
9969
|
}
|
|
9954
9970
|
}
|
|
9955
|
-
function createFusionExtension(defaultModelId) {
|
|
9971
|
+
function createFusionExtension(defaultModelId, ids = resolveFusionIds([])) {
|
|
9972
|
+
const name = ids.planner === FUSION_PLANNER_ID && ids.executor === FUSION_EXECUTOR_ID ? FUSION_NAME : ids.planner === FUSION_FALLBACK_PLANNER_ID ? FUSION_FALLBACK_NAME : "\uD83E\uDDE8 Fusion";
|
|
9956
9973
|
return {
|
|
9957
9974
|
name: "free-pi-fusion",
|
|
9958
9975
|
factory: (pi) => {
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9976
|
+
for (const id of [FUSION_PICKER_ID, FUSION_ID]) {
|
|
9977
|
+
pi.registerVirtualModel({
|
|
9978
|
+
provider: PROVIDER_NAME,
|
|
9979
|
+
id,
|
|
9980
|
+
name,
|
|
9981
|
+
input: ["text"],
|
|
9982
|
+
route: (request, ctx) => routeFusion(request, {
|
|
9983
|
+
planner: ctx.modelRegistry.find(PROVIDER_NAME, ids.planner),
|
|
9984
|
+
executor: ctx.modelRegistry.find(PROVIDER_NAME, ids.executor),
|
|
9985
|
+
defaultModel: ctx.modelRegistry.find(PROVIDER_NAME, defaultModelId)
|
|
9986
|
+
})
|
|
9987
|
+
});
|
|
9988
|
+
}
|
|
9970
9989
|
}
|
|
9971
9990
|
};
|
|
9972
9991
|
}
|
|
@@ -9976,7 +9995,7 @@ function resolveFreePiScope(modelRuntime, providerName, modelIds, env = process.
|
|
|
9976
9995
|
if (env.FREEPI_KEEP_ENV_PROVIDERS)
|
|
9977
9996
|
return [];
|
|
9978
9997
|
const scoped = [];
|
|
9979
|
-
for (const id of new Set([...modelIds
|
|
9998
|
+
for (const id of new Set([FUSION_PICKER_ID, ...modelIds])) {
|
|
9980
9999
|
const model = modelRuntime.getModel(providerName, id);
|
|
9981
10000
|
if (model)
|
|
9982
10001
|
scoped.push({ model });
|
|
@@ -10149,7 +10168,7 @@ function buildRuntimeOptions(opts, sessionId) {
|
|
|
10149
10168
|
const toolSearchExtension = { name: "pi-tool-search", factory: createToolSearchExtension() };
|
|
10150
10169
|
const extensionFactories = [
|
|
10151
10170
|
providerExtension,
|
|
10152
|
-
createFusionExtension(models[0].id),
|
|
10171
|
+
createFusionExtension(models[0].id, resolveFusionIds(models.map((m) => m.id), opts.fusion)),
|
|
10153
10172
|
adsExtension,
|
|
10154
10173
|
usageToolExtension,
|
|
10155
10174
|
buyToolExtension,
|
|
@@ -10638,6 +10657,7 @@ async function run(deps, argv = process.argv) {
|
|
|
10638
10657
|
session: sessionArg.session,
|
|
10639
10658
|
model: versionCheck.model,
|
|
10640
10659
|
models: versionCheck.models,
|
|
10660
|
+
fusion: versionCheck.fusion,
|
|
10641
10661
|
updateLatest,
|
|
10642
10662
|
getGravityContext
|
|
10643
10663
|
});
|
|
@@ -10694,7 +10714,7 @@ async function checkClientVersion(baseUrl, cliVersion, fetchImpl = fetch) {
|
|
|
10694
10714
|
const parsed = ClientVersionResponseSchema.safeParse(await res.json());
|
|
10695
10715
|
if (!parsed.success)
|
|
10696
10716
|
return { action: "ok" };
|
|
10697
|
-
const { min, latest, model, models, notice } = parsed.data;
|
|
10717
|
+
const { min, latest, model, models, notice, fusion } = parsed.data;
|
|
10698
10718
|
const extra = {};
|
|
10699
10719
|
if (model !== undefined)
|
|
10700
10720
|
extra.model = model;
|
|
@@ -10702,6 +10722,8 @@ async function checkClientVersion(baseUrl, cliVersion, fetchImpl = fetch) {
|
|
|
10702
10722
|
extra.models = models;
|
|
10703
10723
|
if (notice !== undefined)
|
|
10704
10724
|
extra.notice = notice;
|
|
10725
|
+
if (fusion !== undefined)
|
|
10726
|
+
extra.fusion = fusion;
|
|
10705
10727
|
if (compareVersions(cliVersion, min) === -1)
|
|
10706
10728
|
return { action: "block", latest, ...extra };
|
|
10707
10729
|
if (compareVersions(cliVersion, latest) === -1)
|