omni-notify-mcp 1.3.332 → 1.3.334

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/dist/daemon.js CHANGED
@@ -13,7 +13,7 @@ import { spawn } from "child_process";
13
13
  import { existsSync, readFileSync, renameSync, writeFileSync, mkdirSync } from "fs";
14
14
  import { join } from "path";
15
15
  import { fileURLToPath } from "url";
16
- import { DAEMON_BEAT_PATH, CONFIG_DIR, DAEMON_TAG, PACKAGE_VERSION, startNotifyServer, yieldGateway } from "./notify.js";
16
+ import { DAEMON_BEAT_PATH, CONFIG_DIR, DAEMON_TAG, PACKAGE_VERSION, startNotifyServer, takePendingInbox, yieldGateway } from "./notify.js";
17
17
  import { startNotifyDoor } from "./gateway/notifyDoor.js";
18
18
  import { announceTakeover, inThisBoot } from "./shared/webhost/originHandover.js";
19
19
  import { TunnelRunner } from "./gateway/tunnel.js";
@@ -112,14 +112,17 @@ const beatTimer = setInterval(() => {
112
112
  let handedOver;
113
113
  // Only the daemon that owns the gateway port runs the connector and publishes its state: a dormant one has nothing for it to reach.
114
114
  const tunnel = new TunnelRunner();
115
- startNotifyServer({
115
+ const alwaysOn = {
116
116
  clientId: DAEMON_TAG, tag: DAEMON_TAG, queueOnly: true, emit: async () => { },
117
117
  onDoorOwned: (port) => {
118
118
  tunnel.beat(port);
119
119
  setInterval(() => tunnel.beat(port), HEARTBEAT_MS);
120
120
  },
121
121
  onSuperseded: () => (handedOver === undefined ? replaceWithInstalledBuild() : void handedOver.then(() => process.exit(0))),
122
- });
122
+ };
123
+ startNotifyServer(alwaysOn);
124
+ // No MCP client connects here, so nothing can be pushed: the boot take only hands entries to the queue.
125
+ takePendingInbox(alwaysOn);
123
126
  startNotifyDoor(() => { beating = true; beat(); }, undefined, {
124
127
  version: PACKAGE_VERSION,
125
128
  takeover,
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
- import { sessionIdentity, startNotifyServer } from "./notify.js";
3
+ import { sessionIdentity, startNotifyServer, takePendingInbox } from "./notify.js";
4
4
  import { startNotifyDoor } from "./gateway/notifyDoor.js";
5
5
  // The explicit name wins, so a host whose config can pass arguments (Copilot's
6
6
  // mcp.json, Codex's config.toml) names its own window instead of inheriting
@@ -17,8 +17,8 @@ const TAG = sessionIdentity({
17
17
  sessionId: process.env.CLAUDE_CODE_SESSION_ID,
18
18
  });
19
19
  // Assigned by startNotifyServer() on the next line and never replaced. It is
20
- // read only from emit(), which no caller can reach before that assignment:
21
- // the entry point starts the disk-sync timer that calls emit.
20
+ // read only from emit(), which runs only after mcp.connect below: the watches
21
+ // fire on later events, and takePendingInbox runs right after connect.
22
22
  let mcp;
23
23
  const host = {
24
24
  clientId: TAG,
@@ -37,5 +37,7 @@ mcp = startNotifyServer(host);
37
37
  startNotifyDoor(() => { });
38
38
  const transport = new StdioServerTransport();
39
39
  await mcp.connect(transport);
40
+ // A channel push is only read by a host that has finished its initialize handshake, so the boot take waits for it.
41
+ mcp.server.oninitialized = () => takePendingInbox(host);
40
42
  process.stdin.on("end", () => process.exit(0));
41
43
  process.stdin.on("close", () => process.exit(0));
package/dist/notify.js CHANGED
@@ -759,13 +759,6 @@ function persistInboxQueue(arrivals = []) {
759
759
  rmSync(join(CONFIG_DIR, other), { force: true });
760
760
  }
761
761
  }
762
- function restoreInboxQueue() {
763
- const saved = readSharedQueue();
764
- if (saved.length === 0)
765
- return;
766
- const taken = takeSharedEntriesForSelf(saved);
767
- log("·", "inbox", `restored ${taken.length} undelivered inbox entr${taken.length === 1 ? "y" : "ies"} of ${saved.length} in ${CONFIG_DIR}`);
768
- }
769
762
  // Entries in the shared queue addressed to THIS host that no process of it has taken yet. Each is
770
763
  // recorded as taken (in memory and in the shared file, so it is never taken twice) and handed over.
771
764
  function takeSharedEntriesForSelf(saved) {
@@ -2696,7 +2689,6 @@ function syncInboxFromDisk(host) {
2696
2689
  export function startNotifyServer(host) {
2697
2690
  SELF_TAG = host.tag;
2698
2691
  QUEUE_ONLY = host.queueOnly === true;
2699
- restoreInboxQueue();
2700
2692
  importCredsOnStart();
2701
2693
  warnIfNoChannelConfigured(loadConfig());
2702
2694
  refreshReach();
@@ -2741,10 +2733,13 @@ export function startNotifyServer(host) {
2741
2733
  syncInboxFromDisk(host);
2742
2734
  });
2743
2735
  watchDrops();
2744
- ingestDropFolder(host);
2745
- syncInboxFromDisk(host);
2746
2736
  const reapTimer = setInterval(reapInboxDrops, 60 * 60 * 1000);
2747
2737
  ownershipTimer.unref();
2748
2738
  reapTimer.unref();
2749
2739
  return createMcpServer(host.clientId, host.tag);
2750
2740
  }
2741
+ /** Takes in what was queued or dropped before this process started. Called once the server is connected, because every push needs it. */
2742
+ export function takePendingInbox(host) {
2743
+ ingestDropFolder(host);
2744
+ syncInboxFromDisk(host);
2745
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-notify-mcp",
3
- "version": "1.3.332",
3
+ "version": "1.3.334",
4
4
  "description": "Reach your AI agents from anywhere — and let them reach you. One stdio process 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/index.js",
6
6
  "type": "module",