pi-fireworks-provider 1.4.2 → 1.5.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 (2) hide show
  1. package/index.ts +52 -1
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -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
- ctx.ui.notify("/fireworks-settings requires TUI mode.", "error");
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.4.2",
3
+ "version": "1.5.0",
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",