blun-king-cli 9.1.610 → 9.1.612
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 +9 -0
- package/LIESMICH.txt +1 -1
- package/README.md +1 -1
- package/bin/profile-launch.cjs +42 -42
- package/blun.mjs +1771 -1063
- package/package.json +1 -1
- package/telegram-plugin/dist/bridge.mjs +3 -1
- package/telegram-plugin/dist/mcp-server.mjs +9 -0
- package/worker-host.mjs +293 -52
package/package.json
CHANGED
|
@@ -60197,7 +60197,7 @@ var BoundedChannelContextBuffer = class {
|
|
|
60197
60197
|
function buildChannelTag(content, meta, addressed = true, inferAddressing = false) {
|
|
60198
60198
|
const pairs = [["source", "telegram"]];
|
|
60199
60199
|
for (const [key, value] of Object.entries(meta)) if (value !== void 0) pairs.push([key, String(value)]);
|
|
60200
|
-
return `<channel ${pairs.map(([key, value]) => `${key}="${escapeAttr(value)}"`).join(" ")}>\n${content}\n</channel>\n${addressed && meta.chat_id.startsWith("-") ? `[GRUPPENANTWORT: Eine bloße Information oder eine Nachricht, die ausdrücklich keine Bestätigung verlangt, macht keine Antwort erforderlich. Beende den Turn dann ohne Ausgabe und ohne Bestätigung deiner Stille. Einen konkreten Auftrag an dich nimm kurz an und beginne die Arbeit; melde danach das Ergebnis oder einen echten Blocker. Eine Frage beantworte, wenn du etwas beitragen kannst. Sende eine nötige Antwort mit dem telegram reply-Tool an chat_id=${meta.chat_id}, ohne dieselbe Annahme zu wiederholen.]` : addressed ? `[REPLY-PFLICHT: Der Absender liest NUR Telegram. Sende deine Antwort mit dem telegram reply-Tool an chat_id=${meta.chat_id}. Sichtbarer Antworttext kann auch automatisch weitergeleitet werden; er ist kein privater Denkbereich.]` : inferAddressing ? `[SEMANTISCHE ADRESSIERUNG: Diese menschliche Gruppennachricht nennt dich nicht explizit. Entscheide anhand von Inhalt und Gesprächskontext, ob sie an dich gerichtet ist oder Arbeit von dir verlangt. Falls ja, antworte kurz mit dem telegram reply-Tool an chat_id=${meta.chat_id}. Falls nein, beende den Turn ohne Ausgabe; sende keine Bestätigung deiner Stille.]` : "[NUR MITLESEN — diese Nachricht ist NICHT an dich gerichtet (kein @King, keine Antwort an dich, sie spricht jemand anderen oder die Gruppe allgemein an). ANTWORTE NICHT: kein reply-Tool, keine Bestätigung, kein \"verstanden\", kein \"halte mich raus\" — beende den Turn einfach ohne Ausgabe. NUR wenn du ein echtes, konkretes Ergebnis oder einen echten Blocker beitragen kannst, antwortest du kurz. Im Zweifel: schweigen.]"}`;
|
|
60200
|
+
return `<channel ${pairs.map(([key, value]) => `${key}="${escapeAttr(value)}"`).join(" ")}>\n${content}\n</channel>\n${addressed && meta.chat_id.startsWith("-") ? `[GRUPPENANTWORT: Eine bloße Information oder eine Nachricht, die ausdrücklich keine Bestätigung verlangt, macht keine Antwort erforderlich. Beende den Turn dann ohne Ausgabe und ohne Bestätigung deiner Stille. Eine Antwort auf deine Statusfrage ohne neuen Auftrag braucht keine Zusammenfassung und keinen sichtbaren Text. Falls ein Abschlusstext nötig ist, gib nur [[BLUN_TELEGRAM_SILENT]] aus. Einen konkreten Auftrag an dich nimm kurz an und beginne die Arbeit; melde danach das Ergebnis oder einen echten Blocker. Eine Frage beantworte, wenn du etwas beitragen kannst. Sende eine nötige Antwort mit dem telegram reply-Tool an chat_id=${meta.chat_id}, ohne dieselbe Annahme zu wiederholen.]` : addressed ? `[REPLY-PFLICHT: Der Absender liest NUR Telegram. Sende deine Antwort mit dem telegram reply-Tool an chat_id=${meta.chat_id}. Sichtbarer Antworttext kann auch automatisch weitergeleitet werden; er ist kein privater Denkbereich.]` : inferAddressing ? `[SEMANTISCHE ADRESSIERUNG: Diese menschliche Gruppennachricht nennt dich nicht explizit. Entscheide anhand von Inhalt und Gesprächskontext, ob sie an dich gerichtet ist oder Arbeit von dir verlangt. Falls ja, antworte kurz mit dem telegram reply-Tool an chat_id=${meta.chat_id}. Falls nein, beende den Turn ohne Ausgabe; sende keine Bestätigung deiner Stille.]` : "[NUR MITLESEN — diese Nachricht ist NICHT an dich gerichtet (kein @King, keine Antwort an dich, sie spricht jemand anderen oder die Gruppe allgemein an). ANTWORTE NICHT: kein reply-Tool, keine Bestätigung, kein \"verstanden\", kein \"halte mich raus\" — beende den Turn einfach ohne Ausgabe. NUR wenn du ein echtes, konkretes Ergebnis oder einen echten Blocker beitragen kannst, antwortest du kurz. Im Zweifel: schweigen.]"}`;
|
|
60201
60201
|
}
|
|
60202
60202
|
/**
|
|
60203
60203
|
* Sent once as the head of the first prompt of every bridged session —
|
|
@@ -60215,6 +60215,8 @@ function buildPreamble() {
|
|
|
60215
60215
|
"useful contribution: a relevant finding, error, or improvement. Otherwise finish",
|
|
60216
60216
|
"with no reply tool call and no assistant text. Do not narrate that decision, cite",
|
|
60217
60217
|
"a silence rule, acknowledge inactivity, or report that you ended without output.",
|
|
60218
|
+
"If someone answers your status question with \"all work is done; new tasks will",
|
|
60219
|
+
"arrive later\", the exchange is closed. Do not restate or acknowledge that answer.",
|
|
60218
60220
|
"If your host requires assistant text to finish a silent turn, output exactly",
|
|
60219
60221
|
"[[BLUN_TELEGRAM_SILENT]] and nothing else. Never send this marker with reply.",
|
|
60220
60222
|
"When you do have something useful to contribute, send it once without repeating it.",
|
|
@@ -73461,6 +73461,10 @@ function assertTelegramLanguageReleased(text, releaseToken, now) {
|
|
|
73461
73461
|
function isGroupChat(chatId) {
|
|
73462
73462
|
return chatId.startsWith("-");
|
|
73463
73463
|
}
|
|
73464
|
+
const SILENT_TURN_MARKER = "[[BLUN_TELEGRAM_SILENT]]";
|
|
73465
|
+
function isSilentTurnMarker(text) {
|
|
73466
|
+
return text.trim() === SILENT_TURN_MARKER;
|
|
73467
|
+
}
|
|
73464
73468
|
function normalize(s) {
|
|
73465
73469
|
return s.toLowerCase().replace(/ä/g, "a").replace(/ö/g, "o").replace(/ü/g, "u").replace(/ß/g, "ss").replace(/[‐-―]/g, " ").replace(/[^\p{L}\p{N}\s]/gu, " ").replace(/\s+/g, " ").trim();
|
|
73466
73470
|
}
|
|
@@ -73617,6 +73621,7 @@ async function runTool(api, token, name, args) {
|
|
|
73617
73621
|
case "download_attachment": return runDownload(api, token, args["file_id"]);
|
|
73618
73622
|
case "edit_message": {
|
|
73619
73623
|
const chatId = resolveAllowedChatId(args["chat_id"]);
|
|
73624
|
+
if (isSilentTurnMarker(args["text"])) throw new Error("silent marker cannot be used to edit a Telegram message");
|
|
73620
73625
|
assertTelegramLanguageReleased(args["text"], args["release_token"]);
|
|
73621
73626
|
const parseMode = args["format"] === "markdownv2" ? "MarkdownV2" : void 0;
|
|
73622
73627
|
const edited = await api.editMessageText(chatId, Number(args["message_id"]), args["text"], parseMode !== void 0 ? { parse_mode: parseMode } : void 0);
|
|
@@ -73672,6 +73677,10 @@ async function runReply(api, args) {
|
|
|
73672
73677
|
const replyTo = args["reply_to"] !== null && args["reply_to"] !== void 0 ? Number(args["reply_to"]) : void 0;
|
|
73673
73678
|
const files = args["files"] ?? [];
|
|
73674
73679
|
const parseMode = args["format"] === "markdownv2" ? "MarkdownV2" : void 0;
|
|
73680
|
+
if (isSilentTurnMarker(text)) {
|
|
73681
|
+
if (files.length > 0) throw new Error("silent marker cannot accompany files");
|
|
73682
|
+
return "suppressed: silent marker - not sent";
|
|
73683
|
+
}
|
|
73675
73684
|
if (files.length === 0 && isGroupChat(chatId) && isGroupNoiseReply(text)) {
|
|
73676
73685
|
appendJsonl(outboxLog(), {
|
|
73677
73686
|
direction: "out",
|