pi-fireworks-provider 1.4.2 → 1.5.1
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/index.ts +57 -6
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
import { getAgentDir, type ExtensionAPI, type ModelRegistry } from "@earendil-works/pi-coding-agent";
|
|
29
|
-
import type { Input, matchesKey, Key, truncateToWidth, visibleWidth, wrapTextWithAnsi, fuzzyFilter, SettingsListTheme } from "@earendil-works/pi-tui";
|
|
29
|
+
import type { Input, matchesKey, Key, KeyId, truncateToWidth, visibleWidth, wrapTextWithAnsi, fuzzyFilter, SettingsListTheme } from "@earendil-works/pi-tui";
|
|
30
30
|
import modelsData from "./models.json" with { type: "json" };
|
|
31
31
|
import customModelsData from "./custom-models.json" with { type: "json" };
|
|
32
32
|
import patchData from "./patch.json" with { type: "json" };
|
|
@@ -44,7 +44,7 @@ interface JsonModel {
|
|
|
44
44
|
baseUrl?: string;
|
|
45
45
|
reasoning: boolean;
|
|
46
46
|
thinkingLevelMap?: Record<string, string | null>;
|
|
47
|
-
input:
|
|
47
|
+
input: ("text" | "image")[];
|
|
48
48
|
cost: {
|
|
49
49
|
input: number;
|
|
50
50
|
output: number;
|
|
@@ -64,7 +64,7 @@ interface PatchEntry {
|
|
|
64
64
|
baseUrl?: string;
|
|
65
65
|
reasoning?: boolean;
|
|
66
66
|
thinkingLevelMap?: Record<string, string | null>;
|
|
67
|
-
input?:
|
|
67
|
+
input?: ("text" | "image")[];
|
|
68
68
|
cost?: {
|
|
69
69
|
input?: number;
|
|
70
70
|
output?: number;
|
|
@@ -371,7 +371,7 @@ type PreserveMode = boolean; // true = inject reasoning_history:"preserved"; fal
|
|
|
371
371
|
|
|
372
372
|
interface ServiceTierConfig {
|
|
373
373
|
default: ServiceTier;
|
|
374
|
-
keybinding:
|
|
374
|
+
keybinding: KeyId;
|
|
375
375
|
display: "statusbar" | "off";
|
|
376
376
|
}
|
|
377
377
|
|
|
@@ -425,7 +425,7 @@ function isValidTier(v: unknown): v is ServiceTier {
|
|
|
425
425
|
return v === "standard" || v === "priority";
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
-
function isValidKeybinding(v: unknown): v is
|
|
428
|
+
function isValidKeybinding(v: unknown): v is KeyId {
|
|
429
429
|
return typeof v === "string" && v.length > 0;
|
|
430
430
|
}
|
|
431
431
|
|
|
@@ -1318,7 +1318,58 @@ export default function (pi: ExtensionAPI) {
|
|
|
1318
1318
|
description: "Configure Fireworks: preserved thinking + service tier + logit bias + display",
|
|
1319
1319
|
async handler(_args, ctx) {
|
|
1320
1320
|
if (ctx.mode !== "tui") {
|
|
1321
|
-
|
|
1321
|
+
// GUI/RPC fallback: a select -> select flow. The custom SettingsList and
|
|
1322
|
+
// the nested LogitBiasEditor are TUI-only, so logit bias isn't offered
|
|
1323
|
+
// here (configure it in a TUI session). One setting per run.
|
|
1324
|
+
if (!ctx.hasUI) {
|
|
1325
|
+
ctx.ui.notify("/fireworks-settings requires a UI (TUI or GUI).", "error");
|
|
1326
|
+
return;
|
|
1327
|
+
}
|
|
1328
|
+
const guiItems = [
|
|
1329
|
+
{ id: "preserveThinking", label: "Preserved thinking", current: preserveOn ? "on" : "off", values: ["on", "off"] },
|
|
1330
|
+
{ id: "serviceTier", label: "Service tier", current: currentTier, values: ["standard", "priority"] },
|
|
1331
|
+
{ id: "serviceTier.display", label: "Service tier display", current: fireworksConfig.serviceTier.display, values: ["statusbar", "off"] },
|
|
1332
|
+
];
|
|
1333
|
+
const pick = await ctx.ui.select(
|
|
1334
|
+
"Fireworks settings — pick a setting (logit-bias editor is TUI-only)",
|
|
1335
|
+
guiItems.map((i) => `${i.label}: ${i.current}`),
|
|
1336
|
+
);
|
|
1337
|
+
if (pick === undefined) return;
|
|
1338
|
+
const item = guiItems.find((i) => pick.startsWith(`${i.label}:`));
|
|
1339
|
+
if (!item) return;
|
|
1340
|
+
const newValue = await ctx.ui.select(item.label, item.values);
|
|
1341
|
+
if (newValue === undefined) return;
|
|
1342
|
+
if (item.id === "preserveThinking") {
|
|
1343
|
+
const on = newValue === "on";
|
|
1344
|
+
setPreserve(on);
|
|
1345
|
+
const raw = readRawFireworksConfig();
|
|
1346
|
+
raw.preserveThinking = { ...(raw.preserveThinking ?? {}), default: on };
|
|
1347
|
+
writeRawFireworksConfig(raw);
|
|
1348
|
+
fireworksConfig = loadFireworksConfig();
|
|
1349
|
+
ctx.ui.notify(`Preserved thinking ${on ? "on" : "off"} — takes effect now.`, "info");
|
|
1350
|
+
} else if (item.id === "serviceTier") {
|
|
1351
|
+
let model: any;
|
|
1352
|
+
try { model = ctx.model; } catch { model = undefined; }
|
|
1353
|
+
if (!model || model.provider !== "fireworks" || !isPriorityApplicable(model.id)) {
|
|
1354
|
+
ctx.ui.notify("Service tier only applies to supported Fireworks models.", "info");
|
|
1355
|
+
return;
|
|
1356
|
+
}
|
|
1357
|
+
const tier = newValue as ServiceTier;
|
|
1358
|
+
setTier(ctx, tier);
|
|
1359
|
+
const raw = readRawFireworksConfig();
|
|
1360
|
+
raw.serviceTier = { ...(raw.serviceTier ?? {}), default: tier };
|
|
1361
|
+
writeRawFireworksConfig(raw);
|
|
1362
|
+
fireworksConfig = loadFireworksConfig();
|
|
1363
|
+
ctx.ui.notify(`Fireworks service tier: ${tier}`, "info");
|
|
1364
|
+
} else if (item.id === "serviceTier.display") {
|
|
1365
|
+
const raw = readRawFireworksConfig();
|
|
1366
|
+
raw.serviceTier = { ...(raw.serviceTier ?? {}), display: newValue };
|
|
1367
|
+
writeRawFireworksConfig(raw);
|
|
1368
|
+
fireworksConfig = loadFireworksConfig();
|
|
1369
|
+
updateTierStatus(ctx);
|
|
1370
|
+
ctx.ui.notify("Service tier display updated.", "info");
|
|
1371
|
+
}
|
|
1372
|
+
ctx.ui.notify("Run /fireworks-settings again for more.", "info");
|
|
1322
1373
|
return;
|
|
1323
1374
|
}
|
|
1324
1375
|
const { SettingsList, Container, Input, matchesKey, Key, truncateToWidth, visibleWidth, wrapTextWithAnsi, fuzzyFilter } = await import("@earendil-works/pi-tui");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-fireworks-provider",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Fireworks AI provider extension for pi - Access Kimi, MiniMax, GLM, DeepSeek, and GPT-OSS models through the Fireworks AI API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|