opencode-acp 1.18.3 → 1.18.4-pr.483.216

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/README.md CHANGED
@@ -71,13 +71,13 @@ This brings two concrete effects:
71
71
 
72
72
  Pick by your client:
73
73
 
74
- | Client | Use |
75
- |---|---|
76
- | **pi** | [`billion-context-pi`](https://github.com/ranxianglei/billion-context-pi) (in-process extension) |
77
- | **opencode 1.x** | [`opencode-acp`](https://github.com/ranxianglei/opencode-acp) (in-process extension) |
78
- | **opencode 2.0+** | [`billion-context`](https://github.com/ranxianglei/billion-context) — `bili opencode` (built-in V2 plugin) or `bili plugin install opencode` (self-spawning native plugin, no launcher); `opencode-acp` does not load on 2.x |
79
- | **omp** | [`billion-context`](https://github.com/ranxianglei/billion-context) via `bili omp` (built-in plugin) |
80
- | **everything else** (no context hook) | [`billion-context`](https://github.com/ranxianglei/billion-context) — `bili <client>` (launcher, preferred) or `/bili/` prefix |
74
+ | Client | Use |
75
+ | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
76
+ | **pi** | [`billion-context-pi`](https://github.com/ranxianglei/billion-context-pi) (in-process extension) |
77
+ | **opencode 1.x** | [`opencode-acp`](https://github.com/ranxianglei/opencode-acp) (in-process extension) |
78
+ | **opencode 2.0+** | [`billion-context`](https://github.com/ranxianglei/billion-context) — `bili opencode` (built-in V2 plugin) or `bili plugin install opencode` (self-spawning native plugin, no launcher); `opencode-acp` does not load on 2.x |
79
+ | **omp** | [`billion-context`](https://github.com/ranxianglei/billion-context) via `bili omp` (built-in plugin) |
80
+ | **everything else** (no context hook) | [`billion-context`](https://github.com/ranxianglei/billion-context) — `bili <client>` (launcher, preferred) or `/bili/` prefix |
81
81
 
82
82
  ---
83
83
 
@@ -157,11 +157,11 @@ stateDiagram-v2
157
157
  Tier1 --> GC_Truncated : GC at 100% context
158
158
  ```
159
159
 
160
- | Tier | Name | Input | Output | Compression ratio | When it fires |
161
- |------|------|-------|--------|-------------------|---------------|
162
- | **T1** | Capture | Raw conversation | Detailed summary | ~45× | Context exceeds `maxContextLimit` |
163
- | **T2** | Distill | T1 summaries (≥ `nudgeGrowthTokens`) | Condensed decisions/outcomes | ~10× | T1 summaries accumulate past threshold |
164
- | **T3** | Condense | T2 summaries (≥ `nudgeGrowthTokens`) | Bare facts (1-3 per block) | ~5× | T2 summaries accumulate past threshold |
160
+ | Tier | Name | Input | Output | Compression ratio | When it fires |
161
+ | ------ | -------- | ------------------------------------ | ---------------------------- | ----------------- | -------------------------------------- |
162
+ | **T1** | Capture | Raw conversation | Detailed summary | ~45× | Context exceeds `maxContextLimit` |
163
+ | **T2** | Distill | T1 summaries (≥ `nudgeGrowthTokens`) | Condensed decisions/outcomes | ~10× | T1 summaries accumulate past threshold |
164
+ | **T3** | Condense | T2 summaries (≥ `nudgeGrowthTokens`) | Bare facts (1-3 per block) | ~5× | T2 summaries accumulate past threshold |
165
165
 
166
166
  **How triggers work:**
167
167
 
@@ -183,19 +183,19 @@ impact).
183
183
  T2 → T3 → context limit (real-calibrated: 500 API calls/day, ~9.6K new tokens/call,
184
184
  T1=45x/T2=10x/T3=3x):
185
185
 
186
- | Context limit | 1 month | 3 months | At limit | Limit reached |
187
- |---------------|---------|----------|----------|---------------|
188
- | 1M | 1.9B tok | 10.5B tok | **68.9B tok** | day 259 (~8.6 mo) |
189
- | 400K | 1.9B tok | 10.3B tok | **10.3B tok** | day 89 (~3 mo) |
190
- | 400K (200 calls/day) | 559M tok | 2.5B tok | **9.5B tok** | day 212 (~7 mo) |
186
+ | Context limit | 1 month | 3 months | At limit | Limit reached |
187
+ | -------------------- | -------- | --------- | ------------- | ----------------- |
188
+ | 1M | 1.9B tok | 10.5B tok | **68.9B tok** | day 259 (~8.6 mo) |
189
+ | 400K | 1.9B tok | 10.3B tok | **10.3B tok** | day 89 (~3 mo) |
190
+ | 400K (200 calls/day) | 559M tok | 2.5B tok | **9.5B tok** | day 212 (~7 mo) |
191
191
 
192
192
  **Token savings** — without ACP, context grows unbounded and the session crashes
193
193
  after ~100 API calls (~0.2 days). With ACP, context is bounded by compression:
194
194
 
195
- | Metric | Without ACP | With ACP (1M model) |
196
- |--------|-------------|---------------------|
197
- | Session lifetime | ~0.2 days | 259 days (**1295x** longer) |
198
- | Total tokens processed | ~52M | 68.9B (**1325x** more work) |
195
+ | Metric | Without ACP | With ACP (1M model) |
196
+ | ---------------------- | ----------- | --------------------------- |
197
+ | Session lifetime | ~0.2 days | 259 days (**1295x** longer) |
198
+ | Total tokens processed | ~52M | 68.9B (**1325x** more work) |
199
199
 
200
200
  The core value: ACP doesn't just reduce per-call token cost — it enables a single
201
201
  session to process **1000x more total work** by keeping context bounded across
@@ -278,12 +278,12 @@ ensures key context information is not lost.
278
278
 
279
279
  ACP provides an `/acp` slash command (also accepts `/dcp` for backward compatibility):
280
280
 
281
- | Command | Description |
282
- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
283
- | `/acp` | Show compression status (same as `/acp stats`). Use `/acp help` for the command list |
284
- | `/acp context` | Token usage breakdown by category (system, user, assistant, tools, etc.) and how much has been saved through pruning |
285
- | `/acp stats` | Compression status: blocks, context usage, ranges (same report as the `acp_status` tool) |
286
- | `/acp export` | Export active compression blocks to a markdown file. Options: `--output <path>`, `--tier t1,t2,t3`, `--stdout`, `--append` |
281
+ | Command | Description |
282
+ | -------------- | -------------------------------------------------------------------------------------------------------------------------- |
283
+ | `/acp` | Show compression status (same as `/acp stats`). Use `/acp help` for the command list |
284
+ | `/acp context` | Token usage breakdown by category (system, user, assistant, tools, etc.) and how much has been saved through pruning |
285
+ | `/acp stats` | Compression status: blocks, context usage, ranges (same report as the `acp_status` tool) |
286
+ | `/acp export` | Export active compression blocks to a markdown file. Options: `--output <path>`, `--tier t1,t2,t3`, `--stdout`, `--append` |
287
287
 
288
288
  ---
289
289
 
@@ -433,7 +433,18 @@ Each level overrides the previous, so project settings take priority over global
433
433
  // touched. Small thinkings under the threshold are kept.
434
434
  "reasoning": {
435
435
  "drop": true,
436
- "threshold": 2048
436
+ "threshold": 2048,
437
+ },
438
+ // [#478] Image archive: spill data-URL images to disk when they enter
439
+ // the session so folded ranges keep re-readable pointers instead of
440
+ // silently dropping the pixels. Files land in
441
+ // <storageDir>/images/<dirName(sessionId)>/ (mode 0600); block
442
+ // summaries covering them append absolute paths for the model to
443
+ // re-read with its own file tools. Not part of the per-model cascade.
444
+ "images": {
445
+ "enabled": true,
446
+ "minBytes": 16384,
447
+ "ttlDays": 7,
437
448
  },
438
449
  },
439
450
  // Garbage collection — hardcoded 100% fallback only
@@ -466,7 +477,7 @@ Each level overrides the previous, so project settings take priority over global
466
477
  // L2 fails (combined with top20Recall via AND) when below this.
467
478
  "layer2MaxRougeF1": 0.05,
468
479
  // L2 fails (combined with rougeF1 via AND) when below this.
469
- "layer2MaxTop20Recall": 0.20,
480
+ "layer2MaxTop20Recall": 0.2,
470
481
  },
471
482
  },
472
483
  },
@@ -502,12 +513,12 @@ Any `compress` field can be overridden per provider and per model via the nested
502
513
  "anthropic": {
503
514
  "nudgeGrowthTokens": 20000,
504
515
  "models": {
505
- "claude-sonnet-4.6": { "maxContextLimit": "70%", "nudgeForce": "strong" }
506
- }
516
+ "claude-sonnet-4.6": { "maxContextLimit": "70%", "nudgeForce": "strong" },
517
+ },
507
518
  },
508
- "openai": { "nudgeGrowthTokens": 40000 }
509
- }
510
- }
519
+ "openai": { "nudgeGrowthTokens": 40000 },
520
+ },
521
+ },
511
522
  }
512
523
  ```
513
524
 
package/README.zh-CN.md CHANGED
@@ -59,13 +59,13 @@ ACP 将上下文管理的所有权限全部交给模型自己,而不依靠外
59
59
 
60
60
  按客户端选:
61
61
 
62
- | 客户端 | 用这个 |
63
- |---|---|
64
- | **pi** | [`billion-context-pi`](https://github.com/ranxianglei/billion-context-pi)(进程内扩展) |
65
- | **opencode 1.x** | [`opencode-acp`](https://github.com/ranxianglei/opencode-acp)(进程内扩展) |
66
- | **opencode 2.0+** | [`billion-context`](https://github.com/ranxianglei/billion-context) —— `bili opencode`(内置 V2 插件)或 `bili plugin install opencode`(自拉起原生插件,免启动器);`opencode-acp` 在 2.x 上不加载 |
67
- | **omp** | [`billion-context`](https://github.com/ranxianglei/billion-context),`bili omp`(内置插件) |
68
- | **其余所有**(没有上下文 hook) | [`billion-context`](https://github.com/ranxianglei/billion-context) —— `bili <client>`(启动器,优先)或 `/bili/` 前缀 |
62
+ | 客户端 | 用这个 |
63
+ | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
64
+ | **pi** | [`billion-context-pi`](https://github.com/ranxianglei/billion-context-pi)(进程内扩展) |
65
+ | **opencode 1.x** | [`opencode-acp`](https://github.com/ranxianglei/opencode-acp)(进程内扩展) |
66
+ | **opencode 2.0+** | [`billion-context`](https://github.com/ranxianglei/billion-context) —— `bili opencode`(内置 V2 插件)或 `bili plugin install opencode`(自拉起原生插件,免启动器);`opencode-acp` 在 2.x 上不加载 |
67
+ | **omp** | [`billion-context`](https://github.com/ranxianglei/billion-context),`bili omp`(内置插件) |
68
+ | **其余所有**(没有上下文 hook) | [`billion-context`](https://github.com/ranxianglei/billion-context) —— `bili <client>`(启动器,优先)或 `/bili/` 前缀 |
69
69
 
70
70
  ---
71
71
 
@@ -129,11 +129,11 @@ stateDiagram-v2
129
129
  Tier1 --> GC_Truncated : GC(100% 上下文)
130
130
  ```
131
131
 
132
- | 层级 | 名称 | 输入 | 输出 | 压缩比 | 触发时机 |
133
- |------|------|------|------|--------|----------|
134
- | **T1** | 捕获 | 原始对话 | 详细摘要 | ~45× | 上下文超过 `maxContextLimit` |
135
- | **T2** | 蒸馏 | T1 摘要(≥ `nudgeGrowthTokens`) | 精炼的决策/结果 | ~10× | T1 摘要累积超过阈值 |
136
- | **T3** | 浓缩 | T2 摘要(≥ `nudgeGrowthTokens`) | 纯事实(每块 1-3 条) | ~5× | T2 摘要累积超过阈值 |
132
+ | 层级 | 名称 | 输入 | 输出 | 压缩比 | 触发时机 |
133
+ | ------ | ---- | -------------------------------- | --------------------- | ------ | ---------------------------- |
134
+ | **T1** | 捕获 | 原始对话 | 详细摘要 | ~45× | 上下文超过 `maxContextLimit` |
135
+ | **T2** | 蒸馏 | T1 摘要(≥ `nudgeGrowthTokens`) | 精炼的决策/结果 | ~10× | T1 摘要累积超过阈值 |
136
+ | **T3** | 浓缩 | T2 摘要(≥ `nudgeGrowthTokens`) | 纯事实(每块 1-3 条) | ~5× | T2 摘要累积超过阈值 |
137
137
 
138
138
  **触发机制:**
139
139
 
@@ -147,17 +147,17 @@ stateDiagram-v2
147
147
 
148
148
  **会话容量** — 一个会话从空 → T1 → T2 → T3 → 上下文极限,总共可以处理多少 token(真实校准:500 次 API 调用/天,~9.6K 新 token/调用,T1=45x/T2=10x/T3=3x):
149
149
 
150
- | 上下文上限 | 1 个月 | 3 个月 | 到极限 | 极限时间 |
151
- |-----------|--------|--------|--------|---------|
152
- | 1M | 19 亿 tok | 105 亿 tok | **689 亿 tok** | 第 259 天(~8.6 月) |
153
- | 400K | 19 亿 tok | 103 亿 tok | **103 亿 tok** | 第 89 天(~3 月) |
154
- | 400K(200 调用/天) | 5.6 亿 tok | 25 亿 tok | **95 亿 tok** | 第 212 天(~7 月) |
150
+ | 上下文上限 | 1 个月 | 3 个月 | 到极限 | 极限时间 |
151
+ | ------------------- | ---------- | ---------- | -------------- | -------------------- |
152
+ | 1M | 19 亿 tok | 105 亿 tok | **689 亿 tok** | 第 259 天(~8.6 月) |
153
+ | 400K | 19 亿 tok | 103 亿 tok | **103 亿 tok** | 第 89 天(~3 月) |
154
+ | 400K(200 调用/天) | 5.6 亿 tok | 25 亿 tok | **95 亿 tok** | 第 212 天(~7 月) |
155
155
 
156
156
  **Token 节省** — 无 ACP 时上下文无限增长,约 100 次 API 调用后崩溃(~0.2 天)。有 ACP 时上下文被压缩在有界范围:
157
157
 
158
- | 指标 | 无 ACP | 有 ACP(1M 模型) |
159
- |------|--------|-----------------|
160
- | 会话寿命 | ~0.2 天 | 259 天(**长 1295 倍**) |
158
+ | 指标 | 无 ACP | 有 ACP(1M 模型) |
159
+ | ------------- | -------- | ------------------------ |
160
+ | 会话寿命 | ~0.2 天 | 259 天(**长 1295 倍**) |
161
161
  | 总 token 产出 | ~5200 万 | 689 亿(**多 1325 倍**) |
162
162
 
163
163
  核心价值:ACP 不是减少每次调用的 token 成本,而是**让一个会话能处理 1000 倍以上的工作量**。
@@ -226,12 +226,12 @@ stateDiagram-v2
226
226
 
227
227
  ACP 提供 `/acp` 斜杠命令(为向后兼容也接受 `/dcp`):
228
228
 
229
- | 命令 | 说明 |
230
- | ----------------------- | ------------------------------------------------------------------------------------------------------------------- |
231
- | `/acp` | 显示压缩状态(同 `/acp stats`);`/acp help` 查看命令列表 |
232
- | `/acp context` | 按类别(system、user、assistant、tools 等)显示 token 用量明细,以及通过剪枝节省的量 |
233
- | `/acp stats` | 压缩状态:压缩块、上下文用量、推荐范围(与 `acp_status` 工具同一报告) |
234
- | `/acp export` | 导出活动压缩块到 markdown 文件。选项:`--output <path>`、`--tier t1,t2,t3`、`--stdout`、`--append` |
229
+ | 命令 | 说明 |
230
+ | -------------- | -------------------------------------------------------------------------------------------------- |
231
+ | `/acp` | 显示压缩状态(同 `/acp stats`);`/acp help` 查看命令列表 |
232
+ | `/acp context` | 按类别(system、user、assistant、tools 等)显示 token 用量明细,以及通过剪枝节省的量 |
233
+ | `/acp stats` | 压缩状态:压缩块、上下文用量、推荐范围(与 `acp_status` 工具同一报告) |
234
+ | `/acp export` | 导出活动压缩块到 markdown 文件。选项:`--output <path>`、`--tier t1,t2,t3`、`--stdout`、`--append` |
235
235
 
236
236
  ---
237
237
 
@@ -378,7 +378,17 @@ ACP 使用自己的配置文件,按以下顺序搜索:
378
378
  // 低于阈值的小思考保留。
379
379
  "reasoning": {
380
380
  "drop": true,
381
- "threshold": 2048
381
+ "threshold": 2048,
382
+ },
383
+ // [#478] 图片归档:图片(data-URL)进入会话时即落盘,折叠后摘要里保留
384
+ // 可重读的路径指针,而不是把像素悄悄丢掉。文件落在
385
+ // <storageDir>/images/<dirName(sessionId)>/(权限 0600);覆盖它们的折叠块
386
+ // 摘要末尾追加绝对路径,模型用自己的文件工具重新读取即可。
387
+ // 不参与按模型的覆盖级联。
388
+ "images": {
389
+ "enabled": true,
390
+ "minBytes": 16384,
391
+ "ttlDays": 7,
382
392
  },
383
393
  },
384
394
  // 垃圾回收与批量清理
@@ -410,7 +420,7 @@ ACP 使用自己的配置文件,按以下顺序搜索:
410
420
  // 当 ROUGE-1 F1 低于此值时(与 top20Recall 经 AND 合并)L2 失败
411
421
  "layer2MaxRougeF1": 0.05,
412
422
  // 当 top-20 关键词召回低于此值时(与 rougeF1 经 AND 合并)L2 失败
413
- "layer2MaxTop20Recall": 0.20,
423
+ "layer2MaxTop20Recall": 0.2,
414
424
  },
415
425
  },
416
426
  },
@@ -445,12 +455,12 @@ ACP 使用自己的配置文件,按以下顺序搜索:
445
455
  "anthropic": {
446
456
  "nudgeGrowthTokens": 20000,
447
457
  "models": {
448
- "claude-sonnet-4.6": { "maxContextLimit": "70%", "nudgeForce": "strong" }
449
- }
458
+ "claude-sonnet-4.6": { "maxContextLimit": "70%", "nudgeForce": "strong" },
459
+ },
450
460
  },
451
- "openai": { "nudgeGrowthTokens": 40000 }
452
- }
453
- }
461
+ "openai": { "nudgeGrowthTokens": 40000 },
462
+ },
463
+ },
454
464
  }
455
465
  ```
456
466