opencode-acp 1.14.26 → 1.14.27-pr.361.96

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
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA2BjD,QAAA,MAAM,MAAM,EAAE,MA0JK,CAAA;AAEnB,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA4BjD,QAAA,MAAM,MAAM,EAAE,MAmMK,CAAA;AAEnB,eAAe,MAAM,CAAA"}
package/dist/index.js CHANGED
@@ -9378,7 +9378,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
9378
9378
  import { join as join3 } from "path";
9379
9379
  import { existsSync as existsSync3 } from "fs";
9380
9380
  import { homedir as homedir3 } from "os";
9381
- var LOG_VERSION = true ? "1.14.26" : "dev";
9381
+ var LOG_VERSION = true ? "1.14.27-pr.361.96" : "dev";
9382
9382
  var LEVEL_RANK = {
9383
9383
  debug: 10,
9384
9384
  info: 20,
@@ -11607,6 +11607,36 @@ function configureClientAuth(client) {
11607
11607
  return client;
11608
11608
  }
11609
11609
 
11610
+ // lib/bili-proxy.ts
11611
+ var BILI_PROXY_MARKER = "/bili/";
11612
+ function extractBaseURL(entry) {
11613
+ if (!entry || typeof entry !== "object") return void 0;
11614
+ const record = entry;
11615
+ const options = record.options;
11616
+ if (options && typeof options === "object") {
11617
+ const optionBaseURL = options.baseURL;
11618
+ if (typeof optionBaseURL === "string" && optionBaseURL.length > 0) {
11619
+ return optionBaseURL;
11620
+ }
11621
+ }
11622
+ const topLevelBaseURL = record.baseURL;
11623
+ if (typeof topLevelBaseURL === "string" && topLevelBaseURL.length > 0) {
11624
+ return topLevelBaseURL;
11625
+ }
11626
+ return void 0;
11627
+ }
11628
+ function findBiliProxyProviders(provider) {
11629
+ if (!provider || typeof provider !== "object") return [];
11630
+ const matches = [];
11631
+ for (const [name, entry] of Object.entries(provider)) {
11632
+ const baseURL = extractBaseURL(entry);
11633
+ if (baseURL !== void 0 && baseURL.includes(BILI_PROXY_MARKER)) {
11634
+ matches.push({ provider: name, baseURL });
11635
+ }
11636
+ }
11637
+ return matches;
11638
+ }
11639
+
11610
11640
  // lib/update.ts
11611
11641
  import { readFile as readFile2, rm } from "fs/promises";
11612
11642
  import { basename, dirname as dirname4, join as join6 } from "path";
@@ -11814,12 +11844,14 @@ var server = (async (ctx) => {
11814
11844
  return {};
11815
11845
  }
11816
11846
  if (process.env.BILLION_CONTEXT_PROXY) {
11817
- console.log("[opencode-acp] disabled: BILLION_CONTEXT_PROXY detected \u2014 proxy handles compression");
11847
+ console.log(
11848
+ "[opencode-acp] disabled: BILLION_CONTEXT_PROXY detected \u2014 proxy handles compression"
11849
+ );
11818
11850
  return {};
11819
11851
  }
11820
11852
  const logger = new Logger(config.debug, config.debug ? "debug" : config.logLevel);
11821
11853
  logger.info("ACP plugin initialized", {
11822
- version: true ? "1.14.26" : "dev",
11854
+ version: true ? "1.14.27-pr.361.96" : "dev",
11823
11855
  workspace: ctx.directory,
11824
11856
  logLevel: logger.level,
11825
11857
  debug: config.debug,
@@ -11863,31 +11895,34 @@ var server = (async (ctx) => {
11863
11895
  config,
11864
11896
  prompts
11865
11897
  };
11898
+ let disabledByBiliProxy = false;
11899
+ const guard = (fn) => (...args) => disabledByBiliProxy ? Promise.resolve() : fn(...args);
11866
11900
  return {
11867
- "experimental.chat.system.transform": createSystemPromptHandler(
11868
- registry4,
11869
- logger,
11870
- config,
11871
- prompts
11901
+ "experimental.chat.system.transform": guard(
11902
+ createSystemPromptHandler(registry4, logger, config, prompts)
11872
11903
  ),
11873
- "experimental.chat.messages.transform": createChatMessageTransformHandler(
11874
- ctx.client,
11875
- registry4,
11876
- logger,
11877
- config,
11878
- prompts,
11879
- hostPermissions
11904
+ "experimental.chat.messages.transform": guard(
11905
+ createChatMessageTransformHandler(
11906
+ ctx.client,
11907
+ registry4,
11908
+ logger,
11909
+ config,
11910
+ prompts,
11911
+ hostPermissions
11912
+ )
11880
11913
  ),
11881
- "experimental.text.complete": createTextCompleteHandler(),
11882
- "command.execute.before": createCommandExecuteHandler(
11883
- ctx.client,
11884
- registry4,
11885
- logger,
11886
- config,
11887
- ctx.directory,
11888
- hostPermissions
11914
+ "experimental.text.complete": guard(createTextCompleteHandler()),
11915
+ "command.execute.before": guard(
11916
+ createCommandExecuteHandler(
11917
+ ctx.client,
11918
+ registry4,
11919
+ logger,
11920
+ config,
11921
+ ctx.directory,
11922
+ hostPermissions
11923
+ )
11889
11924
  ),
11890
- event: createEventHandler(registry4, logger),
11925
+ event: guard(createEventHandler(registry4, logger)),
11891
11926
  tool: {
11892
11927
  ...config.compress.permission !== "deny" && {
11893
11928
  compress: createCompressRangeTool(compressToolContext),
@@ -11898,6 +11933,23 @@ var server = (async (ctx) => {
11898
11933
  }
11899
11934
  },
11900
11935
  config: async (opencodeConfig) => {
11936
+ const biliMatches = findBiliProxyProviders(opencodeConfig.provider);
11937
+ disabledByBiliProxy = biliMatches.length > 0;
11938
+ if (biliMatches.length > 0) {
11939
+ console.log(
11940
+ "[opencode-acp] disabled: /bili/ proxy detected in provider baseURL (" + biliMatches.map((m) => m.provider).join(", ") + ") \u2014 proxy handles compression"
11941
+ );
11942
+ const permission = opencodeConfig.permission ?? {};
11943
+ opencodeConfig.permission = {
11944
+ ...permission,
11945
+ compress: "deny",
11946
+ decompress: "deny",
11947
+ search_context: "deny",
11948
+ acp_status: "deny",
11949
+ acp_context_recap: "deny"
11950
+ };
11951
+ return;
11952
+ }
11901
11953
  if (config.compress.permission !== "deny" && compressDisabledByOpencode(opencodeConfig.permission)) {
11902
11954
  config.compress.permission = "deny";
11903
11955
  }