opencode-acp 1.14.27-pr.361.97 → 1.14.27-pr.365.100

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
@@ -2092,6 +2092,56 @@ var messageHasCompressAttempt = (message) => {
2092
2092
  const parts = Array.isArray(message.parts) ? message.parts : [];
2093
2093
  return parts.some((part) => part.type === "tool" && part.tool === "compress");
2094
2094
  };
2095
+ var isCaptureOnlyCompress = (message) => {
2096
+ if (!isMessageWithInfo(message)) {
2097
+ return false;
2098
+ }
2099
+ if (message.info.role !== "assistant") {
2100
+ return false;
2101
+ }
2102
+ const parts = Array.isArray(message.parts) ? message.parts : [];
2103
+ let sawBoundary = false;
2104
+ for (const part of parts) {
2105
+ if (!(part.type === "tool" && part.tool === "compress")) {
2106
+ continue;
2107
+ }
2108
+ for (const startId of extractCompressBoundaryIds(part.state?.input)) {
2109
+ sawBoundary = true;
2110
+ if (/^b\d+$/i.test(startId)) {
2111
+ return false;
2112
+ }
2113
+ }
2114
+ }
2115
+ return sawBoundary;
2116
+ };
2117
+ function extractCompressBoundaryIds(rawInput) {
2118
+ let content = [];
2119
+ if (typeof rawInput === "string") {
2120
+ try {
2121
+ const parsed = JSON.parse(rawInput);
2122
+ const c = parsed?.content;
2123
+ content = Array.isArray(c) ? c : [];
2124
+ } catch {
2125
+ return [];
2126
+ }
2127
+ } else if (rawInput && typeof rawInput === "object") {
2128
+ const c = rawInput.content;
2129
+ content = Array.isArray(c) ? c : [];
2130
+ }
2131
+ const ids = [];
2132
+ for (const entry of content) {
2133
+ if (!entry || typeof entry !== "object") {
2134
+ continue;
2135
+ }
2136
+ const { startId, endId } = entry;
2137
+ for (const sid of [startId, endId]) {
2138
+ if (typeof sid === "string" && sid.trim() !== "") {
2139
+ ids.push(sid.trim());
2140
+ }
2141
+ }
2142
+ }
2143
+ return ids;
2144
+ }
2095
2145
  var isIgnoredUserMessage = (message) => {
2096
2146
  if (!isMessageWithInfo(message)) {
2097
2147
  return false;
@@ -7781,8 +7831,11 @@ var injectCompressNudges = (state, config, logger, messages, prompts, compressio
7781
7831
  state.nudges.iterationNudgeAnchors.clear();
7782
7832
  state.nudges.lastNudgeShownTokens = void 0;
7783
7833
  state.nudges.lastToolOutputNudgeTokens = void 0;
7784
- state.nudges.lastTier2NudgeTokens = currentTokens;
7785
- state.nudges.lastTier3NudgeTokens = currentTokens;
7834
+ const captureOnly = isCaptureOnlyCompress(lastCompressMsg);
7835
+ if (!captureOnly) {
7836
+ state.nudges.lastTier2NudgeTokens = currentTokens;
7837
+ state.nudges.lastTier3NudgeTokens = currentTokens;
7838
+ }
7786
7839
  const currentTurnHasSuccessfulCompress = messages.slice(currentTurnStart).some((m) => m.info.role === "assistant" && messageHasCompress(m));
7787
7840
  if (currentTurnHasSuccessfulCompress && wasNudgeTriggered && !state.nudges.compressBaselineSet) {
7788
7841
  const baseline = state.nudges.lastPerMessageNudgeTokens;
@@ -9378,7 +9431,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
9378
9431
  import { join as join3 } from "path";
9379
9432
  import { existsSync as existsSync3 } from "fs";
9380
9433
  import { homedir as homedir3 } from "os";
9381
- var LOG_VERSION = true ? "1.14.27-pr.361.97" : "dev";
9434
+ var LOG_VERSION = true ? "1.14.27-pr.365.100" : "dev";
9382
9435
  var LEVEL_RANK = {
9383
9436
  debug: 10,
9384
9437
  info: 20,
@@ -11851,7 +11904,7 @@ var server = (async (ctx) => {
11851
11904
  }
11852
11905
  const logger = new Logger(config.debug, config.debug ? "debug" : config.logLevel);
11853
11906
  logger.info("ACP plugin initialized", {
11854
- version: true ? "1.14.27-pr.361.97" : "dev",
11907
+ version: true ? "1.14.27-pr.365.100" : "dev",
11855
11908
  workspace: ctx.directory,
11856
11909
  logLevel: logger.level,
11857
11910
  debug: config.debug,