blun-king-cli 9.1.83 → 9.1.84
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/LIESMICH.txt +8 -1
- package/README.md +7 -1
- package/bin/compaction-stage-policy.cjs +13 -0
- package/blun.mjs +8 -4
- package/package.json +1 -1
package/LIESMICH.txt
CHANGED
|
@@ -9,7 +9,7 @@ Installation
|
|
|
9
9
|
------------
|
|
10
10
|
Die geprüfte Version exakt global installieren:
|
|
11
11
|
|
|
12
|
-
npm install -g blun-king-cli@9.1.
|
|
12
|
+
npm install -g blun-king-cli@9.1.84
|
|
13
13
|
|
|
14
14
|
Start
|
|
15
15
|
-----
|
|
@@ -227,6 +227,13 @@ sodass auch kurze Schritte wie Rendern und Speichern in der Produktionskette
|
|
|
227
227
|
sichtbar sind. Aktualisierte Vorschaubilder werden erneuert; Medienpfade und
|
|
228
228
|
Webadressen sind als Terminalverweise anklickbar.
|
|
229
229
|
|
|
230
|
+
Gestufte Verdichtung für große Sitzungen
|
|
231
|
+
-----------------------------------------
|
|
232
|
+
|
|
233
|
+
Eine Vollverdichtung verwendet jetzt pro Zusammenfassungsstufe höchstens 64.000 geschätzte Eingabe-Token als Zielwert. Die feste Sicherheitsgrenze des aktiven Modells bleibt unverändert. King teilt den älteren Verlauf an gültigen Nachrichtengrenzen, fasst jeden chronologischen Abschnitt zusammen und übernimmt diese Zusammenfassung in die nächste Stufe. Dabei wird kein noch nicht zusammengefasster Verlauf verworfen. Ist eine einzelne unteilbare Nachricht größer als der Stufenzielwert, bleibt die bestehende feste Sicherheitsgrenze der Rückfallweg.
|
|
234
|
+
|
|
235
|
+
Beispiel: Ein auf 256.000 Token geschätzter Verdichtungsauftrag wird in mehreren kleineren Stufen verarbeitet, statt als eine einzige große Anbieteranfrage. Die genaue Stufenzahl hängt von den Nachrichtengrenzen und den erzeugten Zwischenzusammenfassungen ab. Der Protokolleintrag `compaction stage request` nennt `targetInputTokens`; das Telemetrieereignis `compaction_finished` nennt `stage_count`. Das private Verlaufsarchiv und der ursprüngliche Sitzungs-Wire bleiben vollständig.
|
|
236
|
+
|
|
230
237
|
Wiederauffindbarer Verdichtungsverlauf
|
|
231
238
|
--------------------------------------
|
|
232
239
|
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Voraussetzung ist Node.js 24.15 oder neuer. Die geprüfte Version wird exakt
|
|
|
9
9
|
installiert:
|
|
10
10
|
|
|
11
11
|
```powershell
|
|
12
|
-
npm install -g blun-king-cli@9.1.
|
|
12
|
+
npm install -g blun-king-cli@9.1.84
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Reproduzierbares Staging und Packen
|
|
@@ -255,6 +255,12 @@ sodass auch kurze Schritte wie Rendern und Speichern in der Produktionskette
|
|
|
255
255
|
sichtbar sind. Aktualisierte Vorschaubilder werden erneuert; Medienpfade und
|
|
256
256
|
Webadressen sind als Terminalverweise anklickbar.
|
|
257
257
|
|
|
258
|
+
## Gestufte Verdichtung für große Sitzungen
|
|
259
|
+
|
|
260
|
+
Eine Vollverdichtung verwendet jetzt pro Zusammenfassungsstufe höchstens 64.000 geschätzte Eingabe-Token als Zielwert. Die feste Sicherheitsgrenze des aktiven Modells bleibt unverändert. King teilt den älteren Verlauf an gültigen Nachrichtengrenzen, fasst jeden chronologischen Abschnitt zusammen und übernimmt diese Zusammenfassung in die nächste Stufe. Dabei wird kein noch nicht zusammengefasster Verlauf verworfen. Ist eine einzelne unteilbare Nachricht größer als der Stufenzielwert, bleibt die bestehende feste Sicherheitsgrenze der Rückfallweg.
|
|
261
|
+
|
|
262
|
+
Beispiel: Ein auf 256.000 Token geschätzter Verdichtungsauftrag wird in mehreren kleineren Stufen verarbeitet, statt als eine einzige große Anbieteranfrage. Die genaue Stufenzahl hängt von den Nachrichtengrenzen und den erzeugten Zwischenzusammenfassungen ab. Der Protokolleintrag `compaction stage request` nennt `targetInputTokens`; das Telemetrieereignis `compaction_finished` nennt `stage_count`. Das private Verlaufsarchiv und der ursprüngliche Sitzungs-Wire bleiben vollständig.
|
|
263
|
+
|
|
258
264
|
## Wiederauffindbarer Verdichtungsverlauf
|
|
259
265
|
|
|
260
266
|
Bevor eine erfolgreiche Vollverdichtung ältere Nachrichten ersetzt, schreibt King den verdrängten Verlauf in ein privates Markdown-Archiv unter `~/.blun/conversation-history/`. Die Verdichtungszusammenfassung enthält den genauen `history_path`, sodass der Agent mit `Read` Einzelheiten wiederfinden kann, die nicht in der Zusammenfassung stehen.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const DEFAULT_COMPACTION_STAGE_MAX_TOKENS = 64_000;
|
|
4
|
+
|
|
5
|
+
function capCompactionStageTarget(safeRequestLimitTokens) {
|
|
6
|
+
if (!Number.isFinite(safeRequestLimitTokens) || safeRequestLimitTokens <= 0) return 0;
|
|
7
|
+
return Math.min(Math.floor(safeRequestLimitTokens), DEFAULT_COMPACTION_STAGE_MAX_TOKENS);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
DEFAULT_COMPACTION_STAGE_MAX_TOKENS,
|
|
12
|
+
capCompactionStageTarget,
|
|
13
|
+
};
|
package/blun.mjs
CHANGED
|
@@ -75237,9 +75237,10 @@ function extractCompactionSummary(response) {
|
|
|
75237
75237
|
if (summary.trim().length === 0) throw new APIEmptyResponseError("The compaction response did not contain a non-empty summary.");
|
|
75238
75238
|
return summary;
|
|
75239
75239
|
}
|
|
75240
|
-
var archiveCompactionHistory, buildCompactionArchiveNotice, DEFAULT_COMPACTION_MAX_COMPLETION_TOKENS, COMPACTION_THINKING_EFFORT, 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;
|
|
75240
|
+
var archiveCompactionHistory, buildCompactionArchiveNotice, capCompactionStageTarget, DEFAULT_COMPACTION_MAX_COMPLETION_TOKENS, COMPACTION_THINKING_EFFORT, 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;
|
|
75241
75241
|
var init_full = __esmMin((() => {
|
|
75242
75242
|
({ archiveCompactionHistory, buildCompactionArchiveNotice } = createRequire(import.meta.url)("./bin/compaction-history-archive.cjs"));
|
|
75243
|
+
({ capCompactionStageTarget } = createRequire(import.meta.url)("./bin/compaction-stage-policy.cjs"));
|
|
75243
75244
|
init_errors$8();
|
|
75244
75245
|
init_src$4();
|
|
75245
75246
|
init_errors$4();
|
|
@@ -75578,14 +75579,15 @@ var init_full = __esmMin((() => {
|
|
|
75578
75579
|
while (true) {
|
|
75579
75580
|
const compactionRequestLimit = this.getEffectiveMaxContextTokens();
|
|
75580
75581
|
const safeCompactionRequestLimit = compactionRequestLimit > 0 ? Math.max(1, Math.floor(compactionRequestLimit * (1 - COMPACTION_SUMMARY_RESERVE_RATIO))) : compactionRequestLimit;
|
|
75582
|
+
const targetCompactionRequestLimit = capCompactionStageTarget(safeCompactionRequestLimit);
|
|
75581
75583
|
let messages = buildRequestMessages(historyForModel, instruction);
|
|
75582
75584
|
let estimatedCompactionRequestTokens = this.estimateRequestTokens(messages, this.agent.effectiveSystemPrompt, compactionTools);
|
|
75583
75585
|
initialCompactionRequestTokens ??= estimatedCompactionRequestTokens;
|
|
75584
75586
|
let hierarchicalChunkEnd;
|
|
75585
|
-
if (
|
|
75587
|
+
if (targetCompactionRequestLimit > 0 && estimatedCompactionRequestTokens >= targetCompactionRequestLimit) {
|
|
75586
75588
|
if (historyForModel.length > 1) {
|
|
75587
75589
|
const chunkInstruction = `${instruction}\n\nThis request contains only the oldest chronological segment. Summarize every fact needed by a later merge pass. Do not assume later messages are visible.`;
|
|
75588
|
-
const chunk = selectHierarchicalCompactionChunk(historyForModel,
|
|
75590
|
+
const chunk = selectHierarchicalCompactionChunk(historyForModel, targetCompactionRequestLimit, safeCompactionRequestLimit, (candidate) => {
|
|
75589
75591
|
const candidateMessages = buildRequestMessages(candidate, chunkInstruction);
|
|
75590
75592
|
return {
|
|
75591
75593
|
messages: candidateMessages,
|
|
@@ -75598,7 +75600,7 @@ var init_full = __esmMin((() => {
|
|
|
75598
75600
|
estimatedCompactionRequestTokens = chunk.estimatedTokens;
|
|
75599
75601
|
}
|
|
75600
75602
|
}
|
|
75601
|
-
if (hierarchicalChunkEnd === void 0) throw new BlunError(ErrorCodes.CONTEXT_OVERFLOW, `Compaction stopped before upload: the conversation (${String(tokensBefore)} tokens) could not be divided into a request below the active model window (${String(compactionRequestLimit)} tokens).`, { details: {
|
|
75603
|
+
if (hierarchicalChunkEnd === void 0 && estimatedCompactionRequestTokens >= safeCompactionRequestLimit) throw new BlunError(ErrorCodes.CONTEXT_OVERFLOW, `Compaction stopped before upload: the conversation (${String(tokensBefore)} tokens) could not be divided into a request below the active model window (${String(compactionRequestLimit)} tokens).`, { details: {
|
|
75602
75604
|
contextBrakeBlocked: true,
|
|
75603
75605
|
estimatedRequestTokens: estimatedCompactionRequestTokens,
|
|
75604
75606
|
maxContextTokens: compactionRequestLimit,
|
|
@@ -75623,6 +75625,7 @@ var init_full = __esmMin((() => {
|
|
|
75623
75625
|
activeContextTokens: this.estimateProjectedRequestTokens(),
|
|
75624
75626
|
estimatedInputTokens: estimatedCompactionRequestTokens,
|
|
75625
75627
|
windowUsagePercent,
|
|
75628
|
+
targetInputTokens: targetCompactionRequestLimit,
|
|
75626
75629
|
safeInputLimitTokens: safeCompactionRequestLimit,
|
|
75627
75630
|
maxContextTokens: compactionRequestLimit
|
|
75628
75631
|
});
|
|
@@ -75809,6 +75812,7 @@ var init_full = __esmMin((() => {
|
|
|
75809
75812
|
retry_count: retryCount,
|
|
75810
75813
|
round: 1,
|
|
75811
75814
|
thinking_effort: COMPACTION_THINKING_EFFORT,
|
|
75815
|
+
stage_count: hierarchicalPassCount + 1,
|
|
75812
75816
|
...usage === null ? {} : {
|
|
75813
75817
|
input_tokens: inputTotal(usage),
|
|
75814
75818
|
output_tokens: usage.output
|