billion-context-pi 0.1.71-pr.462.260 → 0.1.71

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
@@ -19115,13 +19115,6 @@ var PROXY_STAND_DOWN_MESSAGE = [
19115
19115
  "If your traffic reaches the proxy via HTTPS_PROXY instead (no /bili/ prefix in the URL), export BILLION_CONTEXT_PROXY=1 before starting pi.",
19116
19116
  "Docs: https://github.com/ranxianglei/billion-context"
19117
19117
  ].join("\n");
19118
- function nativeStandDownMessage(host) {
19119
- return [
19120
- `[billion-context-pi] billion-context native host detected (BILLION_CONTEXT_NATIVE=${host}) \u2014 the in-process native plugin proxies model API traffic and owns compression.`,
19121
- "ACP client-side compression has been disabled for this session to avoid double compression; nothing else to configure.",
19122
- "Docs: https://github.com/ranxianglei/billion-context"
19123
- ].join("\n");
19124
- }
19125
19118
 
19126
19119
  // src/index.ts
19127
19120
  function createAcpExtension(adapter = {}) {
@@ -19135,18 +19128,16 @@ function createAcpExtension(adapter = {}) {
19135
19128
  return;
19136
19129
  }
19137
19130
  const runtime = createRuntime(adapter);
19138
- let standDownWarned = false;
19131
+ let proxyWarned = false;
19139
19132
  const standDownIfProxied = (ctx) => {
19140
- const nativeHost = process.env.BILLION_CONTEXT_NATIVE || void 0;
19141
- if (nativeHost === void 0 && !process.env.BILLION_CONTEXT_PROXY && !isBiliProxyBaseUrl(ctx.model?.baseUrl)) return false;
19142
- const message = nativeHost !== void 0 ? nativeStandDownMessage(nativeHost) : PROXY_STAND_DOWN_MESSAGE;
19133
+ if (!isBiliProxyBaseUrl(ctx.model?.baseUrl)) return false;
19143
19134
  runtime.refused = true;
19144
- runtime.refusalMessage = message;
19145
- if (!standDownWarned) {
19146
- standDownWarned = true;
19147
- logWarn("host", { event: nativeHost !== void 0 ? "native-host-detected" : "proxy-detected", sid: ctx.sessionManager.getSessionId(), action: "refused", native: nativeHost ?? null });
19148
- if (ctx.hasUI) ctx.ui.notify(message, "warning");
19149
- else console.error(message);
19135
+ runtime.refusalMessage = PROXY_STAND_DOWN_MESSAGE;
19136
+ if (!proxyWarned) {
19137
+ proxyWarned = true;
19138
+ logWarn("host", { event: "proxy-baseurl-detected", sid: ctx.sessionManager.getSessionId(), action: "refused" });
19139
+ if (ctx.hasUI) ctx.ui.notify(PROXY_STAND_DOWN_MESSAGE, "warning");
19140
+ else console.error(PROXY_STAND_DOWN_MESSAGE);
19150
19141
  }
19151
19142
  return true;
19152
19143
  };