blun-king-cli 9.1.634 → 9.1.637
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 +5 -0
- package/blun.mjs +33 -16
- package/package.json +1 -1
- package/telegram-plugin/dist/bridge.mjs +1 -0
- package/telegram-plugin/dist/mcp-server.mjs +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## 9.1.637 – Telegram-Stillemarker im Sendepfad
|
|
2
|
+
|
|
3
|
+
- `reply` und `edit_message` sowie die direkten Konsolen- und Brückenfallbacks senden nichts, wenn der Text nach `trim()` ausschließlich `[[BLUN_TELEGRAM_SILENT]]` enthält; der Aufruf meldet `unterdrückt`.
|
|
4
|
+
- Die Chatfreigabe bleibt vorgeschaltet. Marker mit zusätzlichem Text und alle anderen Texte bleiben unverändert.
|
|
5
|
+
|
|
1
6
|
# BLUN King Changelog
|
|
2
7
|
|
|
3
8
|
## 9.1.600
|
package/blun.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// BLUN_BUILD_INPUT_SHA256:
|
|
2
|
+
// BLUN_BUILD_INPUT_SHA256:efe2db101f5ddf60971c8504d9cd59f86444a9b24bae53a5d1e1032307d4171a
|
|
3
3
|
/*! wasm-webp 0.1.0
|
|
4
4
|
MIT License
|
|
5
5
|
|
|
@@ -513542,6 +513542,7 @@ var init_compaction = __esmMin((() => {
|
|
|
513542
513542
|
}
|
|
513543
513543
|
if (this.failed) return `${currentTheme.fg("error", STATUS_BULLET)}${currentTheme.boldFg("error", this.failureTitle ?? uiText("compaction.failed"))}${currentTheme.fg("textDim", ` · ${this.failureDetail ?? uiText("compaction.failureDetail")}`)}`;
|
|
513544
513544
|
if (this.canceled) return `${currentTheme.fg("warning", STATUS_BULLET)}${currentTheme.boldFg("warning", uiText("compaction.canceled"))}`;
|
|
513545
|
+
if (process.env["BLUN_REDUCED_MOTION"] === "1" || process.env["BLUN_REDUCED_MOTION"] === "true") return `${currentTheme.fg("primary", STATUS_BULLET)}${currentTheme.boldFg("primary", uiText("compaction.running"))}${currentTheme.fg("textDim", ` · ${uiText("compaction.cancelHint")}`)}`;
|
|
513545
513546
|
const elapsedMs = Math.max(0, Date.now() - this.attemptStartedAtMs);
|
|
513546
513547
|
const percent = this.estimatedProgressPercent ?? estimateCompactionPercent(elapsedMs, this.estimatedInputTokens);
|
|
513547
513548
|
const filled = Math.round(percent / 100 * BAR_WIDTH);
|
|
@@ -513559,6 +513560,7 @@ var init_compaction = __esmMin((() => {
|
|
|
513559
513560
|
return `${currentTheme.fg("primary", bar)} ${currentTheme.boldFg("primary", runningText)}${this.windowUsagePercent === void 0 ? currentTheme.fg("textDim", ` ~${String(percent)} %`) : ""}${currentTheme.fg("textDim", ` · ${String(this.elapsedSeconds())}s`)}${this.attempt > 1 ? currentTheme.fg("textDim", uiText("compaction.attempt", { attempt: this.attempt })) : ""}${currentTheme.fg("textDim", ` · ${uiText("compaction.cancelHint")}`)}${this.instruction ? currentTheme.fg("textDim", ` · ${this.instruction}`) : ""}${this.tip ? currentTheme.fg("textDim", ` · ${this.tip}`) : ""}`;
|
|
513560
513561
|
}
|
|
513561
513562
|
startTicking() {
|
|
513563
|
+
if (process.env["BLUN_REDUCED_MOTION"] === "1" || process.env["BLUN_REDUCED_MOTION"] === "true") return;
|
|
513562
513564
|
this.timer = setInterval(() => {
|
|
513563
513565
|
this.statusText.setText(this.buildStatusLine());
|
|
513564
513566
|
this.ui?.requestRender();
|
|
@@ -533517,9 +533519,12 @@ var init_message_replay_copy = __esmMin((() => {
|
|
|
533517
533519
|
}));
|
|
533518
533520
|
function appStateFromResumeAgent(agent) {
|
|
533519
533521
|
const maxContextTokens = agent.context.effectiveMaxContextTokens ?? agent.config.modelCapabilities?.max_context_tokens ?? 0;
|
|
533520
|
-
const
|
|
533522
|
+
const projectedTokens = agent.context.projectedTokenCount;
|
|
533523
|
+
const contextMetricsKnown = projectedTokens !== void 0 && Number.isFinite(projectedTokens) && projectedTokens >= 0;
|
|
533524
|
+
const contextTokens = contextMetricsKnown ? projectedTokens : 0;
|
|
533521
533525
|
const contextUsage = maxContextTokens > 0 ? contextTokens / maxContextTokens : 0;
|
|
533522
533526
|
return {
|
|
533527
|
+
contextMetricsKnown,
|
|
533523
533528
|
model: agent.config.modelAlias ?? agent.config.provider?.model ?? "",
|
|
533524
533529
|
contextTokens,
|
|
533525
533530
|
maxContextTokens,
|
|
@@ -535782,7 +535787,10 @@ var init_session_event_handler = __esmMin((() => {
|
|
|
535782
535787
|
const shouldRenderSwarmEnded = event.swarmMode === false && this.host.state.appState.swarmMode && this.host.state.appState.swarmModeEntry === "task";
|
|
535783
535788
|
const patch = {};
|
|
535784
535789
|
if (event.contextUsage !== void 0) patch.contextUsage = event.contextUsage;
|
|
535785
|
-
if (event.contextTokens !== void 0
|
|
535790
|
+
if (event.contextTokens !== void 0 && Number.isFinite(event.contextTokens) && event.contextTokens >= 0) {
|
|
535791
|
+
patch.contextTokens = event.contextTokens;
|
|
535792
|
+
patch.contextMetricsKnown = true;
|
|
535793
|
+
}
|
|
535786
535794
|
if (event.maxContextTokens !== void 0) patch.maxContextTokens = event.maxContextTokens;
|
|
535787
535795
|
patch.compactionBudgetTokens = event.compactionBudgetTokens ?? 0;
|
|
535788
535796
|
if (event.planMode !== void 0) patch.planMode = event.planMode;
|
|
@@ -536194,9 +536202,18 @@ var init_session_event_handler = __esmMin((() => {
|
|
|
536194
536202
|
this.host.streamingUI.beginCompaction(event.instruction);
|
|
536195
536203
|
}
|
|
536196
536204
|
handleCompactionEnd(event) {
|
|
536205
|
+
if (!this.host.state.appState.isCompacting) return;
|
|
536197
536206
|
this.pendingCompactionRetry = void 0;
|
|
536198
536207
|
this.hideCompactionRetry();
|
|
536199
|
-
|
|
536208
|
+
const tokens = event.projectedContextTokens;
|
|
536209
|
+
if (tokens !== void 0 && Number.isFinite(tokens) && tokens >= 0) {
|
|
536210
|
+
const maxTokens = this.host.state.appState.maxContextTokens;
|
|
536211
|
+
this.host.setAppState({
|
|
536212
|
+
contextTokens: tokens,
|
|
536213
|
+
contextUsage: Number.isFinite(maxTokens) && maxTokens > 0 ? Math.min(1, tokens / maxTokens) : void 0,
|
|
536214
|
+
contextMetricsKnown: true
|
|
536215
|
+
});
|
|
536216
|
+
} else this.host.setAppState({ contextMetricsKnown: false });
|
|
536200
536217
|
this.host.streamingUI.endCompaction(event.result.tokensBefore, event.result.tokensAfter, event.stageCount);
|
|
536201
536218
|
this.lastCompactionInstruction = void 0;
|
|
536202
536219
|
this.finishCompaction();
|
|
@@ -537166,7 +537183,8 @@ function clockHhmm(now) {
|
|
|
537166
537183
|
return `${String(now.getHours()).padStart(2, "0")}:${String(now.getMinutes()).padStart(2, "0")}`;
|
|
537167
537184
|
}
|
|
537168
537185
|
function formatContextStatus(usage, tokens, maxTokens, colors, width, now = /* @__PURE__ */ new Date()) {
|
|
537169
|
-
|
|
537186
|
+
if (tokens === void 0 || !Number.isFinite(tokens)) return truncateToWidth(`${uiText("footer.context")} ${uiText("context.unavailable")}`, Math.max(0, width), "…");
|
|
537187
|
+
const ratio = safeUsage(usage ?? 0);
|
|
537170
537188
|
const pct = `${(ratio * 100).toFixed(0)}%`;
|
|
537171
537189
|
const bar = `${renderContextBar(ratio, colors)} `;
|
|
537172
537190
|
const clock = chalk.hex(colors.textDim)(` · ${clockHhmm(now)}`);
|
|
@@ -537191,15 +537209,13 @@ function formatContextStatus(usage, tokens, maxTokens, colors, width, now = /* @
|
|
|
537191
537209
|
for (const variant of variants) if (visibleWidth(variant) <= available) return variant;
|
|
537192
537210
|
return truncateToWidth(current, available, "…");
|
|
537193
537211
|
}
|
|
537194
|
-
|
|
537195
|
-
const filled = Math.max(1, Math.ceil(CONTEXT_BAR_WIDTH * (1 - percent / 100)));
|
|
537196
|
-
const bar = chalk.hex(colors.success ?? colors.primary)("█".repeat(filled) + "░".repeat(CONTEXT_BAR_WIDTH - filled));
|
|
537197
|
-
const variants = [`${bar}${chalk.hex(colors.textDim)(` · ${clockHhmm(now)}`)}`, bar];
|
|
537198
|
-
const available = Math.max(0, width);
|
|
537199
|
-
for (const variant of variants) if (visibleWidth(variant) <= available) return variant;
|
|
537200
|
-
return truncateToWidth(bar, available, "");
|
|
537201
|
-
}
|
|
537212
|
+
|
|
537202
537213
|
function contextMetrics(state) {
|
|
537214
|
+
if (state.contextMetricsKnown === false) return {
|
|
537215
|
+
tokens: void 0,
|
|
537216
|
+
maxTokens: state.maxContextTokens,
|
|
537217
|
+
usage: void 0
|
|
537218
|
+
};
|
|
537203
537219
|
const tokens = Number.isFinite(state.contextTokens) ? Math.max(0, state.contextTokens) : 0;
|
|
537204
537220
|
const responderAlias = state.activeResponderModel ?? state.model;
|
|
537205
537221
|
const responder = state.availableModels[responderAlias];
|
|
@@ -537516,7 +537532,7 @@ var init_footer = __esmMin((() => {
|
|
|
537516
537532
|
const estimate = this.compactionProgress?.estimatedProgressPercent ?? estimateCompactionPercent(Math.max(0, Date.now() - this.compactionAttemptStartedAtMs), this.compactionEstimatedInputTokens);
|
|
537517
537533
|
if (Number.isFinite(estimate)) this.compactionPercent = Math.max(this.compactionPercent, Math.min(97, estimate));
|
|
537518
537534
|
}
|
|
537519
|
-
const contextText =
|
|
537535
|
+
const contextText = formatContextStatus(context.usage, context.tokens, context.maxTokens, colors, width);
|
|
537520
537536
|
const right = this.transientHint && this.compactionAttemptStartedAtMs === null ? chalk.hex(colors.warning).bold(this.transientHint) : chalk.hex(colors.text)(contextText);
|
|
537521
537537
|
const rightWidth = visibleWidth(right);
|
|
537522
537538
|
let line1;
|
|
@@ -538473,10 +538489,10 @@ var init_streaming_ui = __esmMin((() => {
|
|
|
538473
538489
|
const { state } = this.host;
|
|
538474
538490
|
this._cancelledCompactionBlock = void 0;
|
|
538475
538491
|
if (this._activeCompactionBlock !== void 0) {
|
|
538476
|
-
this._activeCompactionBlock.
|
|
538492
|
+
this._activeCompactionBlock.markCanceled();
|
|
538477
538493
|
this._activeCompactionBlock = void 0;
|
|
538478
538494
|
}
|
|
538479
|
-
const block = new CompactionComponent(state.ui, instruction, currentWorkingTip()?.text
|
|
538495
|
+
const block = new CompactionComponent(state.ui, instruction, currentWorkingTip()?.text);
|
|
538480
538496
|
this._activeCompactionBlock = block;
|
|
538481
538497
|
state.transcriptContainer.addChild(block);
|
|
538482
538498
|
state.ui.requestRender();
|
|
@@ -542699,6 +542715,7 @@ function isGroupSuppressed(text, _contextOnly) {
|
|
|
542699
542715
|
return isGroupNoiseReply(text);
|
|
542700
542716
|
}
|
|
542701
542717
|
async function sendReplyFallback(chatId, text, contextOnly = false, requireDelivery = false, progress) {
|
|
542718
|
+
if (typeof text === "string" && text.trim() === "[[BLUN_TELEGRAM_SILENT]]") return true;
|
|
542702
542719
|
if (isGroupChat(chatId) && isGroupSuppressed(text, contextOnly)) {
|
|
542703
542720
|
try {
|
|
542704
542721
|
appendFileSync(outboxPath(), `${JSON.stringify({
|
package/package.json
CHANGED
|
@@ -68029,6 +68029,7 @@ function scrubSecrets(text) {
|
|
|
68029
68029
|
* log it to outbox.jsonl as kind "reply-fallback". Returns true on success.
|
|
68030
68030
|
*/
|
|
68031
68031
|
async function sendReplyFallback(chatId, rawText) {
|
|
68032
|
+
if (typeof rawText === "string" && rawText.trim() === "[[BLUN_TELEGRAM_SILENT]]") return true;
|
|
68032
68033
|
const token = botToken();
|
|
68033
68034
|
if (token === void 0) return false;
|
|
68034
68035
|
if (isGroupChat(chatId) && isGroupNoiseReply(rawText)) {
|
|
@@ -73600,6 +73600,7 @@ async function runTool(api, token, name, args) {
|
|
|
73600
73600
|
case "download_attachment": return runDownload(api, token, args["file_id"]);
|
|
73601
73601
|
case "edit_message": {
|
|
73602
73602
|
const chatId = resolveAllowedChatId(args["chat_id"]);
|
|
73603
|
+
if (typeof args["text"] === "string" && args["text"].trim() === "[[BLUN_TELEGRAM_SILENT]]") return "unterdrückt";
|
|
73603
73604
|
assertTelegramLanguageReleased(args["text"], args["release_token"]);
|
|
73604
73605
|
const parseMode = args["format"] === "markdownv2" ? "MarkdownV2" : void 0;
|
|
73605
73606
|
const edited = await api.editMessageText(chatId, Number(args["message_id"]), args["text"], parseMode !== void 0 ? { parse_mode: parseMode } : void 0);
|
|
@@ -73649,6 +73650,7 @@ function isRecentDuplicate(chatId, text) {
|
|
|
73649
73650
|
async function runReply(api, args) {
|
|
73650
73651
|
const chatId = resolveAllowedChatId(args["chat_id"]);
|
|
73651
73652
|
const text = args["text"];
|
|
73653
|
+
if (typeof text === "string" && text.trim() === "[[BLUN_TELEGRAM_SILENT]]") return "unterdrückt";
|
|
73652
73654
|
const replyTo = args["reply_to"] !== null && args["reply_to"] !== void 0 ? Number(args["reply_to"]) : void 0;
|
|
73653
73655
|
const files = args["files"] ?? [];
|
|
73654
73656
|
const parseMode = args["format"] === "markdownv2" ? "MarkdownV2" : void 0;
|