billion-context 0.1.191 → 0.1.192
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/build-info.json +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -623,7 +623,7 @@ data: ${JSON.stringify({type:"content_block_delta",index:s3.index,delta:{type:de
|
|
|
623
623
|
|
|
624
624
|
`}return out};try{let pendingFinal=null;for(;;){const{done,value}=await reader.read();if(done){if(!sawTerminal&&!res.destroyed&&!res.writableEnded&&await retryZeroByteCut())continue;const resolved=finalizeSseLineEndings(buf);if(resolved===buf)break;buf="";pendingFinal=resolved}else{if(value&&value.length>0)diagBytes+=value.byteLength;pendingFinal=value&&value.length>0?decoder.decode(value,{stream:true}):null}if(pendingFinal!==null){buf=normalizeSseLineEndings(buf+pendingFinal);let idx;while((idx=buf.indexOf("\n\n"))!==-1){const rawEvent=buf.slice(0,idx);buf=buf.slice(idx+2);const dataLines=rawEvent.split("\n").filter(l=>l.startsWith("data:"));if(dataLines.length===0)continue;const jsonStr=dataLines.map(l=>l.slice(5).replace(/^ /,"")).join("\n").trim();if(!jsonStr||jsonStr==="[DONE]"){if(jsonStr==="[DONE]"){diagEvents++;diagPushType("[DONE]");sawTerminal=true}await write(rawEvent+"\n\n");continue}let ev;try{ev=JSON.parse(jsonStr)}catch{diagEvents++;diagUnparseable++;diagPushType("unparseable");auditRawForward(rawEvent);await write(rawEvent+"\n\n");continue}diagEvents++;if(typeof ev["type"]==="string")diagPushType(ev["type"]);const sample=usageFromSseEvent(ev);if(sample)mergeUsageSample(acc,sample);const type=ev["type"];if(typeof type==="string"){if(type.startsWith("response.reasoning"))sawReasoning=true;if(type==="response.output_item.added"||type==="response.output_item.done"){const item=ev["item"];const it2=item?.["type"];if(it2==="function_call"||it2==="custom_tool_call")sawFunctionCall=true;if(it2==="function_call"){const key2=typeof item?.["id"]==="string"&&item["id"]?item["id"]:`oi:${typeof ev["output_index"]==="number"?ev["output_index"]:0}`;const wc=witnessedCalls.get(key2)??{name:"",args:"",named:false};if(typeof item?.["name"]==="string"&&item["name"].length>0){wc.name=item["name"];wc.named=true}if(typeof item?.["arguments"]==="string"&&item["arguments"].length>0)wc.args=item["arguments"];witnessedCalls.set(key2,wc)}}const resp=ev["response"];if(resp&&typeof resp["status"]==="string")responseStatus=resp["status"];if(!inRetry){if(type==="response.created"&&resp&&resp["id"]!==void 0)heldResponseId=resp["id"];if(type==="response.output_item.added"){const added=ev["item"];if(added&&added["id"]!==void 0)heldItemId=added["id"];if(ev["output_index"]!==void 0)heldOutputIndex=ev["output_index"]}}}if(retryFraming(type))continue;if(type==="response.function_call_arguments.done"){const itemId=typeof ev["item_id"]==="string"&&ev["item_id"]?ev["item_id"]:`oi:${typeof ev["output_index"]==="number"?ev["output_index"]:0}`;const wc=witnessedCalls.get(itemId)??{name:"",args:"",named:false};if(typeof ev["arguments"]==="string")wc.args=ev["arguments"];witnessedCalls.set(itemId,wc);await write(flushArgTails()+rawEvent+"\n\n");continue}if(type==="response.reasoning_summary_part.done"){proseAcc+=responsesEventText(ev);await write(flushArgTails()+flushTail(rawEvent+"\n\n"));continue}if(type==="response.output_text.done"||type==="response.content_part.done"||type==="response.output_item.done"){const dropEmission=absorbInstructed===true&&containsToolCallEmissionText(jsonStr);const hadEchoText=containsRenderTagText(jsonStr)||containsMarkerLineText(jsonStr)||containsBiliInternalText(jsonStr)||containsEchoResidue(jsonStr)||dropEmission;if(hadEchoText)sawStrippedEcho=true;let evOut=ev;let rebuild=hadEchoText||retryRewritePending();if(rebuild)evOut=stripResponsesText(ev,dropEmission,requestText);rewriteRetryIds(evOut);const doneText=responsesEventText(evOut);heldVisibleChars+=doneText.length;proseAcc+=doneText;heldEvents.push(rebuild?rebuildEvent(rawEvent,evOut):rawEvent+"\n\n");continue}if(type==="response.output_item.added"){let out=flushArgTails()+flushTail("");for(const held of heldEvents)out+=held;heldEvents=[];await write(out+rawEvent+"\n\n");continue}if(type==="response.completed"||type==="response.failed"||type==="response.incomplete"){sawTerminal=true;if(await retryEmptyTurn(type==="response.completed"?"completed":void 0)){for(const s3 of argStreams.values())s3.filter.flush();argStreams.clear();heldEvents=[];heldVisibleChars=0;continue}const tailFrame=flushTail("");if(tailFrame.length>0)await write(tailFrame);const argTail=flushArgTails();if(argTail.length>0)await write(argTail);for(const held of heldEvents)await write(held);heldEvents=[];heldVisibleChars=0;const dropEmission=absorbInstructed===true&&containsToolCallEmissionText(jsonStr);const hadEchoText=containsRenderTagText(jsonStr)||containsMarkerLineText(jsonStr)||containsBiliInternalText(jsonStr)||containsEchoResidue(jsonStr)||dropEmission;if(hadEchoText)sawStrippedEcho=true;let evOut=ev;let rebuild=hadEchoText||retryRewritePending();if(rebuild)evOut=stripResponsesText(ev,dropEmission,requestText);rewriteRetryIds(evOut);if(session&&acc.inputTokens!==void 0&&acc.inputTokens>0){const credit=session.stats.compressCreditTokens??0;recordContextObservation(session,Math.max(0,acc.inputTokens-credit),credit>0?"estimate":"usage");markDirty(session)}await write(rebuild?rebuildEvent(rawEvent,evOut):rawEvent+"\n\n");continue}if(type==="response.output_text.delta"&&typeof ev["delta"]==="string"){const delta=ev["delta"];if(delta.length===0){await write(rawEvent+"\n\n");continue}if(!retryRewritePending()&&!mayStartRenderTag(delta)&&!mayStartMarkerLine(delta)&&!mayStartBiliInternal(delta)&&!mayStartDegenerateRenderTag(delta)&&!(absorbInstructed===true&&mayStartToolCallEmission(delta))&&!tagFilter.pending()){proseAcc+=delta;visibleTextChars+=delta.length;fastPathChars+=delta.length;if(delta.length>0&&containsEchoResidue(delta))log("warn",`[tag-echo] fast path forwarded echo-residue-shaped bytes (#2190): ${delta.slice(0,80).replace(/\n/g," ")}`);await write(rawEvent+"\n\n");continue}const clean=tagFilter.push(delta);lastDeltaMeta={item_id:ev["item_id"],output_index:ev["output_index"]};if(!inRetry&&heldItemId===void 0&&ev["item_id"]!==void 0){heldItemId=ev["item_id"];heldOutputIndex=ev["output_index"]}if(clean.length===0){sawStrippedEcho=true;continue}visibleTextChars+=clean.length;proseAcc+=clean;if(clean===delta&&!retryRewritePending()){await write(rawEvent+"\n\n");continue}const rebuilt={...ev,delta:clean};rewriteRetryIds(rebuilt);await write(rebuildEvent(rawEvent,rebuilt));continue}if(type==="response.reasoning_summary_text.delta"&&typeof ev["delta"]==="string"){const v2=ev["delta"];if(v2.length>0)proseAcc+=v2;await write(rawEvent+"\n\n");continue}if(!responsesFrameHasToolCalls(ev))auditRawForward(rawEvent);await write(rawEvent+"\n\n")}}if(done)break;if(res.destroyed||res.writableEnded)break}if(!res.destroyed&&!res.writableEnded){const rest=flushArgTails()+flushTail("");if(rest.length>0)await write(rest)}maybeWarnDegenerate();maybeWarnProtocolFragment();maybeSummarizeStrips();settleUsage();settleWitnesses();if(!sawTerminal&&!res.destroyed&&!res.writableEnded){emitUpstreamTruncation(res,"responses",false,log2,buildTruncationDiag("eof"),transparentTruncationApplies(session));return}}catch(e){settleUsage();maybeSummarizeStrips();settleWitnesses();if(res.destroyed||res.writableEnded){log2?.("client aborted mid-stream");return}try{const rest=flushArgTails()+flushTail("");if(rest.length>0)await write(rest)}catch{}log("warn",`[plugin] upstream stream read failed (responses): ${String(e instanceof Error?e.message:e)} \u2014 truncation signal path`);emitUpstreamTruncation(res,"responses",false,log2,buildTruncationDiag("read-error"),transparentTruncationApplies(session));return}finally{reader.releaseLock();res.end()}}function rebuildEvent(rawEvent,ev){const lines=rawEvent.split("\n");let replaced=false;const out=[];for(const l of lines){if(l.startsWith("data:")){if(replaced)continue;replaced=true;out.push(`data: ${JSON.stringify(ev)}`);continue}out.push(l)}return replaced?out.join("\n")+"\n\n":`data: ${JSON.stringify(ev)}
|
|
625
625
|
|
|
626
|
-
`}function stripGoogleChunk(obj,drop=false,requestText){if(!obj||typeof obj!=="object")return obj;const o=obj;const candidates=o["candidates"];if(!Array.isArray(candidates))return obj;o["candidates"]=candidates.map(c=>{if(!c||typeof c!=="object")return c;const cand=c;const content=cand["content"];if(!content||typeof content!=="object")return c;const cont=content;if(!Array.isArray(cont["parts"]))return c;return{...cand,content:{...cont,parts:cont["parts"].map(p2=>p2&&typeof p2==="object"&&p2["thought"]!==true&&typeof p2["text"]==="string"?{...p2,text:stripAcpTags(p2["text"],drop,requestText)}:p2)}}});return obj}function stripGoogleText(obj,drop=false,requestText){if(Array.isArray(obj)){obj.forEach(c=>{stripGoogleChunk(c,drop,requestText)});return obj}return stripGoogleChunk(obj,drop,requestText)}async function pipePluginJson(stream2,res,session,protocol,upstreamOrigin,absorbInstructed,requestText){const reader=stream2.getReader();const chunks=[];try{for(;;){const{done,value}=await reader.read();if(done)break;if(value&&value.length>0)chunks.push(Buffer.from(value))}}catch(e){if(!res.writableEnded)res.end();if(res.destroyed||res.writableEnded)return;throw e}reader.releaseLock();const text2=Buffer.concat(chunks).toString("utf8");let json;let mutated=false;try{json=JSON.parse(text2);const usage=json["usage"];let sawInputSample=false;if(session&&usage){const input=num3(usage["prompt_tokens"])??num3(usage["input_tokens"]);if(input!==void 0){const cached=num3(usage["prompt_tokens_details"]?.["cached_tokens"])??num3(usage["input_tokens_details"]?.["cached_tokens"])??num3(usage["cache_read_input_tokens"])??num3(usage["prompt_cache_hit_tokens"]);const creation=num3(usage["cache_creation_input_tokens"]);applyUsageSample(session,{inputTokens:input,outputTokens:num3(usage["completion_tokens"])??num3(usage["output_tokens"]),cachedTokens:cached,creationTokens:creation},protocol,upstreamOrigin);markDirty(session);sawInputSample=true}}if(session&&!usage){const sample=googleUsageSample(json);if(sample&&sample.inputTokens!==void 0){applyUsageSample(session,sample,protocol,upstreamOrigin);markDirty(session);sawInputSample=true}}if(session&&!sawInputSample)diagnoseSuccessWithoutUsage(session,"plugin-json");if(session)recordJsonToolWitnesses(session.id,json,protocol)}catch{}const dropEmission=absorbInstructed===true&&containsToolCallEmissionText(text2);if(json&&(dropEmission||containsRenderTagText(text2)||containsMarkerLineText(text2)||containsBiliInternalText(text2)||containsEchoResidue(text2))){json=protocol==="responses"?stripResponsesText(json,dropEmission,requestText):protocol==="anthropic"?stripAnthropicText(json,dropEmission,requestText):protocol==="google"?stripGoogleText(json,dropEmission,requestText):stripOpenaiChatText(json,dropEmission,requestText);mutated=true}if(mutated&&json){res.end(Buffer.from(JSON.stringify(json),"utf8"));return}res.end(text2)}function recordJsonToolWitnesses(sessionId,json,protocol){try{if(protocol==="anthropic"){const content=json["content"];if(!Array.isArray(content))return;for(const block of content){if(!block||typeof block!=="object")continue;const b2=block;if(b2["type"]!=="tool_use")continue;if(typeof b2["name"]!=="string"||b2["name"].length===0)continue;recordToolWitness(sessionId,b2["name"],b2["input"]!==null&&b2["input"]!==void 0?b2["input"]:"")}return}if(protocol==="responses"){const output=json["output"];if(!Array.isArray(output))return;for(const item of output){if(!item||typeof item!=="object")continue;const o=item;if(o["type"]!=="function_call")continue;if(typeof o["name"]!=="string"||o["name"].length===0)continue;recordToolWitness(sessionId,o["name"],typeof o["arguments"]==="string"?o["arguments"]:"")}return}if(protocol==="google"){const candidates=json["candidates"];if(!Array.isArray(candidates))return;for(const cand of candidates){if(!cand||typeof cand!=="object")continue;const content=cand["content"];if(!content||typeof content!=="object")continue;const parts=content["parts"];if(!Array.isArray(parts))continue;for(const p2 of parts){if(!p2||typeof p2!=="object")continue;const fc=p2["functionCall"];if(!fc||typeof fc!=="object")continue;const f2=fc;if(typeof f2["name"]!=="string"||f2["name"].length===0)continue;recordToolWitness(sessionId,f2["name"],f2["args"]!==null&&f2["args"]!==void 0?f2["args"]:"")}}return}const choices=json["choices"];if(!Array.isArray(choices))return;for(const choice of choices){if(!choice||typeof choice!=="object")continue;const message=choice["message"];if(!message||typeof message!=="object")continue;const toolCalls=message["tool_calls"];if(!Array.isArray(toolCalls))continue;for(const tc of toolCalls){if(!tc||typeof tc!=="object")continue;const fn=tc["function"];if(!fn||typeof fn!=="object")continue;const f2=fn;if(typeof f2["name"]!=="string"||f2["name"].length===0)continue;recordToolWitness(sessionId,f2["name"],typeof f2["arguments"]==="string"?f2["arguments"]:"")}}}catch{}}import{lookup}from"dns/promises";import{networkInterfaces}from"os";var RESOLVE_MAX_ATTEMPTS=3;var RESOLVE_BACKOFF_MS=250;var RESOLVE_TIMEOUT_MS=2e3;var BILI_TUNNEL_HEADER="x-bili-tunnel";function parseIpLiteral(s3){const t=s3.trim().toLowerCase();if(/^\d{1,3}(\.\d{1,3}){3}$/.test(t))return t;if(t.includes(":"))return t;return null}function normalizeIpLiteral(ip){const t=ip.trim().toLowerCase();if(!t.startsWith("::ffff:"))return t;const dotted=t.match(/^::ffff:(\d{1,3}(?:\.\d{1,3}){3})$/);if(dotted)return dotted[1];const hex=t.match(/^::ffff:0*([0-9a-f]{1,4}):0*([0-9a-f]{1,4})$/);if(hex){const hi2=parseInt(hex[1],16);const lo2=parseInt(hex[2],16);return`${hi2>>8&255}.${hi2&255}.${lo2>>8&255}.${lo2&255}`}return t}function classifyIp(ip){const lit=normalizeIpLiteral(parseIpLiteral(ip)??"");if(!lit)return"public";if(lit.includes(":")){if(lit==="::1"||lit==="::")return"loopback";if(lit.startsWith("fe8")||lit.startsWith("fe9")||lit.startsWith("fea")||lit.startsWith("feb"))return"linkLocal";if(lit.startsWith("fc")||lit.startsWith("fd"))return"private";return"public"}const parts=lit.split(".").map(Number);const[a,b2]=parts;if(a===127)return"loopback";if(a===169&&b2===254)return"linkLocal";if(a===10||a===0)return"private";if(a===172&&b2>=16&&b2<=31)return"private";if(a===192&&b2===168)return"private";if(a===100&&b2>=64&&b2<=127)return"private";return"public"}var dnsResolveHost=async host=>{let timer5;try{const res=await Promise.race([lookup(host,{all:true,family:0}),new Promise((_2,reject)=>{timer5=setTimeout(()=>reject(Object.assign(new Error("ETIMEDOUT"),{code:"ETIMEDOUT"})),RESOLVE_TIMEOUT_MS);timer5.unref?.()})]);return res.map(r=>r.address)}finally{if(timer5)clearTimeout(timer5)}};var localAddrCache;function localMachineIps(){const now=Date.now();if(!localAddrCache||now-localAddrCache.at>3e4){const ips=new Set(["127.0.0.1","::1"]);for(const list of Object.values(networkInterfaces())){for(const ni2 of list??[]){if(ni2.address)ips.add(ni2.address.toLowerCase())}}for(let i=0;i<=255;i++)ips.add(`127.0.0.${i}`);localAddrCache={at:now,ips}}return localAddrCache.ips}function allowlistHit(host,port,allowlist){const h=host.toLowerCase();const hp=`${h}:${port}`;return allowlist.some(e=>e===h||e===hp)}async function checkTunnelDestination(origin,ctx){let u2;try{u2=new URL(origin)}catch{return{ok:false,code:"invalid",message:`invalid tunnel destination ${origin}`}}const host=u2.hostname.replace(/^\[|\]$/g,"").toLowerCase();const port=u2.port?Number(u2.port):u2.protocol==="https:"?443:80;let ips;const literal=parseIpLiteral(host);if(literal){ips=[normalizeIpLiteral(literal)]}else if(ctx.egressProxied){return{ok:true}}else{const resolve=ctx.resolveHost??dnsResolveHost;const backoff=ctx.resolveBackoffMs??RESOLVE_BACKOFF_MS;let resolved;let lastErrCode;for(let attempt=1;attempt<=RESOLVE_MAX_ATTEMPTS;attempt++){try{resolved=await resolve(host);break}catch(err2){const code=err2?.code;if(code)lastErrCode=code;if(attempt===RESOLVE_MAX_ATTEMPTS)break;await new Promise(r=>setTimeout(r,backoff))}}if(resolved===void 0)return{ok:false,code:"unresolvable",message:`cannot resolve tunnel destination ${host}${lastErrCode?` (${lastErrCode})`:""}: local name resolution failed \u2014 the local resolver may be unreachable or taken over by another DNS service (VPN/MagicDNS); route egress through an upstream proxy to have the destination resolved remotely`};ips=resolved;if(ips.length===0)return{ok:false,code:"unresolvable",message:`no addresses for tunnel destination ${host}`};if(ips.some(ip=>classifyIp(ip)==="linkLocal")&&ips.some(ip=>classifyIp(ip)!=="linkLocal")){ips=ips.filter(ip=>classifyIp(ip)!=="linkLocal")}}if(ctx.selfPort!==void 0&&port===ctx.selfPort){const mine=(ctx.localIps??localMachineIps)();if(ips.some(ip=>ip==="0.0.0.0"||ip==="::"||mine.has(ip.toLowerCase())||mine.has(`::ffff:${ip.toLowerCase()}`))){return{ok:false,code:"self",message:"the bili tunnel may not target the proxy itself"}}}const classes=ips.map(ip=>classifyIp(ip));if(classes.includes("linkLocal")){return{ok:false,code:"linkLocal",message:"link-local / metadata destinations are blocked from the bili tunnel"}}if(!classes.every(c=>c==="public")){if(ctx.clientLoopback)return{ok:true};if(allowlistHit(host,port,ctx.allowlist))return{ok:true};return{ok:false,code:"privateRemote",message:`tunnel destination ${host} resolves to a loopback/private address; remote clients may only reach it via BILI_TUNNEL_ALLOWED_HOSTS`}}return{ok:true}}function tunnelAllowlistFromEnv(env=process.env){const raw=env.BILI_TUNNEL_ALLOWED_HOSTS??"";return raw.split(",").map(s3=>s3.trim().toLowerCase()).filter(s3=>s3.length>0)}import fs17 from"fs";import path33 from"path";import{performance as performance3}from"perf_hooks";var codex_models_snapshot_default={source:"openai/codex main (commit 868c9ed) \u2014 codex-rs/models-manager/models.json",fetchedAt:"2026-08-28T17:09:46Z",count:10,models:[{slug:"gpt-5.6-sol",contextWindow:272e3,maxContextWindow:872e3},{slug:"gpt-5.6-terra",contextWindow:272e3,maxContextWindow:872e3},{slug:"gpt-5.6-luna",contextWindow:272e3,maxContextWindow:872e3},{slug:"gpt-daybreak-blue-latest",contextWindow:272e3,maxContextWindow:872e3},{slug:"gpt-daybreak-red-latest",contextWindow:372e3,maxContextWindow:372e3},{slug:"gpt-5.5",contextWindow:272e3,maxContextWindow:272e3},{slug:"gpt-5.4",contextWindow:272e3,maxContextWindow:1e6},{slug:"gpt-5.4-mini",contextWindow:272e3,maxContextWindow:272e3},{slug:"gpt-5.2",contextWindow:272e3,maxContextWindow:272e3},{slug:"codex-auto-review",contextWindow:272e3,maxContextWindow:872e3}]};import fs13 from"fs";import path27 from"path";var SNAPSHOT=codex_models_snapshot_default;var PRISTINE=SNAPSHOT.models.map(m2=>({...m2}));var TABLE=PRISTINE.map(m2=>({...m2}));var CODEX_FALLBACK_CONTEXT_WINDOW=272e3;function resolvedWindow(m2){return m2.contextWindow??m2.maxContextWindow??CODEX_FALLBACK_CONTEXT_WINDOW}function lookupModel(model,table){const direct=longestPrefixMatch(model,table);if(direct)return direct;const slash=model.indexOf("/");if(slash>0){const namespace=model.slice(0,slash);const suffix=model.slice(slash+1);if(!suffix.includes("/")&&/^[A-Za-z0-9_-]+$/.test(namespace)){const m2=longestPrefixMatch(suffix,table);if(m2)return m2}}return void 0}function longestPrefixMatch(model,table){let best;for(const m2 of table){if(!model.startsWith(m2.slug))continue;if(!best||m2.slug.length>best.slug.length)best=m2}return best}function codexWindowForModel(model){const entry=lookupModel(model,TABLE);return entry?resolvedWindow(entry):CODEX_FALLBACK_CONTEXT_WINDOW}var liveTable;function positiveWindow(value){return typeof value==="number"&&Number.isSafeInteger(value)&&value>0?value:void 0}function readCodexModelWindow(model,codexHome){const file=path27.join(codexHome,"models_cache.json");try{const stat4=fs13.statSync(file);const key2=`${file}|${stat4.ino}|${stat4.mtimeMs}|${stat4.ctimeMs}|${stat4.size}`;if(liveTable?.key!==key2){const parsed=JSON.parse(fs13.readFileSync(file,"utf8"));if(!parsed||typeof parsed!=="object"||!("models"in parsed)||!Array.isArray(parsed.models))return void 0;const models=[];for(const value of parsed.models){if(!value||typeof value!=="object"||typeof value.slug!=="string"||!value.slug)continue;const contextWindow=positiveWindow(value.context_window);const maxContextWindow=positiveWindow(value.max_context_window);if(contextWindow===void 0&&maxContextWindow===void 0)continue;const percent=value.effective_context_window_percent??95;if(typeof percent!=="number"||!Number.isInteger(percent)||percent<=0||percent>100)continue;models.push({slug:value.slug,contextWindow,maxContextWindow,effectiveContextWindowPercent:percent})}liveTable={key:key2,models}}const entry=lookupModel(model,liveTable.models);if(!entry)return void 0;const configured=positiveWindow(readCodexConfig(codexHome).contextWindow);const window2=configured===void 0?resolvedWindow(entry):Math.min(configured,entry.maxContextWindow??configured);return Math.floor(window2*(entry.effectiveContextWindowPercent??95)/100)}catch{return void 0}}function codexAlignedWindow(limit,model,headers,clientWindow){if(!isCodexClient(headers))return{limit,clamped:false};const w2=positiveWindow(clientWindow)??readCodexModelWindow(model,resolveCodexHome(process.env))??codexWindowForModel(model);if(limit>w2)return{limit:w2,clamped:true};return{limit,clamped:false}}var byAgent=new Map;function recordAgentProviders(agent,recipes){if(Object.keys(recipes).length===0)byAgent.delete(agent);else byAgent.set(agent,recipes)}function agentProviderRecipes(){const out={};for(const recipes of byAgent.values())Object.assign(out,recipes);return out}function agentRegistryStatus(){return[...byAgent.entries()].map(([agent,recipes])=>({agent,providers:Object.entries(recipes).map(([name,recipe])=>({name,models:Object.keys(recipe.models).sort()})).sort((a,b2)=>a.name.localeCompare(b2.name))}))}var APIS=new Set(["anthropic","openai","responses","google"]);function sanitizeAgentProviderField(value,max){return value.replace(/[\x00-\x1f\x7f]/g,"?").slice(0,max)}function parseAgentProviderEntry(name,value){if(!validSummaryCredentialName(name))throw new Error(`Invalid provider name "${name}"`);if(!value||typeof value!=="object"||Array.isArray(value))throw new Error(`Provider "${name}" must be an object`);const recipe=value;if(typeof recipe.baseUrl!=="string"||recipe.baseUrl.length===0||recipe.baseUrl.length>2048)throw new Error(`Provider "${name}" needs a baseUrl`);if(typeof recipe.api!=="string"||!APIS.has(recipe.api))throw new Error(`Provider "${name}" api must be one of: anthropic, openai, responses, google`);if(typeof recipe.apiKey!=="string"||recipe.apiKey.length===0||recipe.apiKey.length>8192||/[\x00-\x20\x7f]/.test(recipe.apiKey))throw new Error(`Provider "${name}" needs an apiKey`);let url;try{url=new URL(recipe.baseUrl)}catch{throw new Error(`Provider "${name}" baseUrl is not a valid URL`)}const loopback=["localhost","127.0.0.1","[::1]"].includes(url.hostname);if(url.protocol!=="https:"&&!(url.protocol==="http:"&&loopback)||url.username||url.password||url.hash||url.pathname.includes("/bili/")||url.pathname.startsWith("/__bili/"))throw new Error(`Provider "${name}" baseUrl must be HTTPS (or loopback HTTP) without credentials or proxy recursion`);if(!recipe.models||typeof recipe.models!=="object"||Array.isArray(recipe.models))throw new Error(`Provider "${name}" needs a models object`);const models=recipe.models;const modelEntries=Object.entries(models);if(modelEntries.length===0||modelEntries.length>64)throw new Error(`Provider "${name}" needs 1 to 64 models`);const outModels={};for(const[model,knobs]of modelEntries){if(model.length===0||model.length>200)throw new Error(`Provider "${name}" has an invalid model name`);const parsed={};if(knobs.contextWindow!==void 0){if(typeof knobs.contextWindow!=="number"||!Number.isSafeInteger(knobs.contextWindow)||knobs.contextWindow<2048||knobs.contextWindow>1e7)throw new Error(`Provider "${name}" model "${model}" has an invalid contextWindow`);parsed.contextWindow=knobs.contextWindow}if(knobs.outputTokens!==void 0){if(typeof knobs.outputTokens!=="number"||!Number.isSafeInteger(knobs.outputTokens)||knobs.outputTokens<128)throw new Error(`Provider "${name}" model "${model}" has an invalid outputTokens`);parsed.outputTokens=knobs.outputTokens}if(knobs.stream!==void 0){if(typeof knobs.stream!=="boolean")throw new Error(`Provider "${name}" model "${model}" has an invalid stream flag`);parsed.stream=knobs.stream}outModels[model]=parsed}return{baseUrl:recipe.baseUrl.replace(/\/+$/,""),api:recipe.api,apiKey:recipe.apiKey,models:outModels}}function parseAgentProviderReport(payload){if(!payload||typeof payload!=="object"||Array.isArray(payload))throw new Error("Expected a JSON object");const report=payload;if(typeof report.agent!=="string"||!/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(report.agent))throw new Error("Invalid agent name");if(!report.providers||typeof report.providers!=="object"||Array.isArray(report.providers))throw new Error("Expected a providers object");const entries=Object.entries(report.providers);if(entries.length===0||entries.length>64)throw new Error("Expected 1 to 64 providers");const registered={};const skipped=[];for(const[name,value]of entries){try{registered[name]=parseAgentProviderEntry(name,value)}catch(err2){skipped.push({name:sanitizeAgentProviderField(name,64)||"<unnamed>",reason:sanitizeAgentProviderField(err2 instanceof Error?err2.message:String(err2),200)})}}return{agent:report.agent,registered,skipped}}import{createHash as createHash20}from"crypto";var anchors=new Map;function personaFingerprint(systemText){return createHash20("sha256").update(systemText,"utf8").digest("hex").slice(0,16)}function resolvePersonaKey(rawId,systemText,messages){if(!systemText)return{key:rawId,action:"passthrough"};const fp=personaFingerprint(systemText);const anchored=anchors.get(rawId);if(anchored===void 0){anchors.set(rawId,fp);return{key:rawId,action:"claim"}}if(anchored===fp)return{key:rawId,action:"match"};if(prefixAffinity.chainContinues(messages,rawId)){anchors.set(rawId,fp);return{key:rawId,action:"migrate"}}return{key:`${rawId}|sub:${fp}`,action:"fork"}}function personaNamespace(rawId,systemText,messages,log2){const list=Array.isArray(messages)?messages:[];const text2=typeof systemText==="string"&&systemText.trim().length>0?systemText:"";const res=resolvePersonaKey(rawId,text2,list);if(res.action==="migrate"){log2("info",`[persona] persona text changed mid-conversation but the history continues ${rawId}'s chain \u2014 anchor migrated, compression state stays on the raw key (#2241/#2250)`)}return res.key}import fs14 from"fs";import os6 from"os";import path28 from"path";var UUID_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;var MAX_HEAD_BYTES=256*1024;var MAX_PROJECT_DIRS=2e3;function isClaudeSessionUuid(id){return UUID_RE.test(id)}function claudeConfigDirs(env=process.env){const dirs=[];for(const v2 of[env.CLAUDE_CONFIG_DIR,path28.join(os6.homedir(),".claude")]){if(typeof v2!=="string"||v2.trim().length===0)continue;const resolved=path28.resolve(v2.trim());if(!dirs.includes(resolved))dirs.push(resolved)}return dirs}function findTranscripts(sessionId,configDirs){const found=[];for(const dir of configDirs){const projects=path28.join(dir,"projects");let root;let entries;try{root=fs14.realpathSync(projects);entries=fs14.readdirSync(root,{withFileTypes:true})}catch{continue}let probed=0;for(const entry of entries){if(!entry.isDirectory())continue;if(++probed>MAX_PROJECT_DIRS)break;const candidate=path28.join(root,entry.name,`${sessionId}.jsonl`);try{const real=fs14.realpathSync(candidate);if(!real.startsWith(root+path28.sep))continue;if(!fs14.statSync(real).isFile())continue;if(!found.includes(real))found.push(real)}catch{}}}return found}function readForkedFrom(file,selfId){let head;let complete;try{const fd=fs14.openSync(file,"r");try{const buf=Buffer.alloc(MAX_HEAD_BYTES);const n=fs14.readSync(fd,buf,0,MAX_HEAD_BYTES,0);head=buf.subarray(0,n).toString("utf8");complete=n<MAX_HEAD_BYTES}finally{fs14.closeSync(fd)}}catch{return void 0}const lines=head.split("\n");if(!complete||!head.endsWith("\n"))lines.pop();for(const line of lines){if(!line.includes("forkedFrom"))continue;let obj;try{obj=JSON.parse(line)}catch{continue}const ff=obj?.forkedFrom;const parent=ff?.sessionId;if(typeof parent==="string"&&isClaudeSessionUuid(parent)&&parent.toLowerCase()!==selfId.toLowerCase())return parent}return void 0}function claudeTranscriptParent(sessionId,configDirs=claudeConfigDirs()){if(!isClaudeSessionUuid(sessionId))return{kind:"none",reason:"invalid-id"};const files=findTranscripts(sessionId,configDirs);if(files.length===0)return{kind:"none",reason:"no-transcript"};const parents=new Map;for(const file of files){const parent=readForkedFrom(file,sessionId);if(parent&&!parents.has(parent))parents.set(parent,file)}if(parents.size===0)return{kind:"none",reason:"no-fork-marker"};if(parents.size>1)return{kind:"none",reason:"ambiguous"};const[[parentId,transcript]]=[...parents.entries()];return{kind:"parent",parentId,transcript}}function resolveClaudeTranscriptLineage(sessionId,isKnown,opts){const configDirs=opts?.configDirs??claudeConfigDirs();const maxDepth=opts?.maxDepth??8;const seen=new Set([sessionId.toLowerCase()]);let current=sessionId;for(let hop=1;hop<=maxDepth;hop++){const step=claudeTranscriptParent(current,configDirs);if(step.kind==="none")return{parentId:void 0,reason:hop===1?step.reason:`ancestor ${current}: ${step.reason}`};const key2=step.parentId.toLowerCase();if(seen.has(key2))return{parentId:void 0,reason:"cycle"};seen.add(key2);if(isKnown(step.parentId))return{parentId:step.parentId,hops:hop};current=step.parentId}return{parentId:void 0,reason:"depth-cap"}}import{createBrotliDecompress,createGunzip,createInflate,createInflateRaw}from"zlib";var DecompressedTooLargeError=class extends Error{constructor(limit){super(`decompressed request exceeds ${limit} bytes`);this.limit=limit;this.name="DecompressedTooLargeError"}limit};function streamDecode(factory,input,max){return new Promise((resolve,reject)=>{const chunks=[];let size=0;const decoder=factory();decoder.on("data",chunk=>{size+=chunk.length;if(size>max){decoder.destroy();reject(new DecompressedTooLargeError(max));return}chunks.push(chunk)});decoder.on("end",()=>resolve(Buffer.concat(chunks,size)));decoder.on("error",err2=>reject(err2));decoder.end(input)})}async function decodeZstd(input,max){const chunks=[];let size=0;const decoder=new Decompress(chunk=>{size+=chunk.byteLength;if(size>max)throw new DecompressedTooLargeError(max);chunks.push(Buffer.from(chunk))});decoder.push(input,true);return Buffer.concat(chunks,size)}async function decodeOne(coding,input,max){if(coding==="gzip"||coding==="x-gzip")return streamDecode(createGunzip,input,max);if(coding==="br")return streamDecode(createBrotliDecompress,input,max);if(coding==="zstd")return decodeZstd(input,max);if(coding==="deflate"){try{return await streamDecode(createInflate,input,max)}catch(err2){if(err2 instanceof DecompressedTooLargeError)throw err2;return streamDecode(createInflateRaw,input,max)}}throw new Error(`unsupported request content-encoding: ${coding}`)}async function decodeRequestBody(contentEncoding,input,maxOutputBytes){const codings=(contentEncoding??"").split(",").map(coding=>coding.trim().toLowerCase()).filter(coding=>coding&&coding!=="identity");if(codings.length===0)return{body:input,decoded:false};let body=input;for(const coding of codings.reverse()){body=await decodeOne(coding,body,maxOutputBytes);if(body.byteLength>maxOutputBytes)throw new DecompressedTooLargeError(maxOutputBytes)}return{body,decoded:true}}var BILI_HOP_HEADER="x-bili-hop";function parseLauncherModelWindows(raw){if(!raw)return{};try{const parsed=JSON.parse(raw);if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return{};const out={};for(const[id,v2]of Object.entries(parsed)){if(typeof v2==="number"&&Number.isFinite(v2)&&v2>0)out[id]=Math.floor(v2)}return out}catch{return{}}}var LAUNCHER_MODEL_WINDOWS=parseLauncherModelWindows(process.env.BILI_LAUNCHER_MODEL_WINDOWS);function parseLauncherModelMaxOutputs(raw){if(!raw)return{};try{const parsed=JSON.parse(raw);if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return{};const out={};for(const[id,v2]of Object.entries(parsed)){if(typeof v2==="number"&&Number.isFinite(v2)&&v2>0)out[id]=Math.floor(v2)}return out}catch{return{}}}var LAUNCHER_MODEL_MAX_OUTPUTS=parseLauncherModelMaxOutputs(process.env.BILI_LAUNCHER_MODEL_MAX_OUTPUTS);function launcherMaxOutput(model){return LAUNCHER_MODEL_MAX_OUTPUTS[model]}function launcherContextWindow(model){return LAUNCHER_MODEL_WINDOWS[model]}var windowSourceLogged=new Set;var MAX_ANTHROPIC_BETA_WINDOW=1e7;function anthropicBetaContextWindow(headers){const raw=headers["anthropic-beta"];if(raw===void 0)return void 0;const list=Array.isArray(raw)?raw.join(","):raw;let best;for(const part of list.split(",")){const m2=/^context-(\d+)m\b/.exec(part.trim().toLowerCase());if(!m2)continue;const n=Number.parseInt(m2[1],10);if(!Number.isFinite(n)||n<=0)continue;const w2=Math.min(n*1e6,MAX_ANTHROPIC_BETA_WINDOW);if(best===void 0||w2>best)best=w2}return best}function expandedContextSuffixWindow(model){if(!model)return void 0;const m2=/\[(\d+)m\]$/i.exec(model.trim());if(!m2)return void 0;const n=Number.parseInt(m2[1],10);if(!Number.isFinite(n)||n<=0)return void 0;return Math.min(n*1e6,MAX_ANTHROPIC_BETA_WINDOW)}var registryWindowCappedLogged=new Set;function capRegistryWindowByStandard(model,registryWindow,hasTierEvidence){if(registryWindow===void 0||hasTierEvidence)return registryWindow;const std=tierGatedStandardWindow(model);if(std===void 0||registryWindow<=std)return registryWindow;if(!registryWindowCappedLogged.has(model)){registryWindowCappedLogged.add(model);log("info",`[window] registry advertises ${registryWindow} for ${model} but the request carries no tier evidence (context-Nm beta header / [Nm] suffix) \u2014 capping at the built-in standard ${std} (#1321)`)}return std}function safeSessionId(id){return(id??"unknown").replace(/[^a-zA-Z0-9._-]/g,"_")}var NO_IDENTITY_MESSAGE="Missing stable conversation identity. Send one of the headers: x-session-id, x-session-affinity, x-acp-session, x-opencode-session, x-claude-code-session-id, session-id \u2014 or body session_id / prompt_cache_key (responses/openai/anthropic). Requests replaying a conversation history are matched by content prefix affinity (#309); this one carries no usable history signal.";var UPSTREAM_HOP_HEADERS=new Set(["host","content-length","connection","keep-alive","transfer-encoding","proxy-authenticate","proxy-authorization","proxy-connection","x-bili-passthrough","te","trailer","upgrade"]);var RESPONSE_ONLY_STRIP_HEADERS=new Set(["content-encoding"]);function connectionNamedHeaders(conn){const out=new Set;if(!conn)return out;for(const part of Array.isArray(conn)?conn:[conn]){for(const name of part.split(",")){const t=name.trim().toLowerCase();if(t)out.add(t)}}return out}function buildForwardHeaders(headers){const out={};for(const[k2,v2]of Object.entries(headers)){if(k2.toLowerCase()==="content-length"||k2.toLowerCase()==="host")continue;out[k2]=v2}out["content-type"]="application/json";return out}var ACP_TAG_RE=/\x3cacp\s+tokens=\\"?[0-9]+(?:\.[0-9]+)?K?\\"?\s+type=\\"?[^\\"]*\\"?\s*\x3em[0-9]{1,8}\x3c\/acp\x3e/;function artifactSeedHit(body){if(body.length===0)return false;const tagSeed=body.includes("<acp ");const toolSeed=body.includes('"acp_status"')&&body.includes('"search_context"');return tagSeed||toolSeed}function detectAcpArtifacts(body,parsed){if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){const encoded=JSON.stringify(historyTextOf(parsed));if(encoded.includes("<acp ")&&ACP_TAG_RE.test(encoded))return"tags"}else if(body.includes("<acp ")&&ACP_TAG_RE.test(body.toString("utf8"))){return"tags"}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){const names=historyToolCallNames(parsed);if(names.has("acp_status")&&names.has("search_context"))return"tool-history"}return null}function historyTextOf(parsed){const parts=[];const container=Array.isArray(parsed.messages)?parsed.messages:Array.isArray(parsed.input)?parsed.input:Array.isArray(parsed.contents)?parsed.contents:null;if(container){for(const item of container)collectHistoryText(item,parts)}return parts.join("\n")}function collectHistoryText(item,out){if(!item||typeof item!=="object"||Array.isArray(item))return;const it2=item;if(it2.role==="system"||it2.role==="developer")return;const content=it2.content;if(typeof content==="string")out.push(content);else if(Array.isArray(content)){for(const block of content){if(block&&typeof block==="object"&&!Array.isArray(block)&&typeof block.text==="string"){out.push(block.text)}}}const parts=it2.parts;if(Array.isArray(parts)){for(const part of parts){if(part&&typeof part==="object"&&!Array.isArray(part)&&typeof part.text==="string"){out.push(part.text)}}}}function historyToolCallNames(parsed){const names=new Set;const container=Array.isArray(parsed.messages)?parsed.messages:Array.isArray(parsed.input)?parsed.input:Array.isArray(parsed.contents)?parsed.contents:null;if(!container)return names;for(const item of container)visitHistoryItem(item,names);return names}function visitHistoryItem(item,names){if(!item||typeof item!=="object"||Array.isArray(item))return;const it2=item;const toolCalls=it2.tool_calls;if(Array.isArray(toolCalls)){for(const tc of toolCalls){if(!tc||typeof tc!=="object"||Array.isArray(tc))continue;const fn=tc.function;if(fn&&typeof fn==="object"&&!Array.isArray(fn)&&typeof fn.name==="string"){names.add(fn.name)}}}if(it2.type==="function_call"&&typeof it2.name==="string")names.add(it2.name);const content=it2.content;if(Array.isArray(content)){for(const block of content){if(block&&typeof block==="object"&&!Array.isArray(block)&&block.type==="tool_use"&&typeof block.name==="string"){names.add(block.name)}}}const parts=it2.parts;if(Array.isArray(parts)){for(const part of parts){if(!part||typeof part!=="object"||Array.isArray(part))continue;const fc=part.functionCall;if(fc&&typeof fc==="object"&&!Array.isArray(fc)&&typeof fc.name==="string"){names.add(fc.name)}}}}var PI_SUBAGENT_CHILD_MARKER="<active_agent name=";var BILI_INJECTABLE_TOOL_NAMES=new Set(["compress","decompress","search_context","acp_status","acp_rule","acp_retrieve","absorb","image_full"]);function detectPiSubagentChildSignal(bodyBuffer){const idx=bodyBuffer.indexOf(PI_SUBAGENT_CHILD_MARKER);if(idx<0)return{present:false};let agent;const tail=bodyBuffer.subarray(idx,Math.min(bodyBuffer.length,idx+PI_SUBAGENT_CHILD_MARKER.length+96)).toString("utf8").replace(/\\/g,"");const m2=tail.match(/name="([^"]*)"/);if(m2&&m2[1])agent=m2[1];return{present:true,...agent?{agent}:{}}}function isInjectableName(v2){return typeof v2==="string"&&BILI_INJECTABLE_TOOL_NAMES.has(v2)}function exposesBiliInjectableTool(tools){if(!Array.isArray(tools))return false;for(const entry of tools){if(typeof entry!=="object"||entry===null)continue;const rec=entry;if(isInjectableName(rec.name))return true;const fn=rec.function;if(typeof fn==="object"&&fn!==null&&isInjectableName(fn.name))return true;const decls=rec.functionDeclarations;if(Array.isArray(decls)){for(const d of decls){if(typeof d==="object"&&d!==null&&isInjectableName(d.name))return true}}}return false}function piSubagentChannelFallback(bodyBuffer,parsed){const signal=detectPiSubagentChildSignal(bodyBuffer);if(!signal.present)return signal;const tools=typeof parsed==="object"&&parsed!==null?parsed.tools:void 0;if(exposesBiliInjectableTool(tools))return{present:false};return signal}var MESSAGE_MARK_CAP=3;function computeAnthropicMessageMarks(processed,ephemeralTailCount,session){const marks=new Map;if(noCacheControl()){session.metadata["anthropicCacheMarkIds"]=[];return marks}if(processed.length===0||processed.length<=ephemeralTailCount){session.metadata["anthropicCacheMarkIds"]=[];return marks}const liveIds=new Set(processed.map(m2=>m2.id).filter(id=>typeof id==="string"&&id.length>0));const kept=(session.metadata["anthropicCacheMarkIds"]??[]).filter(id=>liveIds.has(id));const lastIndex=processed.length-1-ephemeralTailCount;const currentId=processed[lastIndex]?.id;if(typeof currentId==="string"&¤tId.length>0&&!kept.includes(currentId)&&kept.length<MESSAGE_MARK_CAP){kept.push(currentId)}session.metadata["anthropicCacheMarkIds"]=kept;for(const id of kept)marks.set(id,{type:"ephemeral"});return marks}function anthropicToolsCarryCacheControl(tools){if(!Array.isArray(tools))return false;return tools.some(t=>typeof t==="object"&&t!==null&&t.cache_control!==void 0)}function stampAnthropicSystemCacheControl(systemOut,ours=true){if(noCacheControl())return systemOut;if(!ours)return systemOut;if(typeof systemOut==="string"&&systemOut.length>0){return[{type:"text",text:systemOut,cache_control:{type:"ephemeral"}}]}if(!Array.isArray(systemOut)||systemOut.length===0)return systemOut;for(const block of systemOut){if(block.cache_control)return systemOut}const last=systemOut.length-1;systemOut[last]={...systemOut[last],cache_control:{type:"ephemeral"}};return systemOut}async function prepareAnthropic(parsed,req,opts,core,config,prompts,surface,log2,session,pluginMode,upstreamOrigin,reasoning,visibilityMarkers,decide){const sessionId=session.id;const stream2=parsed.stream===true;++session.stats.requests;const injectTools=opts.compress.injectTool&&!pluginMode;const stripReasoning=msgs=>withReasoningDrop(msgs,reasoning,log2,sessionId,isStrictReasoningEcho(session,upstreamOrigin,modelIdOf(parsed)));if(isAutoModeClassifier(parsed)){log2("info",`[${sessionId}] auto-mode classifier passthrough (skipping compress injection)`);return{body:JSON.stringify(parsed),session,processedMessages:[],originalMessages:[],anthropicSystem:parsed.system,protocol:"anthropic",stream:stream2,compressInjected:false,pluginMode,nudge:void 0,prompts,surface}}let processedMessages=[];let attachedRetrievals=[];let attachedRetrievalNoteIds=[];let originalMessages=[];let nudge;let rebuiltMessages=parsed.messages;let anthropicCacheMarks;let clientCacheControls;let systemOut=parsed.system;let toolsOut=parsed.tools;let sysNotes=[];const clientSystem=parsed.system;const anthropicBillingBlock=extractBillingAttributionBlock(clientSystem);if(opts.stableSystemAnchor&&!pluginMode){const fresh=extractSystem(parsed.system);const outcome=reconcileSystemAnchor(session,"anthropic",fresh,sessionId,log2);sysNotes=outcome.notes;if(outcome.outbound!==fresh){parsed.system=buildSystem(outcome.outbound,parsed.system)}}const strippedPanels=stripAcpPanelMessages(parsed.messages);if(strippedPanels>0){log2("info",`[${sessionId}] stripped ${strippedPanels} ACP panel message(s) before projection (UI-only, issue #359)`)}const strippedMarkerLines=stripAcpStatusMarkers(parsed.messages);if(strippedMarkerLines>0){log2("info",`[${sessionId}] stripped ${strippedMarkerLines} ACP status marker line(s) from incoming history (ephemeral proxy status, issue #1029)`)}const strippedCarriers=stripEmbeddedChainCarriers(parsed,"anthropic");if(strippedCarriers>0){log2("info",`[${sessionId}] stripped ${strippedCarriers} embedded chain checkpoint(s) from incoming history (leaked egress control data, issue #1542)`)}try{const{msgs,cacheControls}=anthropicToCore(parsed);originalMessages=msgs;const inboundImageTokens=imageReserveFor(session,"anthropic",parsed,opts,upstreamOrigin);projectThinkingMass(msgs,{providerInputTokens:session.stats.lastInputTokens,measured:session.stats.lastInputTokensSource==="usage",systemText:extractSystem(parsed.system),tools:parsed.tools,imageTokens:inboundImageTokens,storedOverhead:typeof session.metadata.systemPromptTokens==="number"?session.metadata.systemPromptTokens:void 0});const knownRefsBefore=new Set(Object.keys(session.state.messageRefs.byRaw));extractSystem(parsed.system);const{tokens:tokenCount,source:tokenCountSource}=effectiveTokenCount(session,msgs,inboundImageTokens);const activeBefore=new Set(session.state.blocks.filter(b2=>b2.active).map(b2=>b2.blockId));const absorbBlock=effectiveAbsorbBlock(pluginMode,config,opts.compress.absorb);const absorbTools=absorbToolsFor(absorbBlock?.toolName??ABSORB_TOOL_NAME);const absorbActive=absorbBlock?.enabled===true&&opts.compress.injectTool;const rulesActive=rulesEnabled(config)&&opts.compress.injectTool;const loopConfig=ccrLoopConfig(session,{...config,absorb:absorbActive?absorbBlock:void 0});reconcileFoldCoverage(session,msgs,{mode:resolveFoldReconcileMode(process.env,opts.compress.reconcile),sessionId,log:log2});noteSystemPromptFingerprint(session,clientSystem,{sessionId,log:log2});const foldCoveredBefore=session.stats.pendingFoldUsage===true?new Set(session.state.blocks.flatMap(b2=>b2.active?b2.effectiveMessageIds:[])):null;const turn=core.processTurn({messages:msgs,state:session.state,config:loopConfig,tokenCount,renderTags:renderNone()?"none":"text-only",contentStore:contentStoreOf(session)});session.state=turn.state;adoptContentStore(session,turn.contentStore);session.stats.compressCreditTokens=0;if(foldCoveredBefore!==null&&msgs.length>=REWRITE_MIN_INCOMING_TOTAL){const gap=foldCoverage(foldCoveredBefore,msgs.map(m2=>m2.id));if(gap)log2("warn",`[${sessionId}] [acp-drift] fold coverage mismatch: ${gap.matched}/${gap.expected} covered message id(s) present in resent history \u2014 ${gap.expected-gap.matched} covered id(s) missing from resent history \u2014 mutation (content edit invalidates content-hash refs, fold silently lost) or client-side deletion/truncation (benign, message no longer on the wire); observability complement to the #1328 overflow rescue (#1195)`)}storeEffectiveAbsorb(session,loopConfig);storeEffectiveRules(session,config);turn.messages=applyAbsorbView(turn.messages,session.state,loopConfig,tokenCount);turn.messages=attachSubagentSessions(turn.messages,session);if(turn.nudge)turn.nudge.compressibleRanges=viableRanges(turn.nudge.compressibleRanges);nudge=turn.nudge;session.stats.contextTokens=tokenCount;session.stats.contextTokensSource=tokenCountSource;if(!session.meta.title||isAutoInjectedNotification(session.meta.title)){const t=deriveTitle(msgs);if(t)session.meta.title=t}log2("info",diagTagSummary(turn.messages,sessionId,"text-only"));const willInjectNudge=opts.compress.injectNudge&&!!turn.nudge&&!nudgeSuppressed(session)&&!compressBreakerArmed(session)&&!(autoFoldEngaged(loopConfig,session)&&growthFoldingArmed(loopConfig))&&(turn.nudge.shouldInject||emergencyNudge(turn.nudge,void 0,loopConfig.compress.minCompressRange));log2("info",diagNudge(turn,sessionId,tokenCount,config.modelContextLimit,parsed.model,willInjectNudge));processedMessages=stripReasoning(stripKernelSummaries(turn.messages,turn.state));{const rewrite=detectUnannouncedHistoryRewrite(session,knownRefsBefore,msgs.map(m2=>m2.id));if(rewrite.detected){log2("warn",`[${sessionId}] unannounced client history rewrite detected (${rewrite.knownIncoming}/${rewrite.incomingTotal} incoming message(s) carry pre-turn refs of ${rewrite.knownBefore} known) \u2014 marking compaction boundary (#1001)`);recordConflict(session,"unannounced-rewrite",`${rewrite.knownIncoming}/${rewrite.incomingTotal} incoming message(s) carry pre-turn refs of ${rewrite.knownBefore} known`);markCompactionBoundary(session)}}applyCompactionArchive(session,activeBefore,new Set(msgs.map(m2=>m2.id)),log2);reapOrphansLogged(session,msgs,log2,sessionId);await applyImageCompressionPass(session,processedMessages,{config,billing:imageBillingFor(opts,upstreamOrigin),cap:imageTokenCapFor(opts,upstreamOrigin),log:log2});if(pluginMode&&ccrEnabled(session)){reconcileReloadedRetrievals(session);pruneExpiredRetrievals(session);attachedRetrievals=snapshotPendingRetrievals(session);if(attachedRetrievals.length>0)processedMessages=[...processedMessages,...attachedRetrievals.map(i=>i.injection)]}anthropicCacheMarks=cacheControls.size>0||anthropicToolsCarryCacheControl(parsed.tools)?void 0:computeAnthropicMessageMarks(processedMessages,attachedRetrievals.length,session);clientCacheControls=cacheControls;rebuiltMessages=coreToAnthropic(processedMessages,anthropicCacheMarks??cacheControls);if(sysNotes.length>0){rebuiltMessages=[...rebuiltMessages,...sysNotes.map(text2=>({role:"user",content:text2}))]}systemOut=injectSystem(parsed,opts,prompts,loopConfig,surface,visibilityMarkers);systemOut=stampAnthropicSystemCacheControl(systemOut,anthropicCacheMarks!==void 0);if(injectTools){toolsOut=injectTool(parsed.tools,[...absorbActive?[absorbTools.anthropic]:[],...rulesActive?[RULE_TOOL]:[],...ccrEnabled(session)?[retrieveToolsFor(retrieveToolName(session)).anthropic]:[],...imageCompressionEnabled(session)?[IMAGE_FULL_TOOL]:[]],surface?.toolPrompts,ccrEnabled(session),externalSummaryEnabled(config))}if(willInjectNudge&&turn.nudge){const useDecide=decide!==void 0&&turn.nudge.tier===1&&turn.nudge.breakdown.emergencyOverride!==1;if(useDecide&&ladderMode(session.metadata)==="fallback"){consumeFallback(session.metadata);try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}}catch{}}else if(useDecide){const ranges=turn.nudge.compressibleRanges??[];const sideBody={...parsed,messages:[...rebuiltMessages,{role:"user",content:buildDecisionPrompt(ranges)}],system:systemOut,tools:toolsOut,stream:false,max_tokens:decide.maxTokens};delete sideBody.prompt_cache_key;const outcome=await runNudgeDecision({req,opts,protocol:"anthropic",sideBody,session,log:log2});if(outcome.kind==="yes"){const span=resolveDecisionRange(outcome,ranges);if(span){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(buildDirectiveText(span.startRef,span.endRef,outcome.topic),turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}else{log2("info",`[${sessionId}] [acp-decide] yes but no live range left to target \u2014 skipping injection`)}}}else{try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}}catch{}}}const imgNote=imageFullTrailingNote(session);if(imgNote)rebuiltMessages=[...rebuiltMessages,{role:"user",content:imgNote}];const retrNotes=snapshotRetrievalNotes(session);const retrNote=renderRetrievalNotes(retrNotes);if(retrNote){rebuiltMessages=[...rebuiltMessages,{role:"user",content:retrNote}];attachedRetrievalNoteIds=retrNotes.map(n=>n.id)}}catch(err2){log2("warn",`[${sessionId}] kernel transform failed, forwarding unchanged: ${String(err2)}`);if(attachedRetrievals.length>0)dropRetrievals(session,attachedRetrievals.map(i=>i.ref),"prepare failed; forwarded unprocessed");processedMessages=[]}session.metadata.systemPromptTokens=countSystemAndToolsTokens(extractSystem(systemOut),toolsOut);snapshotMessages(session,originalMessages);markDirty(session);const rebuilt={...parsed,messages:rebuiltMessages,system:systemOut,tools:toolsOut};warnAnthropicThinkingPairs(parsed.messages,rebuiltMessages,log2,sessionId);delete rebuilt.prompt_cache_key;session.stats.localInputEstimate=estimateCoreMessagesUpper(processedMessages.length>0?processedMessages:originalMessages)+countSystemAndToolsTokens(extractSystem(systemOut),toolsOut)+imageReserveFor(session,"anthropic",rebuilt,opts,upstreamOrigin);session.stats.lastLocalTextEstimate=estimateCoreMessages(processedMessages.length>0?processedMessages:originalMessages)+countSystemAndToolsTokens(extractSystem(systemOut),toolsOut)+imageReserveFor(session,"anthropic",rebuilt,opts,upstreamOrigin);if(upstreamOrigin)session.stats.lastLocalTextEstimateOrigin=upstreamOrigin;return{body:JSON.stringify(rebuilt),session,attachedRetrievals,attachedRetrievalNoteIds,processedMessages,originalMessages,anthropicSystem:parsed.system,anthropicBillingBlock,anthropicCacheMarks,anthropicClientCacheControls:clientCacheControls,systemNotes:sysNotes,protocol:"anthropic",stream:stream2,compressInjected:injectTools,pluginMode,nudge,prompts,surface,renderTags:renderNone()?"none":"text-only",dropReasoning:stripReasoning}}var AUTO_MODE_CLASSIFIER_STOPS=new Set(["</severity>","</block>"]);function isAutoModeClassifier(parsed){const stops=parsed.stop_sequences;if(!Array.isArray(stops))return false;return stops.some(s3=>typeof s3==="string"&&AUTO_MODE_CLASSIFIER_STOPS.has(s3))}async function prepareOpenai(parsed,req,opts,core,config,prompts,surface,log2,session,pluginMode,upstreamOrigin,nativeWindow,reasoning,visibilityMarkers,billingUpstream,decide){const sessionId=session.id;const stream2=parsed.stream===true;++session.stats.requests;let openaiSystemText="";let sysNotes=[];const stripReasoning=msgs=>withReasoningDrop(msgs,reasoning,log2,sessionId,isStrictReasoningEcho(session,upstreamOrigin,modelIdOf(parsed)));let openaiOutboundSystem;let processedMessages=[];let attachedRetrievals=[];let attachedRetrievalNoteIds=[];let originalMessages=[];let nudge;let rebuiltMessages=parsed.messages;let toolsOut=parsed.tools;const maxTokens=typeof parsed.max_tokens==="number"?parsed.max_tokens:8192;const isTitleGen=maxTokens<=200;const shouldInject=opts.compress.injectTool&&!isTitleGen;const injectTools=shouldInject&&!pluginMode;const strippedPanels=stripAcpPanelMessages(parsed.messages);if(strippedPanels>0){log2("info",`[${sessionId}] stripped ${strippedPanels} ACP panel message(s) before projection (UI-only, issue #359)`)}const strippedMarkerLines=stripAcpStatusMarkers(parsed.messages);if(strippedMarkerLines>0){log2("info",`[${sessionId}] stripped ${strippedMarkerLines} ACP status marker line(s) from incoming history (ephemeral proxy status, issue #1029)`)}const strippedCarriers=stripEmbeddedChainCarriers(parsed,"openai");if(strippedCarriers>0){log2("info",`[${sessionId}] stripped ${strippedCarriers} embedded chain checkpoint(s) from incoming history (leaked egress control data, issue #1542)`)}try{const{msgs,systemText}=openaiToCore(parsed);openaiSystemText=systemText;warnDroppedOpenaiParts(parsed,sessionId,log2);if(opts.stableSystemAnchor&&!pluginMode&&!isTitleGen){const outcome=reconcileSystemAnchor(session,"openai",systemText,sessionId,log2);sysNotes=outcome.notes;openaiSystemText=outcome.outbound}originalMessages=msgs;const knownRefsBefore=new Set(Object.keys(session.state.messageRefs.byRaw));const{tokens:tokenCount,source:tokenCountSource}=effectiveTokenCount(session,msgs,imageReserveFor(session,"openai",parsed,opts,billingUpstream??upstreamOrigin));const activeBefore=new Set(session.state.blocks.filter(b2=>b2.active).map(b2=>b2.blockId));const absorbBlock=effectiveAbsorbBlock(pluginMode,config,opts.compress.absorb);const absorbTools=absorbToolsFor(absorbBlock?.toolName??ABSORB_TOOL_NAME);const absorbActive=absorbBlock?.enabled===true&&shouldInject;const rulesActive=rulesEnabled(config)&&shouldInject;const loopConfig=ccrLoopConfig(session,{...config,absorb:absorbActive?absorbBlock:void 0});let dshRebased=false;if(!isTitleGen&&session.metadata["pluginAgent"]==="dsh"&&session.state.blocks.some(b2=>b2.active)){const coveredBeforeDshCompact=new Set(session.state.blocks.flatMap(b2=>b2.active?b2.effectiveMessageIds:[]));const dshGap=foldCoverage(coveredBeforeDshCompact,msgs.map(m2=>m2.id));if(dshGap&&carriesDshLocalCompactionSummary(msgs)){const missing=dshGap.expected-dshGap.matched;if(missing>=DSH_LOCAL_COMPACTION_MIN_MISSING&&missing*2>=dshGap.expected){recordConflict(session,"native-compaction",`dsh native compaction: ${missing}/${dshGap.expected} covered id(s) replaced by the compacted history; ACP state rebased (#2432)`);log2("warn",`[${sessionId}] dsh native compaction detected (${dshGap.matched}/${dshGap.expected} covered id(s) retained, checkpoint framing in resent history) \u2014 rebasing ACP state onto the compacted history (#2432)`);markNativeCompactionBoundary(session);dshRebased=reconcileNativeCompactionBoundary(session)}}}reconcileFoldCoverage(session,msgs,{mode:resolveFoldReconcileMode(process.env,opts.compress.reconcile),sessionId,log:log2});if(!isTitleGen)noteSystemPromptFingerprint(session,systemText,{sessionId,log:log2});const foldCoveredBefore=session.stats.pendingFoldUsage===true?new Set(session.state.blocks.flatMap(b2=>b2.active?b2.effectiveMessageIds:[])):null;const turn=core.processTurn({messages:msgs,state:session.state,config:loopConfig,tokenCount,renderTags:renderNone()?"none":"text-only",contentStore:contentStoreOf(session)});session.state=turn.state;adoptContentStore(session,turn.contentStore);session.stats.compressCreditTokens=0;if(foldCoveredBefore!==null&&!isTitleGen&&msgs.length>=REWRITE_MIN_INCOMING_TOTAL){const gap=foldCoverage(foldCoveredBefore,msgs.map(m2=>m2.id));if(gap)log2("warn",`[${sessionId}] [acp-drift] fold coverage mismatch: ${gap.matched}/${gap.expected} covered message id(s) present in resent history \u2014 ${gap.expected-gap.matched} covered id(s) missing from resent history \u2014 mutation (content edit invalidates content-hash refs, fold silently lost) or client-side deletion/truncation (benign, message no longer on the wire); observability complement to the #1328 overflow rescue (#1195)`)}storeEffectiveAbsorb(session,loopConfig);storeEffectiveRules(session,config);turn.messages=applyAbsorbView(turn.messages,session.state,loopConfig,tokenCount);turn.messages=attachSubagentSessions(turn.messages,session);if(turn.nudge)turn.nudge.compressibleRanges=viableRanges(turn.nudge.compressibleRanges);nudge=turn.nudge;session.stats.contextTokens=tokenCount;session.stats.contextTokensSource=tokenCountSource;if(!session.meta.title||isAutoInjectedNotification(session.meta.title)){const t=deriveTitle(msgs);if(t)session.meta.title=t}log2("info",diagTagSummary(turn.messages,sessionId,"text-only"));const willInjectNudge=opts.compress.injectNudge&&!!turn.nudge&&shouldInject&&!nudgeSuppressed(session)&&!compressBreakerArmed(session)&&!(autoFoldEngaged(loopConfig,session)&&growthFoldingArmed(loopConfig))&&(turn.nudge.shouldInject||emergencyNudge(turn.nudge,void 0,loopConfig.compress.minCompressRange));log2("info",diagNudge(turn,sessionId,tokenCount,config.modelContextLimit,parsed.model,willInjectNudge));processedMessages=stripReasoning(stripKernelSummaries(turn.messages,turn.state));if(!dshRebased){const rewrite=detectUnannouncedHistoryRewrite(session,knownRefsBefore,msgs.map(m2=>m2.id));if(rewrite.detected){log2("warn",`[${sessionId}] unannounced client history rewrite detected (${rewrite.knownIncoming}/${rewrite.incomingTotal} incoming message(s) carry pre-turn refs of ${rewrite.knownBefore} known) \u2014 marking compaction boundary (#1001)`);recordConflict(session,"unannounced-rewrite",`${rewrite.knownIncoming}/${rewrite.incomingTotal} incoming message(s) carry pre-turn refs of ${rewrite.knownBefore} known`);markCompactionBoundary(session)}}applyCompactionArchive(session,activeBefore,new Set(msgs.map(m2=>m2.id)),log2);reapOrphansLogged(session,msgs,log2,sessionId);await applyImageCompressionPass(session,processedMessages,{config,billing:imageBillingFor(opts,billingUpstream??upstreamOrigin),cap:imageTokenCapFor(opts,billingUpstream??upstreamOrigin),log:log2});if(pluginMode&&ccrEnabled(session)){reconcileReloadedRetrievals(session);pruneExpiredRetrievals(session);attachedRetrievals=snapshotPendingRetrievals(session);if(attachedRetrievals.length>0)processedMessages=[...processedMessages,...attachedRetrievals.map(i=>i.injection)]}rebuiltMessages=systemToUser(hardenOpenaiAssistantContent(coreToOpenai(processedMessages)));const sysParts=[];if(openaiSystemText)sysParts.push(openaiSystemText);if(shouldInject)sysParts.push(withMarkerIntegrityNote(withSummaryBudgetNote(buildCompressSystemPrompt(prompts,surface?.promptSections),externalSummaryEnabled(config)),visibilityMarkers));else if(!isTitleGen&&!renderNone()){const tagsOnly=buildAcpTagsOnlyPrompt("function",prompts,surface?.promptSections);if(tagsOnly)sysParts.push(tagsOnly)}if(absorbActive)sysParts.push(buildAbsorbSystemPrompt(absorbToolName(loopConfig)));rebuiltMessages=injectOpenaiSystem(rebuiltMessages,sysParts);if(sysNotes.length>0){rebuiltMessages=[...rebuiltMessages,...sysNotes.map(text2=>({role:"user",content:text2}))]}openaiOutboundSystem=sysParts.join("\n\n");if(injectTools){toolsOut=injectOpenaiTool(parsed.tools,[...absorbActive?[absorbTools.openai]:[],...rulesActive?[RULE_TOOL_OPENAI]:[],...ccrEnabled(session)?[retrieveToolsFor(retrieveToolName(session)).openai]:[],...imageCompressionEnabled(session)?[IMAGE_FULL_TOOL_OPENAI]:[]],surface?.toolPrompts,ccrEnabled(session),externalSummaryEnabled(config))}if(willInjectNudge&&turn.nudge){const useDecide=decide!==void 0&&turn.nudge.tier===1&&turn.nudge.breakdown.emergencyOverride!==1;if(useDecide&&ladderMode(session.metadata)==="fallback"){consumeFallback(session.metadata);try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}}catch{}}else if(useDecide){const ranges=turn.nudge.compressibleRanges??[];const stable=normalizeStrictEchoReasoning([...rebuiltMessages],isStrictReasoningEcho(session,upstreamOrigin,modelIdOf(parsed)),log2,sessionId);const sideBody={...parsed,messages:[...stable,{role:"user",content:buildDecisionPrompt(ranges)}],tools:toolsOut,stream:false};sideBody[typeof parsed.max_completion_tokens==="number"?"max_completion_tokens":"max_tokens"]=decide.maxTokens;delete sideBody.prompt_cache_retention;const outcome=await runNudgeDecision({req,opts,protocol:"openai",sideBody,session,log:log2});if(outcome.kind==="yes"){const span=resolveDecisionRange(outcome,ranges);if(span){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(buildDirectiveText(span.startRef,span.endRef,outcome.topic),turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}else{log2("info",`[${sessionId}] [acp-decide] yes but no live range left to target \u2014 skipping injection`)}}}else{try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}}catch{}}}const imgNote=imageFullTrailingNote(session);if(imgNote)rebuiltMessages=[...rebuiltMessages,{role:"user",content:imgNote}];const retrNotes=snapshotRetrievalNotes(session);const retrNote=renderRetrievalNotes(retrNotes);if(retrNote){rebuiltMessages=[...rebuiltMessages,{role:"user",content:retrNote}];attachedRetrievalNoteIds=retrNotes.map(n=>n.id)}}catch(err2){log2("warn",`[${sessionId}] kernel transform failed, forwarding unchanged: ${String(err2)}`);if(attachedRetrievals.length>0)dropRetrievals(session,attachedRetrievals.map(i=>i.ref),"prepare failed; forwarded unprocessed");processedMessages=[]}rebuiltMessages=normalizeStrictEchoReasoning(rebuiltMessages,isStrictReasoningEcho(session,upstreamOrigin,modelIdOf(parsed)),log2,sessionId);const rebuilt={...parsed,messages:rebuiltMessages,tools:toolsOut};warnReasoningPairs(rebuiltMessages,log2,sessionId);clampOutgoingOutput(rebuilt,typeof parsed.max_completion_tokens==="number"?"max_completion_tokens":"max_tokens",{systemText:openaiSystemText,tools:toolsOut,processedMessages,lastInputTokens:session.stats.lastInputTokens,lastInputTokensSource:session.stats.lastInputTokensSource,nativeWindow,headroomWindow:config.modelContextLimit,imageTokens:imageReserveFor(session,"openai",rebuilt,opts,billingUpstream??upstreamOrigin),kFactor:currentCalibrationFactor(session.stats,session.metadata?.lastModel),kOrigin:session.stats.calibratedEstimateOrigin,origin:billingUpstream??upstreamOrigin,ledgerFloorTokens:dshLedgerFloorTokens(session.metadata)},sessionId,log2);delete rebuilt.prompt_cache_retention;if(shouldStampRelayAffinityPck(conversationHeaderSource(req.headers)?.name,parsed.prompt_cache_key,billingUpstream,upstreamOrigin)){rebuilt.prompt_cache_key=session.id}if(stream2&&rebuilt.stream_options===void 0){rebuilt.stream_options={include_usage:true}}if(!isTitleGen&&openaiOutboundSystem!==void 0){session.metadata.systemPromptTokens=countSystemAndToolsTokens(openaiOutboundSystem,toolsOut)}if(!isTitleGen){session.stats.localInputEstimate=estimateCoreMessagesUpper(processedMessages.length>0?processedMessages:originalMessages)+countSystemAndToolsTokens(openaiOutboundSystem||openaiSystemText,toolsOut)+imageReserveFor(session,"openai",rebuilt,opts,billingUpstream??upstreamOrigin);session.stats.lastLocalTextEstimate=estimateCoreMessages(processedMessages.length>0?processedMessages:originalMessages)+countSystemAndToolsTokens(openaiOutboundSystem||openaiSystemText,toolsOut)+imageReserveFor(session,"openai",rebuilt,opts,billingUpstream??upstreamOrigin);const openaiPairOrigin=billingUpstream??upstreamOrigin;if(openaiPairOrigin)session.stats.lastLocalTextEstimateOrigin=openaiPairOrigin}snapshotMessages(session,originalMessages);markDirty(session);return{body:JSON.stringify(rebuilt),session,attachedRetrievals,attachedRetrievalNoteIds,processedMessages,originalMessages,protocol:"openai",stream:stream2,compressInjected:injectTools,pluginMode,nudge,prompts,surface,openaiSystemText,systemNotes:sysNotes,renderTags:renderNone()?"none":"text-only",dropReasoning:stripReasoning}}function appendGoogleNudge(contents,text2){const last=contents[contents.length-1];if(last&&(last.role??"user")!=="model"){const parts=Array.isArray(last.parts)?last.parts:[];return[...contents.slice(0,-1),{...last,parts:[...parts,{text:text2}]}]}return[...contents,{role:"user",parts:[{text:text2}]}]}async function prepareGoogle(parsed,opts,core,config,prompts,surface,log2,session,pluginMode,nativeWindow,model,stream2,visibilityMarkers,upstreamOrigin,req,decide){const sessionId=session.id;++session.stats.requests;let googleClientSystem="";let sysNotes=[];let googleOutboundSystem;let systemInstruction=parsed.systemInstruction;let processedMessages=[];let originalMessages=[];let nudge;let rebuiltContents=Array.isArray(parsed.contents)?parsed.contents:[];let toolsOut=parsed.tools;const genConfig=parsed.generationConfig;const declaredMax=genConfig?genConfig.maxOutputTokens:void 0;const maxTokens=typeof declaredMax==="number"?declaredMax:8192;const isTitleGen=maxTokens<=200;const shouldInject=opts.compress.injectTool&&!isTitleGen;const injectTools=shouldInject&&!pluginMode;const strippedCarriers=stripEmbeddedChainCarriers(parsed,"google");if(strippedCarriers>0){log2("info",`[${sessionId}] stripped ${strippedCarriers} embedded chain checkpoint(s) from incoming history (leaked egress control data, issue #1542)`)}try{const{msgs,systemText}=googleToCore(parsed);googleClientSystem=systemText;if(opts.stableSystemAnchor&&!pluginMode&&!isTitleGen){const outcome=reconcileSystemAnchor(session,"google",systemText,sessionId,log2);sysNotes=outcome.notes;googleClientSystem=outcome.outbound}originalMessages=msgs;const{tokens:tokenCount,source:tokenCountSource}=effectiveTokenCount(session,msgs,imageReserveFor(session,"google",parsed,opts,upstreamOrigin));const activeBefore=new Set(session.state.blocks.filter(b2=>b2.active).map(b2=>b2.blockId));const absorbBlock=effectiveAbsorbBlock(pluginMode,config,opts.compress.absorb);const absorbTools=absorbToolsFor(absorbBlock?.toolName??ABSORB_TOOL_NAME);const absorbActive=absorbBlock?.enabled===true&&shouldInject;const rulesActive=rulesEnabled(config)&&shouldInject;const loopConfig=ccrLoopConfig(session,{...config,absorb:absorbActive?absorbBlock:void 0});reconcileFoldCoverage(session,msgs,{mode:resolveFoldReconcileMode(process.env,opts.compress.reconcile),sessionId,log:log2});if(!isTitleGen)noteSystemPromptFingerprint(session,systemText,{sessionId,log:log2});const foldCoveredBefore=session.stats.pendingFoldUsage===true?new Set(session.state.blocks.flatMap(b2=>b2.active?b2.effectiveMessageIds:[])):null;const turn=core.processTurn({messages:msgs,state:session.state,config:loopConfig,tokenCount,renderTags:"text-only",contentStore:contentStoreOf(session)});session.state=turn.state;adoptContentStore(session,turn.contentStore);session.stats.compressCreditTokens=0;if(foldCoveredBefore!==null&&!isTitleGen&&msgs.length>=REWRITE_MIN_INCOMING_TOTAL){const gap=foldCoverage(foldCoveredBefore,msgs.map(m2=>m2.id));if(gap)log2("warn",`[${sessionId}] [acp-drift] fold coverage mismatch: ${gap.matched}/${gap.expected} covered message id(s) present in resent history \u2014 ${gap.expected-gap.matched} covered id(s) missing from resent history \u2014 mutation (content edit invalidates content-hash refs, fold silently lost) or client-side deletion/truncation (benign, message no longer on the wire); observability complement to the #1328 overflow rescue (#1195)`)}storeEffectiveAbsorb(session,loopConfig);storeEffectiveRules(session,config);turn.messages=applyAbsorbView(turn.messages,session.state,loopConfig,tokenCount);turn.messages=attachSubagentSessions(turn.messages,session);if(turn.nudge)turn.nudge.compressibleRanges=viableRanges(turn.nudge.compressibleRanges);nudge=turn.nudge;session.stats.contextTokens=tokenCount;session.stats.contextTokensSource=tokenCountSource;if(!session.meta.title||isAutoInjectedNotification(session.meta.title)){const t=deriveTitle(msgs);if(t)session.meta.title=t}log2("info",diagTagSummary(turn.messages,sessionId,"text-only"));const willInjectNudge=opts.compress.injectNudge&&!!turn.nudge&&shouldInject&&!nudgeSuppressed(session)&&!compressBreakerArmed(session)&&!(autoFoldEngaged(loopConfig,session)&&growthFoldingArmed(loopConfig))&&(turn.nudge.shouldInject||emergencyNudge(turn.nudge,void 0,loopConfig.compress.minCompressRange));log2("info",diagNudge(turn,sessionId,tokenCount,config.modelContextLimit,model,willInjectNudge));processedMessages=stripKernelSummaries(turn.messages,turn.state);applyCompactionArchive(session,activeBefore,new Set(msgs.map(m2=>m2.id)),log2);reapOrphansLogged(session,msgs,log2,sessionId);await applyImageCompressionPass(session,processedMessages,{config,billing:imageBillingFor(opts,upstreamOrigin),cap:imageTokenCapFor(opts,upstreamOrigin),log:log2});rebuiltContents=coreToGoogle(processedMessages);const sysParts=[];if(googleClientSystem)sysParts.push(googleClientSystem);if(shouldInject)sysParts.push(withMarkerIntegrityNote(withSummaryBudgetNote(buildCompressSystemPrompt(prompts,surface?.promptSections),externalSummaryEnabled(config)),visibilityMarkers));else if(!isTitleGen){const tagsOnly=buildAcpTagsOnlyPrompt("function",prompts,surface?.promptSections);if(tagsOnly)sysParts.push(tagsOnly)}if(absorbActive)sysParts.push(buildAbsorbSystemPrompt(absorbToolName(loopConfig)));googleOutboundSystem=sysParts.join("\n\n");const extraSystemParts=sysParts.slice(googleClientSystem?1:0);systemInstruction=extraSystemParts.length>0?{parts:sysParts.map(text2=>({text:text2}))}:parsed.systemInstruction;if(injectTools){toolsOut=injectGoogleTool(parsed.tools,[...absorbActive?[absorbTools.google]:[],...rulesActive?[RULE_TOOL_GOOGLE]:[],...ccrEnabled(session)?[retrieveToolsFor(retrieveToolName(session)).google]:[],...imageCompressionEnabled(session)?[IMAGE_FULL_TOOL_GOOGLE]:[]],surface?.toolPrompts,ccrEnabled(session),externalSummaryEnabled(config))}if(sysNotes.length>0){rebuiltContents=appendGoogleNudge(rebuiltContents,sysNotes.join("\n\n---\n\n"))}if(willInjectNudge&&turn.nudge){const useDecide=decide!==void 0&&turn.nudge.tier===1&&turn.nudge.breakdown.emergencyOverride!==1;if(useDecide&&ladderMode(session.metadata)==="fallback"){consumeFallback(session.metadata);try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltContents=appendGoogleNudge(rebuiltContents,withMarkerIntegrityNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),visibilityMarkers))}}catch{}}else if(useDecide){const ranges=turn.nudge.compressibleRanges??[];const sideBody={...parsed,contents:[...rebuiltContents,{role:"user",parts:[{text:buildDecisionPrompt(ranges)}]}],tools:toolsOut,systemInstruction,generationConfig:{...parsed.generationConfig??{},maxOutputTokens:decide.maxTokens}};const outcome=await runNudgeDecision({req,opts,protocol:"google",sideBody,session,log:log2});if(outcome.kind==="yes"){const span=resolveDecisionRange(outcome,ranges);if(span){rebuiltContents=appendGoogleNudge(rebuiltContents,withMarkerIntegrityNote(withFirstSightDrain(buildDirectiveText(span.startRef,span.endRef,outcome.topic),turn.nudge.reason,externalSummaryEnabled(config)),visibilityMarkers))}else{log2("info",`[${sessionId}] [acp-decide] yes but no live range left to target \u2014 skipping injection`)}}}else{try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltContents=appendGoogleNudge(rebuiltContents,withMarkerIntegrityNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),visibilityMarkers))}}catch{}}}const imgNote=imageFullTrailingNote(session);if(imgNote)rebuiltContents=appendGoogleNudge(rebuiltContents,imgNote)}catch(err2){log2("warn",`[${sessionId}] kernel transform failed, forwarding unchanged: ${String(err2)}`);processedMessages=[]}const rebuilt={...parsed,contents:rebuiltContents,tools:toolsOut,systemInstruction};clampOutgoingOutput(rebuilt,"generationConfig.maxOutputTokens",{systemText:googleClientSystem,tools:toolsOut,processedMessages,lastInputTokens:session.stats.lastInputTokens,lastInputTokensSource:session.stats.lastInputTokensSource,nativeWindow,headroomWindow:config.modelContextLimit,imageTokens:imageReserveFor(session,"google",rebuilt,opts,upstreamOrigin),kFactor:currentCalibrationFactor(session.stats,session.metadata?.lastModel),kOrigin:session.stats.calibratedEstimateOrigin,origin:upstreamOrigin,ledgerFloorTokens:dshLedgerFloorTokens(session.metadata)},sessionId,log2);if(!isTitleGen&&googleOutboundSystem!==void 0){session.metadata.systemPromptTokens=countSystemAndToolsTokens(googleOutboundSystem,toolsOut)}if(!isTitleGen){session.stats.lastLocalTextEstimate=estimateCoreMessages(processedMessages.length>0?processedMessages:originalMessages)+countSystemAndToolsTokens(googleOutboundSystem??"",toolsOut)+imageReserveFor(session,"google",rebuilt,opts,upstreamOrigin);if(upstreamOrigin)session.stats.lastLocalTextEstimateOrigin=upstreamOrigin}snapshotMessages(session,originalMessages);markDirty(session);return{body:JSON.stringify(rebuilt),session,processedMessages,originalMessages,protocol:"google",stream:stream2,compressInjected:injectTools,pluginMode,nudge,prompts,surface,google:{system:googleClientSystem,model},systemNotes:sysNotes,renderTags:"text-only"}}function prepareGoogleCountTokens(parsed,core,config,log2,session){const sessionId=session.id;try{const{msgs}=googleToCore(parsed);const turn=core.processTurn({messages:msgs,state:session.state,config:ccrLoopConfig(session,config),tokenCount:usageGradeInputBaseline(session),renderTags:"text-only",contentStore:contentStoreOf(session)});const stripped=stripKernelSummaries(turn.messages,turn.state);const rebuilt={...parsed,contents:coreToGoogle(stripped)};log2("info",`[${sessionId}] countTokens pruned: ${msgs.length} \u2192 ${stripped.length} msgs`);return{body:JSON.stringify(rebuilt),session,processedMessages:[],originalMessages:msgs,protocol:"google",stream:false,compressInjected:false}}catch(err2){log2("warn",`[${sessionId}] countTokens prune failed, forwarding unchanged: ${String(err2)}`);return{body:JSON.stringify({...parsed}),session,processedMessages:[],originalMessages:[],protocol:"google",stream:false,compressInjected:false}}}import fs16 from"fs";import path32 from"path";import fs15 from"fs";import path29 from"path";var DSH_AUTO_REVIEW_ISSUE="https://github.com/ranxianglei/billion-context/issues/2462";var KNOWN_COST_PLUGINS=[{client:"dsh",id:"@deepseek-ai/dsh-experimental-auto-review",name:"@deepseek-ai/dsh-experimental-auto-review",issueUrl:DSH_AUTO_REVIEW_ISSUE,patchIds:["auto-review"]}];var SCAN_TTL_MS=5*60*1e3;var cache5;function dshEnabledPatchIds(env){const ids=new Set;let dirs;try{dirs=dshProfileDirs(env)}catch{return ids}const itemRe=/^\s*-\s*id\s*:\s*(\S+)/;for(const dir of dirs){let text2;try{text2=fs15.readFileSync(path29.join(dir,"cordis.patch.yml"),"utf8")}catch{continue}for(const line of text2.split(/\r?\n/)){const m2=line.match(itemRe);if(!m2)continue;let v2=m2[1];if(v2.startsWith('"')&&v2.endsWith('"')||v2.startsWith("'")&&v2.endsWith("'"))v2=v2.slice(1,-1);v2=v2.trim();if(v2.length>0)ids.add(v2)}}return ids}function detectCostAdvisories(env=process.env){const key2=`${env.DSH_HOME??""}|${env.HOME??""}|${env.USERPROFILE??""}`;if(cache5&&cache5.key===key2&&Date.now()-cache5.at<SCAN_TTL_MS)return cache5.result;const found=[];const enabled=KNOWN_COST_PLUGINS.some(p2=>p2.client==="dsh")?dshEnabledPatchIds(env):void 0;for(const p2 of KNOWN_COST_PLUGINS){if(p2.client!=="dsh")continue;if(!p2.patchIds.some(pid=>enabled?.has(pid)))continue;found.push({id:p2.id,name:p2.name,client:p2.client,issueUrl:p2.issueUrl})}cache5={key:key2,at:Date.now(),result:found};return found}var ALERT_KINDS=new Set(["connect-timeout","connect-refused","proxy-reset","upstream-reset","dns","tls"]);var MAX_ALERTS=32;var alerts=new Map;function hostOf(url){try{return new URL(url).host}catch{return url}}function keyFor(kind,host){return kind+"\0"+host}function recordUpstreamAlert(url,error,viaProxy){const kind=classifyUpstreamFailure(error,{viaProxy});if(!ALERT_KINDS.has(kind))return;const host=hostOf(url);const now=Date.now();const key2=keyFor(kind,host);const existing=alerts.get(key2);if(existing){existing.lastSeen=now;existing.count+=1;existing.hint=UPSTREAM_FAIL_HINTS[kind];return}if(alerts.size>=MAX_ALERTS){let oldestKey;let oldestAt=Infinity;for(const[k2,a]of alerts){if(a.lastSeen<oldestAt){oldestAt=a.lastSeen;oldestKey=k2}}if(oldestKey!==void 0)alerts.delete(oldestKey)}alerts.set(key2,{kind,host,hint:UPSTREAM_FAIL_HINTS[kind],firstSeen:now,lastSeen:now,count:1})}function clearUpstreamAlertsForHost(url){const host=hostOf(url);for(const[key2,a]of alerts){if(a.host===host)alerts.delete(key2)}}function getUpstreamAlerts(){return[...alerts.values()].sort((a,b2)=>b2.lastSeen-a.lastSeen)}import{existsSync as existsSync7}from"fs";var MESSAGES={"zh-CN":{"summary.title":"\u7EDF\u4E00\u6458\u8981\u670D\u52A1\uFF08\u5B9E\u9A8C\u6027\u529F\u80FD\uFF09","summary.enabled":"\u542F\u7528","summary.add":"\u6DFB\u52A0\u76EE\u6807","summary.ref":"\u76EE\u6807\uFF08provider/model\uFF09","summary.no_recipes":"providers \u91CC\u8FD8\u6CA1\u6709\u5177\u540D\u62E8\u53F7\u914D\u65B9\uFF08\u542B baseUrl/api \u7684\u975E URL \u6761\u76EE\uFF09\u2014\u2014\u5148\u5728 JSON \u4E2D\u6DFB\u52A0","summary.credentials":"\u914D\u65B9\u51ED\u636E","summary.key":"API Key","summary.key_save":"\u4FDD\u5B58 Key","summary.key_delete":"\u5220\u9664 Key","summary.key_set":"\u5DF2\u914D\u7F6E","summary.key_missing":"\u672A\u914D\u7F6E","summary.key_saved":"Key \u5DF2\u4FDD\u5B58","summary.total":"\u603B\u65F6\u9650 (ms)","summary.timeout":"\u5355\u76EE\u6807\u65F6\u9650 (ms)","summary.bytes":"\u6458\u8981\u4E0A\u9650 (bytes)","summary.up":"\u4E0A\u79FB","summary.down":"\u4E0B\u79FB","summary.remove":"\u79FB\u9664\u76EE\u6807","summary.invalid":"\u6458\u8981\u914D\u7F6E\u65E0\u6548\uFF0C\u8BF7\u5728 JSON \u4E2D\u4FEE\u6B63","nav.overview":"\u603B\u89C8","nav.sessions":"\u4F1A\u8BDD","nav.config":"\u914D\u7F6E","nav.connect":"\u63A5\u5165","nav.logs":"\u65E5\u5FD7","logs.title":"\u8FD0\u884C\u65E5\u5FD7","logs.sub":"bili.log \u5B9E\u65F6\u5C3E\u90E8 \xB7 \u6309\u4F1A\u8BDD ID \u6216\u5173\u952E\u5B57\u8FC7\u6EE4\uFF0C\u652F\u6301\u4E0A\u4E0B\u6587\u5C55\u5F00\u4E0E\u65F6\u95F4\u7A97","logs.filter_ph":"\u8FC7\u6EE4\uFF08\u5982\u4F1A\u8BDD ID \u6216\u5173\u952E\u5B57\uFF09","logs.count":"\u663E\u793A\u6700\u8FD1 {n} \u884C\uFF08\u5339\u914D\u5171 {total} \u884C\uFF09","logs.omitted":" \xB7 \u66F4\u65E9 {o} \u884C\u5DF2\u622A\u65AD\uFF08\u8C03\u5927\u884C\u6570\u4E0A\u9650\u53EF\u770B\u66F4\u591A\uFF09","logs.ctx":"\u4E0A\u4E0B\u6587 \xB13 \u884C","logs.win":"\u65F6\u95F4\u7A97 \xB12 \u5206\u949F","logs.empty":"\u6CA1\u6709\u5339\u914D\u7684\u884C\uFF08\u65E5\u5FD7\u6587\u4EF6\u53EF\u80FD\u5C1A\u672A\u521B\u5EFA\uFF09","logs.path":"\u65E5\u5FD7\u6587\u4EF6","logs.dl":"\u4E0B\u8F7D\u5F53\u524D\u89C6\u56FE (.txt)","logs.dl_all":"\u4E0B\u8F7D\u5B8C\u6574\u65E5\u5FD7 (.txt)","det.log":"\u65E5\u5FD7","det.log_view":"\u67E5\u770B\u8BE5\u4F1A\u8BDD\u7684\u65E5\u5FD7 \u25B8","fork.label":"\u2605 Fork me on GitHub","common.loading":"\u52A0\u8F7D\u4E2D\u2026","common.empty":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.back":"\u2190 \u8FD4\u56DE\u4F1A\u8BDD\u5217\u8868","common.live":"\u8FD0\u884C\u4E2D","common.sessions":"\u4F1A\u8BDD","common.copied_hint":"\u5DF2\u590D\u5236 \u2713","ses.badge_live_tip":"\u5F53\u524D\u8FDB\u7A0B\u6B63\u5728\u5904\u7406\u7684\u4F1A\u8BDD\uFF08\u5B9E\u65F6\u6570\u636E\uFF09","common.requests":"\u8BF7\u6C42","common.saved":"\u8282\u7701","common.context":"\u4E0A\u4E0B\u6587","common.ctx_est":"\u4F30\u7B97","common.ctx_meas":"\u5B9E\u6D4B","common.ctx_est_calib":"\u4F30\u7B97\xB7\u5DF2\u6821\u51C6","common.ctx_est_raw":"\u4F30\u7B97\xB7\u672A\u6821\u51C6","common.ctx_upper":"\u4F30\u7B97\xB7\u4E0A\u754C","common.window":"\u7A97\u53E3","common.title":"\u6807\u9898","common.protocol":"\u534F\u8BAE","common.upstream":"\u4E0A\u6E38","common.label":"\u6807\u7B7E","common.none":"\u2014","protocol.unmarked":"\u672A\u6807\u8BB0\uFF08\u65E7\u7248\u672C\u4F1A\u8BDD\uFF09","ses.no_title":"\u65E0\u6807\u9898","ov.title":"\u603B\u89C8","ov.sub":"\u5168\u5C40\u7EDF\u8BA1\uFF1A\u8986\u76D6\u5185\u5B58\u4E0E\u78C1\u76D8\u4E0A\u7684\u6240\u6709\u4F1A\u8BDD","ov.total_sessions":"\u4F1A\u8BDD\u603B\u6570","ov.live_now":"\u5F53\u524D\u8FD0\u884C\u4E2D","ov.hist":"\u5386\u53F2","ov.saved_from_legacy":"\u5176\u4E2D {n} \u4E3A\u65E7\u7248\u672C\u4F1A\u8BDD\u7684\u672C\u5730\u4F30\u7B97","ov.total_requests":"\u8BF7\u6C42\u603B\u6570","ov.tokens_saved":"\u538B\u7F29\u8282\u7701","ov.gross_saved":"\u538B\u7F29\u7D2F\u8BA1\u8282\u7701","ov.net_saved":"\u51C0\u8282\u7701","ov.sub_repay":"\u5DF2\u6263\u9664\u538B\u7F29\u590D\u4ED8 {r} \u4E0E\u6458\u8981\u6210\u672C {s}","ov.covlost_note":"\u5176\u4E2D {n} \u4E2A\u6298\u53E0\u8986\u76D6\u4E22\u5931\uFF0C\u51BB\u7ED3 {x}","det.covlost_sub":"\u5176\u4E2D {n} \u4E2A\u6298\u53E0\u8986\u76D6\u4E22\u5931\uFF08\u51BB\u7ED3 {x}\uFF09\uFF1A\u5176\u8986\u76D6\u7684\u539F\u59CB\u6D88\u606F\u5DF2\u79BB\u5F00\u91CD\u53D1\u5386\u53F2\uFF0C\u8282\u7701\u7D2F\u8BA1\u5DF2\u505C\u6B62","ses.covlost_tip":"{n} \u4E2A\u6298\u53E0\u8986\u76D6\u4E22\u5931\uFF08\u51BB\u7ED3 {x}\uFF09\uFF1A\u5BBF\u4E3B\u5728 bili \u4E0D\u77E5\u60C5\u4E0B\u79FB\u9664\u4E86\u88AB\u538B\u7F29\u7684\u539F\u59CB\u6D88\u606F\uFF08\u5982 dsh \u539F\u751F\u538B\u7F29\uFF09\uFF0C\u5BF9\u5E94\u8282\u7701\u5DF2\u505C\u6B62\u7D2F\u8BA1","ov.miss_split":"\u672A\u547D\u4E2D\u6784\u6210\uFF08\u6709\u8D26\u672C\u4F1A\u8BDD\uFF09\uFF1A\u65B0\u589E\u5185\u5BB9 {n} \xB7 \u538B\u7F29\u6298\u635F {c} \xB7 TTL\u8FC7\u671F\u7B49\u524D\u7F00\u5931\u6548 {x}","det.hit_pct":"\u7F13\u5B58\u547D\u4E2D\u7387","ses.drop_ph":"\u547D\u4E2D\u7387\u4EE3\u4EF7\uFF08\u5360\u603B\u8F93\u5165\u7684\u767E\u5206\u6BD4\uFF0C\u987A\u5E8F\uFF1A\u65B0\u589E / \u538B\u7F29 / TTL\u8FC7\u671F\uFF09","ses.empty_hidden":"\u53E6\u6709 {n} \u4E2A\u7A7A\u4F1A\u8BDD\u5DF2\u9690\u85CF\uFF08\u65E0\u8BF7\u6C42\u3001\u65E0\u4E0A\u4E0B\u6587\u3001\u65E0\u8D26\u672C\uFF1B\u76F4\u63A5\u94FE\u63A5\u4ECD\u53EF\u8BBF\u95EE\uFF09","det.miss_split_line":"\u547D\u4E2D\u7387\u7684\u672A\u547D\u4E2D\u90E8\u5206\u62C6\u5206\uFF1A\u65B0\u589E\u5185\u5BB9 {n}\uFF08\u2212{pn}%\uFF09\xB7 \u538B\u7F29\u6298\u635F {c}\uFF08\u2212{pc}%\uFF09\xB7 TTL\u8FC7\u671F\u7B49\u524D\u7F00\u5931\u6548 {x}\uFF08\u2212{px}%\uFF09","det.miss_sub":"TTL\u8FC7\u671F \u2212{x}% \xB7 \u538B\u7F29 \u2212{c}% \xB7 \u65B0\u589E \u2212{n}%","det.fold_time":"\u65F6\u95F4","ov.global_hitpct":"\u5168\u5C40\u7F13\u5B58\u547D\u4E2D\u7387","ov.input_tokens":"\u8F93\u5165 token","ov.cached_tokens":"\u7F13\u5B58\u547D\u4E2D token","ov.output_tokens":"\u8F93\u51FA token","ov.by_protocol":"\u6309\u534F\u8BAE\u5206\u5E03","ov.recent":"\u6700\u8FD1\u6D3B\u8DC3\u4F1A\u8BDD","ov.view_all":"\u67E5\u770B\u5168\u90E8 \u2192","sys.title":"\u7CFB\u7EDF\u72B6\u6001","sys.version":"\u7248\u672C","sys.disk_version":"\u78C1\u76D8\u7248\u672C","sys.inflight":"\u8FDB\u884C\u4E2D\u8BF7\u6C42","sys.blind_tunnels":"MITM \u76F2\u96A7\u9053\uFF08CONNECT \u540E\u65E0 TLS\uFF09","sys.stale":"\u78C1\u76D8\u5DF2\u6709\u65B0\u7248\u672C v{disk} \u2014\u2014 \u91CD\u542F bili \u751F\u6548\uFF08\u5F53\u524D\u8FD0\u884C v{running}\uFF09","sys.stale_auto":"\u81EA\u52A8\u91CD\u542F\u5DF2\u542F\u7528\uFF0C\u7A7A\u95F2\u65F6\u81EA\u52A8\u5207\u6362","sys.stale_manual":"\u81EA\u52A8\u91CD\u542F\u672A\u542F\u7528\uFF08\u9700\u8981 --auto-restart-on-update\uFF09","sys.pt_on":"Passthrough \u5DF2\u5F00\u542F\uFF1A\u6240\u6709\u8BF7\u6C42\u539F\u6837\u8F6C\u53D1\uFF0C\u538B\u7F29\u5173\u95ED\u3002\u6765\u6E90\uFF1A","sys.pt_env":"ACP_PASSTHROUGH \u73AF\u5883\u53D8\u91CF\uFF08\u6216 --passthrough \u53C2\u6570\uFF09","sys.pt_file":"\u914D\u7F6E\u6587\u4EF6 passthrough: true","conflict.on":"\u68C0\u6D4B\u5230\u538B\u7F29\u51B2\u7A81","conflict.found":"\uFF1A\u53D1\u73B0","conflict.what_plugin":"\u4E0E bili \u5E76\u5B58\u7684\u7B2C\u4E09\u65B9\u538B\u7F29\u63D2\u4EF6","conflict.what_native":"\u5BA2\u6237\u7AEF\u539F\u751F\u81EA\u52A8\u538B\u7F29\u6539\u5199\u4F1A\u8BDD\u5386\u53F2","conflict.what_join":"\u3001","conflict.risk_active":"\u7684\u75D5\u8FF9\u3002\u4E24\u4E2A\u538B\u7F29\u5668\u4F5C\u7528\u4E8E\u540C\u4E00\u4F1A\u8BDD\u4F1A\u53CC\u538B\u7F29\u3001\u7834\u574F\u6D88\u606F\u5F15\u7528\uFF0C\u53EF\u80FD\u5BFC\u81F4\u4E0A\u4E0B\u6587\u9519\u4E71\u2014\u2014\u8BF7\u53EA\u4FDD\u7559\u4E00\u4E2A\u538B\u7F29\u5668\u3002","conflict.risk_sibling":"\u7684\u75D5\u8FF9\u3002\u5B83\u4EEC\u662F bili \u81EA\u5BB6\u7684\u5144\u5F1F\u6269\u5C55\uFF0C\u4E0D\u662F\u7B2C\u4E09\u65B9\u538B\u7F29\u63D2\u4EF6\uFF1A\u5F53 bili \u4E3B\u5BFC\u4F1A\u8BDD\u65F6\u4F1A\u81EA\u52A8\u8BA9\u4F4D\uFF08native \u6A21\u5F0F\u7ECF BILLION_CONTEXT_NATIVE \u6807\u8BB0\u3001launcher/\u624B\u52A8\u63A5\u7EBF\u7ECF /bili/ baseUrl \u81EA\u68C0\uFF09\uFF0C\u6CA1\u6709\u7B2C\u4E8C\u4E2A\u538B\u7F29\u5668\u5728\u6D3B\u52A8\u2014\u2014\u786E\u8BA4\u7248\u672C\u8F83\u65B0\u540E\u6E05\u9664\u672C\u8BB0\u5F55\u5373\u53EF\uFF0C\u65E0\u9700\u79FB\u9664\u4EFB\u4F55\u63D2\u4EF6\u3002","conflict.risk_historical":"\u7684\u75D5\u8FF9\uFF08\u6700\u8FD1 7 \u5929\u65E0\u65B0\u4E8B\u4EF6\uFF0C\u4EE5\u4E0B\u4E3A\u5B58\u91CF\u8BB0\u5F55\uFF09\u2014\u2014\u786E\u8BA4\u53E6\u4E00\u4E2A\u538B\u7F29\u5668\u5DF2\u79FB\u9664\u6216\u88AB bili \u62E6\u622A\u540E\uFF0C\u53EF\u70B9\u53F3\u4FA7\u6309\u94AE\u6E05\u9664\u3002","conflict.on_suspected":"\u68C0\u6D4B\u5230\u7591\u4F3C\u538B\u7F29\u63D2\u4EF6","conflict.what_suspected":"\u540D\u79F0\u542B\u538B\u7F29\u5173\u952E\u8BCD\u7684\u63D2\u4EF6\uFF08\u5C1A\u672A\u786E\u8BA4\u5176\u662F\u5426\u771F\u7684\u538B\u7F29\u4E0A\u4E0B\u6587\uFF09","conflict.risk_suspected":"\u2014\u2014\u8FD9\u4EC5\u662F\u6309\u540D\u79F0\u5173\u952E\u8BCD\u5339\u914D\u7684\u3010\u7591\u4F3C\u3011\u4FE1\u53F7\uFF0C\u4E0D\u662F\u5DF2\u89C2\u5BDF\u5230\u7684\u53CC\u538B\u7F29\u8BC1\u636E\u3002\u8BF7\u786E\u8BA4\u5176\u662F\u5426\u771F\u7684\u6539\u5199\u53D1\u7ED9\u6A21\u578B\u7684\u4E0A\u4E0B\u6587\uFF1B\u53EA\u6539\u7EC8\u7AEF\u663E\u793A / \u6298\u53E0\u5DE5\u5177\u8F93\u51FA\u7684\u63D2\u4EF6\uFF08\u5982 pi-compact-transcript\uFF09\u4E0D\u4F1A\u53CC\u538B\u7F29\u3001\u65E0\u9700\u79FB\u9664\u3002","conflict.on_unconfirmed":"\u68C0\u6D4B\u5230\u672A\u786E\u8BA4\u7684\u538B\u7F29\u76F8\u5173\u4FE1\u53F7","conflict.what_signal":"\u4F1A\u8BDD\u5386\u53F2\u88AB\u6539\u5199\u7684\u75D5\u8FF9\uFF08\u89C2\u5BDF\u5230\u53D8\u5316\uFF0C\u539F\u56E0\u672A\u786E\u8BA4\uFF09","conflict.risk_unconfirmed":"\u3002\u8FD9\u4E9B\u53EA\u662F\u3010\u672A\u786E\u8BA4\u3011\u4FE1\u53F7\uFF0C\u4E0D\u80FD\u8BC1\u660E\u5B58\u5728\u7B2C\u4E8C\u4E2A\u538B\u7F29\u5668\u2014\u2014\u539F\u56E0\u53EF\u80FD\u662F\u5BA2\u6237\u7AEF\u81EA\u8EAB\u6539\u52A8\u3001\u672A\u88AB\u8BC6\u522B\u7684\u538B\u7F29\u5F62\u6001\u6216\u5176\u4ED6\u63D2\u4EF6\u3002\u8BF7\u6838\u5B9E\u540E\u518D\u884C\u52A8\uFF1B\u53EA\u8BFB\u4E0A\u4E0B\u6587\u67E5\u770B\u5668\u3001\u4EC5\u6539\u7EC8\u7AEF\u663E\u793A/\u6298\u53E0\u5DE5\u5177\u8F93\u51FA\u7684\u63D2\u4EF6\u4E0D\u662F\u538B\u7F29\u5668\uFF0C\u65E0\u9700\u79FB\u9664\u3002","conflict.age_active":"\u8FD1 7 \u5929 {n} \u6761","conflict.age_historical":"\u66F4\u65E9 {n} \u6761","conflict.where":"\u8BE6\u60C5\u89C1\u4E0B\u65B9 Sessions \u9875\u6216 GET /__bili/stats \u2192 conflicts\u3002","conflict.clear_btn":"\u6E05\u9664\u8BB0\u5F55","conflict.cleared":"\u51B2\u7A81\u8BB0\u5F55\u5DF2\u6E05\u9664","conflict.hint_label":"\u5904\u7F6E\u65B9\u6CD5\uFF08\u6309\u5BA2\u6237\u7AEF\uFF09\uFF1A","conflict.hint.opencode":'opencode\uFF1A\u5728 opencode \u914D\u7F6E\u91CC\u8BBE "compaction": { "auto": false }\uFF0C\u6216\u7528 bili opencode / bili plugin install opencode\uFF08\u4F1A\u81EA\u52A8\u8BBE\u7F6E\uFF09',"conflict.hint.claude":"claude\uFF1A\u7528 bili claude \u542F\u52A8\uFF08\u81EA\u52A8\u5BF9\u9F50 CLAUDE_CODE_AUTO_COMPACT_WINDOW\uFF09\uFF0C\u6216\u81EA\u884C\u628A CLAUDE_CODE_AUTO_COMPACT_WINDOW \u8BBE\u4E3A bili \u7684\u6709\u6548\u7A97\u53E3","conflict.hint.codex":"codex\uFF1Abili \u9ED8\u8BA4\u62E6\u622A\u539F\u751F\u538B\u7F29\uFF08BILI_CODEX_COMPACT=intercept\uFF09\u2014\u2014\u82E5\u4F60\u8BBE\u4E86 pass\uFF0C\u53BB\u6389\u8BE5\u8986\u76D6\u5373\u53EF\uFF1B\u5426\u5219\u8BF7\u62A5\u544A\u4F60\u7684 bili \u7248\u672C","conflict.hint.pi":"pi\uFF1Abili \u6269\u5C55\u5728\u63A5\u7BA1\u4F1A\u8BDD\u65F6\u4F1A\u81EA\u52A8\u53D6\u6D88\u5BA2\u6237\u7AEF\u539F\u751F\u81EA\u52A8\u538B\u7F29\u2014\u2014\u4ECD\u51FA\u73B0\u8BF4\u660E\u7F3A\u5C11\u63A5\u7BA1\u8BC1\u636E\u6216\u7248\u672C\u8FC7\u65E7\uFF0C\u8BF7\u62A5\u544A\u5BA2\u6237\u7AEF\u4E0E bili \u7248\u672C","conflict.hint.omp":"omp\uFF1Abili \u6269\u5C55\u5728\u63A5\u7BA1\u4F1A\u8BDD\u65F6\u4F1A\u81EA\u52A8\u53D6\u6D88\u5BA2\u6237\u7AEF\u539F\u751F\u81EA\u52A8\u538B\u7F29\u2014\u2014\u4ECD\u51FA\u73B0\u8BF4\u660E\u7F3A\u5C11\u63A5\u7BA1\u8BC1\u636E\u6216\u7248\u672C\u8FC7\u65E7\uFF0C\u8BF7\u62A5\u544A\u5BA2\u6237\u7AEF\u4E0E bili \u7248\u672C","conflict.hint.generic":"\u5173\u95ED\u5BA2\u6237\u7AEF\u81EA\u8EAB\u7684\u81EA\u52A8\u538B\u7F29\uFF08\u6216\u8BA9\u672C\u4F1A\u8BDD\u7ED5\u8FC7 bili\uFF09\uFF0C\u7136\u540E\u5F00\u65B0\u4F1A\u8BDD\u2014\u2014\u53F0\u8D26\u6309\u4F1A\u8BDD\u9694\u79BB\uFF0C\u65E7\u8BB0\u5F55\u968F\u65E7\u4F1A\u8BDD\u6D88\u5931","conflict.hint_more":"\u53E6\u6709 {n} \u4E2A\u5BA2\u6237\u7AEF\uFF0C\u8BE6\u89C1\u4E0B\u65B9 Sessions \u9875","conflict.docs":"\u5B8C\u6574\u77E9\u9635\uFF1ACONFIGURATION.md\u300CDetecting other compression plugins (#1206)\u300D","advisory.on":"\u4E25\u91CD\u7F3A\u9677\u516C\u544A","advisory.desc":"\uFF1A\u5F53\u524D\u7248\u672C\u5B58\u5728\u91CD\u5927\u7F3A\u9677\uFF0Cbili \u6B63\u5728\u81EA\u52A8\u5347\u7EA7\u5230\u5B89\u5168\u7248\u672C\u3002\u539F\u56E0\uFF1A","advisory.hint":"\u3002\u82E5\u672A\u81EA\u52A8\u5B8C\u6210\uFF0C\u8BF7\u624B\u52A8\u6267\u884C\uFF1A","alert.title":"\u4E0A\u6E38\u8FDE\u63A5\u5F02\u5E38","alert.item":"\u65E0\u6CD5\u8FDE\u63A5 {host}\uFF08{kind} \xD7{count}\uFF0C\u9996\u6B21 {first}\uFF09\u2014 {hint}","alert.dismiss":"\u77E5\u9053\u4E86","alert.hint.connect_timeout":"TCP \u63E1\u624B\u672A\u5B8C\u6210\u2014\u2014\u4E0A\u6E38/\u4EE3\u7406\u4E0D\u53EF\u8FBE\u6216\u88AB\u9ED1\u6D1E\uFF08\u4E22\u5305\uFF09\uFF1B\u53EF\u80FD\u5DF2\u6309 BILI_REPLAY_RETRY_MAX \u505A\u6709\u754C\u900F\u660E\u91CD\u653E","alert.hint.connect_refused":"TCP \u88AB\u62D2\u7EDD\uFF08\u914D\u7F6E\u4E86\u4EE3\u7406\u5219\u6307\u4EE3\u7406\uFF0C\u5426\u5219\u6307\u4E0A\u6E38\uFF09\u2014\u2014\u7AEF\u70B9\u672A\u542F\u52A8\u6216\u7AEF\u53E3\u9519\u8BEF","alert.hint.proxy_reset":"\u4EE3\u7406\u5728\u54CD\u5E94\u5F00\u59CB\u524D\u65AD\u5F00\u8FDE\u63A5\u2014\u2014\u68C0\u67E5\u4EE3\u7406\u7A7A\u95F2\u56DE\u6536/\u8F7D\u8377\u4E0A\u9650\uFF08BILI_PROXY_KEEPALIVE_MAX_MS \u53EF\u7F29\u77ED\u590D\u7528\u7A97\u53E3\uFF09\uFF1B\u53EF\u80FD\u5DF2\u6309 BILI_REPLAY_RETRY_MAX \u505A\u6709\u754C\u900F\u660E\u91CD\u653E","alert.hint.upstream_reset":"\u4E0A\u6E38/\u7F51\u7EDC\u5728\u54CD\u5E94\u5F00\u59CB\u524D\u91CD\u7F6E\u8FDE\u63A5\u2014\u2014\u68C0\u67E5\u4E0A\u6E38\u4E0E\u672C\u5730\u7F51\u7EDC\uFF1B\u53EF\u80FD\u5DF2\u6309 BILI_REPLAY_RETRY_MAX \u505A\u6709\u754C\u900F\u660E\u91CD\u653E","alert.hint.dns":"\u57DF\u540D\u89E3\u6790\u5931\u8D25\u2014\u2014DNS \u670D\u52A1\u5668\u6216\u4E3B\u673A\u540D\u62FC\u5199\u9519\u8BEF\uFF1B\u53EF\u80FD\u5DF2\u6309 BILI_REPLAY_RETRY_MAX \u505A\u6709\u754C\u900F\u660E\u91CD\u653E","alert.hint.tls":"CONNECT \u6216\u4E0A\u6E38\u63E1\u624B\u65F6 TLS/\u8BC1\u4E66\u5931\u8D25\u2014\u2014\u68C0\u67E5 CA/\u4EE3\u7406 MITM \u914D\u7F6E","alert.hint.unknown":"\u672A\u5206\u7C7B\u7684\u4F20\u8F93\u5C42\u6545\u969C\u2014\u2014\u8BF7\u9644\u5B8C\u6574\u9519\u8BEF\u94FE\u53CD\u9988","advisory.restartDesc":"\uFF1A\u5B89\u5168\u7248\u672C\u5DF2\u5B89\u88C5\u5230\u78C1\u76D8\uFF0C\u4F46\u5F53\u524D\u8FDB\u7A0B\u4ECD\u5728\u8FD0\u884C\u53D7\u5F71\u54CD\u7248\u672C\u3002\u539F\u56E0\uFF1A","advisory.restartHint":"\u3002\u91CD\u542F bili \u540E\u751F\u6548\u3002","pluginadv.on":"\u68C0\u6D4B\u5230\u9AD8\u6210\u672C\u63D2\u4EF6","pluginadv.desc":"\u8BE5\u63D2\u4EF6\u4F1A\u5728\u6BCF\u6B21\u5DE5\u5177\u8C03\u7528\u524D\u628A\u6574\u6BB5\u4F1A\u8BDD\u91CD\u65B0\u53D1\u9001\u7ED9\u6A21\u578B\u505A\u5BA1\u67E5\uFF0C\u5BFC\u81F4\u4E0A\u6E38\u524D\u7F00\u7F13\u5B58\u51E0\u4E4E\u65E0\u6CD5\u590D\u7528\uFF08\u7F13\u5B58\u547D\u4E2D\u7387\u5E38\u53EA\u6709\u4E2A\u4F4D\u6570\u767E\u5206\u6BD4\uFF09\uFF0C\u663E\u8457\u589E\u52A0 token \u6210\u672C\u3002\u8FD9\u4E0E bili \u7684\u538B\u7F29\u65E0\u5173\u2014\u2014bili \u5DF2\u628A\u5B83\u9694\u79BB\u5230\u72EC\u7ACB\u5B50\u4F1A\u8BDD\uFF0C\u4E3B\u4F1A\u8BDD\u7684\u524D\u7F00\u7F13\u5B58\u4E0D\u53D7\u5F71\u54CD\u3002","pluginadv.hint":"\u5EFA\u8BAE\u5173\u95ED\u8BE5\u63D2\u4EF6\u6216\u8054\u7CFB\u5176\u5B98\u65B9\u4F18\u5316\uFF1B\u8BE6\u60C5\u89C1\u4E0A\u65B9\u94FE\u63A5\uFF08\u672C issue\uFF09\u3002","ses.title":"\u4F1A\u8BDD","ses.sub":"\u8986\u76D6\u5185\u5B58\u4E0E\u78C1\u76D8\u7684\u5168\u90E8\u4F1A\u8BDD \xB7 \u70B9\u51FB\u884C\u67E5\u770B\u8BE6\u60C5\u3001\u8F68\u8FF9\u4E0E\u4EA4\u63A5\u6587\u6863","ses.search_ph":"\u641C\u7D22\u6807\u9898\u3001\u6807\u7B7E\u6216 id\u2026","ses.th_title":"\u4F1A\u8BDD","ses.th_proto":"\u534F\u8BAE","ses.th_upstream":"\u4E0A\u6E38","ses.th_reqs":"\u8BF7\u6C42","ses.th_ctx":"\u5F53\u524D\u4E0A\u4E0B\u6587","ses.th_saved":"\u8282\u7701","ses.th_hit":"\u547D\u4E2D\u7387","ses.th_switches":"\u6A21\u578B\u5207\u6362","ses.th_switches_tip":"\u4F1A\u8BDD\u4E2D\u9014\u5207\u6362\u6A21\u578B\u7684\u6B21\u6570 \xB7 \u56E0\u65B0\u6A21\u578B\u524D\u7F00\u7F13\u5B58\u5168\u51B7\u3001\u7A33\u5B9A\u524D\u7F00\u91CD\u65B0\u8BA1\u8D39\u800C\u6389\u7684 token\uFF08#1535\uFF09\xB7 \u{1F511}\uFF1D\u4E2D\u8F6C\u7AD9\u5BC6\u94A5/\u8D26\u53F7\u8F6E\u6362\u6B21\u6570\uFF08\u51ED\u8BC1\u6307\u7EB9\u53D8\u5316\uFF0C#2131\uFF09\xB7 \u270D\uFE0F\uFF1D\u5BBF\u4E3B\u6539\u5199\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6B21\u6570\uFF08\u63D0\u793A\u8BCD\u6307\u7EB9\u53D8\u5316\uFF0C#2350\uFF09","ses.th_keyswitches_tip":"\u4E2D\u8F6C\u7AD9\u5BC6\u94A5/\u8D26\u53F7\u8F6E\u6362\uFF08\u51ED\u8BC1\u6307\u7EB9\u53D8\u5316\uFF0C\u540C\u4E00 URL \u80CC\u540E\u6362\u4E86 key\uFF09\xB7 \u8F6E\u6362\u540E\u8BE5\u8D26\u53F7\u524D\u7F00\u7F13\u5B58\u5168\u51B7\u3001\u7A33\u5B9A\u524D\u7F00\u91CD\u65B0\u8BA1\u8D39\u7684 token\uFF08#2131\uFF09","ses.th_promptswitches_tip":"\u5BBF\u4E3B\u6539\u5199\u4E86\u7CFB\u7EDF\u63D0\u793A\u8BCD\uFF08\u63D0\u793A\u8BCD\u6307\u7EB9\u53D8\u5316\uFF0C\u5982\u5BBF\u4E3B\u5468\u671F\u6027\u63D2\u5165/\u79FB\u9664\u52A8\u6001\u6BB5\uFF09\xB7 \u6BCF\u6B21\u6539\u5199\u4F7F\u4E0B\u6E38\u524D\u7F00\u7F13\u5B58\u5168\u90E8\u5931\u6548\u3001\u7A33\u5B9A\u524D\u7F00\u91CD\u65B0\u8BA1\u8D39\u7684 token\uFF08#2350\uFF09","det.key_events":"\u5BC6\u94A5\u5207\u6362\u4E8B\u4EF6\uFF08{n}\uFF09","det.key_events_tip":"\u51ED\u8BC1\u6307\u7EB9\u53D8\u5316\uFF1D\u4E2D\u8F6C\u7AD9\u6362\u4E86\u8D26\u53F7\uFF1B\u6307\u7EB9\u662F sha256 \u524D 12 \u4F4D\uFF0C\u4E0D\u542B\u539F\u59CB\u5BC6\u94A5","det.key_fp":"\u51ED\u8BC1\u6307\u7EB9","det.prompt_events":"\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6539\u5199\u4E8B\u4EF6\uFF08{n}\uFF09","det.prompt_events_tip":"\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6307\u7EB9\u53D8\u5316\uFF1D\u5BBF\u4E3B\u5728\u4E24\u6B21\u8BF7\u6C42\u4E4B\u95F4\u6539\u5199\u4E86\u7CFB\u7EDF\u63D0\u793A\u8BCD\uFF1B\u6307\u7EB9\u662F sha256 \u524D 16 \u4F4D\uFF0C\u4E0D\u542B\u539F\u6587","det.prompt_fp":"\u63D0\u793A\u8BCD\u6307\u7EB9","ses.th_blocks":"\u5757","ses.th_seen":"\u6700\u8FD1\u6D3B\u52A8","ses.th_client":"\u5BA2\u6237\u7AEF","ses.th_input":"\u7D2F\u8BA1\u8F93\u5165","ses.th_folds":"\u538B\u7F29\u6B21\u6570","ses.empty":"\u8FD8\u6CA1\u6709\u4F1A\u8BDD","ses.empty_hint":"\u901A\u8FC7 bili \u4EE3\u7406\u7684\u7B2C\u4E00\u4E2A\u8BF7\u6C42\u4F1A\u81EA\u52A8\u521B\u5EFA\u4F1A\u8BDD","ses.count":"{count} \u4E2A\u4F1A\u8BDD","ses.refresh":"\u5237\u65B0","ses.load_more":"\u52A0\u8F7D\u66F4\u591A","data.error":"\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF1A{msg} \xB7 \u5DF2\u81EA\u52A8\u9000\u907F\u91CD\u8BD5","data.generic":"\u7F51\u7EDC\u9519\u8BEF\u6216\u8BF7\u6C42\u8D85\u65F6","data.timeout":"\u8BF7\u6C42\u8D85\u65F6\uFF0820s\uFF09","det.identity":"\u57FA\u672C\u4FE1\u606F","det.version":"\u4EE3\u7406\u7248\u672C","det.active_pack":"\u538B\u7F29\u63D0\u793A\u5305","det.conflicts_title":"\u538B\u7F29\u51B2\u7A81\u8BB0\u5F55","det.conflicts_hint":"\u5176\u4ED6\u538B\u7F29\u5668\u89E6\u78B0\u672C\u4F1A\u8BDD\u7684\u8BC1\u636E\uFF08\u8BCA\u65AD\u7528\uFF0C\u975E\u5386\u53F2\uFF09","det.conflicts_more":"\u66F4\u65E9\u7684 {n} \u6761\u2026","det.conflicts_clear":"\u6E05\u9664\u672C\u4F1A\u8BDD\u8BB0\u5F55","det.conflicts_cleared":"\u5DF2\u6E05\u9664","det.usage":"\u7528\u91CF\u7EDF\u8BA1","det.last_input":"\u6700\u8FD1\u5355\u6B21\u8F93\u5165","det.upper_bound":"\u4FDD\u5B88\u4E0A\u754C {v}\uFF08\u5B57\u7B26\u6570\u4E0A\u754C\uFF0C\u53EA\u7528\u4E8E\u5B89\u5168\u4FDD\u62A4\uFF0C\u4E0D\u4EE3\u8868\u5B9E\u9645\u7528\u91CF\uFF09","det.calib_chip":"k\u0302={k} \xB7 {n}\u6837\u672C \xB7 \u6781\u5DEE{spread}\xD7 \xB7 {origin}","det.calib_tip":"\u6821\u51C6\u7CFB\u6570 k\u0302\uFF1A\u672C\u8DEF\u7531+\u6A21\u578B\u4E0B\u6700\u8FD1 {n} \u4E2A\u4E00\u81F4\u6837\u672C\uFF08\u6781\u5DEE {spread}\xD7\uFF09\u7684\u5747\u503C\uFF0C\u53EA\u5411\u4E0B\u4FEE\u6B63\u4F30\u7B97\uFF1B\u8DEF\u7531\u6216\u6A21\u578B\u53D8\u5316\u540E\u91CD\u65B0\u5B66\u4E60\u3002\u6765\u6E90 {origin}{model}\u3002","det.ccr":"CCR \u5185\u5BB9\u68C0\u7D22","det.ccr_detail":"{calls} \u6B21\u8C03\u7528 \xB7 {hits} \u547D\u4E2D \xB7 {misses} \u672A\u4E2D","det.store":"\u5185\u5BB9\u5B58\u50A8","det.trajectory":"\u4E0A\u4E0B\u6587\u8F68\u8FF9","det.trajectory_sub":"\u6BCF\u6B21\u8BF7\u6C42\u7684\u8F93\u5165 token \u4E0E\u7F13\u5B58\u547D\u4E2D\uFF1B\u7EA2\u8272\u7AD6\u7EBF\u4E3A\u538B\u7F29\u6298\u53E0\u70B9","det.trajectory_empty":"\u8BE5\u4F1A\u8BDD\u8FD8\u6CA1\u6709\u7528\u91CF\u91C7\u6837","det.legend_input":"\u8F93\u5165","det.legend_cached":"\u5176\u4E2D\u7F13\u5B58\u547D\u4E2D","det.legend_fold":"\u538B\u7F29\u6298\u53E0\u70B9","det.legend_window":"\u4E0A\u4E0B\u6587\u7A97\u53E3\u4E0A\u9650","det.cause_cold":"\u51B7\u542F\u52A8\uFF08\u65E0\u5386\u53F2\u7F13\u5B58\uFF09","det.cause_comp":"\u538B\u7F29\u540E\u91CD\u65B0\u5EFA\u7F13\u5B58","det.cause_ttl":"\u95F4\u9694\u8FC7\u957F \xB7 \u4E0A\u6E38 TTL \u8FC7\u671F\u91CD\u8BFB","det.fold_short":"\u6298\u53E0","ov.gross_note":"\u6309\u6BCF\u6B21\u6298\u53E0\u7684\u8282\u7701\u91CF \xD7 \u5176\u540E\u6BCF\u4E2A\u8BF7\u6C42\u7D2F\u8BA1\uFF08\u7406\u8BBA\u4E0A\u754C\uFF09","ov.net_excl":"\u672A\u542B\u65E7\u7248\u672C\u65E0\u91C7\u6837\u4F1A\u8BDD","det.omitted":"\u66F4\u65E9\u7684 {n} \u6761\u91C7\u6837\u5DF2\u88C1\u9664\uFF1A\u6BCF\u4E2A\u4F1A\u8BDD\u53EA\u4FDD\u7559\u6700\u8FD1 4096 \u6761\u7F13\u5B58\u91C7\u6837\uFF0C\u8D85\u51FA\u90E8\u5206\u5728\u5199\u5165\u65F6\u88C1\u526A\u3001\u4E0D\u53EF\u6062\u590D\uFF0C\u6240\u4EE5\u66F2\u7EBF\u4ECE\u6700\u65E9\u4FDD\u7559\u7684\u4E00\u6761\u5F00\u59CB","ov.saved_neg_tip":"\u51C0\u8282\u7701\u4E3A\u8D1F\uFF1A\u538B\u7F29\u590D\u4ED8\uFF08\u6458\u8981\u590D\u8BFB\u6210\u672C\uFF09\u8D85\u8FC7\u4E86\u7406\u8BBA\u8282\u7701\u2014\u2014\u5E38\u89C1\u4E8E\u6298\u53E0\u540E\u5F88\u5FEB\u7ED3\u675F\u7684\u77ED\u4F1A\u8BDD\uFF0C\u8FD9\u4E9B\u573A\u666F\u4E0B\u538B\u7F29\u4E0D\u5212\u7B97","det.cache_econ":"\u7F13\u5B58\u7ECF\u6D4E\u5B66","det.ce_new":"\u65B0\u5185\u5BB9","det.ce_comp":"\u538B\u7F29\u56DE\u8865","det.ce_ttl":"TTL \u56DE\u8865","det.ce_residual":"\u6B8B\u5DEE","det.ce_balanced":"\u8D26\u76EE\u5E73\u8861 \u2713","det.ce_unbalanced":"\u8D26\u76EE\u4E0D\u5E73\u8861 \u2717","det.attr_title":"\u5F52\u56E0 \xB7 \u672A\u89E3\u91CA\u6B8B\u5DEE","det.attr_seam":"\u26A0 \u7F13\u5B58\u63A5\u7F1D","det.attr_provider":"\u25B2 \u4E0A\u6E38\u4FA7\u5931\u6548","det.attr_rewind":"\u21A9 \u5386\u53F2\u56DE\u9000","det.attr_abort":"\u23FB \u4E2D\u65AD\u76F8\u5173","det.attr_seam_tip":"\u51FA\u7AD9\u8BF7\u6C42\u4F53\u5728\u5386\u53F2\u4E2D\u6BB5\u51FA\u73B0\u5B57\u8282\u5206\u53C9\uFF0C\u4E14\u65E0 fold/\u6A21\u578B\u5207\u6362/\u91CD\u542F\u5F52\u56E0\u2014\u2014\u7591\u4F3C\u91CD\u5EFA\u7F1D\u3002\u6570\u503C\u4E3A\u5ACC\u7591\u6837\u672C\u91CD\u8BA1\u8D39\u7684 token","det.attr_provider_tip":"\u4E0A\u4E00\u8BF7\u6C42\u7684\u6574\u6761\u6D88\u606F\u5217\u8868\u9010\u5B57\u8282\u4FDD\u7559\uFF08\u6574\u4F53\u4E00\u81F4\uFF0C\u6216\u524D\u7F00\u4E00\u81F4\u3001\u4EC5\u5C3E\u90E8\u8FFD\u52A0\u65B0\u6D88\u606F\uFF1B\u8D85\u8FC7 512KiB \u53D6\u8BC1\u4E0A\u9650\u7684\u8BF7\u6C42\u4EE5\u8BB0\u5F55\u5934\u7A33\u5B9A + \u7CBE\u786E\u6D88\u606F\u6570\u589E\u957F\u5224\u5B9A\uFF09\u5374\u4ECD miss\u2014\u2014\u4E0A\u6E38 TTL \u8FC7\u671F/\u6DD8\u6C70/\u4E2D\u7EE7\u8282\u70B9\u8F6E\u6362\uFF0C\u975E bili \u91CD\u5EFA\u7F1D","det.attr_rewind_tip":"\u5BA2\u6237\u7AEF revert/trim \u4F7F\u6D88\u606F\u6570\u4E0B\u964D\u2014\u2014\u5408\u6CD5\u7684\u4E00\u6B21\u6027\u91CD\u8BA1\u8D39\uFF08\u4FDD\u7559\u524D\u7F00\uFF09\uFF0C\u975E\u7F3A\u9677","det.attr_abort_tip":"\u5BA2\u6237\u7AEF\u6D41\u4E2D abort \u540E 30s \u5185\u7ED3\u7B97\u7684 miss \u6837\u672C\u6570\u2014\u2014\u91CD\u8BD5\u91CD\u5199\u91CD\u53D1\u5C3E\u90E8\uFF1B\u76F8\u5173\u6027\u800C\u975E\u56E0\u679C\uFF0C\u53E0\u52A0\u6807\u8BB0\u4E0D\u8BA1\u5165\u5206\u6876","det.attr_prompt":"\u270D\uFE0F \u5BBF\u4E3B\u6539\u5199\u63D0\u793A\u8BCD","det.attr_prompt_tip":"\u76F8\u90BB\u4E24\u6B21\u8BF7\u6C42\u7684\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6307\u7EB9\u4E0D\u540C\uFF1D\u5BBF\u4E3B\u6539\u5199\u4E86\u7CFB\u7EDF\u63D0\u793A\u8BCD\uFF08\u5982\u5468\u671F\u6027\u63D2\u5165/\u79FB\u9664\u52A8\u6001\u6BB5\uFF09\u2014\u2014\u4E0B\u6E38\u524D\u7F00\u7F13\u5B58\u5168\u90E8\u5931\u6548\uFF1B\u8BE5\u8BF7\u6C42\u7A33\u5B9A\u524D\u7F00\u91CD\u8BA1\u8D39\u8BA1\u5165\u6B64\u6876\uFF08\u5F52\u56E0\u4F18\u5148\u7EA7 restart>model>key>prompt>wire>upstream\uFF0C#2350\uFF09","det.attr_note":"\u63A5\u7F1D / \u4E0A\u6E38\u4FA7 / \u56DE\u9000 / \u5BBF\u4E3B\u6539\u5199 \u4E92\u65A5\u5206\u533A\u672A\u89E3\u91CA\u6B8B\u5DEE\u7684\u4E00\u90E8\u5206\uFF0C\u4E2D\u65AD\u4E3A\u53E0\u52A0\u6807\u8BB0\u2014\u2014\u5747\u4E0D\u542B\u5728\u4E0A\u65B9 TOTAL \u5185\uFF0C\u4E0D\u91CD\u590D\u8BA1\u6570","det.seam_events":"\u26A0 \u7F13\u5B58\u63A5\u7F1D\u4E8B\u4EF6 \xB7 {n}","det.seam_events_tip":"\u76F8\u90BB\u51FA\u7AD9\u4F53\u7684\u9996\u4E2A\u5B57\u8282\u5206\u53C9\u4F4D\u7F6E\uFF1B\u82E5\u53EF\u590D\u73B0\uFF0C\u8BF7\u9644\u4E0A\u8BE5\u65F6\u95F4\u9644\u8FD1\u7684 bili.log\uFF08#1548 \u7C7B\u95EE\u9898\uFF09","det.stab_title":"\u4F53\u7A33\u5B9A\u6027\uFF08\u9010\u8C03\u7528\u5B57\u8282\u8BC1\u660E\uFF09","det.stab_pairs":"\u76F8\u90BB\u8C03\u7528\u5BF9 {n}","det.stab_tip":"\u6BCF\u6B21\u51FA\u7AD9\u8BF7\u6C42\u4F53\u4E0E\u4E0A\u4E00\u4E2A\u5DF2\u7ED3\u7B97\u8BF7\u6C42\u505A SHA-256 \u5B57\u8282\u6BD4\u8F83\uFF1Aidentical=\u9010\u5B57\u8282\u76F8\u540C\uFF08\u5982\u4F20\u8F93\u91CD\u8BD5\uFF09\uFF1Bdiverged \u6309\u9996\u4E2A\u5206\u53C9\u70B9\u5206\u7C7B\u2014\u2014head<1KiB \u662F\u5BBF\u4E3B\u4FA7\u53C2\u6570\u53D8\u66F4\uFF08model/tools/\u91C7\u6837\uFF09\uFF0Ctail-append \u662F\u7EAF\u5C3E\u90E8\u589E\u957F\uFF0Cmid \u662F\u771F\u5B9E\u524D\u7F00\u6539\u5199\uFF0Coffset-unknown \u8868\u793A body \u8D85\u4FDD\u7559\u4E0A\u9650\uFF08\u4E0D\u7B49\u5F0F\u4ECD\u7531\u6458\u8981\u8BC1\u660E\uFF09","det.stab_identical":"\u9010\u5B57\u8282\u76F8\u540C","det.stab_head":"\u5934\u90E8<1KiB(\u53C2\u6570\u53D8\u66F4)","det.stab_append":"\u5C3E\u90E8\u8FFD\u52A0","det.stab_mid":"\u4E2D\u6BB5\u6539\u5199","det.stab_unknown":"\u504F\u79FB\u672A\u77E5(\u622A\u65AD)","det.stab_size":"\u6309\u8F93\u5165\u5C3A\u5BF8\u7684\u547D\u4E2D\u7387(\u4E2D\u4F4D)","det.stab_gap":"\u8BF7\u6C42\u95F4\u9694\u4E2D\u4F4D\uFF1A\u4F4E\u547D\u4E2D(<80%) {a}s vs \u9AD8\u547D\u4E2D {b}s","det.seam_col_hit":"\u547D\u4E2D\u7387","det.seam_col_input":"\u8F93\u5165","det.seam_col_div":"\u9996\u4E2A\u5206\u53C9","det.seam_msg":"\u6D88\u606F[{i}]\uFF08{prev}\u2192{cur} \u6761\uFF09","det.seam_mark_tip":"\u26A0 \u7F13\u5B58\u63A5\u7F1D #{seq} \xB7 {at} \xB7 \u547D\u4E2D {hit}% \xB7 \u9996\u4E2A\u5206\u53C9 \u2265{lcp} @ \u6D88\u606F[{msg}]\uFF08{prev}\u2192{cur} \u6761\u6D88\u606F\uFF09","det.legend_seam":"\u7F13\u5B58\u63A5\u7F1D","det.folds":"\u6298\u53E0\u660E\u7EC6","det.folds_empty":"\u5C1A\u65E0\u6298\u53E0\u4E8B\u4EF6","det.fold_s":"\u538B\u7F29\u91CF S","det.fold_sigma":"\u6458\u8981 \u03C3","det.fold_h":"\u6298\u53E0\u540E\u547D\u4E2D\u7387","det.fold_t":"\u7D2F\u8BA1\u56DE\u8865 T","det.client_hint":"\u5BA2\u6237\u7AEF","det.self_heal":"\u81EA\u6108\u72B6\u6001","det.self_heal_tip":"\u4F1A\u8BDD\u5361\u6B7B\u81EA\u6108\u5DF2\u63A5\u7BA1\uFF1A\u8BE6\u89C1\u4F1A\u8BDD\u8BE6\u60C5\uFF08#2155\uFF09","det.self_heal_short":"\u81EA\u6108","det.self_heal_degrade_to_proxy":"\u63D2\u4EF6\u8F66\u9053\u5DF2\u6B7B \u2192 \u5DF2\u964D\u7EA7\u4EE3\u7406\u6A21\u5F0F\uFF08\u5DE5\u5177\u5DF2\u56DE\u6CE8\uFF09","det.self_heal_suppress_nudge":"\u538B\u7F29\u63D0\u9192\u7A7A\u8F6C \u2192 \u5DF2\u9759\u9ED8\uFF08\u6062\u590D\u538B\u7F29\u81EA\u52A8\u89E3\u9664\uFF09","det.legend_base":"\u7CFB\u7EDF\u63D0\u793A\u8BCD\u57FA\u7EBF\uFF08\u5B9E\u6D4B \xB7 \u4E0D\u53EF\u538B\u7F29\uFF09","det.legend_base_est":"\u57FA\u7EBF\u4F30\u7B97\uFF08\u7CFB\u7EDF\u63D0\u793A\u8BCD\u4E0E\u5DE5\u5177\u7B49\u4E0D\u53EF\u538B\u7F29\u90E8\u5206\uFF09","det.blocks_title":"\u538B\u7F29\u5757","det.blocks_count":"{total} \xB7 {active} \u6D3B\u8DC3","det.blocks_empty":"\u5C1A\u65E0\u538B\u7F29\u5757","det.block_active":"\u6D3B\u8DC3","det.block_external":"\u5916\u90E8\u6458\u8981","det.block_inactive":"\u5DF2\u5F52\u6863","det.blocks_download":"\u4E0B\u8F7D\u5757 (.md)","det.report_dl":"\u4E0B\u8F7D\u7F13\u5B58\u62A5\u544A (.md)","det.blocks_copy_md":"\u590D\u5236 Markdown","det.handoff":"\u4F1A\u8BDD\u4EA4\u63A5\u6587\u6863","det.handoff_hint":"\u4E0E bili export \u76F8\u540C\u7684\u5185\u5BB9 \u2014\u2014 \u590D\u5236\u7C98\u8D34\u5230\u65B0\u4F1A\u8BDD\u5373\u53EF\u7EE7\u7EED","det.thinking":"\u601D\u8003","det.handoff_truncated":"\u26A0\uFE0F \u5185\u5BB9\u8FC7\u957F\u5DF2\u622A\u65AD","det.handoff_copy_md":"\u590D\u5236 Markdown","det.handoff_download":"\u4E0B\u8F7D .md","det.not_found":"\u627E\u4E0D\u5230\u8BE5\u4F1A\u8BDD","det.not_found_hint":"\u5B83\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\uFF0C\u6216\u4E0D\u5C5E\u4E8E\u672C\u673A\u6570\u636E\u76EE\u5F55","cfg.title":"\u914D\u7F6E","cfg.sub":"\u4FEE\u6539\u5373\u65F6\u5199\u5165\u914D\u7F6E\u6587\u4EF6\u5E76\u70ED\u751F\u6548 \xB7 \u4FDD\u5B58\u524D\u8BF7\u786E\u8BA4 JSON \u8BED\u6CD5","cfg.file":"\u914D\u7F6E\u6587\u4EF6","cfg.parse_error":"\u914D\u7F6E\u6587\u4EF6\u4E0D\u662F\u6709\u6548 JSON \u2014\u2014 \u663E\u793A\u4E3A\u7A7A\u89C6\u56FE","cfg.upstream_net":"\u4E0A\u6E38\u7F51\u7EDC","cfg.up_auto":"auto\uFF08\u8DDF\u968F\u7CFB\u7EDF\u4EE3\u7406\uFF09","cfg.up_manual":"manual\uFF08\u663E\u5F0F\u4EE3\u7406\uFF09","cfg.up_direct":"direct\uFF08\u5F3A\u5236\u76F4\u8FDE\uFF09","cfg.passthrough":"Passthrough","cfg.passthrough_desc":"\u5F00\u5173\u51B3\u5B9A\u672A\u5339\u914D\u5230\u8DEF\u7531\u7684\u6D41\u91CF\u662F\u5426\u539F\u6837\u900F\u4F20\u3001\u4E0D\u505A\u4EFB\u4F55\u6539\u5199\u5730\u76F4\u8FBE\u76EE\u6807\u670D\u52A1\u3002\u72B6\u6001\u5199\u5165\u914D\u7F6E\u6587\u4EF6\uFF1B\u5F53\u7531\u73AF\u5883\u53D8\u91CF ACP_PASSTHROUGH \u5F3A\u5236\u65F6\u9875\u9762\u4F1A\u6807\u660E\u6765\u6E90\uFF0C\u9700\u53D6\u6D88\u8BE5\u53D8\u91CF\u5E76\u91CD\u542F\u540E\u624D\u80FD\u5728\u6B64\u4FEE\u6539","cfg.pt_off":"\u5173\u95ED","cfg.pt_on":"\u5F00\u542F","cfg.test_hint":"\u5411\u5F53\u524D\u4E0A\u6E38\u53D1\u4E00\u6B21\u6700\u5C0F\u8BF7\u6C42\u9A8C\u8BC1\u53EF\u8FBE\u6027\uFF1B\u4E0D\u4FEE\u6539\u4EFB\u4F55\u914D\u7F6E","cfg.test_btn":"\u6D4B\u8BD5\u8FDE\u63A5","cfg.state":"\u8FDE\u63A5\u72B6\u6001","cfg.untested":"\u5C1A\u672A\u63A2\u6D4B","cfg.save":"\u4FDD\u5B58","cfg.unsaved":"\u26A0 \u6709\u672A\u4FDD\u5B58\u7684\u66F4\u6539\u2014\u2014\u70B9\u300C\u4FDD\u5B58\u300D\u524D\u4E0D\u4F1A\u5199\u5165","cfg.file_desc":"\u5C31\u662F\u76F4\u63A5\u7F16\u8F91\u914D\u7F6E\u6587\u4EF6\u2014\u2014\u8FD9\u4E2A JSON \u91CC\u6240\u6709\u9876\u5C42\u5B57\u6BB5\u90FD\u751F\u6548\uFF08\u8DEF\u7531\u8868\u3001\u538B\u7F29\u3001\u7F51\u7EDC\u3001\u900F\u4F20\u3001promptPack\u3001ccr \u2026\uFF09\uFF0C\u4FDD\u5B58\u7ACB\u5373\u70ED\u751F\u6548","cfg.quick":"\u5FEB\u901F\u914D\u7F6E","cfg.quick_desc":"\u5E38\u7528\u9879\u70B9\u4E00\u70B9\u5C31\u6539\u2014\u2014\u6BCF\u6B21\u6539\u52A8\u5B9E\u65F6\u540C\u6B65\u5230\u4E0B\u65B9\u539F\u59CB JSON\uFF08\u53EA\u6539\u8FD9\u4E00\u4E2A\u6587\u4EF6\uFF0C\u4E0D\u65B0\u589E\u4EFB\u4F55\u914D\u7F6E\u9879\uFF09\uFF1Bproviders \u8868\u7B49\u9AD8\u7EA7\u7ED3\u6784\u76F4\u63A5\u7528\u4E0B\u9762\u7684 JSON","cfg.q_debug":"\u8C03\u8BD5\u65E5\u5FD7\uFF08debug\uFF09","cfg.q_passthrough":"\u900F\u4F20\u6A21\u5F0F\uFF08passthrough\uFF09\u2014\u2014\u5F00\u542F\u540E\u4E0D\u6CE8\u5165\u3001\u4E0D\u538B\u7F29\uFF0C\u7EAF\u4EE3\u7406","cfg.q_dsh_compact":"dsh \u81EA\u5E26\u538B\u7F29\uFF08allowDshCompaction\uFF09\u2014\u2014\u5F53\u524D\u5DF2\u7981\u7528\uFF1Abili \u62E6\u622A dsh \u539F\u751F\u538B\u7F29\u8BF7\u6C42\uFF1B\u4EC5\u5F53\u4F60\u786E\u5B9E\u7528 dsh \u7684 /compact \u6D41\u7A0B\u65F6\u624D\u9700\u8981\u52FE\u9009\u653E\u884C","cfg.q_dsh_compact_warn":"\u26A0 \u52FE\u9009\u653E\u884C\u7684\u540E\u679C\uFF1Adsh \u539F\u751F\u538B\u7F29\u4E00\u65E6\u843D\u5730\uFF0C\u4F1A\u628A\u6574\u4E2A\u539F\u59CB\u5386\u53F2\u6C38\u4E45\u66FF\u6362\u6210\u4E00\u4EFD\u6458\u8981\uFF08\u4E0D\u53EF\u6062\u590D\uFF09\uFF0C\u8BE5\u4F1A\u8BDD\u7684 bili \u538B\u7F29\u968F\u4E4B\u5931\u6548\u3002\u975E web profile \u4E0B\u51FA\u5382 patch \u7684 auto:false \u4ECD\u538B\u5236\u81EA\u52A8\u89E6\u53D1\u2014\u2014\u52FE\u4E0A\u53EA\u5F71\u54CD\u624B\u52A8 /compact\u3002","cfg.q_dsh_compact_env":"\u5F53\u524D\u7531\u73AF\u5883\u53D8\u91CF BILI_ALLOW_DSH_COMPACTION \u5F3A\u5236\u2014\u2014\u6B64\u5904\u4FEE\u6539\u4E0D\u751F\u6548\uFF0C\u53D6\u6D88\u8BBE\u7F6E\u5E76\u91CD\u542F\u540E\u624D\u53EF\u4FEE\u6539","cfg.q_pack":"\u538B\u7F29\u63D0\u793A\u8BCD\u5305\uFF08compress.promptPack\uFF09","cfg.q_nudge":"\u538B\u7F29\u589E\u957F\u9608\u503C tokens\uFF08compress.nudgeGrowthTokens\uFF09","cfg.q_nudge_step":"\u6B65\u8FDB 5000","cfg.q_nudge_low":"\u4F4E\u4E8E 20000\uFF1A\u538B\u7F29\u8FC7\u4E8E\u9891\u7E41\u4F1A\u635F\u5BB3\u6458\u8981\u8D28\u91CF\uFF08\u5185\u6838\u9ED8\u8BA4 50000\uFF09","cfg.q_nudge_high":"\u9AD8\u4E8E 100000\uFF1A\u4E24\u6B21\u6298\u53E0\u4E4B\u95F4\u4E0A\u4E0B\u6587\u8FC7\u957F\uFF0C\u53EF\u80FD\u524A\u5F31\u6A21\u578B\u6CE8\u610F\u529B","cfg.q_tiers":"\u5206\u5C42\u538B\u7F29\u89E6\u53D1\u9608\u503C tokens\uFF08compress.tierNudgeTokens\uFF0C\u521D\u59CB\u4E3A\u6D3E\u751F\u9ED8\u8BA4\u503C\uFF0C\u4EC5\u4FDD\u5B58\u4FEE\u6539\u9879\uFF09","cfg.q_tiers_auto":"auto","cfg.q_tiers_step":"\u6B65\u8FDB 5000","cfg.q_tiers_tip_t1":"T1 \u539F\u59CB\u6D88\u606F\u538B\u7F29\u89E6\u53D1\u9608\u503C\uFF08\u6309\u539F\u59CB token \u8BA1\uFF09\u2014\u2014\u9ED8\u8BA4\uFF1D\u4E0A\u9762\u7684\u538B\u7F29\u589E\u957F\u9608\u503C","cfg.q_tiers_tip_t2":"T2 \u6458\u8981\u518D\u84B8\u998F\u89E6\u53D1\u9608\u503C\uFF08\u6309 T1 \u6458\u8981 token \u8BA1\uFF09\u2014\u2014\u9ED8\u8BA4\uFF1D\u589E\u957F\u9608\u503C \xD7 1.5\uFF1B\u8C03\u5927\u53EF\u8BA9\u6BCF\u4E2A T2 \u5757\u627F\u8F7D\u66F4\u591A\u9879\u76EE\u5386\u53F2","cfg.q_tiers_tip_t3":"T3 \u6D53\u7F29\u89E6\u53D1\u9608\u503C\uFF08\u6309 T2 \u6458\u8981 token \u8BA1\uFF09\u2014\u2014\u9ED8\u8BA4\uFF1D\u589E\u957F\u9608\u503C \xD7 1.5","cfg.q_tiers_desc":"\u521D\u59CB\u503C\u4E3A\u5F53\u524D\u6D3E\u751F\u9ED8\u8BA4\uFF08T1\uFF1D\u589E\u957F\u9608\u503C\uFF0CT2/T3\uFF1D\xD71.5\uFF09\uFF0C\u672A\u6539\u52A8\u7684\u9879\u4E0D\u5199\u5165\u914D\u7F6E\u3002\u6CE8\u610F T2/T3 \u6309\u4F4E\u4E00\u5C42\u6458\u8981 token \u8BA1\u3001\u4E0D\u662F\u539F\u6587\uFF1A\u9ED8\u8BA4 7.5w\u3001\u6309 ~10:1 \u6458\u8981\u6BD4\uFF0C\u4E00\u4E2A T2 \u5757\u7EA6\u627F\u8F7D 75 \u4E07\u539F\u59CB\u4E0A\u4E0B\u6587\uFF1B\u957F\u9879\u76EE\u53EF\u8C03\u5927 T2 \u8BA9\u6BCF\u5757\u627F\u8F7D\u66F4\u591A\u5386\u53F2\u3002","cfg.q_prm":"\u4FDD\u62A4\u6700\u8FD1\u6D88\u606F\u6761\u6570\uFF08compress.preserveRecentMessages\uFF09","cfg.q_prm_ph":"\u7559\u7A7A\uFF1D\u5185\u6838\u9ED8\u8BA4","cfg.q_never":"\u4ECE\u6700\u8FD1\u6D88\u606F\u4FDD\u7559\u4E2D\u6392\u9664\u7684\u5DE5\u5177\u540D\uFF08compress.neverPreserveRecentTools\uFF09","cfg.q_never_ph":"\u9017\u53F7\u5206\u9694\uFF0C* \u901A\u914D\uFF1B\u7559\u7A7A\uFF1D\u5185\u6838\u9ED8\u8BA4\uFF08\u542B read\u3001bash\uFF09","cfg.q_never_note":"\u9ED8\u8BA4\u6392\u9664 decompress\u3001search_context\u3001read\u3001bash\u2014\u2014\u6279\u91CF\u8BFB\u6587\u4EF6\u65F6\u628A read \u79FB\u51FA\u5217\u8868\uFF0C\u53EF\u907F\u514D\u521A\u8BFB\u7684\u6587\u4EF6\u7ACB\u523B\u88AB\u6298\u53E0","cfg.q_ptools":"\u4FDD\u62A4\u5DE5\u5177\u540D\uFF08protectedTools\uFF0C\u6C38\u4E0D\u88AB\u538B\u7F29\uFF09","cfg.q_ptools_ph":"\u9017\u53F7\u5206\u9694\uFF0C\u652F\u6301 * \u901A\u914D\uFF0C\u5982 skill\u3001skill_*\uFF1B\u9ED8\u8BA4\u7559\u7A7A\uFF1D\u4E0D\u4FDD\u62A4","cfg.q_ptools_warn":"\u6CE8\u610F\uFF1Aread / bash / edit \u8FD9\u7C7B\u9AD8\u9891\u5DE5\u5177\u4E0D\u8981\u4FDD\u62A4\u2014\u2014\u5B83\u4EEC\u7684\u8F93\u51FA\u5360\u4F1A\u8BDD token \u7684\u5927\u5934\uFF0C\u4FDD\u62A4\u540E\u6C38\u4E0D\u88AB\u538B\u7F29\uFF0C\u4E0A\u4E0B\u6587\u4F1A\u8D8A\u6EDA\u8D8A\u5927","cfg.q_parse_err":"\u9AD8\u7EA7 JSON \u6682\u65F6\u65E0\u6CD5\u89E3\u6790\u2014\u2014\u5FEB\u901F\u914D\u7F6E\u63A7\u4EF6\u5DF2\u6682\u505C\uFF0C\u8BF7\u5148\u4FEE\u6B63\u4E0B\u65B9 JSON","cfg.q_pack_default_desc":"default\uFF08\u6807\u51C6\uFF09\uFF1A\u5B8C\u6574\u63D0\u793A\u8BCD\u9762\u2014\u2014\u8BE6\u7EC6\u5DE5\u5177\u63CF\u8FF0\uFF0B\u5168\u91CF\u538B\u7F29\u89C4\u5219\uFF0C\u5F15\u5BFC\u6700\u5145\u5206\u3002\u5B9E\u6D4B\uFF08qwen \u5206\u8BCD\uFF09\u6BCF\u6B21\u8BF7\u6C42\u7EA6 2,900+ tokens","cfg.q_pack_lean_desc":"lean\uFF08\u7CBE\u7B80\uFF09\uFF1A\u7701 token \u9762\u2014\u2014\u5DE5\u5177\u63CF\u8FF0\u538B\u6210\u4E00\u884C\u3001\u89C4\u5219\u7CBE\u7B80\uFF0C\u538B\u7F29\u5F15\u5BFC\u66F4\u7B80\u7EC3\u3002\u5B9E\u6D4B\uFF08qwen \u5206\u8BCD\uFF09\u6BCF\u6B21\u8BF7\u6C42\u7EA6 1,400 tokens\uFF0C\u6BD4 default \u7701\u7EA6\u4E00\u534A","cfg.q_pack_custom":"\u81EA\u5B9A\u4E49 pack\u2014\u2014\u4ECE ~/.config/billion-context/packs/\uFF08\u6216\u9879\u76EE .billion-context/packs/\uFF09\u6309\u540D\u8BFB\u53D6","cfg.q_mitm":"MITM \u89E3\u5BC6\u57DF\u540D\uFF0C\u9017\u53F7\u5206\u9694\uFF08mitm.domains\uFF09","cfg.q_more":"\u66F4\u591A\u914D\u7F6E\uFF08\u5B8C\u6574\u5B57\u6BB5\u8BF4\u660E\uFF09","cfg.q_more_url":"https://github.com/ranxianglei/billion-context/blob/master/CONFIGURATION.zh-CN.md","cfg.q_mitm_ph":"api.anthropic.com, open.bigmodel.cn","cfg.state_reached":"HTTP {status} \xB7 \u53EF\u8FBE\uFF08\u8BA4\u8BC1\u7531\u5BA2\u6237\u7AEF\u8D1F\u8D23\uFF09","cfg.saved":"\u5DF2\u4FDD\u5B58\u5230\u914D\u7F6E\u6587\u4EF6 \u2713","cfg.invalid_json":"\u4E0D\u662F\u6709\u6548\u7684 JSON\uFF0C\u672A\u4FDD\u5B58","cfg.pt_clear":"\u5173\u95ED Passthrough","cfg.resign":"\u7B7E\u540D\u4E0A\u6E38\uFF08resign\uFF09","cfg.resign_desc":"\u8BF7\u6C42\u4F53\u5E26\u7B7E\u540D\u7684\u4E0A\u6E38\uFF1A\u4EFB\u4F55\u6539\u5199\u90FD\u4F1A\u8BA9\u4E0A\u6E38\u9A8C\u7B7E\u5931\u8D25\uFF08401\uFF09\u3002\u6309\u300C\u8981\u4E48\u538B\u7F29\u3001\u8981\u4E48\u62D2\u7EDD\u300D\u539F\u5219\uFF0C\u7B7E\u540D\u8BF7\u6C42\u53EA\u6709\u4E24\u79CD\u7ED3\u5C40\u2014\u2014\u80FD\u91CD\u7B7E\u5C31\u91CD\u7B7E+\u538B\u7F29\uFF0C\u4E0D\u80FD\u91CD\u7B7E\u5C31\u672C\u5730\u62D2\u7EDD\uFF08403\uFF09\uFF0C\u6CA1\u6709\u4E0D\u7B7E\u540D\u653E\u884C\u6A21\u5F0F\u3002\u5185\u7F6E\u65B9\u6848\u65E0\u51ED\u636E\u65F6\u53EF\u7528 passthrough \u663E\u5F0F\u63A5\u53D7\u4E0D\u538B\u7F29\u76F4\u9001\uFF1B\u5176\u4ED6\u65B9\u6848\u7684\u94FE\u8DEF\u5728 bili \u8865\u4E0A\u5BF9\u5E94\u91CD\u7B7E\u5668\u4E4B\u524D\u4E0D\u53EF\u7528\uFF08\u914D\u7F6E\u65E0\u6CD5\u653E\u884C\uFF09\u3002\u6761\u76EE\u6765\u81EA\u8FD0\u884C\u4E2D\u89C2\u5BDF\u5230\u7684\u7B7E\u540D","cfg.resign_loading":"\u52A0\u8F7D\u4E2D\u2026","cfg.resign_none":"\u6CA1\u6709\u5F85\u5904\u7406\u7684\u7B7E\u540D\u62D2\u7EDD\u2014\u2014\u672A\u89C2\u5BDF\u5230\u65E0\u6CD5\u91CD\u7B7E\u7684\u7B7E\u540D\u8BF7\u6C42","cfg.resign_builtin":"\u5185\u7F6E\u65B9\u6848 {scheme}\uFF08{label}\uFF09\uFF1Adsh \u51ED\u636E\u670D\u52A1\u53EF\u89E3\u6790\u65F6 bili \u81EA\u52A8\u91CD\u7B7E\u3001\u6B63\u5E38\u538B\u7F29\uFF1B\u5426\u5219\u672C\u5730\u62D2\u7EDD","cfg.resign_row":"{origin} \xB7 \u88AB\u62D2 {count} \u6B21\uFF08\u81EA {firstSeen} \u8D77\uFF09","cfg.resign_refusing":"\u9ED8\u8BA4\u62D2\u7EDD\u4E2D","cfg.resign_passthrough":"\u5DF2\u76F4\u9001\uFF08\u4E0D\u538B\u7F29\uFF09","cfg.resign_disabled":"\u4FDD\u62A4\u5DF2\u505C\u7528\uFF08\u56DE\u9000\u65E7\u884C\u4E3A\uFF1Abody \u4F1A\u88AB\u6539\u5199\uFF0C\u4E0A\u6E38\u53EF\u80FD 401\uFF09","cfg.resign_copy_hint":"\u590D\u5236\u8BE5\u7247\u6BB5\u52A0\u5165\u914D\u7F6E\u6587\u4EF6\uFF1A\u6B64\u94FE\u8DEF\u4E0D\u538B\u7F29\u3001\u539F\u6837\u76F4\u9001\uFF08\u4EC5\u5185\u7F6E\u65B9\u6848\u6709\u6548\uFF09","cfg.resign_awaiting":"\u7B49\u5F85 bili \u5B9E\u73B0\u8BE5\u65B9\u6848\u7684\u91CD\u7B7E\u5668\uFF08\u6309\u538B\u7F29\u6216\u62D2\u7EDD\u539F\u5219\uFF0C\u914D\u7F6E\u65E0\u6CD5\u653E\u884C\uFF09","con.title":"\u5BA2\u6237\u7AEF\u63A5\u5165","con.sub":"\u628A AI \u5BA2\u6237\u7AEF\u7684\u6D41\u91CF\u6307\u5230\u672C\u4EE3\u7406","con.origin":"\u4EE3\u7406\u5730\u5740","con.method_plugin":"\u65B9\u5F0F\u4E00 \xB7 \u5B89\u88C5\u63D2\u4EF6\uFF08\u63A8\u8350 \xB7 \u539F\u751F\u6A21\u5F0F\uFF09","con.method_plugin_hint":"\u63A8\u8350\u65B9\u5F0F\u2014\u2014\u5B89\u88C5\u540E\u7167\u5E38\u8FD0\u884C agent \u5373\u53EF\uFF0C\u4F1A\u81EA\u52A8\u7ECF\u8FC7 billion-context\uFF0C\u529F\u80FD\u6700\u5B8C\u6574\u3002\u5E38\u7528\u7BA1\u7406\u547D\u4EE4\uFF1A","con.plugin_note":"\u63D2\u4EF6\u6A21\u5F0F\u76EE\u524D\u8986\u76D6\u8FD9 9 \u4E2A agent\uFF1Api \xB7 omp \xB7 claude \xB7 codex \xB7 opencode \xB7 dsh \xB7 kimi \xB7 hermes \xB7 zcode\uFF1B\u5176\u4F59\u5BA2\u6237\u7AEF\u8BF7\u7528\u65B9\u5F0F\u4E8C\u6216\u65B9\u5F0F\u4E09\u3002opencode \u5B89\u88C5\u65F6\u52A0 --with-mcp \u53EF\u540C\u65F6\u6CE8\u518C MCP \u5DE5\u5177","con.launcher_mitm":"\u5411\u8BC1\u4E66 MITM \u767D\u540D\u5355\u8FFD\u52A0\u57DF\u540D\uFF08\u5982\u81EA\u5EFA\u4E2D\u8F6C\uFF09\uFF1Abili pi --mitm-domain api.foo.com","con.note_pi":"\u62C9\u8D77 pi\uFF0C\u8D70\u4EE3\u7406 \u2014\u2014 file-free(#535)\uFF1A\u73AF\u5883\u53D8\u91CF + \u6269\u5C55 registerProvider\uFF0C\u771F\u5B9E ~/.pi \u4E0D\u52A8","con.note_codex":"\u62C9\u8D77 codex","con.note_claude":"\u62C9\u8D77 claude","con.note_omp":"pi \u540C\u6B3E\uFF0Cfile-free(#535)\uFF1A\u73AF\u5883\u53D8\u91CF + \u6269\u5C55 registerProvider\uFF0C\u771F\u5B9E ~/.omp \u4E0D\u52A8","con.note_opencode":"OpenCode\uFF081.x \u4E0E 2.x\uFF09\uFF1A\u5B8C\u6574\u6307\u5357\u89C1\u4E0B\u6587 OpenCode \u4E00\u8282","con.note_hermes":"file-free(#535)\uFF1AHTTPS_PROXY + SSL_CERT_FILE \u7EC4\u5408 CA bundle\u2014\u2014https \u8D70 CONNECT MITM\uFF0Chttp \u8D70\u7EDD\u5BF9\u5F62\u5F0F\u8F6C\u53D1\uFF1B\u771F\u5B9E ~/.hermes \u4E0D\u52A8","con.note_dsh":"deepseek-harness\uFF1A\u7ECF --patch \u6CE8\u5165\u5B8C\u6574\u539F\u751F\u63D2\u4EF6(#941)\uFF0Ccompress/decompress/acp_status \u6CE8\u518C\u4E3A\u771F\u5B9E dsh \u5DE5\u5177\uFF1B\u975E\u56DE\u73AF\u4E0A\u6E38\u8D70\u4EE3\u7406 env\uFF0C\u56DE\u73AF\u4FDD\u7559 overlay DSH_HOME \u6539\u5199\uFF1B\u5185\u7F6E deepseek \u8DEF\u7531\u8D70 DEEPSEEK_BASE_URL\uFF1Bdsh \u539F\u751F\u81EA\u52A8\u538B\u7F29\u88AB\u7981\u7528","con.note_codebuddy":"Tencent CodeBuddy Code CLI\uFF1ACODEBUDDY_BASE_URL /bili/ \u6539\u5199\uFF08OpenAI chat-completions wire\uFF09\uFF0C\u9884\u7B97\u5BF9\u9F50\u8D70 CODEBUDDY_AUTO_COMPACT_WINDOW\uFF1B\u771F\u5B9E ~/.codebuddy \u4E0D\u52A8","con.note_qoder":"qoder\uFF1A\u6A21\u578B\u7AEF\u70B9\u786C\u7F16\u7801 https\uFF08\u65E0\u6CD5 /bili/ \u6539\u5199\uFF09\u2014\u2014\u8BC1\u4E66 MITM\uFF08HTTPS_PROXY + NODE_EXTRA_CA_CERTS\uFF09\uFF0C\u9ED8\u8BA4\u6A21\u578B\u4E3B\u673A\u5DF2\u52A0\u767D\u540D\u5355(#653)","con.note_trae":"Trae CLI\uFF08\u5B57\u8282\u8DF3\u52A8\uFF0C\u95ED\u6E90 Go \u4E8C\u8FDB\u5236\uFF0C\u65E0 base-URL \u8986\u76D6\uFF09\u2014\u2014\u8BC1\u4E66 MITM\uFF0C\u6A21\u578B\u4E3B\u673A\u53D6 TRAE_CLI_API_HOST \u6216\u9ED8\u8BA4\u4F01\u4E1A\u7F51\u5173(#655)","con.note_jcode":"jcode\uFF08Rust \u7EC8\u7AEF\u7F16\u7801 agent\uFF09\u2014\u2014\u73AF\u5883\u53D8\u91CF\u5F0F\u8BC1\u4E66 MITM \u542F\u52A8\uFF1Bapi.z.ai \u9ED8\u8BA4\u52A0\u767D\uFF0C\u672C\u5730\u56DE\u73AF provider \u8D70 NO_PROXY \u76F4\u8FDE","con.note_kimi":"Kimi Code CLI\uFF08Moonshot\uFF09\uFF1A\u9664\u65E0\u6761\u4EF6\u56DE\u73AF\u7ED5\u8FC7\u5916\u5747\u9075\u5FAA\u6807\u51C6\u4EE3\u7406\u73AF\u5883\u53D8\u91CF\u2014\u2014\u975E\u56DE\u73AF https \u8BC1\u4E66 MITM\u3001http \u7EDD\u5BF9\u5F62\u5F0F\u8F6C\u53D1\uFF1B\u4E3B\u673A\u53D6 ~/.kimi-code/config.toml\uFF1B\u56DE\u73AF\u7AEF\u70B9\u7F16\u76EE\u5E76\u9644\u624B\u52A8 /bili/ \u524D\u7F00\u63D0\u793A(#757)","con.note_gemini":"Gemini CLI\uFF08Google\uFF09\uFF1AGOOGLE_GEMINI_BASE_URL /bili/ \u6539\u5199\u5230 generativelanguage.googleapis.com\uFF08Google \u539F\u751F wire\uFF09\uFF1B\u771F\u5B9E ~/.gemini \u96F6\u6539\u52A8","con.note_iflow":"iFlow CLI\uFF1AIFLOW_BASE_URL /bili/ \u6539\u5199\u5230 apis.iflow.cn/v1\uFF08OpenAI chat-completions wire\uFF09\uFF1B\u771F\u5B9E ~/.iflow \u96F6\u6539\u52A8","con.note_qwen":"Qwen Code\uFF08\u591A\u534F\u8BAE gemini-cli fork\uFF0C\u65E0 base-URL \u94A9\u5B50\uFF09\uFF1AHTTPS_PROXY + NODE_EXTRA_CA_CERTS \u8BC1\u4E66 MITM\uFF1BDashScope/Qwen \u9ED8\u8BA4\u6A21\u578B\u4E3B\u673A\u52A0\u767D\uFF0C\u81EA\u5EFA\u4E2D\u8F6C\u7528 --mitm-domain \u8FFD\u52A0","con.note_antigravity":"Antigravity CLI\uFF08agy\uFF0CGoogle\uFF0CGemini CLI \u7EE7\u4EFB\u8005\uFF09\uFF1ACLOUD_CODE_URL /bili/ \u6539\u5199\u5230 cloudcode-pa.googleapis.com\uFF08\u8BED\u8A00\u670D\u52A1\u5668\u5185\u672A\u516C\u5F00\u7684\u73AF\u5883\u53D8\u91CF\u8986\u76D6\uFF0Cv2.19.1 \u4E8C\u8FDB\u5236\u9A8C\u8BC1\uFF1Bwire \u6309\u8DEF\u5F84\u8BC6\u522B\u4E3A Google \u539F\u751F\uFF09(#2115)","con.note_mcode":"MiniMax Code CLI\uFF1A\u9664\u65E0\u6761\u4EF6\u56DE\u73AF\u7ED5\u8FC7\u5916\u9075\u5FAA\u6807\u51C6\u4EE3\u7406\u73AF\u5883\u53D8\u91CF\u2014\u2014\u975E\u56DE\u73AF https \u8BC1\u4E66 MITM\u3001http \u7EDD\u5BF9\u5F62\u5F0F\u8F6C\u53D1\uFF1B\u4E3B\u673A\u53D6 ~/.minimax*/config.yaml\uFF1B\u4F1A\u8BDD\u7ECF X-Mavis-Session-Id \u5934\u7ED1\u5B9A(#1050)","con.note_aider":"Aider\uFF08Python pair programmer\uFF09\uFF1AHTTPS_PROXY + SSL_CERT_FILE/REQUESTS_CA_BUNDLE \u8BC1\u4E66 MITM\uFF1B\u7AEF\u70B9\u53D6\u81EA\u7EE7\u627F env\u3001--openai-api-base \u6216 .aider.conf.yml\uFF1B\u56DE\u73AF\u7AEF\u70B9\u7ECF NO_PROXY \u76F4\u8FDE(#1048)","con.note_copilot":"Copilot CLI\uFF08GitHub\uFF0C\u95ED\u6E90 Go \u4E8C\u8FDB\u5236\uFF09\u2014\u2014\u8BC1\u4E66 MITM\uFF0Capi.githubcopilot.com + \u5404\u5957\u9910\u5B50\u57DF\u52A0\u767D(#1049)","con.note_amp":"Amp CLI\uFF08Sourcegraph\uFF0C\u95ED\u6E90 Go \u4E8C\u8FDB\u5236\uFF09\u2014\u2014\u8BC1\u4E66 MITM\uFF0Campcode.com \u52A0\u767D(#1049)","con.note_goose":"Goose\uFF08Block\uFF0CRust/reqwest\uFF09\uFF1Arustls \u53D1\u5E03\u6784\u5EFA\u4E0D\u4FE1\u4EFB\u4EFB\u4F55 CA \u6587\u4EF6\u2014\u2014\u5B8C\u5168\u4E0D\u7528\u4EE3\u7406\u73AF\u5883\u53D8\u91CF\uFF1B\u5185\u7F6E openai/anthropic \u817F\u7ECF OPENAI_HOST/ANTHROPIC_HOST \u91CD\u5B9A\u5411\uFF0C\u81EA\u5B9A\u4E49 provider \u7ECF\u91CD\u65B0\u751F\u6210\u7684 GOOSE_PATH_ROOT overlay \u505A base_url /bili/ \u6539\u5199\uFF1B\u56FA\u5B9A\u7B2C\u4E09\u65B9 provider \u4F1A\u8B66\u544A(#1049)","con.method_launcher":"\u65B9\u5F0F\u4E8C \xB7 bili \u542F\u52A8\u5668\uFF08\u514D\u5B89\u88C5 \u2014\u2014 \u66FF\u4EE3\u539F\u6709\u542F\u52A8\u547D\u4EE4\uFF09","con.method_launcher_hint":"\u88C5\u597D billion-context \u540E\uFF0C\u7528\u4E0B\u9762\u7684\u547D\u4EE4\u4EE3\u66FF\u539F\u6765\u7684\u542F\u52A8\u65B9\u5F0F\uFF1A\u81EA\u52A8\u6CE8\u5165 bili \u4EE3\u7406\u4E0E\u538B\u7F29\u72B6\u6001\uFF0C\u65E0\u9700\u6539\u52A8\u4EFB\u4F55\u5BA2\u6237\u7AEF\u914D\u7F6E","con.launcher_help_pre":"\u5B8C\u6574\u5217\u8868\uFF1A","con.method_a":"\u65B9\u5F0F\u4E09 \xB7 \u901A\u7528\u4EE3\u7406\uFF08URL \u524D\u7F00\u8DEF\u7531\uFF09","con.method_a_hint":"\u4EC5\u652F\u6301\u6539 baseURL \u7684\u5C11\u6570\u5BA2\u6237\u7AEF\uFF08\u5728\u539F\u5730\u5740\u524D\u52A0\u4E0B\u65B9\u524D\u7F00\u5373\u53EF\uFF09\uFF1B\u591A\u6570\u5BA2\u6237\u7AEF\u8BF7\u7528\u4E0A\u9762\u7684\u542F\u52A8\u5668","con.method_b":"\u5907\u9009\uFF1AMITM \u8BC1\u4E66\u63A5\u5165","con.method_b_hint":"\u4E0D\u652F\u6301\u6539 URL \u7684\u5BA2\u6237\u7AEF\uFF08endpoint \u786C\u7F16\u7801\uFF09\u8D70 HTTPS \u62E6\u622A\uFF0C\u9700\u5148\u4FE1\u4EFB CA \u8BC1\u4E66","card.opencode":"OpenCode","card.codex_key":"Codex","card.codex_login":"Codex\uFF08ChatGPT \u767B\u5F55\uFF09","card.claude_key":"Claude Code","card.pi":"Pi","card.other":"\u5176\u4ED6\u5BA2\u6237\u7AEF","dt.config_file":"\u914D\u7F6E\u6587\u4EF6","dt.env":"\u73AF\u5883\u53D8\u91CF","dt.example":"\u793A\u4F8B","dt.auth":"\u8BA4\u8BC1","dt.setting":"\u8BBE\u7F6E\u9879","dt.ca_cert":"CA \u8BC1\u4E66","other.rule":"\u4EFB\u610F baseURL \u524D\u52A0","zcode.title":"ZCode\uFF08\u7F16\u7A0B\u5957\u9910\uFF09","zcode.method":"MITM \u900F\u660E\u4EE3\u7406","ca.not_ready":"\uFF08\u5C1A\u672A\u751F\u6210\uFF0C\u9996\u6B21 MITM \u65F6\u81EA\u52A8\u521B\u5EFA\uFF09","copy.ca":"\u590D\u5236 CA \u8DEF\u5F84","zcode.hint_a":"CA \u8DEF\u5F84\u662F\u672C\u673A bili \u5B9E\u9645\u751F\u6210\u7684\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u70B9\u201C\u590D\u5236 CA \u8DEF\u5F84\u201D\u540E\u76F4\u63A5\u7C98\u8D34\u8FDB ZCode\u3002\u26A0\uFE0F Windows \u4E0A ZCode \u4E0D\u4F1A\u5C55\u5F00","zcode.hint_b":"\uFF0C\u8BF7\u52FF\u624B\u586B","zcode.hint_c":"\u5F62\u5F0F\u7684\u8DEF\u5F84\u3002","routing.codex_auth_note":"\uFF08OAuth token \u900F\u4F20\uFF0C\u65E0\u9700\u8BC1\u4E66\uFF09","routing.codex_note_a":"\u9ED8\u8BA4 provider \u5C31\u662F openai\uFF0C\u65E0\u9700 model_provider\uFF1B\u82E5 config.toml \u91CC\u6539\u8FC7","routing.codex_note_b":"\uFF0C\u9700\u518D\u52A0\u4E00\u884C","routing.codex_note_c":"\u3002\u8FDE\u4E0D\u4E0A\u65F6\u68C0\u67E5\u4EE3\u7406\u73AF\u5883\u53D8\u91CF\uFF1A\u8BBE\u4E86 HTTP(S)_PROXY \u9700\u52A0","routing.codex_note_d":"\uFF1Bbili \u8DD1\u5728 WSL2/Docker \u91CC\u65F6 Windows \u4FA7\u8BF7\u7528","routing.codex_note_e":"\uFF08\u81EA\u52A8\u8F6C\u53D1\uFF09\uFF0C127.0.0.1 \u4E0D\u901A\u3002","toast.connect_ok":"\u8FDE\u63A5\u6210\u529F\uFF0CHTTP {status}","toast.upstream_reachable":"\u4E0A\u6E38\u53EF\u8FBE HTTP {status} \u2014\u2014 \u7F51\u7EDC\u6B63\u5E38\uFF0C\u8BA4\u8BC1\u7531\u5BA2\u6237\u7AEF\u8D1F\u8D23","toast.passthrough_cleared":"Passthrough \u5DF2\u5173\u95ED \u2713","toast.failed":"\u64CD\u4F5C\u5931\u8D25\uFF1A{msg}"},en:{"summary.title":"Shared summary service (experimental)","summary.enabled":"Enabled","summary.add":"Add target","summary.ref":"Target (provider/model)","summary.no_recipes":"No named dial recipes in providers yet (non-URL entries with baseUrl/api) \u2014 add one in JSON first","summary.credentials":"Recipe credentials","summary.key":"API Key","summary.key_save":"Save Key","summary.key_delete":"Delete Key","summary.key_set":"Configured","summary.key_missing":"Not configured","summary.key_saved":"Key saved","summary.total":"Total deadline (ms)","summary.timeout":"Per-target timeout (ms)","summary.bytes":"Summary limit (bytes)","summary.up":"Move up","summary.down":"Move down","summary.remove":"Remove target","summary.invalid":"Invalid summary configuration; correct it in JSON","nav.overview":"Overview","nav.sessions":"Sessions","nav.config":"Configuration","nav.connect":"Connect","nav.logs":"Logs","logs.title":"Run log","logs.sub":"live tail of bili.log \xB7 filter by session id or keyword, with context / time-window expansion","logs.filter_ph":"filter (session id or keyword)","logs.count":"showing latest {n} of {total} matching lines","logs.omitted":" \xB7 {o} older lines truncated (raise the line cap)","logs.ctx":"context \xB13 lines","logs.win":"time window \xB12 min","logs.empty":"no matching lines (the log file may not exist yet)","logs.path":"log file","logs.dl":"download current view (.txt)","logs.dl_all":"download full log (.txt)","det.log":"Log","det.log_view":"view this session's log \u25B8","fork.label":"\u2605 Fork me on GitHub","common.loading":"Loading\u2026","common.empty":"No data yet","common.copy":"Copy","common.back":"\u2190 Back to session list","common.live":"live","common.sessions":"sessions","common.copied_hint":"Copied \u2713","ses.badge_live_tip":"Session being processed by the current daemon (live data)","common.requests":"requests","common.saved":"saved","common.context":"context","common.ctx_est":"estimated","common.ctx_meas":"measured","common.ctx_est_calib":"est.\xB7calibrated","common.ctx_est_raw":"est.\xB7uncalibrated","common.ctx_upper":"est.\xB7upper bound","common.window":"window","common.title":"title","common.protocol":"protocol","common.upstream":"upstream","common.label":"label","common.none":"\u2014","protocol.unmarked":"unmarked (legacy sessions)","ses.no_title":"untitled","ov.title":"Overview","ov.sub":"Global stats across all live and disk-persisted sessions","ov.total_sessions":"Total sessions","ov.live_now":"currently live","ov.hist":"historical","ov.saved_from_legacy":"{n} of it estimated locally by pre-tagging sessions","ov.total_requests":"Total requests","ov.tokens_saved":"Saved by compression","ov.gross_saved":"Compressed savings (cumulative)","ov.net_saved":"Net savings","ov.sub_repay":"after subtracting re-pay {r} and summary cost {s}","ov.covlost_note":"{n} fold(s) coverage-lost, {x} frozen","det.covlost_sub":"{n} fold(s) coverage-lost ({x} frozen): their covered messages left the resent history \u2014 accrual stopped","ses.covlost_tip":"{n} fold(s) coverage-lost ({x} frozen): the host removed the compressed originals outside bili's knowledge (e.g. dsh native compaction) \u2014 their savings no longer accrue","ov.miss_split":"missed tokens (ledgered sessions): new content {n} \xB7 compression re-read {c} \xB7 TTL expiry / other prefix invalidation {x}","det.hit_pct":"cache hit rate","ses.drop_ph":"hit-rate cost as a share of total input, order: new / comp / TTL expiry","ses.empty_hidden":"{n} empty session(s) hidden (no requests, no context, no ledger; still reachable by direct link)","det.miss_split_line":"missed-token split of the hit rate: new content {n} (\u2212{pn}%) \xB7 compression re-read {c} (\u2212{pc}%) \xB7 TTL expiry / other prefix invalidation {x} (\u2212{px}%)","det.miss_sub":"TTL expiry \u2212{x}% \xB7 comp \u2212{c}% \xB7 new \u2212{n}%","det.fold_time":"when","ov.global_hitpct":"Global cache hit rate","ov.input_tokens":"Input tokens","ov.cached_tokens":"Cached tokens","ov.output_tokens":"Output tokens","ov.by_protocol":"By wire protocol","ov.recent":"Recently active sessions","ov.view_all":"View all \u2192","sys.title":"System status","sys.version":"Version","sys.disk_version":"On-disk version","sys.inflight":"In-flight requests","sys.blind_tunnels":"MITM blind tunnels (CONNECT without TLS)","sys.stale":"Newer version v{disk} on disk \u2014 restart bili to apply (running v{running})","sys.stale_auto":"Auto-restart enabled \u2014 switches automatically when idle","sys.stale_manual":"Auto-restart not enabled (needs --auto-restart-on-update)","sys.pt_on":"Passthrough ON: all requests forwarded as-is, compression disabled. Source:","sys.pt_env":"ACP_PASSTHROUGH env var (or --passthrough flag)","sys.pt_file":"config file passthrough: true","conflict.on":"Compression conflict detected","conflict.found":": traces of ","conflict.what_plugin":"a third-party compression plugin co-resident with bili","conflict.what_native":"client-native auto-compaction rewriting conversation history","conflict.what_join":" and ","conflict.risk_active":" were found. Two compressors on one conversation double-compress and corrupt message refs, which can scramble context \u2014 keep exactly one compressor.","conflict.risk_sibling":" were found. These are bili's OWN sibling extensions, not third-party compressors: while bili drives the session they stand down automatically (BILLION_CONTEXT_NATIVE marker in native mode, /bili/ baseUrl self-check otherwise), so no second compressor is active \u2014 verify your versions are recent and clear this record; nothing needs removing.","conflict.risk_historical":" were found (no events in the last 7 days \u2014 stock records only) \u2014 once you've confirmed the other compressor is removed or blocked by bili, clear them with the button.","conflict.on_suspected":"Possible compression plugin detected","conflict.what_suspected":"a plugin whose name matches compression keywords (not yet verified to actually compress context)","conflict.risk_suspected":" \u2014 a name-only [suspected] signal, not observed evidence of double-compression. Confirm it actually rewrites the model context before acting; a display / tool-output-folding plugin (e.g. pi-compact-transcript) does not double-compress and needs no removal.","conflict.on_unconfirmed":"Unconfirmed compression-related signals detected","conflict.what_signal":"conversation history being rewritten (a change was observed, cause not yet identified)","conflict.risk_unconfirmed":" \u2014 all of the above are UNCONFIRMED signals: they do not prove a second compressor exists (possible causes: client-side edits, an unrecognized compaction shape, or another plugin). Verify before acting; a read-only context viewer or a display / tool-output-folding plugin is not a compressor and needs no removal.","conflict.age_active":"{n} in last 7 days","conflict.age_historical":"{n} older","conflict.where":"Details: Sessions page below or GET /__bili/stats \u2192 conflicts.","conflict.clear_btn":"Clear records","conflict.cleared":"Conflict records cleared","conflict.hint_label":"What to do (per client):","conflict.hint.opencode":'opencode: set "compaction": { "auto": false } in your opencode config (or use bili opencode / bili plugin install opencode, which set it for you)',"conflict.hint.claude":"claude: launch through bili claude (it aligns CLAUDE_CODE_AUTO_COMPACT_WINDOW automatically), or set CLAUDE_CODE_AUTO_COMPACT_WINDOW to bili's effective window yourself","conflict.hint.codex":"codex: bili intercepts native compaction by default (BILI_CODEX_COMPACT=intercept) \u2014 if you set pass, remove the override to stop; otherwise report your bili version","conflict.hint.pi":"pi: the bili extension cancels the client's native auto-compaction while it carries the conversation \u2014 seeing this suggests missing carriage evidence or an old version; report client + bili version","conflict.hint.omp":"omp: the bili extension cancels the client's native auto-compaction while it carries the conversation \u2014 seeing this suggests missing carriage evidence or an old version; report client + bili version","conflict.hint.generic":"disable the client's own auto-compaction (or route this session around bili), then start a fresh session \u2014 the ledger is per-session, so old entries clear with the old session","conflict.hint_more":"{n} more client(s) \u2014 see the Sessions page below","conflict.docs":'full matrix: CONFIGURATION.md \u2192 "Detecting other compression plugins (#1206)"',"advisory.on":"Critical defect advisory","advisory.desc":": the current version has a major defect; bili is upgrading it automatically to a safe version. Reason:","advisory.hint":". If it did not complete automatically, run manually:","alert.title":"Upstream connection problems","alert.item":"Cannot reach {host} ({kind} \xD7{count}, since {first}) \u2014 {hint}","alert.dismiss":"Got it","alert.hint.connect_timeout":"TCP handshake never completed \u2014 upstream/proxy unreachable or blackholed; a bounded transparent replay may be attempted (BILI_REPLAY_RETRY_MAX)","alert.hint.connect_refused":"TCP refused (proxy when configured, else upstream) \u2014 endpoint down or wrong port","alert.hint.proxy_reset":"proxy dropped the connection before the response \u2014 check proxy idle-recycle/payload limits (BILI_PROXY_KEEPALIVE_MAX_MS can shorten our reuse window); a bounded transparent replay may be attempted (BILI_REPLAY_RETRY_MAX)","alert.hint.upstream_reset":"upstream/network reset before the response \u2014 check upstream and local network; a bounded transparent replay may be attempted (BILI_REPLAY_RETRY_MAX)","alert.hint.dns":"name resolution failed \u2014 DNS server or hostname typo; a bounded transparent replay may be attempted (BILI_REPLAY_RETRY_MAX)","alert.hint.tls":"TLS/certificate failure at CONNECT or upstream handshake \u2014 CA/proxy MITM config","alert.hint.unknown":"unclassified transport failure \u2014 report with full error chain","advisory.restartDesc":": the safe version is installed on disk, but this process is still running the affected version. Reason:","advisory.restartHint":". Restart bili to activate it.","pluginadv.on":"High-cost plugin detected","pluginadv.desc":"This plugin re-sends the entire conversation to the model before every tool call for review, so the upstream prefix cache almost never applies (hit rate usually single-digit %) and token cost grows sharply. This is unrelated to bili's compression: bili isolates such requests into a separate sub-session, leaving the main session's prefix cache intact.","pluginadv.hint":"Consider disabling the plugin or asking its maintainers to optimize it; details in the link above (this issue).","ses.title":"Sessions","ses.sub":"Every session across memory and disk \u2014 click a row for details, trajectory & handoff document","ses.search_ph":"Search title, label or id\u2026","ses.th_title":"Session","ses.th_proto":"Protocol","ses.th_upstream":"Upstream","ses.th_reqs":"Reqs","ses.th_ctx":"Context now","ses.th_saved":"Saved","ses.th_hit":"Hit %","ses.th_switches":"Switches","ses.th_switches_tip":"Mid-session model switches \xB7 tokens re-billed because the new model starts from a cold prefix cache (#1535) \xB7 \u{1F511} = relay key/account rotations (credential fingerprint change, #2131) \xB7 \u270D\uFE0F = host system-prompt rewrites (prompt fingerprint change, #2350)","ses.th_keyswitches_tip":"Relay key/account rotation (credential fingerprint changed behind the same URL) \xB7 tokens re-billed because the rotated account starts from a cold cache (#2131)","ses.th_promptswitches_tip":"The host rewrote its system prompt (fingerprint changed between requests, e.g. a periodic dynamic section) \xB7 each rewrite invalidates every downstream prefix-cache entry \u2014 tokens re-billed for the stable prefix (#2350)","det.key_events":"Key switches ({n})","det.key_events_tip":"Credential fingerprint change = the relay rotated to a different account; fingerprints are 12-hex sha256 prefixes, never raw keys","det.key_fp":"key fingerprint","det.prompt_events":"System-prompt rewrites ({n})","det.prompt_events_tip":"System-prompt fingerprint change = the host rewrote its system prompt between requests; fingerprints are 16-hex sha256 prefixes, never raw text","det.prompt_fp":"prompt fingerprint","ses.th_blocks":"Blocks","ses.th_seen":"Last seen","ses.th_client":"Client","ses.th_input":"Cum. input","ses.th_folds":"Compressions","ses.empty":"No sessions yet","ses.empty_hint":"The first request through the proxy creates one automatically","ses.count":"{count} sessions","ses.refresh":"Refresh","ses.load_more":"Load more","data.error":"Failed to load data: {msg} \xB7 auto-retrying with backoff","data.generic":"network error or request timed out","data.timeout":"request timed out (20s)","det.identity":"Identity","det.version":"Proxy version","det.active_pack":"Prompt pack","det.conflicts_title":"Compression conflicts","det.conflicts_hint":"Evidence another compressor touched this session (diagnostic, not history)","det.conflicts_more":"{n} earlier event(s)\u2026","det.conflicts_clear":"Clear this session's records","det.conflicts_cleared":"Cleared","det.usage":"Usage","det.last_input":"Last single-turn input","det.upper_bound":"bound {v} (char-count upper bound \u2014 safety protection only, not actual usage)","det.calib_chip":"k\u0302={k} \xB7 {n} samples \xB7 spread {spread}\xD7 \xB7 {origin}","det.calib_tip":"Calibration factor k\u0302: mean of the last {n} consistent samples (spread {spread}\xD7) on this route+model; deflates estimates only; relearned after a route or model change. Source {origin}{model}.","det.ccr":"CCR content retrieval","det.ccr_detail":"{calls} calls \xB7 {hits} hits \xB7 {misses} misses","det.store":"Content store","det.trajectory":"Context trajectory","det.trajectory_sub":"Per-request input tokens and cache hits; red marks are compression folds","det.trajectory_empty":"No usage samples for this session yet","det.legend_input":"input","det.legend_cached":"of which cached","det.legend_fold":"compression fold","det.legend_window":"context window limit","det.cause_cold":"cold start (no prior cache)","det.cause_comp":"re-caching after compaction","det.cause_ttl":"long gap - upstream TTL expired, re-read","det.fold_short":"fold","ov.gross_note":"sums each fold's savings across every later request (theoretical upper bound)","ov.net_excl":"pre-tagging sessions without samples not included","det.omitted":"earliest {n} samples were trimmed at write time: each session keeps only its most recent 4096 cache samples (unrecoverable), so the curve starts at the oldest retained sample","ov.saved_neg_tip":"Negative net savings: compression re-pay (summary re-read cost) exceeded the theoretical gain; typical of short sessions that ended right after folding","det.cache_econ":"Cache economics","det.ce_new":"New content","det.ce_comp":"Compaction repay","det.ce_ttl":"TTL repay","det.ce_residual":"Residual","det.ce_balanced":"Ledger balanced \u2713","det.ce_unbalanced":"Ledger unbalanced \u2717","det.attr_title":"Attribution \xB7 unexplained residual","det.attr_seam":"\u26A0 Cache seam","det.attr_provider":"\u25B2 Provider-side miss","det.attr_rewind":"\u21A9 History rewound","det.attr_abort":"\u23FB Abort-correlated","det.attr_seam_tip":"Outbound bodies diverged mid-history with no fold/model-switch/restart attribution \u2014 suspected rebuild seam. Value = tokens re-billed on suspect samples","det.attr_provider_tip":"The previous request's entire message list came back byte-identical (whole body, or its prefix with only tail messages appended; above the 512 KiB forensics cap, proven by the stable recorded head plus exact message-count growth) yet the upstream did not serve its cache \u2014 TTL expiry / eviction / relay node rotation. Not a bili rebuild seam","det.attr_rewind_tip":"Client revert/trim shrank the message count \u2014 sanctioned one-time re-bill of the retained prefix, not a defect","det.attr_abort_tip":"Missed samples settled within 30s of a client mid-stream abort \u2014 retry churn rewrites the resent tail; correlation, not causation (overlay marker, not a bucket)","det.attr_prompt":"\u270D\uFE0F Host prompt rewrite","det.attr_prompt_tip":"The system-prompt fingerprint differs between consecutive requests = the host rewrote its system prompt (e.g. a periodic dynamic section) \u2014 every downstream prefix-cache entry is invalidated; the stable-prefix re-bill is charged here (attribution priority restart > model > key > prompt > wire > upstream, #2350)","det.attr_note":"seam / provider-side / rewound / host-rewrite exclusively partition part of the unexplained residual; abort-correlated is an overlay \u2014 none of it is counted in TOTAL above","det.seam_events":"\u26A0 Cache-seam events \xB7 {n}","det.seam_events_tip":"First divergence between consecutive outbound bodies; if reproducible attach bili.log around this time (#1548-family)","det.stab_title":"Body Stability (per-call byte proof)","det.stab_pairs":"{n} adjacent pairs","det.stab_tip":"SHA-256 byte comparison of each outbound body against the previous settled request: identical = byte-exact (e.g. transport retry); diverged pairs classified by first divergence \u2014 head <1KiB = host-side parameter change (model/tools/sampling), tail-append = pure tail growth, mid-history = a real prefix rewrite, offset-unknown = bodies above the retention cap (inequality still proven by digest)","det.stab_identical":"byte-identical","det.stab_head":"head <1KiB (param change)","det.stab_append":"tail-append","det.stab_mid":"mid-history rewrite","det.stab_unknown":"offset unknown (capped)","det.stab_size":"hit% by input size (median)","det.stab_gap":"inter-request gap median: low-hit(<80%) {a}s vs high-hit {b}s","det.seam_col_hit":"hit %","det.seam_col_input":"input","det.seam_col_div":"first divergence","det.seam_msg":"message[{i}] ({prev}\u2192{cur} msgs)","det.seam_mark_tip":"\u26A0 CACHE SEAM #{seq} \xB7 {at} \xB7 hit {hit}% \xB7 first divergence \u2265{lcp} bytes @ message[{msg}] ({prev}\u2192{cur} msgs)","det.legend_seam":"cache seam","det.folds":"Fold breakdown","det.folds_empty":"No fold events yet","det.fold_s":"compressed S","det.fold_sigma":"summary \u03C3","det.fold_h":"post-fold hit %","det.fold_t":"cumulative repay T","det.client_hint":"client","det.self_heal":"Self-heal","det.self_heal_tip":"Stuck-session self-heal has taken over \u2014 see session detail (#2155)","det.self_heal_short":"heal","det.self_heal_degrade_to_proxy":"plugin lane gone \u2192 degraded to proxy mode (tools re-injected)","det.self_heal_suppress_nudge":"nudge idle loop \u2192 suppressed (lifts when compression resumes)","det.legend_base":"system prompt baseline (measured, not compressible)","det.legend_base_est":"baseline est. (system prompt & tools, not compressible)","det.blocks_title":"Compression blocks","det.blocks_count":"{total} \xB7 {active} active","det.blocks_empty":"No compression blocks yet","det.block_active":"active","det.block_external":"external","det.block_inactive":"inactive","det.blocks_download":"download blocks (.md)","det.report_dl":"download cache report (.md)","det.blocks_copy_md":"copy Markdown","det.handoff":"Handoff document","det.handoff_hint":"Same content as bili export \u2014 paste into a new session to continue","det.thinking":"thinking","det.handoff_truncated":"\u26A0\uFE0F Content truncated for display","det.handoff_copy_md":"Copy as Markdown","det.handoff_download":"Download .md","det.not_found":"Session not found","det.not_found_hint":"It may have been deleted or lives outside this data dir","cfg.title":"Configuration","cfg.sub":"Edits write straight to the config file and hot-apply \xB7 check JSON syntax before saving","cfg.file":"Config file","cfg.parse_error":"Config file is not valid JSON \u2014 showing an empty view","cfg.upstream_net":"Upstream network","cfg.up_auto":"auto (follow system proxy)","cfg.up_manual":"manual (explicit proxy)","cfg.up_direct":"direct (force direct)","cfg.passthrough":"Passthrough","cfg.passthrough_desc":"Decides whether traffic matching no route passes through to the target service untouched (no interception, no rewriting). State lives in the config file; when forced by the ACP_PASSTHROUGH env var the UI marks the source and you must unset the variable and restart before changing it here","cfg.pt_off":"Off","cfg.pt_on":"On","cfg.test_hint":"Sends one minimal request to verify reachability; changes nothing","cfg.test_btn":"Test connection","cfg.state":"Connection state","cfg.untested":"Not probed yet","cfg.save":"Save","cfg.unsaved":"\u26A0 Unsaved changes \u2014 nothing is written until you click Save","cfg.file_desc":"This card edits the config file directly \u2014 every top-level field in this JSON takes effect (routes, compression, network, passthrough, promptPack, ccr, \u2026). Saving applies immediately","cfg.quick":"Quick settings","cfg.quick_desc":"Toggle common options without touching JSON \u2014 every change syncs live into the raw editor below (same file, no new config fields); advanced structures like the providers table stay in the JSON","cfg.q_debug":"Debug logging (debug)","cfg.q_passthrough":"Passthrough mode (passthrough) \u2014 pure proxying, no injection, no compression","cfg.q_dsh_compact":"dsh built-in compaction (allowDshCompaction) \u2014 currently DISABLED: bili refuses dsh's native compaction calls; check this only if you actually use dsh's /compact flow","cfg.q_dsh_compact_warn":"If you enable it: once a dsh compaction lands, it permanently replaces the full raw history with a summary (irreversible) and kills bili's compression for that session. On non-web profiles the shipped patch's auto:false still suppresses auto-triggering \u2014 enabling only affects manual /compact.","cfg.q_dsh_compact_env":"Currently forced by the BILI_ALLOW_DSH_COMPACTION environment variable \u2014 changes here won't apply until it is unset and the proxy restarts","cfg.q_pack":"Compression prompt pack (compress.promptPack)","cfg.q_nudge":"Compress growth threshold tokens (compress.nudgeGrowthTokens)","cfg.q_nudge_step":"step of 5000","cfg.q_nudge_low":"below 20000: folding this often degrades summary quality (kernel default 50000)","cfg.q_nudge_high":"above 100000: a very long context between folds may weaken model attention","cfg.q_tiers":"Per-tier compress trigger thresholds tokens (compress.tierNudgeTokens; prefilled with derived defaults, only changed values saved)","cfg.q_tiers_auto":"auto","cfg.q_tiers_step":"step of 5000","cfg.q_tiers_tip_t1":"T1 raw-message fold trigger (measured in raw tokens) \u2014 default = the compress growth threshold above","cfg.q_tiers_tip_t2":"T2 re-distill trigger (measured in T1-summary tokens) \u2014 default = growth threshold \xD7 1.5; raise it so each T2 block carries more project history","cfg.q_tiers_tip_t3":"T3 condense trigger (measured in T2-summary tokens) \u2014 default = growth threshold \xD7 1.5","cfg.q_tiers_desc":"Prefilled with the current derived defaults (T1 = growth step, T2/T3 = \xD71.5); unchanged values are not saved. Note: T2/T3 count lower-tier SUMMARY tokens, not raw \u2014 at the default 75K and a ~10:1 summarization ratio one T2 block carries ~750K raw context; raise T2 for longer projects.","cfg.q_prm":"Preserve recent messages (compress.preserveRecentMessages)","cfg.q_prm_ph":"empty = kernel default","cfg.q_never":"Exclude tools from recent-message preservation (compress.neverPreserveRecentTools)","cfg.q_never_ph":"comma-separated, * globs ok; empty = kernel built-in list (incl. read, bash)","cfg.q_never_note":"Default excludes decompress, search_context, read, bash \u2014 during bulk reads drop read from the list so freshly-read files are not folded immediately","cfg.q_ptools":"Protected tool names (protectedTools, never compressed)","cfg.q_ptools_ph":"comma-separated, * globs ok, e.g. skill, skill_*; empty by default","cfg.q_ptools_warn":"Do not protect chatty tools like read / bash / edit \u2014 their output dominates most sessions' tokens; protecting them means it is never compressed and context keeps growing","cfg.q_parse_err":"The advanced JSON cannot be parsed right now \u2014 quick controls are paused until it is valid again","cfg.q_pack_default_desc":"default (full surface): detailed tool descriptions plus complete compression rules \u2014 richest guidance. Measured \u22482,900+ tokens per request (qwen tokenizer)","cfg.q_pack_lean_desc":"lean: one-line tool descriptions, condensed rules \u2014 terser guidance. Measured \u22481,400 tokens per request (qwen tokenizer), roughly half of default","cfg.q_pack_custom":"custom pack \u2014 loaded by name from ~/.config/billion-context/packs/ (or project .billion-context/packs/)","cfg.q_mitm":"MITM decrypt domains, comma-separated (mitm.domains)","cfg.q_more":"More configuration (full field reference)","cfg.q_more_url":"https://github.com/ranxianglei/billion-context/blob/master/CONFIGURATION.md","cfg.q_mitm_ph":"api.anthropic.com, open.bigmodel.cn","cfg.state_reached":"HTTP {status} \xB7 reachable (auth handled by the client)","cfg.saved":"Saved to config file \u2713","cfg.invalid_json":"Not valid JSON \u2014 not saved","cfg.pt_clear":"Disable passthrough","cfg.resign":"Signed upstreams (resign)","cfg.resign_desc":"Upstreams that sign the request body: any rewrite makes their signature check fail (401). Per the compress-or-refuse contract a signed request has exactly two outcomes \u2014 re-signed+compressed, or refused locally (403); there is no unsigned pass-through mode. The built-in scheme may opt into passthrough (explicitly accepting uncompressed forwarding) when no credential resolves; every other scheme stays unavailable until bili ships its re-signer (no config can pass it through). Entries come from signatures observed at runtime","cfg.resign_loading":"Loading\u2026","cfg.resign_none":"No pending signature refusals \u2014 no un-re-signable signed requests observed","cfg.resign_builtin":"Built-in scheme {scheme} ({label}): bili re-signs automatically (normal compression) when the dsh credential service resolves; otherwise local refusal","cfg.resign_row":"{origin} \xB7 refused {count}\xD7 (since {firstSeen})","cfg.resign_refusing":"refusing by default","cfg.resign_passthrough":"direct (uncompressed)","cfg.resign_disabled":"protection disabled (pre-resign behavior: body is rewritten, upstream may 401)","cfg.resign_copy_hint":"Copy this snippet into the config file: this link forwards byte-untouched WITHOUT compression (built-in scheme only)","cfg.resign_awaiting":"awaiting re-signer support in bili (per the compress-or-refuse contract, no config can pass this through)","con.title":"Connect clients","con.sub":"Point your AI clients at this proxy","con.origin":"Proxy origin","con.method_plugin":"Method 1 \xB7 Install the plugin (recommended \xB7 native mode)","con.method_plugin_hint":"Recommended \u2014 after installing, just run your agent as usual; it goes through billion-context automatically and offers the most complete features. Common management commands:","con.plugin_note":"Plugin mode currently covers these 9 agents: pi \xB7 omp \xB7 claude \xB7 codex \xB7 opencode \xB7 dsh \xB7 kimi \xB7 hermes \xB7 zcode \u2014 other clients use Method 2 or Method 3. For opencode, add --with-mcp at install time to also register its MCP tools","con.launcher_mitm":"Append domains to the certificate-MITM allow-list (e.g. a self-hosted relay): bili pi --mitm-domain api.foo.com","con.note_pi":"Start pi through the proxy \u2014 file-free (#535): env vars + extension registerProvider; real ~/.pi untouched","con.note_codex":"Start codex","con.note_claude":"Start claude","con.note_omp":"Same approach as pi, file-free (#535): env vars + extension registerProvider; real ~/.omp untouched","con.note_opencode":"OpenCode (1.x and 2.x): full guide in the OpenCode section below","con.note_hermes":"file-free (#535): HTTPS_PROXY + SSL_CERT_FILE combined CA bundle \u2014 https via CONNECT MITM, http absolute-form forwarding; real ~/.hermes untouched","con.note_dsh":"deepseek-harness: full native plugin injected via --patch (#941) \u2014 compress/decompress/acp_status registered as real dsh tools; non-loopback upstream via proxy env, loopback keeps overlay DSH_HOME rewrites; built-in deepseek route via DEEPSEEK_BASE_URL; native auto-compaction disabled","con.note_codebuddy":"Tencent CodeBuddy Code CLI: CODEBUDDY_BASE_URL /bili/ rewrite (OpenAI chat-completions wire); budget aligned via CODEBUDDY_AUTO_COMPACT_WINDOW; real ~/.codebuddy untouched","con.note_qoder":"model endpoint hardcoded https (no /bili/ rewrite possible) \u2014 certificate MITM (HTTPS_PROXY + NODE_EXTRA_CA_CERTS); default model host pre-whitelisted (#653)","con.note_trae":"Trae CLI (ByteDance, closed-source Go binary, no base-URL override) \u2014 certificate MITM; model host from TRAE_CLI_API_HOST or default enterprise gateway (#655)","con.note_jcode":"Rust terminal coding agent \u2014 env-style certificate MITM startup; api.z.ai whitelisted by default; local loopback provider direct via NO_PROXY","con.note_kimi":"Kimi Code CLI (Moonshot): aside from the unconditional loopback bypass all traffic follows standard proxy env \u2014 non-loopback https certificate MITM, http absolute-form forwarding; hosts from ~/.kimi-code/config.toml; loopback endpoints cataloged with manual /bili/ prefix hints (#757)","con.note_gemini":"Gemini CLI (Google): GOOGLE_GEMINI_BASE_URL /bili/ rewritten to generativelanguage.googleapis.com (Google native wire); real ~/.gemini zero-touch","con.note_iflow":"iFlow CLI: IFLOW_BASE_URL /bili/ rewritten to apis.iflow.cn/v1 (OpenAI chat-completions wire); real ~/.iflow zero-touch","con.note_qwen":"Qwen Code (multi-protocol gemini-cli fork, no base-URL hook): certificate MITM via HTTPS_PROXY + NODE_EXTRA_CA_CERTS; DashScope/Qwen default model hosts whitelisted; self-hosted relays appended via --mitm-domain","con.note_antigravity":"Antigravity CLI (agy, Google, Gemini CLI successor): CLOUD_CODE_URL /bili/ rewritten to cloudcode-pa.googleapis.com (undocumented language-server env override, verified in the v2.19.1 binary; wire recognized as Google native by path) (#2115)","con.note_mcode":"MiniMax Code CLI: aside from the unconditional loopback bypass, standard proxy env \u2014 non-loopback https certificate MITM, http absolute-form forwarding; hosts from ~/.minimax*/config.yaml; sessions bound via X-Mavis-Session-Id header (#1050)","con.note_aider":"Aider (Python pair programmer): certificate MITM via HTTPS_PROXY + SSL_CERT_FILE/REQUESTS_CA_BUNDLE; endpoint from inherited env, --openai-api-base or .aider.conf.yml; loopback endpoints direct via NO_PROXY (#1048)","con.note_copilot":"Copilot CLI (GitHub, closed-source Go binary) \u2014 certificate MITM; api.githubcopilot.com plus tier subdomains whitelisted (#1049)","con.note_amp":"Amp CLI (Sourcegraph, closed-source Go binary) \u2014 certificate MITM; ampcode.com whitelisted (#1049)","con.note_goose":"Goose (Block, Rust/reqwest): rustls builds trust no CA files \u2014 no proxy env vars at all; built-in openai/anthropic legs redirected via OPENAI_HOST/ANTHROPIC_HOST; custom declarative providers get a regenerated GOOSE_PATH_ROOT overlay rewriting base_url to /bili/; fixed third-party providers warn (#1049)","con.method_launcher":"Method 2 \xB7 Bili launcher (no install \u2014 replaces your usual start command)","con.method_launcher_hint":"With billion-context installed, start your client with one of the commands below instead of its usual way: bili proxy + compression state injected automatically, no client config edits needed","con.launcher_help_pre":"Full list:","con.method_a":"Method 3 \xB7 Generic proxy (URL-prefix routing)","con.method_a_hint":"Only clients that allow changing baseURL (prepend the origin below to their base URL); prefer the launcher above for most clients","con.method_b":"Alternative: MITM certificate routing","con.method_b_hint":"Clients with hardcoded endpoints use HTTPS interception; trust the CA first","card.opencode":"OpenCode","card.codex_key":"Codex","card.codex_login":"Codex (ChatGPT login)","card.claude_key":"Claude Code","card.pi":"Pi","card.other":"Other clients","dt.config_file":"Config file","dt.env":"Environment","dt.example":"Example","dt.auth":"Auth","dt.setting":"Setting","dt.ca_cert":"CA certificate","other.rule":"Prepend to any baseURL:","zcode.title":"ZCode (coding plan)","zcode.method":"MITM transparent proxy","ca.not_ready":"(not yet generated; created on first MITM)","copy.ca":"Copy CA path","zcode.hint_a":'The CA path is the absolute path bili actually generated on this machine \u2014 click "Copy CA path" and paste it straight into ZCode. \u26A0\uFE0F On Windows ZCode does not expand',"zcode.hint_b":", never hand-type","zcode.hint_c":"-style paths.","routing.codex_auth_note":"(OAuth token passthrough, no cert needed)","routing.codex_note_a":"The default provider is openai \u2014 no model_provider needed; if you changed","routing.codex_note_b":"in config.toml, also add","routing.codex_note_c":". If it can't connect and HTTP(S)_PROXY is set, also add","routing.codex_note_d":"; when bili runs in WSL2/Docker use","routing.codex_note_e":"from Windows (auto-forwarded); 127.0.0.1 will not work.","toast.connect_ok":"Connection successful, HTTP {status}","toast.upstream_reachable":"Reachable (HTTP {status}) \u2014 network OK; auth handled by the client","toast.passthrough_cleared":"Passthrough disabled \u2713","toast.failed":"Operation failed: {msg}"}};function translate(locale,key2,vars){let text2=MESSAGES[locale][key2]??MESSAGES["zh-CN"][key2]??key2;if(vars){for(const[name,value]of Object.entries(vars)){text2=text2.split(`{${name}}`).join(String(value))}}return text2}var WEB_CLIENT=`(function () {
|
|
626
|
+
`}function stripGoogleChunk(obj,drop=false,requestText){if(!obj||typeof obj!=="object")return obj;const o=obj;const candidates=o["candidates"];if(!Array.isArray(candidates))return obj;o["candidates"]=candidates.map(c=>{if(!c||typeof c!=="object")return c;const cand=c;const content=cand["content"];if(!content||typeof content!=="object")return c;const cont=content;if(!Array.isArray(cont["parts"]))return c;return{...cand,content:{...cont,parts:cont["parts"].map(p2=>p2&&typeof p2==="object"&&p2["thought"]!==true&&typeof p2["text"]==="string"?{...p2,text:stripAcpTags(p2["text"],drop,requestText)}:p2)}}});return obj}function stripGoogleText(obj,drop=false,requestText){if(Array.isArray(obj)){obj.forEach(c=>{stripGoogleChunk(c,drop,requestText)});return obj}return stripGoogleChunk(obj,drop,requestText)}async function pipePluginJson(stream2,res,session,protocol,upstreamOrigin,absorbInstructed,requestText){const reader=stream2.getReader();const chunks=[];try{for(;;){const{done,value}=await reader.read();if(done)break;if(value&&value.length>0)chunks.push(Buffer.from(value))}}catch(e){if(!res.writableEnded)res.end();if(res.destroyed||res.writableEnded)return;throw e}reader.releaseLock();const text2=Buffer.concat(chunks).toString("utf8");let json;let mutated=false;try{json=JSON.parse(text2);const usage=json["usage"];let sawInputSample=false;if(session&&usage){const input=num3(usage["prompt_tokens"])??num3(usage["input_tokens"]);if(input!==void 0){const cached=num3(usage["prompt_tokens_details"]?.["cached_tokens"])??num3(usage["input_tokens_details"]?.["cached_tokens"])??num3(usage["cache_read_input_tokens"])??num3(usage["prompt_cache_hit_tokens"]);const creation=num3(usage["cache_creation_input_tokens"]);applyUsageSample(session,{inputTokens:input,outputTokens:num3(usage["completion_tokens"])??num3(usage["output_tokens"]),cachedTokens:cached,creationTokens:creation},protocol,upstreamOrigin);markDirty(session);sawInputSample=true}}if(session&&!usage){const sample=googleUsageSample(json);if(sample&&sample.inputTokens!==void 0){applyUsageSample(session,sample,protocol,upstreamOrigin);markDirty(session);sawInputSample=true}}if(session&&!sawInputSample)diagnoseSuccessWithoutUsage(session,"plugin-json");if(session)recordJsonToolWitnesses(session.id,json,protocol)}catch{}const dropEmission=absorbInstructed===true&&containsToolCallEmissionText(text2);if(json&&(dropEmission||containsRenderTagText(text2)||containsMarkerLineText(text2)||containsBiliInternalText(text2)||containsEchoResidue(text2))){json=protocol==="responses"?stripResponsesText(json,dropEmission,requestText):protocol==="anthropic"?stripAnthropicText(json,dropEmission,requestText):protocol==="google"?stripGoogleText(json,dropEmission,requestText):stripOpenaiChatText(json,dropEmission,requestText);mutated=true}if(mutated&&json){res.end(Buffer.from(JSON.stringify(json),"utf8"));return}res.end(text2)}function recordJsonToolWitnesses(sessionId,json,protocol){try{if(protocol==="anthropic"){const content=json["content"];if(!Array.isArray(content))return;for(const block of content){if(!block||typeof block!=="object")continue;const b2=block;if(b2["type"]!=="tool_use")continue;if(typeof b2["name"]!=="string"||b2["name"].length===0)continue;recordToolWitness(sessionId,b2["name"],b2["input"]!==null&&b2["input"]!==void 0?b2["input"]:"")}return}if(protocol==="responses"){const output=json["output"];if(!Array.isArray(output))return;for(const item of output){if(!item||typeof item!=="object")continue;const o=item;if(o["type"]!=="function_call")continue;if(typeof o["name"]!=="string"||o["name"].length===0)continue;recordToolWitness(sessionId,o["name"],typeof o["arguments"]==="string"?o["arguments"]:"")}return}if(protocol==="google"){const candidates=json["candidates"];if(!Array.isArray(candidates))return;for(const cand of candidates){if(!cand||typeof cand!=="object")continue;const content=cand["content"];if(!content||typeof content!=="object")continue;const parts=content["parts"];if(!Array.isArray(parts))continue;for(const p2 of parts){if(!p2||typeof p2!=="object")continue;const fc=p2["functionCall"];if(!fc||typeof fc!=="object")continue;const f2=fc;if(typeof f2["name"]!=="string"||f2["name"].length===0)continue;recordToolWitness(sessionId,f2["name"],f2["args"]!==null&&f2["args"]!==void 0?f2["args"]:"")}}return}const choices=json["choices"];if(!Array.isArray(choices))return;for(const choice of choices){if(!choice||typeof choice!=="object")continue;const message=choice["message"];if(!message||typeof message!=="object")continue;const toolCalls=message["tool_calls"];if(!Array.isArray(toolCalls))continue;for(const tc of toolCalls){if(!tc||typeof tc!=="object")continue;const fn=tc["function"];if(!fn||typeof fn!=="object")continue;const f2=fn;if(typeof f2["name"]!=="string"||f2["name"].length===0)continue;recordToolWitness(sessionId,f2["name"],typeof f2["arguments"]==="string"?f2["arguments"]:"")}}}catch{}}import{lookup}from"dns/promises";import{networkInterfaces}from"os";var RESOLVE_MAX_ATTEMPTS=3;var RESOLVE_BACKOFF_MS=250;var RESOLVE_TIMEOUT_MS=2e3;var BILI_TUNNEL_HEADER="x-bili-tunnel";function parseIpLiteral(s3){const t=s3.trim().toLowerCase();if(/^\d{1,3}(\.\d{1,3}){3}$/.test(t))return t;if(t.includes(":"))return t;return null}function normalizeIpLiteral(ip){const t=ip.trim().toLowerCase();if(!t.startsWith("::ffff:"))return t;const dotted=t.match(/^::ffff:(\d{1,3}(?:\.\d{1,3}){3})$/);if(dotted)return dotted[1];const hex=t.match(/^::ffff:0*([0-9a-f]{1,4}):0*([0-9a-f]{1,4})$/);if(hex){const hi2=parseInt(hex[1],16);const lo2=parseInt(hex[2],16);return`${hi2>>8&255}.${hi2&255}.${lo2>>8&255}.${lo2&255}`}return t}function classifyIp(ip){const lit=normalizeIpLiteral(parseIpLiteral(ip)??"");if(!lit)return"public";if(lit.includes(":")){if(lit==="::1"||lit==="::")return"loopback";if(lit.startsWith("fe8")||lit.startsWith("fe9")||lit.startsWith("fea")||lit.startsWith("feb"))return"linkLocal";if(lit.startsWith("fc")||lit.startsWith("fd"))return"private";return"public"}const parts=lit.split(".").map(Number);const[a,b2]=parts;if(a===127)return"loopback";if(a===169&&b2===254)return"linkLocal";if(a===10||a===0)return"private";if(a===172&&b2>=16&&b2<=31)return"private";if(a===192&&b2===168)return"private";if(a===100&&b2>=64&&b2<=127)return"private";return"public"}var dnsResolveHost=async host=>{let timer5;try{const res=await Promise.race([lookup(host,{all:true,family:0}),new Promise((_2,reject)=>{timer5=setTimeout(()=>reject(Object.assign(new Error("ETIMEDOUT"),{code:"ETIMEDOUT"})),RESOLVE_TIMEOUT_MS);timer5.unref?.()})]);return res.map(r=>r.address)}finally{if(timer5)clearTimeout(timer5)}};var localAddrCache;function localMachineIps(){const now=Date.now();if(!localAddrCache||now-localAddrCache.at>3e4){const ips=new Set(["127.0.0.1","::1"]);for(const list of Object.values(networkInterfaces())){for(const ni2 of list??[]){if(ni2.address)ips.add(ni2.address.toLowerCase())}}for(let i=0;i<=255;i++)ips.add(`127.0.0.${i}`);localAddrCache={at:now,ips}}return localAddrCache.ips}function allowlistHit(host,port,allowlist){const h=host.toLowerCase();const hp=`${h}:${port}`;return allowlist.some(e=>e===h||e===hp)}async function checkTunnelDestination(origin,ctx){let u2;try{u2=new URL(origin)}catch{return{ok:false,code:"invalid",message:`invalid tunnel destination ${origin}`}}const host=u2.hostname.replace(/^\[|\]$/g,"").toLowerCase();const port=u2.port?Number(u2.port):u2.protocol==="https:"?443:80;let ips;const literal=parseIpLiteral(host);if(literal){ips=[normalizeIpLiteral(literal)]}else if(ctx.egressProxied){return{ok:true}}else{const resolve=ctx.resolveHost??dnsResolveHost;const backoff=ctx.resolveBackoffMs??RESOLVE_BACKOFF_MS;let resolved;let lastErrCode;for(let attempt=1;attempt<=RESOLVE_MAX_ATTEMPTS;attempt++){try{resolved=await resolve(host);break}catch(err2){const code=err2?.code;if(code)lastErrCode=code;if(attempt===RESOLVE_MAX_ATTEMPTS)break;await new Promise(r=>setTimeout(r,backoff))}}if(resolved===void 0)return{ok:false,code:"unresolvable",message:`cannot resolve tunnel destination ${host}${lastErrCode?` (${lastErrCode})`:""}: local name resolution failed \u2014 the local resolver may be unreachable or taken over by another DNS service (VPN/MagicDNS); route egress through an upstream proxy to have the destination resolved remotely`};ips=resolved;if(ips.length===0)return{ok:false,code:"unresolvable",message:`no addresses for tunnel destination ${host}`};if(ips.some(ip=>classifyIp(ip)==="linkLocal")&&ips.some(ip=>classifyIp(ip)!=="linkLocal")){ips=ips.filter(ip=>classifyIp(ip)!=="linkLocal")}}if(ctx.selfPort!==void 0&&port===ctx.selfPort){const mine=(ctx.localIps??localMachineIps)();if(ips.some(ip=>ip==="0.0.0.0"||ip==="::"||mine.has(ip.toLowerCase())||mine.has(`::ffff:${ip.toLowerCase()}`))){return{ok:false,code:"self",message:"the bili tunnel may not target the proxy itself"}}}const classes=ips.map(ip=>classifyIp(ip));if(classes.includes("linkLocal")){return{ok:false,code:"linkLocal",message:"link-local / metadata destinations are blocked from the bili tunnel"}}if(!classes.every(c=>c==="public")){if(ctx.clientLoopback)return{ok:true};if(allowlistHit(host,port,ctx.allowlist))return{ok:true};return{ok:false,code:"privateRemote",message:`tunnel destination ${host} resolves to a loopback/private address; remote clients may only reach it via BILI_TUNNEL_ALLOWED_HOSTS`}}return{ok:true}}function tunnelAllowlistFromEnv(env=process.env){const raw=env.BILI_TUNNEL_ALLOWED_HOSTS??"";return raw.split(",").map(s3=>s3.trim().toLowerCase()).filter(s3=>s3.length>0)}import fs17 from"fs";import path33 from"path";import{performance as performance3}from"perf_hooks";var codex_models_snapshot_default={source:"openai/codex main (commit 868c9ed) \u2014 codex-rs/models-manager/models.json",fetchedAt:"2026-08-28T17:09:46Z",count:10,models:[{slug:"gpt-5.6-sol",contextWindow:272e3,maxContextWindow:872e3},{slug:"gpt-5.6-terra",contextWindow:272e3,maxContextWindow:872e3},{slug:"gpt-5.6-luna",contextWindow:272e3,maxContextWindow:872e3},{slug:"gpt-daybreak-blue-latest",contextWindow:272e3,maxContextWindow:872e3},{slug:"gpt-daybreak-red-latest",contextWindow:372e3,maxContextWindow:372e3},{slug:"gpt-5.5",contextWindow:272e3,maxContextWindow:272e3},{slug:"gpt-5.4",contextWindow:272e3,maxContextWindow:1e6},{slug:"gpt-5.4-mini",contextWindow:272e3,maxContextWindow:272e3},{slug:"gpt-5.2",contextWindow:272e3,maxContextWindow:272e3},{slug:"codex-auto-review",contextWindow:272e3,maxContextWindow:872e3}]};import fs13 from"fs";import path27 from"path";var SNAPSHOT=codex_models_snapshot_default;var PRISTINE=SNAPSHOT.models.map(m2=>({...m2}));var TABLE=PRISTINE.map(m2=>({...m2}));var CODEX_FALLBACK_CONTEXT_WINDOW=272e3;function resolvedWindow(m2){return m2.contextWindow??m2.maxContextWindow??CODEX_FALLBACK_CONTEXT_WINDOW}function lookupModel(model,table){const direct=longestPrefixMatch(model,table);if(direct)return direct;const slash=model.indexOf("/");if(slash>0){const namespace=model.slice(0,slash);const suffix=model.slice(slash+1);if(!suffix.includes("/")&&/^[A-Za-z0-9_-]+$/.test(namespace)){const m2=longestPrefixMatch(suffix,table);if(m2)return m2}}return void 0}function longestPrefixMatch(model,table){let best;for(const m2 of table){if(!model.startsWith(m2.slug))continue;if(!best||m2.slug.length>best.slug.length)best=m2}return best}function codexWindowForModel(model){const entry=lookupModel(model,TABLE);return entry?resolvedWindow(entry):CODEX_FALLBACK_CONTEXT_WINDOW}var liveTable;function positiveWindow(value){return typeof value==="number"&&Number.isSafeInteger(value)&&value>0?value:void 0}function readCodexModelWindow(model,codexHome){const file=path27.join(codexHome,"models_cache.json");try{const stat4=fs13.statSync(file);const key2=`${file}|${stat4.ino}|${stat4.mtimeMs}|${stat4.ctimeMs}|${stat4.size}`;if(liveTable?.key!==key2){const parsed=JSON.parse(fs13.readFileSync(file,"utf8"));if(!parsed||typeof parsed!=="object"||!("models"in parsed)||!Array.isArray(parsed.models))return void 0;const models=[];for(const value of parsed.models){if(!value||typeof value!=="object"||typeof value.slug!=="string"||!value.slug)continue;const contextWindow=positiveWindow(value.context_window);const maxContextWindow=positiveWindow(value.max_context_window);if(contextWindow===void 0&&maxContextWindow===void 0)continue;const percent=value.effective_context_window_percent??95;if(typeof percent!=="number"||!Number.isInteger(percent)||percent<=0||percent>100)continue;models.push({slug:value.slug,contextWindow,maxContextWindow,effectiveContextWindowPercent:percent})}liveTable={key:key2,models}}const entry=lookupModel(model,liveTable.models);if(!entry)return void 0;const configured=positiveWindow(readCodexConfig(codexHome).contextWindow);const window2=configured===void 0?resolvedWindow(entry):Math.min(configured,entry.maxContextWindow??configured);return Math.floor(window2*(entry.effectiveContextWindowPercent??95)/100)}catch{return void 0}}function codexAlignedWindow(limit,model,headers,clientWindow){if(!isCodexClient(headers))return{limit,clamped:false};const w2=positiveWindow(clientWindow)??readCodexModelWindow(model,resolveCodexHome(process.env))??codexWindowForModel(model);if(limit>w2)return{limit:w2,clamped:true};return{limit,clamped:false}}var byAgent=new Map;function recordAgentProviders(agent,recipes){if(Object.keys(recipes).length===0)byAgent.delete(agent);else byAgent.set(agent,recipes)}function agentProviderRecipes(){const out={};for(const recipes of byAgent.values())Object.assign(out,recipes);return out}function agentRegistryStatus(){return[...byAgent.entries()].map(([agent,recipes])=>({agent,providers:Object.entries(recipes).map(([name,recipe])=>({name,models:Object.keys(recipe.models).sort()})).sort((a,b2)=>a.name.localeCompare(b2.name))}))}var APIS=new Set(["anthropic","openai","responses","google"]);function sanitizeAgentProviderField(value,max){return value.replace(/[\x00-\x1f\x7f]/g,"?").slice(0,max)}function parseAgentProviderEntry(name,value){if(!validSummaryCredentialName(name))throw new Error(`Invalid provider name "${name}"`);if(!value||typeof value!=="object"||Array.isArray(value))throw new Error(`Provider "${name}" must be an object`);const recipe=value;if(typeof recipe.baseUrl!=="string"||recipe.baseUrl.length===0||recipe.baseUrl.length>2048)throw new Error(`Provider "${name}" needs a baseUrl`);if(typeof recipe.api!=="string"||!APIS.has(recipe.api))throw new Error(`Provider "${name}" api must be one of: anthropic, openai, responses, google`);if(typeof recipe.apiKey!=="string"||recipe.apiKey.length===0||recipe.apiKey.length>8192||/[\x00-\x20\x7f]/.test(recipe.apiKey))throw new Error(`Provider "${name}" needs an apiKey`);let url;try{url=new URL(recipe.baseUrl)}catch{throw new Error(`Provider "${name}" baseUrl is not a valid URL`)}const loopback=["localhost","127.0.0.1","[::1]"].includes(url.hostname);if(url.protocol!=="https:"&&!(url.protocol==="http:"&&loopback)||url.username||url.password||url.hash||url.pathname.includes("/bili/")||url.pathname.startsWith("/__bili/"))throw new Error(`Provider "${name}" baseUrl must be HTTPS (or loopback HTTP) without credentials or proxy recursion`);if(!recipe.models||typeof recipe.models!=="object"||Array.isArray(recipe.models))throw new Error(`Provider "${name}" needs a models object`);const models=recipe.models;const modelEntries=Object.entries(models);if(modelEntries.length===0||modelEntries.length>64)throw new Error(`Provider "${name}" needs 1 to 64 models`);const outModels={};for(const[model,knobs]of modelEntries){if(model.length===0||model.length>200)throw new Error(`Provider "${name}" has an invalid model name`);const parsed={};if(knobs.contextWindow!==void 0){if(typeof knobs.contextWindow!=="number"||!Number.isSafeInteger(knobs.contextWindow)||knobs.contextWindow<2048||knobs.contextWindow>1e7)throw new Error(`Provider "${name}" model "${model}" has an invalid contextWindow`);parsed.contextWindow=knobs.contextWindow}if(knobs.outputTokens!==void 0){if(typeof knobs.outputTokens!=="number"||!Number.isSafeInteger(knobs.outputTokens)||knobs.outputTokens<128)throw new Error(`Provider "${name}" model "${model}" has an invalid outputTokens`);parsed.outputTokens=knobs.outputTokens}if(knobs.stream!==void 0){if(typeof knobs.stream!=="boolean")throw new Error(`Provider "${name}" model "${model}" has an invalid stream flag`);parsed.stream=knobs.stream}outModels[model]=parsed}return{baseUrl:recipe.baseUrl.replace(/\/+$/,""),api:recipe.api,apiKey:recipe.apiKey,models:outModels}}function parseAgentProviderReport(payload){if(!payload||typeof payload!=="object"||Array.isArray(payload))throw new Error("Expected a JSON object");const report=payload;if(typeof report.agent!=="string"||!/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(report.agent))throw new Error("Invalid agent name");if(!report.providers||typeof report.providers!=="object"||Array.isArray(report.providers))throw new Error("Expected a providers object");const entries=Object.entries(report.providers);if(entries.length===0||entries.length>64)throw new Error("Expected 1 to 64 providers");const registered={};const skipped=[];for(const[name,value]of entries){try{registered[name]=parseAgentProviderEntry(name,value)}catch(err2){skipped.push({name:sanitizeAgentProviderField(name,64)||"<unnamed>",reason:sanitizeAgentProviderField(err2 instanceof Error?err2.message:String(err2),200)})}}return{agent:report.agent,registered,skipped}}import{createHash as createHash20}from"crypto";var anchors=new Map;function personaFingerprint(systemText){return createHash20("sha256").update(systemText,"utf8").digest("hex").slice(0,16)}function resolvePersonaKey(rawId,systemText,messages){if(!systemText)return{key:rawId,action:"passthrough"};const fp=personaFingerprint(systemText);const anchored=anchors.get(rawId);if(anchored===void 0){anchors.set(rawId,fp);return{key:rawId,action:"claim"}}if(anchored===fp)return{key:rawId,action:"match"};if(prefixAffinity.chainContinues(messages,rawId)){anchors.set(rawId,fp);return{key:rawId,action:"migrate"}}return{key:`${rawId}|sub:${fp}`,action:"fork"}}function personaNamespace(rawId,systemText,messages,log2){const list=Array.isArray(messages)?messages:[];const text2=typeof systemText==="string"&&systemText.trim().length>0?systemText:"";const res=resolvePersonaKey(rawId,text2,list);if(res.action==="migrate"){log2("info",`[persona] persona text changed mid-conversation but the history continues ${rawId}'s chain \u2014 anchor migrated, compression state stays on the raw key (#2241/#2250)`)}return res.key}import fs14 from"fs";import os6 from"os";import path28 from"path";var UUID_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;var MAX_HEAD_BYTES=256*1024;var MAX_PROJECT_DIRS=2e3;function isClaudeSessionUuid(id){return UUID_RE.test(id)}function claudeConfigDirs(env=process.env){const dirs=[];for(const v2 of[env.CLAUDE_CONFIG_DIR,path28.join(os6.homedir(),".claude")]){if(typeof v2!=="string"||v2.trim().length===0)continue;const resolved=path28.resolve(v2.trim());if(!dirs.includes(resolved))dirs.push(resolved)}return dirs}function findTranscripts(sessionId,configDirs){const found=[];for(const dir of configDirs){const projects=path28.join(dir,"projects");let root;let entries;try{root=fs14.realpathSync(projects);entries=fs14.readdirSync(root,{withFileTypes:true})}catch{continue}let probed=0;for(const entry of entries){if(!entry.isDirectory())continue;if(++probed>MAX_PROJECT_DIRS)break;const candidate=path28.join(root,entry.name,`${sessionId}.jsonl`);try{const real=fs14.realpathSync(candidate);if(!real.startsWith(root+path28.sep))continue;if(!fs14.statSync(real).isFile())continue;if(!found.includes(real))found.push(real)}catch{}}}return found}function readForkedFrom(file,selfId){let head;let complete;try{const fd=fs14.openSync(file,"r");try{const buf=Buffer.alloc(MAX_HEAD_BYTES);const n=fs14.readSync(fd,buf,0,MAX_HEAD_BYTES,0);head=buf.subarray(0,n).toString("utf8");complete=n<MAX_HEAD_BYTES}finally{fs14.closeSync(fd)}}catch{return void 0}const lines=head.split("\n");if(!complete||!head.endsWith("\n"))lines.pop();for(const line of lines){if(!line.includes("forkedFrom"))continue;let obj;try{obj=JSON.parse(line)}catch{continue}const ff=obj?.forkedFrom;const parent=ff?.sessionId;if(typeof parent==="string"&&isClaudeSessionUuid(parent)&&parent.toLowerCase()!==selfId.toLowerCase())return parent}return void 0}function claudeTranscriptParent(sessionId,configDirs=claudeConfigDirs()){if(!isClaudeSessionUuid(sessionId))return{kind:"none",reason:"invalid-id"};const files=findTranscripts(sessionId,configDirs);if(files.length===0)return{kind:"none",reason:"no-transcript"};const parents=new Map;for(const file of files){const parent=readForkedFrom(file,sessionId);if(parent&&!parents.has(parent))parents.set(parent,file)}if(parents.size===0)return{kind:"none",reason:"no-fork-marker"};if(parents.size>1)return{kind:"none",reason:"ambiguous"};const[[parentId,transcript]]=[...parents.entries()];return{kind:"parent",parentId,transcript}}function resolveClaudeTranscriptLineage(sessionId,isKnown,opts){const configDirs=opts?.configDirs??claudeConfigDirs();const maxDepth=opts?.maxDepth??8;const seen=new Set([sessionId.toLowerCase()]);let current=sessionId;for(let hop=1;hop<=maxDepth;hop++){const step=claudeTranscriptParent(current,configDirs);if(step.kind==="none")return{parentId:void 0,reason:hop===1?step.reason:`ancestor ${current}: ${step.reason}`};const key2=step.parentId.toLowerCase();if(seen.has(key2))return{parentId:void 0,reason:"cycle"};seen.add(key2);if(isKnown(step.parentId))return{parentId:step.parentId,hops:hop};current=step.parentId}return{parentId:void 0,reason:"depth-cap"}}import{createBrotliDecompress,createGunzip,createInflate,createInflateRaw}from"zlib";var DecompressedTooLargeError=class extends Error{constructor(limit){super(`decompressed request exceeds ${limit} bytes`);this.limit=limit;this.name="DecompressedTooLargeError"}limit};function streamDecode(factory,input,max){return new Promise((resolve,reject)=>{const chunks=[];let size=0;const decoder=factory();decoder.on("data",chunk=>{size+=chunk.length;if(size>max){decoder.destroy();reject(new DecompressedTooLargeError(max));return}chunks.push(chunk)});decoder.on("end",()=>resolve(Buffer.concat(chunks,size)));decoder.on("error",err2=>reject(err2));decoder.end(input)})}async function decodeZstd(input,max){const chunks=[];let size=0;const decoder=new Decompress(chunk=>{size+=chunk.byteLength;if(size>max)throw new DecompressedTooLargeError(max);chunks.push(Buffer.from(chunk))});decoder.push(input,true);return Buffer.concat(chunks,size)}async function decodeOne(coding,input,max){if(coding==="gzip"||coding==="x-gzip")return streamDecode(createGunzip,input,max);if(coding==="br")return streamDecode(createBrotliDecompress,input,max);if(coding==="zstd")return decodeZstd(input,max);if(coding==="deflate"){try{return await streamDecode(createInflate,input,max)}catch(err2){if(err2 instanceof DecompressedTooLargeError)throw err2;return streamDecode(createInflateRaw,input,max)}}throw new Error(`unsupported request content-encoding: ${coding}`)}async function decodeRequestBody(contentEncoding,input,maxOutputBytes){const codings=(contentEncoding??"").split(",").map(coding=>coding.trim().toLowerCase()).filter(coding=>coding&&coding!=="identity");if(codings.length===0)return{body:input,decoded:false};let body=input;for(const coding of codings.reverse()){body=await decodeOne(coding,body,maxOutputBytes);if(body.byteLength>maxOutputBytes)throw new DecompressedTooLargeError(maxOutputBytes)}return{body,decoded:true}}var BILI_HOP_HEADER="x-bili-hop";function parseLauncherModelWindows(raw){if(!raw)return{};try{const parsed=JSON.parse(raw);if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return{};const out={};for(const[id,v2]of Object.entries(parsed)){if(typeof v2==="number"&&Number.isFinite(v2)&&v2>0)out[id]=Math.floor(v2)}return out}catch{return{}}}var LAUNCHER_MODEL_WINDOWS=parseLauncherModelWindows(process.env.BILI_LAUNCHER_MODEL_WINDOWS);function parseLauncherModelMaxOutputs(raw){if(!raw)return{};try{const parsed=JSON.parse(raw);if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return{};const out={};for(const[id,v2]of Object.entries(parsed)){if(typeof v2==="number"&&Number.isFinite(v2)&&v2>0)out[id]=Math.floor(v2)}return out}catch{return{}}}var LAUNCHER_MODEL_MAX_OUTPUTS=parseLauncherModelMaxOutputs(process.env.BILI_LAUNCHER_MODEL_MAX_OUTPUTS);function launcherMaxOutput(model){return LAUNCHER_MODEL_MAX_OUTPUTS[model]}function launcherContextWindow(model){return LAUNCHER_MODEL_WINDOWS[model]}var windowSourceLogged=new Set;var MAX_ANTHROPIC_BETA_WINDOW=1e7;function anthropicBetaContextWindow(headers){const raw=headers["anthropic-beta"];if(raw===void 0)return void 0;const list=Array.isArray(raw)?raw.join(","):raw;let best;for(const part of list.split(",")){const m2=/^context-(\d+)m\b/.exec(part.trim().toLowerCase());if(!m2)continue;const n=Number.parseInt(m2[1],10);if(!Number.isFinite(n)||n<=0)continue;const w2=Math.min(n*1e6,MAX_ANTHROPIC_BETA_WINDOW);if(best===void 0||w2>best)best=w2}return best}function expandedContextSuffixWindow(model){if(!model)return void 0;const m2=/\[(\d+)m\]$/i.exec(model.trim());if(!m2)return void 0;const n=Number.parseInt(m2[1],10);if(!Number.isFinite(n)||n<=0)return void 0;return Math.min(n*1e6,MAX_ANTHROPIC_BETA_WINDOW)}var registryWindowCappedLogged=new Set;function capRegistryWindowByStandard(model,registryWindow,hasTierEvidence){if(registryWindow===void 0||hasTierEvidence)return registryWindow;const std=tierGatedStandardWindow(model);if(std===void 0||registryWindow<=std)return registryWindow;if(!registryWindowCappedLogged.has(model)){registryWindowCappedLogged.add(model);log("info",`[window] registry advertises ${registryWindow} for ${model} but the request carries no tier evidence (context-Nm beta header / [Nm] suffix) \u2014 capping at the built-in standard ${std} (#1321)`)}return std}function safeSessionId(id){return(id??"unknown").replace(/[^a-zA-Z0-9._-]/g,"_")}var NO_IDENTITY_MESSAGE="Missing stable conversation identity. Send one of the headers: x-session-id, x-session-affinity, x-acp-session, x-opencode-session, x-claude-code-session-id, session-id \u2014 or body session_id / prompt_cache_key (responses/openai/anthropic). Requests replaying a conversation history are matched by content prefix affinity (#309); this one carries no usable history signal.";var UPSTREAM_HOP_HEADERS=new Set(["host","content-length","connection","keep-alive","transfer-encoding","proxy-authenticate","proxy-authorization","proxy-connection","x-bili-passthrough","te","trailer","upgrade"]);var RESPONSE_ONLY_STRIP_HEADERS=new Set(["content-encoding"]);function connectionNamedHeaders(conn){const out=new Set;if(!conn)return out;for(const part of Array.isArray(conn)?conn:[conn]){for(const name of part.split(",")){const t=name.trim().toLowerCase();if(t)out.add(t)}}return out}function buildForwardHeaders(headers){const out={};for(const[k2,v2]of Object.entries(headers)){if(k2.toLowerCase()==="content-length"||k2.toLowerCase()==="host")continue;out[k2]=v2}out["content-type"]="application/json";return out}var ACP_TAG_RE=/\x3cacp\s+tokens=\\"?[0-9]+(?:\.[0-9]+)?K?\\"?\s+type=\\"?[^\\"]*\\"?\s*\x3em[0-9]{1,8}\x3c\/acp\x3e/;function artifactSeedHit(body){if(body.length===0)return false;const tagSeed=body.includes("<acp ");const toolSeed=body.includes('"acp_status"')&&body.includes('"search_context"');return tagSeed||toolSeed}function detectAcpArtifacts(body,parsed){if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){const encoded=JSON.stringify(historyTextOf(parsed));if(encoded.includes("<acp ")&&ACP_TAG_RE.test(encoded))return"tags"}else if(body.includes("<acp ")&&ACP_TAG_RE.test(body.toString("utf8"))){return"tags"}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){const names=historyToolCallNames(parsed);if(names.has("acp_status")&&names.has("search_context"))return"tool-history"}return null}function historyTextOf(parsed){const parts=[];const container=Array.isArray(parsed.messages)?parsed.messages:Array.isArray(parsed.input)?parsed.input:Array.isArray(parsed.contents)?parsed.contents:null;if(container){for(const item of container)collectHistoryText(item,parts)}return parts.join("\n")}function collectHistoryText(item,out){if(!item||typeof item!=="object"||Array.isArray(item))return;const it2=item;if(it2.role==="system"||it2.role==="developer")return;const content=it2.content;if(typeof content==="string")out.push(content);else if(Array.isArray(content)){for(const block of content){if(block&&typeof block==="object"&&!Array.isArray(block)&&typeof block.text==="string"){out.push(block.text)}}}const parts=it2.parts;if(Array.isArray(parts)){for(const part of parts){if(part&&typeof part==="object"&&!Array.isArray(part)&&typeof part.text==="string"){out.push(part.text)}}}}function historyToolCallNames(parsed){const names=new Set;const container=Array.isArray(parsed.messages)?parsed.messages:Array.isArray(parsed.input)?parsed.input:Array.isArray(parsed.contents)?parsed.contents:null;if(!container)return names;for(const item of container)visitHistoryItem(item,names);return names}function visitHistoryItem(item,names){if(!item||typeof item!=="object"||Array.isArray(item))return;const it2=item;const toolCalls=it2.tool_calls;if(Array.isArray(toolCalls)){for(const tc of toolCalls){if(!tc||typeof tc!=="object"||Array.isArray(tc))continue;const fn=tc.function;if(fn&&typeof fn==="object"&&!Array.isArray(fn)&&typeof fn.name==="string"){names.add(fn.name)}}}if(it2.type==="function_call"&&typeof it2.name==="string")names.add(it2.name);const content=it2.content;if(Array.isArray(content)){for(const block of content){if(block&&typeof block==="object"&&!Array.isArray(block)&&block.type==="tool_use"&&typeof block.name==="string"){names.add(block.name)}}}const parts=it2.parts;if(Array.isArray(parts)){for(const part of parts){if(!part||typeof part!=="object"||Array.isArray(part))continue;const fc=part.functionCall;if(fc&&typeof fc==="object"&&!Array.isArray(fc)&&typeof fc.name==="string"){names.add(fc.name)}}}}var PI_SUBAGENT_CHILD_MARKER="<active_agent name=";var BILI_INJECTABLE_TOOL_NAMES=new Set(["compress","decompress","search_context","acp_status","acp_rule","acp_retrieve","absorb","image_full"]);function detectPiSubagentChildSignal(bodyBuffer){const idx=bodyBuffer.indexOf(PI_SUBAGENT_CHILD_MARKER);if(idx<0)return{present:false};let agent;const tail=bodyBuffer.subarray(idx,Math.min(bodyBuffer.length,idx+PI_SUBAGENT_CHILD_MARKER.length+96)).toString("utf8").replace(/\\/g,"");const m2=tail.match(/name="([^"]*)"/);if(m2&&m2[1])agent=m2[1];return{present:true,...agent?{agent}:{}}}function isInjectableName(v2){return typeof v2==="string"&&BILI_INJECTABLE_TOOL_NAMES.has(v2)}function exposesBiliInjectableTool(tools){if(!Array.isArray(tools))return false;for(const entry of tools){if(typeof entry!=="object"||entry===null)continue;const rec=entry;if(isInjectableName(rec.name))return true;const fn=rec.function;if(typeof fn==="object"&&fn!==null&&isInjectableName(fn.name))return true;const decls=rec.functionDeclarations;if(Array.isArray(decls)){for(const d of decls){if(typeof d==="object"&&d!==null&&isInjectableName(d.name))return true}}}return false}function piSubagentChannelFallback(bodyBuffer,parsed){const signal=detectPiSubagentChildSignal(bodyBuffer);if(!signal.present)return signal;const tools=typeof parsed==="object"&&parsed!==null?parsed.tools:void 0;if(exposesBiliInjectableTool(tools))return{present:false};return signal}var MESSAGE_MARK_CAP=3;function computeAnthropicMessageMarks(processed,ephemeralTailCount,session){const marks=new Map;if(noCacheControl()){session.metadata["anthropicCacheMarkIds"]=[];return marks}if(processed.length===0||processed.length<=ephemeralTailCount){session.metadata["anthropicCacheMarkIds"]=[];return marks}const liveIds=new Set(processed.map(m2=>m2.id).filter(id=>typeof id==="string"&&id.length>0));const kept=(session.metadata["anthropicCacheMarkIds"]??[]).filter(id=>liveIds.has(id));const lastIndex=processed.length-1-ephemeralTailCount;const currentId=processed[lastIndex]?.id;if(typeof currentId==="string"&¤tId.length>0&&!kept.includes(currentId)&&kept.length<MESSAGE_MARK_CAP){kept.push(currentId)}session.metadata["anthropicCacheMarkIds"]=kept;for(const id of kept)marks.set(id,{type:"ephemeral"});return marks}function anthropicToolsCarryCacheControl(tools){if(!Array.isArray(tools))return false;return tools.some(t=>typeof t==="object"&&t!==null&&t.cache_control!==void 0)}function stampAnthropicSystemCacheControl(systemOut,ours=true){if(noCacheControl())return systemOut;if(!ours)return systemOut;if(typeof systemOut==="string"&&systemOut.length>0){return[{type:"text",text:systemOut,cache_control:{type:"ephemeral"}}]}if(!Array.isArray(systemOut)||systemOut.length===0)return systemOut;for(const block of systemOut){if(block.cache_control)return systemOut}const last=systemOut.length-1;systemOut[last]={...systemOut[last],cache_control:{type:"ephemeral"}};return systemOut}async function prepareAnthropic(parsed,req,opts,core,config,prompts,surface,log2,session,pluginMode,upstreamOrigin,reasoning,visibilityMarkers,decide){const sessionId=session.id;const stream2=parsed.stream===true;++session.stats.requests;const injectTools=opts.compress.injectTool&&!pluginMode;const stripReasoning=msgs=>withReasoningDrop(msgs,reasoning,log2,sessionId,isStrictReasoningEcho(session,upstreamOrigin,modelIdOf(parsed)));if(isAutoModeClassifier(parsed)){log2("info",`[${sessionId}] auto-mode classifier passthrough (skipping compress injection)`);return{body:JSON.stringify(parsed),session,processedMessages:[],originalMessages:[],anthropicSystem:parsed.system,protocol:"anthropic",stream:stream2,compressInjected:false,pluginMode,nudge:void 0,prompts,surface}}let processedMessages=[];let attachedRetrievals=[];let attachedRetrievalNoteIds=[];let originalMessages=[];let nudge;let rebuiltMessages=parsed.messages;let anthropicCacheMarks;let clientCacheControls;let systemOut=parsed.system;let toolsOut=parsed.tools;let sysNotes=[];const clientSystem=parsed.system;const anthropicBillingBlock=extractBillingAttributionBlock(clientSystem);if(opts.stableSystemAnchor&&!pluginMode){const fresh=extractSystem(parsed.system);const outcome=reconcileSystemAnchor(session,"anthropic",fresh,sessionId,log2);sysNotes=outcome.notes;if(outcome.outbound!==fresh){parsed.system=buildSystem(outcome.outbound,parsed.system)}}const strippedPanels=stripAcpPanelMessages(parsed.messages);if(strippedPanels>0){log2("info",`[${sessionId}] stripped ${strippedPanels} ACP panel message(s) before projection (UI-only, issue #359)`)}const strippedMarkerLines=stripAcpStatusMarkers(parsed.messages);if(strippedMarkerLines>0){log2("info",`[${sessionId}] stripped ${strippedMarkerLines} ACP status marker line(s) from incoming history (ephemeral proxy status, issue #1029)`)}const strippedCarriers=stripEmbeddedChainCarriers(parsed,"anthropic");if(strippedCarriers>0){log2("info",`[${sessionId}] stripped ${strippedCarriers} embedded chain checkpoint(s) from incoming history (leaked egress control data, issue #1542)`)}try{const{msgs,cacheControls}=anthropicToCore(parsed);originalMessages=msgs;const inboundImageTokens=imageReserveFor(session,"anthropic",parsed,opts,upstreamOrigin);projectThinkingMass(msgs,{providerInputTokens:session.stats.lastInputTokens,measured:session.stats.lastInputTokensSource==="usage",systemText:extractSystem(parsed.system),tools:parsed.tools,imageTokens:inboundImageTokens,storedOverhead:typeof session.metadata.systemPromptTokens==="number"?session.metadata.systemPromptTokens:void 0});const knownRefsBefore=new Set(Object.keys(session.state.messageRefs.byRaw));extractSystem(parsed.system);const{tokens:tokenCount,source:tokenCountSource}=effectiveTokenCount(session,msgs,inboundImageTokens);const activeBefore=new Set(session.state.blocks.filter(b2=>b2.active).map(b2=>b2.blockId));const absorbBlock=effectiveAbsorbBlock(pluginMode,config,opts.compress.absorb);const absorbTools=absorbToolsFor(absorbBlock?.toolName??ABSORB_TOOL_NAME);const absorbActive=absorbBlock?.enabled===true&&opts.compress.injectTool;const rulesActive=rulesEnabled(config)&&opts.compress.injectTool;const loopConfig=ccrLoopConfig(session,{...config,absorb:absorbActive?absorbBlock:void 0});let dshRebased=false;const anthropicTitleGen=typeof parsed.max_tokens==="number"&&parsed.max_tokens<=200;if(!anthropicTitleGen&&session.metadata["pluginAgent"]==="dsh"&&session.state.blocks.some(b2=>b2.active)){const coveredBeforeDshCompact=new Set(session.state.blocks.flatMap(b2=>b2.active?b2.effectiveMessageIds:[]));const dshGap=foldCoverage(coveredBeforeDshCompact,msgs.map(m2=>m2.id));if(dshGap&&carriesDshLocalCompactionSummary(msgs)){const missing=dshGap.expected-dshGap.matched;if(missing>=DSH_LOCAL_COMPACTION_MIN_MISSING&&missing*2>=dshGap.expected){recordConflict(session,"native-compaction",`dsh native compaction: ${missing}/${dshGap.expected} covered id(s) replaced by the compacted history; ACP state rebased (#2432)`);log2("warn",`[${sessionId}] dsh native compaction detected (${dshGap.matched}/${dshGap.expected} covered id(s) retained, checkpoint framing in resent history) \u2014 rebasing ACP state onto the compacted history (#2432)`);markNativeCompactionBoundary(session);dshRebased=reconcileNativeCompactionBoundary(session)}}}reconcileFoldCoverage(session,msgs,{mode:resolveFoldReconcileMode(process.env,opts.compress.reconcile),sessionId,log:log2});noteSystemPromptFingerprint(session,clientSystem,{sessionId,log:log2});const foldCoveredBefore=session.stats.pendingFoldUsage===true?new Set(session.state.blocks.flatMap(b2=>b2.active?b2.effectiveMessageIds:[])):null;const turn=core.processTurn({messages:msgs,state:session.state,config:loopConfig,tokenCount,renderTags:renderNone()?"none":"text-only",contentStore:contentStoreOf(session)});session.state=turn.state;adoptContentStore(session,turn.contentStore);session.stats.compressCreditTokens=0;if(foldCoveredBefore!==null&&msgs.length>=REWRITE_MIN_INCOMING_TOTAL){const gap=foldCoverage(foldCoveredBefore,msgs.map(m2=>m2.id));if(gap)log2("warn",`[${sessionId}] [acp-drift] fold coverage mismatch: ${gap.matched}/${gap.expected} covered message id(s) present in resent history \u2014 ${gap.expected-gap.matched} covered id(s) missing from resent history \u2014 mutation (content edit invalidates content-hash refs, fold silently lost) or client-side deletion/truncation (benign, message no longer on the wire); observability complement to the #1328 overflow rescue (#1195)`)}storeEffectiveAbsorb(session,loopConfig);storeEffectiveRules(session,config);turn.messages=applyAbsorbView(turn.messages,session.state,loopConfig,tokenCount);turn.messages=attachSubagentSessions(turn.messages,session);if(turn.nudge)turn.nudge.compressibleRanges=viableRanges(turn.nudge.compressibleRanges);nudge=turn.nudge;session.stats.contextTokens=tokenCount;session.stats.contextTokensSource=tokenCountSource;if(!session.meta.title||isAutoInjectedNotification(session.meta.title)){const t=deriveTitle(msgs);if(t)session.meta.title=t}log2("info",diagTagSummary(turn.messages,sessionId,"text-only"));const willInjectNudge=opts.compress.injectNudge&&!!turn.nudge&&!nudgeSuppressed(session)&&!compressBreakerArmed(session)&&!(autoFoldEngaged(loopConfig,session)&&growthFoldingArmed(loopConfig))&&(turn.nudge.shouldInject||emergencyNudge(turn.nudge,void 0,loopConfig.compress.minCompressRange));log2("info",diagNudge(turn,sessionId,tokenCount,config.modelContextLimit,parsed.model,willInjectNudge));processedMessages=stripReasoning(stripKernelSummaries(turn.messages,turn.state));if(!dshRebased){const rewrite=detectUnannouncedHistoryRewrite(session,knownRefsBefore,msgs.map(m2=>m2.id));if(rewrite.detected){log2("warn",`[${sessionId}] unannounced client history rewrite detected (${rewrite.knownIncoming}/${rewrite.incomingTotal} incoming message(s) carry pre-turn refs of ${rewrite.knownBefore} known) \u2014 marking compaction boundary (#1001)`);recordConflict(session,"unannounced-rewrite",`${rewrite.knownIncoming}/${rewrite.incomingTotal} incoming message(s) carry pre-turn refs of ${rewrite.knownBefore} known`);markCompactionBoundary(session)}}applyCompactionArchive(session,activeBefore,new Set(msgs.map(m2=>m2.id)),log2);reapOrphansLogged(session,msgs,log2,sessionId);await applyImageCompressionPass(session,processedMessages,{config,billing:imageBillingFor(opts,upstreamOrigin),cap:imageTokenCapFor(opts,upstreamOrigin),log:log2});if(pluginMode&&ccrEnabled(session)){reconcileReloadedRetrievals(session);pruneExpiredRetrievals(session);attachedRetrievals=snapshotPendingRetrievals(session);if(attachedRetrievals.length>0)processedMessages=[...processedMessages,...attachedRetrievals.map(i=>i.injection)]}anthropicCacheMarks=cacheControls.size>0||anthropicToolsCarryCacheControl(parsed.tools)?void 0:computeAnthropicMessageMarks(processedMessages,attachedRetrievals.length,session);clientCacheControls=cacheControls;rebuiltMessages=coreToAnthropic(processedMessages,anthropicCacheMarks??cacheControls);if(sysNotes.length>0){rebuiltMessages=[...rebuiltMessages,...sysNotes.map(text2=>({role:"user",content:text2}))]}systemOut=injectSystem(parsed,opts,prompts,loopConfig,surface,visibilityMarkers);systemOut=stampAnthropicSystemCacheControl(systemOut,anthropicCacheMarks!==void 0);if(injectTools){toolsOut=injectTool(parsed.tools,[...absorbActive?[absorbTools.anthropic]:[],...rulesActive?[RULE_TOOL]:[],...ccrEnabled(session)?[retrieveToolsFor(retrieveToolName(session)).anthropic]:[],...imageCompressionEnabled(session)?[IMAGE_FULL_TOOL]:[]],surface?.toolPrompts,ccrEnabled(session),externalSummaryEnabled(config))}if(willInjectNudge&&turn.nudge){const useDecide=decide!==void 0&&turn.nudge.tier===1&&turn.nudge.breakdown.emergencyOverride!==1;if(useDecide&&ladderMode(session.metadata)==="fallback"){consumeFallback(session.metadata);try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}}catch{}}else if(useDecide){const ranges=turn.nudge.compressibleRanges??[];const sideBody={...parsed,messages:[...rebuiltMessages,{role:"user",content:buildDecisionPrompt(ranges)}],system:systemOut,tools:toolsOut,stream:false,max_tokens:decide.maxTokens};delete sideBody.prompt_cache_key;const outcome=await runNudgeDecision({req,opts,protocol:"anthropic",sideBody,session,log:log2});if(outcome.kind==="yes"){const span=resolveDecisionRange(outcome,ranges);if(span){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(buildDirectiveText(span.startRef,span.endRef,outcome.topic),turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}else{log2("info",`[${sessionId}] [acp-decide] yes but no live range left to target \u2014 skipping injection`)}}}else{try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}}catch{}}}const imgNote=imageFullTrailingNote(session);if(imgNote)rebuiltMessages=[...rebuiltMessages,{role:"user",content:imgNote}];const retrNotes=snapshotRetrievalNotes(session);const retrNote=renderRetrievalNotes(retrNotes);if(retrNote){rebuiltMessages=[...rebuiltMessages,{role:"user",content:retrNote}];attachedRetrievalNoteIds=retrNotes.map(n=>n.id)}}catch(err2){log2("warn",`[${sessionId}] kernel transform failed, forwarding unchanged: ${String(err2)}`);if(attachedRetrievals.length>0)dropRetrievals(session,attachedRetrievals.map(i=>i.ref),"prepare failed; forwarded unprocessed");processedMessages=[]}session.metadata.systemPromptTokens=countSystemAndToolsTokens(extractSystem(systemOut),toolsOut);snapshotMessages(session,originalMessages);markDirty(session);const rebuilt={...parsed,messages:rebuiltMessages,system:systemOut,tools:toolsOut};warnAnthropicThinkingPairs(parsed.messages,rebuiltMessages,log2,sessionId);delete rebuilt.prompt_cache_key;session.stats.localInputEstimate=estimateCoreMessagesUpper(processedMessages.length>0?processedMessages:originalMessages)+countSystemAndToolsTokens(extractSystem(systemOut),toolsOut)+imageReserveFor(session,"anthropic",rebuilt,opts,upstreamOrigin);session.stats.lastLocalTextEstimate=estimateCoreMessages(processedMessages.length>0?processedMessages:originalMessages)+countSystemAndToolsTokens(extractSystem(systemOut),toolsOut)+imageReserveFor(session,"anthropic",rebuilt,opts,upstreamOrigin);if(upstreamOrigin)session.stats.lastLocalTextEstimateOrigin=upstreamOrigin;return{body:JSON.stringify(rebuilt),session,attachedRetrievals,attachedRetrievalNoteIds,processedMessages,originalMessages,anthropicSystem:parsed.system,anthropicBillingBlock,anthropicCacheMarks,anthropicClientCacheControls:clientCacheControls,systemNotes:sysNotes,protocol:"anthropic",stream:stream2,compressInjected:injectTools,pluginMode,nudge,prompts,surface,renderTags:renderNone()?"none":"text-only",dropReasoning:stripReasoning}}var AUTO_MODE_CLASSIFIER_STOPS=new Set(["</severity>","</block>"]);function isAutoModeClassifier(parsed){const stops=parsed.stop_sequences;if(!Array.isArray(stops))return false;return stops.some(s3=>typeof s3==="string"&&AUTO_MODE_CLASSIFIER_STOPS.has(s3))}async function prepareOpenai(parsed,req,opts,core,config,prompts,surface,log2,session,pluginMode,upstreamOrigin,nativeWindow,reasoning,visibilityMarkers,billingUpstream,decide){const sessionId=session.id;const stream2=parsed.stream===true;++session.stats.requests;let openaiSystemText="";let sysNotes=[];const stripReasoning=msgs=>withReasoningDrop(msgs,reasoning,log2,sessionId,isStrictReasoningEcho(session,upstreamOrigin,modelIdOf(parsed)));let openaiOutboundSystem;let processedMessages=[];let attachedRetrievals=[];let attachedRetrievalNoteIds=[];let originalMessages=[];let nudge;let rebuiltMessages=parsed.messages;let toolsOut=parsed.tools;const maxTokens=typeof parsed.max_tokens==="number"?parsed.max_tokens:8192;const isTitleGen=maxTokens<=200;const shouldInject=opts.compress.injectTool&&!isTitleGen;const injectTools=shouldInject&&!pluginMode;const strippedPanels=stripAcpPanelMessages(parsed.messages);if(strippedPanels>0){log2("info",`[${sessionId}] stripped ${strippedPanels} ACP panel message(s) before projection (UI-only, issue #359)`)}const strippedMarkerLines=stripAcpStatusMarkers(parsed.messages);if(strippedMarkerLines>0){log2("info",`[${sessionId}] stripped ${strippedMarkerLines} ACP status marker line(s) from incoming history (ephemeral proxy status, issue #1029)`)}const strippedCarriers=stripEmbeddedChainCarriers(parsed,"openai");if(strippedCarriers>0){log2("info",`[${sessionId}] stripped ${strippedCarriers} embedded chain checkpoint(s) from incoming history (leaked egress control data, issue #1542)`)}try{const{msgs,systemText}=openaiToCore(parsed);openaiSystemText=systemText;warnDroppedOpenaiParts(parsed,sessionId,log2);if(opts.stableSystemAnchor&&!pluginMode&&!isTitleGen){const outcome=reconcileSystemAnchor(session,"openai",systemText,sessionId,log2);sysNotes=outcome.notes;openaiSystemText=outcome.outbound}originalMessages=msgs;const knownRefsBefore=new Set(Object.keys(session.state.messageRefs.byRaw));const{tokens:tokenCount,source:tokenCountSource}=effectiveTokenCount(session,msgs,imageReserveFor(session,"openai",parsed,opts,billingUpstream??upstreamOrigin));const activeBefore=new Set(session.state.blocks.filter(b2=>b2.active).map(b2=>b2.blockId));const absorbBlock=effectiveAbsorbBlock(pluginMode,config,opts.compress.absorb);const absorbTools=absorbToolsFor(absorbBlock?.toolName??ABSORB_TOOL_NAME);const absorbActive=absorbBlock?.enabled===true&&shouldInject;const rulesActive=rulesEnabled(config)&&shouldInject;const loopConfig=ccrLoopConfig(session,{...config,absorb:absorbActive?absorbBlock:void 0});let dshRebased=false;if(!isTitleGen&&session.metadata["pluginAgent"]==="dsh"&&session.state.blocks.some(b2=>b2.active)){const coveredBeforeDshCompact=new Set(session.state.blocks.flatMap(b2=>b2.active?b2.effectiveMessageIds:[]));const dshGap=foldCoverage(coveredBeforeDshCompact,msgs.map(m2=>m2.id));if(dshGap&&carriesDshLocalCompactionSummary(msgs)){const missing=dshGap.expected-dshGap.matched;if(missing>=DSH_LOCAL_COMPACTION_MIN_MISSING&&missing*2>=dshGap.expected){recordConflict(session,"native-compaction",`dsh native compaction: ${missing}/${dshGap.expected} covered id(s) replaced by the compacted history; ACP state rebased (#2432)`);log2("warn",`[${sessionId}] dsh native compaction detected (${dshGap.matched}/${dshGap.expected} covered id(s) retained, checkpoint framing in resent history) \u2014 rebasing ACP state onto the compacted history (#2432)`);markNativeCompactionBoundary(session);dshRebased=reconcileNativeCompactionBoundary(session)}}}reconcileFoldCoverage(session,msgs,{mode:resolveFoldReconcileMode(process.env,opts.compress.reconcile),sessionId,log:log2});if(!isTitleGen)noteSystemPromptFingerprint(session,systemText,{sessionId,log:log2});const foldCoveredBefore=session.stats.pendingFoldUsage===true?new Set(session.state.blocks.flatMap(b2=>b2.active?b2.effectiveMessageIds:[])):null;const turn=core.processTurn({messages:msgs,state:session.state,config:loopConfig,tokenCount,renderTags:renderNone()?"none":"text-only",contentStore:contentStoreOf(session)});session.state=turn.state;adoptContentStore(session,turn.contentStore);session.stats.compressCreditTokens=0;if(foldCoveredBefore!==null&&!isTitleGen&&msgs.length>=REWRITE_MIN_INCOMING_TOTAL){const gap=foldCoverage(foldCoveredBefore,msgs.map(m2=>m2.id));if(gap)log2("warn",`[${sessionId}] [acp-drift] fold coverage mismatch: ${gap.matched}/${gap.expected} covered message id(s) present in resent history \u2014 ${gap.expected-gap.matched} covered id(s) missing from resent history \u2014 mutation (content edit invalidates content-hash refs, fold silently lost) or client-side deletion/truncation (benign, message no longer on the wire); observability complement to the #1328 overflow rescue (#1195)`)}storeEffectiveAbsorb(session,loopConfig);storeEffectiveRules(session,config);turn.messages=applyAbsorbView(turn.messages,session.state,loopConfig,tokenCount);turn.messages=attachSubagentSessions(turn.messages,session);if(turn.nudge)turn.nudge.compressibleRanges=viableRanges(turn.nudge.compressibleRanges);nudge=turn.nudge;session.stats.contextTokens=tokenCount;session.stats.contextTokensSource=tokenCountSource;if(!session.meta.title||isAutoInjectedNotification(session.meta.title)){const t=deriveTitle(msgs);if(t)session.meta.title=t}log2("info",diagTagSummary(turn.messages,sessionId,"text-only"));const willInjectNudge=opts.compress.injectNudge&&!!turn.nudge&&shouldInject&&!nudgeSuppressed(session)&&!compressBreakerArmed(session)&&!(autoFoldEngaged(loopConfig,session)&&growthFoldingArmed(loopConfig))&&(turn.nudge.shouldInject||emergencyNudge(turn.nudge,void 0,loopConfig.compress.minCompressRange));log2("info",diagNudge(turn,sessionId,tokenCount,config.modelContextLimit,parsed.model,willInjectNudge));processedMessages=stripReasoning(stripKernelSummaries(turn.messages,turn.state));if(!dshRebased){const rewrite=detectUnannouncedHistoryRewrite(session,knownRefsBefore,msgs.map(m2=>m2.id));if(rewrite.detected){log2("warn",`[${sessionId}] unannounced client history rewrite detected (${rewrite.knownIncoming}/${rewrite.incomingTotal} incoming message(s) carry pre-turn refs of ${rewrite.knownBefore} known) \u2014 marking compaction boundary (#1001)`);recordConflict(session,"unannounced-rewrite",`${rewrite.knownIncoming}/${rewrite.incomingTotal} incoming message(s) carry pre-turn refs of ${rewrite.knownBefore} known`);markCompactionBoundary(session)}}applyCompactionArchive(session,activeBefore,new Set(msgs.map(m2=>m2.id)),log2);reapOrphansLogged(session,msgs,log2,sessionId);await applyImageCompressionPass(session,processedMessages,{config,billing:imageBillingFor(opts,billingUpstream??upstreamOrigin),cap:imageTokenCapFor(opts,billingUpstream??upstreamOrigin),log:log2});if(pluginMode&&ccrEnabled(session)){reconcileReloadedRetrievals(session);pruneExpiredRetrievals(session);attachedRetrievals=snapshotPendingRetrievals(session);if(attachedRetrievals.length>0)processedMessages=[...processedMessages,...attachedRetrievals.map(i=>i.injection)]}rebuiltMessages=systemToUser(hardenOpenaiAssistantContent(coreToOpenai(processedMessages)));const sysParts=[];if(openaiSystemText)sysParts.push(openaiSystemText);if(shouldInject)sysParts.push(withMarkerIntegrityNote(withSummaryBudgetNote(buildCompressSystemPrompt(prompts,surface?.promptSections),externalSummaryEnabled(config)),visibilityMarkers));else if(!isTitleGen&&!renderNone()){const tagsOnly=buildAcpTagsOnlyPrompt("function",prompts,surface?.promptSections);if(tagsOnly)sysParts.push(tagsOnly)}if(absorbActive)sysParts.push(buildAbsorbSystemPrompt(absorbToolName(loopConfig)));rebuiltMessages=injectOpenaiSystem(rebuiltMessages,sysParts);if(sysNotes.length>0){rebuiltMessages=[...rebuiltMessages,...sysNotes.map(text2=>({role:"user",content:text2}))]}openaiOutboundSystem=sysParts.join("\n\n");if(injectTools){toolsOut=injectOpenaiTool(parsed.tools,[...absorbActive?[absorbTools.openai]:[],...rulesActive?[RULE_TOOL_OPENAI]:[],...ccrEnabled(session)?[retrieveToolsFor(retrieveToolName(session)).openai]:[],...imageCompressionEnabled(session)?[IMAGE_FULL_TOOL_OPENAI]:[]],surface?.toolPrompts,ccrEnabled(session),externalSummaryEnabled(config))}if(willInjectNudge&&turn.nudge){const useDecide=decide!==void 0&&turn.nudge.tier===1&&turn.nudge.breakdown.emergencyOverride!==1;if(useDecide&&ladderMode(session.metadata)==="fallback"){consumeFallback(session.metadata);try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}}catch{}}else if(useDecide){const ranges=turn.nudge.compressibleRanges??[];const stable=normalizeStrictEchoReasoning([...rebuiltMessages],isStrictReasoningEcho(session,upstreamOrigin,modelIdOf(parsed)),log2,sessionId);const sideBody={...parsed,messages:[...stable,{role:"user",content:buildDecisionPrompt(ranges)}],tools:toolsOut,stream:false};sideBody[typeof parsed.max_completion_tokens==="number"?"max_completion_tokens":"max_tokens"]=decide.maxTokens;delete sideBody.prompt_cache_retention;const outcome=await runNudgeDecision({req,opts,protocol:"openai",sideBody,session,log:log2});if(outcome.kind==="yes"){const span=resolveDecisionRange(outcome,ranges);if(span){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(buildDirectiveText(span.startRef,span.endRef,outcome.topic),turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}else{log2("info",`[${sessionId}] [acp-decide] yes but no live range left to target \u2014 skipping injection`)}}}else{try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltMessages=[...rebuiltMessages,{role:"user",content:withMarkerIntegrityNote(withSummaryBudgetNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),externalSummaryEnabled(config)),visibilityMarkers)}]}}catch{}}}const imgNote=imageFullTrailingNote(session);if(imgNote)rebuiltMessages=[...rebuiltMessages,{role:"user",content:imgNote}];const retrNotes=snapshotRetrievalNotes(session);const retrNote=renderRetrievalNotes(retrNotes);if(retrNote){rebuiltMessages=[...rebuiltMessages,{role:"user",content:retrNote}];attachedRetrievalNoteIds=retrNotes.map(n=>n.id)}}catch(err2){log2("warn",`[${sessionId}] kernel transform failed, forwarding unchanged: ${String(err2)}`);if(attachedRetrievals.length>0)dropRetrievals(session,attachedRetrievals.map(i=>i.ref),"prepare failed; forwarded unprocessed");processedMessages=[]}rebuiltMessages=normalizeStrictEchoReasoning(rebuiltMessages,isStrictReasoningEcho(session,upstreamOrigin,modelIdOf(parsed)),log2,sessionId);const rebuilt={...parsed,messages:rebuiltMessages,tools:toolsOut};warnReasoningPairs(rebuiltMessages,log2,sessionId);clampOutgoingOutput(rebuilt,typeof parsed.max_completion_tokens==="number"?"max_completion_tokens":"max_tokens",{systemText:openaiSystemText,tools:toolsOut,processedMessages,lastInputTokens:session.stats.lastInputTokens,lastInputTokensSource:session.stats.lastInputTokensSource,nativeWindow,headroomWindow:config.modelContextLimit,imageTokens:imageReserveFor(session,"openai",rebuilt,opts,billingUpstream??upstreamOrigin),kFactor:currentCalibrationFactor(session.stats,session.metadata?.lastModel),kOrigin:session.stats.calibratedEstimateOrigin,origin:billingUpstream??upstreamOrigin,ledgerFloorTokens:dshLedgerFloorTokens(session.metadata)},sessionId,log2);delete rebuilt.prompt_cache_retention;if(shouldStampRelayAffinityPck(conversationHeaderSource(req.headers)?.name,parsed.prompt_cache_key,billingUpstream,upstreamOrigin)){rebuilt.prompt_cache_key=session.id}if(stream2&&rebuilt.stream_options===void 0){rebuilt.stream_options={include_usage:true}}if(!isTitleGen&&openaiOutboundSystem!==void 0){session.metadata.systemPromptTokens=countSystemAndToolsTokens(openaiOutboundSystem,toolsOut)}if(!isTitleGen){session.stats.localInputEstimate=estimateCoreMessagesUpper(processedMessages.length>0?processedMessages:originalMessages)+countSystemAndToolsTokens(openaiOutboundSystem||openaiSystemText,toolsOut)+imageReserveFor(session,"openai",rebuilt,opts,billingUpstream??upstreamOrigin);session.stats.lastLocalTextEstimate=estimateCoreMessages(processedMessages.length>0?processedMessages:originalMessages)+countSystemAndToolsTokens(openaiOutboundSystem||openaiSystemText,toolsOut)+imageReserveFor(session,"openai",rebuilt,opts,billingUpstream??upstreamOrigin);const openaiPairOrigin=billingUpstream??upstreamOrigin;if(openaiPairOrigin)session.stats.lastLocalTextEstimateOrigin=openaiPairOrigin}snapshotMessages(session,originalMessages);markDirty(session);return{body:JSON.stringify(rebuilt),session,attachedRetrievals,attachedRetrievalNoteIds,processedMessages,originalMessages,protocol:"openai",stream:stream2,compressInjected:injectTools,pluginMode,nudge,prompts,surface,openaiSystemText,systemNotes:sysNotes,renderTags:renderNone()?"none":"text-only",dropReasoning:stripReasoning}}function appendGoogleNudge(contents,text2){const last=contents[contents.length-1];if(last&&(last.role??"user")!=="model"){const parts=Array.isArray(last.parts)?last.parts:[];return[...contents.slice(0,-1),{...last,parts:[...parts,{text:text2}]}]}return[...contents,{role:"user",parts:[{text:text2}]}]}async function prepareGoogle(parsed,opts,core,config,prompts,surface,log2,session,pluginMode,nativeWindow,model,stream2,visibilityMarkers,upstreamOrigin,req,decide){const sessionId=session.id;++session.stats.requests;let googleClientSystem="";let sysNotes=[];let googleOutboundSystem;let systemInstruction=parsed.systemInstruction;let processedMessages=[];let originalMessages=[];let nudge;let rebuiltContents=Array.isArray(parsed.contents)?parsed.contents:[];let toolsOut=parsed.tools;const genConfig=parsed.generationConfig;const declaredMax=genConfig?genConfig.maxOutputTokens:void 0;const maxTokens=typeof declaredMax==="number"?declaredMax:8192;const isTitleGen=maxTokens<=200;const shouldInject=opts.compress.injectTool&&!isTitleGen;const injectTools=shouldInject&&!pluginMode;const strippedCarriers=stripEmbeddedChainCarriers(parsed,"google");if(strippedCarriers>0){log2("info",`[${sessionId}] stripped ${strippedCarriers} embedded chain checkpoint(s) from incoming history (leaked egress control data, issue #1542)`)}try{const{msgs,systemText}=googleToCore(parsed);googleClientSystem=systemText;if(opts.stableSystemAnchor&&!pluginMode&&!isTitleGen){const outcome=reconcileSystemAnchor(session,"google",systemText,sessionId,log2);sysNotes=outcome.notes;googleClientSystem=outcome.outbound}originalMessages=msgs;const{tokens:tokenCount,source:tokenCountSource}=effectiveTokenCount(session,msgs,imageReserveFor(session,"google",parsed,opts,upstreamOrigin));const activeBefore=new Set(session.state.blocks.filter(b2=>b2.active).map(b2=>b2.blockId));const absorbBlock=effectiveAbsorbBlock(pluginMode,config,opts.compress.absorb);const absorbTools=absorbToolsFor(absorbBlock?.toolName??ABSORB_TOOL_NAME);const absorbActive=absorbBlock?.enabled===true&&shouldInject;const rulesActive=rulesEnabled(config)&&shouldInject;const loopConfig=ccrLoopConfig(session,{...config,absorb:absorbActive?absorbBlock:void 0});if(!isTitleGen&&session.metadata["pluginAgent"]==="dsh"&&session.state.blocks.some(b2=>b2.active)){const coveredBeforeDshCompact=new Set(session.state.blocks.flatMap(b2=>b2.active?b2.effectiveMessageIds:[]));const dshGap=foldCoverage(coveredBeforeDshCompact,msgs.map(m2=>m2.id));if(dshGap&&carriesDshLocalCompactionSummary(msgs)){const missing=dshGap.expected-dshGap.matched;if(missing>=DSH_LOCAL_COMPACTION_MIN_MISSING&&missing*2>=dshGap.expected){recordConflict(session,"native-compaction",`dsh native compaction: ${missing}/${dshGap.expected} covered id(s) replaced by the compacted history; ACP state rebased (#2432)`);log2("warn",`[${sessionId}] dsh native compaction detected (${dshGap.matched}/${dshGap.expected} covered id(s) retained, checkpoint framing in resent history) \u2014 rebasing ACP state onto the compacted history (#2432)`);markNativeCompactionBoundary(session);reconcileNativeCompactionBoundary(session)}}}reconcileFoldCoverage(session,msgs,{mode:resolveFoldReconcileMode(process.env,opts.compress.reconcile),sessionId,log:log2});if(!isTitleGen)noteSystemPromptFingerprint(session,systemText,{sessionId,log:log2});const foldCoveredBefore=session.stats.pendingFoldUsage===true?new Set(session.state.blocks.flatMap(b2=>b2.active?b2.effectiveMessageIds:[])):null;const turn=core.processTurn({messages:msgs,state:session.state,config:loopConfig,tokenCount,renderTags:"text-only",contentStore:contentStoreOf(session)});session.state=turn.state;adoptContentStore(session,turn.contentStore);session.stats.compressCreditTokens=0;if(foldCoveredBefore!==null&&!isTitleGen&&msgs.length>=REWRITE_MIN_INCOMING_TOTAL){const gap=foldCoverage(foldCoveredBefore,msgs.map(m2=>m2.id));if(gap)log2("warn",`[${sessionId}] [acp-drift] fold coverage mismatch: ${gap.matched}/${gap.expected} covered message id(s) present in resent history \u2014 ${gap.expected-gap.matched} covered id(s) missing from resent history \u2014 mutation (content edit invalidates content-hash refs, fold silently lost) or client-side deletion/truncation (benign, message no longer on the wire); observability complement to the #1328 overflow rescue (#1195)`)}storeEffectiveAbsorb(session,loopConfig);storeEffectiveRules(session,config);turn.messages=applyAbsorbView(turn.messages,session.state,loopConfig,tokenCount);turn.messages=attachSubagentSessions(turn.messages,session);if(turn.nudge)turn.nudge.compressibleRanges=viableRanges(turn.nudge.compressibleRanges);nudge=turn.nudge;session.stats.contextTokens=tokenCount;session.stats.contextTokensSource=tokenCountSource;if(!session.meta.title||isAutoInjectedNotification(session.meta.title)){const t=deriveTitle(msgs);if(t)session.meta.title=t}log2("info",diagTagSummary(turn.messages,sessionId,"text-only"));const willInjectNudge=opts.compress.injectNudge&&!!turn.nudge&&shouldInject&&!nudgeSuppressed(session)&&!compressBreakerArmed(session)&&!(autoFoldEngaged(loopConfig,session)&&growthFoldingArmed(loopConfig))&&(turn.nudge.shouldInject||emergencyNudge(turn.nudge,void 0,loopConfig.compress.minCompressRange));log2("info",diagNudge(turn,sessionId,tokenCount,config.modelContextLimit,model,willInjectNudge));processedMessages=stripKernelSummaries(turn.messages,turn.state);applyCompactionArchive(session,activeBefore,new Set(msgs.map(m2=>m2.id)),log2);reapOrphansLogged(session,msgs,log2,sessionId);await applyImageCompressionPass(session,processedMessages,{config,billing:imageBillingFor(opts,upstreamOrigin),cap:imageTokenCapFor(opts,upstreamOrigin),log:log2});rebuiltContents=coreToGoogle(processedMessages);const sysParts=[];if(googleClientSystem)sysParts.push(googleClientSystem);if(shouldInject)sysParts.push(withMarkerIntegrityNote(withSummaryBudgetNote(buildCompressSystemPrompt(prompts,surface?.promptSections),externalSummaryEnabled(config)),visibilityMarkers));else if(!isTitleGen){const tagsOnly=buildAcpTagsOnlyPrompt("function",prompts,surface?.promptSections);if(tagsOnly)sysParts.push(tagsOnly)}if(absorbActive)sysParts.push(buildAbsorbSystemPrompt(absorbToolName(loopConfig)));googleOutboundSystem=sysParts.join("\n\n");const extraSystemParts=sysParts.slice(googleClientSystem?1:0);systemInstruction=extraSystemParts.length>0?{parts:sysParts.map(text2=>({text:text2}))}:parsed.systemInstruction;if(injectTools){toolsOut=injectGoogleTool(parsed.tools,[...absorbActive?[absorbTools.google]:[],...rulesActive?[RULE_TOOL_GOOGLE]:[],...ccrEnabled(session)?[retrieveToolsFor(retrieveToolName(session)).google]:[],...imageCompressionEnabled(session)?[IMAGE_FULL_TOOL_GOOGLE]:[]],surface?.toolPrompts,ccrEnabled(session),externalSummaryEnabled(config))}if(sysNotes.length>0){rebuiltContents=appendGoogleNudge(rebuiltContents,sysNotes.join("\n\n---\n\n"))}if(willInjectNudge&&turn.nudge){const useDecide=decide!==void 0&&turn.nudge.tier===1&&turn.nudge.breakdown.emergencyOverride!==1;if(useDecide&&ladderMode(session.metadata)==="fallback"){consumeFallback(session.metadata);try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltContents=appendGoogleNudge(rebuiltContents,withMarkerIntegrityNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),visibilityMarkers))}}catch{}}else if(useDecide){const ranges=turn.nudge.compressibleRanges??[];const sideBody={...parsed,contents:[...rebuiltContents,{role:"user",parts:[{text:buildDecisionPrompt(ranges)}]}],tools:toolsOut,systemInstruction,generationConfig:{...parsed.generationConfig??{},maxOutputTokens:decide.maxTokens}};const outcome=await runNudgeDecision({req,opts,protocol:"google",sideBody,session,log:log2});if(outcome.kind==="yes"){const span=resolveDecisionRange(outcome,ranges);if(span){rebuiltContents=appendGoogleNudge(rebuiltContents,withMarkerIntegrityNote(withFirstSightDrain(buildDirectiveText(span.startRef,span.endRef,outcome.topic),turn.nudge.reason,externalSummaryEnabled(config)),visibilityMarkers))}else{log2("info",`[${sessionId}] [acp-decide] yes but no live range left to target \u2014 skipping injection`)}}}else{try{const rendered=renderNudgeText(turn.nudge,prompts,surface?.nudgeSections);const renderedWithPayload=rendered.text;if(rendered.text){rebuiltContents=appendGoogleNudge(rebuiltContents,withMarkerIntegrityNote(withFirstSightDrain(renderedWithPayload,turn.nudge.reason,externalSummaryEnabled(config)),visibilityMarkers))}}catch{}}}const imgNote=imageFullTrailingNote(session);if(imgNote)rebuiltContents=appendGoogleNudge(rebuiltContents,imgNote)}catch(err2){log2("warn",`[${sessionId}] kernel transform failed, forwarding unchanged: ${String(err2)}`);processedMessages=[]}const rebuilt={...parsed,contents:rebuiltContents,tools:toolsOut,systemInstruction};clampOutgoingOutput(rebuilt,"generationConfig.maxOutputTokens",{systemText:googleClientSystem,tools:toolsOut,processedMessages,lastInputTokens:session.stats.lastInputTokens,lastInputTokensSource:session.stats.lastInputTokensSource,nativeWindow,headroomWindow:config.modelContextLimit,imageTokens:imageReserveFor(session,"google",rebuilt,opts,upstreamOrigin),kFactor:currentCalibrationFactor(session.stats,session.metadata?.lastModel),kOrigin:session.stats.calibratedEstimateOrigin,origin:upstreamOrigin,ledgerFloorTokens:dshLedgerFloorTokens(session.metadata)},sessionId,log2);if(!isTitleGen&&googleOutboundSystem!==void 0){session.metadata.systemPromptTokens=countSystemAndToolsTokens(googleOutboundSystem,toolsOut)}if(!isTitleGen){session.stats.lastLocalTextEstimate=estimateCoreMessages(processedMessages.length>0?processedMessages:originalMessages)+countSystemAndToolsTokens(googleOutboundSystem??"",toolsOut)+imageReserveFor(session,"google",rebuilt,opts,upstreamOrigin);if(upstreamOrigin)session.stats.lastLocalTextEstimateOrigin=upstreamOrigin}snapshotMessages(session,originalMessages);markDirty(session);return{body:JSON.stringify(rebuilt),session,processedMessages,originalMessages,protocol:"google",stream:stream2,compressInjected:injectTools,pluginMode,nudge,prompts,surface,google:{system:googleClientSystem,model},systemNotes:sysNotes,renderTags:"text-only"}}function prepareGoogleCountTokens(parsed,core,config,log2,session){const sessionId=session.id;try{const{msgs}=googleToCore(parsed);const turn=core.processTurn({messages:msgs,state:session.state,config:ccrLoopConfig(session,config),tokenCount:usageGradeInputBaseline(session),renderTags:"text-only",contentStore:contentStoreOf(session)});const stripped=stripKernelSummaries(turn.messages,turn.state);const rebuilt={...parsed,contents:coreToGoogle(stripped)};log2("info",`[${sessionId}] countTokens pruned: ${msgs.length} \u2192 ${stripped.length} msgs`);return{body:JSON.stringify(rebuilt),session,processedMessages:[],originalMessages:msgs,protocol:"google",stream:false,compressInjected:false}}catch(err2){log2("warn",`[${sessionId}] countTokens prune failed, forwarding unchanged: ${String(err2)}`);return{body:JSON.stringify({...parsed}),session,processedMessages:[],originalMessages:[],protocol:"google",stream:false,compressInjected:false}}}import fs16 from"fs";import path32 from"path";import fs15 from"fs";import path29 from"path";var DSH_AUTO_REVIEW_ISSUE="https://github.com/ranxianglei/billion-context/issues/2462";var KNOWN_COST_PLUGINS=[{client:"dsh",id:"@deepseek-ai/dsh-experimental-auto-review",name:"@deepseek-ai/dsh-experimental-auto-review",issueUrl:DSH_AUTO_REVIEW_ISSUE,patchIds:["auto-review"]}];var SCAN_TTL_MS=5*60*1e3;var cache5;function dshEnabledPatchIds(env){const ids=new Set;let dirs;try{dirs=dshProfileDirs(env)}catch{return ids}const itemRe=/^\s*-\s*id\s*:\s*(\S+)/;for(const dir of dirs){let text2;try{text2=fs15.readFileSync(path29.join(dir,"cordis.patch.yml"),"utf8")}catch{continue}for(const line of text2.split(/\r?\n/)){const m2=line.match(itemRe);if(!m2)continue;let v2=m2[1];if(v2.startsWith('"')&&v2.endsWith('"')||v2.startsWith("'")&&v2.endsWith("'"))v2=v2.slice(1,-1);v2=v2.trim();if(v2.length>0)ids.add(v2)}}return ids}function detectCostAdvisories(env=process.env){const key2=`${env.DSH_HOME??""}|${env.HOME??""}|${env.USERPROFILE??""}`;if(cache5&&cache5.key===key2&&Date.now()-cache5.at<SCAN_TTL_MS)return cache5.result;const found=[];const enabled=KNOWN_COST_PLUGINS.some(p2=>p2.client==="dsh")?dshEnabledPatchIds(env):void 0;for(const p2 of KNOWN_COST_PLUGINS){if(p2.client!=="dsh")continue;if(!p2.patchIds.some(pid=>enabled?.has(pid)))continue;found.push({id:p2.id,name:p2.name,client:p2.client,issueUrl:p2.issueUrl})}cache5={key:key2,at:Date.now(),result:found};return found}var ALERT_KINDS=new Set(["connect-timeout","connect-refused","proxy-reset","upstream-reset","dns","tls"]);var MAX_ALERTS=32;var alerts=new Map;function hostOf(url){try{return new URL(url).host}catch{return url}}function keyFor(kind,host){return kind+"\0"+host}function recordUpstreamAlert(url,error,viaProxy){const kind=classifyUpstreamFailure(error,{viaProxy});if(!ALERT_KINDS.has(kind))return;const host=hostOf(url);const now=Date.now();const key2=keyFor(kind,host);const existing=alerts.get(key2);if(existing){existing.lastSeen=now;existing.count+=1;existing.hint=UPSTREAM_FAIL_HINTS[kind];return}if(alerts.size>=MAX_ALERTS){let oldestKey;let oldestAt=Infinity;for(const[k2,a]of alerts){if(a.lastSeen<oldestAt){oldestAt=a.lastSeen;oldestKey=k2}}if(oldestKey!==void 0)alerts.delete(oldestKey)}alerts.set(key2,{kind,host,hint:UPSTREAM_FAIL_HINTS[kind],firstSeen:now,lastSeen:now,count:1})}function clearUpstreamAlertsForHost(url){const host=hostOf(url);for(const[key2,a]of alerts){if(a.host===host)alerts.delete(key2)}}function getUpstreamAlerts(){return[...alerts.values()].sort((a,b2)=>b2.lastSeen-a.lastSeen)}import{existsSync as existsSync7}from"fs";var MESSAGES={"zh-CN":{"summary.title":"\u7EDF\u4E00\u6458\u8981\u670D\u52A1\uFF08\u5B9E\u9A8C\u6027\u529F\u80FD\uFF09","summary.enabled":"\u542F\u7528","summary.add":"\u6DFB\u52A0\u76EE\u6807","summary.ref":"\u76EE\u6807\uFF08provider/model\uFF09","summary.no_recipes":"providers \u91CC\u8FD8\u6CA1\u6709\u5177\u540D\u62E8\u53F7\u914D\u65B9\uFF08\u542B baseUrl/api \u7684\u975E URL \u6761\u76EE\uFF09\u2014\u2014\u5148\u5728 JSON \u4E2D\u6DFB\u52A0","summary.credentials":"\u914D\u65B9\u51ED\u636E","summary.key":"API Key","summary.key_save":"\u4FDD\u5B58 Key","summary.key_delete":"\u5220\u9664 Key","summary.key_set":"\u5DF2\u914D\u7F6E","summary.key_missing":"\u672A\u914D\u7F6E","summary.key_saved":"Key \u5DF2\u4FDD\u5B58","summary.total":"\u603B\u65F6\u9650 (ms)","summary.timeout":"\u5355\u76EE\u6807\u65F6\u9650 (ms)","summary.bytes":"\u6458\u8981\u4E0A\u9650 (bytes)","summary.up":"\u4E0A\u79FB","summary.down":"\u4E0B\u79FB","summary.remove":"\u79FB\u9664\u76EE\u6807","summary.invalid":"\u6458\u8981\u914D\u7F6E\u65E0\u6548\uFF0C\u8BF7\u5728 JSON \u4E2D\u4FEE\u6B63","nav.overview":"\u603B\u89C8","nav.sessions":"\u4F1A\u8BDD","nav.config":"\u914D\u7F6E","nav.connect":"\u63A5\u5165","nav.logs":"\u65E5\u5FD7","logs.title":"\u8FD0\u884C\u65E5\u5FD7","logs.sub":"bili.log \u5B9E\u65F6\u5C3E\u90E8 \xB7 \u6309\u4F1A\u8BDD ID \u6216\u5173\u952E\u5B57\u8FC7\u6EE4\uFF0C\u652F\u6301\u4E0A\u4E0B\u6587\u5C55\u5F00\u4E0E\u65F6\u95F4\u7A97","logs.filter_ph":"\u8FC7\u6EE4\uFF08\u5982\u4F1A\u8BDD ID \u6216\u5173\u952E\u5B57\uFF09","logs.count":"\u663E\u793A\u6700\u8FD1 {n} \u884C\uFF08\u5339\u914D\u5171 {total} \u884C\uFF09","logs.omitted":" \xB7 \u66F4\u65E9 {o} \u884C\u5DF2\u622A\u65AD\uFF08\u8C03\u5927\u884C\u6570\u4E0A\u9650\u53EF\u770B\u66F4\u591A\uFF09","logs.ctx":"\u4E0A\u4E0B\u6587 \xB13 \u884C","logs.win":"\u65F6\u95F4\u7A97 \xB12 \u5206\u949F","logs.empty":"\u6CA1\u6709\u5339\u914D\u7684\u884C\uFF08\u65E5\u5FD7\u6587\u4EF6\u53EF\u80FD\u5C1A\u672A\u521B\u5EFA\uFF09","logs.path":"\u65E5\u5FD7\u6587\u4EF6","logs.dl":"\u4E0B\u8F7D\u5F53\u524D\u89C6\u56FE (.txt)","logs.dl_all":"\u4E0B\u8F7D\u5B8C\u6574\u65E5\u5FD7 (.txt)","det.log":"\u65E5\u5FD7","det.log_view":"\u67E5\u770B\u8BE5\u4F1A\u8BDD\u7684\u65E5\u5FD7 \u25B8","fork.label":"\u2605 Fork me on GitHub","common.loading":"\u52A0\u8F7D\u4E2D\u2026","common.empty":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.back":"\u2190 \u8FD4\u56DE\u4F1A\u8BDD\u5217\u8868","common.live":"\u8FD0\u884C\u4E2D","common.sessions":"\u4F1A\u8BDD","common.copied_hint":"\u5DF2\u590D\u5236 \u2713","ses.badge_live_tip":"\u5F53\u524D\u8FDB\u7A0B\u6B63\u5728\u5904\u7406\u7684\u4F1A\u8BDD\uFF08\u5B9E\u65F6\u6570\u636E\uFF09","common.requests":"\u8BF7\u6C42","common.saved":"\u8282\u7701","common.context":"\u4E0A\u4E0B\u6587","common.ctx_est":"\u4F30\u7B97","common.ctx_meas":"\u5B9E\u6D4B","common.ctx_est_calib":"\u4F30\u7B97\xB7\u5DF2\u6821\u51C6","common.ctx_est_raw":"\u4F30\u7B97\xB7\u672A\u6821\u51C6","common.ctx_upper":"\u4F30\u7B97\xB7\u4E0A\u754C","common.window":"\u7A97\u53E3","common.title":"\u6807\u9898","common.protocol":"\u534F\u8BAE","common.upstream":"\u4E0A\u6E38","common.label":"\u6807\u7B7E","common.none":"\u2014","protocol.unmarked":"\u672A\u6807\u8BB0\uFF08\u65E7\u7248\u672C\u4F1A\u8BDD\uFF09","ses.no_title":"\u65E0\u6807\u9898","ov.title":"\u603B\u89C8","ov.sub":"\u5168\u5C40\u7EDF\u8BA1\uFF1A\u8986\u76D6\u5185\u5B58\u4E0E\u78C1\u76D8\u4E0A\u7684\u6240\u6709\u4F1A\u8BDD","ov.total_sessions":"\u4F1A\u8BDD\u603B\u6570","ov.live_now":"\u5F53\u524D\u8FD0\u884C\u4E2D","ov.hist":"\u5386\u53F2","ov.saved_from_legacy":"\u5176\u4E2D {n} \u4E3A\u65E7\u7248\u672C\u4F1A\u8BDD\u7684\u672C\u5730\u4F30\u7B97","ov.total_requests":"\u8BF7\u6C42\u603B\u6570","ov.tokens_saved":"\u538B\u7F29\u8282\u7701","ov.gross_saved":"\u538B\u7F29\u7D2F\u8BA1\u8282\u7701","ov.net_saved":"\u51C0\u8282\u7701","ov.sub_repay":"\u5DF2\u6263\u9664\u538B\u7F29\u590D\u4ED8 {r} \u4E0E\u6458\u8981\u6210\u672C {s}","ov.covlost_note":"\u5176\u4E2D {n} \u4E2A\u6298\u53E0\u8986\u76D6\u4E22\u5931\uFF0C\u51BB\u7ED3 {x}","det.covlost_sub":"\u5176\u4E2D {n} \u4E2A\u6298\u53E0\u8986\u76D6\u4E22\u5931\uFF08\u51BB\u7ED3 {x}\uFF09\uFF1A\u5176\u8986\u76D6\u7684\u539F\u59CB\u6D88\u606F\u5DF2\u79BB\u5F00\u91CD\u53D1\u5386\u53F2\uFF0C\u8282\u7701\u7D2F\u8BA1\u5DF2\u505C\u6B62","ses.covlost_tip":"{n} \u4E2A\u6298\u53E0\u8986\u76D6\u4E22\u5931\uFF08\u51BB\u7ED3 {x}\uFF09\uFF1A\u5BBF\u4E3B\u5728 bili \u4E0D\u77E5\u60C5\u4E0B\u79FB\u9664\u4E86\u88AB\u538B\u7F29\u7684\u539F\u59CB\u6D88\u606F\uFF08\u5982 dsh \u539F\u751F\u538B\u7F29\uFF09\uFF0C\u5BF9\u5E94\u8282\u7701\u5DF2\u505C\u6B62\u7D2F\u8BA1","ov.miss_split":"\u672A\u547D\u4E2D\u6784\u6210\uFF08\u6709\u8D26\u672C\u4F1A\u8BDD\uFF09\uFF1A\u65B0\u589E\u5185\u5BB9 {n} \xB7 \u538B\u7F29\u6298\u635F {c} \xB7 TTL\u8FC7\u671F\u7B49\u524D\u7F00\u5931\u6548 {x}","det.hit_pct":"\u7F13\u5B58\u547D\u4E2D\u7387","ses.drop_ph":"\u547D\u4E2D\u7387\u4EE3\u4EF7\uFF08\u5360\u603B\u8F93\u5165\u7684\u767E\u5206\u6BD4\uFF0C\u987A\u5E8F\uFF1A\u65B0\u589E / \u538B\u7F29 / TTL\u8FC7\u671F\uFF09","ses.empty_hidden":"\u53E6\u6709 {n} \u4E2A\u7A7A\u4F1A\u8BDD\u5DF2\u9690\u85CF\uFF08\u65E0\u8BF7\u6C42\u3001\u65E0\u4E0A\u4E0B\u6587\u3001\u65E0\u8D26\u672C\uFF1B\u76F4\u63A5\u94FE\u63A5\u4ECD\u53EF\u8BBF\u95EE\uFF09","det.miss_split_line":"\u547D\u4E2D\u7387\u7684\u672A\u547D\u4E2D\u90E8\u5206\u62C6\u5206\uFF1A\u65B0\u589E\u5185\u5BB9 {n}\uFF08\u2212{pn}%\uFF09\xB7 \u538B\u7F29\u6298\u635F {c}\uFF08\u2212{pc}%\uFF09\xB7 TTL\u8FC7\u671F\u7B49\u524D\u7F00\u5931\u6548 {x}\uFF08\u2212{px}%\uFF09","det.miss_sub":"TTL\u8FC7\u671F \u2212{x}% \xB7 \u538B\u7F29 \u2212{c}% \xB7 \u65B0\u589E \u2212{n}%","det.fold_time":"\u65F6\u95F4","ov.global_hitpct":"\u5168\u5C40\u7F13\u5B58\u547D\u4E2D\u7387","ov.input_tokens":"\u8F93\u5165 token","ov.cached_tokens":"\u7F13\u5B58\u547D\u4E2D token","ov.output_tokens":"\u8F93\u51FA token","ov.by_protocol":"\u6309\u534F\u8BAE\u5206\u5E03","ov.recent":"\u6700\u8FD1\u6D3B\u8DC3\u4F1A\u8BDD","ov.view_all":"\u67E5\u770B\u5168\u90E8 \u2192","sys.title":"\u7CFB\u7EDF\u72B6\u6001","sys.version":"\u7248\u672C","sys.disk_version":"\u78C1\u76D8\u7248\u672C","sys.inflight":"\u8FDB\u884C\u4E2D\u8BF7\u6C42","sys.blind_tunnels":"MITM \u76F2\u96A7\u9053\uFF08CONNECT \u540E\u65E0 TLS\uFF09","sys.stale":"\u78C1\u76D8\u5DF2\u6709\u65B0\u7248\u672C v{disk} \u2014\u2014 \u91CD\u542F bili \u751F\u6548\uFF08\u5F53\u524D\u8FD0\u884C v{running}\uFF09","sys.stale_auto":"\u81EA\u52A8\u91CD\u542F\u5DF2\u542F\u7528\uFF0C\u7A7A\u95F2\u65F6\u81EA\u52A8\u5207\u6362","sys.stale_manual":"\u81EA\u52A8\u91CD\u542F\u672A\u542F\u7528\uFF08\u9700\u8981 --auto-restart-on-update\uFF09","sys.pt_on":"Passthrough \u5DF2\u5F00\u542F\uFF1A\u6240\u6709\u8BF7\u6C42\u539F\u6837\u8F6C\u53D1\uFF0C\u538B\u7F29\u5173\u95ED\u3002\u6765\u6E90\uFF1A","sys.pt_env":"ACP_PASSTHROUGH \u73AF\u5883\u53D8\u91CF\uFF08\u6216 --passthrough \u53C2\u6570\uFF09","sys.pt_file":"\u914D\u7F6E\u6587\u4EF6 passthrough: true","conflict.on":"\u68C0\u6D4B\u5230\u538B\u7F29\u51B2\u7A81","conflict.found":"\uFF1A\u53D1\u73B0","conflict.what_plugin":"\u4E0E bili \u5E76\u5B58\u7684\u7B2C\u4E09\u65B9\u538B\u7F29\u63D2\u4EF6","conflict.what_native":"\u5BA2\u6237\u7AEF\u539F\u751F\u81EA\u52A8\u538B\u7F29\u6539\u5199\u4F1A\u8BDD\u5386\u53F2","conflict.what_join":"\u3001","conflict.risk_active":"\u7684\u75D5\u8FF9\u3002\u4E24\u4E2A\u538B\u7F29\u5668\u4F5C\u7528\u4E8E\u540C\u4E00\u4F1A\u8BDD\u4F1A\u53CC\u538B\u7F29\u3001\u7834\u574F\u6D88\u606F\u5F15\u7528\uFF0C\u53EF\u80FD\u5BFC\u81F4\u4E0A\u4E0B\u6587\u9519\u4E71\u2014\u2014\u8BF7\u53EA\u4FDD\u7559\u4E00\u4E2A\u538B\u7F29\u5668\u3002","conflict.risk_sibling":"\u7684\u75D5\u8FF9\u3002\u5B83\u4EEC\u662F bili \u81EA\u5BB6\u7684\u5144\u5F1F\u6269\u5C55\uFF0C\u4E0D\u662F\u7B2C\u4E09\u65B9\u538B\u7F29\u63D2\u4EF6\uFF1A\u5F53 bili \u4E3B\u5BFC\u4F1A\u8BDD\u65F6\u4F1A\u81EA\u52A8\u8BA9\u4F4D\uFF08native \u6A21\u5F0F\u7ECF BILLION_CONTEXT_NATIVE \u6807\u8BB0\u3001launcher/\u624B\u52A8\u63A5\u7EBF\u7ECF /bili/ baseUrl \u81EA\u68C0\uFF09\uFF0C\u6CA1\u6709\u7B2C\u4E8C\u4E2A\u538B\u7F29\u5668\u5728\u6D3B\u52A8\u2014\u2014\u786E\u8BA4\u7248\u672C\u8F83\u65B0\u540E\u6E05\u9664\u672C\u8BB0\u5F55\u5373\u53EF\uFF0C\u65E0\u9700\u79FB\u9664\u4EFB\u4F55\u63D2\u4EF6\u3002","conflict.risk_historical":"\u7684\u75D5\u8FF9\uFF08\u6700\u8FD1 7 \u5929\u65E0\u65B0\u4E8B\u4EF6\uFF0C\u4EE5\u4E0B\u4E3A\u5B58\u91CF\u8BB0\u5F55\uFF09\u2014\u2014\u786E\u8BA4\u53E6\u4E00\u4E2A\u538B\u7F29\u5668\u5DF2\u79FB\u9664\u6216\u88AB bili \u62E6\u622A\u540E\uFF0C\u53EF\u70B9\u53F3\u4FA7\u6309\u94AE\u6E05\u9664\u3002","conflict.on_suspected":"\u68C0\u6D4B\u5230\u7591\u4F3C\u538B\u7F29\u63D2\u4EF6","conflict.what_suspected":"\u540D\u79F0\u542B\u538B\u7F29\u5173\u952E\u8BCD\u7684\u63D2\u4EF6\uFF08\u5C1A\u672A\u786E\u8BA4\u5176\u662F\u5426\u771F\u7684\u538B\u7F29\u4E0A\u4E0B\u6587\uFF09","conflict.risk_suspected":"\u2014\u2014\u8FD9\u4EC5\u662F\u6309\u540D\u79F0\u5173\u952E\u8BCD\u5339\u914D\u7684\u3010\u7591\u4F3C\u3011\u4FE1\u53F7\uFF0C\u4E0D\u662F\u5DF2\u89C2\u5BDF\u5230\u7684\u53CC\u538B\u7F29\u8BC1\u636E\u3002\u8BF7\u786E\u8BA4\u5176\u662F\u5426\u771F\u7684\u6539\u5199\u53D1\u7ED9\u6A21\u578B\u7684\u4E0A\u4E0B\u6587\uFF1B\u53EA\u6539\u7EC8\u7AEF\u663E\u793A / \u6298\u53E0\u5DE5\u5177\u8F93\u51FA\u7684\u63D2\u4EF6\uFF08\u5982 pi-compact-transcript\uFF09\u4E0D\u4F1A\u53CC\u538B\u7F29\u3001\u65E0\u9700\u79FB\u9664\u3002","conflict.on_unconfirmed":"\u68C0\u6D4B\u5230\u672A\u786E\u8BA4\u7684\u538B\u7F29\u76F8\u5173\u4FE1\u53F7","conflict.what_signal":"\u4F1A\u8BDD\u5386\u53F2\u88AB\u6539\u5199\u7684\u75D5\u8FF9\uFF08\u89C2\u5BDF\u5230\u53D8\u5316\uFF0C\u539F\u56E0\u672A\u786E\u8BA4\uFF09","conflict.risk_unconfirmed":"\u3002\u8FD9\u4E9B\u53EA\u662F\u3010\u672A\u786E\u8BA4\u3011\u4FE1\u53F7\uFF0C\u4E0D\u80FD\u8BC1\u660E\u5B58\u5728\u7B2C\u4E8C\u4E2A\u538B\u7F29\u5668\u2014\u2014\u539F\u56E0\u53EF\u80FD\u662F\u5BA2\u6237\u7AEF\u81EA\u8EAB\u6539\u52A8\u3001\u672A\u88AB\u8BC6\u522B\u7684\u538B\u7F29\u5F62\u6001\u6216\u5176\u4ED6\u63D2\u4EF6\u3002\u8BF7\u6838\u5B9E\u540E\u518D\u884C\u52A8\uFF1B\u53EA\u8BFB\u4E0A\u4E0B\u6587\u67E5\u770B\u5668\u3001\u4EC5\u6539\u7EC8\u7AEF\u663E\u793A/\u6298\u53E0\u5DE5\u5177\u8F93\u51FA\u7684\u63D2\u4EF6\u4E0D\u662F\u538B\u7F29\u5668\uFF0C\u65E0\u9700\u79FB\u9664\u3002","conflict.age_active":"\u8FD1 7 \u5929 {n} \u6761","conflict.age_historical":"\u66F4\u65E9 {n} \u6761","conflict.where":"\u8BE6\u60C5\u89C1\u4E0B\u65B9 Sessions \u9875\u6216 GET /__bili/stats \u2192 conflicts\u3002","conflict.clear_btn":"\u6E05\u9664\u8BB0\u5F55","conflict.cleared":"\u51B2\u7A81\u8BB0\u5F55\u5DF2\u6E05\u9664","conflict.hint_label":"\u5904\u7F6E\u65B9\u6CD5\uFF08\u6309\u5BA2\u6237\u7AEF\uFF09\uFF1A","conflict.hint.opencode":'opencode\uFF1A\u5728 opencode \u914D\u7F6E\u91CC\u8BBE "compaction": { "auto": false }\uFF0C\u6216\u7528 bili opencode / bili plugin install opencode\uFF08\u4F1A\u81EA\u52A8\u8BBE\u7F6E\uFF09',"conflict.hint.claude":"claude\uFF1A\u7528 bili claude \u542F\u52A8\uFF08\u81EA\u52A8\u5BF9\u9F50 CLAUDE_CODE_AUTO_COMPACT_WINDOW\uFF09\uFF0C\u6216\u81EA\u884C\u628A CLAUDE_CODE_AUTO_COMPACT_WINDOW \u8BBE\u4E3A bili \u7684\u6709\u6548\u7A97\u53E3","conflict.hint.codex":"codex\uFF1Abili \u9ED8\u8BA4\u62E6\u622A\u539F\u751F\u538B\u7F29\uFF08BILI_CODEX_COMPACT=intercept\uFF09\u2014\u2014\u82E5\u4F60\u8BBE\u4E86 pass\uFF0C\u53BB\u6389\u8BE5\u8986\u76D6\u5373\u53EF\uFF1B\u5426\u5219\u8BF7\u62A5\u544A\u4F60\u7684 bili \u7248\u672C","conflict.hint.pi":"pi\uFF1Abili \u6269\u5C55\u5728\u63A5\u7BA1\u4F1A\u8BDD\u65F6\u4F1A\u81EA\u52A8\u53D6\u6D88\u5BA2\u6237\u7AEF\u539F\u751F\u81EA\u52A8\u538B\u7F29\u2014\u2014\u4ECD\u51FA\u73B0\u8BF4\u660E\u7F3A\u5C11\u63A5\u7BA1\u8BC1\u636E\u6216\u7248\u672C\u8FC7\u65E7\uFF0C\u8BF7\u62A5\u544A\u5BA2\u6237\u7AEF\u4E0E bili \u7248\u672C","conflict.hint.omp":"omp\uFF1Abili \u6269\u5C55\u5728\u63A5\u7BA1\u4F1A\u8BDD\u65F6\u4F1A\u81EA\u52A8\u53D6\u6D88\u5BA2\u6237\u7AEF\u539F\u751F\u81EA\u52A8\u538B\u7F29\u2014\u2014\u4ECD\u51FA\u73B0\u8BF4\u660E\u7F3A\u5C11\u63A5\u7BA1\u8BC1\u636E\u6216\u7248\u672C\u8FC7\u65E7\uFF0C\u8BF7\u62A5\u544A\u5BA2\u6237\u7AEF\u4E0E bili \u7248\u672C","conflict.hint.generic":"\u5173\u95ED\u5BA2\u6237\u7AEF\u81EA\u8EAB\u7684\u81EA\u52A8\u538B\u7F29\uFF08\u6216\u8BA9\u672C\u4F1A\u8BDD\u7ED5\u8FC7 bili\uFF09\uFF0C\u7136\u540E\u5F00\u65B0\u4F1A\u8BDD\u2014\u2014\u53F0\u8D26\u6309\u4F1A\u8BDD\u9694\u79BB\uFF0C\u65E7\u8BB0\u5F55\u968F\u65E7\u4F1A\u8BDD\u6D88\u5931","conflict.hint_more":"\u53E6\u6709 {n} \u4E2A\u5BA2\u6237\u7AEF\uFF0C\u8BE6\u89C1\u4E0B\u65B9 Sessions \u9875","conflict.docs":"\u5B8C\u6574\u77E9\u9635\uFF1ACONFIGURATION.md\u300CDetecting other compression plugins (#1206)\u300D","advisory.on":"\u4E25\u91CD\u7F3A\u9677\u516C\u544A","advisory.desc":"\uFF1A\u5F53\u524D\u7248\u672C\u5B58\u5728\u91CD\u5927\u7F3A\u9677\uFF0Cbili \u6B63\u5728\u81EA\u52A8\u5347\u7EA7\u5230\u5B89\u5168\u7248\u672C\u3002\u539F\u56E0\uFF1A","advisory.hint":"\u3002\u82E5\u672A\u81EA\u52A8\u5B8C\u6210\uFF0C\u8BF7\u624B\u52A8\u6267\u884C\uFF1A","alert.title":"\u4E0A\u6E38\u8FDE\u63A5\u5F02\u5E38","alert.item":"\u65E0\u6CD5\u8FDE\u63A5 {host}\uFF08{kind} \xD7{count}\uFF0C\u9996\u6B21 {first}\uFF09\u2014 {hint}","alert.dismiss":"\u77E5\u9053\u4E86","alert.hint.connect_timeout":"TCP \u63E1\u624B\u672A\u5B8C\u6210\u2014\u2014\u4E0A\u6E38/\u4EE3\u7406\u4E0D\u53EF\u8FBE\u6216\u88AB\u9ED1\u6D1E\uFF08\u4E22\u5305\uFF09\uFF1B\u53EF\u80FD\u5DF2\u6309 BILI_REPLAY_RETRY_MAX \u505A\u6709\u754C\u900F\u660E\u91CD\u653E","alert.hint.connect_refused":"TCP \u88AB\u62D2\u7EDD\uFF08\u914D\u7F6E\u4E86\u4EE3\u7406\u5219\u6307\u4EE3\u7406\uFF0C\u5426\u5219\u6307\u4E0A\u6E38\uFF09\u2014\u2014\u7AEF\u70B9\u672A\u542F\u52A8\u6216\u7AEF\u53E3\u9519\u8BEF","alert.hint.proxy_reset":"\u4EE3\u7406\u5728\u54CD\u5E94\u5F00\u59CB\u524D\u65AD\u5F00\u8FDE\u63A5\u2014\u2014\u68C0\u67E5\u4EE3\u7406\u7A7A\u95F2\u56DE\u6536/\u8F7D\u8377\u4E0A\u9650\uFF08BILI_PROXY_KEEPALIVE_MAX_MS \u53EF\u7F29\u77ED\u590D\u7528\u7A97\u53E3\uFF09\uFF1B\u53EF\u80FD\u5DF2\u6309 BILI_REPLAY_RETRY_MAX \u505A\u6709\u754C\u900F\u660E\u91CD\u653E","alert.hint.upstream_reset":"\u4E0A\u6E38/\u7F51\u7EDC\u5728\u54CD\u5E94\u5F00\u59CB\u524D\u91CD\u7F6E\u8FDE\u63A5\u2014\u2014\u68C0\u67E5\u4E0A\u6E38\u4E0E\u672C\u5730\u7F51\u7EDC\uFF1B\u53EF\u80FD\u5DF2\u6309 BILI_REPLAY_RETRY_MAX \u505A\u6709\u754C\u900F\u660E\u91CD\u653E","alert.hint.dns":"\u57DF\u540D\u89E3\u6790\u5931\u8D25\u2014\u2014DNS \u670D\u52A1\u5668\u6216\u4E3B\u673A\u540D\u62FC\u5199\u9519\u8BEF\uFF1B\u53EF\u80FD\u5DF2\u6309 BILI_REPLAY_RETRY_MAX \u505A\u6709\u754C\u900F\u660E\u91CD\u653E","alert.hint.tls":"CONNECT \u6216\u4E0A\u6E38\u63E1\u624B\u65F6 TLS/\u8BC1\u4E66\u5931\u8D25\u2014\u2014\u68C0\u67E5 CA/\u4EE3\u7406 MITM \u914D\u7F6E","alert.hint.unknown":"\u672A\u5206\u7C7B\u7684\u4F20\u8F93\u5C42\u6545\u969C\u2014\u2014\u8BF7\u9644\u5B8C\u6574\u9519\u8BEF\u94FE\u53CD\u9988","advisory.restartDesc":"\uFF1A\u5B89\u5168\u7248\u672C\u5DF2\u5B89\u88C5\u5230\u78C1\u76D8\uFF0C\u4F46\u5F53\u524D\u8FDB\u7A0B\u4ECD\u5728\u8FD0\u884C\u53D7\u5F71\u54CD\u7248\u672C\u3002\u539F\u56E0\uFF1A","advisory.restartHint":"\u3002\u91CD\u542F bili \u540E\u751F\u6548\u3002","pluginadv.on":"\u68C0\u6D4B\u5230\u9AD8\u6210\u672C\u63D2\u4EF6","pluginadv.desc":"\u8BE5\u63D2\u4EF6\u4F1A\u5728\u6BCF\u6B21\u5DE5\u5177\u8C03\u7528\u524D\u628A\u6574\u6BB5\u4F1A\u8BDD\u91CD\u65B0\u53D1\u9001\u7ED9\u6A21\u578B\u505A\u5BA1\u67E5\uFF0C\u5BFC\u81F4\u4E0A\u6E38\u524D\u7F00\u7F13\u5B58\u51E0\u4E4E\u65E0\u6CD5\u590D\u7528\uFF08\u7F13\u5B58\u547D\u4E2D\u7387\u5E38\u53EA\u6709\u4E2A\u4F4D\u6570\u767E\u5206\u6BD4\uFF09\uFF0C\u663E\u8457\u589E\u52A0 token \u6210\u672C\u3002\u8FD9\u4E0E bili \u7684\u538B\u7F29\u65E0\u5173\u2014\u2014bili \u5DF2\u628A\u5B83\u9694\u79BB\u5230\u72EC\u7ACB\u5B50\u4F1A\u8BDD\uFF0C\u4E3B\u4F1A\u8BDD\u7684\u524D\u7F00\u7F13\u5B58\u4E0D\u53D7\u5F71\u54CD\u3002","pluginadv.hint":"\u5EFA\u8BAE\u5173\u95ED\u8BE5\u63D2\u4EF6\u6216\u8054\u7CFB\u5176\u5B98\u65B9\u4F18\u5316\uFF1B\u8BE6\u60C5\u89C1\u4E0A\u65B9\u94FE\u63A5\uFF08\u672C issue\uFF09\u3002","ses.title":"\u4F1A\u8BDD","ses.sub":"\u8986\u76D6\u5185\u5B58\u4E0E\u78C1\u76D8\u7684\u5168\u90E8\u4F1A\u8BDD \xB7 \u70B9\u51FB\u884C\u67E5\u770B\u8BE6\u60C5\u3001\u8F68\u8FF9\u4E0E\u4EA4\u63A5\u6587\u6863","ses.search_ph":"\u641C\u7D22\u6807\u9898\u3001\u6807\u7B7E\u6216 id\u2026","ses.th_title":"\u4F1A\u8BDD","ses.th_proto":"\u534F\u8BAE","ses.th_upstream":"\u4E0A\u6E38","ses.th_reqs":"\u8BF7\u6C42","ses.th_ctx":"\u5F53\u524D\u4E0A\u4E0B\u6587","ses.th_saved":"\u8282\u7701","ses.th_hit":"\u547D\u4E2D\u7387","ses.th_switches":"\u6A21\u578B\u5207\u6362","ses.th_switches_tip":"\u4F1A\u8BDD\u4E2D\u9014\u5207\u6362\u6A21\u578B\u7684\u6B21\u6570 \xB7 \u56E0\u65B0\u6A21\u578B\u524D\u7F00\u7F13\u5B58\u5168\u51B7\u3001\u7A33\u5B9A\u524D\u7F00\u91CD\u65B0\u8BA1\u8D39\u800C\u6389\u7684 token\uFF08#1535\uFF09\xB7 \u{1F511}\uFF1D\u4E2D\u8F6C\u7AD9\u5BC6\u94A5/\u8D26\u53F7\u8F6E\u6362\u6B21\u6570\uFF08\u51ED\u8BC1\u6307\u7EB9\u53D8\u5316\uFF0C#2131\uFF09\xB7 \u270D\uFE0F\uFF1D\u5BBF\u4E3B\u6539\u5199\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6B21\u6570\uFF08\u63D0\u793A\u8BCD\u6307\u7EB9\u53D8\u5316\uFF0C#2350\uFF09","ses.th_keyswitches_tip":"\u4E2D\u8F6C\u7AD9\u5BC6\u94A5/\u8D26\u53F7\u8F6E\u6362\uFF08\u51ED\u8BC1\u6307\u7EB9\u53D8\u5316\uFF0C\u540C\u4E00 URL \u80CC\u540E\u6362\u4E86 key\uFF09\xB7 \u8F6E\u6362\u540E\u8BE5\u8D26\u53F7\u524D\u7F00\u7F13\u5B58\u5168\u51B7\u3001\u7A33\u5B9A\u524D\u7F00\u91CD\u65B0\u8BA1\u8D39\u7684 token\uFF08#2131\uFF09","ses.th_promptswitches_tip":"\u5BBF\u4E3B\u6539\u5199\u4E86\u7CFB\u7EDF\u63D0\u793A\u8BCD\uFF08\u63D0\u793A\u8BCD\u6307\u7EB9\u53D8\u5316\uFF0C\u5982\u5BBF\u4E3B\u5468\u671F\u6027\u63D2\u5165/\u79FB\u9664\u52A8\u6001\u6BB5\uFF09\xB7 \u6BCF\u6B21\u6539\u5199\u4F7F\u4E0B\u6E38\u524D\u7F00\u7F13\u5B58\u5168\u90E8\u5931\u6548\u3001\u7A33\u5B9A\u524D\u7F00\u91CD\u65B0\u8BA1\u8D39\u7684 token\uFF08#2350\uFF09","det.key_events":"\u5BC6\u94A5\u5207\u6362\u4E8B\u4EF6\uFF08{n}\uFF09","det.key_events_tip":"\u51ED\u8BC1\u6307\u7EB9\u53D8\u5316\uFF1D\u4E2D\u8F6C\u7AD9\u6362\u4E86\u8D26\u53F7\uFF1B\u6307\u7EB9\u662F sha256 \u524D 12 \u4F4D\uFF0C\u4E0D\u542B\u539F\u59CB\u5BC6\u94A5","det.key_fp":"\u51ED\u8BC1\u6307\u7EB9","det.prompt_events":"\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6539\u5199\u4E8B\u4EF6\uFF08{n}\uFF09","det.prompt_events_tip":"\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6307\u7EB9\u53D8\u5316\uFF1D\u5BBF\u4E3B\u5728\u4E24\u6B21\u8BF7\u6C42\u4E4B\u95F4\u6539\u5199\u4E86\u7CFB\u7EDF\u63D0\u793A\u8BCD\uFF1B\u6307\u7EB9\u662F sha256 \u524D 16 \u4F4D\uFF0C\u4E0D\u542B\u539F\u6587","det.prompt_fp":"\u63D0\u793A\u8BCD\u6307\u7EB9","ses.th_blocks":"\u5757","ses.th_seen":"\u6700\u8FD1\u6D3B\u52A8","ses.th_client":"\u5BA2\u6237\u7AEF","ses.th_input":"\u7D2F\u8BA1\u8F93\u5165","ses.th_folds":"\u538B\u7F29\u6B21\u6570","ses.empty":"\u8FD8\u6CA1\u6709\u4F1A\u8BDD","ses.empty_hint":"\u901A\u8FC7 bili \u4EE3\u7406\u7684\u7B2C\u4E00\u4E2A\u8BF7\u6C42\u4F1A\u81EA\u52A8\u521B\u5EFA\u4F1A\u8BDD","ses.count":"{count} \u4E2A\u4F1A\u8BDD","ses.refresh":"\u5237\u65B0","ses.load_more":"\u52A0\u8F7D\u66F4\u591A","data.error":"\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF1A{msg} \xB7 \u5DF2\u81EA\u52A8\u9000\u907F\u91CD\u8BD5","data.generic":"\u7F51\u7EDC\u9519\u8BEF\u6216\u8BF7\u6C42\u8D85\u65F6","data.timeout":"\u8BF7\u6C42\u8D85\u65F6\uFF0820s\uFF09","det.identity":"\u57FA\u672C\u4FE1\u606F","det.version":"\u4EE3\u7406\u7248\u672C","det.active_pack":"\u538B\u7F29\u63D0\u793A\u5305","det.conflicts_title":"\u538B\u7F29\u51B2\u7A81\u8BB0\u5F55","det.conflicts_hint":"\u5176\u4ED6\u538B\u7F29\u5668\u89E6\u78B0\u672C\u4F1A\u8BDD\u7684\u8BC1\u636E\uFF08\u8BCA\u65AD\u7528\uFF0C\u975E\u5386\u53F2\uFF09","det.conflicts_more":"\u66F4\u65E9\u7684 {n} \u6761\u2026","det.conflicts_clear":"\u6E05\u9664\u672C\u4F1A\u8BDD\u8BB0\u5F55","det.conflicts_cleared":"\u5DF2\u6E05\u9664","det.usage":"\u7528\u91CF\u7EDF\u8BA1","det.last_input":"\u6700\u8FD1\u5355\u6B21\u8F93\u5165","det.upper_bound":"\u4FDD\u5B88\u4E0A\u754C {v}\uFF08\u5B57\u7B26\u6570\u4E0A\u754C\uFF0C\u53EA\u7528\u4E8E\u5B89\u5168\u4FDD\u62A4\uFF0C\u4E0D\u4EE3\u8868\u5B9E\u9645\u7528\u91CF\uFF09","det.calib_chip":"k\u0302={k} \xB7 {n}\u6837\u672C \xB7 \u6781\u5DEE{spread}\xD7 \xB7 {origin}","det.calib_tip":"\u6821\u51C6\u7CFB\u6570 k\u0302\uFF1A\u672C\u8DEF\u7531+\u6A21\u578B\u4E0B\u6700\u8FD1 {n} \u4E2A\u4E00\u81F4\u6837\u672C\uFF08\u6781\u5DEE {spread}\xD7\uFF09\u7684\u5747\u503C\uFF0C\u53EA\u5411\u4E0B\u4FEE\u6B63\u4F30\u7B97\uFF1B\u8DEF\u7531\u6216\u6A21\u578B\u53D8\u5316\u540E\u91CD\u65B0\u5B66\u4E60\u3002\u6765\u6E90 {origin}{model}\u3002","det.ccr":"CCR \u5185\u5BB9\u68C0\u7D22","det.ccr_detail":"{calls} \u6B21\u8C03\u7528 \xB7 {hits} \u547D\u4E2D \xB7 {misses} \u672A\u4E2D","det.store":"\u5185\u5BB9\u5B58\u50A8","det.trajectory":"\u4E0A\u4E0B\u6587\u8F68\u8FF9","det.trajectory_sub":"\u6BCF\u6B21\u8BF7\u6C42\u7684\u8F93\u5165 token \u4E0E\u7F13\u5B58\u547D\u4E2D\uFF1B\u7EA2\u8272\u7AD6\u7EBF\u4E3A\u538B\u7F29\u6298\u53E0\u70B9","det.trajectory_empty":"\u8BE5\u4F1A\u8BDD\u8FD8\u6CA1\u6709\u7528\u91CF\u91C7\u6837","det.legend_input":"\u8F93\u5165","det.legend_cached":"\u5176\u4E2D\u7F13\u5B58\u547D\u4E2D","det.legend_fold":"\u538B\u7F29\u6298\u53E0\u70B9","det.legend_window":"\u4E0A\u4E0B\u6587\u7A97\u53E3\u4E0A\u9650","det.cause_cold":"\u51B7\u542F\u52A8\uFF08\u65E0\u5386\u53F2\u7F13\u5B58\uFF09","det.cause_comp":"\u538B\u7F29\u540E\u91CD\u65B0\u5EFA\u7F13\u5B58","det.cause_ttl":"\u95F4\u9694\u8FC7\u957F \xB7 \u4E0A\u6E38 TTL \u8FC7\u671F\u91CD\u8BFB","det.fold_short":"\u6298\u53E0","ov.gross_note":"\u6309\u6BCF\u6B21\u6298\u53E0\u7684\u8282\u7701\u91CF \xD7 \u5176\u540E\u6BCF\u4E2A\u8BF7\u6C42\u7D2F\u8BA1\uFF08\u7406\u8BBA\u4E0A\u754C\uFF09","ov.net_excl":"\u672A\u542B\u65E7\u7248\u672C\u65E0\u91C7\u6837\u4F1A\u8BDD","det.omitted":"\u66F4\u65E9\u7684 {n} \u6761\u91C7\u6837\u5DF2\u88C1\u9664\uFF1A\u6BCF\u4E2A\u4F1A\u8BDD\u53EA\u4FDD\u7559\u6700\u8FD1 4096 \u6761\u7F13\u5B58\u91C7\u6837\uFF0C\u8D85\u51FA\u90E8\u5206\u5728\u5199\u5165\u65F6\u88C1\u526A\u3001\u4E0D\u53EF\u6062\u590D\uFF0C\u6240\u4EE5\u66F2\u7EBF\u4ECE\u6700\u65E9\u4FDD\u7559\u7684\u4E00\u6761\u5F00\u59CB","ov.saved_neg_tip":"\u51C0\u8282\u7701\u4E3A\u8D1F\uFF1A\u538B\u7F29\u590D\u4ED8\uFF08\u6458\u8981\u590D\u8BFB\u6210\u672C\uFF09\u8D85\u8FC7\u4E86\u7406\u8BBA\u8282\u7701\u2014\u2014\u5E38\u89C1\u4E8E\u6298\u53E0\u540E\u5F88\u5FEB\u7ED3\u675F\u7684\u77ED\u4F1A\u8BDD\uFF0C\u8FD9\u4E9B\u573A\u666F\u4E0B\u538B\u7F29\u4E0D\u5212\u7B97","det.cache_econ":"\u7F13\u5B58\u7ECF\u6D4E\u5B66","det.ce_new":"\u65B0\u5185\u5BB9","det.ce_comp":"\u538B\u7F29\u56DE\u8865","det.ce_ttl":"TTL \u56DE\u8865","det.ce_residual":"\u6B8B\u5DEE","det.ce_balanced":"\u8D26\u76EE\u5E73\u8861 \u2713","det.ce_unbalanced":"\u8D26\u76EE\u4E0D\u5E73\u8861 \u2717","det.attr_title":"\u5F52\u56E0 \xB7 \u672A\u89E3\u91CA\u6B8B\u5DEE","det.attr_seam":"\u26A0 \u7F13\u5B58\u63A5\u7F1D","det.attr_provider":"\u25B2 \u4E0A\u6E38\u4FA7\u5931\u6548","det.attr_rewind":"\u21A9 \u5386\u53F2\u56DE\u9000","det.attr_abort":"\u23FB \u4E2D\u65AD\u76F8\u5173","det.attr_seam_tip":"\u51FA\u7AD9\u8BF7\u6C42\u4F53\u5728\u5386\u53F2\u4E2D\u6BB5\u51FA\u73B0\u5B57\u8282\u5206\u53C9\uFF0C\u4E14\u65E0 fold/\u6A21\u578B\u5207\u6362/\u91CD\u542F\u5F52\u56E0\u2014\u2014\u7591\u4F3C\u91CD\u5EFA\u7F1D\u3002\u6570\u503C\u4E3A\u5ACC\u7591\u6837\u672C\u91CD\u8BA1\u8D39\u7684 token","det.attr_provider_tip":"\u4E0A\u4E00\u8BF7\u6C42\u7684\u6574\u6761\u6D88\u606F\u5217\u8868\u9010\u5B57\u8282\u4FDD\u7559\uFF08\u6574\u4F53\u4E00\u81F4\uFF0C\u6216\u524D\u7F00\u4E00\u81F4\u3001\u4EC5\u5C3E\u90E8\u8FFD\u52A0\u65B0\u6D88\u606F\uFF1B\u8D85\u8FC7 512KiB \u53D6\u8BC1\u4E0A\u9650\u7684\u8BF7\u6C42\u4EE5\u8BB0\u5F55\u5934\u7A33\u5B9A + \u7CBE\u786E\u6D88\u606F\u6570\u589E\u957F\u5224\u5B9A\uFF09\u5374\u4ECD miss\u2014\u2014\u4E0A\u6E38 TTL \u8FC7\u671F/\u6DD8\u6C70/\u4E2D\u7EE7\u8282\u70B9\u8F6E\u6362\uFF0C\u975E bili \u91CD\u5EFA\u7F1D","det.attr_rewind_tip":"\u5BA2\u6237\u7AEF revert/trim \u4F7F\u6D88\u606F\u6570\u4E0B\u964D\u2014\u2014\u5408\u6CD5\u7684\u4E00\u6B21\u6027\u91CD\u8BA1\u8D39\uFF08\u4FDD\u7559\u524D\u7F00\uFF09\uFF0C\u975E\u7F3A\u9677","det.attr_abort_tip":"\u5BA2\u6237\u7AEF\u6D41\u4E2D abort \u540E 30s \u5185\u7ED3\u7B97\u7684 miss \u6837\u672C\u6570\u2014\u2014\u91CD\u8BD5\u91CD\u5199\u91CD\u53D1\u5C3E\u90E8\uFF1B\u76F8\u5173\u6027\u800C\u975E\u56E0\u679C\uFF0C\u53E0\u52A0\u6807\u8BB0\u4E0D\u8BA1\u5165\u5206\u6876","det.attr_prompt":"\u270D\uFE0F \u5BBF\u4E3B\u6539\u5199\u63D0\u793A\u8BCD","det.attr_prompt_tip":"\u76F8\u90BB\u4E24\u6B21\u8BF7\u6C42\u7684\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6307\u7EB9\u4E0D\u540C\uFF1D\u5BBF\u4E3B\u6539\u5199\u4E86\u7CFB\u7EDF\u63D0\u793A\u8BCD\uFF08\u5982\u5468\u671F\u6027\u63D2\u5165/\u79FB\u9664\u52A8\u6001\u6BB5\uFF09\u2014\u2014\u4E0B\u6E38\u524D\u7F00\u7F13\u5B58\u5168\u90E8\u5931\u6548\uFF1B\u8BE5\u8BF7\u6C42\u7A33\u5B9A\u524D\u7F00\u91CD\u8BA1\u8D39\u8BA1\u5165\u6B64\u6876\uFF08\u5F52\u56E0\u4F18\u5148\u7EA7 restart>model>key>prompt>wire>upstream\uFF0C#2350\uFF09","det.attr_note":"\u63A5\u7F1D / \u4E0A\u6E38\u4FA7 / \u56DE\u9000 / \u5BBF\u4E3B\u6539\u5199 \u4E92\u65A5\u5206\u533A\u672A\u89E3\u91CA\u6B8B\u5DEE\u7684\u4E00\u90E8\u5206\uFF0C\u4E2D\u65AD\u4E3A\u53E0\u52A0\u6807\u8BB0\u2014\u2014\u5747\u4E0D\u542B\u5728\u4E0A\u65B9 TOTAL \u5185\uFF0C\u4E0D\u91CD\u590D\u8BA1\u6570","det.seam_events":"\u26A0 \u7F13\u5B58\u63A5\u7F1D\u4E8B\u4EF6 \xB7 {n}","det.seam_events_tip":"\u76F8\u90BB\u51FA\u7AD9\u4F53\u7684\u9996\u4E2A\u5B57\u8282\u5206\u53C9\u4F4D\u7F6E\uFF1B\u82E5\u53EF\u590D\u73B0\uFF0C\u8BF7\u9644\u4E0A\u8BE5\u65F6\u95F4\u9644\u8FD1\u7684 bili.log\uFF08#1548 \u7C7B\u95EE\u9898\uFF09","det.stab_title":"\u4F53\u7A33\u5B9A\u6027\uFF08\u9010\u8C03\u7528\u5B57\u8282\u8BC1\u660E\uFF09","det.stab_pairs":"\u76F8\u90BB\u8C03\u7528\u5BF9 {n}","det.stab_tip":"\u6BCF\u6B21\u51FA\u7AD9\u8BF7\u6C42\u4F53\u4E0E\u4E0A\u4E00\u4E2A\u5DF2\u7ED3\u7B97\u8BF7\u6C42\u505A SHA-256 \u5B57\u8282\u6BD4\u8F83\uFF1Aidentical=\u9010\u5B57\u8282\u76F8\u540C\uFF08\u5982\u4F20\u8F93\u91CD\u8BD5\uFF09\uFF1Bdiverged \u6309\u9996\u4E2A\u5206\u53C9\u70B9\u5206\u7C7B\u2014\u2014head<1KiB \u662F\u5BBF\u4E3B\u4FA7\u53C2\u6570\u53D8\u66F4\uFF08model/tools/\u91C7\u6837\uFF09\uFF0Ctail-append \u662F\u7EAF\u5C3E\u90E8\u589E\u957F\uFF0Cmid \u662F\u771F\u5B9E\u524D\u7F00\u6539\u5199\uFF0Coffset-unknown \u8868\u793A body \u8D85\u4FDD\u7559\u4E0A\u9650\uFF08\u4E0D\u7B49\u5F0F\u4ECD\u7531\u6458\u8981\u8BC1\u660E\uFF09","det.stab_identical":"\u9010\u5B57\u8282\u76F8\u540C","det.stab_head":"\u5934\u90E8<1KiB(\u53C2\u6570\u53D8\u66F4)","det.stab_append":"\u5C3E\u90E8\u8FFD\u52A0","det.stab_mid":"\u4E2D\u6BB5\u6539\u5199","det.stab_unknown":"\u504F\u79FB\u672A\u77E5(\u622A\u65AD)","det.stab_size":"\u6309\u8F93\u5165\u5C3A\u5BF8\u7684\u547D\u4E2D\u7387(\u4E2D\u4F4D)","det.stab_gap":"\u8BF7\u6C42\u95F4\u9694\u4E2D\u4F4D\uFF1A\u4F4E\u547D\u4E2D(<80%) {a}s vs \u9AD8\u547D\u4E2D {b}s","det.seam_col_hit":"\u547D\u4E2D\u7387","det.seam_col_input":"\u8F93\u5165","det.seam_col_div":"\u9996\u4E2A\u5206\u53C9","det.seam_msg":"\u6D88\u606F[{i}]\uFF08{prev}\u2192{cur} \u6761\uFF09","det.seam_mark_tip":"\u26A0 \u7F13\u5B58\u63A5\u7F1D #{seq} \xB7 {at} \xB7 \u547D\u4E2D {hit}% \xB7 \u9996\u4E2A\u5206\u53C9 \u2265{lcp} @ \u6D88\u606F[{msg}]\uFF08{prev}\u2192{cur} \u6761\u6D88\u606F\uFF09","det.legend_seam":"\u7F13\u5B58\u63A5\u7F1D","det.folds":"\u6298\u53E0\u660E\u7EC6","det.folds_empty":"\u5C1A\u65E0\u6298\u53E0\u4E8B\u4EF6","det.fold_s":"\u538B\u7F29\u91CF S","det.fold_sigma":"\u6458\u8981 \u03C3","det.fold_h":"\u6298\u53E0\u540E\u547D\u4E2D\u7387","det.fold_t":"\u7D2F\u8BA1\u56DE\u8865 T","det.client_hint":"\u5BA2\u6237\u7AEF","det.self_heal":"\u81EA\u6108\u72B6\u6001","det.self_heal_tip":"\u4F1A\u8BDD\u5361\u6B7B\u81EA\u6108\u5DF2\u63A5\u7BA1\uFF1A\u8BE6\u89C1\u4F1A\u8BDD\u8BE6\u60C5\uFF08#2155\uFF09","det.self_heal_short":"\u81EA\u6108","det.self_heal_degrade_to_proxy":"\u63D2\u4EF6\u8F66\u9053\u5DF2\u6B7B \u2192 \u5DF2\u964D\u7EA7\u4EE3\u7406\u6A21\u5F0F\uFF08\u5DE5\u5177\u5DF2\u56DE\u6CE8\uFF09","det.self_heal_suppress_nudge":"\u538B\u7F29\u63D0\u9192\u7A7A\u8F6C \u2192 \u5DF2\u9759\u9ED8\uFF08\u6062\u590D\u538B\u7F29\u81EA\u52A8\u89E3\u9664\uFF09","det.legend_base":"\u7CFB\u7EDF\u63D0\u793A\u8BCD\u57FA\u7EBF\uFF08\u5B9E\u6D4B \xB7 \u4E0D\u53EF\u538B\u7F29\uFF09","det.legend_base_est":"\u57FA\u7EBF\u4F30\u7B97\uFF08\u7CFB\u7EDF\u63D0\u793A\u8BCD\u4E0E\u5DE5\u5177\u7B49\u4E0D\u53EF\u538B\u7F29\u90E8\u5206\uFF09","det.blocks_title":"\u538B\u7F29\u5757","det.blocks_count":"{total} \xB7 {active} \u6D3B\u8DC3","det.blocks_empty":"\u5C1A\u65E0\u538B\u7F29\u5757","det.block_active":"\u6D3B\u8DC3","det.block_external":"\u5916\u90E8\u6458\u8981","det.block_inactive":"\u5DF2\u5F52\u6863","det.blocks_download":"\u4E0B\u8F7D\u5757 (.md)","det.report_dl":"\u4E0B\u8F7D\u7F13\u5B58\u62A5\u544A (.md)","det.blocks_copy_md":"\u590D\u5236 Markdown","det.handoff":"\u4F1A\u8BDD\u4EA4\u63A5\u6587\u6863","det.handoff_hint":"\u4E0E bili export \u76F8\u540C\u7684\u5185\u5BB9 \u2014\u2014 \u590D\u5236\u7C98\u8D34\u5230\u65B0\u4F1A\u8BDD\u5373\u53EF\u7EE7\u7EED","det.thinking":"\u601D\u8003","det.handoff_truncated":"\u26A0\uFE0F \u5185\u5BB9\u8FC7\u957F\u5DF2\u622A\u65AD","det.handoff_copy_md":"\u590D\u5236 Markdown","det.handoff_download":"\u4E0B\u8F7D .md","det.not_found":"\u627E\u4E0D\u5230\u8BE5\u4F1A\u8BDD","det.not_found_hint":"\u5B83\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\uFF0C\u6216\u4E0D\u5C5E\u4E8E\u672C\u673A\u6570\u636E\u76EE\u5F55","cfg.title":"\u914D\u7F6E","cfg.sub":"\u4FEE\u6539\u5373\u65F6\u5199\u5165\u914D\u7F6E\u6587\u4EF6\u5E76\u70ED\u751F\u6548 \xB7 \u4FDD\u5B58\u524D\u8BF7\u786E\u8BA4 JSON \u8BED\u6CD5","cfg.file":"\u914D\u7F6E\u6587\u4EF6","cfg.parse_error":"\u914D\u7F6E\u6587\u4EF6\u4E0D\u662F\u6709\u6548 JSON \u2014\u2014 \u663E\u793A\u4E3A\u7A7A\u89C6\u56FE","cfg.upstream_net":"\u4E0A\u6E38\u7F51\u7EDC","cfg.up_auto":"auto\uFF08\u8DDF\u968F\u7CFB\u7EDF\u4EE3\u7406\uFF09","cfg.up_manual":"manual\uFF08\u663E\u5F0F\u4EE3\u7406\uFF09","cfg.up_direct":"direct\uFF08\u5F3A\u5236\u76F4\u8FDE\uFF09","cfg.passthrough":"Passthrough","cfg.passthrough_desc":"\u5F00\u5173\u51B3\u5B9A\u672A\u5339\u914D\u5230\u8DEF\u7531\u7684\u6D41\u91CF\u662F\u5426\u539F\u6837\u900F\u4F20\u3001\u4E0D\u505A\u4EFB\u4F55\u6539\u5199\u5730\u76F4\u8FBE\u76EE\u6807\u670D\u52A1\u3002\u72B6\u6001\u5199\u5165\u914D\u7F6E\u6587\u4EF6\uFF1B\u5F53\u7531\u73AF\u5883\u53D8\u91CF ACP_PASSTHROUGH \u5F3A\u5236\u65F6\u9875\u9762\u4F1A\u6807\u660E\u6765\u6E90\uFF0C\u9700\u53D6\u6D88\u8BE5\u53D8\u91CF\u5E76\u91CD\u542F\u540E\u624D\u80FD\u5728\u6B64\u4FEE\u6539","cfg.pt_off":"\u5173\u95ED","cfg.pt_on":"\u5F00\u542F","cfg.test_hint":"\u5411\u5F53\u524D\u4E0A\u6E38\u53D1\u4E00\u6B21\u6700\u5C0F\u8BF7\u6C42\u9A8C\u8BC1\u53EF\u8FBE\u6027\uFF1B\u4E0D\u4FEE\u6539\u4EFB\u4F55\u914D\u7F6E","cfg.test_btn":"\u6D4B\u8BD5\u8FDE\u63A5","cfg.state":"\u8FDE\u63A5\u72B6\u6001","cfg.untested":"\u5C1A\u672A\u63A2\u6D4B","cfg.save":"\u4FDD\u5B58","cfg.unsaved":"\u26A0 \u6709\u672A\u4FDD\u5B58\u7684\u66F4\u6539\u2014\u2014\u70B9\u300C\u4FDD\u5B58\u300D\u524D\u4E0D\u4F1A\u5199\u5165","cfg.file_desc":"\u5C31\u662F\u76F4\u63A5\u7F16\u8F91\u914D\u7F6E\u6587\u4EF6\u2014\u2014\u8FD9\u4E2A JSON \u91CC\u6240\u6709\u9876\u5C42\u5B57\u6BB5\u90FD\u751F\u6548\uFF08\u8DEF\u7531\u8868\u3001\u538B\u7F29\u3001\u7F51\u7EDC\u3001\u900F\u4F20\u3001promptPack\u3001ccr \u2026\uFF09\uFF0C\u4FDD\u5B58\u7ACB\u5373\u70ED\u751F\u6548","cfg.quick":"\u5FEB\u901F\u914D\u7F6E","cfg.quick_desc":"\u5E38\u7528\u9879\u70B9\u4E00\u70B9\u5C31\u6539\u2014\u2014\u6BCF\u6B21\u6539\u52A8\u5B9E\u65F6\u540C\u6B65\u5230\u4E0B\u65B9\u539F\u59CB JSON\uFF08\u53EA\u6539\u8FD9\u4E00\u4E2A\u6587\u4EF6\uFF0C\u4E0D\u65B0\u589E\u4EFB\u4F55\u914D\u7F6E\u9879\uFF09\uFF1Bproviders \u8868\u7B49\u9AD8\u7EA7\u7ED3\u6784\u76F4\u63A5\u7528\u4E0B\u9762\u7684 JSON","cfg.q_debug":"\u8C03\u8BD5\u65E5\u5FD7\uFF08debug\uFF09","cfg.q_passthrough":"\u900F\u4F20\u6A21\u5F0F\uFF08passthrough\uFF09\u2014\u2014\u5F00\u542F\u540E\u4E0D\u6CE8\u5165\u3001\u4E0D\u538B\u7F29\uFF0C\u7EAF\u4EE3\u7406","cfg.q_dsh_compact":"dsh \u81EA\u5E26\u538B\u7F29\uFF08allowDshCompaction\uFF09\u2014\u2014\u5F53\u524D\u5DF2\u7981\u7528\uFF1Abili \u62E6\u622A dsh \u539F\u751F\u538B\u7F29\u8BF7\u6C42\uFF1B\u4EC5\u5F53\u4F60\u786E\u5B9E\u7528 dsh \u7684 /compact \u6D41\u7A0B\u65F6\u624D\u9700\u8981\u52FE\u9009\u653E\u884C","cfg.q_dsh_compact_warn":"\u26A0 \u52FE\u9009\u653E\u884C\u7684\u540E\u679C\uFF1Adsh \u539F\u751F\u538B\u7F29\u4E00\u65E6\u843D\u5730\uFF0C\u4F1A\u628A\u6574\u4E2A\u539F\u59CB\u5386\u53F2\u6C38\u4E45\u66FF\u6362\u6210\u4E00\u4EFD\u6458\u8981\uFF08\u4E0D\u53EF\u6062\u590D\uFF09\uFF0C\u8BE5\u4F1A\u8BDD\u7684 bili \u538B\u7F29\u968F\u4E4B\u5931\u6548\u3002\u975E web profile \u4E0B\u51FA\u5382 patch \u7684 auto:false \u4ECD\u538B\u5236\u81EA\u52A8\u89E6\u53D1\u2014\u2014\u52FE\u4E0A\u53EA\u5F71\u54CD\u624B\u52A8 /compact\u3002","cfg.q_dsh_compact_env":"\u5F53\u524D\u7531\u73AF\u5883\u53D8\u91CF BILI_ALLOW_DSH_COMPACTION \u5F3A\u5236\u2014\u2014\u6B64\u5904\u4FEE\u6539\u4E0D\u751F\u6548\uFF0C\u53D6\u6D88\u8BBE\u7F6E\u5E76\u91CD\u542F\u540E\u624D\u53EF\u4FEE\u6539","cfg.q_pack":"\u538B\u7F29\u63D0\u793A\u8BCD\u5305\uFF08compress.promptPack\uFF09","cfg.q_nudge":"\u538B\u7F29\u589E\u957F\u9608\u503C tokens\uFF08compress.nudgeGrowthTokens\uFF09","cfg.q_nudge_step":"\u6B65\u8FDB 5000","cfg.q_nudge_low":"\u4F4E\u4E8E 20000\uFF1A\u538B\u7F29\u8FC7\u4E8E\u9891\u7E41\u4F1A\u635F\u5BB3\u6458\u8981\u8D28\u91CF\uFF08\u5185\u6838\u9ED8\u8BA4 50000\uFF09","cfg.q_nudge_high":"\u9AD8\u4E8E 100000\uFF1A\u4E24\u6B21\u6298\u53E0\u4E4B\u95F4\u4E0A\u4E0B\u6587\u8FC7\u957F\uFF0C\u53EF\u80FD\u524A\u5F31\u6A21\u578B\u6CE8\u610F\u529B","cfg.q_tiers":"\u5206\u5C42\u538B\u7F29\u89E6\u53D1\u9608\u503C tokens\uFF08compress.tierNudgeTokens\uFF0C\u521D\u59CB\u4E3A\u6D3E\u751F\u9ED8\u8BA4\u503C\uFF0C\u4EC5\u4FDD\u5B58\u4FEE\u6539\u9879\uFF09","cfg.q_tiers_auto":"auto","cfg.q_tiers_step":"\u6B65\u8FDB 5000","cfg.q_tiers_tip_t1":"T1 \u539F\u59CB\u6D88\u606F\u538B\u7F29\u89E6\u53D1\u9608\u503C\uFF08\u6309\u539F\u59CB token \u8BA1\uFF09\u2014\u2014\u9ED8\u8BA4\uFF1D\u4E0A\u9762\u7684\u538B\u7F29\u589E\u957F\u9608\u503C","cfg.q_tiers_tip_t2":"T2 \u6458\u8981\u518D\u84B8\u998F\u89E6\u53D1\u9608\u503C\uFF08\u6309 T1 \u6458\u8981 token \u8BA1\uFF09\u2014\u2014\u9ED8\u8BA4\uFF1D\u589E\u957F\u9608\u503C \xD7 1.5\uFF1B\u8C03\u5927\u53EF\u8BA9\u6BCF\u4E2A T2 \u5757\u627F\u8F7D\u66F4\u591A\u9879\u76EE\u5386\u53F2","cfg.q_tiers_tip_t3":"T3 \u6D53\u7F29\u89E6\u53D1\u9608\u503C\uFF08\u6309 T2 \u6458\u8981 token \u8BA1\uFF09\u2014\u2014\u9ED8\u8BA4\uFF1D\u589E\u957F\u9608\u503C \xD7 1.5","cfg.q_tiers_desc":"\u521D\u59CB\u503C\u4E3A\u5F53\u524D\u6D3E\u751F\u9ED8\u8BA4\uFF08T1\uFF1D\u589E\u957F\u9608\u503C\uFF0CT2/T3\uFF1D\xD71.5\uFF09\uFF0C\u672A\u6539\u52A8\u7684\u9879\u4E0D\u5199\u5165\u914D\u7F6E\u3002\u6CE8\u610F T2/T3 \u6309\u4F4E\u4E00\u5C42\u6458\u8981 token \u8BA1\u3001\u4E0D\u662F\u539F\u6587\uFF1A\u9ED8\u8BA4 7.5w\u3001\u6309 ~10:1 \u6458\u8981\u6BD4\uFF0C\u4E00\u4E2A T2 \u5757\u7EA6\u627F\u8F7D 75 \u4E07\u539F\u59CB\u4E0A\u4E0B\u6587\uFF1B\u957F\u9879\u76EE\u53EF\u8C03\u5927 T2 \u8BA9\u6BCF\u5757\u627F\u8F7D\u66F4\u591A\u5386\u53F2\u3002","cfg.q_prm":"\u4FDD\u62A4\u6700\u8FD1\u6D88\u606F\u6761\u6570\uFF08compress.preserveRecentMessages\uFF09","cfg.q_prm_ph":"\u7559\u7A7A\uFF1D\u5185\u6838\u9ED8\u8BA4","cfg.q_never":"\u4ECE\u6700\u8FD1\u6D88\u606F\u4FDD\u7559\u4E2D\u6392\u9664\u7684\u5DE5\u5177\u540D\uFF08compress.neverPreserveRecentTools\uFF09","cfg.q_never_ph":"\u9017\u53F7\u5206\u9694\uFF0C* \u901A\u914D\uFF1B\u7559\u7A7A\uFF1D\u5185\u6838\u9ED8\u8BA4\uFF08\u542B read\u3001bash\uFF09","cfg.q_never_note":"\u9ED8\u8BA4\u6392\u9664 decompress\u3001search_context\u3001read\u3001bash\u2014\u2014\u6279\u91CF\u8BFB\u6587\u4EF6\u65F6\u628A read \u79FB\u51FA\u5217\u8868\uFF0C\u53EF\u907F\u514D\u521A\u8BFB\u7684\u6587\u4EF6\u7ACB\u523B\u88AB\u6298\u53E0","cfg.q_ptools":"\u4FDD\u62A4\u5DE5\u5177\u540D\uFF08protectedTools\uFF0C\u6C38\u4E0D\u88AB\u538B\u7F29\uFF09","cfg.q_ptools_ph":"\u9017\u53F7\u5206\u9694\uFF0C\u652F\u6301 * \u901A\u914D\uFF0C\u5982 skill\u3001skill_*\uFF1B\u9ED8\u8BA4\u7559\u7A7A\uFF1D\u4E0D\u4FDD\u62A4","cfg.q_ptools_warn":"\u6CE8\u610F\uFF1Aread / bash / edit \u8FD9\u7C7B\u9AD8\u9891\u5DE5\u5177\u4E0D\u8981\u4FDD\u62A4\u2014\u2014\u5B83\u4EEC\u7684\u8F93\u51FA\u5360\u4F1A\u8BDD token \u7684\u5927\u5934\uFF0C\u4FDD\u62A4\u540E\u6C38\u4E0D\u88AB\u538B\u7F29\uFF0C\u4E0A\u4E0B\u6587\u4F1A\u8D8A\u6EDA\u8D8A\u5927","cfg.q_parse_err":"\u9AD8\u7EA7 JSON \u6682\u65F6\u65E0\u6CD5\u89E3\u6790\u2014\u2014\u5FEB\u901F\u914D\u7F6E\u63A7\u4EF6\u5DF2\u6682\u505C\uFF0C\u8BF7\u5148\u4FEE\u6B63\u4E0B\u65B9 JSON","cfg.q_pack_default_desc":"default\uFF08\u6807\u51C6\uFF09\uFF1A\u5B8C\u6574\u63D0\u793A\u8BCD\u9762\u2014\u2014\u8BE6\u7EC6\u5DE5\u5177\u63CF\u8FF0\uFF0B\u5168\u91CF\u538B\u7F29\u89C4\u5219\uFF0C\u5F15\u5BFC\u6700\u5145\u5206\u3002\u5B9E\u6D4B\uFF08qwen \u5206\u8BCD\uFF09\u6BCF\u6B21\u8BF7\u6C42\u7EA6 2,900+ tokens","cfg.q_pack_lean_desc":"lean\uFF08\u7CBE\u7B80\uFF09\uFF1A\u7701 token \u9762\u2014\u2014\u5DE5\u5177\u63CF\u8FF0\u538B\u6210\u4E00\u884C\u3001\u89C4\u5219\u7CBE\u7B80\uFF0C\u538B\u7F29\u5F15\u5BFC\u66F4\u7B80\u7EC3\u3002\u5B9E\u6D4B\uFF08qwen \u5206\u8BCD\uFF09\u6BCF\u6B21\u8BF7\u6C42\u7EA6 1,400 tokens\uFF0C\u6BD4 default \u7701\u7EA6\u4E00\u534A","cfg.q_pack_custom":"\u81EA\u5B9A\u4E49 pack\u2014\u2014\u4ECE ~/.config/billion-context/packs/\uFF08\u6216\u9879\u76EE .billion-context/packs/\uFF09\u6309\u540D\u8BFB\u53D6","cfg.q_mitm":"MITM \u89E3\u5BC6\u57DF\u540D\uFF0C\u9017\u53F7\u5206\u9694\uFF08mitm.domains\uFF09","cfg.q_more":"\u66F4\u591A\u914D\u7F6E\uFF08\u5B8C\u6574\u5B57\u6BB5\u8BF4\u660E\uFF09","cfg.q_more_url":"https://github.com/ranxianglei/billion-context/blob/master/CONFIGURATION.zh-CN.md","cfg.q_mitm_ph":"api.anthropic.com, open.bigmodel.cn","cfg.state_reached":"HTTP {status} \xB7 \u53EF\u8FBE\uFF08\u8BA4\u8BC1\u7531\u5BA2\u6237\u7AEF\u8D1F\u8D23\uFF09","cfg.saved":"\u5DF2\u4FDD\u5B58\u5230\u914D\u7F6E\u6587\u4EF6 \u2713","cfg.invalid_json":"\u4E0D\u662F\u6709\u6548\u7684 JSON\uFF0C\u672A\u4FDD\u5B58","cfg.pt_clear":"\u5173\u95ED Passthrough","cfg.resign":"\u7B7E\u540D\u4E0A\u6E38\uFF08resign\uFF09","cfg.resign_desc":"\u8BF7\u6C42\u4F53\u5E26\u7B7E\u540D\u7684\u4E0A\u6E38\uFF1A\u4EFB\u4F55\u6539\u5199\u90FD\u4F1A\u8BA9\u4E0A\u6E38\u9A8C\u7B7E\u5931\u8D25\uFF08401\uFF09\u3002\u6309\u300C\u8981\u4E48\u538B\u7F29\u3001\u8981\u4E48\u62D2\u7EDD\u300D\u539F\u5219\uFF0C\u7B7E\u540D\u8BF7\u6C42\u53EA\u6709\u4E24\u79CD\u7ED3\u5C40\u2014\u2014\u80FD\u91CD\u7B7E\u5C31\u91CD\u7B7E+\u538B\u7F29\uFF0C\u4E0D\u80FD\u91CD\u7B7E\u5C31\u672C\u5730\u62D2\u7EDD\uFF08403\uFF09\uFF0C\u6CA1\u6709\u4E0D\u7B7E\u540D\u653E\u884C\u6A21\u5F0F\u3002\u5185\u7F6E\u65B9\u6848\u65E0\u51ED\u636E\u65F6\u53EF\u7528 passthrough \u663E\u5F0F\u63A5\u53D7\u4E0D\u538B\u7F29\u76F4\u9001\uFF1B\u5176\u4ED6\u65B9\u6848\u7684\u94FE\u8DEF\u5728 bili \u8865\u4E0A\u5BF9\u5E94\u91CD\u7B7E\u5668\u4E4B\u524D\u4E0D\u53EF\u7528\uFF08\u914D\u7F6E\u65E0\u6CD5\u653E\u884C\uFF09\u3002\u6761\u76EE\u6765\u81EA\u8FD0\u884C\u4E2D\u89C2\u5BDF\u5230\u7684\u7B7E\u540D","cfg.resign_loading":"\u52A0\u8F7D\u4E2D\u2026","cfg.resign_none":"\u6CA1\u6709\u5F85\u5904\u7406\u7684\u7B7E\u540D\u62D2\u7EDD\u2014\u2014\u672A\u89C2\u5BDF\u5230\u65E0\u6CD5\u91CD\u7B7E\u7684\u7B7E\u540D\u8BF7\u6C42","cfg.resign_builtin":"\u5185\u7F6E\u65B9\u6848 {scheme}\uFF08{label}\uFF09\uFF1Adsh \u51ED\u636E\u670D\u52A1\u53EF\u89E3\u6790\u65F6 bili \u81EA\u52A8\u91CD\u7B7E\u3001\u6B63\u5E38\u538B\u7F29\uFF1B\u5426\u5219\u672C\u5730\u62D2\u7EDD","cfg.resign_row":"{origin} \xB7 \u88AB\u62D2 {count} \u6B21\uFF08\u81EA {firstSeen} \u8D77\uFF09","cfg.resign_refusing":"\u9ED8\u8BA4\u62D2\u7EDD\u4E2D","cfg.resign_passthrough":"\u5DF2\u76F4\u9001\uFF08\u4E0D\u538B\u7F29\uFF09","cfg.resign_disabled":"\u4FDD\u62A4\u5DF2\u505C\u7528\uFF08\u56DE\u9000\u65E7\u884C\u4E3A\uFF1Abody \u4F1A\u88AB\u6539\u5199\uFF0C\u4E0A\u6E38\u53EF\u80FD 401\uFF09","cfg.resign_copy_hint":"\u590D\u5236\u8BE5\u7247\u6BB5\u52A0\u5165\u914D\u7F6E\u6587\u4EF6\uFF1A\u6B64\u94FE\u8DEF\u4E0D\u538B\u7F29\u3001\u539F\u6837\u76F4\u9001\uFF08\u4EC5\u5185\u7F6E\u65B9\u6848\u6709\u6548\uFF09","cfg.resign_awaiting":"\u7B49\u5F85 bili \u5B9E\u73B0\u8BE5\u65B9\u6848\u7684\u91CD\u7B7E\u5668\uFF08\u6309\u538B\u7F29\u6216\u62D2\u7EDD\u539F\u5219\uFF0C\u914D\u7F6E\u65E0\u6CD5\u653E\u884C\uFF09","con.title":"\u5BA2\u6237\u7AEF\u63A5\u5165","con.sub":"\u628A AI \u5BA2\u6237\u7AEF\u7684\u6D41\u91CF\u6307\u5230\u672C\u4EE3\u7406","con.origin":"\u4EE3\u7406\u5730\u5740","con.method_plugin":"\u65B9\u5F0F\u4E00 \xB7 \u5B89\u88C5\u63D2\u4EF6\uFF08\u63A8\u8350 \xB7 \u539F\u751F\u6A21\u5F0F\uFF09","con.method_plugin_hint":"\u63A8\u8350\u65B9\u5F0F\u2014\u2014\u5B89\u88C5\u540E\u7167\u5E38\u8FD0\u884C agent \u5373\u53EF\uFF0C\u4F1A\u81EA\u52A8\u7ECF\u8FC7 billion-context\uFF0C\u529F\u80FD\u6700\u5B8C\u6574\u3002\u5E38\u7528\u7BA1\u7406\u547D\u4EE4\uFF1A","con.plugin_note":"\u63D2\u4EF6\u6A21\u5F0F\u76EE\u524D\u8986\u76D6\u8FD9 9 \u4E2A agent\uFF1Api \xB7 omp \xB7 claude \xB7 codex \xB7 opencode \xB7 dsh \xB7 kimi \xB7 hermes \xB7 zcode\uFF1B\u5176\u4F59\u5BA2\u6237\u7AEF\u8BF7\u7528\u65B9\u5F0F\u4E8C\u6216\u65B9\u5F0F\u4E09\u3002opencode \u5B89\u88C5\u65F6\u52A0 --with-mcp \u53EF\u540C\u65F6\u6CE8\u518C MCP \u5DE5\u5177","con.launcher_mitm":"\u5411\u8BC1\u4E66 MITM \u767D\u540D\u5355\u8FFD\u52A0\u57DF\u540D\uFF08\u5982\u81EA\u5EFA\u4E2D\u8F6C\uFF09\uFF1Abili pi --mitm-domain api.foo.com","con.note_pi":"\u62C9\u8D77 pi\uFF0C\u8D70\u4EE3\u7406 \u2014\u2014 file-free(#535)\uFF1A\u73AF\u5883\u53D8\u91CF + \u6269\u5C55 registerProvider\uFF0C\u771F\u5B9E ~/.pi \u4E0D\u52A8","con.note_codex":"\u62C9\u8D77 codex","con.note_claude":"\u62C9\u8D77 claude","con.note_omp":"pi \u540C\u6B3E\uFF0Cfile-free(#535)\uFF1A\u73AF\u5883\u53D8\u91CF + \u6269\u5C55 registerProvider\uFF0C\u771F\u5B9E ~/.omp \u4E0D\u52A8","con.note_opencode":"OpenCode\uFF081.x \u4E0E 2.x\uFF09\uFF1A\u5B8C\u6574\u6307\u5357\u89C1\u4E0B\u6587 OpenCode \u4E00\u8282","con.note_hermes":"file-free(#535)\uFF1AHTTPS_PROXY + SSL_CERT_FILE \u7EC4\u5408 CA bundle\u2014\u2014https \u8D70 CONNECT MITM\uFF0Chttp \u8D70\u7EDD\u5BF9\u5F62\u5F0F\u8F6C\u53D1\uFF1B\u771F\u5B9E ~/.hermes \u4E0D\u52A8","con.note_dsh":"deepseek-harness\uFF1A\u7ECF --patch \u6CE8\u5165\u5B8C\u6574\u539F\u751F\u63D2\u4EF6(#941)\uFF0Ccompress/decompress/acp_status \u6CE8\u518C\u4E3A\u771F\u5B9E dsh \u5DE5\u5177\uFF1B\u975E\u56DE\u73AF\u4E0A\u6E38\u8D70\u4EE3\u7406 env\uFF0C\u56DE\u73AF\u4FDD\u7559 overlay DSH_HOME \u6539\u5199\uFF1B\u5185\u7F6E deepseek \u8DEF\u7531\u8D70 DEEPSEEK_BASE_URL\uFF1Bdsh \u539F\u751F\u81EA\u52A8\u538B\u7F29\u88AB\u7981\u7528","con.note_codebuddy":"Tencent CodeBuddy Code CLI\uFF1ACODEBUDDY_BASE_URL /bili/ \u6539\u5199\uFF08OpenAI chat-completions wire\uFF09\uFF0C\u9884\u7B97\u5BF9\u9F50\u8D70 CODEBUDDY_AUTO_COMPACT_WINDOW\uFF1B\u771F\u5B9E ~/.codebuddy \u4E0D\u52A8","con.note_qoder":"qoder\uFF1A\u6A21\u578B\u7AEF\u70B9\u786C\u7F16\u7801 https\uFF08\u65E0\u6CD5 /bili/ \u6539\u5199\uFF09\u2014\u2014\u8BC1\u4E66 MITM\uFF08HTTPS_PROXY + NODE_EXTRA_CA_CERTS\uFF09\uFF0C\u9ED8\u8BA4\u6A21\u578B\u4E3B\u673A\u5DF2\u52A0\u767D\u540D\u5355(#653)","con.note_trae":"Trae CLI\uFF08\u5B57\u8282\u8DF3\u52A8\uFF0C\u95ED\u6E90 Go \u4E8C\u8FDB\u5236\uFF0C\u65E0 base-URL \u8986\u76D6\uFF09\u2014\u2014\u8BC1\u4E66 MITM\uFF0C\u6A21\u578B\u4E3B\u673A\u53D6 TRAE_CLI_API_HOST \u6216\u9ED8\u8BA4\u4F01\u4E1A\u7F51\u5173(#655)","con.note_jcode":"jcode\uFF08Rust \u7EC8\u7AEF\u7F16\u7801 agent\uFF09\u2014\u2014\u73AF\u5883\u53D8\u91CF\u5F0F\u8BC1\u4E66 MITM \u542F\u52A8\uFF1Bapi.z.ai \u9ED8\u8BA4\u52A0\u767D\uFF0C\u672C\u5730\u56DE\u73AF provider \u8D70 NO_PROXY \u76F4\u8FDE","con.note_kimi":"Kimi Code CLI\uFF08Moonshot\uFF09\uFF1A\u9664\u65E0\u6761\u4EF6\u56DE\u73AF\u7ED5\u8FC7\u5916\u5747\u9075\u5FAA\u6807\u51C6\u4EE3\u7406\u73AF\u5883\u53D8\u91CF\u2014\u2014\u975E\u56DE\u73AF https \u8BC1\u4E66 MITM\u3001http \u7EDD\u5BF9\u5F62\u5F0F\u8F6C\u53D1\uFF1B\u4E3B\u673A\u53D6 ~/.kimi-code/config.toml\uFF1B\u56DE\u73AF\u7AEF\u70B9\u7F16\u76EE\u5E76\u9644\u624B\u52A8 /bili/ \u524D\u7F00\u63D0\u793A(#757)","con.note_gemini":"Gemini CLI\uFF08Google\uFF09\uFF1AGOOGLE_GEMINI_BASE_URL /bili/ \u6539\u5199\u5230 generativelanguage.googleapis.com\uFF08Google \u539F\u751F wire\uFF09\uFF1B\u771F\u5B9E ~/.gemini \u96F6\u6539\u52A8","con.note_iflow":"iFlow CLI\uFF1AIFLOW_BASE_URL /bili/ \u6539\u5199\u5230 apis.iflow.cn/v1\uFF08OpenAI chat-completions wire\uFF09\uFF1B\u771F\u5B9E ~/.iflow \u96F6\u6539\u52A8","con.note_qwen":"Qwen Code\uFF08\u591A\u534F\u8BAE gemini-cli fork\uFF0C\u65E0 base-URL \u94A9\u5B50\uFF09\uFF1AHTTPS_PROXY + NODE_EXTRA_CA_CERTS \u8BC1\u4E66 MITM\uFF1BDashScope/Qwen \u9ED8\u8BA4\u6A21\u578B\u4E3B\u673A\u52A0\u767D\uFF0C\u81EA\u5EFA\u4E2D\u8F6C\u7528 --mitm-domain \u8FFD\u52A0","con.note_antigravity":"Antigravity CLI\uFF08agy\uFF0CGoogle\uFF0CGemini CLI \u7EE7\u4EFB\u8005\uFF09\uFF1ACLOUD_CODE_URL /bili/ \u6539\u5199\u5230 cloudcode-pa.googleapis.com\uFF08\u8BED\u8A00\u670D\u52A1\u5668\u5185\u672A\u516C\u5F00\u7684\u73AF\u5883\u53D8\u91CF\u8986\u76D6\uFF0Cv2.19.1 \u4E8C\u8FDB\u5236\u9A8C\u8BC1\uFF1Bwire \u6309\u8DEF\u5F84\u8BC6\u522B\u4E3A Google \u539F\u751F\uFF09(#2115)","con.note_mcode":"MiniMax Code CLI\uFF1A\u9664\u65E0\u6761\u4EF6\u56DE\u73AF\u7ED5\u8FC7\u5916\u9075\u5FAA\u6807\u51C6\u4EE3\u7406\u73AF\u5883\u53D8\u91CF\u2014\u2014\u975E\u56DE\u73AF https \u8BC1\u4E66 MITM\u3001http \u7EDD\u5BF9\u5F62\u5F0F\u8F6C\u53D1\uFF1B\u4E3B\u673A\u53D6 ~/.minimax*/config.yaml\uFF1B\u4F1A\u8BDD\u7ECF X-Mavis-Session-Id \u5934\u7ED1\u5B9A(#1050)","con.note_aider":"Aider\uFF08Python pair programmer\uFF09\uFF1AHTTPS_PROXY + SSL_CERT_FILE/REQUESTS_CA_BUNDLE \u8BC1\u4E66 MITM\uFF1B\u7AEF\u70B9\u53D6\u81EA\u7EE7\u627F env\u3001--openai-api-base \u6216 .aider.conf.yml\uFF1B\u56DE\u73AF\u7AEF\u70B9\u7ECF NO_PROXY \u76F4\u8FDE(#1048)","con.note_copilot":"Copilot CLI\uFF08GitHub\uFF0C\u95ED\u6E90 Go \u4E8C\u8FDB\u5236\uFF09\u2014\u2014\u8BC1\u4E66 MITM\uFF0Capi.githubcopilot.com + \u5404\u5957\u9910\u5B50\u57DF\u52A0\u767D(#1049)","con.note_amp":"Amp CLI\uFF08Sourcegraph\uFF0C\u95ED\u6E90 Go \u4E8C\u8FDB\u5236\uFF09\u2014\u2014\u8BC1\u4E66 MITM\uFF0Campcode.com \u52A0\u767D(#1049)","con.note_goose":"Goose\uFF08Block\uFF0CRust/reqwest\uFF09\uFF1Arustls \u53D1\u5E03\u6784\u5EFA\u4E0D\u4FE1\u4EFB\u4EFB\u4F55 CA \u6587\u4EF6\u2014\u2014\u5B8C\u5168\u4E0D\u7528\u4EE3\u7406\u73AF\u5883\u53D8\u91CF\uFF1B\u5185\u7F6E openai/anthropic \u817F\u7ECF OPENAI_HOST/ANTHROPIC_HOST \u91CD\u5B9A\u5411\uFF0C\u81EA\u5B9A\u4E49 provider \u7ECF\u91CD\u65B0\u751F\u6210\u7684 GOOSE_PATH_ROOT overlay \u505A base_url /bili/ \u6539\u5199\uFF1B\u56FA\u5B9A\u7B2C\u4E09\u65B9 provider \u4F1A\u8B66\u544A(#1049)","con.method_launcher":"\u65B9\u5F0F\u4E8C \xB7 bili \u542F\u52A8\u5668\uFF08\u514D\u5B89\u88C5 \u2014\u2014 \u66FF\u4EE3\u539F\u6709\u542F\u52A8\u547D\u4EE4\uFF09","con.method_launcher_hint":"\u88C5\u597D billion-context \u540E\uFF0C\u7528\u4E0B\u9762\u7684\u547D\u4EE4\u4EE3\u66FF\u539F\u6765\u7684\u542F\u52A8\u65B9\u5F0F\uFF1A\u81EA\u52A8\u6CE8\u5165 bili \u4EE3\u7406\u4E0E\u538B\u7F29\u72B6\u6001\uFF0C\u65E0\u9700\u6539\u52A8\u4EFB\u4F55\u5BA2\u6237\u7AEF\u914D\u7F6E","con.launcher_help_pre":"\u5B8C\u6574\u5217\u8868\uFF1A","con.method_a":"\u65B9\u5F0F\u4E09 \xB7 \u901A\u7528\u4EE3\u7406\uFF08URL \u524D\u7F00\u8DEF\u7531\uFF09","con.method_a_hint":"\u4EC5\u652F\u6301\u6539 baseURL \u7684\u5C11\u6570\u5BA2\u6237\u7AEF\uFF08\u5728\u539F\u5730\u5740\u524D\u52A0\u4E0B\u65B9\u524D\u7F00\u5373\u53EF\uFF09\uFF1B\u591A\u6570\u5BA2\u6237\u7AEF\u8BF7\u7528\u4E0A\u9762\u7684\u542F\u52A8\u5668","con.method_b":"\u5907\u9009\uFF1AMITM \u8BC1\u4E66\u63A5\u5165","con.method_b_hint":"\u4E0D\u652F\u6301\u6539 URL \u7684\u5BA2\u6237\u7AEF\uFF08endpoint \u786C\u7F16\u7801\uFF09\u8D70 HTTPS \u62E6\u622A\uFF0C\u9700\u5148\u4FE1\u4EFB CA \u8BC1\u4E66","card.opencode":"OpenCode","card.codex_key":"Codex","card.codex_login":"Codex\uFF08ChatGPT \u767B\u5F55\uFF09","card.claude_key":"Claude Code","card.pi":"Pi","card.other":"\u5176\u4ED6\u5BA2\u6237\u7AEF","dt.config_file":"\u914D\u7F6E\u6587\u4EF6","dt.env":"\u73AF\u5883\u53D8\u91CF","dt.example":"\u793A\u4F8B","dt.auth":"\u8BA4\u8BC1","dt.setting":"\u8BBE\u7F6E\u9879","dt.ca_cert":"CA \u8BC1\u4E66","other.rule":"\u4EFB\u610F baseURL \u524D\u52A0","zcode.title":"ZCode\uFF08\u7F16\u7A0B\u5957\u9910\uFF09","zcode.method":"MITM \u900F\u660E\u4EE3\u7406","ca.not_ready":"\uFF08\u5C1A\u672A\u751F\u6210\uFF0C\u9996\u6B21 MITM \u65F6\u81EA\u52A8\u521B\u5EFA\uFF09","copy.ca":"\u590D\u5236 CA \u8DEF\u5F84","zcode.hint_a":"CA \u8DEF\u5F84\u662F\u672C\u673A bili \u5B9E\u9645\u751F\u6210\u7684\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u70B9\u201C\u590D\u5236 CA \u8DEF\u5F84\u201D\u540E\u76F4\u63A5\u7C98\u8D34\u8FDB ZCode\u3002\u26A0\uFE0F Windows \u4E0A ZCode \u4E0D\u4F1A\u5C55\u5F00","zcode.hint_b":"\uFF0C\u8BF7\u52FF\u624B\u586B","zcode.hint_c":"\u5F62\u5F0F\u7684\u8DEF\u5F84\u3002","routing.codex_auth_note":"\uFF08OAuth token \u900F\u4F20\uFF0C\u65E0\u9700\u8BC1\u4E66\uFF09","routing.codex_note_a":"\u9ED8\u8BA4 provider \u5C31\u662F openai\uFF0C\u65E0\u9700 model_provider\uFF1B\u82E5 config.toml \u91CC\u6539\u8FC7","routing.codex_note_b":"\uFF0C\u9700\u518D\u52A0\u4E00\u884C","routing.codex_note_c":"\u3002\u8FDE\u4E0D\u4E0A\u65F6\u68C0\u67E5\u4EE3\u7406\u73AF\u5883\u53D8\u91CF\uFF1A\u8BBE\u4E86 HTTP(S)_PROXY \u9700\u52A0","routing.codex_note_d":"\uFF1Bbili \u8DD1\u5728 WSL2/Docker \u91CC\u65F6 Windows \u4FA7\u8BF7\u7528","routing.codex_note_e":"\uFF08\u81EA\u52A8\u8F6C\u53D1\uFF09\uFF0C127.0.0.1 \u4E0D\u901A\u3002","toast.connect_ok":"\u8FDE\u63A5\u6210\u529F\uFF0CHTTP {status}","toast.upstream_reachable":"\u4E0A\u6E38\u53EF\u8FBE HTTP {status} \u2014\u2014 \u7F51\u7EDC\u6B63\u5E38\uFF0C\u8BA4\u8BC1\u7531\u5BA2\u6237\u7AEF\u8D1F\u8D23","toast.passthrough_cleared":"Passthrough \u5DF2\u5173\u95ED \u2713","toast.failed":"\u64CD\u4F5C\u5931\u8D25\uFF1A{msg}"},en:{"summary.title":"Shared summary service (experimental)","summary.enabled":"Enabled","summary.add":"Add target","summary.ref":"Target (provider/model)","summary.no_recipes":"No named dial recipes in providers yet (non-URL entries with baseUrl/api) \u2014 add one in JSON first","summary.credentials":"Recipe credentials","summary.key":"API Key","summary.key_save":"Save Key","summary.key_delete":"Delete Key","summary.key_set":"Configured","summary.key_missing":"Not configured","summary.key_saved":"Key saved","summary.total":"Total deadline (ms)","summary.timeout":"Per-target timeout (ms)","summary.bytes":"Summary limit (bytes)","summary.up":"Move up","summary.down":"Move down","summary.remove":"Remove target","summary.invalid":"Invalid summary configuration; correct it in JSON","nav.overview":"Overview","nav.sessions":"Sessions","nav.config":"Configuration","nav.connect":"Connect","nav.logs":"Logs","logs.title":"Run log","logs.sub":"live tail of bili.log \xB7 filter by session id or keyword, with context / time-window expansion","logs.filter_ph":"filter (session id or keyword)","logs.count":"showing latest {n} of {total} matching lines","logs.omitted":" \xB7 {o} older lines truncated (raise the line cap)","logs.ctx":"context \xB13 lines","logs.win":"time window \xB12 min","logs.empty":"no matching lines (the log file may not exist yet)","logs.path":"log file","logs.dl":"download current view (.txt)","logs.dl_all":"download full log (.txt)","det.log":"Log","det.log_view":"view this session's log \u25B8","fork.label":"\u2605 Fork me on GitHub","common.loading":"Loading\u2026","common.empty":"No data yet","common.copy":"Copy","common.back":"\u2190 Back to session list","common.live":"live","common.sessions":"sessions","common.copied_hint":"Copied \u2713","ses.badge_live_tip":"Session being processed by the current daemon (live data)","common.requests":"requests","common.saved":"saved","common.context":"context","common.ctx_est":"estimated","common.ctx_meas":"measured","common.ctx_est_calib":"est.\xB7calibrated","common.ctx_est_raw":"est.\xB7uncalibrated","common.ctx_upper":"est.\xB7upper bound","common.window":"window","common.title":"title","common.protocol":"protocol","common.upstream":"upstream","common.label":"label","common.none":"\u2014","protocol.unmarked":"unmarked (legacy sessions)","ses.no_title":"untitled","ov.title":"Overview","ov.sub":"Global stats across all live and disk-persisted sessions","ov.total_sessions":"Total sessions","ov.live_now":"currently live","ov.hist":"historical","ov.saved_from_legacy":"{n} of it estimated locally by pre-tagging sessions","ov.total_requests":"Total requests","ov.tokens_saved":"Saved by compression","ov.gross_saved":"Compressed savings (cumulative)","ov.net_saved":"Net savings","ov.sub_repay":"after subtracting re-pay {r} and summary cost {s}","ov.covlost_note":"{n} fold(s) coverage-lost, {x} frozen","det.covlost_sub":"{n} fold(s) coverage-lost ({x} frozen): their covered messages left the resent history \u2014 accrual stopped","ses.covlost_tip":"{n} fold(s) coverage-lost ({x} frozen): the host removed the compressed originals outside bili's knowledge (e.g. dsh native compaction) \u2014 their savings no longer accrue","ov.miss_split":"missed tokens (ledgered sessions): new content {n} \xB7 compression re-read {c} \xB7 TTL expiry / other prefix invalidation {x}","det.hit_pct":"cache hit rate","ses.drop_ph":"hit-rate cost as a share of total input, order: new / comp / TTL expiry","ses.empty_hidden":"{n} empty session(s) hidden (no requests, no context, no ledger; still reachable by direct link)","det.miss_split_line":"missed-token split of the hit rate: new content {n} (\u2212{pn}%) \xB7 compression re-read {c} (\u2212{pc}%) \xB7 TTL expiry / other prefix invalidation {x} (\u2212{px}%)","det.miss_sub":"TTL expiry \u2212{x}% \xB7 comp \u2212{c}% \xB7 new \u2212{n}%","det.fold_time":"when","ov.global_hitpct":"Global cache hit rate","ov.input_tokens":"Input tokens","ov.cached_tokens":"Cached tokens","ov.output_tokens":"Output tokens","ov.by_protocol":"By wire protocol","ov.recent":"Recently active sessions","ov.view_all":"View all \u2192","sys.title":"System status","sys.version":"Version","sys.disk_version":"On-disk version","sys.inflight":"In-flight requests","sys.blind_tunnels":"MITM blind tunnels (CONNECT without TLS)","sys.stale":"Newer version v{disk} on disk \u2014 restart bili to apply (running v{running})","sys.stale_auto":"Auto-restart enabled \u2014 switches automatically when idle","sys.stale_manual":"Auto-restart not enabled (needs --auto-restart-on-update)","sys.pt_on":"Passthrough ON: all requests forwarded as-is, compression disabled. Source:","sys.pt_env":"ACP_PASSTHROUGH env var (or --passthrough flag)","sys.pt_file":"config file passthrough: true","conflict.on":"Compression conflict detected","conflict.found":": traces of ","conflict.what_plugin":"a third-party compression plugin co-resident with bili","conflict.what_native":"client-native auto-compaction rewriting conversation history","conflict.what_join":" and ","conflict.risk_active":" were found. Two compressors on one conversation double-compress and corrupt message refs, which can scramble context \u2014 keep exactly one compressor.","conflict.risk_sibling":" were found. These are bili's OWN sibling extensions, not third-party compressors: while bili drives the session they stand down automatically (BILLION_CONTEXT_NATIVE marker in native mode, /bili/ baseUrl self-check otherwise), so no second compressor is active \u2014 verify your versions are recent and clear this record; nothing needs removing.","conflict.risk_historical":" were found (no events in the last 7 days \u2014 stock records only) \u2014 once you've confirmed the other compressor is removed or blocked by bili, clear them with the button.","conflict.on_suspected":"Possible compression plugin detected","conflict.what_suspected":"a plugin whose name matches compression keywords (not yet verified to actually compress context)","conflict.risk_suspected":" \u2014 a name-only [suspected] signal, not observed evidence of double-compression. Confirm it actually rewrites the model context before acting; a display / tool-output-folding plugin (e.g. pi-compact-transcript) does not double-compress and needs no removal.","conflict.on_unconfirmed":"Unconfirmed compression-related signals detected","conflict.what_signal":"conversation history being rewritten (a change was observed, cause not yet identified)","conflict.risk_unconfirmed":" \u2014 all of the above are UNCONFIRMED signals: they do not prove a second compressor exists (possible causes: client-side edits, an unrecognized compaction shape, or another plugin). Verify before acting; a read-only context viewer or a display / tool-output-folding plugin is not a compressor and needs no removal.","conflict.age_active":"{n} in last 7 days","conflict.age_historical":"{n} older","conflict.where":"Details: Sessions page below or GET /__bili/stats \u2192 conflicts.","conflict.clear_btn":"Clear records","conflict.cleared":"Conflict records cleared","conflict.hint_label":"What to do (per client):","conflict.hint.opencode":'opencode: set "compaction": { "auto": false } in your opencode config (or use bili opencode / bili plugin install opencode, which set it for you)',"conflict.hint.claude":"claude: launch through bili claude (it aligns CLAUDE_CODE_AUTO_COMPACT_WINDOW automatically), or set CLAUDE_CODE_AUTO_COMPACT_WINDOW to bili's effective window yourself","conflict.hint.codex":"codex: bili intercepts native compaction by default (BILI_CODEX_COMPACT=intercept) \u2014 if you set pass, remove the override to stop; otherwise report your bili version","conflict.hint.pi":"pi: the bili extension cancels the client's native auto-compaction while it carries the conversation \u2014 seeing this suggests missing carriage evidence or an old version; report client + bili version","conflict.hint.omp":"omp: the bili extension cancels the client's native auto-compaction while it carries the conversation \u2014 seeing this suggests missing carriage evidence or an old version; report client + bili version","conflict.hint.generic":"disable the client's own auto-compaction (or route this session around bili), then start a fresh session \u2014 the ledger is per-session, so old entries clear with the old session","conflict.hint_more":"{n} more client(s) \u2014 see the Sessions page below","conflict.docs":'full matrix: CONFIGURATION.md \u2192 "Detecting other compression plugins (#1206)"',"advisory.on":"Critical defect advisory","advisory.desc":": the current version has a major defect; bili is upgrading it automatically to a safe version. Reason:","advisory.hint":". If it did not complete automatically, run manually:","alert.title":"Upstream connection problems","alert.item":"Cannot reach {host} ({kind} \xD7{count}, since {first}) \u2014 {hint}","alert.dismiss":"Got it","alert.hint.connect_timeout":"TCP handshake never completed \u2014 upstream/proxy unreachable or blackholed; a bounded transparent replay may be attempted (BILI_REPLAY_RETRY_MAX)","alert.hint.connect_refused":"TCP refused (proxy when configured, else upstream) \u2014 endpoint down or wrong port","alert.hint.proxy_reset":"proxy dropped the connection before the response \u2014 check proxy idle-recycle/payload limits (BILI_PROXY_KEEPALIVE_MAX_MS can shorten our reuse window); a bounded transparent replay may be attempted (BILI_REPLAY_RETRY_MAX)","alert.hint.upstream_reset":"upstream/network reset before the response \u2014 check upstream and local network; a bounded transparent replay may be attempted (BILI_REPLAY_RETRY_MAX)","alert.hint.dns":"name resolution failed \u2014 DNS server or hostname typo; a bounded transparent replay may be attempted (BILI_REPLAY_RETRY_MAX)","alert.hint.tls":"TLS/certificate failure at CONNECT or upstream handshake \u2014 CA/proxy MITM config","alert.hint.unknown":"unclassified transport failure \u2014 report with full error chain","advisory.restartDesc":": the safe version is installed on disk, but this process is still running the affected version. Reason:","advisory.restartHint":". Restart bili to activate it.","pluginadv.on":"High-cost plugin detected","pluginadv.desc":"This plugin re-sends the entire conversation to the model before every tool call for review, so the upstream prefix cache almost never applies (hit rate usually single-digit %) and token cost grows sharply. This is unrelated to bili's compression: bili isolates such requests into a separate sub-session, leaving the main session's prefix cache intact.","pluginadv.hint":"Consider disabling the plugin or asking its maintainers to optimize it; details in the link above (this issue).","ses.title":"Sessions","ses.sub":"Every session across memory and disk \u2014 click a row for details, trajectory & handoff document","ses.search_ph":"Search title, label or id\u2026","ses.th_title":"Session","ses.th_proto":"Protocol","ses.th_upstream":"Upstream","ses.th_reqs":"Reqs","ses.th_ctx":"Context now","ses.th_saved":"Saved","ses.th_hit":"Hit %","ses.th_switches":"Switches","ses.th_switches_tip":"Mid-session model switches \xB7 tokens re-billed because the new model starts from a cold prefix cache (#1535) \xB7 \u{1F511} = relay key/account rotations (credential fingerprint change, #2131) \xB7 \u270D\uFE0F = host system-prompt rewrites (prompt fingerprint change, #2350)","ses.th_keyswitches_tip":"Relay key/account rotation (credential fingerprint changed behind the same URL) \xB7 tokens re-billed because the rotated account starts from a cold cache (#2131)","ses.th_promptswitches_tip":"The host rewrote its system prompt (fingerprint changed between requests, e.g. a periodic dynamic section) \xB7 each rewrite invalidates every downstream prefix-cache entry \u2014 tokens re-billed for the stable prefix (#2350)","det.key_events":"Key switches ({n})","det.key_events_tip":"Credential fingerprint change = the relay rotated to a different account; fingerprints are 12-hex sha256 prefixes, never raw keys","det.key_fp":"key fingerprint","det.prompt_events":"System-prompt rewrites ({n})","det.prompt_events_tip":"System-prompt fingerprint change = the host rewrote its system prompt between requests; fingerprints are 16-hex sha256 prefixes, never raw text","det.prompt_fp":"prompt fingerprint","ses.th_blocks":"Blocks","ses.th_seen":"Last seen","ses.th_client":"Client","ses.th_input":"Cum. input","ses.th_folds":"Compressions","ses.empty":"No sessions yet","ses.empty_hint":"The first request through the proxy creates one automatically","ses.count":"{count} sessions","ses.refresh":"Refresh","ses.load_more":"Load more","data.error":"Failed to load data: {msg} \xB7 auto-retrying with backoff","data.generic":"network error or request timed out","data.timeout":"request timed out (20s)","det.identity":"Identity","det.version":"Proxy version","det.active_pack":"Prompt pack","det.conflicts_title":"Compression conflicts","det.conflicts_hint":"Evidence another compressor touched this session (diagnostic, not history)","det.conflicts_more":"{n} earlier event(s)\u2026","det.conflicts_clear":"Clear this session's records","det.conflicts_cleared":"Cleared","det.usage":"Usage","det.last_input":"Last single-turn input","det.upper_bound":"bound {v} (char-count upper bound \u2014 safety protection only, not actual usage)","det.calib_chip":"k\u0302={k} \xB7 {n} samples \xB7 spread {spread}\xD7 \xB7 {origin}","det.calib_tip":"Calibration factor k\u0302: mean of the last {n} consistent samples (spread {spread}\xD7) on this route+model; deflates estimates only; relearned after a route or model change. Source {origin}{model}.","det.ccr":"CCR content retrieval","det.ccr_detail":"{calls} calls \xB7 {hits} hits \xB7 {misses} misses","det.store":"Content store","det.trajectory":"Context trajectory","det.trajectory_sub":"Per-request input tokens and cache hits; red marks are compression folds","det.trajectory_empty":"No usage samples for this session yet","det.legend_input":"input","det.legend_cached":"of which cached","det.legend_fold":"compression fold","det.legend_window":"context window limit","det.cause_cold":"cold start (no prior cache)","det.cause_comp":"re-caching after compaction","det.cause_ttl":"long gap - upstream TTL expired, re-read","det.fold_short":"fold","ov.gross_note":"sums each fold's savings across every later request (theoretical upper bound)","ov.net_excl":"pre-tagging sessions without samples not included","det.omitted":"earliest {n} samples were trimmed at write time: each session keeps only its most recent 4096 cache samples (unrecoverable), so the curve starts at the oldest retained sample","ov.saved_neg_tip":"Negative net savings: compression re-pay (summary re-read cost) exceeded the theoretical gain; typical of short sessions that ended right after folding","det.cache_econ":"Cache economics","det.ce_new":"New content","det.ce_comp":"Compaction repay","det.ce_ttl":"TTL repay","det.ce_residual":"Residual","det.ce_balanced":"Ledger balanced \u2713","det.ce_unbalanced":"Ledger unbalanced \u2717","det.attr_title":"Attribution \xB7 unexplained residual","det.attr_seam":"\u26A0 Cache seam","det.attr_provider":"\u25B2 Provider-side miss","det.attr_rewind":"\u21A9 History rewound","det.attr_abort":"\u23FB Abort-correlated","det.attr_seam_tip":"Outbound bodies diverged mid-history with no fold/model-switch/restart attribution \u2014 suspected rebuild seam. Value = tokens re-billed on suspect samples","det.attr_provider_tip":"The previous request's entire message list came back byte-identical (whole body, or its prefix with only tail messages appended; above the 512 KiB forensics cap, proven by the stable recorded head plus exact message-count growth) yet the upstream did not serve its cache \u2014 TTL expiry / eviction / relay node rotation. Not a bili rebuild seam","det.attr_rewind_tip":"Client revert/trim shrank the message count \u2014 sanctioned one-time re-bill of the retained prefix, not a defect","det.attr_abort_tip":"Missed samples settled within 30s of a client mid-stream abort \u2014 retry churn rewrites the resent tail; correlation, not causation (overlay marker, not a bucket)","det.attr_prompt":"\u270D\uFE0F Host prompt rewrite","det.attr_prompt_tip":"The system-prompt fingerprint differs between consecutive requests = the host rewrote its system prompt (e.g. a periodic dynamic section) \u2014 every downstream prefix-cache entry is invalidated; the stable-prefix re-bill is charged here (attribution priority restart > model > key > prompt > wire > upstream, #2350)","det.attr_note":"seam / provider-side / rewound / host-rewrite exclusively partition part of the unexplained residual; abort-correlated is an overlay \u2014 none of it is counted in TOTAL above","det.seam_events":"\u26A0 Cache-seam events \xB7 {n}","det.seam_events_tip":"First divergence between consecutive outbound bodies; if reproducible attach bili.log around this time (#1548-family)","det.stab_title":"Body Stability (per-call byte proof)","det.stab_pairs":"{n} adjacent pairs","det.stab_tip":"SHA-256 byte comparison of each outbound body against the previous settled request: identical = byte-exact (e.g. transport retry); diverged pairs classified by first divergence \u2014 head <1KiB = host-side parameter change (model/tools/sampling), tail-append = pure tail growth, mid-history = a real prefix rewrite, offset-unknown = bodies above the retention cap (inequality still proven by digest)","det.stab_identical":"byte-identical","det.stab_head":"head <1KiB (param change)","det.stab_append":"tail-append","det.stab_mid":"mid-history rewrite","det.stab_unknown":"offset unknown (capped)","det.stab_size":"hit% by input size (median)","det.stab_gap":"inter-request gap median: low-hit(<80%) {a}s vs high-hit {b}s","det.seam_col_hit":"hit %","det.seam_col_input":"input","det.seam_col_div":"first divergence","det.seam_msg":"message[{i}] ({prev}\u2192{cur} msgs)","det.seam_mark_tip":"\u26A0 CACHE SEAM #{seq} \xB7 {at} \xB7 hit {hit}% \xB7 first divergence \u2265{lcp} bytes @ message[{msg}] ({prev}\u2192{cur} msgs)","det.legend_seam":"cache seam","det.folds":"Fold breakdown","det.folds_empty":"No fold events yet","det.fold_s":"compressed S","det.fold_sigma":"summary \u03C3","det.fold_h":"post-fold hit %","det.fold_t":"cumulative repay T","det.client_hint":"client","det.self_heal":"Self-heal","det.self_heal_tip":"Stuck-session self-heal has taken over \u2014 see session detail (#2155)","det.self_heal_short":"heal","det.self_heal_degrade_to_proxy":"plugin lane gone \u2192 degraded to proxy mode (tools re-injected)","det.self_heal_suppress_nudge":"nudge idle loop \u2192 suppressed (lifts when compression resumes)","det.legend_base":"system prompt baseline (measured, not compressible)","det.legend_base_est":"baseline est. (system prompt & tools, not compressible)","det.blocks_title":"Compression blocks","det.blocks_count":"{total} \xB7 {active} active","det.blocks_empty":"No compression blocks yet","det.block_active":"active","det.block_external":"external","det.block_inactive":"inactive","det.blocks_download":"download blocks (.md)","det.report_dl":"download cache report (.md)","det.blocks_copy_md":"copy Markdown","det.handoff":"Handoff document","det.handoff_hint":"Same content as bili export \u2014 paste into a new session to continue","det.thinking":"thinking","det.handoff_truncated":"\u26A0\uFE0F Content truncated for display","det.handoff_copy_md":"Copy as Markdown","det.handoff_download":"Download .md","det.not_found":"Session not found","det.not_found_hint":"It may have been deleted or lives outside this data dir","cfg.title":"Configuration","cfg.sub":"Edits write straight to the config file and hot-apply \xB7 check JSON syntax before saving","cfg.file":"Config file","cfg.parse_error":"Config file is not valid JSON \u2014 showing an empty view","cfg.upstream_net":"Upstream network","cfg.up_auto":"auto (follow system proxy)","cfg.up_manual":"manual (explicit proxy)","cfg.up_direct":"direct (force direct)","cfg.passthrough":"Passthrough","cfg.passthrough_desc":"Decides whether traffic matching no route passes through to the target service untouched (no interception, no rewriting). State lives in the config file; when forced by the ACP_PASSTHROUGH env var the UI marks the source and you must unset the variable and restart before changing it here","cfg.pt_off":"Off","cfg.pt_on":"On","cfg.test_hint":"Sends one minimal request to verify reachability; changes nothing","cfg.test_btn":"Test connection","cfg.state":"Connection state","cfg.untested":"Not probed yet","cfg.save":"Save","cfg.unsaved":"\u26A0 Unsaved changes \u2014 nothing is written until you click Save","cfg.file_desc":"This card edits the config file directly \u2014 every top-level field in this JSON takes effect (routes, compression, network, passthrough, promptPack, ccr, \u2026). Saving applies immediately","cfg.quick":"Quick settings","cfg.quick_desc":"Toggle common options without touching JSON \u2014 every change syncs live into the raw editor below (same file, no new config fields); advanced structures like the providers table stay in the JSON","cfg.q_debug":"Debug logging (debug)","cfg.q_passthrough":"Passthrough mode (passthrough) \u2014 pure proxying, no injection, no compression","cfg.q_dsh_compact":"dsh built-in compaction (allowDshCompaction) \u2014 currently DISABLED: bili refuses dsh's native compaction calls; check this only if you actually use dsh's /compact flow","cfg.q_dsh_compact_warn":"If you enable it: once a dsh compaction lands, it permanently replaces the full raw history with a summary (irreversible) and kills bili's compression for that session. On non-web profiles the shipped patch's auto:false still suppresses auto-triggering \u2014 enabling only affects manual /compact.","cfg.q_dsh_compact_env":"Currently forced by the BILI_ALLOW_DSH_COMPACTION environment variable \u2014 changes here won't apply until it is unset and the proxy restarts","cfg.q_pack":"Compression prompt pack (compress.promptPack)","cfg.q_nudge":"Compress growth threshold tokens (compress.nudgeGrowthTokens)","cfg.q_nudge_step":"step of 5000","cfg.q_nudge_low":"below 20000: folding this often degrades summary quality (kernel default 50000)","cfg.q_nudge_high":"above 100000: a very long context between folds may weaken model attention","cfg.q_tiers":"Per-tier compress trigger thresholds tokens (compress.tierNudgeTokens; prefilled with derived defaults, only changed values saved)","cfg.q_tiers_auto":"auto","cfg.q_tiers_step":"step of 5000","cfg.q_tiers_tip_t1":"T1 raw-message fold trigger (measured in raw tokens) \u2014 default = the compress growth threshold above","cfg.q_tiers_tip_t2":"T2 re-distill trigger (measured in T1-summary tokens) \u2014 default = growth threshold \xD7 1.5; raise it so each T2 block carries more project history","cfg.q_tiers_tip_t3":"T3 condense trigger (measured in T2-summary tokens) \u2014 default = growth threshold \xD7 1.5","cfg.q_tiers_desc":"Prefilled with the current derived defaults (T1 = growth step, T2/T3 = \xD71.5); unchanged values are not saved. Note: T2/T3 count lower-tier SUMMARY tokens, not raw \u2014 at the default 75K and a ~10:1 summarization ratio one T2 block carries ~750K raw context; raise T2 for longer projects.","cfg.q_prm":"Preserve recent messages (compress.preserveRecentMessages)","cfg.q_prm_ph":"empty = kernel default","cfg.q_never":"Exclude tools from recent-message preservation (compress.neverPreserveRecentTools)","cfg.q_never_ph":"comma-separated, * globs ok; empty = kernel built-in list (incl. read, bash)","cfg.q_never_note":"Default excludes decompress, search_context, read, bash \u2014 during bulk reads drop read from the list so freshly-read files are not folded immediately","cfg.q_ptools":"Protected tool names (protectedTools, never compressed)","cfg.q_ptools_ph":"comma-separated, * globs ok, e.g. skill, skill_*; empty by default","cfg.q_ptools_warn":"Do not protect chatty tools like read / bash / edit \u2014 their output dominates most sessions' tokens; protecting them means it is never compressed and context keeps growing","cfg.q_parse_err":"The advanced JSON cannot be parsed right now \u2014 quick controls are paused until it is valid again","cfg.q_pack_default_desc":"default (full surface): detailed tool descriptions plus complete compression rules \u2014 richest guidance. Measured \u22482,900+ tokens per request (qwen tokenizer)","cfg.q_pack_lean_desc":"lean: one-line tool descriptions, condensed rules \u2014 terser guidance. Measured \u22481,400 tokens per request (qwen tokenizer), roughly half of default","cfg.q_pack_custom":"custom pack \u2014 loaded by name from ~/.config/billion-context/packs/ (or project .billion-context/packs/)","cfg.q_mitm":"MITM decrypt domains, comma-separated (mitm.domains)","cfg.q_more":"More configuration (full field reference)","cfg.q_more_url":"https://github.com/ranxianglei/billion-context/blob/master/CONFIGURATION.md","cfg.q_mitm_ph":"api.anthropic.com, open.bigmodel.cn","cfg.state_reached":"HTTP {status} \xB7 reachable (auth handled by the client)","cfg.saved":"Saved to config file \u2713","cfg.invalid_json":"Not valid JSON \u2014 not saved","cfg.pt_clear":"Disable passthrough","cfg.resign":"Signed upstreams (resign)","cfg.resign_desc":"Upstreams that sign the request body: any rewrite makes their signature check fail (401). Per the compress-or-refuse contract a signed request has exactly two outcomes \u2014 re-signed+compressed, or refused locally (403); there is no unsigned pass-through mode. The built-in scheme may opt into passthrough (explicitly accepting uncompressed forwarding) when no credential resolves; every other scheme stays unavailable until bili ships its re-signer (no config can pass it through). Entries come from signatures observed at runtime","cfg.resign_loading":"Loading\u2026","cfg.resign_none":"No pending signature refusals \u2014 no un-re-signable signed requests observed","cfg.resign_builtin":"Built-in scheme {scheme} ({label}): bili re-signs automatically (normal compression) when the dsh credential service resolves; otherwise local refusal","cfg.resign_row":"{origin} \xB7 refused {count}\xD7 (since {firstSeen})","cfg.resign_refusing":"refusing by default","cfg.resign_passthrough":"direct (uncompressed)","cfg.resign_disabled":"protection disabled (pre-resign behavior: body is rewritten, upstream may 401)","cfg.resign_copy_hint":"Copy this snippet into the config file: this link forwards byte-untouched WITHOUT compression (built-in scheme only)","cfg.resign_awaiting":"awaiting re-signer support in bili (per the compress-or-refuse contract, no config can pass this through)","con.title":"Connect clients","con.sub":"Point your AI clients at this proxy","con.origin":"Proxy origin","con.method_plugin":"Method 1 \xB7 Install the plugin (recommended \xB7 native mode)","con.method_plugin_hint":"Recommended \u2014 after installing, just run your agent as usual; it goes through billion-context automatically and offers the most complete features. Common management commands:","con.plugin_note":"Plugin mode currently covers these 9 agents: pi \xB7 omp \xB7 claude \xB7 codex \xB7 opencode \xB7 dsh \xB7 kimi \xB7 hermes \xB7 zcode \u2014 other clients use Method 2 or Method 3. For opencode, add --with-mcp at install time to also register its MCP tools","con.launcher_mitm":"Append domains to the certificate-MITM allow-list (e.g. a self-hosted relay): bili pi --mitm-domain api.foo.com","con.note_pi":"Start pi through the proxy \u2014 file-free (#535): env vars + extension registerProvider; real ~/.pi untouched","con.note_codex":"Start codex","con.note_claude":"Start claude","con.note_omp":"Same approach as pi, file-free (#535): env vars + extension registerProvider; real ~/.omp untouched","con.note_opencode":"OpenCode (1.x and 2.x): full guide in the OpenCode section below","con.note_hermes":"file-free (#535): HTTPS_PROXY + SSL_CERT_FILE combined CA bundle \u2014 https via CONNECT MITM, http absolute-form forwarding; real ~/.hermes untouched","con.note_dsh":"deepseek-harness: full native plugin injected via --patch (#941) \u2014 compress/decompress/acp_status registered as real dsh tools; non-loopback upstream via proxy env, loopback keeps overlay DSH_HOME rewrites; built-in deepseek route via DEEPSEEK_BASE_URL; native auto-compaction disabled","con.note_codebuddy":"Tencent CodeBuddy Code CLI: CODEBUDDY_BASE_URL /bili/ rewrite (OpenAI chat-completions wire); budget aligned via CODEBUDDY_AUTO_COMPACT_WINDOW; real ~/.codebuddy untouched","con.note_qoder":"model endpoint hardcoded https (no /bili/ rewrite possible) \u2014 certificate MITM (HTTPS_PROXY + NODE_EXTRA_CA_CERTS); default model host pre-whitelisted (#653)","con.note_trae":"Trae CLI (ByteDance, closed-source Go binary, no base-URL override) \u2014 certificate MITM; model host from TRAE_CLI_API_HOST or default enterprise gateway (#655)","con.note_jcode":"Rust terminal coding agent \u2014 env-style certificate MITM startup; api.z.ai whitelisted by default; local loopback provider direct via NO_PROXY","con.note_kimi":"Kimi Code CLI (Moonshot): aside from the unconditional loopback bypass all traffic follows standard proxy env \u2014 non-loopback https certificate MITM, http absolute-form forwarding; hosts from ~/.kimi-code/config.toml; loopback endpoints cataloged with manual /bili/ prefix hints (#757)","con.note_gemini":"Gemini CLI (Google): GOOGLE_GEMINI_BASE_URL /bili/ rewritten to generativelanguage.googleapis.com (Google native wire); real ~/.gemini zero-touch","con.note_iflow":"iFlow CLI: IFLOW_BASE_URL /bili/ rewritten to apis.iflow.cn/v1 (OpenAI chat-completions wire); real ~/.iflow zero-touch","con.note_qwen":"Qwen Code (multi-protocol gemini-cli fork, no base-URL hook): certificate MITM via HTTPS_PROXY + NODE_EXTRA_CA_CERTS; DashScope/Qwen default model hosts whitelisted; self-hosted relays appended via --mitm-domain","con.note_antigravity":"Antigravity CLI (agy, Google, Gemini CLI successor): CLOUD_CODE_URL /bili/ rewritten to cloudcode-pa.googleapis.com (undocumented language-server env override, verified in the v2.19.1 binary; wire recognized as Google native by path) (#2115)","con.note_mcode":"MiniMax Code CLI: aside from the unconditional loopback bypass, standard proxy env \u2014 non-loopback https certificate MITM, http absolute-form forwarding; hosts from ~/.minimax*/config.yaml; sessions bound via X-Mavis-Session-Id header (#1050)","con.note_aider":"Aider (Python pair programmer): certificate MITM via HTTPS_PROXY + SSL_CERT_FILE/REQUESTS_CA_BUNDLE; endpoint from inherited env, --openai-api-base or .aider.conf.yml; loopback endpoints direct via NO_PROXY (#1048)","con.note_copilot":"Copilot CLI (GitHub, closed-source Go binary) \u2014 certificate MITM; api.githubcopilot.com plus tier subdomains whitelisted (#1049)","con.note_amp":"Amp CLI (Sourcegraph, closed-source Go binary) \u2014 certificate MITM; ampcode.com whitelisted (#1049)","con.note_goose":"Goose (Block, Rust/reqwest): rustls builds trust no CA files \u2014 no proxy env vars at all; built-in openai/anthropic legs redirected via OPENAI_HOST/ANTHROPIC_HOST; custom declarative providers get a regenerated GOOSE_PATH_ROOT overlay rewriting base_url to /bili/; fixed third-party providers warn (#1049)","con.method_launcher":"Method 2 \xB7 Bili launcher (no install \u2014 replaces your usual start command)","con.method_launcher_hint":"With billion-context installed, start your client with one of the commands below instead of its usual way: bili proxy + compression state injected automatically, no client config edits needed","con.launcher_help_pre":"Full list:","con.method_a":"Method 3 \xB7 Generic proxy (URL-prefix routing)","con.method_a_hint":"Only clients that allow changing baseURL (prepend the origin below to their base URL); prefer the launcher above for most clients","con.method_b":"Alternative: MITM certificate routing","con.method_b_hint":"Clients with hardcoded endpoints use HTTPS interception; trust the CA first","card.opencode":"OpenCode","card.codex_key":"Codex","card.codex_login":"Codex (ChatGPT login)","card.claude_key":"Claude Code","card.pi":"Pi","card.other":"Other clients","dt.config_file":"Config file","dt.env":"Environment","dt.example":"Example","dt.auth":"Auth","dt.setting":"Setting","dt.ca_cert":"CA certificate","other.rule":"Prepend to any baseURL:","zcode.title":"ZCode (coding plan)","zcode.method":"MITM transparent proxy","ca.not_ready":"(not yet generated; created on first MITM)","copy.ca":"Copy CA path","zcode.hint_a":'The CA path is the absolute path bili actually generated on this machine \u2014 click "Copy CA path" and paste it straight into ZCode. \u26A0\uFE0F On Windows ZCode does not expand',"zcode.hint_b":", never hand-type","zcode.hint_c":"-style paths.","routing.codex_auth_note":"(OAuth token passthrough, no cert needed)","routing.codex_note_a":"The default provider is openai \u2014 no model_provider needed; if you changed","routing.codex_note_b":"in config.toml, also add","routing.codex_note_c":". If it can't connect and HTTP(S)_PROXY is set, also add","routing.codex_note_d":"; when bili runs in WSL2/Docker use","routing.codex_note_e":"from Windows (auto-forwarded); 127.0.0.1 will not work.","toast.connect_ok":"Connection successful, HTTP {status}","toast.upstream_reachable":"Reachable (HTTP {status}) \u2014 network OK; auth handled by the client","toast.passthrough_cleared":"Passthrough disabled \u2713","toast.failed":"Operation failed: {msg}"}};function translate(locale,key2,vars){let text2=MESSAGES[locale][key2]??MESSAGES["zh-CN"][key2]??key2;if(vars){for(const[name,value]of Object.entries(vars)){text2=text2.split(`{${name}}`).join(String(value))}}return text2}var WEB_CLIENT=`(function () {
|
|
627
627
|
"use strict";
|
|
628
628
|
const MESSAGES=${JSON.stringify(MESSAGES)};
|
|
629
629
|
let locale = "zh-CN";
|