opencode-acp 1.14.26-pr.353.90 → 1.14.26-pr.360.93

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
@@ -339,6 +339,9 @@ Each level overrides the previous, so project settings take priority over global
339
339
  // "anthropic/claude-sonnet-4.6": "80%"
340
340
  // },
341
341
  // Optional per-model override for minContextLimit.
342
+ // DEPRECATED — scheduled for removal alongside minContextLimit;
343
+ // use compress.providers (or minNudgeContextPercent for growth
344
+ // nudges) instead. Still honored until removed.
342
345
  // If present, this wins over the global minContextLimit.
343
346
  // "modelMinLimits": {
344
347
  // "openai/gpt-5.3-codex": 50000,
@@ -441,7 +444,7 @@ Any `compress` field can be overridden per provider and per model via the nested
441
444
 
442
445
  Resolution is **per field**: model > provider > global. Unknown provider/model IDs fall back to the global value. A nested `maxContextLimit` also wins over the legacy flat `modelMaxLimits` map. Overrides deep-merge across the three config layers (global → config dir → project) per provider/model key.
443
446
 
444
- Not overridable here: `permission`, the deprecated `minContextLimit` family, and the flat `model*Limits` maps themselves.
447
+ Not overridable here: `permission`, the deprecated `minContextLimit` / `modelMinLimits` family, and the flat `modelMaxLimits` / `modelMinLimits` maps themselves. Note: `modelMaxLimits` is **not** deprecated — it stays fully supported; a nested `maxContextLimit` simply outranks it.
445
448
 
446
449
  See the [`compress.providers`](./CONFIGURATION.md#compressproviders) reference in CONFIGURATION.md for the full 23-field list and recipes.
447
450
 
package/README.zh-CN.md CHANGED
@@ -292,6 +292,9 @@ ACP 使用自己的配置文件,按以下顺序搜索:
292
292
  // "anthropic/claude-sonnet-4.6": "80%"
293
293
  // },
294
294
  // Optional per-model override for minContextLimit.
295
+ // 已废弃 —— 将随 minContextLimit 一并移除;
296
+ // 请改用 compress.providers(增长型提醒用
297
+ // minNudgeContextPercent)。移除前仍然生效。
295
298
  // If present, this wins over the global minContextLimit.
296
299
  // "modelMinLimits": {
297
300
  // "openai/gpt-5.3-codex": 50000,
@@ -393,7 +396,7 @@ ACP 使用自己的配置文件,按以下顺序搜索:
393
396
 
394
397
  解析为**逐字段**优先级:model > provider > 全局。未知的 provider/model ID 回退到全局值。嵌套的 `maxContextLimit` 同时优先于旧版扁平 `modelMaxLimits` 映射。多层配置(全局 → 配置目录 → 项目)按 provider/model 键深合并。
395
398
 
396
- 不可覆盖:`permission`、已废弃的 `minContextLimit` 系列,以及扁平 `model*Limits` 映射自身。
399
+ 不可覆盖:`permission`、已废弃的 `minContextLimit` / `modelMinLimits` 系列、以及扁平 `modelMaxLimits` / `modelMinLimits` 映射自身。注意:`modelMaxLimits` **未废弃** —— 仍完全支持,只是优先级低于嵌套的 `maxContextLimit`。
397
400
 
398
401
  完整 23 项字段清单与配方见 CONFIGURATION.zh-CN.md 的 [`compress.providers`](./CONFIGURATION.zh-CN.md#compressproviders) 参考节。
399
402
 
package/dist/index.js CHANGED
@@ -6922,13 +6922,10 @@ function buildCompressibleRanges(messages, state, protectedTools = [], protected
6922
6922
  if (!ref) continue;
6923
6923
  const rn = parseInt(ref.slice(1), 10);
6924
6924
  if ((protectedTools.length > 0 || protectedFilePatterns.length > 0) && messageContainsProtectedTool(msg, protectedTools, protectedFilePatterns)) {
6925
- let tokens2 = 0;
6925
+ const tokens2 = Math.round(countMessageCharacters(msg) / 4);
6926
6926
  const tools = /* @__PURE__ */ new Set();
6927
6927
  for (const part of msg.parts || []) {
6928
- if (part.type === "text" && typeof part.text === "string") {
6929
- tokens2 += Math.round(part.text.length / 4);
6930
- } else if (part.type !== "text" && part.type !== "reasoning") {
6931
- tokens2 += Math.round(JSON.stringify(part).length / 4);
6928
+ if (part.type !== "text" && part.type !== "reasoning") {
6932
6929
  const toolName = part?.tool;
6933
6930
  const callID = part?.callID;
6934
6931
  if (toolName && callID) {
@@ -6949,15 +6946,13 @@ function buildCompressibleRanges(messages, state, protectedTools = [], protected
6949
6946
  protectedMsgInfo.push({ ref, refNum: rn, tokens: tokens2, tools: [...tools] });
6950
6947
  continue;
6951
6948
  }
6952
- let tokens = 0;
6949
+ const tokens = Math.round(countMessageCharacters(msg) / 4);
6953
6950
  let isTool = false;
6954
6951
  let hasMeaningfulPart = false;
6955
6952
  for (const part of msg.parts || []) {
6956
6953
  if (part.type === "text" && typeof part.text === "string") {
6957
- tokens += Math.round(part.text.length / 4);
6958
6954
  if (part.text.trim().length > 0) hasMeaningfulPart = true;
6959
6955
  } else if (part.type !== "text" && part.type !== "reasoning") {
6960
- tokens += Math.round(JSON.stringify(part).length / 4);
6961
6956
  isTool = true;
6962
6957
  hasMeaningfulPart = true;
6963
6958
  }
@@ -9378,7 +9373,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
9378
9373
  import { join as join3 } from "path";
9379
9374
  import { existsSync as existsSync3 } from "fs";
9380
9375
  import { homedir as homedir3 } from "os";
9381
- var LOG_VERSION = true ? "1.14.26-pr.353.90" : "dev";
9376
+ var LOG_VERSION = true ? "1.14.26-pr.360.93" : "dev";
9382
9377
  var LEVEL_RANK = {
9383
9378
  debug: 10,
9384
9379
  info: 20,
@@ -11819,7 +11814,7 @@ var server = (async (ctx) => {
11819
11814
  }
11820
11815
  const logger = new Logger(config.debug, config.debug ? "debug" : config.logLevel);
11821
11816
  logger.info("ACP plugin initialized", {
11822
- version: true ? "1.14.26-pr.353.90" : "dev",
11817
+ version: true ? "1.14.26-pr.360.93" : "dev",
11823
11818
  workspace: ctx.directory,
11824
11819
  logLevel: logger.level,
11825
11820
  debug: config.debug,