omni-notify-mcp 1.3.339 → 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/dist/notify.js +6 -8
- package/package.json +1 -1
- package/dist/index.js +0 -43
package/dist/notify.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The notify server — ONE process, spoken to over
|
|
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:
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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
|
-
*
|
|
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:
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.340",
|
|
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",
|
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));
|