blun-king-cli 9.1.418 → 9.1.420

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
@@ -83,6 +83,20 @@ Agent korrigiert. Alle Rollen, Zuständigkeiten, Beziehungsnotizen und sonstigen
83
83
  Felder bleiben unverändert. Ein Agent wird niemals zu einer Person
84
84
  zurückgestuft; Namen oder Benutzernamen dienen nicht als Beweis.
85
85
 
86
+ Ab BLUN King 9.1.419 setzt eine natürlich fortgesetzte Sitzung ein bereits
87
+ aktives Ziel selbstständig fort, wenn dessen gespeicherter nächster Auslöser
88
+ ausdrücklich sofort gilt und Auto- oder God-Modus aktiv ist. Die Fortsetzung
89
+ erscheint nicht als erfundene Benutzernachricht und wird pro Sitzung nur einmal
90
+ angestoßen. Wartende, pausierte und blockierte Ziele sowie manuelle
91
+ Berechtigungsmodi starten weiterhin nicht selbstständig.
92
+
93
+ Ab BLUN King 9.1.420 beendet ein aktives Ziel mit dauerhaftem
94
+ Warte-Checkpoint die autonome Fortsetzung nach dem aktuellen Zug, ohne das Ziel
95
+ zu verwerfen. Externe, zeitliche, abhängige und nutzerabhängige Auslöser
96
+ erzeugen dadurch keine leeren Folgezüge. Beim nächsten Ereignis wird der
97
+ gespeicherte Auslöser erneut eingeordnet. Sofortige Ziele und ältere Ziele ohne
98
+ Checkpoint laufen unverändert weiter.
99
+
86
100
  Zuverlässiger King-Start
87
101
  -----------------------
88
102
  Bei einer ausdrücklich als wiederholbar gekennzeichneten Serverüberlastung
package/README.md CHANGED
@@ -102,6 +102,20 @@ zurückgestuft; Namen oder Benutzernamen dienen nicht als Beweis.
102
102
  geschriebenen Entwurf zu löschen. Das gilt auch bei Autovervollständigung,
103
103
  Geistervorschlägen, Bash-Eingabe und einer noch offenen Mehrzeileneingabe.
104
104
 
105
+ Ab BLUN King 9.1.419 setzt eine natürlich fortgesetzte Sitzung ein bereits
106
+ aktives Ziel selbstständig fort, wenn dessen gespeicherter nächster Auslöser
107
+ ausdrücklich sofort gilt und Auto- oder God-Modus aktiv ist. Die Fortsetzung
108
+ erscheint nicht als erfundene Benutzernachricht und wird pro Sitzung nur einmal
109
+ angestoßen. Wartende, pausierte und blockierte Ziele sowie manuelle
110
+ Berechtigungsmodi starten weiterhin nicht selbstständig.
111
+
112
+ Ab BLUN King 9.1.420 beendet ein aktives Ziel mit dauerhaftem
113
+ Warte-Checkpoint die autonome Fortsetzung nach dem aktuellen Zug, ohne das Ziel
114
+ zu verwerfen. Externe, zeitliche, abhängige und nutzerabhängige Auslöser
115
+ erzeugen dadurch keine leeren Folgezüge. Beim nächsten Ereignis wird der
116
+ gespeicherte Auslöser erneut eingeordnet. Sofortige Ziele und ältere Ziele ohne
117
+ Checkpoint laufen unverändert weiter.
118
+
105
119
  ## Zuverlässiger King-Start
106
120
 
107
121
  Bei einer vom Server ausdrücklich als wiederholbar gekennzeichneten
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ const AUTONOMOUS_PERMISSION_MODES = new Set(['auto', 'yolo']);
4
+ const ACTIVE_PHASES = new Set(['orient', 'plan', 'act', 'verify', 'learn']);
5
+ const START = Object.freeze({ kind: 'start', trigger: 'immediate' });
6
+ const WAIT = Object.freeze({ kind: 'wait' });
7
+ const CONTINUE = Object.freeze({ kind: 'continue' });
8
+ const YIELD = Object.freeze({ kind: 'yield' });
9
+
10
+ function goalAutostartDecision({ goal, permissionMode } = {}) {
11
+ if (!goal || typeof goal !== 'object' || Array.isArray(goal)) return WAIT;
12
+ if (goal.status !== 'active' || !AUTONOMOUS_PERMISSION_MODES.has(permissionMode)) return WAIT;
13
+
14
+ const checkpoint = goal.actionCheckpoint;
15
+ if (!checkpoint || typeof checkpoint !== 'object' || Array.isArray(checkpoint)) return WAIT;
16
+ if (!ACTIVE_PHASES.has(checkpoint.phase)) return WAIT;
17
+ const trigger = checkpoint.nextTrigger;
18
+ if (!trigger || typeof trigger !== 'object' || Array.isArray(trigger)) return WAIT;
19
+ if (trigger.kind !== 'immediate') return WAIT;
20
+ if (typeof trigger.condition !== 'string' || trigger.condition.trim().length === 0) return WAIT;
21
+ return START;
22
+ }
23
+
24
+ function goalContinuationDecision({ goal } = {}) {
25
+ if (!goal || typeof goal !== 'object' || Array.isArray(goal) || goal.status !== 'active') return YIELD;
26
+ const checkpoint = goal.actionCheckpoint;
27
+ if (!checkpoint || typeof checkpoint !== 'object' || Array.isArray(checkpoint)) return CONTINUE;
28
+ return checkpoint.phase === 'wait' ? YIELD : CONTINUE;
29
+ }
30
+
31
+ module.exports = { goalAutostartDecision, goalContinuationDecision };
package/blun.mjs CHANGED
@@ -6,6 +6,7 @@ const __filename = __cjsShimFileURLToPath(import.meta.url);
6
6
  const __dirname = __cjsShimDirname(__filename);
7
7
  import { createRequire } from "node:module";
8
8
  import telegramConsoleStatusPolicy from "./bin/telegram-console-status-policy.cjs";
9
+ import cognitiveGoalAutostartPolicy from "./bin/cognitive-goal-autostart-policy.cjs";
9
10
  import crypto$1, { createHash, randomBytes, randomInt, randomUUID, timingSafeEqual } from "node:crypto";
10
11
  import * as fs$16 from "node:fs";
11
12
  import Kt, { accessSync, appendFileSync, chmodSync, closeSync, constants, copyFileSync, createReadStream, createWriteStream, existsSync, fsyncSync, linkSync, lstatSync, mkdirSync, openSync, promises, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
@@ -36,6 +37,7 @@ import * as win32Path from "node:path/win32";
36
37
  import { createServer } from "node:http";
37
38
  import { pipeline as pipeline$1 } from "node:stream/promises";
38
39
  const { writeTelegramConsoleStatus } = telegramConsoleStatusPolicy;
40
+ const { goalAutostartDecision, goalContinuationDecision } = cognitiveGoalAutostartPolicy;
39
41
  import { EventEmitter as EventEmitter$1 } from "node:events";
40
42
  import { StringDecoder } from "node:string_decoder";
41
43
  import co from "node:assert";
@@ -262098,6 +262100,7 @@ var init_turn = __esmMin((() => {
262098
262100
  await this.agent.goal.markBlocked({ reason: "A configured budget was reached" });
262099
262101
  return end;
262100
262102
  }
262103
+ if (goalContinuationDecision({ goal }).kind === "yield") return end;
262101
262104
  turnId = this.allocateTurnId();
262102
262105
  turnInput = [{
262103
262106
  type: "text",
@@ -516666,8 +516669,32 @@ var BlunTUI = class {
516666
516669
  async promptStartupResumeGoalIfNeeded() {
516667
516670
  const session = this.session;
516668
516671
  const goal = this.state.appState.goal;
516669
- if (session === void 0 || goal === null || goal === void 0 || goal.status !== "paused" && goal.status !== "blocked" || this.startupGoalPromptedSessionId === session.id) return;
516672
+ if (session === void 0 || goal === null || goal === void 0 || this.startupGoalPromptedSessionId === session.id) return;
516670
516673
  const sessionId = session.id;
516674
+ const autostart = goalAutostartDecision({
516675
+ goal,
516676
+ permissionMode: this.state.appState.permissionMode
516677
+ });
516678
+ if (autostart.kind === "start") {
516679
+ this.startupGoalPromptedSessionId = sessionId;
516680
+ this.beginSessionRequest();
516681
+ this.setAppState({
516682
+ model: BLUN_KING_MODEL_ALIAS,
516683
+ modelFallbackAllowed: false
516684
+ });
516685
+ try {
516686
+ const result = await session.promptAccepted(GOAL_CONTINUATION_PROMPT);
516687
+ if (!result.accepted && this.session?.id === sessionId) {
516688
+ this.setAppState({ streamingPhase: "idle" });
516689
+ this.resetLivePane();
516690
+ this.track("goal_autostart", { outcome: "not_accepted" });
516691
+ }
516692
+ } catch (error) {
516693
+ if (this.session?.id === sessionId) this.failSessionRequest(uiText("blunTui.session.sendFailed", { error: formatErrorMessage$2(error) }));
516694
+ }
516695
+ return;
516696
+ }
516697
+ if (goal.status !== "paused" && goal.status !== "blocked") return;
516671
516698
  this.startupGoalPromptedSessionId = sessionId;
516672
516699
  const choice = await promptStartupResumeGoal(this, goal.objective, startupResumeGoalPromptCopy());
516673
516700
  if (this.aborted || this.session?.id !== sessionId) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.418",
3
+ "version": "9.1.420",
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": {