@wrongstack/webui 0.236.0 → 0.255.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.
@@ -602,7 +602,7 @@ import {
602
602
  } from "@wrongstack/core";
603
603
  function isGitRepo(cwd) {
604
604
  try {
605
- const r = spawnSync("git", ["rev-parse", "--is-inside-work-tree"], { cwd, encoding: "utf8" });
605
+ const r = spawnSync("git", ["rev-parse", "--is-inside-work-tree"], { cwd, encoding: "utf8", windowsHide: true });
606
606
  return r.status === 0 && r.stdout.trim() === "true";
607
607
  } catch {
608
608
  return false;
@@ -2025,7 +2025,7 @@ function browserOpenCommand(url, platform = process.platform) {
2025
2025
  function openBrowser(url, platform = process.platform) {
2026
2026
  try {
2027
2027
  const { command, args } = browserOpenCommand(url, platform);
2028
- const child = spawn(command, args, { stdio: "ignore", detached: true });
2028
+ const child = spawn(command, args, { stdio: "ignore", detached: true, windowsHide: true });
2029
2029
  child.on("error", () => {
2030
2030
  });
2031
2031
  child.unref();
@@ -3296,6 +3296,14 @@ async function startWebUI(opts = {}) {
3296
3296
  try {
3297
3297
  const m = await modelsRegistry.getModel(config.provider, config.model);
3298
3298
  maxContext = m?.capabilities?.maxContext ?? 0;
3299
+ if (!maxContext) {
3300
+ try {
3301
+ const provider2 = await modelsRegistry.getProvider(config.provider);
3302
+ const rawModel = provider2?.models.find((mod) => mod.id === config.model);
3303
+ maxContext = rawModel?.limit?.context ?? 0;
3304
+ } catch {
3305
+ }
3306
+ }
3299
3307
  const rates = getCostRates(m);
3300
3308
  inputCost = rates.input;
3301
3309
  outputCost = rates.output;