blun-king-cli 9.1.103 → 9.1.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LIESMICH.txt CHANGED
@@ -9,7 +9,7 @@ Installation
9
9
  ------------
10
10
  Die geprüfte Version exakt global installieren:
11
11
 
12
- npm install -g blun-king-cli@9.1.100
12
+ npm install -g blun-king-cli@9.1.105
13
13
 
14
14
  Start
15
15
  -----
@@ -91,6 +91,8 @@ Ab BLUN King 9.1.98 kann King einen abgeschlossenen Arbeitsabschnitt verdichten,
91
91
 
92
92
  Große textbasierte Werkzeugergebnisse bleiben nicht mehr vollständig im Modellkontext. Ab 12.001 Zeichen speichert BLUN King das vollständige Ergebnis in einer privaten Datei im Sitzungsordner `tool-results`. Im Modellkontext verbleiben die ersten 1.000 und die letzten 1.000 Zeichen, die genaue Zahl der ausgelassenen Zeichen und der `output_path`. Der Agent kann das vollständige Ergebnis anschließend mit `Read` seitenweise über diesen Pfad lesen. Ergebnisse bis einschließlich 12.000 Zeichen, gemischte Medienergebnisse und bereits gekürzte Ergebnisse bleiben unverändert. Auch eine spätere Mikroverdichtung bewahrt den Dateiverweis. Beispiel: Bei einem Suchergebnis mit 30.000 Zeichen sehen folgende Modellanfragen den Anfang und das abschließende Ergebnis oder den Fehler; der vollständige Text bleibt lokal verfügbar.
93
93
 
94
+ Version 9.1.104 lässt Shell-Befehle im Vordergrund auch bei sehr großen Ausgaben bis zum regulären Ende laufen. King schreibt bis zu 16 MiB fortlaufend in das private Aufgabenprotokoll, verwirft darüber hinausgehende Ausgaben und meldet den tatsächlichen Exit-Code, statt den Prozess wegen der Ausgabemenge zu beenden. Kleine Ausgaben, Hintergrundaufgaben, Zeitgrenzen und manuelle Abbrüche bleiben unverändert.
95
+
94
96
  Ab BLUN King 9.1.99 werden auch direkt aufeinanderfolgende reine Textergebnisse als Stapel betrachtet. Enthalten sie zusammen mehr als 12.000 Zeichen, obwohl kein einzelnes Ergebnis diese Grenze überschreitet, speichert King so viele der größten geeigneten Ergebnisse wie nötig in privaten Dateien. In der Modellprojektion verbleiben lesbare Verweise. Der unveränderte Sitzungsrohverlauf bleibt vollständig erhalten. Gemischte Medienergebnisse, einzelne Ergebnisse unter 3.000 Zeichen und Stapel bis einschließlich 12.000 Zeichen bleiben unverändert. Beispiel: Bei zwei Suchergebnissen mit 7.000 und 6.000 Zeichen wird das größere Ergebnis privat gespeichert; Anfang, Ende, ausgelassene Zeichenzahl und `output_path` bleiben für den Agenten sichtbar.
95
97
 
96
98
  Ab BLUN King 9.1.100 beendet eine begrenzte Grep-Inhaltssuche ripgrep, sobald der Versatz, die angeforderten Zeilen und eine zusätzliche Vorschauzeile vollständig vorliegen. Die Vorschauzeile belegt, ob eine weitere Seite existiert, ohne vorher bis zu 10 MB einzulesen. Unbegrenzte Suchen, Trefferzählungen und nach Änderungszeit sortierte Dateilisten laufen weiterhin vollständig durch.
@@ -103,6 +105,8 @@ Das Telemetrieereignis `tool_result_batch_offloaded` meldet ausschließlich die
103
105
 
104
106
  Reguläre `Agent`-Teilaufgaben verwenden eine eigene `ContextMemory` und eine eigene `wire.jsonl` in einem getrennten Agentenverzeichnis. Der Hauptagent erhält nur die Ergebniszusammenfassung, sodass lange Teilaufgaben nicht den Hauptverlauf füllen. `TodoList` speichert Pläne weiterhin maschinenlesbar im Sitzungs-Wire; `blun handoff` übergibt sie zusammen mit prüfbaren Hashes zwischen CLI, Desktop und Web.
105
107
 
108
+ Version 9.1.105 ergänzt `TaskUpdate` für laufende Hintergrundagenten. King übergibt zusätzliche Anweisungen am nächsten sicheren Modellschritt an denselben aktiven Agenten, ohne ihn zu stoppen oder einen weiteren Agenten zu starten. Unbekannte und bereits beendete Aufgaben, Shell-Aufgaben sowie Agenten, die keine Aktualisierung mehr annehmen, werden unverändert abgewiesen.
109
+
106
110
  Verliert ein delegierter Einzelagent oder ein Mitglied eines Agentenschwarms die Provider-Verbindung, erhält es eine leere Provider-Antwort, bricht sein Stream wegen Leerlaufs ab oder meldet der Server HTTP 408/500/502/503/504, setzt BLUN King denselben Agenten anhand seines dauerhaften Verlaufs fort. Bei Einzelagenten sowie bei Schwarm-Unterbrechungen außerhalb von HTTP 429 wartet die erste Fortsetzung zwei Sekunden und die zweite fünf Sekunden; danach bleibt der ursprüngliche Fehler sichtbar. HTTP 429 behält im Schwarm seine getrennte, längere Überlastungsregel. Authentifizierungs-, Zahlungs- oder Kontingent-, Richtlinien-, Kontext-, Werkzeug- und Codefehler sowie manuelle Abbrüche lösen keine automatische Fortsetzung aus. Jeder Fortsetzungsversuch verwendet die bestehende Agenten-ID, damit bereits abgeschlossene Arbeit nicht wiederholt wird.
107
111
 
108
112
  Rein lesende Sitzungsdiagnose
package/README.md CHANGED
@@ -9,7 +9,7 @@ Voraussetzung ist Node.js 24.15 oder neuer. Die geprüfte Version wird exakt
9
9
  installiert:
10
10
 
11
11
  ```powershell
12
- npm install -g blun-king-cli@9.1.100
12
+ npm install -g blun-king-cli@9.1.105
13
13
  ```
14
14
 
15
15
  ## Reproduzierbares Staging und Packen
@@ -111,6 +111,10 @@ Ab BLUN King 9.1.98 kann King einen abgeschlossenen Arbeitsabschnitt verdichten,
111
111
 
112
112
  Große textbasierte Werkzeugergebnisse bleiben nicht mehr vollständig im Modellkontext. Ab 12.001 Zeichen speichert BLUN King das vollständige Ergebnis in einer privaten Datei im Sitzungsordner `tool-results`. Im Modellkontext verbleiben die ersten 1.000 und die letzten 1.000 Zeichen, die genaue Zahl der ausgelassenen Zeichen und der `output_path`. Der Agent kann das vollständige Ergebnis anschließend mit `Read` seitenweise über diesen Pfad lesen. Ergebnisse bis einschließlich 12.000 Zeichen, gemischte Medienergebnisse und bereits gekürzte Ergebnisse bleiben unverändert. Auch eine spätere Mikroverdichtung bewahrt den Dateiverweis. Beispiel: Bei einem Suchergebnis mit 30.000 Zeichen sehen folgende Modellanfragen den Anfang und das abschließende Ergebnis oder den Fehler; der vollständige Text bleibt lokal verfügbar.
113
113
 
114
+ Version 9.1.104 lässt Shell-Befehle im Vordergrund auch bei sehr großen Ausgaben bis zum regulären Ende laufen. King schreibt bis zu 16 MiB fortlaufend in das private Aufgabenprotokoll, verwirft darüber hinausgehende Ausgaben und meldet den tatsächlichen Exit-Code, statt den Prozess wegen der Ausgabemenge zu beenden. Kleine Ausgaben, Hintergrundaufgaben, Zeitgrenzen und manuelle Abbrüche bleiben unverändert.
115
+
116
+ Version 9.1.105 ergänzt `TaskUpdate` für laufende Hintergrundagenten. King übergibt zusätzliche Anweisungen am nächsten sicheren Modellschritt an denselben aktiven Agenten, ohne ihn zu stoppen oder einen weiteren Agenten zu starten. Unbekannte und bereits beendete Aufgaben, Shell-Aufgaben sowie Agenten, die keine Aktualisierung mehr annehmen, werden unverändert abgewiesen.
117
+
114
118
  Ab BLUN King 9.1.99 werden auch direkt aufeinanderfolgende reine Textergebnisse als Stapel betrachtet. Enthalten sie zusammen mehr als 12.000 Zeichen, obwohl kein einzelnes Ergebnis diese Grenze überschreitet, speichert King so viele der größten geeigneten Ergebnisse wie nötig in privaten Dateien. In der Modellprojektion verbleiben lesbare Verweise. Der unveränderte Sitzungsrohverlauf bleibt vollständig erhalten. Gemischte Medienergebnisse, einzelne Ergebnisse unter 3.000 Zeichen und Stapel bis einschließlich 12.000 Zeichen bleiben unverändert. Beispiel: Bei zwei Suchergebnissen mit 7.000 und 6.000 Zeichen wird das größere Ergebnis privat gespeichert; Anfang, Ende, ausgelassene Zeichenzahl und `output_path` bleiben für den Agenten sichtbar.
115
119
 
116
120
  Ab BLUN King 9.1.100 beendet eine begrenzte Grep-Inhaltssuche ripgrep, sobald der Versatz, die angeforderten Zeilen und eine zusätzliche Vorschauzeile vollständig vorliegen. Die Vorschauzeile belegt, ob eine weitere Seite existiert, ohne vorher bis zu 10 MB einzulesen. Unbegrenzte Suchen, Trefferzählungen und nach Änderungszeit sortierte Dateilisten laufen weiterhin vollständig durch.
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ const MAX_FOREGROUND_CAPTURE_BYTES = 16 * 1024 * 1024;
4
+
5
+ function utf8PrefixWithinBytes(text, maxBytes) {
6
+ if (maxBytes <= 0 || text.length === 0) return '';
7
+ if (Buffer.byteLength(text, 'utf8') <= maxBytes) return text;
8
+
9
+ let low = 0;
10
+ let high = text.length;
11
+ while (low < high) {
12
+ const middle = Math.ceil((low + high) / 2);
13
+ if (Buffer.byteLength(text.slice(0, middle), 'utf8') <= maxBytes) low = middle;
14
+ else high = middle - 1;
15
+ }
16
+ if (low > 0 && low < text.length) {
17
+ const last = text.charCodeAt(low - 1);
18
+ if (last >= 0xD800 && last <= 0xDBFF) low -= 1;
19
+ }
20
+ return text.slice(0, low);
21
+ }
22
+
23
+ function captureForegroundOutputChunk(text, capturedBytes, maxBytes = MAX_FOREGROUND_CAPTURE_BYTES) {
24
+ const observedBytes = Buffer.byteLength(text, 'utf8');
25
+ const remainingBytes = Math.max(0, maxBytes - Math.max(0, capturedBytes));
26
+ const capturedText = utf8PrefixWithinBytes(text, remainingBytes);
27
+ const newCapturedBytes = Buffer.byteLength(capturedText, 'utf8');
28
+ return {
29
+ capturedText,
30
+ observedBytes,
31
+ capturedBytes: newCapturedBytes,
32
+ droppedBytes: observedBytes - newCapturedBytes,
33
+ capped: newCapturedBytes < observedBytes,
34
+ };
35
+ }
36
+
37
+ module.exports = {
38
+ MAX_FOREGROUND_CAPTURE_BYTES,
39
+ captureForegroundOutputChunk,
40
+ utf8PrefixWithinBytes,
41
+ };
package/blun.mjs CHANGED
@@ -28484,7 +28484,7 @@ var init_load = __esmMin((() => {
28484
28484
  //#region ../../packages/agent-core/src/profile/default/agent.yaml?raw
28485
28485
  var agent_default$1;
28486
28486
  var init_agent$3 = __esmMin((() => {
28487
- agent_default$1 = "name: agent\ndescription: Default BLUN King agent\n\nsystemPromptPath: ./system.md\npromptVars:\n roleAdditional: ''\n\ntools:\n - Read\n - Write\n - Edit\n - Grep\n - Glob\n - Bash\n - TaskList\n - TaskOutput\n - TaskStop\n - CronCreate\n - CronList\n - CronDelete\n - ReadMediaFile\n - TodoList\n - Skill\n - WebSearch\n - Agent\n - AgentSwarm\n - FetchURL\n - GenerateImage\n - GenerateVideo\n - GenerateSpeech\n - GetMedia\n - AskUserQuestion\n - MistakeRecord\n - CodebaseSearch\n - EnterPlanMode\n - ExitPlanMode\n - CreateGoal\n - GetGoal\n - SetGoalBudget\n - UpdateGoal\n - mcp__*\n\nsubagents:\n coder:\n description: General software engineering agent — the only subagent type with file-editing tools; use it for any delegated task that must modify code.\n explore:\n description: Fast codebase exploration with prompt-enforced read-only behavior.\n plan:\n description: Read-only implementation planning and architecture design.\n";
28487
+ agent_default$1 = "name: agent\ndescription: Default BLUN King agent\n\nsystemPromptPath: ./system.md\npromptVars:\n roleAdditional: ''\n\ntools:\n - Read\n - Write\n - Edit\n - Grep\n - Glob\n - Bash\n - TaskList\n - TaskOutput\n - TaskUpdate\n - TaskStop\n - CronCreate\n - CronList\n - CronDelete\n - ReadMediaFile\n - TodoList\n - Skill\n - WebSearch\n - Agent\n - AgentSwarm\n - FetchURL\n - GenerateImage\n - GenerateVideo\n - GenerateSpeech\n - GetMedia\n - AskUserQuestion\n - MistakeRecord\n - CodebaseSearch\n - EnterPlanMode\n - ExitPlanMode\n - CreateGoal\n - GetGoal\n - SetGoalBudget\n - UpdateGoal\n - mcp__*\n\nsubagents:\n coder:\n description: General software engineering agent — the only subagent type with file-editing tools; use it for any delegated task that must modify code.\n explore:\n description: Fast codebase exploration with prompt-enforced read-only behavior.\n plan:\n description: Read-only implementation planning and architecture design.\n";
28488
28488
  agent_default$1 = agent_default$1.replace(" - TodoList\n", " - TodoList\n - CompactConversation\n");
28489
28489
  }));
28490
28490
  //#endregion
@@ -29084,6 +29084,9 @@ var init_agent_task = __esmMin((() => {
29084
29084
  });
29085
29085
  }
29086
29086
  }
29087
+ update(message) {
29088
+ return this.subagentHost.updateActive(this.agentId, message);
29089
+ }
29087
29090
  onDetach() {
29088
29091
  this.runInBackground = true;
29089
29092
  this.subagentHost.markActiveChildDetached(this.agentId);
@@ -29316,9 +29319,6 @@ function isBackgroundTaskTerminal(status) {
29316
29319
  return TERMINAL_STATUSES.has(status);
29317
29320
  }
29318
29321
  /** Terminal `stopReason` recorded when a foreground command trips the output ceiling. */
29319
- function foregroundOutputLimitReason() {
29320
- return `Output limit exceeded: the command produced more than ${Math.floor(MAX_FOREGROUND_OUTPUT_BYTES / (1024 * 1024))} MiB and was terminated. Redirect large output to a file (e.g. \`command > out.txt\`) and inspect it in slices instead.`;
29321
- }
29322
29322
  /**
29323
29323
  * Generate `{prefix}-{8 base36 chars}`.
29324
29324
  *
@@ -29378,7 +29378,7 @@ function buildBackgroundTaskNotificationBody(info) {
29378
29378
  "The subagent retains its full prior context across the restart, but any in-flight tool call lost its result and may need to be redone."
29379
29379
  ].join("\n")}`;
29380
29380
  }
29381
- var MAX_OUTPUT_BYTES$2, NOTIFICATION_FALLBACK_PREVIEW_BYTES, MAX_FOREGROUND_OUTPUT_BYTES, SIGTERM_GRACE_MS$1, USER_INTERRUPT_REASON$1, _ALPHABET, BackgroundManager;
29381
+ var MAX_OUTPUT_BYTES$2, NOTIFICATION_FALLBACK_PREVIEW_BYTES, MAX_FOREGROUND_CAPTURE_BYTES, captureForegroundOutputChunk, SIGTERM_GRACE_MS$1, USER_INTERRUPT_REASON$1, _ALPHABET, BackgroundManager;
29382
29382
  var init_background = __esmMin((() => {
29383
29383
  init_dist$4();
29384
29384
  init_errors$4();
@@ -29392,7 +29392,7 @@ var init_background = __esmMin((() => {
29392
29392
  init_question_task();
29393
29393
  MAX_OUTPUT_BYTES$2 = 1024 * 1024;
29394
29394
  NOTIFICATION_FALLBACK_PREVIEW_BYTES = 3e3;
29395
- MAX_FOREGROUND_OUTPUT_BYTES = 16 * 1024 * 1024;
29395
+ ({ MAX_FOREGROUND_CAPTURE_BYTES, captureForegroundOutputChunk } = createRequire(import.meta.url)("./bin/foreground-output-capture-policy.cjs"));
29396
29396
  SIGTERM_GRACE_MS$1 = 5e3;
29397
29397
  USER_INTERRUPT_REASON$1 = "Interrupted by user";
29398
29398
  _ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
@@ -29470,7 +29470,8 @@ var init_background = __esmMin((() => {
29470
29470
  outputChunks: [],
29471
29471
  outputRingChars: 0,
29472
29472
  outputSizeBytes: 0,
29473
- outputLimitTripped: false,
29473
+ outputCapturedBytes: 0,
29474
+ outputCaptureCapped: false,
29474
29475
  status: "running",
29475
29476
  options: entryOptions,
29476
29477
  startedAt: Date.now(),
@@ -29499,6 +29500,17 @@ var init_background = __esmMin((() => {
29499
29500
  if (entry !== void 0) return this.toInfo(entry);
29500
29501
  return this.ghosts.get(taskId);
29501
29502
  }
29503
+ updateAgentTask(taskId, message) {
29504
+ const entry = this.tasks.get(taskId);
29505
+ if (entry === void 0) throw new Error(`Task not found: ${taskId}`);
29506
+ if (TERMINAL_STATUSES.has(entry.status)) throw new Error(`Task ${taskId} is already in terminal state: ${entry.status}`);
29507
+ if (entry.task.kind !== "agent" || typeof entry.task.update !== "function") throw new Error(`Task ${taskId} is not an agent task and cannot receive updates`);
29508
+ const turnId = entry.task.update(message);
29509
+ return {
29510
+ ...this.toInfo(entry),
29511
+ turnId
29512
+ };
29513
+ }
29502
29514
  /**
29503
29515
  * List tasks, optionally filtering to active-only.
29504
29516
  *
@@ -29708,27 +29720,32 @@ var init_background = __esmMin((() => {
29708
29720
  return entry.persistWriteQueue;
29709
29721
  }
29710
29722
  appendOutput(entry, chunk) {
29711
- entry.outputSizeBytes += Buffer.byteLength(chunk, "utf-8");
29712
- entry.outputChunks.push(chunk);
29713
- entry.outputRingChars += chunk.length;
29723
+ const capture = this.isDetached(entry) ? {
29724
+ capturedText: chunk,
29725
+ observedBytes: Buffer.byteLength(chunk, "utf-8"),
29726
+ capturedBytes: Buffer.byteLength(chunk, "utf-8"),
29727
+ droppedBytes: 0,
29728
+ capped: false
29729
+ } : captureForegroundOutputChunk(chunk, entry.outputCapturedBytes);
29730
+ entry.outputSizeBytes += capture.observedBytes;
29731
+ entry.outputCapturedBytes += capture.capturedBytes;
29732
+ if (capture.capped) entry.outputCaptureCapped = true;
29733
+ if (capture.capturedText.length === 0) return;
29734
+ entry.outputChunks.push(capture.capturedText);
29735
+ entry.outputRingChars += capture.capturedText.length;
29714
29736
  while (entry.outputRingChars > MAX_OUTPUT_BYTES$2 && entry.outputChunks.length > 1) {
29715
29737
  const removed = entry.outputChunks.shift();
29716
29738
  if (removed === void 0) break;
29717
29739
  entry.outputRingChars -= removed.length;
29718
29740
  }
29719
- if (!entry.outputLimitTripped && !this.isDetached(entry) && entry.outputSizeBytes > MAX_FOREGROUND_OUTPUT_BYTES) {
29720
- entry.outputLimitTripped = true;
29721
- this.stop(entry.taskId, foregroundOutputLimitReason());
29722
- }
29723
- if (entry.outputLimitTripped) return;
29724
29741
  if (this.persistence === void 0) return;
29725
29742
  if (!entry.outputPersistStarted) {
29726
- entry.pendingOutput.push(chunk);
29727
- entry.pendingOutputBytes += Buffer.byteLength(chunk, "utf-8");
29743
+ entry.pendingOutput.push(capture.capturedText);
29744
+ entry.pendingOutputBytes += capture.capturedBytes;
29728
29745
  if (entry.pendingOutputBytes > MAX_OUTPUT_BYTES$2) this.startOutputPersist(entry);
29729
29746
  return;
29730
29747
  }
29731
- this.appendTaskOutput(entry, chunk);
29748
+ this.appendTaskOutput(entry, capture.capturedText);
29732
29749
  }
29733
29750
  /** Enqueue an `output.log` append, serialized per task. No-op when detached managers omit persistence. */
29734
29751
  appendTaskOutput(entry, chunk) {
@@ -29925,6 +29942,7 @@ var init_background = __esmMin((() => {
29925
29942
  endedAt: entry.endedAt,
29926
29943
  stopReason: entry.stopReason,
29927
29944
  terminalNotificationSuppressed: entry.terminalNotificationSuppressed,
29945
+ outputCaptureCapped: entry.outputCaptureCapped,
29928
29946
  timeoutMs: entry.options.timeoutMs
29929
29947
  };
29930
29948
  return entry.task.toInfo(base);
@@ -232799,7 +232817,7 @@ var init_manager$2 = __esmMin((() => {
232799
232817
  init_plugin_session_start();
232800
232818
  init_plan_mode();
232801
232819
  init_tool_awareness();
232802
- ACTIVE_BACKGROUND_TASK_GUIDANCE = "The conversation was compacted, so the earlier messages that started these background tasks are gone — but the tasks are still running from before. Do not start duplicates. Use TaskOutput to fetch a task’s result, TaskList to list them, and TaskStop to cancel one.";
232820
+ ACTIVE_BACKGROUND_TASK_GUIDANCE = "The conversation was compacted, so the earlier messages that started these background tasks are gone — but the tasks are still running from before. Do not start duplicates. Use TaskOutput to fetch a task’s result, TaskList to list them, TaskUpdate to send additional instructions to a running agent task, and TaskStop to cancel one.";
232803
232821
  InjectionManager = class {
232804
232822
  agent;
232805
232823
  injectors;
@@ -232976,6 +232994,7 @@ var init_default_tool_approve = __esmMin((() => {
232976
232994
  "TodoList",
232977
232995
  "TaskList",
232978
232996
  "TaskOutput",
232997
+ "TaskUpdate",
232979
232998
  "CronList",
232980
232999
  "WebSearch",
232981
233000
  "FetchURL",
@@ -250907,6 +250926,55 @@ var init_task_output = __esmMin((() => {
250907
250926
  };
250908
250927
  }));
250909
250928
  //#endregion
250929
+ //#region ../../packages/agent-core/src/tools/background/task-update.md?raw
250930
+ var task_update_default;
250931
+ var init_task_update$1 = __esmMin((() => {
250932
+ task_update_default = "Send additional instructions to a running background agent without stopping it or starting another agent.\n\nThe update is inserted into the same agent's active turn at the next safe model-step boundary, so the agent keeps its existing context and completed work. Use the exact task_id returned by Agent(run_in_background=true) or shown by TaskList.\n\nThis tool accepts only a currently running agent task. Shell tasks, unknown tasks, completed tasks, and tasks that are no longer accepting updates are rejected without changing them.";
250933
+ }));
250934
+ //#endregion
250935
+ //#region ../../packages/agent-core/src/tools/background/task-update.ts
250936
+ var TaskUpdateInputSchema, TaskUpdateTool;
250937
+ var init_task_update = __esmMin((() => {
250938
+ init_zod$1();
250939
+ init_input_schema();
250940
+ init_rule_match();
250941
+ init_task_update$1();
250942
+ TaskUpdateInputSchema = object({
250943
+ task_id: string().trim().min(1).describe("The running background agent task ID to update."),
250944
+ message: string().trim().min(1).describe("Additional instruction for the same running agent.")
250945
+ });
250946
+ TaskUpdateTool = class {
250947
+ manager;
250948
+ name = "TaskUpdate";
250949
+ description = task_update_default;
250950
+ parameters = toInputJsonSchema(TaskUpdateInputSchema);
250951
+ constructor(manager) {
250952
+ this.manager = manager;
250953
+ }
250954
+ resolveExecution(args) {
250955
+ return {
250956
+ description: `Updating agent task ${args.task_id}`,
250957
+ approvalRule: this.name,
250958
+ matchesRule: (ruleArgs) => matchesGlobRuleSubject(ruleArgs, args.task_id),
250959
+ execute: async () => {
250960
+ try {
250961
+ const info = this.manager.updateAgentTask(args.task_id, args.message);
250962
+ return {
250963
+ output: `task_id: ${info.taskId}\nstatus: ${info.status}\nagent_id: ${info.agentId}\nturn_id: ${String(info.turnId)}\nupdate: accepted`,
250964
+ isError: false
250965
+ };
250966
+ } catch (error) {
250967
+ return {
250968
+ output: error instanceof Error ? error.message : String(error),
250969
+ isError: true
250970
+ };
250971
+ }
250972
+ }
250973
+ };
250974
+ }
250975
+ };
250976
+ }));
250977
+ //#endregion
250910
250978
  //#region ../../packages/agent-core/src/tools/background/task-stop.md?raw
250911
250979
  var task_stop_default;
250912
250980
  var init_task_stop$1 = __esmMin((() => {
@@ -251946,6 +252014,22 @@ IMPORTANT:
251946
252014
  })
251947
252015
  };
251948
252016
  }
252017
+ updateActive(agentId, message) {
252018
+ const active = this.activeChildren.get(agentId);
252019
+ if (active === void 0 || active.runInBackground !== true) throw new Error(`Agent instance "${agentId}" is not running in the background`);
252020
+ const child = this.session.getReadyAgent(agentId);
252021
+ if (child === void 0 || !child.turn.hasActiveTurn) throw new Error(`Agent instance "${agentId}" has no active turn to update`);
252022
+ const turnId = child.turn.currentId;
252023
+ const acceptedTurnId = child.turn.steerActive([{
252024
+ type: "text",
252025
+ text: message
252026
+ }], turnId, {
252027
+ kind: "system_trigger",
252028
+ name: "subagent_update"
252029
+ });
252030
+ if (acceptedTurnId === null) throw new Error(`Agent instance "${agentId}" is not accepting updates at this boundary`);
252031
+ return acceptedTurnId;
252032
+ }
251949
252033
  async retry(agentId, options) {
251950
252034
  options.signal.throwIfAborted();
251951
252035
  const { parent, child, profileName } = await this.ensureIdleSubagent(agentId);
@@ -262142,7 +262226,7 @@ var init_bash = __esmMin((() => {
262142
262226
  MAX_TIMEOUT_S,
262143
262227
  MAX_BACKGROUND_TIMEOUT_S
262144
262228
  };
262145
- bash_default = "Execute a `{{ SHELL_NAME }}` command for pipes, environment variables, processes, git, package managers, build or test runners, and other genuine shell semantics.\n\nPrefer the dedicated tools when they fit: `Read` for a known file, `Write` to create or replace a file, `Edit` for exact changes, `Glob` to locate files, and `Grep` to search contents. Their output is bounded and their permissions are clearer.\n\nStdout and stderr are combined. Long output may be truncated. A non-zero command ends with its exit code; timeouts and user interrupts are reported separately.\n\nEach call runs in a fresh shell environment. Variables, `cd`, and shell history do not carry into later calls; pass `cwd` or use absolute paths. Foreground commands default to {{ DEFAULT_TIMEOUT_S }}s and allow up to {{ MAX_TIMEOUT_S }}s through `timeout`. Do not run interactive commands or commands that may run forever in the foreground.\n\nWith `run_in_background=true`, provide a short `description`; the tool returns a task ID and notifies you on completion. Background tasks default to {{ DEFAULT_BACKGROUND_TIMEOUT_S }}s and allow up to {{ MAX_BACKGROUND_TIMEOUT_S }}s. Use `disable_timeout=true` only when no deadline is appropriate. Use `TaskOutput` for a status or output snapshot and `TaskStop` only to cancel. After launch, normally return control instead of immediately waiting.\n\nQuote paths containing spaces. Chain dependent commands with `&&`; issue independent read-only checks as parallel tool calls. Use `;`, `||`, pipes, redirects, and shell control flow when their semantics are required.\n\nStay inside the working directory unless the user explicitly requests otherwise. Avoid `..`, and never require superuser privileges without explicit instruction. Command availability depends on the host; verify unfamiliar commands before relying on them.";
262229
+ bash_default = "Execute a `{{ SHELL_NAME }}` command for pipes, environment variables, processes, git, package managers, build or test runners, and other genuine shell semantics.\n\nPrefer the dedicated tools when they fit: `Read` for a known file, `Write` to create or replace a file, `Edit` for exact changes, `Glob` to locate files, and `Grep` to search contents. Their output is bounded and their permissions are clearer.\n\nStdout and stderr are combined. Long foreground output is streamed to a private file; capture stops at a safe size while the command continues to its real exit code. A non-zero command ends with its exit code; timeouts and user interrupts are reported separately.\n\nEach call runs in a fresh shell environment. Variables, `cd`, and shell history do not carry into later calls; pass `cwd` or use absolute paths. Foreground commands default to {{ DEFAULT_TIMEOUT_S }}s and allow up to {{ MAX_TIMEOUT_S }}s through `timeout`. Do not run interactive commands or commands that may run forever in the foreground.\n\nWith `run_in_background=true`, provide a short `description`; the tool returns a task ID and notifies you on completion. Background tasks default to {{ DEFAULT_BACKGROUND_TIMEOUT_S }}s and allow up to {{ MAX_BACKGROUND_TIMEOUT_S }}s. Use `disable_timeout=true` only when no deadline is appropriate. Use `TaskOutput` for a status or output snapshot and `TaskStop` only to cancel. After launch, normally return control instead of immediately waiting.\n\nQuote paths containing spaces. Chain dependent commands with `&&`; issue independent read-only checks as parallel tool calls. Use `;`, `||`, pipes, redirects, and shell control flow when their semantics are required.\n\nStay inside the working directory unless the user explicitly requests otherwise. Avoid `..`, and never require superuser privileges without explicit instruction. Command availability depends on the host; verify unfamiliar commands before relying on them.";
262146
262230
  BashTool = class {
262147
262231
  kaos;
262148
262232
  cwd;
@@ -262308,8 +262392,10 @@ var init_bash = __esmMin((() => {
262308
262392
  if (!result.truncated) return result;
262309
262393
  const output = await this.backgroundManager.getOutputSnapshot(taskId, 0);
262310
262394
  if (!output.fullOutputAvailable || output.outputPath === void 0) return result;
262395
+ const captureCapped = this.backgroundManager.getTask(taskId)?.outputCaptureCapped === true;
262311
262396
  const taskOutputHint = this.allowBackground ? `, or TaskOutput(task_id="${taskId}", block=false)` : "";
262312
- const reference = `\n\n[Full output saved]\ntask_id: ${taskId}\noutput_path: ${output.outputPath}\noutput_size_bytes: ${String(output.outputSizeBytes)}\nnext_step: Use Read with output_path to page through the full log${taskOutputHint}.`;
262397
+ const captureNotice = captureCapped ? `\n[Capture capped at ${String(MAX_FOREGROUND_CAPTURE_BYTES)} bytes. Additional output was discarded, but the command continued to its real exit code.]` : "";
262398
+ const reference = `\n\n[Full output saved]\ntask_id: ${taskId}\noutput_path: ${output.outputPath}\noutput_size_bytes: ${String(output.outputSizeBytes)}${captureNotice}\nnext_step: Use Read with output_path to page through the full log${taskOutputHint}.`;
262313
262399
  return {
262314
262400
  ...result,
262315
262401
  output: `${result.output}${reference}`
@@ -263212,6 +263298,7 @@ var init_blun_media$1 = __esmMin((() => {
263212
263298
  var init_builtin = __esmMin((() => {
263213
263299
  init_task_list();
263214
263300
  init_task_output();
263301
+ init_task_update();
263215
263302
  init_task_stop();
263216
263303
  init_cron_create();
263217
263304
  init_cron_delete();
@@ -263654,6 +263741,7 @@ var init_tool$1 = __esmMin((() => {
263654
263741
  new CompactConversationTool(this.agent),
263655
263742
  new TaskListTool(background),
263656
263743
  new TaskOutputTool(background),
263744
+ new TaskUpdateTool(background),
263657
263745
  new TaskStopTool(background),
263658
263746
  this.agent.cron && new CronCreateTool(this.agent.cron),
263659
263747
  this.agent.cron && new CronListTool(this.agent.cron),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.103",
3
+ "version": "9.1.105",
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": {