billion-context 0.1.77-pr.501.320 → 0.1.77

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
@@ -55416,20 +55416,13 @@ function loadClientConfig(env, cwd) {
55416
55416
  config.dsh = readDshConfig(resolveDshHome(env));
55417
55417
  return config;
55418
55418
  }
55419
- function collectModelWindows(config, scope) {
55419
+ function collectModelWindows(config) {
55420
55420
  const out = {};
55421
55421
  const add = (wins) => {
55422
55422
  for (const w2 of wins ?? []) {
55423
55423
  if (!out[w2.id] || w2.contextWindow > out[w2.id]) out[w2.id] = w2.contextWindow;
55424
55424
  }
55425
55425
  };
55426
- if (scope) {
55427
- if (scope === "codex") add(config.codex?.modelWindows);
55428
- else if (scope === "pi") for (const p2 of Object.values(config.pi?.providers ?? {})) add(p2.models);
55429
- else if (scope === "omp") for (const p2 of Object.values(config.omp?.providers ?? {})) add(p2.models);
55430
- else if (scope === "opencode") for (const p2 of Object.values(config.opencode?.providers ?? {})) add(p2.models);
55431
- return out;
55432
- }
55433
55426
  for (const p2 of Object.values(config.pi?.providers ?? {})) add(p2.models);
55434
55427
  for (const p2 of Object.values(config.omp?.providers ?? {})) add(p2.models);
55435
55428
  for (const p2 of Object.values(config.opencode?.providers ?? {})) add(p2.models);
@@ -63725,7 +63718,7 @@ async function runLaunch(params, deps = {}) {
63725
63718
  const routes = discoverRoutes(base, config);
63726
63719
  const biliRoutes = loadRoutes(process.env);
63727
63720
  const domains = dedupeInOrder([...routes.httpsDomains, ...params.mitmDomains ?? []]);
63728
- const handle2 = await ensureProxyRunning({ host, port, passthrough, debug, mitmDomains: domains, modelWindows: collectModelWindows(config, base) }, deps);
63721
+ const handle2 = await ensureProxyRunning({ host, port, passthrough, debug, mitmDomains: domains, modelWindows: collectModelWindows(config) }, deps);
63729
63722
  console.error(
63730
63723
  `bili: started proxy at ${handle2.origin} (MITM domains: ${domains.length ? domains.join(", ") : "defaults"})` + (routes.httpRewrites.length > 0 ? ` (HTTP /bili/ rewrites: ${routes.httpRewrites.length})` : "") + (routes.httpsRewrites.length > 0 ? ` (HTTPS cert rewrites: ${routes.httpsRewrites.length})` : "") + (params.client === "pi-test" ? " (no extensions)" : "")
63731
63724
  );
@@ -63900,7 +63893,7 @@ async function runTestPi(params, deps = {}) {
63900
63893
  ...discoverDomains("pi", config),
63901
63894
  ...params.mitmDomains ?? []
63902
63895
  ]);
63903
- const handle2 = await ensureProxyRunning({ host, port, passthrough, debug, mitmDomains: domains, modelWindows: collectModelWindows(config, "pi") }, deps);
63896
+ const handle2 = await ensureProxyRunning({ host, port, passthrough, debug, mitmDomains: domains, modelWindows: collectModelWindows(config) }, deps);
63904
63897
  console.error(
63905
63898
  `bili: started proxy at ${handle2.origin} (MITM domains: ${domains.length ? domains.join(", ") : "defaults"})`
63906
63899
  );