blun-king-cli 9.1.655 → 9.1.657

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.655",
3
+ "version": "9.1.657",
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": {
@@ -291,6 +291,7 @@ export function setGrammyErrorType(type) { isGrammyError = error => error instan
291
291
  const BINDING_FILE = 'tui-session-control.json';
292
292
  const BINDING_TTL_MS = 90_000;
293
293
  const BINDING_REFRESH_MS = 10_000;
294
+ const LEASE_CLOCK_SKEW_MS = 5_000;
294
295
  const BOT_ID = /^[1-9]\d{0,18}$/u;
295
296
 
296
297
  function underLease(dir, owner, pid) {
@@ -301,7 +302,7 @@ function underLease(dir, owner, pid) {
301
302
  try {
302
303
  const named = lstatSync(file);
303
304
  const age = Date.now() - Math.floor(named.mtimeMs);
304
- if (!named.isFile() || named.nlink !== 1 || named.size > 16 || age < 0 || age >= BINDING_TTL_MS) return false;
305
+ if (!named.isFile() || named.nlink !== 1 || named.size > 16 || age < -LEASE_CLOCK_SKEW_MS || age >= BINDING_TTL_MS) return false;
305
306
  fd = openSync(file, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0));
306
307
  const info = fstatSync(fd);
307
308
  if (info.dev !== named.dev || info.ino !== named.ino || info.nlink !== 1 || !info.isFile()) return false;