opencode-acp 1.14.26-pr.358.92 → 1.14.26-pr.360.94

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/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.358.92" : "dev";
9376
+ var LOG_VERSION = true ? "1.14.26-pr.360.94" : "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.358.92" : "dev",
11817
+ version: true ? "1.14.26-pr.360.94" : "dev",
11823
11818
  workspace: ctx.directory,
11824
11819
  logLevel: logger.level,
11825
11820
  debug: config.debug,