billion-context 0.1.217 → 0.1.218
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/agent/dsh-native.js +33 -30
- package/dist/agent/omp-native.js +34 -31
- package/dist/agent/omp.js +1 -1
- package/dist/agent/opencode-native.js +34 -31
- package/dist/agent/opencode.js +34 -31
- package/dist/agent/pi-native.js +34 -31
- package/dist/agent/pi.js +1 -1
- package/dist/build-info.json +1 -1
- package/dist/index.js +46 -43
- package/docs/configuration.md +2 -2
- package/docs/configuration.zh-CN.md +2 -2
- package/package.json +1 -1
package/docs/configuration.md
CHANGED
|
@@ -110,7 +110,7 @@ This index is generated from `website/config-reference/*.yaml` — edit the seed
|
|
|
110
110
|
| `rollout.features.pluginMsgIdIncremental` | boolean \| number | 100 (on, GA) | BILI_ROLLOUT_PLUGIN_MSG_ID_INCREMENTAL | Incremental msgid pin channel (#7064 §8, owner rulings 2026-11-18/19): steady plugin-lane turns declare their message ids in TAIL FORM — the bounded `x-bili-pf-tail-ids` header (anchor + new ids, ≤ 2048 ids, `?` placeholder slots) or a short body id array — instead of the FULL list; the server re-stamps the prefix ids from its own ledger live rows (ingest is INSERT OR IGNORE on (session_id,seq) — a position's msg_id is written once, never overwritten). Acceptance (2026-11-19 form): the declared tail [T-L, T-1] must match the ledger overlap segment row-by-row (any drift degrades to `full`, never 400); ultra-long sessions (> 2048 ids) pin a truncated tail the same way — the longer overlap proves MORE. Only snapshot rounds (empty ledger / post-fold re-anchor) send the full form; full form always wins when both arrive. The response carries `x-bili-msgid-mode: incremental\|full` (cleared on any 4xx; one learning point next to x-bili-pf-seq). Any mismatch self-heals within one round. Default 100%; set 0 to roll back to full-list pinning (byte-identical to pre-feature). Requires pluginLaneServerHistory. See docs/session-identity-resolution.md. |
|
|
111
111
|
| `rollout.features.egressPlane` | boolean \| number | 0 (off) | BILI_ROLLOUT_EGRESS_PLANE | The egress plane — ONE switch for the whole new path (#7398/#7439; replaces the retired egressOpLog/egressServeLog pair). ON: every wire lane (OpenAI/Anthropic/Responses/Google) records its outbound conversation view as sparse ops (I/D/U) into the egress_state/egress_flow dual tables — rows are SELF-CONTAINED (message bytes ride the row; no content CAS, ruling 7439-1) — and serves the outbound core-message portion back from the op log, byte-identical by construction (the row bytes are the pipeline's own final core JSON); pinned plugin lanes additionally take server authority — the kernel input is replayed from the flow (rulings 7439-3/5). A bounded backward ladder recovers to the newest healthy log point; ANY unrebuildable row (missing/empty bytes, unknown role), corrupt log, or probe failure degrades that turn to the legacy chain — never a partial swap, never client-as-authority. The system block stays live-built in both paths (prefix-cache anchor discipline). SQLite lane only; title-gen/compaction side requests excluded. Default 0 = off: legacy chain, zero rows, byte-identical to pre-feature. Round 2 (KDD #23): for egress-on sessions the `messages` table is a LAZY projection — no per-turn ingest, the pin channel resolves the op log's I rows, and the session JSON envelope freezes at bootstrap — so per-turn cost stays O(live-window) at any ledger size (10w cumulative measured 638 ms p50; resident guard: `tests/egress-bench.test.ts`, PR #6785 doc §6). |
|
|
112
112
|
| `rollout.features.pluginDeltaResend` | boolean \| number | 0 (off) | BILI_ROLLOUT_PLUGIN_DELTA_RESEND | Delta resend — the tail-slice form of the full-resend watermark lane: steady plugin-lane turns send x-bili-pf-delta: 1 + body.messages = ONLY the new elements (L = T − stampT, no prefix); the server rebuilds the view from the stashed prefix cores plus the parsed tail (same hit provenance as the full lane). ANY unsatisfiable claim (count/body/tail-ids width mismatch, anchor-chain break after a known list, rollout off) returns 400 pf_delta_reanchor + x-bili-msgid-mode: full and the client resends that turn in full form — one-round convergence, never a silent misparse. OFF by default: delta bodies are unprocessable by servers that do not ship this arm, so the key stays 0 until client send-sides exist. See technical-notes.md “Delta resend”. |
|
|
113
|
-
| `rollout.features.pluginFullResendWatermark` | boolean \| number |
|
|
113
|
+
| `rollout.features.pluginFullResendWatermark` | boolean \| number | 0 (default off since 2026-11-29; the 2026-11-22 GA is retracted after #7960) | BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK | Full-resend watermark fastpath (#5403/#5418): plugin-lane chat-completions turns whose previous response carried an x-bili-pf-seq stamp assert the resent prefix via the echoed count (structural scan, no full parse); on a hit the pipeline consumes stashed canonical prefix cores plus only the new tail window (byte-identical outbound provenance; ANY doubt falls back to the untouched full-parse path per turn and re-stamps, five credited misses hold the lane for one hour). Requires the client to echo the stamp back as x-bili-pf-count (dsh/pi/opencode/omp do; unadapted lanes never hit). Default OFF again (owner ruling 2026-11-29, #7960): after the GA (owner ruling 2026-11-22, PR #6785; the 5% grey ran since 2026-11-02), one-shot host injections left a stale seed the 8-element head check cannot see -> orphaned tool 400s; PR #7962 fixes that shape only, so the fastpath stays off until detection widens. Opt in with `true` (or a percent) / env = 1. See technical-notes.md “Full-resend watermark fastpath”. |
|
|
114
114
|
| `rollout.features.passDshExtensions` | boolean \| number | 0 (off = intercept) | BILI_ROLLOUT_PASS_DSH_EXTENSIONS | DSH client-extension intercept (#7168/#7439): DSH (deepseek-harness) rides top-level `dsh_*` fields on every request — `dsh_session_log` (the 8 MiB lossless session-log upload for the official DeepSeek API; the model never reads it) plus the sibling `dsh_plugin_packages`; forked/seeded sessions resend the whole log each turn until the watermark catches up. Default 0% = INTERCEPT: bili strips every TOP-LEVEL `dsh_*` key from the inbound body (src/server/handle.ts) before any protocol path builds the outbound, so the 8 MiB is never forwarded upstream — no bandwidth waste, no unknown-field risk on a non-DeepSeek upstream. DSH is unaffected: its upload watermark only advances on a 2xx, which bili still returns, so the resends self-heal. The window meter is separately exempt via the #7168 dsh_* skip (src/preflight.ts). RELEASE by flipping to 100% (or removing the strip) once the server-authoritative egress work (#6785 / discussion #7439) ships the client-extension sideband; force pass-through now with `true` / env = 1. |
|
|
115
115
|
| `maskHosts` | boolean | true | BILI_LOG_MASK_HOSTS | Mask non-public target hosts in logs as <private-host>; credential headers are always masked regardless. |
|
|
116
116
|
| `security.adminRelay` | boolean | false | — | Let an embedding host (dsh web today) relay the ENTIRE /__bili/ admin surface through its own entry origin so a remote browser can open the panel (#3373). Fail-closed, file-only. The relayed hop reaches the proxy as a local non-browser client (loopback source + loopback Host, no Origin), so the admin gate stays unchanged; enabling it exposes config editing and credential writes to whoever can reach the host web entry — protect that entry (auth / reverse proxy) first. |
|
|
@@ -2081,7 +2081,7 @@ File keys resolve only when the matching env var is unset. Defaults in parenthes
|
|
|
2081
2081
|
| `BILI_ROLLOUT_IDENTITY_CHANNEL_HARVEST` | `rollout.features.identityChannelHarvest` | 0 (off) |
|
|
2082
2082
|
| `BILI_ROLLOUT_PASS_DSH_EXTENSIONS` | `rollout.features.passDshExtensions` | 0 (off = intercept) |
|
|
2083
2083
|
| `BILI_ROLLOUT_PLUGIN_DELTA_RESEND` | `rollout.features.pluginDeltaResend` | 0 (off) |
|
|
2084
|
-
| `BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK` | `rollout.features.pluginFullResendWatermark` |
|
|
2084
|
+
| `BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK` | `rollout.features.pluginFullResendWatermark` | 0 (default off since 2026-11-29; the 2026-11-22 GA is retracted after #7960) |
|
|
2085
2085
|
| `BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY` | `rollout.features.pluginLaneServerHistory` | 100 (on, GA) |
|
|
2086
2086
|
| `BILI_ROLLOUT_PLUGIN_MSG_ID_INCREMENTAL` | `rollout.features.pluginMsgIdIncremental` | 100 (on, GA) |
|
|
2087
2087
|
| `BILI_SESSIONS_DIR` | `sessions.dir` | unset (XDG data dir) |
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
| `rollout.features.pluginMsgIdIncremental` | boolean \| number | 100(开,已 GA) | BILI_ROLLOUT_PLUGIN_MSG_ID_INCREMENTAL | 增量 msgid pin 通道(#7064 §8,owner 裁定 2026-11-18/19):稳态插件轮用**尾形态**申报消息 id——有界的 `x-bili-pf-tail-ids` 头(锚点+新增,≤ 2048 个,`?` 占位槽)或短 body id 数组——替代全量清单;服务端从自己账本的 live 行重盖前缀 id(ingest 是 INSERT OR IGNORE on (session_id,seq)——位置上的 msg_id 只写一次,永不改写)。接受规则(2026-11-19 定型):声明的尾段 [T-L, T-1] 与账本重叠段逐行相等(任一行漂移⇒降级 full,永不 400);超长会话(>2048)截断的尾清单同样可 pin——重叠段更长、证明更强。只有快照轮(账本空/折叠后重锚)发全量形态;全量优先于尾形态同时到达。响应携带 `x-bili-msgid-mode: incremental\|full`(4xx 即清,与 x-bili-pf-seq 同一学习点)。任何失配一轮内自愈。默认 100%;设 0 回滚到全量清单 pin(与特性前字节一致)。需先开 pluginLaneServerHistory。见 session-identity-resolution.zh-CN.md。 |
|
|
111
111
|
| `rollout.features.egressPlane` | boolean \| number | 0(关) | BILI_ROLLOUT_EGRESS_PLANE | egress 平面——整条新链路的**唯一开关**(#7398/#7439;取代已退役的 egressOpLog/egressServeLog 双键)。开:四条 wire 车道(OpenAI/Anthropic/Responses/Google)每轮把出站会话视图记为稀疏 op(I/D/U)写入 egress_state/egress_flow 双表——行**自包含**(消息字节随行走,不经内容 CAS,裁定 7439-1)——并从 op 日志回放重建出站核心消息段,按构造字节一致(行内字节就是管线自己的最终 core JSON);pinned 插件车道另获服务端权威——内核输入从流水回放(裁定 7439-3/5)。有界回溯阶梯恢复到最近健康日志点;任何不可重建行(缺/空字节、未知 role)、日志损坏或探针失败,整轮降级 legacy 链路——绝不部分替换、绝不客户端为准。system 块两条路径都保持 live 构建(前缀缓存锚点纪律)。仅 SQLite 车道;标题生成/压缩侧路请求排除。默认 0 = 关:legacy 链路,零行,与特性前字节一致。第 2 轮(KDD #23):egress-on 会话的 `messages` 表是**惰性投影**——不逐轮 ingest,pin 通道解析 op log 的 I 行,会话 JSON 信封 bootstrap 冻结——单轮成本恒为 O(存活窗口),与账本规模无关(10w 累计实测 638ms p50;常驻守卫:`tests/egress-bench.test.ts`,PR #6785 文档 §6)。 |
|
|
112
112
|
| `rollout.features.pluginDeltaResend` | boolean \| number | 0(关) | BILI_ROLLOUT_PLUGIN_DELTA_RESEND | Delta 重发——全量重发水位快路径的尾切片形态:稳态轮发 x-bili-pf-delta: 1 + body.messages = **只有**新元素(L = T − stampT,无前置);服务端用钉存前缀核 + 解析出的尾部重建视图(与全量车道同源的命中可证)。任何不成立的声明(count/body/tail-ids 宽度不符、已知清单后锚链断裂、灰度关)返回 400 pf_delta_reanchor + x-bili-msgid-mode: full,客户端当轮改发全量形态——一轮收敛,绝不静默错解。默认**关**:delta body 对未上车的服务端不可处理,故保持 0 直到客户端发送端就位。见 technical-notes.zh-CN.md「Delta 重发」。 |
|
|
113
|
-
| `rollout.features.pluginFullResendWatermark` | boolean \| number |
|
|
113
|
+
| `rollout.features.pluginFullResendWatermark` | boolean \| number | 0(2026-11-29 起默认关;2026-11-22 的 GA 因 #7960 收回) | BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK | 全量重发水位快路径(#5403/#5418):插件车道 chat-completions 回合若上一轮响应盖有 x-bili-pf-seq,则用回声计数声明重发前缀(结构扫描,不做全量解析);命中时管线只消费钉存的前缀核 + 新增尾巴窗口(出站字节同源可证;任何疑点当轮回退未动过的全量解析路径并重新盖戳,连续五次计名失配将车道按住一小时)。需客户端把戳回声为 x-bili-pf-count(适配的车道回带;其余车道不会命中)。**2026-11-29 起默认关**(owner 裁定,#7960):GA(owner 裁定 2026-11-22,PR #6785;5% 灰度自 2026-11-02)之后,宿主一次性注入留下的过期种子超出 8 元素 head 检查的可见范围 → 孤儿 tool 400;PR #7962 只修这一种形状,检测面扩宽前保持关闭。`true`(或百分比)/ env = 1 开启;快速配置三态开关不变。见 technical-notes.zh-CN.md「全量重发水位快路径」。 |
|
|
114
114
|
| `rollout.features.passDshExtensions` | boolean \| number | 0(关 = 拦截) | BILI_ROLLOUT_PASS_DSH_EXTENSIONS | DSH 客户端扩展拦截(#7168/#7439):DSH(deepseek-harness)每个请求都带顶层 `dsh_*` 字段——`dsh_session_log`(给官方 DeepSeek API 的 8 MiB 增量无损会话日志,模型根本不读)加孪生字段 `dsh_plugin_packages`;fork/seed 会话在水位追上前每轮从头整段重传。默认 0% = 拦截:bili 在入站 body 解析后、任何协议路径构建出站前,删掉所有**顶层** `dsh_*` 键(src/server/handle.ts),8 MiB 永不转发上游——不浪费带宽,非 DeepSeek 上游也不见陌生大字段。DSH 不受影响:其上传水位只在 2xx 时推进,bili 照常回 2xx,重传自愈。窗口计量另由 #7168 的 dsh_* 豁免(src/preflight.ts)兜底。等服务端权威 egress 工作(#6785 / 讨论 #7439)把客户端扩展旁路带做好后,翻到 100%(或移除裁切)即放开;现在想临时放行用 `true` / env = 1。 |
|
|
115
115
|
| `maskHosts` | boolean | true | BILI_LOG_MASK_HOSTS | 日志中把非公开目标主机遮成 <private-host>;凭据头无论此开关如何总是遮盖。 |
|
|
116
116
|
| `security.adminRelay` | boolean | false | — | 允许宿主(当前为 dsh web)把它自己入口域名下的整个 /__bili/ 管理面中继到本机代理,使远程浏览器能打开面板(#3373)。默认关闭、仅配置文件。中继跳到达代理时是本机非浏览器客户端(回环源地址 + 回环 Host、无 Origin 头),管理端门槛不变;开启后,凡能访问宿主 web 入口的人都能改配置、写凭据——请先给入口加鉴权/反代。 |
|
|
@@ -2058,7 +2058,7 @@ ACP 原生 agent(当前为 `pi` 扩展)会在每个进程内向代理上报
|
|
|
2058
2058
|
| `BILI_ROLLOUT_IDENTITY_CHANNEL_HARVEST` | `rollout.features.identityChannelHarvest` | 0 (off) |
|
|
2059
2059
|
| `BILI_ROLLOUT_PASS_DSH_EXTENSIONS` | `rollout.features.passDshExtensions` | 0 (off = intercept) |
|
|
2060
2060
|
| `BILI_ROLLOUT_PLUGIN_DELTA_RESEND` | `rollout.features.pluginDeltaResend` | 0 (off) |
|
|
2061
|
-
| `BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK` | `rollout.features.pluginFullResendWatermark` |
|
|
2061
|
+
| `BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK` | `rollout.features.pluginFullResendWatermark` | 0 (default off since 2026-11-29; the 2026-11-22 GA is retracted after #7960) |
|
|
2062
2062
|
| `BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY` | `rollout.features.pluginLaneServerHistory` | 100 (on, GA) |
|
|
2063
2063
|
| `BILI_ROLLOUT_PLUGIN_MSG_ID_INCREMENTAL` | `rollout.features.pluginMsgIdIncremental` | 100 (on, GA) |
|
|
2064
2064
|
| `BILI_SESSIONS_DIR` | `sessions.dir` | unset (XDG data dir) |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "billion-context",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.218",
|
|
4
4
|
"description": "A context-compression plugin \u2014 small context windows (a 100K context is enough), 5x fewer tokens, month-long single sessions (billions of tokens), and compression quality \u2014 for all agents: pi, OpenCode, Codex, Claude Code, and more. billion-context is all you need.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|