blun-king-cli 9.1.647 → 9.1.649

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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # Versionsverlauf
2
2
 
3
+ ## 9.1.649
4
+
5
+ - `king -c` hält den lokalen Wiederaufnahmepunkt klein, auch wenn sich der Systemprompt oft ändert. Bereits geprüfte Konto- und Modellinformationen können beim Fortsetzen wiederverwendet werden.
6
+ - Überfällige Wiederholungsaufträge warten nach der interaktiven Wiederaufnahme 60 Sekunden und anschließend auf einen freien Turn. Einmalige Erinnerungen folgen ihrem Termin.
7
+ - Bei gemischten Telegram- und Konsoleneingaben erhält eine offene Direktnachricht am nächsten Modellschritt eine gezielte Antwortgelegenheit, sobald die laufenden Werkzeuge fertig sind.
8
+ - Die Konsole bindet Telegram-Eingang und Zustellbeleg an Chat und Nachricht. Ein möglicherweise bereits zugestellter Versand löst über diesen Weg keinen weiteren Versuch aus.
9
+ - Große automatisch gefundene `Mistake.md`-Dateien werden bei Bedarf gelesen. Ausdrücklich eingebundene Arbeitsanweisungen werden vollständig geladen.
10
+ - Chat- und Nachrichtenkennungen bleiben Teil des lokalen Sitzungsprotokolls. Die Antwort nutzt die eingerichtete Modell- und Telegram-Verbindung. Die neue Antwortzeit im laufenden Betrieb ist noch offen.
11
+
12
+ [Versionshinweise und Installation](RELEASE-9.1.649.md).
13
+
14
+ ## 9.1.648
15
+
16
+ - Telegram-Antwortwerkzeuge bleiben für berechtigte Nutzereingaben in einer laufenden Goal-Kette verfügbar; bestehende Berechtigungen und Empfängerregeln gelten weiterhin.
17
+ - Im lokalen Telegram-Ausgangsprotokoll bestätigte Antworten ihrem Chat und ihrer Eingangsnachricht zuordnen. Bei einem teilweise gescheiterten Versand bleiben die bestätigten Teile nachvollziehbar.
18
+ - Ausstehende Eingaben nach Vorbereitung und Verdichtung vor der nächsten Modellanfrage erneut prüfen. Eine Zustellung innerhalb von sechzig Sekunden bleibt im laufenden Betrieb unbewiesen.
19
+ - An erkannten BLUN-Endpunkten einen Standard von 700.000 Byte verwenden und neue gelernte Grenzen nach fünfzehn Minuten verfallen lassen; ausdrückliche Konfiguration und frische niedrigere Servergrenzen bleiben wirksam. Das garantiert keine 250.000 Token.
20
+ - Einen experimentellen Leser für den erfassten Originalverlauf und gespeicherte Werkzeugausgaben mitliefern, standardmäßig ausgeschaltet. Eine stabile Leseposition bei Größenänderungen, die Aktualisierung mit neuen Ereignissen aus der laufenden Sitzung, seitenweises Laden vom Backend, gesondert extern aufbewahrte Ausgaben und Kopieren bleiben offen.
21
+ - Einstellungen mit vorangestellter UTF-8-BOM im Launcher, in der Konsole und im Worker lesen. Beschädigte inaktive Profile melden, ohne ein sauberes aktives Profil zu blockieren.
22
+ - Beim normalen Start die ausgemusterte AgentSpine-Registrierung, verwaltete Pluginkopien, den kopierten Skill und bekannten Plugin-Zustand aus dem gemeinsamen King-Verzeichnis und benannten Profilen entfernen.
23
+ - Fünf bekannte Pfadkandidaten alter Worker und Installer erhalten, bis die zuständigen Prozesse beendet und die Dateien einzeln geprüft sind; ausstehende Bereinigung melden, ohne vollständige Datenentfernung zu behaupten.
24
+ - Separate MCP-Einträge aus JSON und TOML entfernen; andere Werte bleiben erhalten. Neu geschriebene TOML-Dateien behalten Kommentare und Formatierung nicht bei.
25
+ - Datenfluss: kein neuer externer Empfänger und keine Übertragung von Migrationsdaten. Gelernte Grenzwerte erhalten eine Version und einen lokalen Zeitpunkt; der experimentelle Leser hält eine private Gesprächsmomentaufnahme im Arbeitsspeicher. Mit anderen Anwendungen geteilte Daten außerhalb von King, Projektdateien und Gesprächsverläufe werden nicht gelöscht.
26
+
27
+ [Versionshinweise und Installation](RELEASE-9.1.648.md).
28
+
3
29
  ## 9.1.647 — 19.11.2026
4
30
 
5
31
  - Optionale Verdichtung bei 75 Prozent der lokalen Byte-Grenze entfernt; Anfragen unterhalb der festen Grenze können weiterhin gesendet werden.
@@ -0,0 +1,15 @@
1
+ # Pending input at the compaction boundary
2
+
3
+ The repair rechecks pending input after asynchronous context preparation and compaction. If its sequence changed, tool selection and context-budget validation run again before that snapshot is committed. The existing transport path still enforces the serialized request-body byte limit.
4
+
5
+ The turn identity is captured once for the lifetime of the request wrapper, including model fallback. A changed active turn or an aborted provider attempt cannot consume its prepared snapshot. A retry yields to the event loop, then checks cancellation and turn identity again.
6
+
7
+ User input already supersedes an in-flight provider attempt through InputControl. This behavior existed before this repair: the first actual subsequent model request includes that input. The stale snapshot defect reproduced for background-task input, which does not supersede the provider. This change must not be described as a proven Telegram delivery or latency fix.
8
+
9
+ Input arriving after a stable commit remains pending for a later request; it is never flushed unchecked into the final fallback message rebuild. Context receipts mean storage in the conversation context. They do not prove that a model processed the input or that Telegram received a reply.
10
+
11
+ Terminal cancellation retains the existing discarded-receipt reconciliation path: unconsumed input is not acknowledged as consumed and remains available to the UI queue. Repeated background arrivals can require repeated validation; no response-time guarantee is made.
12
+
13
+ Validation uses functions extracted from the actual pinned package, including InputControl, executeLoopStep, FallbackLLM, pending-steer methods and UI receipt reconciliation. Sixteen main-core cases and fifteen worker-core cases pass without skips. Fifty-four existing core/input/media/goal/byte-limit checks also pass. The source-tree runtime differs from the published repair target; this helper is not evidence of source parity or a completed release.
14
+
15
+ No new recipient, telemetry, permission or persistent data store is introduced.
@@ -0,0 +1,57 @@
1
+ # Reply tools during goal work
2
+
3
+ A goal continuation uses a synthetic input origin. The previous origin filter removed registered Telegram reply, reaction and edit tools even after a real user message had entered that turn, while mixed-source routing required an explicit reply and suppressed automatic fallback. The model could therefore receive the message without the required reply tool.
4
+
5
+ The repair retains existing user tool authority inside one active worker's goal-continuation chain. A private object is bound to the exact agent instance and worker signal. It checks the current turn and active controller before granting or using authority. A different observed goal ID revokes inheritance. Worker completion, failure or cancellation disposes the object; nothing is stored for a later launch or resume. A final answer may still use the tools after goal completion within the same turn.
6
+
7
+ Only trusted host origin metadata can grant this authority. Pending USER steers count only through the exact request snapshot's sequence boundary; provisional selection does not persist a grant. A committed USER steer grants inheritance only after its actual context append succeeds. A projected message with role `user`, a channel-like text block, or a background/injection/cron origin cannot mint this authority. The existing behavior of direct background and cron turns is unchanged; this repair addresses the restricted synthetic-origin path.
8
+
9
+ The tools still come from the current registered MCP set and pass through the existing permission hooks. Telegram's configured destination list, language gate and file checks remain in force. That existing destination list covers configured chats; it does not bind a reply to the particular inbound chat. The repair adds no such guarantee, no new destination, no credential store and no automatic reply path. Mixed-source fallback suppression remains unchanged.
10
+
11
+ Tests extract the actual main and worker methods for tool selection, worker lifecycle, goal driving, pending snapshots and context commit. Model/MCP/network behavior and surrounding per-turn bookkeeping are isolated. They cover consumed and uncommitted input, consecutive goal turns, changed goals, cancellation, existing permission hooks and background text that resembles a channel message. Separate request-boundary regressions verify the composed compaction repair. These checks prove tool availability and lifecycle behavior, not live Telegram delivery or a response-time bound.
12
+
13
+ The source runtime differs from the packaged repair target. The final composed package still needs installation checks and independent package review before publication.
14
+
15
+ ## Telegram delivery receipts in the package
16
+
17
+ The bundled bridge asks the model for the chat and incoming message IDs when it replies. The installed Telegram tool records these IDs alongside Telegram-confirmed outgoing IDs in the existing local outbox. Text and attachment failures record only the parts already confirmed. Configured reply threading still applies. If the original message was removed, Telegram can send the reply to the same allowed chat without a thread reference.
18
+
19
+ When the model supplies an incoming message ID, the existing recent-text duplicate check matches the chat and incoming message together. This prevents an answer to a different message in the same chat from suppressing the current answer. The check remains limited to its recent window. Older outbox entries can lack the address. Existing allowlists, group rules, language release checks and file checks still apply.
20
+
21
+ ## Local delivery correlation in the source runtime
22
+
23
+ The console copies the numeric chat and incoming message IDs from Telegram bridge metadata into its local checked admission. The session journal records the pair with the actual context append. Active retries use the pair as part of the existing request digest, so the same request cannot claim another chat or message after a restart. The typed address stays out of model requests and public turn-start events. Telegram's existing message content and destination permissions still apply.
24
+
25
+ The bridge asks the model to pass both IDs for each reply. The Telegram tool records an explicitly supplied incoming message ID alongside the chat and Telegram-confirmed outgoing IDs in the existing outbox, including when visible reply threading is disabled. A partial failure records only acknowledged parts and the address. An abrupt process exit between Telegram's acknowledgement and the outbox write can leave an uncertain receipt. The journal address and the outbox receipt provide separate evidence of local context delivery and Telegram send.
26
+
27
+ ## Reply priority during work
28
+
29
+ The active goal reminder asks the model to answer new direct questions in their original channel before taking an unrelated goal action. In the bundled console the mixed-input hint also prioritizes new addressed Telegram messages and keeps unaddressed group context silent. A task that needs more work can receive an honest progress update while the agent continues.
30
+
31
+ This changes model guidance. Existing tool permissions and reply routes apply, and no extra destination is added. The time to a Telegram reply still depends on model and tool execution. An input admitted to the session is a separate event from Telegram confirming a reply.
32
+
33
+ ## Project mistake archive
34
+
35
+ The bundled runtime references automatically discovered project `Mistake.md` files larger than the existing 32 KiB instruction-size recommendation. The reference stays visible in the system prompt. The existing lesson selector and ordinary file tools can still retrieve relevant entries. Explicit imports and `AGENTS.md` keep their full contents. This reduces the text sent to the existing model endpoint. It adds neither a file write nor a new recipient.
36
+
37
+ ## Overdue recurring jobs on interactive resume
38
+
39
+ After restoring a session with terminal input and output, the scheduler holds recurring jobs that already had multiple missed occurrences for the first 60 seconds. One-shot reminders and jobs with only one occurrence due at restore follow their existing schedule. When the initial window ends, the scheduler waits for an idle turn before sending the existing coalesced run and advancing the saved cursor. The check uses elapsed time, including when the system clock changes.
40
+
41
+ ## Reply matching in the console
42
+
43
+ The bundled console carries the bridge's incoming message ID through the visible queue. During a completed turn with one addressed message, it matches the local Telegram receipt on chat ID and incoming message ID. A receipt for a different message leaves the existing text fallback available. Partial receipts and a matching reply call with an uncertain result suppress a resend that could duplicate a delivery. The fallback stores its confirmed send with the incoming message ID in the existing local Telegram outbox. Wire destinations and Telegram reply threading stay the same.
44
+
45
+ If a second addressed message joins the turn, even from the same chat, use the explicit Telegram reply tool with the address of each original message. Unaddressed group context stays silent. Existing permissions and chat settings apply. Mixed-source reply times still depend on the agent calling the tool.
46
+
47
+ ### Local active-turn admission in the bundle
48
+
49
+ When the console submits an addressed Telegram input into an ongoing local session using checked queue admission, it takes the chat ID and incoming message ID from the bridge queue item. Submission and receipt lookup bind both to the same runtime-scoped request. A lookup with either ID changed conflicts with the accepted request. Terminal input and older queue items without an address keep their existing receipt format.
50
+
51
+ The session's local journal keeps the address with the steer and with its context append. A receipt with disposition `context` confirms the append. A discarded steer can have an admission record without a context append. The extra address fields are stripped from the model's message projection. The existing input text, Telegram permissions, outbound confirmation, and gateway request format follow their existing paths. The address alone gives no authority to send a reply.
52
+
53
+ ### Reply opportunity during a local active turn
54
+
55
+ When a direct Telegram message joins the main agent's active turn and a model step finishes without attempting its reply, the next model request gets one instruction with that message's chat and incoming message IDs. If the first step was about to end the turn, the runtime allows an additional step for the reply. The instruction is transient and included in the normal request size check. It is sent to the same configured model endpoint as the message and uses the registered Telegram reply tool and the normal language and permission checks.
56
+
57
+ The correction runs after completed tool work and leaves active tools running. It does not schedule another attempt after a matching or ambiguous reply call. Filtered output, an explicit tool stop, and the goal budget retain their existing behavior. Group messages do not enter this direct-message recovery path. The instruction does not send a message by itself. Telegram confirmation still comes from the normal reply tool.
package/LIESMICH.txt CHANGED
@@ -1,26 +1,32 @@
1
- # blun-king-cli 9.1.647
1
+ # blun-king-cli 9.1.649
2
2
 
3
3
  ## Installieren und fortsetzen
4
4
 
5
5
  ```powershell
6
- npm install -g blun-king-cli@9.1.647
6
+ npm install -g blun-king-cli@9.1.649
7
7
  king -c
8
8
  ```
9
9
 
10
- Starte die Konsole nach der Installation selbst neu, damit sie die neue Version lädt. Die eingerichtete Telegram-Verbindung bleibt erhalten.
10
+ [Genau dieses Paket herunterladen](https://registry.npmjs.org/blun-king-cli/-/blun-king-cli-9.1.649.tgz).
11
11
 
12
- [Genau dieses Paket herunterladen](https://registry.npmjs.org/blun-king-cli/-/blun-king-cli-9.1.647.tgz).
12
+ ## Wiederaufnahme mit großem Verlauf
13
13
 
14
- ## Wann verdichtet wird
14
+ Der Wiederaufnahmepunkt speichert bei Änderungen am Systemprompt die letzte reine Prompt-Konfiguration. Der vollständige ursprüngliche Verlauf liegt weiterhin im lokalen Sitzungsjournal. Ist der Wiederaufnahmepunkt veraltet, wird der fehlende Teil des Journals einmal eingelesen. Im Test mit einem Journal von rund 54 MB dauerte das erneute Einlesen nach dem Aufbau des Wiederaufnahmepunkts rund fünf Millisekunden. Die Zeit bis zum ersten Modellaufruf hängt auch vom Start des Launchers und des Modells ab.
15
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.
16
+ Beim Fortsetzen kann King eine bereits erfolgreiche Kontoprüfung wiederverwenden, wenn der Modellkatalog denselben verwalteten Zugang bestätigt. Neue, geänderte oder unklare Zugänge werden geprüft.
17
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.
18
+ Wiederholungsaufträge, für die beim interaktiven Fortsetzen bereits mehrere Termine verpasst wurden, warten in den ersten 60 Sekunden. Nach dem Startfenster laufen sie gebündelt, sobald der Agent frei ist. Einmalige Erinnerungen und Wiederholungsaufträge mit nur einem fälligen Termin folgen der normalen Planung.
19
19
 
20
- ## Daten und Berechtigungen
20
+ ## Telegram-Antworten während eines Auftrags
21
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.
22
+ Wenn eine direkte Telegram-Nachricht in einen laufenden Auftrag aufgenommen wurde, kann der nächste Modellschritt sie gezielt beantworten. Hat das Modell die Nachricht im ersten möglichen Schritt übergangen, erhält es einmal eine zusätzliche Aufforderung mit dem richtigen Chat und der richtigen Eingangsnachricht. Ein bereits gestartetes Werkzeug arbeitet zu Ende. Bestehende Freigaben und die konfigurierte Empfängerliste gelten auch für diese Antwort.
23
23
 
24
- ## Grenzen
24
+ Die lokale Konsole bindet die Übernahme und den Zustellbeleg an dieselbe Nachricht. Nach einem bestätigten oder unklaren Sendeversuch löst die zusätzliche Aufforderung keinen erneuten Versand aus. Gruppen folgen ihrer bestehenden Konfiguration. Die Antwortzeit im laufenden Betrieb ist für diese Version noch nicht gemessen.
25
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.
26
+ ## Projektanweisungen und Datenfluss
27
+
28
+ Bei automatisch gefundenen `Mistake.md`-Dateien über 32 KiB verweist der Systemprompt auf die Datei. Relevante Einträge können bei Bedarf geladen werden. `AGENTS.md` und ausdrücklich eingebundene Anweisungen werden vollständig gelesen.
29
+
30
+ Die Chat- und Nachrichtenkennung liegt beim geprüften Einfügen in einen laufenden Turn im lokalen Sitzungsjournal. Der Antwortschritt gibt dem eingerichteten Modell die beiden Kennungen für die Zuordnung. Der Versand erfolgt über die bestehende Telegram-Verbindung. Aufbewahrung und Löschung des lokalen Journals folgen dem Sitzungsverzeichnis. Hinweise zum Originalverlauf, zum Bildleser und zur Entfernung alter Erweiterungen stehen in den früheren Versionshinweisen.
31
+
32
+ [Versionsverlauf](CHANGELOG.md).
@@ -0,0 +1,13 @@
1
+ # Captured original history
2
+
3
+ This experimental foundation connects the captured resume snapshot to the original-history reader. It is off by default and uses the same resolved feature snapshot as the TUI, including configuration overrides. It does not fetch a new flag decision directly from the process environment.
4
+
5
+ When enabled, Page Up and upward scrolling open the captured conversation. Home reaches its oldest page. Reading does not change the live transcript or consume model context. Live rendering keeps updating offscreen; leaving the reader restores the current live view. Editor shortcuts, including Ctrl+S, retain their existing handler.
6
+
7
+ The binding owns a private deep copy of the captured replay. Session, agent, binding generation and terminal width are checked before source access. A replaced or disposed owner cannot install an obsolete reader. Failed input takeover releases the candidate; a failing old adapter does not strand the original reading view. Render requests are coalesced and discarded after their owner ends.
8
+
9
+ Page-cache limits bound rendered rows and bytes, not the entire retained snapshot. The full captured replay remains in memory. A terminal-width change currently invalidates the binding; automatic rewrapping with a stable anchor, refresh from newer live events, backend paging and external retained-output access remain open. The separate [saved tool output reader](ORIGINAL-TOOL-OUTPUT.md) extends this experiment beyond the live preview caps. This is not completion of the full history work or a release-ready feature.
10
+
11
+ Tests exercise the actual pinned bundle's snapshot lifecycle, keyboard, scrollback and component rendering with 10,001 records. Initial live rendering and hydration are isolated in that test. Separate source-reader checks visit every captured small tool result without writing to the live transcript. No production TUI, session, bot or service is started.
12
+
13
+ The source runtime differs from the packaged repair target. The source registry and artifact patch both register the flag; a source build alone does not prove the repaired package behavior. No new network destination, telemetry or persistent store is added.
@@ -0,0 +1,15 @@
1
+ # Saved tool output reader
2
+
3
+ This addition extends the disabled `original_history` experiment. After opening the captured history with Page Up, press `t` to choose a saved tool output. The existing searchable picker lists outputs in capture order, with a tool name and ordinal. Reused tool-call IDs remain separate choices. Typing `t` in the normal editor keeps its existing behavior.
4
+
5
+ Selecting an output opens its first page. Page Up, Page Down, arrows and mouse-wheel navigation read the projected output; Home returns to the first page. Escape, End or ordinary editor input leaves the reader and restores the live view. Opening another output and cancelling leaves the captured history available immediately. Ctrl+S in the picker restores the editor and calls its existing queue handler once. This does not establish a delivery-time guarantee.
6
+
7
+ The reader applies the existing image projection and whole-output display sanitizer before paging. Existing credential redaction and terminal-control handling remain in force, including the sanitizer's current whitespace normalization. The live tool-card preview keeps its existing character and row caps. The detail reader can reach the full saved display projection beyond those caps; it does not recover external retained output files or expose unredacted bytes.
8
+
9
+ Pages wrap on grapheme boundaries using the real terminal-width function. Private cursors cannot be transferred between sources. The adapter loads pages lazily and limits its rendered cache to three pages, 4,096 rows and 8 MiB; each detail page has at most 128 rows. Invalid options are rejected before projection. These limits do not bound the full captured replay, sanitized output string, choice list or cursor index in memory.
10
+
11
+ Session, agent, owner, editor-panel generation and captured width fence the selection and reader. Cancellation restores only the owned picker; newer panels remain untouched. A stale asynchronous load cannot take over a newer panel. A current load failure restores history and reports one error. Reading adds no network destination, telemetry or persistent store.
12
+
13
+ The actual pinned bundle is tested as a library, with its real picker, editor replacement methods, scrollback and rendering components. Checks cover 12,000 saved result markers, both paging directions, redaction, repeated call IDs, searchable selection, Kitty keyboard input, cancellation, queue callback and delayed loads. The normal program entry point is removed only in the test copy. No production TUI, agent, bot or service is started.
14
+
15
+ This is an experimental implementation, not the complete PDF history/output work. Stable resize anchors, refresh from newer live events, backend paging, external full-output retrieval and copying remain open. The source runtime and packaged repair target differ; the final composed package still needs independent review and installation checks before publication.
package/README.md CHANGED
@@ -1,26 +1,32 @@
1
- # blun-king-cli 9.1.647
1
+ # blun-king-cli 9.1.649
2
2
 
3
3
  ## Installieren und fortsetzen
4
4
 
5
5
  ```powershell
6
- npm install -g blun-king-cli@9.1.647
6
+ npm install -g blun-king-cli@9.1.649
7
7
  king -c
8
8
  ```
9
9
 
10
- Starte die Konsole nach der Installation selbst neu, damit sie die neue Version lädt. Die eingerichtete Telegram-Verbindung bleibt erhalten.
10
+ [Genau dieses Paket herunterladen](https://registry.npmjs.org/blun-king-cli/-/blun-king-cli-9.1.649.tgz).
11
11
 
12
- [Genau dieses Paket herunterladen](https://registry.npmjs.org/blun-king-cli/-/blun-king-cli-9.1.647.tgz).
12
+ ## Wiederaufnahme mit großem Verlauf
13
13
 
14
- ## Wann verdichtet wird
14
+ Der Wiederaufnahmepunkt speichert bei Änderungen am Systemprompt die letzte reine Prompt-Konfiguration. Der vollständige ursprüngliche Verlauf liegt weiterhin im lokalen Sitzungsjournal. Ist der Wiederaufnahmepunkt veraltet, wird der fehlende Teil des Journals einmal eingelesen. Im Test mit einem Journal von rund 54 MB dauerte das erneute Einlesen nach dem Aufbau des Wiederaufnahmepunkts rund fünf Millisekunden. Die Zeit bis zum ersten Modellaufruf hängt auch vom Start des Launchers und des Modells ab.
15
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.
16
+ Beim Fortsetzen kann King eine bereits erfolgreiche Kontoprüfung wiederverwenden, wenn der Modellkatalog denselben verwalteten Zugang bestätigt. Neue, geänderte oder unklare Zugänge werden geprüft.
17
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.
18
+ Wiederholungsaufträge, für die beim interaktiven Fortsetzen bereits mehrere Termine verpasst wurden, warten in den ersten 60 Sekunden. Nach dem Startfenster laufen sie gebündelt, sobald der Agent frei ist. Einmalige Erinnerungen und Wiederholungsaufträge mit nur einem fälligen Termin folgen der normalen Planung.
19
19
 
20
- ## Daten und Berechtigungen
20
+ ## Telegram-Antworten während eines Auftrags
21
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.
22
+ Wenn eine direkte Telegram-Nachricht in einen laufenden Auftrag aufgenommen wurde, kann der nächste Modellschritt sie gezielt beantworten. Hat das Modell die Nachricht im ersten möglichen Schritt übergangen, erhält es einmal eine zusätzliche Aufforderung mit dem richtigen Chat und der richtigen Eingangsnachricht. Ein bereits gestartetes Werkzeug arbeitet zu Ende. Bestehende Freigaben und die konfigurierte Empfängerliste gelten auch für diese Antwort.
23
23
 
24
- ## Grenzen
24
+ Die lokale Konsole bindet die Übernahme und den Zustellbeleg an dieselbe Nachricht. Nach einem bestätigten oder unklaren Sendeversuch löst die zusätzliche Aufforderung keinen erneuten Versand aus. Gruppen folgen ihrer bestehenden Konfiguration. Die Antwortzeit im laufenden Betrieb ist für diese Version noch nicht gemessen.
25
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.
26
+ ## Projektanweisungen und Datenfluss
27
+
28
+ Bei automatisch gefundenen `Mistake.md`-Dateien über 32 KiB verweist der Systemprompt auf die Datei. Relevante Einträge können bei Bedarf geladen werden. `AGENTS.md` und ausdrücklich eingebundene Anweisungen werden vollständig gelesen.
29
+
30
+ Die Chat- und Nachrichtenkennung liegt beim geprüften Einfügen in einen laufenden Turn im lokalen Sitzungsjournal. Der Antwortschritt gibt dem eingerichteten Modell die beiden Kennungen für die Zuordnung. Der Versand erfolgt über die bestehende Telegram-Verbindung. Aufbewahrung und Löschung des lokalen Journals folgen dem Sitzungsverzeichnis. Hinweise zum Originalverlauf, zum Bildleser und zur Entfernung alter Erweiterungen stehen in den früheren Versionshinweisen.
31
+
32
+ [Versionsverlauf](CHANGELOG.md).
@@ -0,0 +1,64 @@
1
+ # blun-king-cli 9.1.648
2
+
3
+ ## Installieren und fortsetzen
4
+
5
+ Schließe die laufenden King-Konsolen vor dem Update selbst. Installiere diese Version und starte King anschließend erneut:
6
+
7
+ ```powershell
8
+ npm install -g blun-king-cli@9.1.648
9
+ king -c
10
+ ```
11
+
12
+ [Genau dieses Paket herunterladen](https://registry.npmjs.org/blun-king-cli/-/blun-king-cli-9.1.648.tgz).
13
+
14
+ ## Antworten und Eingaben während der Verdichtung
15
+
16
+ Telegram-Antwortwerkzeuge bleiben in einer laufenden Goal-Kette verfügbar, wenn eine vertrauenswürdige Nutzernachricht die nötige Berechtigung erteilt. Eine Hintergrundnachricht kann diese Berechtigung nicht allein durch ihren Text oder ihre Rollenbezeichnung erteilen. Bestehende Berechtigungen, die konfigurierte Liste erlaubter Telegram-Chats und die Empfängerregeln gelten weiterhin.
17
+
18
+ Bei einer ausdrücklichen Antwort hält die Telegram-Erweiterung im vorhandenen lokalen Ausgangsprotokoll den Chat, die Eingangsnachricht und die von Telegram bestätigten Ausgangsnachrichten fest. Die Prüfung auf Wiederholungen unterscheidet damit gleichlautende Antworten auf verschiedene Nachrichten. Scheitert ein mehrteiliger Versand, bleiben die bereits bestätigten Teile nachvollziehbar. Die Einstellung für sichtbare Antwortverknüpfungen gilt weiterhin.
19
+
20
+ Ausstehende Eingaben werden nach asynchroner Vorbereitung und Verdichtung erneut geprüft, bevor die nächste Modellanfrage verbindlich übernommen wird. Das schließt die getestete Lücke am Übergang zum nächsten Schritt. Eine Zustellung innerhalb von sechzig Sekunden ist damit im laufenden Betrieb nicht nachgewiesen. Langes Nachdenken des Modells kann eine Antwort weiterhin verzögern.
21
+
22
+ ## Gelernte Anfragegrenzen
23
+
24
+ Für die erkannten BLUN-Endpunkte gilt als Standard eine Grenze von 700.000 UTF-8-Byte für den vollständigen Anfragekörper. Neue Serverbeobachtungen verfallen nach fünfzehn Minuten. Der historische, unversionierte Beobachtungswert von 500.000 Byte senkt diesen Standard nicht mehr dauerhaft ab. Ausdrückliche Konfigurationswerte und frische niedrigere Servergrenzen bleiben wirksam. Die Byte-Grenze ist von der Token-Schwelle getrennt; sie garantiert keine 250.000 Token pro Anfrage.
25
+
26
+ ## Experimenteller Originalverlauf
27
+
28
+ Der Leser für den Originalverlauf bleibt experimentell und standardmäßig ausgeschaltet. Ist er aktiviert, öffnen Bild auf und Aufwärtsscrollen den bei der Wiederaufnahme erfassten Verlauf; Pos1 führt zur ältesten Seite. Innerhalb des Lesers öffnet T die Auswahl gespeicherter Werkzeugausgaben. Die Detailansicht kann den gespeicherten Text über die Grenzen der laufenden Vorschau hinaus anzeigen.
29
+
30
+ Der Leser verwendet derzeit eine erfasste Momentaufnahme. Ändert sich die Terminalbreite, wird die Ansicht ungültig. Eine stabile Leseposition bei Größenänderungen, die Aktualisierung mit neuen Ereignissen aus der laufenden Sitzung, seitenweises Laden vom Backend, gesondert extern aufbewahrte Ausgaben und Kopieren bleiben offen. Der Cache gerenderter Seiten ist begrenzt; die vollständige erfasste Momentaufnahme bleibt im Arbeitsspeicher. Der vollständig scrollbare Verlauf ist damit noch nicht fertiggestellt.
31
+
32
+ ## Kompatibilität beim Start
33
+
34
+ Launcher, Konsole und Worker können Einstellungen mit vorangestellter UTF-8-BOM lesen. Die Dateien behalten beim Lesen ihre ursprünglichen Bytes. Ein beschädigtes ungenutztes Profil blockiert kein sauberes aktives Profil mehr; eine aufgeschobene Bereinigung wird gemeldet. Unbeteiligte verknüpfte Einstellungsdateien können unverändert bleiben. Eine erforderliche Änderung an verknüpften Einstellungen wird abgelehnt.
35
+
36
+ ## Automatische Entfernung
37
+
38
+ Beim nächsten normalen Start entfernt King die Registrierung des ausgemusterten AgentSpine-Plugins, dessen Hooks und MCP-Eintrag, verwaltete Pluginkopien, den Plugin-Zustand unter `state/agent-spine` und `agentspine` im King-Anwendungsverzeichnis, den kopierten Skill und den alten Reader-Launcher. Das gilt für das gemeinsame King-Verzeichnis und seine benannten Profile, einschließlich verwaister Pluginkopien aus früheren Updates. Geerbte AgentSpine-Laufzeitvariablen werden dem neuen Kernprozess nicht mitgegeben.
39
+
40
+ Andere Konfigurationswerte bleiben erhalten. Muss aus einer TOML-Datei ein MCP-Eintrag entfernt werden, wird sie neu geschrieben; ihre Kommentare und Formatierung bleiben dabei nicht erhalten. Dateien ohne Änderungsbedarf bleiben bytegleich.
41
+
42
+ ## Verbliebene Arbeitsdateien
43
+
44
+ Fünf bekannte Pfade sind von der automatischen Löschung ausgenommen. Daneben steht jeweils der erwartete Schemaname; jede Logzeile muss das angegebene Logschema haben:
45
+
46
+ - `worker/goal-status-v2.json` — `blun.king-goal-status/v2`
47
+ - `worker/goal-status-v2.json.lock` — `agentspine.owned-file-lock/v1`
48
+ - `worker/goal-queue-checkpoint.json` — `blun.king-goal-queue-checkpoint/v1`
49
+ - `worker/worker.log` — `blun.king-goal-worker-log/v1`
50
+ - `skills/.agent-spine-install.lock` — `agentspine.owned-file-lock/v1`
51
+
52
+ Ein gesondert gestarteter alter Worker kann nach dem Schließen eines King-Fensters weiterlaufen. Seine Annahme- und Zustellnachweise verhindern doppelte Aufträge und Nachrichten. Eine fehlende oder alte Sperrdatei beweist nicht, dass der zugehörige Prozess beendet ist. Die Bereinigung meldet diese Pfadkandidaten als ausstehend; sie liest deren Inhalte nicht und löscht sie nicht. Ein sauberes aktives Profil kann trotzdem starten.
53
+
54
+ Beende für die manuelle Bereinigung zuerst den eindeutig zugeordneten alten Worker und etwaige alte Skill-Installationsprozesse. Prüfe das genaue aktive oder gemeinsame King-Verzeichnis, die Zugehörigkeit und das Schema jeder Datei sowie, dass weder übergeordnete Verzeichnisse noch die Datei selbst verknüpft sind oder die Datei über einen Hardlink geteilt wird. Entferne erst danach die oben aufgeführten veralteten Dateien einzeln. Ist eine Datei unbekannt, beschädigt, unzugänglich oder noch in Benutzung, lasse sie zur Prüfung bestehen. Erhalte die Verzeichnisse `worker` und `skills` sowie alle anderen Dateien. Die automatische Datenentfernung ist damit ausdrücklich noch nicht vollständig abgeschlossen.
55
+
56
+ ## Umfang, Datenfluss und Fehlerfälle
57
+
58
+ Die Entfernung beschränkt sich auf die bekannten King-Installationspfade. Registrierungspfade außerhalb dieser Orte, Projektdateien, Gesprächsverläufe und außerhalb des King-Verzeichnisses mit anderen Anwendungen geteilte Daten werden nicht gelöscht. Das historische AgentSpine-Zustandsverzeichnis außerhalb des King-Verzeichnisses wird von mehreren Hosts gemeinsam verwendet und kann nicht als ausschließlich zu King gehörend betrachtet werden.
59
+
60
+ Bei einem verknüpften, veränderten, unlesbaren oder gesperrten Bereinigungsziel wird die Entfernung nicht als erfolgreich gemeldet. Die Bereinigung wird beim nächsten normalen Start erneut versucht. Die Migration startet keine TUI, keinen Bot und keinen Dienst neu.
61
+
62
+ Es wird kein neuer externer Empfänger ergänzt. Antwortwerkzeuge nutzen die bestehende Telegram-Verbindung. Gelernte Anfragegrenzen ergänzen die vorhandene Tabelle mit Endpunkt-Hashes um eine Version und einen lokalen Beobachtungszeitpunkt; der Verfall löscht den gespeicherten Eintrag nicht. Der experimentelle Leser hält eine private Kopie erfasster Gesprächseinträge im Arbeitsspeicher. Es werden keine Migrationsdaten übertragen.
63
+
64
+ Dieses Paket bündelt Reparaturen am veröffentlichten Laufzeitstand. Der Laufzeitstand im Quellrepository unterscheidet sich davon; ein Quellbuild allein belegt das Verhalten dieses Pakets nicht. Die mitgelieferten technischen Hinweise beschreiben die geprüften Abläufe und verbleibenden Grenzen.
@@ -0,0 +1,32 @@
1
+ # blun-king-cli 9.1.649
2
+
3
+ ## Installieren und fortsetzen
4
+
5
+ ```powershell
6
+ npm install -g blun-king-cli@9.1.649
7
+ king -c
8
+ ```
9
+
10
+ [Genau dieses Paket herunterladen](https://registry.npmjs.org/blun-king-cli/-/blun-king-cli-9.1.649.tgz).
11
+
12
+ ## Wiederaufnahme mit großem Verlauf
13
+
14
+ Der Wiederaufnahmepunkt speichert bei Änderungen am Systemprompt die letzte reine Prompt-Konfiguration. Der vollständige ursprüngliche Verlauf liegt weiterhin im lokalen Sitzungsjournal. Ist der Wiederaufnahmepunkt veraltet, wird der fehlende Teil des Journals einmal eingelesen. Im Test mit einem Journal von rund 54 MB dauerte das erneute Einlesen nach dem Aufbau des Wiederaufnahmepunkts rund fünf Millisekunden. Die Zeit bis zum ersten Modellaufruf hängt auch vom Start des Launchers und des Modells ab.
15
+
16
+ Beim Fortsetzen kann King eine bereits erfolgreiche Kontoprüfung wiederverwenden, wenn der Modellkatalog denselben verwalteten Zugang bestätigt. Neue, geänderte oder unklare Zugänge werden geprüft.
17
+
18
+ Wiederholungsaufträge, für die beim interaktiven Fortsetzen bereits mehrere Termine verpasst wurden, warten in den ersten 60 Sekunden. Nach dem Startfenster laufen sie gebündelt, sobald der Agent frei ist. Einmalige Erinnerungen und Wiederholungsaufträge mit nur einem fälligen Termin folgen der normalen Planung.
19
+
20
+ ## Telegram-Antworten während eines Auftrags
21
+
22
+ Wenn eine direkte Telegram-Nachricht in einen laufenden Auftrag aufgenommen wurde, kann der nächste Modellschritt sie gezielt beantworten. Hat das Modell die Nachricht im ersten möglichen Schritt übergangen, erhält es einmal eine zusätzliche Aufforderung mit dem richtigen Chat und der richtigen Eingangsnachricht. Ein bereits gestartetes Werkzeug arbeitet zu Ende. Bestehende Freigaben und die konfigurierte Empfängerliste gelten auch für diese Antwort.
23
+
24
+ Die lokale Konsole bindet die Übernahme und den Zustellbeleg an dieselbe Nachricht. Nach einem bestätigten oder unklaren Sendeversuch löst die zusätzliche Aufforderung keinen erneuten Versand aus. Gruppen folgen ihrer bestehenden Konfiguration. Die Antwortzeit im laufenden Betrieb ist für diese Version noch nicht gemessen.
25
+
26
+ ## Projektanweisungen und Datenfluss
27
+
28
+ Bei automatisch gefundenen `Mistake.md`-Dateien über 32 KiB verweist der Systemprompt auf die Datei. Relevante Einträge können bei Bedarf geladen werden. `AGENTS.md` und ausdrücklich eingebundene Anweisungen werden vollständig gelesen.
29
+
30
+ Die Chat- und Nachrichtenkennung liegt beim geprüften Einfügen in einen laufenden Turn im lokalen Sitzungsjournal. Der Antwortschritt gibt dem eingerichteten Modell die beiden Kennungen für die Zuordnung. Der Versand erfolgt über die bestehende Telegram-Verbindung. Aufbewahrung und Löschung des lokalen Journals folgen dem Sitzungsverzeichnis. Hinweise zum Originalverlauf, zum Bildleser und zur Entfernung alter Erweiterungen stehen in den früheren Versionshinweisen.
31
+
32
+ [Versionsverlauf](CHANGELOG.md).
@@ -0,0 +1,17 @@
1
+ # Request body limit observations
2
+
3
+ The packaged provider measures the UTF-8 bytes of the complete JSON request, including tool definitions. For ordinary model requests, at or above the effective byte ceiling it requests recovery before transport. The existing special compaction-request bypass is unchanged. This byte boundary is separate from the token compaction threshold: a 700,000-byte ceiling does not guarantee that a request can contain 250,000 tokens.
4
+
5
+ The two recognized HTTPS BLUN API endpoints use a 700,000-byte fallback. Unknown endpoints receive no guessed product limit. Explicit configuration remains effective, including an explicitly configured 500,000-byte ceiling. A fresh lower ceiling reported by a provider error still bounds that configuration.
6
+
7
+ New learned observations contain a version, a byte limit and a local observation timestamp. They expire after fifteen minutes. The newest valid observation wins; equal timestamps choose the smaller limit. Invalid, future-dated and expired records are ignored. An expired versioned runtime record cannot reactivate its numeric compatibility shadow. Provider clones replace records rather than mutating shared records.
8
+
9
+ The migration ignores only the unversioned historic value 500,000 at the recognized product endpoints. Other legacy numeric observations retain their previous behavior, including those for foreign endpoints. A fresh, versioned 500,000-byte server observation remains effective until expiry. A later higher server observation can replace an earlier lower one.
10
+
11
+ Records stay in the existing request_body_byte_limits TOML table, keyed by the existing endpoint hash. The normal configuration writer merges the latest table. No message text, credentials, account identifier or new destination is added, and learning uses the existing provider-error path. This change adds no network request. Expiry affects whether a record is used; it does not automatically erase the record from disk. The fifteen-minute lifetime is a local cache policy, not a server-provided promise.
12
+
13
+ The existing configuration lock and atomic writer are reused. The lock retains its best-effort timeout and stale-lock behavior. Tests cover parallel saves, an overlapping save and stale configuration write under an intact lock, and preservation of unrelated settings; they do not establish race freedom under every interprocess failure.
14
+
15
+ Regression tests extract measurement and learning from both packaged cores. A separate test imports the main bundle as a library without running its entry point and uses its actual TOML parser, serializer, atomic writer and configuration writer. Patch guards reject missing or duplicate target definitions and partial helper injection. These checks do not prove live server settings, a response-time bound, or final installation behavior.
16
+
17
+ This repair targets the packaged runtime. The source runtime differs, and the final composed package still needs installation checks and independent package review before publication.
@@ -0,0 +1,25 @@
1
+ # Retained legacy worker files
2
+
3
+ On the next normal start, King removes the retired AgentSpine plugin registration, its hooks and MCP entry, managed plugin copies, plugin state under `state/agent-spine` and `agentspine` in the King application directory, the copied skill and the old reader launcher. This covers the shared King directory and its named profiles, including orphaned plugin copies from previous updates. Inherited AgentSpine runtime variables are not passed to the new core process.
4
+
5
+ ## Retained working files
6
+
7
+ Five known paths are excluded from automatic deletion. Their expected schema names are listed beside them; every log line must have the stated log schema:
8
+
9
+ - `worker/goal-status-v2.json` — `blun.king-goal-status/v2`
10
+ - `worker/goal-status-v2.json.lock` — `agentspine.owned-file-lock/v1`
11
+ - `worker/goal-queue-checkpoint.json` — `blun.king-goal-queue-checkpoint/v1`
12
+ - `worker/worker.log` — `blun.king-goal-worker-log/v1`
13
+ - `skills/.agent-spine-install.lock` — `agentspine.owned-file-lock/v1`
14
+
15
+ A separately started old worker can remain active after a King window closes. Its acceptance and delivery records prevent duplicate jobs and messages. A missing or old lock does not prove that its process has stopped. The installer reports these candidate paths as pending; it does not read their contents or delete them. A clean active profile can still start.
16
+
17
+ For manual cleanup, first stop the clearly identified old worker and any old skill installation process. Verify the exact active or shared King home, the ownership and schema of each file, and that no parent or target is a link or shared hardlink. Only then remove the individual obsolete files listed above. If a file is unknown, malformed, inaccessible or still in use, leave it in place for inspection. Keep the `worker` and `skills` directories and every other file. This procedure does not mean that automatic data removal is complete.
18
+
19
+ ## What startup checks
20
+
21
+ The report uses only the presence of the five candidate names and canonical parent paths. It does not open file contents, inspect process arguments, infer abandonment from file age, stop a worker, or delete any working file. An inaccessible or redirected parent is reported conservatively as pending. Unrelated directory entries are not enumerated or removed.
22
+
23
+ Presence is not an ownership or quiescence proof. The aggregate candidate list does not preserve profile attribution and must not be used as a deletion manifest. A pending candidate makes cleanup incomplete while allowing the clean active profile to launch. Separate inactive-profile failures retain their existing notice.
24
+
25
+ No new persistent record, recipient or network request is introduced. The existing plugin/settings/payload retirement still runs; these additional working files and installation locks remain an explicit exception. No operating-system restart detection or automatic process termination is implemented.
@@ -0,0 +1,11 @@
1
+ # Startup compatibility during legacy cleanup
2
+
3
+ Cleanup accepts a leading UTF-8 BOM in JSON and TOML. Unchanged configuration and registry files keep their original bytes.
4
+
5
+ A malformed or unavailable inactive profile defers its cleanup and shows one warning while the active profile starts. Invalid profile names are ignored. A malformed active profile still blocks startup.
6
+
7
+ Linked configuration is inspected without mutation; cleanup rejects a linked file when a retired entry needs removal. Existing launcher private-file checks remain in force.
8
+
9
+ Regular files at the exact retired skill and reader paths are also removed. Named profiles infer their shared home when it is not supplied.
10
+
11
+ Tests cover 39 unit cases and four actual-launcher compatibility cases without starting a production TUI or service. Legacy worker residues remain a separate open item; these checks do not establish complete removal or a finished release.
package/bin/blun.js CHANGED
File without changes
File without changes
package/bin/king.js CHANGED
File without changes
@@ -65,7 +65,7 @@ function runtimePolicyEnvironment(blunDir) {
65
65
 
66
66
  function createLauncherEnvironment(sourceEnv, mode, publicPackageVersion, blunDir) {
67
67
  return {
68
- ...sourceEnv,
68
+ ...Object.fromEntries(Object.entries(sourceEnv).filter(([name]) => !/^AGENTSPINE_/i.test(name))),
69
69
  ...runtimePolicyEnvironment(blunDir),
70
70
  BLUN_NO_AUTO_UPDATE: '1',
71
71
  BLUN_PUBLIC_PACKAGE_VERSION: publicPackageVersion,
@@ -662,7 +662,20 @@ async function runLauncher(options = {}) {
662
662
  require('./verify-bundled-agent-sources.cjs').verifyBundledAgentSources(PKG);
663
663
 
664
664
  // --- 3. BLUN-Standard-MCPs additiv im Benutzerprofil einrichten ---------
665
- await require('./retired-bundled-plugins.cjs').retireBundledPlugins({ blunDir, io: startupSecurity });
665
+ const retirement = require('./retired-installation.cjs');
666
+ const privatePaths = getPrivatePaths();
667
+ try {
668
+ const result = await retirement.uninstallRetiredProfiles({ blunDir, io: startupSecurity,
669
+ sharedHome: privatePaths.sharedHome });
670
+ const notices = [];
671
+ if (result.deferredProfiles.length > 0) notices.push('Einige ungenutzte King-Profile konnten noch nicht vollständig bereinigt werden. Das aktive Profil startet; beim nächsten normalen Start wird die Bereinigung erneut versucht.');
672
+ if (result.deferredWorkerFiles.length > 0) notices.push('Einige alte Arbeitsdateien sind noch vorhanden. Beende noch laufende alte Hintergrundprozesse, bevor du diese Dateien einzeln entfernst. Die Versionsdokumentation erklärt die Schritte zur Bereinigung.');
673
+ if (notices.length > 0) process.stderr.write(notices.join('\n') + '\n');
674
+ } catch {
675
+ process.stderr.write('AgentSpine konnte noch nicht vollständig entfernt werden. Schließe andere King-Fenster und starte King erneut. Bleibt der Fehler bestehen, prüfe die Dateiberechtigungen.\n');
676
+ process.exitCode = 1;
677
+ return;
678
+ }
666
679
 
667
680
  // --- 5. Telegram-Plugin + Token-Vorlage (nur King) -----------------------
668
681
  if (mode === LAUNCHER_MODES.KING) {
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -18,7 +18,7 @@ function isObject(value) {
18
18
  function readInstalledPlugins(filePath) {
19
19
  if (!fs.existsSync(filePath)) return { version: 1, plugins: [] };
20
20
 
21
- const parsed = JSON.parse(fs.readFileSync(filePath, 'utf8'));
21
+ const parsed = JSON.parse(fs.readFileSync(filePath, 'utf8').replace(/^\uFEFF/u, ''));
22
22
  if (!isObject(parsed) || parsed.version !== 1 || !Array.isArray(parsed.plugins)
23
23
  || !parsed.plugins.every(isObject)) {
24
24
  throw new Error(`Ungültige Plugin-Konfiguration: ${filePath}`);
File without changes
@@ -44,7 +44,8 @@ function readRegistry(filename) {
44
44
  || currentPath.dev !== before.dev || currentPath.ino !== before.ino || currentPath.isSymbolicLink()) {
45
45
  throw new Error('PLUGIN_REGISTRY_CHANGED');
46
46
  }
47
- const document = JSON.parse(bytes.toString('utf8'));
47
+ const text = bytes.toString('utf8');
48
+ const document = JSON.parse(text.codePointAt(0) === 0xFEFF ? text.slice(1) : text);
48
49
  if (document?.version !== 1 || !Array.isArray(document.plugins)
49
50
  || document.plugins.some((entry) => !entry || typeof entry !== 'object' || Array.isArray(entry))) {
50
51
  throw new Error('INVALID_PLUGIN_REGISTRY_DOCUMENT');
@@ -0,0 +1,103 @@
1
+ 'use strict';
2
+
3
+ const fs = require('node:fs');
4
+ const path = require('node:path');
5
+ const { retireBundledPlugins } = require('./retired-bundled-plugins.cjs');
6
+ const { retireSettings } = require('./retired-settings.cjs');
7
+ const { inspectRetiredWorkerResidues } = require('./retired-worker-residues.cjs');
8
+ const { samePath, canonicalDirectory, optionalStat, planRetiredTree, removeRetiredTree } = require('./retired-owned-tree.cjs');
9
+
10
+ const PAYLOAD_NAME = /^(?:agent-spine(?:-[a-f0-9]{64})?|\.agent-spine-selected-\d+-[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}\.tmp)$/;
11
+ const PROFILE_NAME = /^[a-z0-9][a-z0-9_-]{0,31}$/u;
12
+
13
+ function installationPlans(blunDir) {
14
+ canonicalDirectory(blunDir);
15
+ const plans = [];
16
+ const add = (parent, name, allowFile = false) => {
17
+ const plan = planRetiredTree(parent, name, { allowFile });
18
+ if (plan && !plans.some(existing => existing.root === plan.root)) plans.push(plan);
19
+ };
20
+ const managed = path.join(blunDir, 'plugins', 'managed');
21
+ if (optionalStat(managed)) {
22
+ canonicalDirectory(managed);
23
+ for (const name of fs.readdirSync(managed).toSorted()) {
24
+ const comparable = process.platform === 'win32' ? name.toLowerCase() : name;
25
+ if (PAYLOAD_NAME.test(comparable)) add(managed, name);
26
+ }
27
+ }
28
+ add(path.join(blunDir, 'state'), 'agent-spine', true);
29
+ add(path.join(blunDir, 'skills'), 'agent-spine', true);
30
+ add(blunDir, 'agentspine', true);
31
+ return plans;
32
+ }
33
+
34
+ async function uninstallRetiredInstallation({ blunDir, io }) {
35
+ blunDir = path.resolve(blunDir);
36
+ canonicalDirectory(blunDir);
37
+ // Disable plugin hooks/MCP/skills before deleting their installed payload.
38
+ // A locked/unsafe tree fails visibly and is retried at the next normal start.
39
+ const registration = await retireBundledPlugins({ blunDir, io });
40
+ const changedSettings = await retireSettings({ blunDir, io });
41
+ const plans = installationPlans(blunDir);
42
+ let removedFiles = 0;
43
+ for (const plan of plans) removedFiles += removeRetiredTree(plan);
44
+ if (installationPlans(blunDir).length > 0) throw new Error('RETIRED_INSTALLATION_CHANGED');
45
+ const deferredWorkerFiles = inspectRetiredWorkerResidues(blunDir);
46
+ return { complete: deferredWorkerFiles.length === 0, deferredWorkerFiles,
47
+ removedRegistrations: registration.removed, changedSettings,
48
+ removedTrees: plans.length, removedFiles };
49
+ }
50
+
51
+ async function uninstallRetiredProfiles({ blunDir, sharedHome, io }) {
52
+ blunDir = path.resolve(blunDir);
53
+ sharedHome ??= samePath(path.basename(path.dirname(blunDir)), 'profile') && PROFILE_NAME.test(path.basename(blunDir))
54
+ ? path.dirname(path.dirname(blunDir)) : blunDir;
55
+ sharedHome = path.resolve(sharedHome);
56
+ if (!samePath(blunDir, sharedHome) && !samePath(path.dirname(blunDir), path.join(sharedHome, 'profile'))) {
57
+ throw new Error('RETIRED_INSTALLATION_PROFILE_SCOPE');
58
+ }
59
+ canonicalDirectory(sharedHome);
60
+ canonicalDirectory(blunDir);
61
+ const profileRoot = path.join(sharedHome, 'profile');
62
+ const homes = new Map();
63
+ const addHome = home => homes.set(process.platform === 'win32' ? home.toLowerCase() : home, home);
64
+ addHome(sharedHome);
65
+ addHome(blunDir);
66
+ const deferredProfiles = [];
67
+ try {
68
+ if (optionalStat(profileRoot)) {
69
+ canonicalDirectory(profileRoot);
70
+ const entries = fs.readdirSync(profileRoot, { withFileTypes: true });
71
+ if (entries.length > 4096) throw new Error('RETIRED_INSTALLATION_LIMIT');
72
+ for (const entry of entries) {
73
+ if (!PROFILE_NAME.test(entry.name)) continue;
74
+ if (entry.isDirectory() || entry.isSymbolicLink()) {
75
+ const home = path.join(profileRoot, entry.name);
76
+ try { canonicalDirectory(home); addHome(home); }
77
+ catch (error) {
78
+ if (samePath(home, blunDir)) throw error;
79
+ deferredProfiles.push({ profile: entry.name, reason: 'RETIRED_PROFILE_UNAVAILABLE' });
80
+ }
81
+ }
82
+ }
83
+ }
84
+ } catch {
85
+ deferredProfiles.push({ profile: '(catalog)', reason: 'RETIRED_PROFILE_UNAVAILABLE' });
86
+ }
87
+ const results = [];
88
+ for (const home of homes.values()) {
89
+ try { results.push(await uninstallRetiredInstallation({ blunDir: home, io })); }
90
+ catch (error) {
91
+ if (samePath(home, blunDir)) throw error;
92
+ deferredProfiles.push({ profile: samePath(home, sharedHome) ? '(shared)' : path.basename(home),
93
+ reason: 'RETIRED_PROFILE_INCOMPLETE' });
94
+ }
95
+ }
96
+ const deferredWorkerFiles = results.flatMap(result => result.deferredWorkerFiles);
97
+ return { complete: deferredProfiles.length === 0 && deferredWorkerFiles.length === 0,
98
+ deferredProfiles, deferredWorkerFiles, profiles: results.length,
99
+ removedTrees: results.reduce((sum, item) => sum + item.removedTrees, 0),
100
+ removedFiles: results.reduce((sum, item) => sum + item.removedFiles, 0) };
101
+ }
102
+
103
+ module.exports = { uninstallRetiredInstallation, uninstallRetiredProfiles };