acp-kernel 0.0.92 → 0.0.93-pr.430.284

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,CAsJvD"}
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,CA6JvD"}
package/dist/index.js CHANGED
@@ -462,6 +462,9 @@ function validateConfig(config) {
462
462
  if (config.neverPreserveRecentTools !== void 0 && (!Array.isArray(config.neverPreserveRecentTools) || config.neverPreserveRecentTools.some((t) => typeof t !== "string"))) {
463
463
  errors.push("neverPreserveRecentTools must be a string array");
464
464
  }
465
+ if (config.preserveRecentTools !== void 0 && (!Array.isArray(config.preserveRecentTools) || config.preserveRecentTools.some((t) => typeof t !== "string"))) {
466
+ errors.push("preserveRecentTools must be a string array");
467
+ }
465
468
  if (config.absorb) {
466
469
  if (config.absorb.enabled && !config.absorb.toolName) {
467
470
  errors.push("absorb.toolName must be a non-empty string when enabled");
@@ -1194,12 +1197,13 @@ var NEVER_PRESERVE_RECENT_TOOLS = [
1194
1197
  "read",
1195
1198
  "bash"
1196
1199
  ];
1197
- function isNeverPreserveRecent(msg, patterns) {
1200
+ function isNeverPreserveRecent(msg, patterns, preservePatterns) {
1198
1201
  if (msg.contentType !== "tool-call" && msg.contentType !== "tool-result") {
1199
1202
  return false;
1200
1203
  }
1201
1204
  if (!msg.toolName) return false;
1202
- const list = patterns === void 0 ? NEVER_PRESERVE_RECENT_TOOLS : patterns;
1205
+ const base = patterns === void 0 ? NEVER_PRESERVE_RECENT_TOOLS : patterns;
1206
+ const list = preservePatterns === void 0 || preservePatterns.length === 0 ? base : base.filter((tool) => !preservePatterns.some((p) => matchToolPattern(tool, p)));
1203
1207
  for (const pattern of list) {
1204
1208
  if (matchToolPattern(msg.toolName, pattern)) return true;
1205
1209
  }
@@ -4219,7 +4223,7 @@ function computeProtectedRefs(messages, state, config, countTokens = estimateTex
4219
4223
  const visible = [];
4220
4224
  for (const msg of messages) {
4221
4225
  if (isSyntheticOrPruned(msg, state)) continue;
4222
- if (isNeverPreserveRecent(msg, config.neverPreserveRecentTools)) continue;
4226
+ if (isNeverPreserveRecent(msg, config.neverPreserveRecentTools, config.preserveRecentTools)) continue;
4223
4227
  const ref = state.messageRefs.byRaw[msg.id];
4224
4228
  if (!ref || ref === "BLOCKED") continue;
4225
4229
  visible.push({ ref, tokens: countMessageTokens(msg, countTokens) });