blun-king-cli 9.1.645 → 9.1.647
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 +19 -0
- package/LIESMICH.txt +12 -15
- package/README.md +12 -15
- package/RELEASE-9.1.646.md +30 -0
- package/RELEASE-9.1.647.md +26 -0
- package/blun.mjs +191 -47
- package/package.json +4 -2
- package/worker-host.mjs +2 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Versionsverlauf
|
|
2
2
|
|
|
3
|
+
## 9.1.647 — 19.11.2026
|
|
4
|
+
|
|
5
|
+
- Optionale Verdichtung bei 75 Prozent der lokalen Byte-Grenze entfernt; Anfragen unterhalb der festen Grenze können weiterhin gesendet werden.
|
|
6
|
+
- Feste UTF-8-Byte-Prüfung, niedrigere konfigurierte und gelernte Grenzen sowie die Token-Schwelle bleiben erhalten.
|
|
7
|
+
- Datenfluss: Eine gültige Anfrage kann mehr vom bestehenden Gespräch am eingerichteten Modell-Endpunkt enthalten; es wird kein neuer externer Empfänger ergänzt.
|
|
8
|
+
- Zustellung während der Verdichtung und vollständig scrollbarer Originalverlauf bleiben offene Aufgaben.
|
|
9
|
+
|
|
10
|
+
[Versionshinweise und Installation](RELEASE-9.1.647.md).
|
|
11
|
+
|
|
12
|
+
## 9.1.646 — 19.11.2026
|
|
13
|
+
|
|
14
|
+
- Bereits erlaubte Eingaben aus der Warteschlange und Strg+S nutzen denselben Zustellweg in die laufende Gesprächsrunde. Reihenfolge und Belege für die Übernahme bleiben erhalten.
|
|
15
|
+
- Bestätigt abgewiesene Versuche können wiederholt werden. Unklare Versuche behalten für den Abgleich ihre Anfragekennung und ihren Inhalt.
|
|
16
|
+
- Bei gemischten Chat- und Konsoleneingaben sind ausdrückliche Antwortempfänger erforderlich. Automatische Text- und Medienweiterleitung wird abgeschaltet; die Regeln bleiben bei der Wiederaufnahme erhalten.
|
|
17
|
+
- Datenfluss: Es wird kein neuer externer Empfänger eingerichtet. Die Regeln für Antwortempfänger werden im Format 3 in vorhandenen lokalen Sitzungsmetadaten gespeichert. Ältere Versionen verweigern die automatische Zustellung dieser Einträge.
|
|
18
|
+
- Die Übernahme innerhalb von 60 Sekunden ist im laufenden Betrieb noch nicht nachgewiesen; der vollständig scrollbare Originalverlauf bleibt offen.
|
|
19
|
+
|
|
20
|
+
[Versionshinweise und Installation](RELEASE-9.1.646.md).
|
|
21
|
+
|
|
3
22
|
## 9.1.645 — 19.11.2026
|
|
4
23
|
|
|
5
24
|
- ReadMediaFile steht auch für Textmodelle bereit, wenn ein separater Bildleser eingerichtet ist, und wird direkt im Grundwerkzeugsatz angeboten.
|
package/LIESMICH.txt
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
# blun-king-cli 9.1.
|
|
1
|
+
# blun-king-cli 9.1.647
|
|
2
2
|
|
|
3
|
-
## Installieren
|
|
3
|
+
## Installieren und fortsetzen
|
|
4
4
|
|
|
5
5
|
```powershell
|
|
6
|
-
npm install -g blun-king-cli@9.1.
|
|
7
|
-
king --version
|
|
6
|
+
npm install -g blun-king-cli@9.1.647
|
|
8
7
|
king -c
|
|
9
8
|
```
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
Starte die Konsole nach der Installation selbst neu, damit sie die neue Version lädt. Die eingerichtete Telegram-Verbindung bleibt erhalten.
|
|
12
11
|
|
|
13
|
-
[
|
|
12
|
+
[Genau dieses Paket herunterladen](https://registry.npmjs.org/blun-king-cli/-/blun-king-cli-9.1.647.tgz).
|
|
14
13
|
|
|
15
|
-
##
|
|
14
|
+
## Wann verdichtet wird
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
Die Konsole startet keine optionale Verdichtung mehr allein deshalb, weil eine Anfrage 75 Prozent der lokalen Byte-Grenze erreicht. Anfragen unterhalb dieser Grenze können weiterhin gesendet werden. Damit entfällt eine Ursache für vorzeitige Verdichtung; Verdichtung bleibt möglich.
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
Die vorhandene UTF-8-Größenprüfung greift weiterhin an der festen Byte-Grenze. Niedrigere konfigurierte Grenzen und aus Serverfehlern gelernte Grenzen bleiben wirksam. Die eingestellte Token-Schwelle bleibt unverändert. Eine Byte-Grenze kann weiterhin eine Verdichtung erforderlich machen, bevor diese Token-Schwelle erreicht ist.
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
## Daten und Berechtigungen
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
Eine Anfrage unterhalb der Byte-Grenze kann jetzt mehr vom bestehenden Gespräch enthalten, statt vorher verdichtet zu werden. Sie geht an den bereits eingerichteten Modell-Endpunkt. Es wird kein neuer externer Empfänger ergänzt. Berechtigungsregeln und die Zuordnung von Telegram-Antworten bleiben unverändert.
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
## Grenzen
|
|
26
25
|
|
|
27
|
-
Die
|
|
28
|
-
|
|
29
|
-
Frühere Änderungen und den Versionsnachweis enthält [CHANGELOG.md](CHANGELOG.md).
|
|
26
|
+
Die tatsächlich wirksame Byte-Grenze des Servers ist noch nicht unabhängig geprüft. Diese Reparatur erhöht den vorhandenen lokalen Ersatzwert nicht und verspricht nicht, dass jede Sitzung vor der Verdichtung 250.000 Tokens erreicht. Die Zustellung während der Verdichtung und der vollständig scrollbare Originalverlauf bleiben offene Aufgaben. Die Reparaturen für Eingabezustellung und Bildleser aus 9.1.646 bleiben enthalten.
|
package/README.md
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
# blun-king-cli 9.1.
|
|
1
|
+
# blun-king-cli 9.1.647
|
|
2
2
|
|
|
3
|
-
## Installieren
|
|
3
|
+
## Installieren und fortsetzen
|
|
4
4
|
|
|
5
5
|
```powershell
|
|
6
|
-
npm install -g blun-king-cli@9.1.
|
|
7
|
-
king --version
|
|
6
|
+
npm install -g blun-king-cli@9.1.647
|
|
8
7
|
king -c
|
|
9
8
|
```
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
Starte die Konsole nach der Installation selbst neu, damit sie die neue Version lädt. Die eingerichtete Telegram-Verbindung bleibt erhalten.
|
|
12
11
|
|
|
13
|
-
[
|
|
12
|
+
[Genau dieses Paket herunterladen](https://registry.npmjs.org/blun-king-cli/-/blun-king-cli-9.1.647.tgz).
|
|
14
13
|
|
|
15
|
-
##
|
|
14
|
+
## Wann verdichtet wird
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
Die Konsole startet keine optionale Verdichtung mehr allein deshalb, weil eine Anfrage 75 Prozent der lokalen Byte-Grenze erreicht. Anfragen unterhalb dieser Grenze können weiterhin gesendet werden. Damit entfällt eine Ursache für vorzeitige Verdichtung; Verdichtung bleibt möglich.
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
Die vorhandene UTF-8-Größenprüfung greift weiterhin an der festen Byte-Grenze. Niedrigere konfigurierte Grenzen und aus Serverfehlern gelernte Grenzen bleiben wirksam. Die eingestellte Token-Schwelle bleibt unverändert. Eine Byte-Grenze kann weiterhin eine Verdichtung erforderlich machen, bevor diese Token-Schwelle erreicht ist.
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
## Daten und Berechtigungen
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
Eine Anfrage unterhalb der Byte-Grenze kann jetzt mehr vom bestehenden Gespräch enthalten, statt vorher verdichtet zu werden. Sie geht an den bereits eingerichteten Modell-Endpunkt. Es wird kein neuer externer Empfänger ergänzt. Berechtigungsregeln und die Zuordnung von Telegram-Antworten bleiben unverändert.
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
## Grenzen
|
|
26
25
|
|
|
27
|
-
Die
|
|
28
|
-
|
|
29
|
-
Frühere Änderungen und den Versionsnachweis enthält [CHANGELOG.md](CHANGELOG.md).
|
|
26
|
+
Die tatsächlich wirksame Byte-Grenze des Servers ist noch nicht unabhängig geprüft. Diese Reparatur erhöht den vorhandenen lokalen Ersatzwert nicht und verspricht nicht, dass jede Sitzung vor der Verdichtung 250.000 Tokens erreicht. Die Zustellung während der Verdichtung und der vollständig scrollbare Originalverlauf bleiben offene Aufgaben. Die Reparaturen für Eingabezustellung und Bildleser aus 9.1.646 bleiben enthalten.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# blun-king-cli 9.1.646
|
|
2
|
+
|
|
3
|
+
## Installieren und fortsetzen
|
|
4
|
+
|
|
5
|
+
```powershell
|
|
6
|
+
npm install -g blun-king-cli@9.1.646
|
|
7
|
+
king -c
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Starte die Konsole nach der Installation selbst neu, damit sie die neue Version lädt. Die eingerichtete Telegram-Verbindung bleibt erhalten.
|
|
11
|
+
|
|
12
|
+
[Genau dieses Paket herunterladen](https://registry.npmjs.org/blun-king-cli/-/blun-king-cli-9.1.646.tgz).
|
|
13
|
+
|
|
14
|
+
## Eingaben während laufender Arbeit
|
|
15
|
+
|
|
16
|
+
Bereits erlaubte Telegram-Nachrichten und normale Konsoleneingaben nutzen denselben Zustellweg in die laufende Gesprächsrunde. Auch Strg+S nutzt diesen Weg. Ein im Vordergrund laufender Unteragent kann die Kontrolle an den Hauptagenten abgeben, ohne beendet zu werden.
|
|
17
|
+
|
|
18
|
+
Ein abgewiesener Erstversuch blockiert weitere Versuche nicht mehr bis zum Ende der Gesprächsrunde. Unklare Zustellversuche werden mit ihrer bestehenden Anfragekennung und ihrem bestehenden Inhalt abgeglichen. Der Nachrichteneingang wird erst bestätigt, wenn ein Beleg die Übernahme in den Modellkontext nachweist.
|
|
19
|
+
|
|
20
|
+
Wenn Eingaben aus verschiedenen Chats oder der Konsole in einer Gesprächsrunde zusammenkommen, wird die automatische Weiterleitung von Text und Medien für diese Runde abgeschaltet. Telegram-Antworten müssen das ausdrückliche Antwortwerkzeug und die ursprüngliche Chat-ID nutzen.
|
|
21
|
+
|
|
22
|
+
## Daten und Berechtigungen
|
|
23
|
+
|
|
24
|
+
Zugriffs- und Erwähnungsregeln, ein ausdrücklicher Stopp, Berechtigungsabfragen, Slash-Befehle und die Behandlung interaktiver Shells bleiben wirksam. Es wird kein neuer externer Empfänger eingerichtet. Die Regeln für Antwortempfänger werden in den vorhandenen lokalen Sitzungsmetadaten gespeichert.
|
|
25
|
+
|
|
26
|
+
Das lokale Journal für Zielantworten nutzt jetzt Format 3. Ältere Versionen verweigern die automatische Zustellung dieser Einträge, damit deren Regeln für Antwortempfänger nicht übergangen werden.
|
|
27
|
+
|
|
28
|
+
## Grenzen
|
|
29
|
+
|
|
30
|
+
Eine Übernahme innerhalb von 60 Sekunden ist im laufenden Betrieb noch nicht nachgewiesen. Verdichtung, fehlende Verbindungen und vorhandene Zustellsperren können die Übernahme verzögern. Der vollständig scrollbare Originalverlauf bleibt eine eigene offene Aufgabe. Die Reparatur von ReadMediaFile aus 9.1.645 ist enthalten.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# blun-king-cli 9.1.647
|
|
2
|
+
|
|
3
|
+
## Installieren und fortsetzen
|
|
4
|
+
|
|
5
|
+
```powershell
|
|
6
|
+
npm install -g blun-king-cli@9.1.647
|
|
7
|
+
king -c
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Starte die Konsole nach der Installation selbst neu, damit sie die neue Version lädt. Die eingerichtete Telegram-Verbindung bleibt erhalten.
|
|
11
|
+
|
|
12
|
+
[Genau dieses Paket herunterladen](https://registry.npmjs.org/blun-king-cli/-/blun-king-cli-9.1.647.tgz).
|
|
13
|
+
|
|
14
|
+
## Wann verdichtet wird
|
|
15
|
+
|
|
16
|
+
Die Konsole startet keine optionale Verdichtung mehr allein deshalb, weil eine Anfrage 75 Prozent der lokalen Byte-Grenze erreicht. Anfragen unterhalb dieser Grenze können weiterhin gesendet werden. Damit entfällt eine Ursache für vorzeitige Verdichtung; Verdichtung bleibt möglich.
|
|
17
|
+
|
|
18
|
+
Die vorhandene UTF-8-Größenprüfung greift weiterhin an der festen Byte-Grenze. Niedrigere konfigurierte Grenzen und aus Serverfehlern gelernte Grenzen bleiben wirksam. Die eingestellte Token-Schwelle bleibt unverändert. Eine Byte-Grenze kann weiterhin eine Verdichtung erforderlich machen, bevor diese Token-Schwelle erreicht ist.
|
|
19
|
+
|
|
20
|
+
## Daten und Berechtigungen
|
|
21
|
+
|
|
22
|
+
Eine Anfrage unterhalb der Byte-Grenze kann jetzt mehr vom bestehenden Gespräch enthalten, statt vorher verdichtet zu werden. Sie geht an den bereits eingerichteten Modell-Endpunkt. Es wird kein neuer externer Empfänger ergänzt. Berechtigungsregeln und die Zuordnung von Telegram-Antworten bleiben unverändert.
|
|
23
|
+
|
|
24
|
+
## Grenzen
|
|
25
|
+
|
|
26
|
+
Die tatsächlich wirksame Byte-Grenze des Servers ist noch nicht unabhängig geprüft. Diese Reparatur erhöht den vorhandenen lokalen Ersatzwert nicht und verspricht nicht, dass jede Sitzung vor der Verdichtung 250.000 Tokens erreicht. Die Zustellung während der Verdichtung und der vollständig scrollbare Originalverlauf bleiben offene Aufgaben. Die Reparaturen für Eingabezustellung und Bildleser aus 9.1.646 bleiben enthalten.
|
package/blun.mjs
CHANGED
|
@@ -230005,23 +230005,9 @@ var init_full = __esmMin((() => {
|
|
|
230005
230005
|
if (this.requiresShrinkableHistory && !this.hasShrinkableHistory(messages)) return false;
|
|
230006
230006
|
return this.beginAutoCompaction(throwOnLimit);
|
|
230007
230007
|
}
|
|
230008
|
-
shouldCompactRequestBody(
|
|
230009
|
-
|
|
230010
|
-
return true;
|
|
230011
|
-
const attempts = this.t3458PressureAttempts ??= new Map();
|
|
230012
|
-
const key = endpoint + "\0" + String(limit);
|
|
230013
|
-
if (bytes < limit * 0.75) {
|
|
230014
|
-
attempts.delete(key);
|
|
230015
|
-
return false;
|
|
230008
|
+
shouldCompactRequestBody(_endpoint, bytes, limit) {
|
|
230009
|
+
return bytes >= limit;
|
|
230016
230010
|
}
|
|
230017
|
-
if (this.isSessionCompactionStopped || !this.hasShrinkableHistory(this.agent.context.history))
|
|
230018
|
-
return false;
|
|
230019
|
-
const previous = attempts.get(key);
|
|
230020
|
-
if (previous !== undefined && bytes < previous + Math.ceil(previous / 10))
|
|
230021
|
-
return false;
|
|
230022
|
-
attempts.set(key, bytes);
|
|
230023
|
-
return true;
|
|
230024
|
-
}
|
|
230025
230011
|
hasShrinkableHistory(messages) {
|
|
230026
230012
|
if (messages.some((message) => message.role === "tool" || message.role === "assistant" && ((message.toolCalls?.length ?? 0) > 0 || message.content.some(part => part.type !== "text" || part.text.trim().length > 0))))
|
|
230027
230013
|
return true;
|
|
@@ -531387,8 +531373,25 @@ pumpDelivery() {
|
|
|
531387
531373
|
};
|
|
531388
531374
|
}));
|
|
531389
531375
|
var REMOTE_COMMANDS, REMOTE_COMMAND_LIST;
|
|
531376
|
+
function activeInputRoutingHint(input) {
|
|
531377
|
+
const text = 'Multiple input sources share this turn. Reply to each Telegram message using ' +
|
|
531378
|
+
'the explicit Telegram reply tool and the chat_id in that message. Keep each reply in its ' +
|
|
531379
|
+
'original chat. Console input does not require a Telegram reply unless requested.';
|
|
531380
|
+
return typeof input === 'string' ? `${text}\n\n${input}` : [{ type: 'text', text }, ...input];
|
|
531381
|
+
}
|
|
531382
|
+
function activeInputReceiptSender(session, canSubmit) {
|
|
531383
|
+
return {
|
|
531384
|
+
getPromptAdmissionScope: session.getPromptAdmissionScope?.bind(session),
|
|
531385
|
+
getSteerAdmissionReceipt: session.getSteerAdmissionReceipt?.bind(session),
|
|
531386
|
+
steerActiveWithReceipt: typeof session.steerActiveWithReceipt !== 'function' ? undefined : (...args) => {
|
|
531387
|
+
if (!canSubmit()) throw new Error('PROMPT_ADMISSION_CLOSED');
|
|
531388
|
+
return session.steerActiveWithReceipt(...args);
|
|
531389
|
+
},
|
|
531390
|
+
};
|
|
531391
|
+
}
|
|
531390
531392
|
var init_active_input_delivery = __esmMin((() => {
|
|
531391
531393
|
ActiveInputDelivery = class {
|
|
531394
|
+
retryTimer;
|
|
531392
531395
|
host;
|
|
531393
531396
|
attempts = /* @__PURE__ */ new Map();
|
|
531394
531397
|
pumping = false;
|
|
@@ -531400,12 +531403,20 @@ var init_active_input_delivery = __esmMin((() => {
|
|
|
531400
531403
|
has(item) {
|
|
531401
531404
|
return item !== void 0 && this.attempts.has(item);
|
|
531402
531405
|
}
|
|
531406
|
+
deferRetry() {
|
|
531407
|
+
if (this.ended) { this.host.retry(); return; }
|
|
531408
|
+
clearTimeout(this.retryTimer);
|
|
531409
|
+
this.retryTimer = setTimeout(() => { this.retryTimer = void 0; this.host.retry(); }, 1000);
|
|
531410
|
+
this.retryTimer.unref?.();
|
|
531411
|
+
}
|
|
531403
531412
|
endTurn() {
|
|
531413
|
+
clearTimeout(this.retryTimer);
|
|
531404
531414
|
this.ended = true;
|
|
531405
531415
|
for (const [item, attempt] of this.attempts) if (attempt.terminal) this.attempts.delete(item);
|
|
531406
531416
|
this.host.retry();
|
|
531407
531417
|
}
|
|
531408
531418
|
cancel() {
|
|
531419
|
+
clearTimeout(this.retryTimer);
|
|
531409
531420
|
for (const attempt of this.attempts.values()) attempt.abort.abort();
|
|
531410
531421
|
this.attempts.clear();
|
|
531411
531422
|
}
|
|
@@ -531444,6 +531455,11 @@ var init_active_input_delivery = __esmMin((() => {
|
|
|
531444
531455
|
}).then((disposition) => {
|
|
531445
531456
|
if (attempt.abort.signal.aborted || this.attempts.get(item) !== attempt) return;
|
|
531446
531457
|
attempt.terminal = true;
|
|
531458
|
+
if (disposition === "rejected" && !attempt.accepted) {
|
|
531459
|
+
this.attempts.delete(item);
|
|
531460
|
+
this.deferRetry();
|
|
531461
|
+
return;
|
|
531462
|
+
}
|
|
531447
531463
|
if (disposition === "context") {
|
|
531448
531464
|
this.attempts.delete(item);
|
|
531449
531465
|
this.host.commit(item);
|
|
@@ -531453,7 +531469,13 @@ var init_active_input_delivery = __esmMin((() => {
|
|
|
531453
531469
|
this.host.retry();
|
|
531454
531470
|
}
|
|
531455
531471
|
}).catch((error) => {
|
|
531456
|
-
if (!attempt.abort.signal.aborted)
|
|
531472
|
+
if (!attempt.abort.signal.aborted) {
|
|
531473
|
+
if (this.attempts.get(item) === attempt) {
|
|
531474
|
+
this.attempts.delete(item);
|
|
531475
|
+
this.deferRetry();
|
|
531476
|
+
}
|
|
531477
|
+
this.host.error(error);
|
|
531478
|
+
}
|
|
531457
531479
|
}).finally(admitted);
|
|
531458
531480
|
await acceptance;
|
|
531459
531481
|
if (attempt.abort.signal.aborted || !attempt.accepted) return;
|
|
@@ -531618,6 +531640,7 @@ function messageText(value) {
|
|
|
531618
531640
|
return value.filter((part) => object(part) && part["type"] === "text" && typeof part["text"] === "string").map((part) => part.text).join("");
|
|
531619
531641
|
}
|
|
531620
531642
|
function decodeReply(value, sessionId) {
|
|
531643
|
+
if (value?.autoReplySuppressed !== void 0 && typeof value.autoReplySuppressed !== "boolean") throw new TypeError("Invalid Goal routing policy");
|
|
531621
531644
|
if (!object(value) || value["sessionId"] !== sessionId || typeof value["goalId"] !== "string" || !value["goalId"] || typeof value["chatId"] !== "string" || !/^-?[1-9]\d*$/.test(value["chatId"]) || typeof value["status"] !== "string" || ![
|
|
531622
531645
|
"active",
|
|
531623
531646
|
"paused",
|
|
@@ -531640,6 +531663,7 @@ function decodeReply(value, sessionId) {
|
|
|
531640
531663
|
"blocked"
|
|
531641
531664
|
].includes(pending["status"]) || !Number.isInteger(pending["attempts"]) || Number(pending["attempts"]) < 0 || Number(pending["attempts"]) > 3 || pending["acceptedChunks"] !== void 0 && (!Array.isArray(pending["acceptedChunks"]) || !pending["acceptedChunks"].every((chunk) => object(chunk) && typeof chunk["text"] === "string" && messageId(chunk["messageId"]))))) throw new TypeError("Invalid pending Goal delivery");
|
|
531642
531665
|
return {
|
|
531666
|
+
autoReplySuppressed: value["autoReplySuppressed"] === true,
|
|
531643
531667
|
goalId: value["goalId"],
|
|
531644
531668
|
sessionId,
|
|
531645
531669
|
chatId: value["chatId"],
|
|
@@ -531654,6 +531678,7 @@ function decodeReply(value, sessionId) {
|
|
|
531654
531678
|
};
|
|
531655
531679
|
}
|
|
531656
531680
|
function recoverReply(record, replay) {
|
|
531681
|
+
if (record.autoReplySuppressed) return void 0;
|
|
531657
531682
|
if (!Array.isArray(replay)) return void 0;
|
|
531658
531683
|
const index = replay.findLastIndex((entry) => object(entry) && entry["type"] === "goal_updated" && object(entry["snapshot"]) && entry["snapshot"]["goalId"] === record.goalId && entry["snapshot"]["status"] === "complete" && object(entry["change"]) && entry["change"]["kind"] === "completion");
|
|
531659
531684
|
if (index < 0) return void 0;
|
|
@@ -531734,7 +531759,9 @@ var init_goal_channel_replies = __esmMin((() => {
|
|
|
531734
531759
|
const value = metadata.custom?.["telegramGoalReplies"];
|
|
531735
531760
|
if (value !== void 0 && (!object(value) || typeof value["sessionId"] !== "string")) throw new TypeError("Invalid Goal metadata");
|
|
531736
531761
|
if (!object(value) || value["sessionId"] !== session.id) return;
|
|
531737
|
-
if (typeof value["version"] !== "number" || ![1, 2].includes(value["version"]) || !Array.isArray(value["records"])) throw new TypeError("Unsupported Goal metadata");
|
|
531762
|
+
if (typeof value["version"] !== "number" || ![1, 2, 3].includes(value["version"]) || !Array.isArray(value["records"])) throw new TypeError("Unsupported Goal metadata");
|
|
531763
|
+
if (value["version"] === 3 && (value["mixedTurnId"] !== void 0 && typeof value["mixedTurnId"] !== "string" || value["records"].some(record => !object(record) || typeof record.autoReplySuppressed !== "boolean"))) throw new TypeError("Invalid Goal routing metadata");
|
|
531764
|
+
scope.mixedTurnId = value["mixedTurnId"];
|
|
531738
531765
|
const records = value["records"].map((record) => decodeReply(record, session.id));
|
|
531739
531766
|
if (new Set(records.map((record) => record.goalId)).size !== records.length) throw new TypeError("Duplicate Goal route");
|
|
531740
531767
|
for (const record of records) scope.records.set(record.goalId, record);
|
|
@@ -531745,6 +531772,7 @@ var init_goal_channel_replies = __esmMin((() => {
|
|
|
531745
531772
|
record.turnEnded = false;
|
|
531746
531773
|
continue;
|
|
531747
531774
|
}
|
|
531775
|
+
if (record.autoReplySuppressed) continue;
|
|
531748
531776
|
if (!record.pending && (record.turnEndReason === void 0 || record.turnEndReason === "completed")) {
|
|
531749
531777
|
const outcome = recoverReply(record, session.getResumeState()?.agents?.["main"]?.replay);
|
|
531750
531778
|
if (!outcome) continue;
|
|
@@ -531764,6 +531792,27 @@ var init_goal_channel_replies = __esmMin((() => {
|
|
|
531764
531792
|
})();
|
|
531765
531793
|
return scope.restoring;
|
|
531766
531794
|
}
|
|
531795
|
+
needsExplicitRouting(turnId, incomingChat) {
|
|
531796
|
+
const scope = this.scope;
|
|
531797
|
+
if (!scope || !this.current(scope)) return false;
|
|
531798
|
+
if (scope.mixedTurnId === String(turnId)) return true;
|
|
531799
|
+
return [...scope.records.values()].some(record =>
|
|
531800
|
+
(record.status === 'active' || record.turnId === String(turnId)) && record.chatId !== incomingChat);
|
|
531801
|
+
}
|
|
531802
|
+
async suppressAutoReplies(session, turnId) {
|
|
531803
|
+
const scope = this.scope;
|
|
531804
|
+
if (!scope || scope.session !== session || !this.current(scope) || !scope.writable) return false;
|
|
531805
|
+
scope.mixedTurnId = String(turnId);
|
|
531806
|
+
for (const record of scope.records.values()) {
|
|
531807
|
+
if (record.turnId !== String(turnId) && record.status !== 'active') continue;
|
|
531808
|
+
record.autoReplySuppressed = true;
|
|
531809
|
+
clearTimeout(record.timer);
|
|
531810
|
+
record.timer = undefined;
|
|
531811
|
+
}
|
|
531812
|
+
// In-flight sends retain their confirmed chunk receipts. Their next chunk and
|
|
531813
|
+
// retries observe the flag; no pending receipt is discarded here.
|
|
531814
|
+
return await this.persist(scope) && this.current(scope);
|
|
531815
|
+
}
|
|
531767
531816
|
async bind(session, goal, chatId) {
|
|
531768
531817
|
await this.restore(session, goal);
|
|
531769
531818
|
const scope = this.scope;
|
|
@@ -531771,6 +531820,7 @@ var init_goal_channel_replies = __esmMin((() => {
|
|
|
531771
531820
|
const existing = scope.records.get(goal.goalId);
|
|
531772
531821
|
if (existing && existing.chatId !== chatId) return false;
|
|
531773
531822
|
if (!existing) scope.records.set(goal.goalId, {
|
|
531823
|
+
autoReplySuppressed: scope.mixedTurnId !== void 0 && (scope.activeTurnId === void 0 || scope.activeTurnId === scope.mixedTurnId),
|
|
531774
531824
|
goalId: goal.goalId,
|
|
531775
531825
|
sessionId: session.id,
|
|
531776
531826
|
chatId,
|
|
@@ -531788,9 +531838,11 @@ var init_goal_channel_replies = __esmMin((() => {
|
|
|
531788
531838
|
const scope = this.scope;
|
|
531789
531839
|
if (!scope || scope.sessionId !== sessionId || !this.current(scope)) return;
|
|
531790
531840
|
scope.activeTurnId = String(turnId);
|
|
531841
|
+
if (scope.mixedTurnId !== String(turnId)) scope.mixedTurnId = void 0;
|
|
531791
531842
|
scope.hookEntries.clear();
|
|
531792
531843
|
const record = scope.records.get(goalId ?? scope.activeGoalId ?? "");
|
|
531793
531844
|
if (!record || record.status !== "active") return;
|
|
531845
|
+
record.autoReplySuppressed = scope.mixedTurnId === String(turnId);
|
|
531794
531846
|
record.turnId = String(turnId);
|
|
531795
531847
|
record.turnEnded = false;
|
|
531796
531848
|
record.turnEndReason = void 0;
|
|
@@ -531817,6 +531869,7 @@ var init_goal_channel_replies = __esmMin((() => {
|
|
|
531817
531869
|
}
|
|
531818
531870
|
record.status = goal.status;
|
|
531819
531871
|
if (resumed && scope.activeTurnId !== void 0) {
|
|
531872
|
+
record.autoReplySuppressed = scope.mixedTurnId === scope.activeTurnId;
|
|
531820
531873
|
record.turnId = scope.activeTurnId;
|
|
531821
531874
|
record.turnEnded = false;
|
|
531822
531875
|
record.turnEndReason = void 0;
|
|
@@ -531902,9 +531955,11 @@ var init_goal_channel_replies = __esmMin((() => {
|
|
|
531902
531955
|
persist(scope) {
|
|
531903
531956
|
if (!scope.writable) return Promise.resolve(false);
|
|
531904
531957
|
const value = structuredClone({
|
|
531905
|
-
version:
|
|
531958
|
+
version: 3,
|
|
531959
|
+
mixedTurnId: scope.mixedTurnId,
|
|
531906
531960
|
sessionId: scope.sessionId,
|
|
531907
531961
|
records: [...scope.records.values()].map((record) => ({
|
|
531962
|
+
autoReplySuppressed: record.autoReplySuppressed === true,
|
|
531908
531963
|
goalId: record.goalId,
|
|
531909
531964
|
sessionId: record.sessionId,
|
|
531910
531965
|
chatId: record.chatId,
|
|
@@ -531935,7 +531990,7 @@ var init_goal_channel_replies = __esmMin((() => {
|
|
|
531935
531990
|
return scope.persistence;
|
|
531936
531991
|
}
|
|
531937
531992
|
prepareReply(scope, record) {
|
|
531938
|
-
if (!record.turnEnded || record.status !== "complete" || record.turnEndReason !== "completed" || !record.finalText) return;
|
|
531993
|
+
if (record.autoReplySuppressed || !record.turnEnded || record.status !== "complete" || record.turnEndReason !== "completed" || !record.finalText) return;
|
|
531939
531994
|
if (record.replyReceipts.some((receipt) => receipt.text === record.finalText)) {
|
|
531940
531995
|
this.remove(scope, record);
|
|
531941
531996
|
return;
|
|
@@ -531955,7 +532010,7 @@ var init_goal_channel_replies = __esmMin((() => {
|
|
|
531955
532010
|
}
|
|
531956
532011
|
deliver(scope, record) {
|
|
531957
532012
|
const pending = record.pending;
|
|
531958
|
-
if (!pending || record.sending || !this.current(scope) || scope.suspended > 0 || record.status !== "complete" || record.turnEndReason !== void 0 && record.turnEndReason !== "completed") return;
|
|
532013
|
+
if (record.autoReplySuppressed || !pending || record.sending || !this.current(scope) || scope.suspended > 0 || record.status !== "complete" || record.turnEndReason !== void 0 && record.turnEndReason !== "completed") return;
|
|
531959
532014
|
const receiptOnly = pending.attempts >= 3;
|
|
531960
532015
|
if (!receiptOnly) pending.attempts += 1;
|
|
531961
532016
|
const progress = {
|
|
@@ -531967,7 +532022,7 @@ var init_goal_channel_replies = __esmMin((() => {
|
|
|
531967
532022
|
},
|
|
531968
532023
|
receiptOnly,
|
|
531969
532024
|
signal: scope.signal.signal,
|
|
531970
|
-
isCurrent: () => this.current(scope) && scope.suspended === 0 && scope.records.get(record.goalId) === record && record.pending === pending,
|
|
532025
|
+
isCurrent: () => !record.autoReplySuppressed && this.current(scope) && scope.suspended === 0 && scope.records.get(record.goalId) === record && record.pending === pending,
|
|
531971
532026
|
persistAccepted: () => this.persist(scope)
|
|
531972
532027
|
};
|
|
531973
532028
|
record.sending = (async () => {
|
|
@@ -531987,7 +532042,7 @@ var init_goal_channel_replies = __esmMin((() => {
|
|
|
531987
532042
|
if (sent) {
|
|
531988
532043
|
this.remove(scope, record);
|
|
531989
532044
|
if (this.current(scope)) this.host.onDelivered();
|
|
531990
|
-
} else if (this.current(scope) && scope.suspended === 0) if (pending.attempts < 3) {
|
|
532045
|
+
} else if (!record.autoReplySuppressed && this.current(scope) && scope.suspended === 0) if (pending.attempts < 3) {
|
|
531991
532046
|
record.timer = setTimeout(() => {
|
|
531992
532047
|
record.timer = void 0;
|
|
531993
532048
|
this.deliver(scope, record);
|
|
@@ -546577,13 +546632,95 @@ channelOwnsStoppedInput(chatId) {
|
|
|
546577
546632
|
activeInputRequests;
|
|
546578
546633
|
activeInputDelivery;
|
|
546579
546634
|
activeInputScope;
|
|
546635
|
+
canSubmitActiveInput(session, agentId) {
|
|
546636
|
+
return this.session === session && this.interactiveAgentId === agentId &&
|
|
546637
|
+
this.stoppedInputSession !== session && !this.isShuttingDown && !this.deferUserMessages &&
|
|
546638
|
+
!this.queueCommandRunning && !this.editorReplacementActive && this.localShellConsentRequest === undefined &&
|
|
546639
|
+
this.queueSteerInFlight === undefined && this.manualPromptInFlight === undefined &&
|
|
546640
|
+
this.state.appState.streamingPhase !== 'shell' && !this.hasPendingQueueCommandCancellation() &&
|
|
546641
|
+
!this.queuePolicyBlocksInput(session);
|
|
546642
|
+
}
|
|
546643
|
+
commitActiveQueuedInput(item, session, agentId, turn) {
|
|
546644
|
+
if (this.session !== session || this.interactiveAgentId !== agentId || !this.state.queuedMessages.includes(item)) return;
|
|
546645
|
+
this.activeInputRequests?.delete(item);
|
|
546646
|
+
this.state.queuedMessages = this.state.queuedMessages.filter(entry => entry !== item);
|
|
546647
|
+
if (!(item.transcriptRendered || item.channelTranscriptRendered)) this.appendTranscriptEntry({
|
|
546648
|
+
id: nextTranscriptId(), kind: 'user', turnId: String(turn), renderMode: 'plain',
|
|
546649
|
+
content: item.displayText ?? item.text.trim(), origin: item.origin, imageAttachmentIds: item.imageAttachmentIds,
|
|
546650
|
+
});
|
|
546651
|
+
item.channelAcknowledge?.();
|
|
546652
|
+
this.updateQueueDisplay();
|
|
546653
|
+
this.state.ui.requestRender();
|
|
546654
|
+
}
|
|
546655
|
+
reconcileActiveInputHead() {
|
|
546656
|
+
const item = this.state.queuedMessages[0];
|
|
546657
|
+
const request = item === undefined ? undefined : this.activeInputRequests?.get(item);
|
|
546658
|
+
if (request?.identity === undefined) return false;
|
|
546659
|
+
if (request.reconciling !== undefined) return true;
|
|
546660
|
+
if (this.activeInputDelivery?.has(item)) return false;
|
|
546661
|
+
const session = request.session;
|
|
546662
|
+
const agentId = request.agentId;
|
|
546663
|
+
if (session === undefined || !this.canSubmitActiveInput(session, agentId)) return true;
|
|
546664
|
+
clearTimeout(request.reconcileTimer);
|
|
546665
|
+
request.reconcileTimer = undefined;
|
|
546666
|
+
const controller = new AbortController();
|
|
546667
|
+
this.activeInputReconciliations ??= new Set();
|
|
546668
|
+
this.activeInputReconciliations.add(controller);
|
|
546669
|
+
const current = () => this.session === session && this.interactiveAgentId === agentId &&
|
|
546670
|
+
this.state.queuedMessages.includes(item) && this.activeInputRequests?.get(item) === request && !controller.signal.aborted;
|
|
546671
|
+
request.reconciling = Promise.resolve().then(async () => {
|
|
546672
|
+
try {
|
|
546673
|
+
const sender = activeInputReceiptSender(session, () => current() && this.canSubmitActiveInput(session, agentId));
|
|
546674
|
+
const result = await this.withInteractiveAgent(agentId, () => deliverQueueSteer(sender,
|
|
546675
|
+
request.input ?? request.payload, request.identity.expectedTurnId, controller.signal, undefined, request));
|
|
546676
|
+
if (!current()) return;
|
|
546677
|
+
if (result === 'context') this.commitActiveQueuedInput(item, session, agentId, request.identity.expectedTurnId);
|
|
546678
|
+
else if (result === 'discarded' || result === 'rejected') this.activeInputRequests.delete(item);
|
|
546679
|
+
} catch (error) {
|
|
546680
|
+
if (current()) this.showError(formatErrorMessage$2(error));
|
|
546681
|
+
} finally {
|
|
546682
|
+
request.reconciling = undefined;
|
|
546683
|
+
this.activeInputReconciliations.delete(controller);
|
|
546684
|
+
const owned = this.activeInputRequests?.get(item) === request;
|
|
546685
|
+
if (current() || !owned) {
|
|
546686
|
+
if (owned) {
|
|
546687
|
+
request.reconcileTimer = setTimeout(() => this.scheduleQueueDrain(), 1000);
|
|
546688
|
+
request.reconcileTimer.unref?.();
|
|
546689
|
+
} else this.scheduleQueueDrain();
|
|
546690
|
+
}
|
|
546691
|
+
}
|
|
546692
|
+
});
|
|
546693
|
+
return true;
|
|
546694
|
+
}
|
|
546580
546695
|
activeInputChat;
|
|
546581
|
-
|
|
546696
|
+
async prepareActiveInputRouting(item, session, turn, signal) {
|
|
546697
|
+
signal.throwIfAborted();
|
|
546698
|
+
const guard = this.pendingChannelReplyGuard;
|
|
546699
|
+
const chat = item.mode === 'channel' ? item.channelChatId : undefined;
|
|
546700
|
+
// Disable the ephemeral fallback synchronously, before any asynchronous work.
|
|
546701
|
+
let mixed = guard !== undefined ? guard.chatId !== chat || guard.explicitReplyOnly === true : chat !== undefined;
|
|
546702
|
+
if (mixed && guard !== undefined) guard.explicitReplyOnly = true;
|
|
546703
|
+
await this.goalChannelReplies.restore(session, this.state.appState.goal ?? null);
|
|
546704
|
+
signal.throwIfAborted();
|
|
546705
|
+
mixed ||= this.goalChannelReplies.needsExplicitRouting(turn, chat);
|
|
546706
|
+
if (!mixed) return false;
|
|
546707
|
+
if (this.pendingChannelReplyGuard !== undefined) this.pendingChannelReplyGuard.explicitReplyOnly = true;
|
|
546708
|
+
if (!await this.goalChannelReplies.suppressAutoReplies(session, turn)) {
|
|
546709
|
+
throw Object.assign(new Error('Input is waiting for its reply-routing policy to be saved.'),
|
|
546710
|
+
{ code: 'ACTIVE_INPUT_ROUTING_NOT_SAVED' });
|
|
546711
|
+
}
|
|
546712
|
+
signal.throwIfAborted();
|
|
546713
|
+
return true;
|
|
546714
|
+
}
|
|
546715
|
+
admitActiveQueuedInputs() {
|
|
546716
|
+
if (this.reconcileActiveInputHead()) return true;
|
|
546582
546717
|
const session = this.session;
|
|
546583
546718
|
if (!isExperimentalFlagEnabled("queue_policies") || session === void 0 || this.stoppedInputSession === session || this.isShuttingDown || this.state.appState.streamingPhase === "idle" || this.state.appState.streamingPhase === "shell" || this.queueSteerInFlight !== void 0 || this.manualPromptInFlight !== void 0 || this.deferUserMessages || this.queueCommandRunning || this.editorReplacementActive || this.localShellConsentRequest !== void 0 || this.hasPendingQueueCommandCancellation() || this.queuePolicyBlocksInput(session)) return false;
|
|
546584
546719
|
const turn = this.streamingUI.getTurnContext().turnId;
|
|
546585
546720
|
if (turn === void 0 || !/^\d+$/.test(turn) || !Number.isSafeInteger(Number(turn))) return false;
|
|
546586
546721
|
const agentId = this.interactiveAgentId;
|
|
546722
|
+
const head = this.state.queuedMessages[0];
|
|
546723
|
+
if (head === void 0 || (head.agentId ?? "main") !== agentId || (head.mode === "channel" ? head.channelContextOnly === true : head.mode !== void 0 && head.mode !== "prompt")) return false;
|
|
546587
546724
|
const scope = JSON.stringify([
|
|
546588
546725
|
session.id,
|
|
546589
546726
|
agentId,
|
|
@@ -546591,6 +546728,8 @@ admitActiveQueuedInputs() {
|
|
|
546591
546728
|
]);
|
|
546592
546729
|
if (this.activeInputScope !== scope) {
|
|
546593
546730
|
this.activeInputDelivery?.cancel();
|
|
546731
|
+
for (const controller of this.activeInputReconciliations ?? []) controller.abort();
|
|
546732
|
+
this.activeInputReconciliations?.clear();
|
|
546594
546733
|
this.activeInputScope = scope;
|
|
546595
546734
|
this.activeInputChat = this.pendingChannelReplyGuard?.chatId;
|
|
546596
546735
|
const current = () => this.session === session && this.activeInputScope === scope && this.interactiveAgentId === agentId;
|
|
@@ -546606,51 +546745,42 @@ admitActiveQueuedInputs() {
|
|
|
546606
546745
|
}
|
|
546607
546746
|
if (item.mode === "channel") {
|
|
546608
546747
|
if (this.activeInputChat === void 0) this.activeInputChat = item.channelChatId;
|
|
546609
|
-
if (item.channelContextOnly === true
|
|
546748
|
+
if (item.channelContextOnly === true) break;
|
|
546610
546749
|
} else if (item.mode !== void 0 && item.mode !== "prompt") break;
|
|
546611
546750
|
result.push(item);
|
|
546612
546751
|
}
|
|
546613
546752
|
return result;
|
|
546614
546753
|
},
|
|
546615
|
-
send: (item, signal, accepted) => {
|
|
546754
|
+
send: async (item, signal, accepted) => {
|
|
546616
546755
|
this.activeInputRequests ??= /* @__PURE__ */ new WeakMap();
|
|
546617
|
-
let request = this.activeInputRequests.get(item) ?? {};
|
|
546756
|
+
let request = this.activeInputRequests.get(item) ?? { session, agentId };
|
|
546618
546757
|
this.activeInputRequests.set(item, request);
|
|
546758
|
+
const explicit = await this.prepareActiveInputRouting(item, session, turn, signal);
|
|
546759
|
+
if (!current() || this.streamingUI.getTurnContext().turnId !== turn || this.stoppedInputSession === session || this.isShuttingDown || this.deferUserMessages || this.queueCommandRunning || this.editorReplacementActive || this.localShellConsentRequest !== void 0 || this.hasPendingQueueCommandCancellation() || this.queuePolicyBlocksInput(session)) {
|
|
546760
|
+
throw Object.assign(new Error("Active input scope changed before submission."), { code: "ACTIVE_INPUT_ROUTING_NOT_SAVED" });
|
|
546761
|
+
}
|
|
546619
546762
|
const image = item.channelImagePath === void 0 ? void 0 : buildChannelImagePart(item.channelImagePath);
|
|
546620
546763
|
const input = item.parts !== void 0 ? [...item.parts] : image !== void 0 && this.canReadImages() ? [{
|
|
546621
546764
|
type: "text",
|
|
546622
546765
|
text: item.text.trim()
|
|
546623
546766
|
}, image] : item.text.trim();
|
|
546767
|
+
request.input ??= explicit ? activeInputRoutingHint(input) : input;
|
|
546624
546768
|
return this.withInteractiveAgent(agentId, async () => {
|
|
546625
546769
|
const originalTurn = request.identity?.expectedTurnId;
|
|
546626
|
-
let disposition = await deliverQueueSteer(session, input, Number(turn), signal, () => {
|
|
546770
|
+
let disposition = await deliverQueueSteer(activeInputReceiptSender(session, () => current() && this.state.queuedMessages.includes(item) && this.streamingUI.getTurnContext().turnId === turn && this.canSubmitActiveInput(session, agentId)), request.input, Number(turn), signal, () => {
|
|
546627
546771
|
if (request.identity?.expectedTurnId === Number(turn)) accepted();
|
|
546628
546772
|
}, request);
|
|
546629
546773
|
if (originalTurn !== void 0 && originalTurn !== Number(turn) && disposition !== "context") {
|
|
546630
|
-
request = {};
|
|
546774
|
+
request = { session, agentId, input: explicit ? activeInputRoutingHint(input) : input };
|
|
546631
546775
|
this.activeInputRequests.set(item, request);
|
|
546632
|
-
disposition = await deliverQueueSteer(session, input, Number(turn), signal, accepted, request);
|
|
546776
|
+
disposition = await deliverQueueSteer(activeInputReceiptSender(session, () => current() && this.state.queuedMessages.includes(item) && this.streamingUI.getTurnContext().turnId === turn && this.canSubmitActiveInput(session, agentId)), request.input, Number(turn), signal, accepted, request);
|
|
546633
546777
|
}
|
|
546634
546778
|
if (disposition !== "context") this.activeInputRequests?.delete(item);
|
|
546635
546779
|
return disposition;
|
|
546636
546780
|
});
|
|
546637
546781
|
},
|
|
546638
546782
|
commit: (item) => {
|
|
546639
|
-
if (
|
|
546640
|
-
this.activeInputRequests?.delete(item);
|
|
546641
|
-
this.state.queuedMessages = this.state.queuedMessages.filter((entry) => entry !== item);
|
|
546642
|
-
if (!(item.transcriptRendered || item.channelTranscriptRendered)) this.appendTranscriptEntry({
|
|
546643
|
-
id: nextTranscriptId(),
|
|
546644
|
-
kind: "user",
|
|
546645
|
-
turnId: turn,
|
|
546646
|
-
renderMode: "plain",
|
|
546647
|
-
content: item.displayText ?? item.text.trim(),
|
|
546648
|
-
origin: item.origin,
|
|
546649
|
-
imageAttachmentIds: item.imageAttachmentIds
|
|
546650
|
-
});
|
|
546651
|
-
item.channelAcknowledge?.();
|
|
546652
|
-
this.updateQueueDisplay();
|
|
546653
|
-
this.state.ui.requestRender();
|
|
546783
|
+
if (current()) this.commitActiveQueuedInput(item, session, agentId, this.activeInputRequests?.get(item)?.identity?.expectedTurnId ?? turn);
|
|
546654
546784
|
},
|
|
546655
546785
|
error: (error) => {
|
|
546656
546786
|
if (current()) this.showError(formatErrorMessage$2(error));
|
|
@@ -546682,6 +546812,7 @@ releaseChannelQueueAtSafePoint() {
|
|
|
546682
546812
|
this.steerQueueFlushPrefix();
|
|
546683
546813
|
}
|
|
546684
546814
|
canDrainQueue() {
|
|
546815
|
+
if (this.activeInputRequests?.get(this.state.queuedMessages[0])?.identity !== void 0) return false;
|
|
546685
546816
|
if (this.gatewayStartup && !this.gatewayViewReady) return false;
|
|
546686
546817
|
if (this.session !== void 0 && this.stoppedInputSession === this.session) return false;
|
|
546687
546818
|
if (this.queueInterruptCancellations.size > 0) return false;
|
|
@@ -546697,6 +546828,7 @@ releaseChannelQueueAtSafePoint() {
|
|
|
546697
546828
|
return !this.isShuttingDown && !this.queueCommandRunning && this.queueSteerInFlight === void 0 && this.manualPromptInFlight === void 0 && !this.editorReplacementActive && !this.deferUserMessages && (remoteControl || this.state.appState.streamingPhase === "idle" && !this.state.appState.isCompacting);
|
|
546698
546829
|
}
|
|
546699
546830
|
scheduleQueueDrain(minimumDelay = 0) {
|
|
546831
|
+
if (this.reconcileActiveInputHead()) return;
|
|
546700
546832
|
if (this.admitActiveQueuedInputs()) return;
|
|
546701
546833
|
if (!this.canDrainQueue()) return;
|
|
546702
546834
|
if (this.queueDrainTimer !== void 0) {
|
|
@@ -546801,6 +546933,10 @@ releaseChannelQueueAtSafePoint() {
|
|
|
546801
546933
|
if (this.manualPromptInFlight !== void 0) this.manualPromptInFlight.flushRequested = this.queueFlushBatchRemaining > 0;
|
|
546802
546934
|
if (this.queueFlushBatchRemaining > 0 && this.state.appState.streamingPhase === "shell")
|
|
546803
546935
|
toolLiveness642.yieldLocalShellsForInput(this, true);
|
|
546936
|
+
if (isExperimentalFlagEnabled("queue_policies") && this.state.appState.streamingPhase !== "shell") {
|
|
546937
|
+
this.scheduleQueueDrain();
|
|
546938
|
+
return;
|
|
546939
|
+
}
|
|
546804
546940
|
this.steerQueueFlushPrefix();
|
|
546805
546941
|
this.scheduleQueueDrain();
|
|
546806
546942
|
}
|
|
@@ -547202,7 +547338,7 @@ releaseChannelQueueAtSafePoint() {
|
|
|
547202
547338
|
runChannelMediaFallback(output) {
|
|
547203
547339
|
const guard = this.pendingChannelReplyGuard;
|
|
547204
547340
|
const filePath = completedMediaLocalPath(output);
|
|
547205
|
-
if (guard === void 0 || filePath === void 0) return;
|
|
547341
|
+
if (guard === void 0 || guard.explicitReplyOnly === true || filePath === void 0) return;
|
|
547206
547342
|
const deliveryKey = `${guard.chatId}\0${filePath}`;
|
|
547207
547343
|
if (this.channelMediaDeliveries.has(deliveryKey)) return;
|
|
547208
547344
|
this.channelMediaDeliveries.add(deliveryKey);
|
|
@@ -547216,7 +547352,7 @@ releaseChannelQueueAtSafePoint() {
|
|
|
547216
547352
|
const guard = this.pendingChannelReplyGuard;
|
|
547217
547353
|
if (guard === void 0) return;
|
|
547218
547354
|
this.pendingChannelReplyGuard = void 0;
|
|
547219
|
-
if (guard.goalId !== void 0 || this.goalChannelReplies.handledChat(guard.chatId)) return;
|
|
547355
|
+
if (guard.explicitReplyOnly === true || guard.goalId !== void 0 || this.goalChannelReplies.handledChat(guard.chatId)) return;
|
|
547220
547356
|
if (reason !== "completed") return;
|
|
547221
547357
|
if (this.state.transcriptEntries.slice(guard.transcriptStart).some((entry) => entry.kind === "tool_call" && /reply|edit_message/i.test(entry.toolCallData?.name ?? ""))) return;
|
|
547222
547358
|
if (outboxGrewForChat(guard.outboxMarker, guard.chatId)) return;
|
|
@@ -547800,6 +547936,8 @@ releaseChannelQueueAtSafePoint() {
|
|
|
547800
547936
|
} : void 0;
|
|
547801
547937
|
} else this.stoppedQueueBoundary = this.telegramChannel === void 0 ? void 0 : this.captureTelegramQueueBoundary();
|
|
547802
547938
|
this.activeInputDelivery?.cancel();
|
|
547939
|
+
for (const controller of this.activeInputReconciliations ?? []) controller.abort();
|
|
547940
|
+
this.activeInputReconciliations?.clear();
|
|
547803
547941
|
const turn = this.streamingUI.getTurnContext().turnId;
|
|
547804
547942
|
if (turn === void 0 || !/^\d+$/.test(turn)) return;
|
|
547805
547943
|
const turnId = Number(turn);
|
|
@@ -548066,6 +548204,8 @@ releaseChannelQueueAtSafePoint() {
|
|
|
548066
548204
|
clearQueuedMessages(preserveCancellations = false) {
|
|
548067
548205
|
if (!preserveCancellations) this.queueInterruptCancellations.clear();
|
|
548068
548206
|
this.activeInputDelivery?.cancel();
|
|
548207
|
+
for (const controller of this.activeInputReconciliations ?? []) controller.abort();
|
|
548208
|
+
this.activeInputReconciliations?.clear();
|
|
548069
548209
|
this.activeInputScope = void 0;
|
|
548070
548210
|
this.queueSteerInFlight?.receiptAbort?.abort();
|
|
548071
548211
|
if (this.manualPromptInFlight?.promptAbort !== void 0 && !this.manualPromptInFlight.promptSubmitted && this.state.appState.streamingPhase === "waiting" && !this.streamingUI.hasActiveTurn()) {
|
|
@@ -548449,6 +548589,8 @@ releaseChannelQueueAtSafePoint() {
|
|
|
548449
548589
|
const previous = this.session;
|
|
548450
548590
|
this.queueInterruptCancellations.clear();
|
|
548451
548591
|
this.activeInputDelivery?.cancel();
|
|
548592
|
+
for (const controller of this.activeInputReconciliations ?? []) controller.abort();
|
|
548593
|
+
this.activeInputReconciliations?.clear();
|
|
548452
548594
|
this.activeInputScope = void 0;
|
|
548453
548595
|
this.queueSteerInFlight?.receiptAbort?.abort();
|
|
548454
548596
|
this.manualPromptInFlight?.promptAbort?.abort();
|
|
@@ -548538,6 +548680,8 @@ releaseChannelQueueAtSafePoint() {
|
|
|
548538
548680
|
if (!this.preserveQueueAcrossSessionReset) this.queueInterruptCancellations.clear();
|
|
548539
548681
|
if (!this.preserveQueueAcrossSessionReset) {
|
|
548540
548682
|
this.activeInputDelivery?.cancel();
|
|
548683
|
+
for (const controller of this.activeInputReconciliations ?? []) controller.abort();
|
|
548684
|
+
this.activeInputReconciliations?.clear();
|
|
548541
548685
|
this.activeInputScope = void 0;
|
|
548542
548686
|
this.queueSteerInFlight?.receiptAbort?.abort();
|
|
548543
548687
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blun-king-cli",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.647",
|
|
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": {
|
|
@@ -47,7 +47,9 @@
|
|
|
47
47
|
"LIESMICH.txt",
|
|
48
48
|
"tool-liveness642/",
|
|
49
49
|
"versionierung/",
|
|
50
|
-
"RELEASE-9.1.645.md"
|
|
50
|
+
"RELEASE-9.1.645.md",
|
|
51
|
+
"RELEASE-9.1.646.md",
|
|
52
|
+
"RELEASE-9.1.647.md"
|
|
51
53
|
],
|
|
52
54
|
"keywords": [
|
|
53
55
|
"blun",
|
package/worker-host.mjs
CHANGED
|
@@ -229527,23 +229527,9 @@ var FullCompaction = class {
|
|
|
229527
229527
|
if (this.requiresShrinkableHistory && !this.hasShrinkableHistory(messages)) return false;
|
|
229528
229528
|
return this.beginAutoCompaction(throwOnLimit);
|
|
229529
229529
|
}
|
|
229530
|
-
shouldCompactRequestBody(
|
|
229531
|
-
|
|
229532
|
-
return true;
|
|
229533
|
-
const attempts = this.t3458PressureAttempts ??= new Map();
|
|
229534
|
-
const key = endpoint + "\0" + String(limit);
|
|
229535
|
-
if (bytes < limit * 0.75) {
|
|
229536
|
-
attempts.delete(key);
|
|
229537
|
-
return false;
|
|
229530
|
+
shouldCompactRequestBody(_endpoint, bytes, limit) {
|
|
229531
|
+
return bytes >= limit;
|
|
229538
229532
|
}
|
|
229539
|
-
if (this.isSessionCompactionStopped || !this.hasShrinkableHistory(this.agent.context.history))
|
|
229540
|
-
return false;
|
|
229541
|
-
const previous = attempts.get(key);
|
|
229542
|
-
if (previous !== undefined && bytes < previous + Math.ceil(previous / 10))
|
|
229543
|
-
return false;
|
|
229544
|
-
attempts.set(key, bytes);
|
|
229545
|
-
return true;
|
|
229546
|
-
}
|
|
229547
229533
|
hasShrinkableHistory(messages) {
|
|
229548
229534
|
if (messages.some((message) => message.role === "tool" || message.role === "assistant" && ((message.toolCalls?.length ?? 0) > 0 || message.content.some(part => part.type !== "text" || part.text.trim().length > 0))))
|
|
229549
229535
|
return true;
|