acp-kernel 0.0.91 → 0.0.92-pr.427.278

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.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,wBAAgB,aAAa,CAC3B,iBAAiB,EAAE,MAAM,EACzB,SAAS,GAAE,OAAO,CAAC,MAAM,CAAM,GAC9B,MAAM,CAyER;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CA+IvD"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,wBAAgB,aAAa,CAC3B,iBAAiB,EAAE,MAAM,EACzB,SAAS,GAAE,OAAO,CAAC,MAAM,CAAM,GAC9B,MAAM,CAyER;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAsJvD"}
package/dist/index.js CHANGED
@@ -459,6 +459,9 @@ function validateConfig(config) {
459
459
  if (config.tiers.tier3Trigger <= config.tiers.tier2Trigger) {
460
460
  errors.push("tiers.tier3Trigger must be greater than tiers.tier2Trigger");
461
461
  }
462
+ if (config.neverPreserveRecentTools !== void 0 && (!Array.isArray(config.neverPreserveRecentTools) || config.neverPreserveRecentTools.some((t) => typeof t !== "string"))) {
463
+ errors.push("neverPreserveRecentTools must be a string array");
464
+ }
462
465
  if (config.absorb) {
463
466
  if (config.absorb.enabled && !config.absorb.toolName) {
464
467
  errors.push("absorb.toolName must be a non-empty string when enabled");
@@ -1191,12 +1194,16 @@ var NEVER_PRESERVE_RECENT_TOOLS = [
1191
1194
  "read",
1192
1195
  "bash"
1193
1196
  ];
1194
- function isNeverPreserveRecent(msg) {
1197
+ function isNeverPreserveRecent(msg, patterns) {
1195
1198
  if (msg.contentType !== "tool-call" && msg.contentType !== "tool-result") {
1196
1199
  return false;
1197
1200
  }
1198
1201
  if (!msg.toolName) return false;
1199
- return NEVER_PRESERVE_RECENT_TOOLS.includes(msg.toolName);
1202
+ const list = patterns === void 0 ? NEVER_PRESERVE_RECENT_TOOLS : patterns;
1203
+ for (const pattern of list) {
1204
+ if (matchToolPattern(msg.toolName, pattern)) return true;
1205
+ }
1206
+ return false;
1200
1207
  }
1201
1208
  function matchToolPattern(toolName, pattern) {
1202
1209
  if (pattern.endsWith("*")) {
@@ -4212,7 +4219,7 @@ function computeProtectedRefs(messages, state, config, countTokens = estimateTex
4212
4219
  const visible = [];
4213
4220
  for (const msg of messages) {
4214
4221
  if (isSyntheticOrPruned(msg, state)) continue;
4215
- if (isNeverPreserveRecent(msg)) continue;
4222
+ if (isNeverPreserveRecent(msg, config.neverPreserveRecentTools)) continue;
4216
4223
  const ref = state.messageRefs.byRaw[msg.id];
4217
4224
  if (!ref || ref === "BLOCKED") continue;
4218
4225
  visible.push({ ref, tokens: countMessageTokens(msg, countTokens) });