blun-king-cli 9.1.460 → 9.1.461
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.
|
@@ -7,6 +7,7 @@ const STATUS_FILE = 'telegram-console-status.json';
|
|
|
7
7
|
const MAX_STATUS_BYTES = 16_384;
|
|
8
8
|
const MAX_TASK_CHARS = 240;
|
|
9
9
|
const MAX_TOOL_NAME_CHARS = 80;
|
|
10
|
+
const MAX_VERSION_CHARS = 80;
|
|
10
11
|
|
|
11
12
|
function validInstant(value) {
|
|
12
13
|
if (typeof value !== 'string' || value.length === 0) return undefined;
|
|
@@ -25,6 +26,16 @@ function boundedToolName(value) {
|
|
|
25
26
|
return name.length > 0 ? name.slice(0, MAX_TOOL_NAME_CHARS) : undefined;
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
function boundedVersion(value) {
|
|
30
|
+
if (typeof value !== 'string') return undefined;
|
|
31
|
+
const version = value.trim();
|
|
32
|
+
return version.length > 0
|
|
33
|
+
&& version.length <= MAX_VERSION_CHARS
|
|
34
|
+
&& /^[0-9A-Za-z][0-9A-Za-z.+-]*$/u.test(version)
|
|
35
|
+
? version
|
|
36
|
+
: undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
function instantFromMilliseconds(value) {
|
|
29
40
|
if (!Number.isFinite(value) || value < 0) return undefined;
|
|
30
41
|
try {
|
|
@@ -54,6 +65,7 @@ function buildTurnDiagnostics(turnActive, activity) {
|
|
|
54
65
|
|
|
55
66
|
function buildTelegramConsoleStatus(input = {}) {
|
|
56
67
|
const capturedAt = validInstant(input.capturedAt);
|
|
68
|
+
const loadedVersion = boundedVersion(input.loadedVersion);
|
|
57
69
|
const processStartedAt = validInstant(input.processStartedAt);
|
|
58
70
|
const pid = Number.isSafeInteger(input.pid) && input.pid > 1 ? input.pid : undefined;
|
|
59
71
|
const step = Number.isSafeInteger(input.step) && input.step >= 0 ? input.step : 0;
|
|
@@ -66,6 +78,7 @@ function buildTelegramConsoleStatus(input = {}) {
|
|
|
66
78
|
: undefined;
|
|
67
79
|
return {
|
|
68
80
|
version: 1,
|
|
81
|
+
...(loadedVersion === undefined ? {} : { loadedVersion }),
|
|
69
82
|
pid,
|
|
70
83
|
capturedAt,
|
|
71
84
|
processStartedAt,
|
|
@@ -88,6 +101,8 @@ function parseTelegramConsoleStatus(value, options = {}) {
|
|
|
88
101
|
|| typeof parsed.turnActive !== 'boolean'
|
|
89
102
|
|| !Number.isSafeInteger(parsed.step) || parsed.step < 0) return undefined;
|
|
90
103
|
const activeTask = boundedTask(parsed.activeTask);
|
|
104
|
+
const hasLoadedVersion = Object.hasOwn(parsed, 'loadedVersion');
|
|
105
|
+
const loadedVersion = boundedVersion(parsed.loadedVersion);
|
|
91
106
|
const hasTurnStartedAt = Object.hasOwn(parsed, 'turnStartedAt');
|
|
92
107
|
const hasLastProgressAt = Object.hasOwn(parsed, 'lastProgressAt');
|
|
93
108
|
const hasLastToolName = Object.hasOwn(parsed, 'lastToolName');
|
|
@@ -96,7 +111,8 @@ function parseTelegramConsoleStatus(value, options = {}) {
|
|
|
96
111
|
const lastProgressAt = validInstant(parsed.lastProgressAt);
|
|
97
112
|
const lastToolName = boundedToolName(parsed.lastToolName);
|
|
98
113
|
const failedRepetitions = parsed.failedRepetitions;
|
|
99
|
-
if ((
|
|
114
|
+
if ((hasLoadedVersion && loadedVersion === undefined)
|
|
115
|
+
|| (hasTurnStartedAt && turnStartedAt === undefined)
|
|
100
116
|
|| (hasLastProgressAt && lastProgressAt === undefined)
|
|
101
117
|
|| (hasLastToolName && lastToolName === undefined)
|
|
102
118
|
|| (hasFailedRepetitions && (!Number.isSafeInteger(failedRepetitions)
|
|
@@ -109,6 +125,7 @@ function parseTelegramConsoleStatus(value, options = {}) {
|
|
|
109
125
|
} : {};
|
|
110
126
|
return {
|
|
111
127
|
version: 1,
|
|
128
|
+
...(loadedVersion === undefined ? {} : { loadedVersion }),
|
|
112
129
|
pid: parsed.pid,
|
|
113
130
|
capturedAt: parsed.capturedAt,
|
|
114
131
|
processStartedAt: parsed.processStartedAt,
|
|
@@ -13,6 +13,16 @@ function resolveTelegramRemoteVersion(input = {}) {
|
|
|
13
13
|
|| 'unbekannt';
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
function resolveVersionDisplay(input = {}) {
|
|
17
|
+
const loaded = trustedVersion(input.consoleStatus?.loadedVersion)
|
|
18
|
+
|| trustedVersion(input.version)
|
|
19
|
+
|| 'unbekannt';
|
|
20
|
+
const installed = trustedVersion(input.installedVersion);
|
|
21
|
+
return installed !== undefined && installed !== loaded
|
|
22
|
+
? `${loaded} -> ${installed}`
|
|
23
|
+
: loaded;
|
|
24
|
+
}
|
|
25
|
+
|
|
16
26
|
function formatDuration(seconds) {
|
|
17
27
|
const minutes = Math.max(0, Math.floor(Number(seconds) / 60));
|
|
18
28
|
if (minutes < 60) return `${minutes} min`;
|
|
@@ -89,7 +99,7 @@ function buildTelegramRemoteStatus(input) {
|
|
|
89
99
|
return [
|
|
90
100
|
`BLUN-Fernstatus für ${username}`,
|
|
91
101
|
`Rechner: ${input.machineName || 'unbekannt'}`,
|
|
92
|
-
`Version: ${input
|
|
102
|
+
`Version: ${resolveVersionDisplay(input)}`,
|
|
93
103
|
`Brücke: aktiv (PID ${input.bridgePid}, ${formatDuration(input.bridgeUptimeSeconds)})`,
|
|
94
104
|
`Konsole: ${tui}`,
|
|
95
105
|
`Zustellung: ${delivery}`,
|
package/blun.mjs
CHANGED
|
@@ -341020,6 +341020,14 @@ function getVersion() {
|
|
|
341020
341020
|
if (BLUN_BUILD_INFO.version !== void 0) return BLUN_BUILD_INFO.version;
|
|
341021
341021
|
return JSON.parse(readFileSync(getHostPackageJsonPath(), "utf-8")).version;
|
|
341022
341022
|
}
|
|
341023
|
+
function getInstalledPackageVersion() {
|
|
341024
|
+
try {
|
|
341025
|
+
const version = JSON.parse(readFileSync(getHostPackageJsonPath(), "utf-8")).version;
|
|
341026
|
+
return typeof version === "string" && version.trim().length > 0 ? version.trim() : void 0;
|
|
341027
|
+
} catch {
|
|
341028
|
+
return void 0;
|
|
341029
|
+
}
|
|
341030
|
+
}
|
|
341023
341031
|
function createBlunHostIdentity(version = getVersion()) {
|
|
341024
341032
|
return {
|
|
341025
341033
|
userAgentProduct: CLI_USER_AGENT_PRODUCT,
|
|
@@ -417986,6 +417994,10 @@ function buildStatusReportLines(options) {
|
|
|
417986
417994
|
value: sessionId
|
|
417987
417995
|
}
|
|
417988
417996
|
];
|
|
417997
|
+
if (options.installedVersion !== void 0 && options.installedVersion !== options.version) rows.push({
|
|
417998
|
+
label: uiText("status.label.warning"),
|
|
417999
|
+
value: uiText("plugins.market.status.installedVersion", { version: options.installedVersion })
|
|
418000
|
+
});
|
|
417989
418001
|
const title = options.sessionTitle?.trim();
|
|
417990
418002
|
if (title !== void 0 && title.length > 0) rows.push({
|
|
417991
418003
|
label: uiText("status.label.title"),
|
|
@@ -418882,6 +418894,7 @@ async function showStatusReport(host) {
|
|
|
418882
418894
|
const appState = host.state.appState;
|
|
418883
418895
|
const reportArgs = {
|
|
418884
418896
|
version: appState.version,
|
|
418897
|
+
installedVersion: getInstalledPackageVersion(),
|
|
418885
418898
|
model: appState.model,
|
|
418886
418899
|
workDir: appState.workDir,
|
|
418887
418900
|
sessionId: appState.sessionId,
|
|
@@ -511609,6 +511622,7 @@ var StreamingUIController = class {
|
|
|
511609
511622
|
writeTelegramConsoleStatus({
|
|
511610
511623
|
directory: telegramStateDir(),
|
|
511611
511624
|
capturedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
511625
|
+
loadedVersion: this.host.state.appState.version,
|
|
511612
511626
|
pid: process.pid,
|
|
511613
511627
|
processStartedAt: this._remoteProcessStartedAt,
|
|
511614
511628
|
step: this._currentStep,
|
package/package.json
CHANGED
|
@@ -4809,6 +4809,7 @@ bot.command("status", async (ctx) => {
|
|
|
4809
4809
|
queueCheckpointAt,
|
|
4810
4810
|
queueUnreadBytes: queueSnapshot.unreadBytes,
|
|
4811
4811
|
senderId,
|
|
4812
|
+
installedVersion: version,
|
|
4812
4813
|
tuiFresh: isTuiLeaseFresh(),
|
|
4813
4814
|
tuiHeartbeatAt,
|
|
4814
4815
|
tuiPid: Number.isInteger(tuiPid) ? tuiPid : void 0,
|