acp-kernel 0.0.87-pr.393.249 → 0.0.88-pr.395.251
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/config.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/protected.d.ts +9 -4
- package/dist/protected.d.ts.map +1 -1
- package/dist/recommend.d.ts.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/config.d.ts.map
CHANGED
|
@@ -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,
|
|
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
|
@@ -443,6 +443,9 @@ function validateConfig(config) {
|
|
|
443
443
|
if (config.tiers.tier3Trigger <= config.tiers.tier2Trigger) {
|
|
444
444
|
errors.push("tiers.tier3Trigger must be greater than tiers.tier2Trigger");
|
|
445
445
|
}
|
|
446
|
+
if (config.neverPreserveRecentTools !== void 0 && (!Array.isArray(config.neverPreserveRecentTools) || config.neverPreserveRecentTools.some((t) => typeof t !== "string"))) {
|
|
447
|
+
errors.push("neverPreserveRecentTools must be a string array");
|
|
448
|
+
}
|
|
446
449
|
if (config.absorb) {
|
|
447
450
|
if (config.absorb.enabled && !config.absorb.toolName) {
|
|
448
451
|
errors.push("absorb.toolName must be a non-empty string when enabled");
|
|
@@ -1182,12 +1185,16 @@ var NEVER_PRESERVE_RECENT_TOOLS = [
|
|
|
1182
1185
|
"read",
|
|
1183
1186
|
"bash"
|
|
1184
1187
|
];
|
|
1185
|
-
function isNeverPreserveRecent(msg) {
|
|
1188
|
+
function isNeverPreserveRecent(msg, patterns) {
|
|
1186
1189
|
if (msg.contentType !== "tool-call" && msg.contentType !== "tool-result") {
|
|
1187
1190
|
return false;
|
|
1188
1191
|
}
|
|
1189
1192
|
if (!msg.toolName) return false;
|
|
1190
|
-
|
|
1193
|
+
const list = patterns === void 0 ? NEVER_PRESERVE_RECENT_TOOLS : patterns;
|
|
1194
|
+
for (const pattern of list) {
|
|
1195
|
+
if (matchToolPattern(msg.toolName, pattern)) return true;
|
|
1196
|
+
}
|
|
1197
|
+
return false;
|
|
1191
1198
|
}
|
|
1192
1199
|
function matchToolPattern(toolName, pattern) {
|
|
1193
1200
|
if (pattern.endsWith("*")) {
|
|
@@ -3968,7 +3975,7 @@ function computeProtectedRefs(messages, state, config, countTokens = estimateTex
|
|
|
3968
3975
|
const visible = [];
|
|
3969
3976
|
for (const msg of messages) {
|
|
3970
3977
|
if (isSyntheticOrPruned(msg, state)) continue;
|
|
3971
|
-
if (isNeverPreserveRecent(msg)) continue;
|
|
3978
|
+
if (isNeverPreserveRecent(msg, config.neverPreserveRecentTools)) continue;
|
|
3972
3979
|
const ref = state.messageRefs.byRaw[msg.id];
|
|
3973
3980
|
if (!ref || ref === "BLOCKED") continue;
|
|
3974
3981
|
visible.push({ ref, tokens: countMessageTokens(msg, countTokens) });
|