blun-king-cli 9.1.22 → 9.1.24
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/bin/blun.js +11 -12
- package/bin/king.js +11 -12
- package/bin/launcher-runtime.js +1 -1
- package/bin/update-notice.js +93 -17
- package/blun.mjs +448 -185
- package/package.json +1 -1
- package/telegram-plugin/dist/bridge.mjs +10 -2
package/package.json
CHANGED
|
@@ -67752,6 +67752,14 @@ function pidAlive(pid) {
|
|
|
67752
67752
|
return false;
|
|
67753
67753
|
}
|
|
67754
67754
|
}
|
|
67755
|
+
/** True while the TUI process named by the lease still exists. */
|
|
67756
|
+
function isTuiLeaseOwnerAlive() {
|
|
67757
|
+
try {
|
|
67758
|
+
return pidAlive(parseInt(readFileSync(tuiPidFile(), "utf8"), 10));
|
|
67759
|
+
} catch {
|
|
67760
|
+
return false;
|
|
67761
|
+
}
|
|
67762
|
+
}
|
|
67755
67763
|
function isTuiLeaseFresh(maxAgeMs = TUI_LEASE_MAX_AGE_MS, now = Date.now()) {
|
|
67756
67764
|
try {
|
|
67757
67765
|
const file = tuiPidFile();
|
|
@@ -67763,7 +67771,7 @@ function isTuiLeaseFresh(maxAgeMs = TUI_LEASE_MAX_AGE_MS, now = Date.now()) {
|
|
|
67763
67771
|
}
|
|
67764
67772
|
/** Per-message routing decision of the single poller. */
|
|
67765
67773
|
function deliveryTarget() {
|
|
67766
|
-
return
|
|
67774
|
+
return isTuiLeaseOwnerAlive() ? "tui" : "headless";
|
|
67767
67775
|
}
|
|
67768
67776
|
function deliverToTuiQueue(envelope) {
|
|
67769
67777
|
appendJsonl(tuiInboundQueueFile(), envelope);
|
|
@@ -67775,7 +67783,7 @@ function deliverToTuiQueue(envelope) {
|
|
|
67775
67783
|
*/
|
|
67776
67784
|
function rotateStaleTuiQueue() {
|
|
67777
67785
|
try {
|
|
67778
|
-
if (!
|
|
67786
|
+
if (!isTuiLeaseOwnerAlive() && existsSync(tuiInboundQueueFile())) rmSync(tuiInboundQueueFile());
|
|
67779
67787
|
} catch {}
|
|
67780
67788
|
}
|
|
67781
67789
|
//#endregion
|