omni-notify-mcp 1.3.338 → 1.3.340

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/README.md CHANGED
@@ -46,16 +46,15 @@ Beyond notifications, BullseyeNotify runs a full interactive agent CLI on your m
46
46
  `omni-notify-mcp` **is** the notification server. In the shipped VS Code extension one
47
47
  copy of it runs at login and serves a single door on loopback
48
48
  (`http://127.0.0.1:7475/mcp`); Claude Code and VS Code / Copilot Chat are pointed at
49
- that door, so neither spawns a child per session. The same source is also a plain stdio
50
- server for anything that can only spawn one:
49
+ that door, so neither spawns a child per session. That door is the only way in — there
50
+ is no stdio mode. Started by hand with no argument, the server serves the same door:
51
51
 
52
52
  ```bash
53
- node dist/index.js # the stdio entry; a stdio host spawns this and holds its pipe
53
+ node dist/daemon.js # serves http://127.0.0.1:7475/mcp
54
54
  ```
55
55
 
56
56
  The config is a plain file (below), and the editor-side panel that edits it lives in
57
- the VS Code extension. A stdio host's copy exits when its host goes away; the resident
58
- process the extension starts does not — it belongs to no window and outlives them all.
57
+ the VS Code extension. The resident process belongs to no window and outlives them all.
59
58
 
60
59
  > **Build note.** `package.json` is deliberately tracked here (see `.gitignore`), so
61
60
  > `bin`, `main` and the build scripts are all in git. The published package declares
@@ -82,16 +81,6 @@ serves:
82
81
  }
83
82
  ```
84
83
 
85
- A host that can only spawn a stdio server takes the mirrored bundle instead, starting
86
- its own child per session:
87
-
88
- ```json
89
- {
90
- "mcpServers": {
91
- "notify": { "type": "stdio", "command": "node", "args": ["<globalStorage>/dist/index.mjs"] }
92
- }
93
- }
94
- ```
95
84
 
96
85
  ## MCP wiring
97
86
 
@@ -104,10 +93,10 @@ window start so a machine registered by an older release converges on its own:
104
93
  | **VS Code / GitHub Copilot Chat** | the extension's `contributes.mcpServerDefinitionProviders` **and** the workspace's `.vscode/mcp.json` | `servers.notify` |
105
94
 
106
95
  Both point at the door the copy bundled inside the extension serves. Any other host is
107
- wired by hand, with either entry from *Quick start* — for **Codex** that is
108
- `~/.codex/config.toml` under `[mcp_servers.notify]`, `command`/`args` naming the mirrored
109
- bundle. A `notify` entry that differs from ours is yours and is left untouched; a build
110
- that bundled no server registers nothing and says so.
96
+ wired by hand to that same door — for **Codex** that is `~/.codex/config.toml` under
97
+ `[mcp_servers.notify]`, `url = "http://127.0.0.1:7475/mcp"`. A host that can only spawn
98
+ a stdio server cannot reach notify. A `notify` entry that differs from ours is yours and
99
+ is left untouched; a build that bundled no server registers nothing and says so.
111
100
 
112
101
  ## Tools
113
102
 
package/dist/daemon.js CHANGED
@@ -2,27 +2,25 @@
2
2
  /**
3
3
  * notify's daemon — the one process per machine, started by the boot supervisor.
4
4
  *
5
- * It runs the same server code as the stdio bridge (`startNotifyServer`) with no MCP client attached, so it
6
- * competes for the gateway port like every other BN process, and the one that binds it polls the channels,
7
- * serves the REST/MCP door and runs the agent conversations whether or not any agent session is open. Everything it hears lands in the shared inbox
8
- * files under the config dir, which every bridge already reads: nothing is held only in its memory, so a
9
- * restart of this process loses no message. The stdio bridge keeps working with this process up or down.
10
- * It also binds the chat-tool door (127.0.0.1:7475), so it is what an HTTP-attached chat talks to.
5
+ * It is the only mode BN runs in: started with no argument it serves the chat-tool door on 127.0.0.1:7475, which every
6
+ * MCP host is pointed at. It runs the server code (`startNotifyServer`) with no MCP client attached, so it competes for
7
+ * the gateway port like every other BN process, and the one that binds it polls the channels, serves the REST/MCP door
8
+ * and runs the agent conversations whether or not any agent session is open. Everything it hears lands in the shared
9
+ * inbox files under the config dir: nothing is held only in its memory, so a restart of this process loses no message.
11
10
  */
12
11
  import { spawn } from "child_process";
13
- import { existsSync, readFileSync, renameSync, writeFileSync, mkdirSync } from "fs";
12
+ import { existsSync, readFileSync, mkdirSync } from "fs";
14
13
  import { join } from "path";
15
14
  import { fileURLToPath } from "url";
16
15
  import { DAEMON_BEAT_PATH, CONFIG_DIR, DAEMON_TAG, PACKAGE_VERSION, startNotifyServer, takePendingInbox, yieldGateway } from "./notify.js";
17
16
  import { startNotifyDoor } from "./gateway/notifyDoor.js";
17
+ import { writeRecordFile } from "./gateway/conversations.js";
18
18
  import { announceTakeover, inThisBoot } from "./shared/webhost/originHandover.js";
19
19
  import { TunnelRunner } from "./gateway/tunnel.js";
20
20
  const HEARTBEAT_MS = 10_000;
21
21
  function beat(pid = process.pid) {
22
22
  mkdirSync(CONFIG_DIR, { recursive: true });
23
- const staged = `${DAEMON_BEAT_PATH}.${process.pid}.tmp`;
24
- writeFileSync(staged, JSON.stringify({ pid, at: Date.now(), version: PACKAGE_VERSION }));
25
- renameSync(staged, DAEMON_BEAT_PATH);
23
+ writeRecordFile(DAEMON_BEAT_PATH, JSON.stringify({ pid, at: Date.now(), version: PACKAGE_VERSION }));
26
24
  }
27
25
  /** The boot supervisor's login entry: launchd's label and systemd's unit. */
28
26
  const ENTRY_LABEL = "com.bullseye.BullseyeMcpOrigins";
@@ -91,7 +89,7 @@ if (stoppedByHand()) {
91
89
  const takeover = process.argv.includes("--takeover");
92
90
  /** Whether this process writes the heartbeat: the next release only from the moment it holds the chat door, so a takeover that never lands leaves the serving build's beat alone; and a build that let the door go no longer, so the release that took it is the one beat. */
93
91
  let beating = !takeover;
94
- // The server's own timers are unref'd because a bridge lives as long as its stdin; this process lives until it is stopped.
92
+ // The server's own timers are unref'd, so this beat and the door hold the process until it is stopped.
95
93
  if (beating)
96
94
  beat();
97
95
  /** Each tick reads the Stop first, beating or not: a press in a window that may not end this process — the boot task's, in session 0, or one still draining its gateway after a hand-over — stops it all the same, within one tick. */
@@ -103,7 +103,7 @@ function dropStaged(staged) {
103
103
  const code = err.code ?? "";
104
104
  if (!RENAME_REFUSED.has(code))
105
105
  throw err;
106
- process.stderr.write(`[agent-gateway] the staged record ${staged} could not be removed (${code}) — this process's next write of it replaces the file\n`);
106
+ process.stderr.write(`[store] the staged file ${staged} could not be removed (${code}) — this process's next write of it replaces the file\n`);
107
107
  }
108
108
  }
109
109
  /**
@@ -116,7 +116,7 @@ function dropStaged(staged) {
116
116
  function writeMeta(meta) {
117
117
  writeRecordFile(metaPath(meta.id), JSON.stringify(meta, null, 2));
118
118
  }
119
- /** Writes one store file of the agent dir the way a record is written: staged beside itself and renamed over the old one, a refused rename tried again. */
119
+ /** Writes one store file — an agent-dir record, or the daemon's heartbeat in the config dir — the way a record is written: staged beside itself and renamed over the old one, a refused rename tried again. */
120
120
  export function writeRecordFile(final, text) {
121
121
  const staged = `${final}.${process.pid}.tmp`;
122
122
  for (let attempt = 0;; attempt++) {
package/dist/notify.js CHANGED
@@ -1,10 +1,9 @@
1
1
  /**
2
- * The notify server — ONE process, spoken to over stdio.
2
+ * The notify server — ONE process per machine, spoken to over its HTTP door.
3
3
  *
4
- * Every MCP host reaches this program the same way: it spawns `node
5
- * dist/index.mjs` and negotiates MCP over the child's stdin/stdout. Nothing
6
- * here listens on a port and nothing here starts a second process — the whole
7
- * tool surface lives in this file.
4
+ * Every MCP host reaches this program the same way: the daemon (`dist/daemon.js`)
5
+ * serves the chat-tool door on 127.0.0.1:7475 and each chat is one MCP session
6
+ * on it — the whole tool surface lives in this file.
8
7
  *
9
8
  * Configuration is the file `~/.notify-mcp/config.json`, edited directly.
10
9
  * Unsolicited user messages arrive on the Telegram and Slack pollers and are
@@ -38,8 +37,7 @@ function installedVersion() {
38
37
  export const PACKAGE_VERSION = installedVersion();
39
38
  /**
40
39
  * The identity one chat reports and the tag its messages are routed by: `<machine>-<workspace>[-<session>]`.
41
- * Both doors derive it from the same place — the stdio bridge from its environment, the HTTP door from the
42
- * headers its client sends — so a chat reads the same name whichever transport carries it. A tag the host
40
+ * The HTTP door derives it from the headers its client sends. A tag the host
43
41
  * states explicitly wins; otherwise the workspace is walked up from the project folder, skipping launcher and
44
42
  * system directory names, and a session id (when the host has one) tells two windows on one workspace apart.
45
43
  * The session part is only ever what a host ACTUALLY sends: a Claude Code MCP header does not expand
@@ -2235,7 +2233,7 @@ BEHAVIORAL RULES for every client that connects:
2235
2233
  'notify'; this server states what its tools do, never a claim on a user's
2236
2234
  attention that the user's own rules contradict.
2237
2235
  `.trim();
2238
- /** The notify tool surface itself, built for one chat: the stdio bridge and the HTTP door both get their own. */
2236
+ /** The notify tool surface itself, built for one chat: each session on the HTTP door gets its own. */
2239
2237
  export function createMcpServer(clientId, sessionTag) {
2240
2238
  const identity = `@${clientId}`;
2241
2239
  const identityLine = `\nYOUR SESSION IDENTITY: "${identity}" — use this as your prefix in all notify replies (e.g. "[${identity}] done with build").\n`;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "omni-notify-mcp",
3
- "version": "1.3.338",
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
- "main": "dist/index.js",
3
+ "version": "1.3.340",
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
+ "main": "dist/daemon.js",
6
6
  "type": "module",
7
7
  "bin": {
8
- "omni-notify-mcp": "dist/index.js"
8
+ "omni-notify-mcp": "dist/daemon.js"
9
9
  },
10
10
  "license": "MIT",
11
11
  "engines": {
@@ -16,7 +16,7 @@
16
16
  "prebuild": "npm run sync-shared",
17
17
  "build": "tsc && node -e \"require('fs').copyFileSync('src/shared/webhost/package.json','dist/shared/webhost/package.json')\"",
18
18
  "build:extension": "node vscode-extension/esbuild.js",
19
- "start": "node dist/index.js",
19
+ "start": "node dist/daemon.js",
20
20
  "test": "npm run build && npm run build:extension && node tests/run-tests.js",
21
21
  "test:files": "node tests/run-tests.js"
22
22
  },
package/dist/index.js DELETED
@@ -1,43 +0,0 @@
1
- #!/usr/bin/env node
2
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
- import { sessionIdentity, startNotifyServer, takePendingInbox } from "./notify.js";
4
- import { startNotifyDoor } from "./gateway/notifyDoor.js";
5
- // The explicit name wins, so a host whose config can pass arguments (Copilot's
6
- // mcp.json, Codex's config.toml) names its own window instead of inheriting
7
- // whatever directory it happens to be launched from.
8
- function explicitTag() {
9
- const flag = process.argv.find((arg) => arg.startsWith("--tag="));
10
- if (flag)
11
- return flag.slice("--tag=".length);
12
- return process.env.NOTIFY_MCP_TAG ?? "";
13
- }
14
- const TAG = sessionIdentity({
15
- explicitTag: explicitTag(),
16
- projectDir: process.env.CLAUDE_PROJECT_DIR || process.cwd(),
17
- sessionId: process.env.CLAUDE_CODE_SESSION_ID,
18
- });
19
- // Assigned by startNotifyServer() on the next line and never replaced. It is
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
- let mcp;
23
- const host = {
24
- clientId: TAG,
25
- tag: TAG,
26
- emit: async (entry) => {
27
- // Claude Code surfaces this as a synthetic user turn. `wait_for_inbox`
28
- // stays the universal fallback for a host that does not carry it.
29
- const content = entry.tag ? `[@${entry.tag}] ${entry.text}` : entry.text;
30
- await mcp.server.notification({
31
- method: "notifications/claude/channel",
32
- params: { content, meta: { ts: entry.ts, tag: entry.tag ?? null, source: "notify-mcp" } },
33
- });
34
- },
35
- };
36
- mcp = startNotifyServer(host);
37
- startNotifyDoor(() => { });
38
- const transport = new StdioServerTransport();
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);
42
- process.stdin.on("end", () => process.exit(0));
43
- process.stdin.on("close", () => process.exit(0));