opencode-acp 1.14.21 → 1.14.22

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
@@ -4523,6 +4523,9 @@ function formatProgressBar(messageIds, prunedMessages, recentMessageIds, width =
4523
4523
  return `\u2502${bar.join("")}\u2502`;
4524
4524
  }
4525
4525
  function cacheSystemPromptTokens(state, messages) {
4526
+ if (state.systemPromptTokens !== void 0 && state.systemPromptTokens > 0) {
4527
+ return;
4528
+ }
4526
4529
  let firstInputTokens = 0;
4527
4530
  for (const msg of messages) {
4528
4531
  if (msg.info.role !== "assistant") {
@@ -7165,7 +7168,7 @@ function estimateContextComposition(messages, state, protectedTools = [], protec
7165
7168
  perCode.sort((a, b) => b.tokens - a.tokens);
7166
7169
  perText.sort((a, b) => b.tokens - a.tokens);
7167
7170
  const toolTypeBreakdown = Array.from(toolTypeMap.entries()).map(([tool6, tokens]) => ({ tool: tool6, tokens })).sort((a, b) => b.tokens - a.tokens);
7168
- const systemTokens = estimateSystemPromptTokens(messages);
7171
+ const systemTokens = state?.systemPromptTokens !== void 0 && state.systemPromptTokens > 0 ? state.systemPromptTokens : estimateSystemPromptTokens(messages);
7169
7172
  return {
7170
7173
  toolTokens,
7171
7174
  codeTokens,
@@ -8609,7 +8612,11 @@ function collectVisibleMessages(rawMessages, ctx) {
8609
8612
  result.push({ ref, tokens, tool: toolName || "text", index: idx });
8610
8613
  }
8611
8614
  });
8612
- return { messages: result, summaryTokens, systemTokens: estimateSystemPromptTokens(rawMessages) };
8615
+ return {
8616
+ messages: result,
8617
+ summaryTokens,
8618
+ systemTokens: ctx.state.systemPromptTokens !== void 0 && ctx.state.systemPromptTokens > 0 ? ctx.state.systemPromptTokens : estimateSystemPromptTokens(rawMessages)
8619
+ };
8613
8620
  }
8614
8621
  function renderOverview(visibleMessages, summaryTokens, systemTokens, blocks, fetchFailed, rawMessages, ctx) {
8615
8622
  const lines = [];
@@ -9025,7 +9032,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
9025
9032
  import { join as join3 } from "path";
9026
9033
  import { existsSync as existsSync3 } from "fs";
9027
9034
  import { homedir as homedir3 } from "os";
9028
- var LOG_VERSION = true ? "1.14.21" : "dev";
9035
+ var LOG_VERSION = true ? "1.14.22" : "dev";
9029
9036
  var Logger = class {
9030
9037
  logDir;
9031
9038
  enabled;