omni-notify-mcp 1.3.327 → 1.3.329
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 +2 -2
- package/dist/notify.js +9 -5
- package/package.json +1 -1
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, PACKAGE_VERSION, startNotifyServer, yieldGateway } from "./notify.js";
|
|
16
|
+
import { DAEMON_BEAT_PATH, CONFIG_DIR, DAEMON_TAG, PACKAGE_VERSION, startNotifyServer, 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";
|
|
@@ -113,7 +113,7 @@ 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
115
|
startNotifyServer({
|
|
116
|
-
clientId:
|
|
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);
|
package/dist/notify.js
CHANGED
|
@@ -681,6 +681,9 @@ function takeWaitersFor(entryTag) {
|
|
|
681
681
|
// because the channel push is unacknowledged and Claude Code drops it silently.
|
|
682
682
|
const inboxDeliveredTo = new Map();
|
|
683
683
|
const deliveredKey = (tag) => tag ?? "*";
|
|
684
|
+
export const DAEMON_TAG = "daemon";
|
|
685
|
+
const OLD_DAEMON_TAG = "always-on";
|
|
686
|
+
const readerKeys = (tag) => (tag === DAEMON_TAG ? [deliveredKey(tag), OLD_DAEMON_TAG] : [deliveredKey(tag)]);
|
|
684
687
|
const entryKey = (entry) => `${entry.ts}\u0000${entry.tag ?? ""}\u0000${entry.text}`;
|
|
685
688
|
function alreadyDelivered(entry, tag) {
|
|
686
689
|
return inboxDeliveredTo.get(entryKey(entry))?.has(deliveredKey(tag)) ?? false;
|
|
@@ -740,7 +743,7 @@ function restoreInboxQueue() {
|
|
|
740
743
|
function takeSharedEntriesForSelf(saved) {
|
|
741
744
|
const mine = [];
|
|
742
745
|
for (const { deliveredTo, ...entry } of saved) {
|
|
743
|
-
if (deliveredTo.includes(
|
|
746
|
+
if (readerKeys(SELF_TAG).some((key) => deliveredTo.includes(key)) || alreadyDelivered(entry, SELF_TAG))
|
|
744
747
|
continue;
|
|
745
748
|
// The daemon is the machine's queue: it holds every chat's undelivered entry in memory, tagged ones
|
|
746
749
|
// included, because the HTTP chats it serves are the only readers of a tagged entry and each drains its own by
|
|
@@ -898,7 +901,7 @@ function reapInboxDrops() {
|
|
|
898
901
|
// renamed by the writer; each is claimed by rename (so exactly one host process takes it), queued UNTAGGED
|
|
899
902
|
// so every window sees it, and deleted. An unreadable file is kept as .rejected, never silently dropped.
|
|
900
903
|
const INBOX_DROP_IN_DIR = join(CONFIG_DIR, "inbox-drop");
|
|
901
|
-
function ingestDropFolder() {
|
|
904
|
+
function ingestDropFolder(host) {
|
|
902
905
|
if (!existsSync(INBOX_DROP_IN_DIR))
|
|
903
906
|
return;
|
|
904
907
|
const arrivals = [];
|
|
@@ -927,6 +930,7 @@ function ingestDropFolder() {
|
|
|
927
930
|
return;
|
|
928
931
|
persistInboxQueue(arrivals);
|
|
929
932
|
log("·", "inbox-drop", `queued ${arrivals.length} message${arrivals.length === 1 ? "" : "s"} from ${INBOX_DROP_IN_DIR}`);
|
|
933
|
+
syncInboxFromDisk(host);
|
|
930
934
|
}
|
|
931
935
|
function ingestInboxEntry(entry, source) {
|
|
932
936
|
const waiters = takeWaitersFor(entry.tag);
|
|
@@ -2704,20 +2708,20 @@ export function startNotifyServer(host) {
|
|
|
2704
2708
|
if (dropWatched || !existsSync(INBOX_DROP_IN_DIR))
|
|
2705
2709
|
return;
|
|
2706
2710
|
dropWatched = true;
|
|
2707
|
-
const drops = watch(INBOX_DROP_IN_DIR, { persistent: false }, () => ingestDropFolder());
|
|
2711
|
+
const drops = watch(INBOX_DROP_IN_DIR, { persistent: false }, () => ingestDropFolder(host));
|
|
2708
2712
|
// The drop folder was taken away: its watch is gone, and the folder's return is seen on the config folder's own watch.
|
|
2709
2713
|
drops.on("error", () => { dropWatched = false; });
|
|
2710
2714
|
};
|
|
2711
2715
|
watchNames(CONFIG_DIR, [basename(INBOX_QUEUE_PATH), basename(INBOX_DROP_IN_DIR)], (name) => {
|
|
2712
2716
|
if (name !== basename(INBOX_QUEUE_PATH)) {
|
|
2713
2717
|
watchDrops();
|
|
2714
|
-
ingestDropFolder();
|
|
2718
|
+
ingestDropFolder(host);
|
|
2715
2719
|
}
|
|
2716
2720
|
if (name !== basename(INBOX_DROP_IN_DIR) && !(existsSync(INBOX_QUEUE_PATH) && readFileSync(INBOX_QUEUE_PATH, "utf8") === queueWritten))
|
|
2717
2721
|
syncInboxFromDisk(host);
|
|
2718
2722
|
});
|
|
2719
2723
|
watchDrops();
|
|
2720
|
-
ingestDropFolder();
|
|
2724
|
+
ingestDropFolder(host);
|
|
2721
2725
|
syncInboxFromDisk(host);
|
|
2722
2726
|
const reapTimer = setInterval(reapInboxDrops, 60 * 60 * 1000);
|
|
2723
2727
|
ownershipTimer.unref();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.329",
|
|
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",
|