opencode-acp 1.14.19 → 1.14.20-pr.286.33
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 +19 -7
- package/README.zh-CN.md +19 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +520 -81
- package/dist/index.js.map +1 -1
- package/dist/lib/commands/export.d.ts +57 -0
- package/dist/lib/commands/export.d.ts.map +1 -0
- package/dist/lib/compress/decompress.d.ts.map +1 -1
- package/dist/lib/compress/quality-gate/index.d.ts +1 -1
- package/dist/lib/compress/quality-gate/index.d.ts.map +1 -1
- package/dist/lib/compress/quality-gate/rejection.d.ts +0 -1
- package/dist/lib/compress/quality-gate/rejection.d.ts.map +1 -1
- package/dist/lib/compress/range.d.ts.map +1 -1
- package/dist/lib/compress/status.d.ts.map +1 -1
- package/dist/lib/hooks.d.ts +2 -0
- package/dist/lib/hooks.d.ts.map +1 -1
- package/dist/lib/logger.d.ts +2 -2
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/messages/filter/apply.d.ts.map +1 -1
- package/dist/lib/messages/inject/inject.d.ts.map +1 -1
- package/dist/lib/state/index.d.ts +1 -0
- package/dist/lib/state/index.d.ts.map +1 -1
- package/dist/lib/state/model-limits.d.ts +27 -0
- package/dist/lib/state/model-limits.d.ts.map +1 -0
- package/dist/lib/state/persistence.d.ts +2 -0
- package/dist/lib/state/persistence.d.ts.map +1 -1
- package/dist/lib/state/state.d.ts +9 -0
- package/dist/lib/state/state.d.ts.map +1 -1
- package/dist/lib/state/types.d.ts +5 -1
- package/dist/lib/state/types.d.ts.map +1 -1
- package/dist/lib/ui/notification.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -235,13 +235,10 @@ ACP provides an `/acp` slash command (also accepts `/dcp` for backward compatibi
|
|
|
235
235
|
|
|
236
236
|
| Command | Description |
|
|
237
237
|
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
238
|
-
| `/acp` |
|
|
238
|
+
| `/acp` | Show compression status (same as `/acp stats`). Use `/acp help` for the command list |
|
|
239
239
|
| `/acp context` | Token usage breakdown by category (system, user, assistant, tools, etc.) and how much has been saved through pruning |
|
|
240
|
-
| `/acp stats` |
|
|
241
|
-
| `/acp
|
|
242
|
-
| `/acp compress [focus]` | Trigger a single compress tool execution. Optional focus text directs what content to compress, following the active `compress.mode` |
|
|
243
|
-
| `/acp decompress <n>` | Restore a specific active compression by ID. Running without an argument shows available compression IDs, token sizes, and topics |
|
|
244
|
-
| `/acp recompress <n>` | Re-apply a user-decompressed compression by ID. Running without an argument shows recompressible IDs, token sizes, and topics |
|
|
240
|
+
| `/acp stats` | Compression status: blocks, context usage, ranges (same report as the `acp_status` tool) |
|
|
241
|
+
| `/acp export` | Export active compression blocks to a markdown file. Options: `--output <path>`, `--tier t1,t2,t3`, `--stdout`, `--append` |
|
|
245
242
|
|
|
246
243
|
---
|
|
247
244
|
|
|
@@ -284,7 +281,8 @@ Each level overrides the previous, so project settings take priority over global
|
|
|
284
281
|
// Automatically update npm-installed ACP when a newer npm latest is available.
|
|
285
282
|
// Version-locked plugin specs are not updated.
|
|
286
283
|
"autoUpdate": true,
|
|
287
|
-
// Enable
|
|
284
|
+
// Enable INFO/DEBUG logging + per-request snapshots to ~/.config/opencode/logs/acp/
|
|
285
|
+
// (WARN/ERROR are always logged to daily/<date>.log)
|
|
288
286
|
"debug": false,
|
|
289
287
|
// Notification display: "off", "minimal", or "detailed"
|
|
290
288
|
"pruneNotification": "off",
|
|
@@ -492,6 +490,20 @@ For the complete list with root cause analysis, see the [bug tracker](https://gi
|
|
|
492
490
|
|
|
493
491
|
## Changelog
|
|
494
492
|
|
|
493
|
+
### v1.14.20 — Post-v1.14.19 fix batch (modelContextLimit lifecycle, inactive-block decompress, logging)
|
|
494
|
+
|
|
495
|
+
**Problem**: Five clusters of post-v1.14.19 issues: (1) `modelContextLimit` stayed stale after a model switch (#312) — within one LLM request the messages hook runs before the system hook refreshes the limit, and on a catalog miss (fresh instance + failed hydration) the previous model's window survived, so every percentage threshold misfired (#315); (2) `decompress` failed on standalone inactive blocks and inactive blocks were invisible in `acp_status` (#193); (3) a preemptive `acknowledgeRisk: true` (carried over from a non-quality error) hard-failed with "no quality gate rejection is pending" (#301); (4) debug nudge notifications used `sendIgnoredMessage` causing phantom turns, the debug recommendation-filter log spammed every turn, and ERROR/WARN lines only reached the daily log when debug was on (#311, #278, #279).
|
|
496
|
+
|
|
497
|
+
**Fix**:
|
|
498
|
+
- #314 + #315: reconcile `state.modelContextLimit` from the model-limit catalog on model switch; record the (provider, model) identity pair alongside the limit and, on a catalog miss, invalidate it when the request's model identity mismatches (match keeps it; legacy persisted states without an identity are treated as stale — one blind turn per upgraded session). The catalog is extracted to `lib/state/model-limits.ts`; failed hydration now logs (info with entry count on success, warn on zero entries/failure) instead of degrading silently.
|
|
499
|
+
- #193: `decompress` accepts standalone inactive blocks (nested-block redirect unchanged) and `decompress toFile` writes the real block content; `acp_status scope=compressed` now lists all blocks with an `[inactive]` marker plus active/inactive counts (overview still shows active blocks only).
|
|
500
|
+
- #303: `acknowledgeRisk` without a pending quality-gate rejection is now a no-op with a usage-teaching note instead of an error — only a real quality-gate rejection arms the bypass, so the gate's protection is unchanged.
|
|
501
|
+
- #278/#279/#311: debug notifications no longer use `sendIgnoredMessage` (phantom turn loop gone); the recommendation-filter log is gated behind `shouldInject` (no more per-turn noise); ERROR/WARN are written to the daily log even when debug is off.
|
|
502
|
+
|
|
503
|
+
Files: `lib/compress/range.ts`, `lib/state/model-limits.ts`, `lib/state/types.ts`, `index.ts`, `lib/state/registry.ts`. Tests: 1003 pass.
|
|
504
|
+
|
|
505
|
+
**Install**: `opencode plugin opencode-acp@latest --global`
|
|
506
|
+
|
|
495
507
|
### v1.14.19 — Fix release pipeline for real (npm 10 `--ignore-scripts` bug)
|
|
496
508
|
|
|
497
509
|
**Problem**: v1.14.18 (#306) was merged but still never published — `release.yml` failed at the exact same step. Root cause of the failed fix: the CI runner uses Node 22 (npm 10.9.x), and **npm 10 runs the `prepare` lifecycle hook during `npm pack` even when `--ignore-scripts` is passed**. v1.14.18's fix (`npm pack --ignore-scripts`) works on npm 11 but is a no-op on npm 10. When prepare runs, tsup writes `CLI Building entry: index.ts` to **stdout**, breaking `JSON.parse` in `verify-package.mjs` (`SyntaxError: Unexpected token`).
|
package/README.zh-CN.md
CHANGED
|
@@ -190,13 +190,10 @@ ACP 提供 `/acp` 斜杠命令(为向后兼容也接受 `/dcp`):
|
|
|
190
190
|
|
|
191
191
|
| 命令 | 说明 |
|
|
192
192
|
| ----------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
193
|
-
| `/acp` |
|
|
193
|
+
| `/acp` | 显示压缩状态(同 `/acp stats`);`/acp help` 查看命令列表 |
|
|
194
194
|
| `/acp context` | 按类别(system、user、assistant、tools 等)显示 token 用量明细,以及通过剪枝节省的量 |
|
|
195
|
-
| `/acp stats` |
|
|
196
|
-
| `/acp
|
|
197
|
-
| `/acp compress [focus]` | 触发一次 `compress` 工具执行。可选的焦点文本指示要压缩的内容,遵循当前 `compress.mode` |
|
|
198
|
-
| `/acp decompress <n>` | 按 ID 恢复特定的活动压缩。不带参数运行时显示可用的压缩 ID、token 大小和主题 |
|
|
199
|
-
| `/acp recompress <n>` | 按 ID 重新应用用户解压的压缩。不带参数运行时显示可重新压缩的 ID、token 大小和主题 |
|
|
195
|
+
| `/acp stats` | 压缩状态:压缩块、上下文用量、推荐范围(与 `acp_status` 工具同一报告) |
|
|
196
|
+
| `/acp export` | 导出活动压缩块到 markdown 文件。选项:`--output <path>`、`--tier t1,t2,t3`、`--stdout`、`--append` |
|
|
200
197
|
|
|
201
198
|
---
|
|
202
199
|
|
|
@@ -239,7 +236,8 @@ ACP 使用自己的配置文件,按以下顺序搜索:
|
|
|
239
236
|
// Automatically update npm-installed ACP when a newer npm latest is available.
|
|
240
237
|
// Version-locked plugin specs are not updated.
|
|
241
238
|
"autoUpdate": true,
|
|
242
|
-
// Enable
|
|
239
|
+
// Enable INFO/DEBUG logging + per-request snapshots to ~/.config/opencode/logs/acp/
|
|
240
|
+
// (WARN/ERROR are always logged to daily/<date>.log)
|
|
243
241
|
"debug": false,
|
|
244
242
|
// Notification display: "off", "minimal", or "detailed"
|
|
245
243
|
"pruneNotification": "detailed",
|
|
@@ -446,6 +444,20 @@ ACP 是 DCP 的直接替代品。迁移步骤:
|
|
|
446
444
|
|
|
447
445
|
## 更新日志
|
|
448
446
|
|
|
447
|
+
### v1.14.20 — v1.14.19 之后的修复批次(modelContextLimit 生命周期、inactive block 解压缩、日志)
|
|
448
|
+
|
|
449
|
+
**问题**:五类 v1.14.19 之后发现的问题:(1)`modelContextLimit` 在模型切换后失效(#312)——同一次 LLM 请求内,messages hook 先于 system hook 刷新窗口值,而目录未命中时(新实例 + 水合失败),上一个模型的窗口值会一直残留,导致所有按百分比计算的阈值误触发(#315);(2)`decompress` 对独立的 inactive block 报 `Block not found`,且 inactive block 在 `acp_status` 里完全不可见(#193);(3)预防式 `acknowledgeRisk: true`(从非质量门禁错误里带过来的)直接报错 `no quality gate rejection is pending`(#301);(4)debug nudge 通知用 `sendIgnoredMessage` 触发幽灵回合(#311),debug 推荐过滤日志每回合刷屏,ERROR/WARN 在 debug 关闭时不进日常日志(#311、#278、#279)。
|
|
450
|
+
|
|
451
|
+
**修复**:
|
|
452
|
+
- #314 + #315:模型切换时从模型限制目录重新对齐 `state.modelContextLimit`;目录未命中时记录 (provider, model) 身份对,请求的身份与记录不一致时使窗口值失效(一致则保留;未记录身份的旧持久化状态按失效处理,升级后每个会话盲一轮)。目录提取到 `lib/state/model-limits.ts`;水合失败现在会记日志(成功 info 带条目数,失败 warn),不再静默降级。
|
|
453
|
+
- #193:`decompress` 接受独立的 inactive block(嵌套 block 重定向不变);`acp_status scope=compressed` 现在列出所有 block,inactive 的带 `[inactive]` 标记,并显示 active/inactive 计数(overview 仍只显示 active)。
|
|
454
|
+
- #303:没有待处理的质量门禁拒绝时,`acknowledgeRisk` 变为 no-op + 用法提示,不再报错 —— 真正的质量门禁拒绝才会武装 bypass,门禁保护不受影响。
|
|
455
|
+
- #278/#279/#311:debug 通知不再用 `sendIgnoredMessage`(幽灵回合循环消失);推荐过滤日志改为 `shouldInject` 后才输出(不再每回合刷屏);ERROR/WARN 在 debug 关闭时也写入日常日志。
|
|
456
|
+
|
|
457
|
+
文件:`lib/compress/range.ts`、`lib/state/model-limits.ts`、`lib/state/types.ts`、`index.ts`、`lib/state/registry.ts`。测试:1003 通过。
|
|
458
|
+
|
|
459
|
+
**安装**:`opencode plugin opencode-acp@latest --global`
|
|
460
|
+
|
|
449
461
|
### v1.14.19 — 彻底修复发版流水线(npm 10 `--ignore-scripts` 失效)
|
|
450
462
|
|
|
451
463
|
**问题**:v1.14.18(#306)已合并但依然没有发布 —— `release.yml` 又在同一步骤失败。v1.14.18 修复失败的根本原因:CI 运行器是 Node 22(npm 10.9.x),而 **npm 10 在 `npm pack` 时即使传了 `--ignore-scripts` 也照样执行 `prepare` 生命周期钩子**。v1.14.18 的修复(`npm pack --ignore-scripts`)在 npm 11 上有效,在 npm 10 上是空操作。prepare 一旦执行,tsup 会把 `CLI Building entry: index.ts` 写到 **stdout**,破坏 `verify-package.mjs` 里的 `JSON.parse`(`SyntaxError: Unexpected token`)。
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA2BjD,QAAA,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA2BjD,QAAA,MAAM,MAAM,EAAE,MA6IK,CAAA;AAEnB,eAAe,MAAM,CAAA"}
|