blun-king-cli 9.1.290 → 9.1.291
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/bin/abort-listener-policy.cjs +14 -0
- package/blun.mjs +5 -4
- package/package.json +3 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
async function waitForAbortableCompletion(signal, work, onAbort) {
|
|
4
|
+
const listenerRegistered = !signal.aborted;
|
|
5
|
+
if (listenerRegistered) signal.addEventListener('abort', onAbort, { once: true });
|
|
6
|
+
else onAbort();
|
|
7
|
+
try {
|
|
8
|
+
return await work;
|
|
9
|
+
} finally {
|
|
10
|
+
if (listenerRegistered) signal.removeEventListener('abort', onAbort);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = { waitForAbortableCompletion };
|
package/blun.mjs
CHANGED
|
@@ -75292,9 +75292,10 @@ function extractCompactionSummary(response) {
|
|
|
75292
75292
|
if (summary.trim().length === 0) throw new APIEmptyResponseError("The compaction response did not contain a non-empty summary.");
|
|
75293
75293
|
return summary;
|
|
75294
75294
|
}
|
|
75295
|
-
var archiveCompactionHistory, buildCompactionArchiveNotice, capCompactionCompletionTokens, capCompactionStageTarget, proactiveCompactionEligibility, COMPACTION_THINKING_EFFORT, COMPACTION_SYSTEM_PROMPT, COMPACTION_SUMMARY_RESERVE_RATIO, MAX_HIERARCHICAL_COMPACTION_PASSES, HIERARCHICAL_COMPACTION_PREFIX, CompactionTruncatedError, CompactionStallError, COMPACTION_STALL_MEASUREMENT_MULTIPLIER, REBUILT_AFTER_COMPACTION_INJECTION_VARIANTS, FullCompaction, MAX_COMPACTION_OVERFLOW_SHRINK_ATTEMPTS, COMPACTION_OVERFLOW_SHRINK_RATIOS;
|
|
75295
|
+
var archiveCompactionHistory, buildCompactionArchiveNotice, capCompactionCompletionTokens, capCompactionStageTarget, proactiveCompactionEligibility, waitForAbortableCompletion, COMPACTION_THINKING_EFFORT, COMPACTION_SYSTEM_PROMPT, COMPACTION_SUMMARY_RESERVE_RATIO, MAX_HIERARCHICAL_COMPACTION_PASSES, HIERARCHICAL_COMPACTION_PREFIX, CompactionTruncatedError, CompactionStallError, COMPACTION_STALL_MEASUREMENT_MULTIPLIER, REBUILT_AFTER_COMPACTION_INJECTION_VARIANTS, FullCompaction, MAX_COMPACTION_OVERFLOW_SHRINK_ATTEMPTS, COMPACTION_OVERFLOW_SHRINK_RATIOS;
|
|
75296
75296
|
var init_full = __esmMin((() => {
|
|
75297
75297
|
({ archiveCompactionHistory, buildCompactionArchiveNotice } = createRequire(import.meta.url)("./bin/compaction-history-archive.cjs"));
|
|
75298
|
+
({ waitForAbortableCompletion } = createRequire(import.meta.url)("./bin/abort-listener-policy.cjs"));
|
|
75298
75299
|
({ capCompactionCompletionTokens, capCompactionStageTarget } = createRequire(import.meta.url)("./bin/compaction-stage-policy.cjs"));
|
|
75299
75300
|
({ proactiveCompactionEligibility } = createRequire(import.meta.url)("./bin/proactive-compaction-policy.cjs"));
|
|
75300
75301
|
init_errors$8();
|
|
@@ -75556,14 +75557,14 @@ var init_full = __esmMin((() => {
|
|
|
75556
75557
|
const active = this.compacting;
|
|
75557
75558
|
if (active) {
|
|
75558
75559
|
active.blockedByTurn = true;
|
|
75559
|
-
|
|
75560
|
+
const onAbort = () => {
|
|
75560
75561
|
if (this.compacting === active) this.cancel();
|
|
75561
|
-
}
|
|
75562
|
+
};
|
|
75562
75563
|
this.agent.emitEvent({
|
|
75563
75564
|
type: "compaction.blocked",
|
|
75564
75565
|
turnId: this.agent.turn.currentId
|
|
75565
75566
|
});
|
|
75566
|
-
await active.promise;
|
|
75567
|
+
await waitForAbortableCompletion(signal, active.promise, onAbort);
|
|
75567
75568
|
}
|
|
75568
75569
|
}
|
|
75569
75570
|
async compactionWorker(signal, data) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blun-king-cli",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.291",
|
|
4
4
|
"description": "BLUN CLI - your own AI agent with a Telegram channel. Get it done. With BLUN.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -56,5 +56,6 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"blun-king-cli": "^9.1.62",
|
|
58
58
|
"node-addon-api": "^7.1.1"
|
|
59
|
-
}
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {}
|
|
60
61
|
}
|