blun-king-cli 9.1.418 → 9.1.419
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 +7 -0
- package/README.md +7 -0
- package/bin/cognitive-goal-autostart-policy.cjs +22 -0
- package/blun.mjs +27 -1
- package/package.json +1 -1
package/LIESMICH.txt
CHANGED
|
@@ -83,6 +83,13 @@ 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
|
+
|
|
86
93
|
Zuverlässiger King-Start
|
|
87
94
|
-----------------------
|
|
88
95
|
Bei einer ausdrücklich als wiederholbar gekennzeichneten Serverüberlastung
|
package/README.md
CHANGED
|
@@ -102,6 +102,13 @@ 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
|
+
|
|
105
112
|
## Zuverlässiger King-Start
|
|
106
113
|
|
|
107
114
|
Bei einer vom Server ausdrücklich als wiederholbar gekennzeichneten
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
|
|
8
|
+
function goalAutostartDecision({ goal, permissionMode } = {}) {
|
|
9
|
+
if (!goal || typeof goal !== 'object' || Array.isArray(goal)) return WAIT;
|
|
10
|
+
if (goal.status !== 'active' || !AUTONOMOUS_PERMISSION_MODES.has(permissionMode)) return WAIT;
|
|
11
|
+
|
|
12
|
+
const checkpoint = goal.actionCheckpoint;
|
|
13
|
+
if (!checkpoint || typeof checkpoint !== 'object' || Array.isArray(checkpoint)) return WAIT;
|
|
14
|
+
if (!ACTIVE_PHASES.has(checkpoint.phase)) return WAIT;
|
|
15
|
+
const trigger = checkpoint.nextTrigger;
|
|
16
|
+
if (!trigger || typeof trigger !== 'object' || Array.isArray(trigger)) return WAIT;
|
|
17
|
+
if (trigger.kind !== 'immediate') return WAIT;
|
|
18
|
+
if (typeof trigger.condition !== 'string' || trigger.condition.trim().length === 0) return WAIT;
|
|
19
|
+
return START;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = { goalAutostartDecision };
|
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 } = 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";
|
|
@@ -516666,8 +516668,32 @@ var BlunTUI = class {
|
|
|
516666
516668
|
async promptStartupResumeGoalIfNeeded() {
|
|
516667
516669
|
const session = this.session;
|
|
516668
516670
|
const goal = this.state.appState.goal;
|
|
516669
|
-
if (session === void 0 || goal === null || goal === void 0 ||
|
|
516671
|
+
if (session === void 0 || goal === null || goal === void 0 || this.startupGoalPromptedSessionId === session.id) return;
|
|
516670
516672
|
const sessionId = session.id;
|
|
516673
|
+
const autostart = goalAutostartDecision({
|
|
516674
|
+
goal,
|
|
516675
|
+
permissionMode: this.state.appState.permissionMode
|
|
516676
|
+
});
|
|
516677
|
+
if (autostart.kind === "start") {
|
|
516678
|
+
this.startupGoalPromptedSessionId = sessionId;
|
|
516679
|
+
this.beginSessionRequest();
|
|
516680
|
+
this.setAppState({
|
|
516681
|
+
model: BLUN_KING_MODEL_ALIAS,
|
|
516682
|
+
modelFallbackAllowed: false
|
|
516683
|
+
});
|
|
516684
|
+
try {
|
|
516685
|
+
const result = await session.promptAccepted(GOAL_CONTINUATION_PROMPT);
|
|
516686
|
+
if (!result.accepted && this.session?.id === sessionId) {
|
|
516687
|
+
this.setAppState({ streamingPhase: "idle" });
|
|
516688
|
+
this.resetLivePane();
|
|
516689
|
+
this.track("goal_autostart", { outcome: "not_accepted" });
|
|
516690
|
+
}
|
|
516691
|
+
} catch (error) {
|
|
516692
|
+
if (this.session?.id === sessionId) this.failSessionRequest(uiText("blunTui.session.sendFailed", { error: formatErrorMessage$2(error) }));
|
|
516693
|
+
}
|
|
516694
|
+
return;
|
|
516695
|
+
}
|
|
516696
|
+
if (goal.status !== "paused" && goal.status !== "blocked") return;
|
|
516671
516697
|
this.startupGoalPromptedSessionId = sessionId;
|
|
516672
516698
|
const choice = await promptStartupResumeGoal(this, goal.objective, startupResumeGoalPromptCopy());
|
|
516673
516699
|
if (this.aborted || this.session?.id !== sessionId) return;
|