omni-notify-mcp 1.3.505 → 1.3.507
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/chunk.js +5 -0
- package/dist/gateway/servedDev.js +13 -10
- package/dist/notify.js +21 -15
- package/package.json +1 -1
package/dist/chunk.js
CHANGED
|
@@ -22,6 +22,11 @@ const BLOCK_START = /^\s*(#{1,6}\s|>|[-*+]\s|\||```|\*\*\S)/;
|
|
|
22
22
|
export function withLead(lead, text) {
|
|
23
23
|
return `${lead}${BLOCK_START.test(text) ? "\n" : " "}${text}`;
|
|
24
24
|
}
|
|
25
|
+
/** #5085 — the text one channel reads: `message` whole, or with `lead.from` swapped for that channel's own wording when the caller named one. */
|
|
26
|
+
export function forChannel(message, channel, lead) {
|
|
27
|
+
const said = lead?.per[channel];
|
|
28
|
+
return lead === undefined || said === undefined ? message : message.split(lead.from).join(said);
|
|
29
|
+
}
|
|
25
30
|
export function splitForNotify(message, limit = NOTIFY_CHUNK_LIMIT) {
|
|
26
31
|
if (message.length <= limit)
|
|
27
32
|
return [message];
|
|
@@ -12,15 +12,18 @@
|
|
|
12
12
|
* button's face, its entries and the notice's wording all come from the shared module, so the served page and a window's
|
|
13
13
|
* panel can never drift.
|
|
14
14
|
*/
|
|
15
|
-
import { createRequire } from "module";
|
|
16
15
|
import * as fs from "node:fs";
|
|
17
16
|
import * as os from "node:os";
|
|
18
17
|
import * as path from "node:path";
|
|
19
18
|
import * as http from "node:http";
|
|
20
19
|
import { GatewayError } from "../gatewaySettings.js";
|
|
21
20
|
import { actWindows } from "../shared/webhost/bullseyeWebHost.js";
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
// #5087 — the shared DEV module is BUNDLED, never required at runtime. This file also runs INSIDE the packaged
|
|
22
|
+
// `dist/daemon.mjs`, where `createRequire(import.meta.url)("../shared/dev/devControls.js")` resolves one directory above
|
|
23
|
+
// `dist/` (no such file ships there) and the require's own throw aborts this module's init, taking the gateway bind with
|
|
24
|
+
// it. A static import makes esbuild inline the module — exactly as panelPage.ts already does for the shared renderers, and
|
|
25
|
+
// as restDoor.ts does for the shared web host — so the shipped daemon resolves nothing off the disk at runtime.
|
|
26
|
+
import { DevControls, DevStepError, GROUPS, buildStamp, devCheckout } from "../shared/dev/devControls.js";
|
|
24
27
|
/** BN's extension id, used only when no manifest on disk names one — every real lookup reads the manifest. */
|
|
25
28
|
const FALLBACK_ID = "menihillel.bullseye-notify";
|
|
26
29
|
const EXTENSION_NAME = "BullseyeNotify";
|
|
@@ -90,15 +93,15 @@ function locate() {
|
|
|
90
93
|
return {
|
|
91
94
|
id,
|
|
92
95
|
runningVersion: String(runningManifest.version ?? ""),
|
|
93
|
-
runningStamp: () =>
|
|
96
|
+
runningStamp: () => buildStamp(runningManifest),
|
|
94
97
|
installedVersion: () => (installedManifest === undefined ? null : String(installedManifest.version ?? "")),
|
|
95
|
-
installedStamp: () => (installedManifest === undefined ? null :
|
|
98
|
+
installedStamp: () => (installedManifest === undefined ? null : buildStamp(installedManifest)),
|
|
96
99
|
checkout: () => {
|
|
97
100
|
if (!walked) {
|
|
98
101
|
walked = true;
|
|
99
102
|
// OWNER: a page draw is this search's trigger root — a search that cannot run costs the button its draw, never the page.
|
|
100
103
|
try {
|
|
101
|
-
cached =
|
|
104
|
+
cached = devCheckout(id, [root, path.join(os.homedir(), "Desktop", "BullseyeVSC")], io);
|
|
102
105
|
}
|
|
103
106
|
catch {
|
|
104
107
|
cached = undefined;
|
|
@@ -118,7 +121,7 @@ function sources() {
|
|
|
118
121
|
}
|
|
119
122
|
/** The served page's own DEV view, groups and build notice, driven off one set of sources — the seam a test fixtures. */
|
|
120
123
|
export function devSectionFor(found) {
|
|
121
|
-
const control = new
|
|
124
|
+
const control = new DevControls({
|
|
122
125
|
label: `${EXTENSION_NAME} DEV`,
|
|
123
126
|
runningVersion: found.runningVersion,
|
|
124
127
|
runningStamp: found.runningStamp,
|
|
@@ -142,16 +145,16 @@ export function devSectionFor(found) {
|
|
|
142
145
|
notice = control.notice();
|
|
143
146
|
}
|
|
144
147
|
catch (cause) {
|
|
145
|
-
if (!(cause instanceof
|
|
148
|
+
if (!(cause instanceof DevStepError))
|
|
146
149
|
throw cause;
|
|
147
150
|
notice = null;
|
|
148
151
|
}
|
|
149
|
-
return dev === undefined ? { devGroups:
|
|
152
|
+
return dev === undefined ? { devGroups: GROUPS, build: { notice } } : { dev, devGroups: GROUPS, build: { notice } };
|
|
150
153
|
}
|
|
151
154
|
/** The one source of the served page's DEV view, its groups and its build notice — the shared module's own answers, driven headlessly off the disk. */
|
|
152
155
|
export function devSection() {
|
|
153
156
|
const found = sources();
|
|
154
|
-
return found === undefined ? { devGroups:
|
|
157
|
+
return found === undefined ? { devGroups: GROUPS, build: { notice: null } } : devSectionFor(found);
|
|
155
158
|
}
|
|
156
159
|
/** One POST to a running BN window's act door, answered as `{ status, body }`; a window that will not answer THROWS in words. */
|
|
157
160
|
function askWindow(port, actToken, body) {
|
package/dist/notify.js
CHANGED
|
@@ -21,7 +21,7 @@ import { sendWithRouting, formatIdleReading, describePriorityRouting } from "./m
|
|
|
21
21
|
import { deliveryVerdict } from "./messaging/deliveryVerdict.js";
|
|
22
22
|
import { telegramSendErrorHint } from "./messaging/telegramError.js";
|
|
23
23
|
import { postTelegramMessage, telegramParseMode } from "./messaging/telegramFormat.js";
|
|
24
|
-
import { splitForNotify, withLead } from "./chunk.js";
|
|
24
|
+
import { forChannel, splitForNotify, withLead } from "./chunk.js";
|
|
25
25
|
import { idleNow, playVoice, showBanner } from "./desk.js";
|
|
26
26
|
import { AgentGateway, AGENT_PREFIX, SLACK_DM, streamedChat } from "./agentGateway.js";
|
|
27
27
|
import { slackVerifyAndRepair } from "./messaging/slackSetup.js";
|
|
@@ -389,7 +389,7 @@ export const textOwner = (message) => smsEveryNumber(loadConfig(), message);
|
|
|
389
389
|
export function masterMuted() {
|
|
390
390
|
return loadConfig().muteAll === true;
|
|
391
391
|
}
|
|
392
|
-
async function sendNotification(message, priority, client, buttons, topic) {
|
|
392
|
+
async function sendNotification(message, priority, client, buttons, topic, lead) {
|
|
393
393
|
const cfg = loadConfig();
|
|
394
394
|
if (cfg.muteAll === true) {
|
|
395
395
|
log("·", "notify", `BLOCKED — all notifications disabled (master mute), priority=${priority}`, client);
|
|
@@ -437,11 +437,12 @@ async function sendNotification(message, priority, client, buttons, topic) {
|
|
|
437
437
|
enableTeams: able.teams,
|
|
438
438
|
senders: measuredSends({
|
|
439
439
|
desktop: async () => {
|
|
440
|
+
const text = forChannel(message, "desktop", lead);
|
|
440
441
|
if (cfg.desktop?.tts) {
|
|
441
442
|
const voice = cfg.desktop?.ttsVoice ?? "en-US-AndrewMultilingualNeural";
|
|
442
|
-
speakText(
|
|
443
|
+
speakText(text, voice).catch((err) => log("→", "tts", `ERROR: ${err instanceof Error ? err.message : String(err)}`, client));
|
|
443
444
|
}
|
|
444
|
-
await showBanner(CONFIG_DIR, "Claude Notify",
|
|
445
|
+
await showBanner(CONFIG_DIR, "Claude Notify", text);
|
|
445
446
|
},
|
|
446
447
|
telegram: async () => {
|
|
447
448
|
const errors = [];
|
|
@@ -449,7 +450,7 @@ async function sendNotification(message, priority, client, buttons, topic) {
|
|
|
449
450
|
let unformatted = 0;
|
|
450
451
|
const mode = telegramParseMode(cfg);
|
|
451
452
|
for (const chatId of cfg.telegram.chatIds) {
|
|
452
|
-
const body = { chat_id: chatId, text: message };
|
|
453
|
+
const body = { chat_id: chatId, text: forChannel(message, "telegram", lead) };
|
|
453
454
|
// NULL-OK: field buttons is OPTIONAL and therefore it is ok to check for NULL
|
|
454
455
|
if (buttons !== undefined)
|
|
455
456
|
body.reply_markup = buttons;
|
|
@@ -489,8 +490,8 @@ async function sendNotification(message, priority, client, buttons, topic) {
|
|
|
489
490
|
throw new Error(errors.join("; "));
|
|
490
491
|
return unformatted ? `went out UNFORMATTED to ${unformatted} chat(s): Telegram refused the formatting (can't parse entities), so the message was re-sent once as plain text` : undefined;
|
|
491
492
|
},
|
|
492
|
-
sms: () => smsEveryNumber(cfg, message),
|
|
493
|
-
ntfy: async (_text, prio) => { await ntfyPublish(cfg, message, prio); },
|
|
493
|
+
sms: () => smsEveryNumber(cfg, forChannel(message, "sms", lead)),
|
|
494
|
+
ntfy: async (_text, prio) => { await ntfyPublish(cfg, forChannel(message, "ntfy", lead), prio); },
|
|
494
495
|
discord: async (_text, prio) => {
|
|
495
496
|
const colorMap = { low: 0x6b7280, normal: 0x7c6dfa, high: 0xef4444 };
|
|
496
497
|
const r = await fetch(cfg.discord.webhookUrl, {
|
|
@@ -500,7 +501,7 @@ async function sendNotification(message, priority, client, buttons, topic) {
|
|
|
500
501
|
username: cfg.discord.username ?? "Claude Notify",
|
|
501
502
|
embeds: [{
|
|
502
503
|
title: "Claude Notify",
|
|
503
|
-
description: message,
|
|
504
|
+
description: forChannel(message, "discord", lead),
|
|
504
505
|
color: colorMap[prio] ?? colorMap.normal,
|
|
505
506
|
timestamp: new Date().toISOString(),
|
|
506
507
|
}],
|
|
@@ -513,7 +514,7 @@ async function sendNotification(message, priority, client, buttons, topic) {
|
|
|
513
514
|
const emojiMap = { low: "ℹ️", normal: "🔔", high: "🚨" };
|
|
514
515
|
const emoji = emojiMap[prio] ?? emojiMap.normal;
|
|
515
516
|
const blocks = [
|
|
516
|
-
{ type: "section", text: { type: "mrkdwn", text: `${emoji} *Claude Notify*\n${message}` } },
|
|
517
|
+
{ type: "section", text: { type: "mrkdwn", text: `${emoji} *Claude Notify*\n${forChannel(message, "slack", lead)}` } },
|
|
517
518
|
{ type: "context", elements: [{ type: "mrkdwn", text: `Priority: ${prio}` }] },
|
|
518
519
|
];
|
|
519
520
|
// Bot token + selected channels → one chat.postMessage per channel
|
|
@@ -560,7 +561,7 @@ async function sendNotification(message, priority, client, buttons, topic) {
|
|
|
560
561
|
version: "1.2",
|
|
561
562
|
body: [
|
|
562
563
|
{ type: "TextBlock", size: "Medium", weight: "Bolder", text: "Claude Notify", color: colorMap[prio] ?? "Default" },
|
|
563
|
-
{ type: "TextBlock", text: message, wrap: true },
|
|
564
|
+
{ type: "TextBlock", text: forChannel(message, "teams", lead), wrap: true },
|
|
564
565
|
{ type: "TextBlock", text: `Priority: ${prio}`, isSubtle: true, size: "Small" },
|
|
565
566
|
],
|
|
566
567
|
},
|
|
@@ -583,7 +584,7 @@ async function sendNotification(message, priority, client, buttons, topic) {
|
|
|
583
584
|
};
|
|
584
585
|
}
|
|
585
586
|
for (const delivered of result.delivered) {
|
|
586
|
-
log("→", delivered, message, client);
|
|
587
|
+
log("→", delivered, forChannel(message, delivered, lead), client);
|
|
587
588
|
}
|
|
588
589
|
for (const err of result.errors) {
|
|
589
590
|
log("→", "notify", `ERROR: ${err}`, client);
|
|
@@ -3204,7 +3205,7 @@ function drainInboxFor(tag) {
|
|
|
3204
3205
|
// One message, delivered as however many parts the 500-character limit needs.
|
|
3205
3206
|
// Every part is sent and every part's outcome is returned — a part that reached
|
|
3206
3207
|
// nobody must not be swallowed by the part before it.
|
|
3207
|
-
async function sendChunked(message, priority, clientId) {
|
|
3208
|
+
async function sendChunked(message, priority, clientId, lead) {
|
|
3208
3209
|
const outcomes = [];
|
|
3209
3210
|
const parts = splitForNotify(message);
|
|
3210
3211
|
const buttons = decisionButtons(message);
|
|
@@ -3213,7 +3214,7 @@ async function sendChunked(message, priority, clientId) {
|
|
|
3213
3214
|
// #5063 — the buttons ride on EVERY part, not only the last: splitForNotify puts the decision link on every part too, so a
|
|
3214
3215
|
// tap on any part's buttons resolves the decision (buttonPick reads the link off the message the button sits on). Attaching
|
|
3215
3216
|
// them to the last part alone left every earlier part a dead end for both a tap and a reply.
|
|
3216
|
-
outcomes.push(await sendNotification(withLead(`[${clientId}]`, chunk), priority, clientId, buttons, topic === undefined ? undefined : { ...topic, ships: topic.ships && i === parts.length - 1 }));
|
|
3217
|
+
outcomes.push(await sendNotification(withLead(`[${clientId}]`, chunk), priority, clientId, buttons, topic === undefined ? undefined : { ...topic, ships: topic.ships && i === parts.length - 1 }, lead));
|
|
3217
3218
|
}
|
|
3218
3219
|
return outcomes;
|
|
3219
3220
|
}
|
|
@@ -3425,11 +3426,16 @@ export function createMcpServer(clientId, sessionTag) {
|
|
|
3425
3426
|
.describe(`Channels per priority, each only when enabled: ${describePriorityRouting()} — high also bypasses activity gating (it never overrides DND)`),
|
|
3426
3427
|
answers: z.string().max(2000).optional()
|
|
3427
3428
|
.describe("The user's own words, verbatim, of the request this notification answers. Required unless the message is a board decision carrying its decision link."),
|
|
3428
|
-
|
|
3429
|
+
per_channel_line: z.object({
|
|
3430
|
+
from: z.string().min(1),
|
|
3431
|
+
per: z.record(z.string(), z.string()),
|
|
3432
|
+
}).optional()
|
|
3433
|
+
.describe("One line of `message` that must read differently on a channel where it is not true, with the wording that channel reads instead: `from` is the line as sent on the channels not named; `per` maps a channel (telegram, slack, desktop, …) to the line it reads. Every channel the caller does not name, and every message that sends none, is delivered whole. A board decision uses it so the tap-or-reply invitation reaches only the channel whose reply rules it."),
|
|
3434
|
+
}, async ({ message, priority, answers, per_channel_line }) => {
|
|
3429
3435
|
const unasked = refusedUnasked(message, answers, sessionTag, clientId);
|
|
3430
3436
|
if (unasked !== undefined)
|
|
3431
3437
|
return unasked;
|
|
3432
|
-
const outcomes = await sendChunked(message, priority, clientId);
|
|
3438
|
+
const outcomes = await sendChunked(message, priority, clientId, per_channel_line);
|
|
3433
3439
|
const notDelivered = outcomes.some((o) => o.outcome !== "delivered");
|
|
3434
3440
|
const held = notDelivered && outcomes.every((o) => o.outcome === "blocked");
|
|
3435
3441
|
const delivered = [...new Set(outcomes.filter((o) => o.outcome === "delivered").flatMap((o) => o.delivered))];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.507",
|
|
4
4
|
"homepage": "https://www.npmjs.com/package/omni-notify-mcp",
|
|
5
5
|
"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.",
|
|
6
6
|
"main": "dist/daemon.js",
|