omni-notify-mcp 1.3.359 → 1.3.360

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.
@@ -1616,6 +1616,8 @@ export function requestedStories(board) {
1616
1616
  }
1617
1617
  // GATE: how long a request no ack names waits before BB writes it again — FV acks within one beat, so past this the request or its ack was lost, or FV is down
1618
1618
  export const ACK_LATE_MS = 60_000;
1619
+ // GATE: how long an unacknowledged request may stand before the board's OWN SURFACE says FleetView has not answered it — a reading of the page's words, never a re-send, so a beat that lags no longer tells Meni FleetView is down while it is working
1620
+ export const ACK_LATE_SAID_MS = 2 * 60 * 60_000;
1619
1621
  /**
1620
1622
  * BB's ONE scheduling act: the story's request written beside the board. A request FV already acknowledged is left alone;
1621
1623
  * one waiting on its ack is written again once {@link ACK_LATE_MS} has passed (a lost request or a lost ack); a press's
@@ -1812,10 +1814,12 @@ export class WorkerNotStarted extends Error {
1812
1814
  this.name = "WorkerNotStarted";
1813
1815
  }
1814
1816
  }
1815
- // GATE: how many times one story's worker is started before its entry stops in `failed` with the reason — each start that ends with the story still open is one
1817
+ // GATE: how many times one story's worker is started before the queue gives up on it and its entry stops in `failed` — each start that ends with the story still open is one
1816
1818
  export const WORKER_ATTEMPTS = 3;
1817
1819
  // GATE: the wait before a story whose worker ended is started again: this, doubled for each earlier attempt
1818
1820
  export const RETRY_BASE_MS = 60_000;
1821
+ // GATE: the wait before a story the queue gave up on is offered to the line again: this, doubled for each start past WORKER_ATTEMPTS
1822
+ export const REARM_BASE_MS = RETRY_BASE_MS * 2 ** WORKER_ATTEMPTS;
1819
1823
  /** The acks the passes' requests call for: one per request read, carrying its entry's state and place, rewritten only when one of them changed. */
1820
1824
  function writeAcks(board, store, refusals, applied, now) {
1821
1825
  const order = queueOrder(store);
@@ -1900,6 +1904,18 @@ export async function driveStoryQueue(board, world, now) {
1900
1904
  step(e, now, "closed", closed);
1901
1905
  continue;
1902
1906
  }
1907
+ if (e.state === "failed") {
1908
+ const gaveUp = e.trace.filter((t) => t.stage === "failed").pop();
1909
+ if (!e.eligible || gaveUp === undefined)
1910
+ continue;
1911
+ if (now - gaveUp.at < REARM_BASE_MS * 2 ** (e.attempts - WORKER_ATTEMPTS))
1912
+ continue;
1913
+ e.state = "queued";
1914
+ delete e.nextTryAt;
1915
+ e.why = `the queue gave up on it ${Math.round((now - gaveUp.at) / 60_000)}m ago and the story is still open, so it is offered to the line again`;
1916
+ step(e, now, "retry", e.why);
1917
+ continue;
1918
+ }
1903
1919
  if (e.state !== "starting" && e.state !== "running")
1904
1920
  continue;
1905
1921
  const w = world.worker(e, board);
@@ -1945,7 +1961,7 @@ export async function driveStoryQueue(board, world, now) {
1945
1961
  e.state = "starting";
1946
1962
  e.attempts += 1;
1947
1963
  delete e.worker;
1948
- step(e, now, "selected", `start ${e.attempts} of ${WORKER_ATTEMPTS}, with ${lanes} of ${world.limit} lanes running`);
1964
+ step(e, now, "selected", `start ${e.attempts}${e.attempts > WORKER_ATTEMPTS ? ", past the attempts a story is given" : ` of ${WORKER_ATTEMPTS}`}, with ${lanes} of ${world.limit} lanes running`);
1949
1965
  save();
1950
1966
  lanes += 1;
1951
1967
  try {
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ const crypto = require("crypto");
2
3
  const fs = require("fs");
3
4
  const http = require("http");
4
5
  const os = require("os");
@@ -66,6 +67,43 @@ function takeStartLock(origin) {
66
67
  }
67
68
  return undefined;
68
69
  }
70
+ /** Whether `file` exists, asked without blocking the event loop; any failure but "not there" is thrown. */
71
+ const existsAsync = (file) => fs.promises.access(file).then(() => true, (failed) => {
72
+ if (failed.code === "ENOENT")
73
+ return false;
74
+ throw failed;
75
+ });
76
+ /** Writes `content` (text or bytes) to `file` through a staged rename unless the file already holds exactly those bytes; true when it wrote. Every file call is asynchronous, and the staged name is unique to the call because every Bullseye extension of one window shares its process id. */
77
+ async function writeIfChangedAsync(file, content) {
78
+ const bytes = Buffer.isBuffer(content) ? content : Buffer.from(content, "utf8");
79
+ const held = await fs.promises.readFile(file).catch((failed) => {
80
+ if (failed.code === "ENOENT")
81
+ return undefined;
82
+ throw failed;
83
+ });
84
+ if (held !== undefined && Buffer.compare(held, bytes) === 0)
85
+ return false;
86
+ await fs.promises.mkdir(path.dirname(file), { recursive: true });
87
+ const staged = `${file}.${process.pid}.${crypto.randomUUID()}.tmp`;
88
+ await fs.promises.writeFile(staged, bytes);
89
+ await fs.promises.rename(staged, file);
90
+ return true;
91
+ }
92
+ /** The first runnable node on PATH, found without a child process; undefined when none is. */
93
+ async function nodeOnPath() {
94
+ const exe = process.platform === "win32" ? "node.exe" : "node";
95
+ for (const entry of (process.env.PATH ?? "").split(path.delimiter).map((dir) => dir.replace(/^"(.*)"$/, "$1")).filter((dir) => dir !== "")) {
96
+ const file = path.join(entry, exe);
97
+ const found = await fs.promises.stat(file).catch((failed) => {
98
+ if (["ENOENT", "ENOTDIR", "EACCES", "EPERM"].includes(failed.code))
99
+ return undefined;
100
+ throw failed;
101
+ });
102
+ if (found !== undefined && found.isFile() && (process.platform === "win32" || (found.mode & 0o111) !== 0))
103
+ return file;
104
+ }
105
+ return undefined;
106
+ }
69
107
  /** #3849 Q782 — whether a moment `at` (ms epoch) falls in this boot: Meni's Stop holds until his Start or the machine's next boot, and a supervisor's start failure stands only until a new build or the next boot. */
70
108
  function inThisBoot(at) {
71
109
  return at >= Date.now() - os.uptime() * 1000;
@@ -511,4 +549,4 @@ function listenWithHandover(httpServer, { server, port, version, onServing }) {
511
549
  httpServer.once("listening", onServing);
512
550
  httpServer.listen(port, "127.0.0.1");
513
551
  }
514
- module.exports = { inThisBoot, takeStartLock, bundleRelease, spawnBundle, residentLogFile, keepDoor, servedDoor, ensureResidentDoor, doorAnswer, servesUntil, healthBody, answerShutdown, announceTakeover, TAKEOVER_BIND, listenWithHandover, holdOf, holdStopped, releaseHold };
552
+ module.exports = { existsAsync, writeIfChangedAsync, nodeOnPath, inThisBoot, takeStartLock, bundleRelease, spawnBundle, residentLogFile, keepDoor, servedDoor, ensureResidentDoor, doorAnswer, servesUntil, healthBody, answerShutdown, announceTakeover, TAKEOVER_BIND, listenWithHandover, holdOf, holdStopped, releaseHold };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-notify-mcp",
3
- "version": "1.3.359",
3
+ "version": "1.3.360",
4
4
  "description": "Reach your AI agents from anywhere — and let them reach you. One resident process on 127.0.0.1:7475 serves the whole tool surface to Claude Code, GitHub Copilot Chat and Codex: desktop, Telegram, Slack, ntfy, Discord, Teams and SMS are configured in one file, and agents notify you when long work finishes or a decision is needed, ask you a question and wait for your answer, and receive and reply to the messages you send them — with Do Not Disturb and idle detection deciding what actually gets through.",
5
5
  "main": "dist/daemon.js",
6
6
  "type": "module",