blun-king-cli 9.1.641 → 9.1.643

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.641",
3
+ "version": "9.1.643",
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": {
@@ -48,7 +48,9 @@
48
48
  "agent-spine-plugin/.mcp.json",
49
49
  "bundled-agent-sources.json",
50
50
  "telegram-plugin/",
51
- "LIESMICH.txt"
51
+ "LIESMICH.txt",
52
+ "tool-liveness642/",
53
+ "versionierung/"
52
54
  ],
53
55
  "keywords": [
54
56
  "blun",
@@ -68438,6 +68438,12 @@ function alreadySeen(key) {
68438
68438
  }
68439
68439
  const MAX_INBOUND_AGE_S = Number(process.env.BLUN_TELEGRAM_MAX_INBOUND_AGE_S ?? 900);
68440
68440
  const HEADLESS_ENABLED = (process.env.BLUN_TELEGRAM_HEADLESS ?? "on").trim().toLowerCase() !== "off";
68441
+ function controlAuthorized(ctx, result) {
68442
+ if (result.action !== "deliver" || result.addressed === false || result.inferAddressing === true || ctx.from === void 0 || ctx.from.isBot === true || ctx.chatId === void 0) return false;
68443
+ const id = String(ctx.from.id);
68444
+ const group = result.access.groups[String(ctx.chatId)];
68445
+ return result.access.allowFrom.includes(id) || (group?.allowFrom ?? []).includes(id) || (group?.alwaysAllowFrom ?? []).includes(id);
68446
+ }
68441
68447
  async function handleInbound(event) {
68442
68448
  const { ctx } = event;
68443
68449
  const result = gate(ctx, botUsername);
@@ -68478,6 +68484,8 @@ async function handleInbound(event) {
68478
68484
  addressed: inferAddressing ? "semantic" : String(addressed),
68479
68485
  user: ctx.from?.username ?? String(ctx.from?.id),
68480
68486
  user_id: String(ctx.from?.id),
68487
+ bot_username: bot.botInfo.username,
68488
+ control_authorized: String(controlAuthorized(ctx, result)),
68481
68489
  ts: (/* @__PURE__ */ new Date((ctx.date ?? 0) * 1e3)).toISOString(),
68482
68490
  ...image !== void 0 ? { image_path: image.path } : {},
68483
68491
  ...attachment !== void 0 ? {
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ ...require('./shell-yield.cjs'),
5
+ ...require('./queue-delivery.cjs'),
6
+ ...require('./task-wait.cjs'),
7
+ };
@@ -0,0 +1,109 @@
1
+ 'use strict';
2
+
3
+ const QUEUE_DELIVERY_DELAY_MS = 250;
4
+ const localShellRequests = new WeakSet();
5
+ const localShellManualRequests = new WeakSet();
6
+ const localShellPending = new WeakSet();
7
+ const localShellFailed = new WeakSet();
8
+ const localShellSucceeded = new WeakSet();
9
+
10
+ function releaseLocalShell(host, commandId, stream, content) {
11
+ if (host.shellOutputStreams.get(commandId) !== stream || stream.owner !== host.session) return false;
12
+ stream.component.finishBackgrounded();
13
+ stream.entry.content = content;
14
+ host.shellOutputStreams.delete(commandId);
15
+ if (host.shellOutputStreams.size === 0) {
16
+ host.setAppState({ streamingPhase: 'idle' });
17
+ host.requestQueueDrain();
18
+ }
19
+ host.updateQueueDisplay();
20
+ host.state.ui.requestRender();
21
+ return true;
22
+ }
23
+
24
+ function yieldRequestedLocalShell(host, commandId, stream) {
25
+ if (!localShellRequests.has(stream) || localShellPending.has(stream) || localShellFailed.has(stream)
26
+ || localShellSucceeded.has(stream)
27
+ || stream.taskId === undefined || stream.owner !== host.session
28
+ || host.gatewayLocalShells?.has(commandId)) return;
29
+ const session = host.session;
30
+ localShellPending.add(stream);
31
+ Promise.resolve().then(() => {
32
+ if (host.session !== session || host.isShuttingDown || host.aborted
33
+ || host.shellOutputStreams.get(commandId) !== stream) return;
34
+ const policy = host.queuePolicyForSession?.(session);
35
+ if (!localShellManualRequests.has(stream) && policy !== undefined && policy.mode !== 'steer') {
36
+ localShellRequests.delete(stream);
37
+ return;
38
+ }
39
+ return session.detachBackgroundTask(stream.taskId).then(result => {
40
+ localShellSucceeded.add(stream);
41
+ return result;
42
+ });
43
+ }).catch(() => {
44
+ localShellFailed.add(stream);
45
+ if (host.session === session && host.shellOutputStreams.get(commandId) === stream) {
46
+ host.showError('Could not move the command to the background.');
47
+ }
48
+ }).finally(() => localShellPending.delete(stream));
49
+ }
50
+
51
+ function yieldLocalShellsForInput(host, manual = false) {
52
+ for (const [commandId, stream] of host.shellOutputStreams) {
53
+ if (stream.owner !== host.session) continue;
54
+ if (manual) {
55
+ localShellFailed.delete(stream);
56
+ localShellManualRequests.add(stream);
57
+ }
58
+ localShellRequests.add(stream);
59
+ yieldRequestedLocalShell(host, commandId, stream);
60
+ }
61
+ }
62
+
63
+ class QueueDeliveryNudge {
64
+ constructor(host) { this.host = host; }
65
+ sync() {
66
+ const host = this.host;
67
+ if (this.owner !== host.session) { clearTimeout(this.timer); this.timer = undefined; }
68
+ this.owner = host.session;
69
+ if (host.state.queuedMessages.length === 0) { clearTimeout(this.timer); this.timer = undefined; }
70
+ if (this.timer !== undefined || !this.owner || host.isShuttingDown || host.aborted
71
+ || host.state.queuedMessages.length === 0) return;
72
+ const owner = this.owner;
73
+ this.timer = setTimeout(() => {
74
+ this.timer = undefined;
75
+ if (host.session !== owner || host.isShuttingDown || host.aborted) return;
76
+ const state = host.state.appState;
77
+ const head = host.state.queuedMessages[0];
78
+ const stopped = host.stoppedInputSession === owner
79
+ || host.stoppedInputScopes?.get(owner, head?.agentId ?? host.interactiveAgentId);
80
+ const policy = host.queuePolicyForSession?.(owner);
81
+ const maySteer = policy === undefined || policy.mode === 'steer';
82
+ if (!state.isReplaying && !state.isCompacting && !host.deferUserMessages
83
+ && !host.queueCommandRunning && !host.editorReplacementActive
84
+ && !host.manualPromptInFlight && !host.localShellConsentRequest
85
+ && !host.queueSteerInFlight && !stopped
86
+ && !(host.gatewayStartup && !host.gatewayViewReady)
87
+ && !host.hasPendingQueueCommandCancellation?.()
88
+ && !(host.queueInterruptCancellations?.size > 0)
89
+ && !host.activeInputDelivery?.has(head)) {
90
+ if (state.streamingPhase === 'shell') {
91
+ if (maySteer) yieldLocalShellsForInput(host);
92
+ }
93
+ else if (state.streamingPhase === 'idle') host.requestQueueDrain();
94
+ else if (maySteer && host.state.queuedMessages[0]?.mode === 'channel') {
95
+ host.channelQueueDeadline.requestDeliveryNow();
96
+ } else if (maySteer && host.pendingChannelReplyGuard === undefined) {
97
+ host.queueFlushBatchRemaining = Math.max(host.queueFlushBatchRemaining,
98
+ host.state.queuedMessages.length);
99
+ host.steerQueueFlushPrefix();
100
+ }
101
+ }
102
+ this.sync();
103
+ }, QUEUE_DELIVERY_DELAY_MS);
104
+ this.timer.unref?.();
105
+ }
106
+ }
107
+
108
+ module.exports = { QUEUE_DELIVERY_DELAY_MS, QueueDeliveryNudge, releaseLocalShell,
109
+ yieldRequestedLocalShell, yieldLocalShellsForInput };
@@ -0,0 +1,40 @@
1
+ {
2
+ "schema": "blun.shell-queue643-candidate/v1",
3
+ "releaseApproved": false,
4
+ "upstreamArchiveSha256": "529dda1f1a7fc9530d155ebf538b2bd408b762d3b3af82cce33da19855d4d43e",
5
+ "patchesSha256": "5b8006429074b0101b212431da7a7e9b51c899c23d1a2e1bd39b4fc878164db3",
6
+ "upstreamFiles": 939,
7
+ "preservedFiles": 936,
8
+ "removedFiles": [],
9
+ "changes": {
10
+ "blun.mjs": {
11
+ "before": "3b1c3891b1cb1a640d679d972ec773ba3a8371282fbf91ddbaa979ad57c1e9a7",
12
+ "after": "0a6664e561cb9495d34f1a90c731ff1aadbc3a2bc406723a8630599888d1b303"
13
+ },
14
+ "package.json": {
15
+ "before": "754161b0f802c6c6288bbe66f2a7f3b4e10b983d394ebdc10d6bdaef4d00a144",
16
+ "after": "0f9b7f75089537abad70deffb1fbb0d6934492aae90dc6032a477b1f2435c11c"
17
+ },
18
+ "tool-liveness642/index.cjs": {
19
+ "before": null,
20
+ "after": "490943e2bb28c59fea8aafaf2a05fbfe3ab10665924147c4e039039acad876cb"
21
+ },
22
+ "tool-liveness642/queue-delivery.cjs": {
23
+ "before": null,
24
+ "after": "504d416fd73ac2cb23b8df519fddb22eb5679b35560a4c1aad3311ca4e03110e"
25
+ },
26
+ "tool-liveness642/shell-yield.cjs": {
27
+ "before": null,
28
+ "after": "1cc0aa50f21f728bad582bfbdad6cb9c0f193a34a47bf23074cde1608dca7c5b"
29
+ },
30
+ "tool-liveness642/task-wait.cjs": {
31
+ "before": null,
32
+ "after": "e83bbea76b293d3444c180e49454c42b91fd3a2d8e975b3e4686a55ce4c9a039"
33
+ },
34
+ "worker-host.mjs": {
35
+ "before": "38955b66e48ae559935026e9124cbd4d0777b6948fb6007b60e9b288afc23bd6",
36
+ "after": "8bbbcf971599e20e916816571d084b7999ca6d6a669a8f66d73ce2eed28eee14"
37
+ }
38
+ },
39
+ "version": "9.1.643"
40
+ }
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ const SHELL_IDLE_YIELD_MS = 30_000;
4
+
5
+ /** Release the foreground wait; the existing manager retains the same process. */
6
+ function createForegroundYield({ control, initialEpoch, signal, enabled, detach,
7
+ onError = () => {}, idleMs = SHELL_IDLE_YIELD_MS }) {
8
+ let disposed = false;
9
+ let yielded = false;
10
+ let timer;
11
+ let removeInputListener;
12
+ const clear = () => { clearTimeout(timer); timer = undefined; };
13
+ const dispose = () => {
14
+ if (disposed) return;
15
+ disposed = true;
16
+ clear();
17
+ removeInputListener?.();
18
+ signal.removeEventListener('abort', dispose);
19
+ };
20
+ const yieldForeground = () => {
21
+ if (disposed || yielded || signal.aborted || control.stopped) return;
22
+ yielded = true;
23
+ clear();
24
+ try { detach(); }
25
+ catch (error) { try { onError(error); } catch {} }
26
+ finally { dispose(); }
27
+ };
28
+ const touch = () => {
29
+ if (disposed || yielded || !enabled || idleMs <= 0) return;
30
+ clear();
31
+ timer = setTimeout(yieldForeground, idleMs);
32
+ timer.unref?.();
33
+ };
34
+ if (enabled && !signal.aborted) {
35
+ removeInputListener = control.onChange(yieldForeground);
36
+ signal.addEventListener('abort', dispose, { once: true });
37
+ if (control.epoch !== initialEpoch) yieldForeground();
38
+ else touch();
39
+ }
40
+ return { touch, dispose };
41
+ }
42
+
43
+ module.exports = { SHELL_IDLE_YIELD_MS, createForegroundYield };
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ /** Cancel an observation wait without cancelling the task being observed. */
4
+ async function waitForTaskTerminal(terminal, timeout, signal) {
5
+ let onAbort;
6
+ try {
7
+ signal?.throwIfAborted();
8
+ const waits = [terminal, timeout];
9
+ if (signal) waits.push(new Promise((_, reject) => {
10
+ onAbort = () => reject(signal.reason);
11
+ signal.addEventListener('abort', onAbort, { once: true });
12
+ if (signal.aborted) onAbort();
13
+ }));
14
+ await Promise.race(waits);
15
+ } finally {
16
+ timeout.clear();
17
+ if (onAbort) signal.removeEventListener('abort', onAbort);
18
+ }
19
+ }
20
+
21
+ /** A new instruction releases TaskOutput's wait; work and notifications stay owned. */
22
+ async function waitForTaskInput({ manager, taskId, timeoutMs, signal, control, initialEpoch }) {
23
+ signal.throwIfAborted();
24
+ const inputArrived = Symbol('task-wait-input');
25
+ const observer = new AbortController();
26
+ const changed = () => observer.abort(control.stopped
27
+ ? new DOMException('Input stopped', 'AbortError') : inputArrived);
28
+ const remove = control.onChange(changed);
29
+ try {
30
+ if (control.stopped || control.epoch !== initialEpoch) changed();
31
+ await manager.wait(taskId, timeoutMs, AbortSignal.any([signal, observer.signal]));
32
+ signal.throwIfAborted();
33
+ if (control.stopped) throw new DOMException('Input stopped', 'AbortError');
34
+ return 'settled';
35
+ } catch (error) {
36
+ signal.throwIfAborted();
37
+ if (control.stopped) throw new DOMException('Input stopped', 'AbortError');
38
+ if (error === inputArrived) return 'input';
39
+ throw error;
40
+ } finally {
41
+ remove();
42
+ }
43
+ }
44
+
45
+ module.exports = { waitForTaskTerminal, waitForTaskInput };
@@ -0,0 +1,43 @@
1
+ {
2
+ "schema": "ISOLIERTE-VERSIONIERUNG-v1",
3
+ "version": "9.1.643",
4
+ "releaseApproved": false,
5
+ "installation": false,
6
+ "basisArchivSha256": "529dda1f1a7fc9530d155ebf538b2bd408b762d3b3af82cce33da19855d4d43e",
7
+ "quellen": {
8
+ "quellen/.gitignore": "58eab193f3324cfcb16a960f1b35fe4c3652d7bcfa5cc07234e78ac6045d1b03",
9
+ "quellen/README.md": "cf9200723365e770b976565f5a20885481a300d0807887b57c3acd0756c460bb",
10
+ "quellen/build.py": "fe170233a9f26a534177fcd41e2190c10e9b69a89f38604e2930d5622ec1698d",
11
+ "quellen/package.json": "bb5f6bfd59f1014843d4ec2fbec12baba154fe5d991e4604b75df96917874e42",
12
+ "quellen/patches.py": "5b8006429074b0101b212431da7a7e9b51c899c23d1a2e1bd39b4fc878164db3",
13
+ "quellen/runtime/index.cjs": "490943e2bb28c59fea8aafaf2a05fbfe3ab10665924147c4e039039acad876cb",
14
+ "quellen/runtime/queue-delivery.cjs": "504d416fd73ac2cb23b8df519fddb22eb5679b35560a4c1aad3311ca4e03110e",
15
+ "quellen/runtime/shell-yield.cjs": "1cc0aa50f21f728bad582bfbdad6cb9c0f193a34a47bf23074cde1608dca7c5b",
16
+ "quellen/runtime/task-wait.cjs": "e83bbea76b293d3444c180e49454c42b91fd3a2d8e975b3e4686a55ce4c9a039",
17
+ "quellen/test/agent-wait.test.cjs": "b2ed8e96a44531984cb849f6e1ce430b4031dfae073660de675e6ec3037a4051",
18
+ "quellen/test/assembly.test.cjs": "56331ddd6bd5ab6ce41062c032b528115ee1e1f645dd7d055e7a9ef804892c43",
19
+ "quellen/test/bundle.test.cjs": "22d5220b054abaeacd589edd4cfa756799aba775e421d88b426517a9f8621cdd",
20
+ "quellen/test/runtime.test.cjs": "e05c337ad0f6d8a9dcb25484b23a052b55b2508663ef5f36e7326eab9f40e5e4",
21
+ "quellen/test/task-harness.cjs": "9e6dae7603567c96041690a8171d98af9c6bc18db3fdb779fb700907d37e71e2",
22
+ "quellen/test/task-wait.test.cjs": "3649d739caf250fdf4fefe8027778ad25a682d168b96b552bf903d3340d5f079"
23
+ },
24
+ "versioniererSha256": "88e50b48c0622dd0b38a66145093eaddbbdf21bd53f9efdfaebf8275a52bf864",
25
+ "versionsschritt": {
26
+ "blun.mjs": {
27
+ "before": "48e2714999ae4f9f8d2979d69d0cde3eba73f14b95824007bf045d5db6eb2667",
28
+ "after": "0a6664e561cb9495d34f1a90c731ff1aadbc3a2bc406723a8630599888d1b303",
29
+ "aenderung": "Ausschliesslich Buildversionsliteral"
30
+ },
31
+ "worker-host.mjs": {
32
+ "before": "74f4f6b6d701977d5aaf424b6b98eb370458c6720957d098844972fbf5a40878",
33
+ "after": "8bbbcf971599e20e916816571d084b7999ca6d6a669a8f66d73ce2eed28eee14",
34
+ "aenderung": "Ausschliesslich Buildversionsliteral"
35
+ },
36
+ "package.json": {
37
+ "before": "11880ed0ca482030cfbcdf6f0c9215365b03de93f84dc83f1f1ce81ecebb0bf7",
38
+ "after": "0f9b7f75089537abad70deffb1fbb0d6934492aae90dc6032a477b1f2435c11c",
39
+ "aenderung": "Version und Aufnahme des Versionierungsbelegs"
40
+ }
41
+ },
42
+ "grenze": "Gepruefte Bundles werden mit Original-PR17-Builder rekonstruiert, dann ausschliesslich Buildversionsliterale und Paketmetadaten versioniert; kein TypeScript-Neubau. Headerhash bezeichnet weiterhin den Upstream-Build. Native 642-Belege sind kein nativer 643-PASS."
43
+ }
@@ -0,0 +1,5 @@
1
+ # Isolierter Kandidat 9.1.643
2
+
3
+ Nicht veröffentlicht, nicht installiert. PR17-Overlay aus exakt hashgeprüfter veröffentlichter Basis rekonstruiert; danach ausschließlich Versionsidentität und Paketierungsbeleg ergänzt. Kein Neubau aus gepflegten TypeScript-Quellen. Upstream-Buildheader bleibt Herkunftsbeleg, nicht Hash des Versionsschritts.
4
+
5
+ Persönliche 9.1.642-Lieferung und historische Belege unverändert. Kein Livekonto, Telegramversand oder fremde Konfiguration. Datenarten: technische Quell-/Dateihashes und synthetische Tests. Rechtsgrundlage, Verantwortliche, Speicherfristen und konkrete KI-Rolle/Risiko-/Transparenzpflichten aus T4593 vor betroffenem echtem Betrieb klären; kein Rechtsgesamt-PASS. Löschung ausschließlich im eigenen Aufgabenordner samt autorisierten Sicherungs-/Rücklesekopien durch Berechtigte.
@@ -0,0 +1,39 @@
1
+ {
2
+ "schema": "blun.shell-queue642-candidate/v1",
3
+ "releaseApproved": false,
4
+ "upstreamArchiveSha256": "529dda1f1a7fc9530d155ebf538b2bd408b762d3b3af82cce33da19855d4d43e",
5
+ "patchesSha256": "5b8006429074b0101b212431da7a7e9b51c899c23d1a2e1bd39b4fc878164db3",
6
+ "upstreamFiles": 939,
7
+ "preservedFiles": 936,
8
+ "removedFiles": [],
9
+ "changes": {
10
+ "blun.mjs": {
11
+ "before": "3b1c3891b1cb1a640d679d972ec773ba3a8371282fbf91ddbaa979ad57c1e9a7",
12
+ "after": "48e2714999ae4f9f8d2979d69d0cde3eba73f14b95824007bf045d5db6eb2667"
13
+ },
14
+ "package.json": {
15
+ "before": "754161b0f802c6c6288bbe66f2a7f3b4e10b983d394ebdc10d6bdaef4d00a144",
16
+ "after": "11880ed0ca482030cfbcdf6f0c9215365b03de93f84dc83f1f1ce81ecebb0bf7"
17
+ },
18
+ "tool-liveness642/index.cjs": {
19
+ "before": null,
20
+ "after": "490943e2bb28c59fea8aafaf2a05fbfe3ab10665924147c4e039039acad876cb"
21
+ },
22
+ "tool-liveness642/queue-delivery.cjs": {
23
+ "before": null,
24
+ "after": "504d416fd73ac2cb23b8df519fddb22eb5679b35560a4c1aad3311ca4e03110e"
25
+ },
26
+ "tool-liveness642/shell-yield.cjs": {
27
+ "before": null,
28
+ "after": "1cc0aa50f21f728bad582bfbdad6cb9c0f193a34a47bf23074cde1608dca7c5b"
29
+ },
30
+ "tool-liveness642/task-wait.cjs": {
31
+ "before": null,
32
+ "after": "e83bbea76b293d3444c180e49454c42b91fd3a2d8e975b3e4686a55ce4c9a039"
33
+ },
34
+ "worker-host.mjs": {
35
+ "before": "38955b66e48ae559935026e9124cbd4d0777b6948fb6007b60e9b288afc23bd6",
36
+ "after": "74f4f6b6d701977d5aaf424b6b98eb370458c6720957d098844972fbf5a40878"
37
+ }
38
+ }
39
+ }