billion-context-omp 0.2.6 → 0.2.7
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 +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/config.d.ts +14 -8
- package/dist/index.js +915 -279
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +19 -0
- package/dist/runtime.d.ts +16 -1
- package/dist/transform-mode.d.ts +5 -0
- package/dist/wire-fold.d.ts +116 -0
- package/package.json +7 -7
- package/dist/wire-transform.d.ts +0 -71
package/README.md
CHANGED
|
@@ -144,7 +144,7 @@ Create `~/.omp/acp-omp.json` (global) and/or `<project>/.omp/acp-omp.json` (proj
|
|
|
144
144
|
| Key | Default | Description |
|
|
145
145
|
|-----|---------|-------------|
|
|
146
146
|
| `debug` | `false` | Enable verbose **debug-level** events in the log. The always-on log (lifecycle events, errors, warnings) is written regardless; `debug` only adds extra diagnostics. Also enabled by env `ACP_DEBUG=1`. |
|
|
147
|
-
| `transformMode` |
|
|
147
|
+
| `transformMode` | unset (resolved per API) or explicit `"provider"` / `"context"` — where the compression surgery intercepts. Unset: `provider` where the host applies the wire-payload replacement AND the wire body has a codec path (anthropic-messages, ollama-chat; openai-completions on hosts >= 17.3.8 — upstream PR can1357/oh-my-pi#8717, issue #83); `context` everywhere else (issue #79). Explicit: always honored. `provider` transforms the provider wire payload (request-local, structurally immune to feedback re-entry); `context` rewrites the context event (legacy mode). |
|
|
148
148
|
| `autoUpdate` | `true` | On session start (throttled to one check per 3 minutes), check npm for a newer version and auto-install it. Disable to avoid all startup network calls. |
|
|
149
149
|
| `modelContextLimit` | *(auto)* | Override the context limit (in tokens). Defaults to the model's `contextWindow`. |
|
|
150
150
|
| `toolBashDefaultTimeout` | `60` | Seconds injected into the `bash` tool when the model omits `timeout`. Without this a forgotten timeout can hang for thousands of seconds. `0` restores unbounded behavior. |
|
package/README.zh-CN.md
CHANGED
|
@@ -146,7 +146,7 @@ billion-context-omp 开箱即用,无需配置。可选键写入 JSON 配置文
|
|
|
146
146
|
| `debug` | `false` | 开启**debug 级**详细日志事件。常开日志(生命周期事件、错误、警告)无论如何都会写;`debug` 只增加诊断信息。也可用环境变量 `ACP_DEBUG=1` 开启。 |
|
|
147
147
|
| `autoUpdate` | `true` | 会话启动时(节流为每 3 分钟最多一次)检查 npm 是否有新版本并自动安装。关闭可避免所有启动期网络请求。 |
|
|
148
148
|
| `modelContextLimit` | *(自动)* | 覆盖上下文上限(token 数)。默认取模型的 `contextWindow`。 |
|
|
149
|
-
| `transformMode` | `"provider"
|
|
149
|
+
| `transformMode` | 未设置(按 API 解析)或显式 `"provider"` / `"context"` | 压缩手术拦截位置。未设置:host 会应用 wire 载荷替换且 wire 体有编解码路径的 API 用 `provider`(anthropic-messages、ollama-chat;openai-completions 需 host >= 17.3.8,上游 PR can1357/oh-my-pi#8717,issue #83),其余用 `context`(issue #79)。显式设置总是生效。`provider` 变换 provider wire 载荷(请求局部,结构性免疫回灌环路);`context` 改写 context 事件(旧版模式)。 |
|
|
150
150
|
| `toolBashDefaultTimeout` | `60` | 模型省略 `timeout` 时注入 `bash` 工具的秒数。没有它,一次忘记的 timeout 可能挂起数千秒。`0` 恢复无限制。 |
|
|
151
151
|
| `toolOutputMaxBytes` | `200000` | 工具结果文本的硬字节上限(经 `tool_result` 钩子实施)。拦截 omp 自身上限管不住的失控输出。触发时模型会被告知完整输出在哪;调低(如 `8192`)可更省上下文,`0` 禁用。 |
|
|
152
152
|
| `compress.maxContextLimit` | `"75%"` | 触发**强制压缩**提醒的上下文用量阈值(绕过增长门控与节拍)。接受比例(`0.75`)或百分比字符串(`"75%"`)。越低 = 越早/越激进压缩。 |
|
package/dist/config.d.ts
CHANGED
|
@@ -28,14 +28,20 @@ export interface CompressConfig {
|
|
|
28
28
|
*/
|
|
29
29
|
export interface AdapterConfig {
|
|
30
30
|
/** Where the compression surgery intercepts (issue #52). "provider"
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
31
|
+
* leaves the agent array untouched and transforms the WIRE payload at
|
|
32
|
+
* before_provider_request — request-local, no re-entry, structurally
|
|
33
|
+
* immune to omp's feedback-view loops (the recap / subagent re-feed
|
|
34
|
+
* pathology, issues #22/#52). Unknown provider formats pass through
|
|
35
|
+
* untransformed (fail-open). "context" rewrites the context event —
|
|
36
|
+
* battle-tested legacy mode, kept for compat.
|
|
37
|
+
* When omitted, the mode is resolved per model API (issue #79):
|
|
38
|
+
* "provider" where the host actually applies the wire-payload
|
|
39
|
+
* replacement AND the wire body has a codec path — anthropic-messages,
|
|
40
|
+
* ollama-chat, and openai-completions on hosts >= 17.3.8 (upstream PR
|
|
41
|
+
* can1357/oh-my-pi#8717, issue #83); "context" everywhere else
|
|
42
|
+
* (older hosts drop the replacement; bedrock/cursor/responses/google
|
|
43
|
+
* bodies have no codec path yet). Explicit pinning in
|
|
44
|
+
* ~/.omp/acp-omp.json always wins. */
|
|
39
45
|
transformMode?: "context" | "provider";
|
|
40
46
|
/** When omitted, the adapter reads `ctx.model.contextWindow` live each turn.
|
|
41
47
|
* Set explicitly for tests/headless runs. */
|