billion-context 0.1.95-pr.649.467 → 0.1.95
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 +4 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48455,7 +48455,6 @@ function loadOptions(env = process.env) {
|
|
|
48455
48455
|
passthrough: passthrough.enabled,
|
|
48456
48456
|
passthroughSource: passthrough.source,
|
|
48457
48457
|
autoUpdate: (env.ACP_AUTO_UPDATE ?? (fileConfig.autoUpdate === false ? "0" : "1")) !== "0",
|
|
48458
|
-
hostUsageCredit: parseHostUsageCredit(env.BILI_HOST_USAGE_CREDIT ?? fileConfig.hostUsageCredit),
|
|
48459
48458
|
updateTag: (env.ACP_UPDATE_TAG ?? fileConfig.updateTag ?? "latest").trim() || "latest",
|
|
48460
48459
|
logFile: env.ACP_LOG_FILE !== void 0 ? env.ACP_LOG_FILE || void 0 : fileConfig.logFile,
|
|
48461
48460
|
mitm: {
|
|
@@ -48532,9 +48531,6 @@ function parsePromptCacheRouting(value) {
|
|
|
48532
48531
|
function parseUpstreamProxyMode(value) {
|
|
48533
48532
|
return value === "manual" || value === "auto" ? value : "direct";
|
|
48534
48533
|
}
|
|
48535
|
-
function parseHostUsageCredit(value) {
|
|
48536
|
-
return value === "off" ? "off" : "auto";
|
|
48537
|
-
}
|
|
48538
48534
|
function parseCompressSettings(v2) {
|
|
48539
48535
|
if (!v2 || typeof v2 !== "object" || Array.isArray(v2)) return void 0;
|
|
48540
48536
|
const obj = v2;
|
|
@@ -59341,9 +59337,8 @@ function diagNudge(turn, sessionId, tokenCount, limit, model, willInject) {
|
|
|
59341
59337
|
const modelTag = model ? ` model=${model}` : "";
|
|
59342
59338
|
return `[${sessionId}] nudge ${inject}: usage=${pct2} (${tokenCount}/${limit}), growth=${growth}/${floor} (ref=${ref}, interval=${interval}), pendingT1=${pendingT1}/${interval}${modelTag}, reason="${n.reason.slice(0, 120)}"`;
|
|
59343
59339
|
}
|
|
59344
|
-
function armHostUsageCredit(session, originalMessages, processedMessages,
|
|
59340
|
+
function armHostUsageCredit(session, originalMessages, processedMessages, log2) {
|
|
59345
59341
|
session.hostCreditTokens = 0;
|
|
59346
|
-
if (hostUsageCredit === "off") return;
|
|
59347
59342
|
if (session.metadata.pluginAgent === "pi" || session.metadata.pluginAgent === "omp") return;
|
|
59348
59343
|
session.hostCreditTokens = processedMessages.length > 0 ? Math.max(0, estimateCoreMessages(originalMessages) - estimateCoreMessages(processedMessages)) : 0;
|
|
59349
59344
|
if (session.hostCreditTokens > 0) {
|
|
@@ -59424,7 +59419,7 @@ function prepareAnthropic(parsed, req, opts, core, config, prompts, log2, sessio
|
|
|
59424
59419
|
markDirty(session);
|
|
59425
59420
|
const rebuilt = { ...parsed, messages: rebuiltMessages, system: systemOut, tools: toolsOut };
|
|
59426
59421
|
delete rebuilt.prompt_cache_key;
|
|
59427
|
-
armHostUsageCredit(session, originalMessages, processedMessages,
|
|
59422
|
+
armHostUsageCredit(session, originalMessages, processedMessages, log2);
|
|
59428
59423
|
return { body: JSON.stringify(rebuilt), session, processedMessages, originalMessages, anthropicSystem: parsed.system, protocol: "anthropic", stream: stream2, compressInjected: injectTools, pluginMode, nudge, prompts, renderTags: "text-only" };
|
|
59429
59424
|
}
|
|
59430
59425
|
var OUTPUT_CLAMP_MARGIN_PCT = 0.05;
|
|
@@ -59555,7 +59550,7 @@ function prepareOpenai(parsed, req, opts, core, config, prompts, log2, session,
|
|
|
59555
59550
|
if (stream2 && rebuilt.stream_options === void 0) {
|
|
59556
59551
|
rebuilt.stream_options = { include_usage: true };
|
|
59557
59552
|
}
|
|
59558
|
-
armHostUsageCredit(session, originalMessages, processedMessages,
|
|
59553
|
+
armHostUsageCredit(session, originalMessages, processedMessages, log2);
|
|
59559
59554
|
if (!isTitleGen && openaiOutboundSystem !== void 0) {
|
|
59560
59555
|
session.metadata.systemPromptTokens = countSystemAndToolsTokens(openaiOutboundSystem, toolsOut);
|
|
59561
59556
|
}
|
|
@@ -59706,7 +59701,7 @@ function prepareResponses(parsed, req, opts, core, config, prompts, log2, sessio
|
|
|
59706
59701
|
});
|
|
59707
59702
|
log2("info", `[${sessionId}] responses forward tools=[${fwdTools.join(",")}] injectTool=${injectTools}${pluginMode ? " (plugin mode: wire injection suppressed)" : ""} NO_INJECT_TOOL=${!!process.env.ACP_NO_INJECT_TOOL} NO_COMPRESS_PROMPT=${!!process.env.ACP_NO_COMPRESS_PROMPT}`);
|
|
59708
59703
|
}
|
|
59709
|
-
armHostUsageCredit(session, originalMessages, processedMessages,
|
|
59704
|
+
armHostUsageCredit(session, originalMessages, processedMessages, log2);
|
|
59710
59705
|
if (transformOk) {
|
|
59711
59706
|
session.metadata.systemPromptTokens = countSystemAndToolsTokens(responsesDevContent ?? "", toolsOut);
|
|
59712
59707
|
}
|