billion-context 0.1.99-pr.649.494 → 0.1.99
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
|
@@ -48514,7 +48514,6 @@ function loadOptions(env = process.env) {
|
|
|
48514
48514
|
passthrough: passthrough.enabled,
|
|
48515
48515
|
passthroughSource: passthrough.source,
|
|
48516
48516
|
autoUpdate: (env.ACP_AUTO_UPDATE ?? (fileConfig.autoUpdate === false ? "0" : "1")) !== "0",
|
|
48517
|
-
hostUsageCredit: parseHostUsageCredit(env.BILI_HOST_USAGE_CREDIT ?? fileConfig.hostUsageCredit),
|
|
48518
48517
|
updateTag: (env.ACP_UPDATE_TAG ?? fileConfig.updateTag ?? "latest").trim() || "latest",
|
|
48519
48518
|
logFile: env.ACP_LOG_FILE !== void 0 ? env.ACP_LOG_FILE || void 0 : fileConfig.logFile,
|
|
48520
48519
|
mitm: {
|
|
@@ -48591,9 +48590,6 @@ function parsePromptCacheRouting(value) {
|
|
|
48591
48590
|
function parseUpstreamProxyMode(value) {
|
|
48592
48591
|
return value === "manual" || value === "auto" ? value : "direct";
|
|
48593
48592
|
}
|
|
48594
|
-
function parseHostUsageCredit(value) {
|
|
48595
|
-
return value === "off" ? "off" : "auto";
|
|
48596
|
-
}
|
|
48597
48593
|
function parseCompressSettings(v2) {
|
|
48598
48594
|
if (!v2 || typeof v2 !== "object" || Array.isArray(v2)) return void 0;
|
|
48599
48595
|
const obj = v2;
|
|
@@ -59477,9 +59473,8 @@ function diagNudge(turn, sessionId, tokenCount, limit, model, willInject) {
|
|
|
59477
59473
|
const modelTag = model ? ` model=${model}` : "";
|
|
59478
59474
|
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)}"`;
|
|
59479
59475
|
}
|
|
59480
|
-
function armHostUsageCredit(session, originalMessages, processedMessages,
|
|
59476
|
+
function armHostUsageCredit(session, originalMessages, processedMessages, log2) {
|
|
59481
59477
|
session.hostCreditTokens = 0;
|
|
59482
|
-
if (hostUsageCredit === "off") return;
|
|
59483
59478
|
if (session.metadata.pluginAgent === "pi" || session.metadata.pluginAgent === "omp") return;
|
|
59484
59479
|
session.hostCreditTokens = processedMessages.length > 0 ? Math.max(0, estimateCoreMessages(originalMessages) - estimateCoreMessages(processedMessages)) : 0;
|
|
59485
59480
|
if (session.hostCreditTokens > 0) {
|
|
@@ -59561,7 +59556,7 @@ function prepareAnthropic(parsed, req, opts, core, config, prompts, log2, sessio
|
|
|
59561
59556
|
markDirty(session);
|
|
59562
59557
|
const rebuilt = { ...parsed, messages: rebuiltMessages, system: systemOut, tools: toolsOut };
|
|
59563
59558
|
delete rebuilt.prompt_cache_key;
|
|
59564
|
-
armHostUsageCredit(session, originalMessages, processedMessages,
|
|
59559
|
+
armHostUsageCredit(session, originalMessages, processedMessages, log2);
|
|
59565
59560
|
return { body: JSON.stringify(rebuilt), session, processedMessages, originalMessages, anthropicSystem: parsed.system, protocol: "anthropic", stream: stream2, compressInjected: injectTools, pluginMode, nudge, prompts, renderTags: "text-only" };
|
|
59566
59561
|
}
|
|
59567
59562
|
var OUTPUT_CLAMP_MARGIN_PCT = 0.05;
|
|
@@ -59693,7 +59688,7 @@ function prepareOpenai(parsed, req, opts, core, config, prompts, log2, session,
|
|
|
59693
59688
|
if (stream2 && rebuilt.stream_options === void 0) {
|
|
59694
59689
|
rebuilt.stream_options = { include_usage: true };
|
|
59695
59690
|
}
|
|
59696
|
-
armHostUsageCredit(session, originalMessages, processedMessages,
|
|
59691
|
+
armHostUsageCredit(session, originalMessages, processedMessages, log2);
|
|
59697
59692
|
if (!isTitleGen && openaiOutboundSystem !== void 0) {
|
|
59698
59693
|
session.metadata.systemPromptTokens = countSystemAndToolsTokens(openaiOutboundSystem, toolsOut);
|
|
59699
59694
|
}
|
|
@@ -59845,7 +59840,7 @@ function prepareResponses(parsed, req, opts, core, config, prompts, log2, sessio
|
|
|
59845
59840
|
});
|
|
59846
59841
|
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}`);
|
|
59847
59842
|
}
|
|
59848
|
-
armHostUsageCredit(session, originalMessages, processedMessages,
|
|
59843
|
+
armHostUsageCredit(session, originalMessages, processedMessages, log2);
|
|
59849
59844
|
if (transformOk) {
|
|
59850
59845
|
session.metadata.systemPromptTokens = countSystemAndToolsTokens(responsesDevContent ?? "", toolsOut);
|
|
59851
59846
|
}
|