blun-king-cli 9.1.617 → 9.1.619
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/CHANGELOG.md +113 -104
- package/LIESMICH.txt +56 -56
- package/README.md +89 -89
- package/blun.mjs +269 -226
- package/package.json +2 -2
- package/worker-host.mjs +35 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blun-king-cli",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.619",
|
|
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": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"optionalDependencies": {
|
|
28
28
|
"@mariozechner/clipboard": "^0.3.9",
|
|
29
|
-
"node-pty": "
|
|
29
|
+
"node-pty": "1.2.0-beta.15"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"quickjs-emscripten": "0.32.0"
|
package/worker-host.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// BLUN_BUILD_INPUT_SHA256:
|
|
2
|
+
// BLUN_BUILD_INPUT_SHA256:2b68008c167498735f1058c26d451ab91cc9a391df328f4c5ee215fd7a2da994
|
|
3
3
|
import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
|
|
4
4
|
import { dirname as __cjsShimDirname } from 'node:path';
|
|
5
5
|
const __filename = __cjsShimFileURLToPath(import.meta.url);
|
|
@@ -231152,7 +231152,7 @@ var FullCompaction = class {
|
|
|
231152
231152
|
}
|
|
231153
231153
|
restoreResumeState(state) {
|
|
231154
231154
|
if (!Number.isSafeInteger(state.sessionCompactionFailures) || state.sessionCompactionFailures < 0) throw new Error("Invalid session compaction failure count");
|
|
231155
|
-
this.sessionCompactionFailures =
|
|
231155
|
+
this.sessionCompactionFailures = state.sessionCompactionFailures;
|
|
231156
231156
|
}
|
|
231157
231157
|
async handleOverflowError(signal, error) {
|
|
231158
231158
|
this.consecutiveOverflowCompactions += 1;
|
|
@@ -231251,7 +231251,7 @@ var FullCompaction = class {
|
|
|
231251
231251
|
beginAutoCompaction(throwOnLimit = true) {
|
|
231252
231252
|
if (this.compacting) return true;
|
|
231253
231253
|
if (this.sessionCompactionFailures >= MAX_SESSION_COMPACTION_FAILURES) {
|
|
231254
|
-
if (throwOnLimit) throw this.sessionStoppedError(ErrorCodes.
|
|
231254
|
+
if (throwOnLimit) throw this.sessionStoppedError(ErrorCodes.COMPACTION_FAILED);
|
|
231255
231255
|
return false;
|
|
231256
231256
|
}
|
|
231257
231257
|
const maxCompactions = this.strategy.maxCompactionPerTurn;
|
|
@@ -231267,12 +231267,35 @@ var FullCompaction = class {
|
|
|
231267
231267
|
}
|
|
231268
231268
|
sessionStoppedError(code, cause) {
|
|
231269
231269
|
const action = "Start a fresh session after saving any pending work.";
|
|
231270
|
-
|
|
231270
|
+
let lastFailure;
|
|
231271
|
+
if (cause !== void 0) {
|
|
231272
|
+
const failure = toBlunErrorPayload(cause);
|
|
231273
|
+
lastFailure = { code: failure.code };
|
|
231274
|
+
for (const key of [
|
|
231275
|
+
"statusCode",
|
|
231276
|
+
"estimatedRequestTokens",
|
|
231277
|
+
"maxContextTokens",
|
|
231278
|
+
"requestBudgetTokens",
|
|
231279
|
+
"estimatedRequestBytes",
|
|
231280
|
+
"requestBudgetBytes",
|
|
231281
|
+
"summaryReserveTokens",
|
|
231282
|
+
"hierarchicalPassCount"
|
|
231283
|
+
]) {
|
|
231284
|
+
const value = failure.details?.[key];
|
|
231285
|
+
if (typeof value === "number" && Number.isFinite(value) && value >= 0) lastFailure[key] = value;
|
|
231286
|
+
}
|
|
231287
|
+
for (const key of ["contextBrakeBlocked", "contextUnchanged"]) {
|
|
231288
|
+
const value = failure.details?.[key];
|
|
231289
|
+
if (typeof value === "boolean") lastFailure[key] = value;
|
|
231290
|
+
}
|
|
231291
|
+
}
|
|
231292
|
+
return new BlunError(code, `Compaction paused after ${String(this.sessionCompactionFailures)} consecutive failed attempts. This does not mean the context window is full. ${action}`, {
|
|
231271
231293
|
cause: cause instanceof Error ? cause : void 0,
|
|
231272
231294
|
details: {
|
|
231273
231295
|
compactionSessionStopped: true,
|
|
231274
231296
|
failures: this.sessionCompactionFailures,
|
|
231275
|
-
action
|
|
231297
|
+
action,
|
|
231298
|
+
...lastFailure === void 0 ? {} : { lastFailure }
|
|
231276
231299
|
}
|
|
231277
231300
|
});
|
|
231278
231301
|
}
|
|
@@ -231307,6 +231330,13 @@ var FullCompaction = class {
|
|
|
231307
231330
|
modelAlias: this.agent.activeResponderModel ?? this.agent.config.modelAlias,
|
|
231308
231331
|
maxContextTokens: this.getEffectiveMaxContextTokens()
|
|
231309
231332
|
};
|
|
231333
|
+
if (this.sessionCompactionFailures > 0) {
|
|
231334
|
+
this.sessionCompactionFailures = 0;
|
|
231335
|
+
this.agent.records.logRecord({
|
|
231336
|
+
type: "full_compaction.session_failures",
|
|
231337
|
+
count: 0
|
|
231338
|
+
});
|
|
231339
|
+
}
|
|
231310
231340
|
this.markCompleted();
|
|
231311
231341
|
const { contextSummary: _contextSummary, ...eventResult } = result;
|
|
231312
231342
|
const projectedContextTokens = this.estimateCurrentRequestTokens();
|