omni-notify-mcp 1.3.382 โ 1.3.383
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/gateway/panel.js +23 -1
- package/dist/gateway/panelPage.js +25 -1
- package/dist/gateway/terminalPage.js +2 -0
- package/dist/notify.js +2 -2
- package/package.json +1 -1
package/dist/gateway/panel.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "fs";
|
|
8
8
|
import { dirname, join } from "path";
|
|
9
|
-
import { CONFIG_DIR } from "../notify.js";
|
|
9
|
+
import { CONFIG_DIR, deliveryReport, isDndActive } from "../notify.js";
|
|
10
10
|
import { GatewayError, conversationEnabled, setConversationEnabled } from "./conversations.js";
|
|
11
11
|
const CHANNEL_KEYS = ["desktop", "telegram", "slack", "sms", "ntfy", "discord", "teams"];
|
|
12
12
|
const CONFIG_PATH = join(CONFIG_DIR, "config.json");
|
|
@@ -144,6 +144,26 @@ function channelState(cfg, unreadable) {
|
|
|
144
144
|
return { severity: "warning", label: "Muted", icon: "๐", text: `Master mute is ON โ nothing is delivered. Enabled: ${on.join(", ")}.` };
|
|
145
145
|
return { severity: "good", label: "Enabled", icon: "๐", text: `Enabled: ${on.join(", ")}. Whether each can carry is not measured here.` };
|
|
146
146
|
}
|
|
147
|
+
export function notificationHold(cfg) {
|
|
148
|
+
const release = [];
|
|
149
|
+
const causes = [];
|
|
150
|
+
if (cfg.muteAll === true) {
|
|
151
|
+
release.push(['muteAll']);
|
|
152
|
+
causes.push('Master mute');
|
|
153
|
+
}
|
|
154
|
+
if (readAt(cfg, ['dnd', 'enabled']) === true) {
|
|
155
|
+
release.push(['dnd', 'enabled']);
|
|
156
|
+
causes.push('Do not disturb');
|
|
157
|
+
}
|
|
158
|
+
const dnd = cfg.dnd;
|
|
159
|
+
if (isDndActive({ dnd: { ...dnd, enabled: false } })) {
|
|
160
|
+
release.push(['dnd', 'schedule', 'enabled']);
|
|
161
|
+
causes.push('Quiet hours');
|
|
162
|
+
}
|
|
163
|
+
return { active: release.length > 0, release, text: causes.length > 0
|
|
164
|
+
? causes.join(' + ') + ' holds every notification, every priority including high / CRITICAL. No channel is attempted.'
|
|
165
|
+
: 'No all-notification hold is active.' };
|
|
166
|
+
}
|
|
147
167
|
/** Everything the Settings page draws, in one reading: the channel state, every group with its rows' current values and next-step line, and the conversation switch. */
|
|
148
168
|
export function panelState() {
|
|
149
169
|
let cfg;
|
|
@@ -159,6 +179,8 @@ export function panelState() {
|
|
|
159
179
|
}
|
|
160
180
|
return {
|
|
161
181
|
state: channelState(cfg, unreadable),
|
|
182
|
+
hold: unreadable === undefined ? notificationHold(cfg) : undefined,
|
|
183
|
+
delivery: unreadable === undefined ? deliveryReport() : undefined,
|
|
162
184
|
configPath: CONFIG_PATH,
|
|
163
185
|
conversation: conversationSwitchRead(),
|
|
164
186
|
groups: unreadable !== undefined ? [] : SETTINGS.map((g) => ({
|
|
@@ -93,13 +93,37 @@ async function call(method, path, body) {
|
|
|
93
93
|
return j;
|
|
94
94
|
}
|
|
95
95
|
`;
|
|
96
|
+
/** Both service screens draw the same hold and measured delivery contract. */
|
|
97
|
+
export function notificationStatusScript(request) {
|
|
98
|
+
return `(function(){
|
|
99
|
+
var box=document.createElement('section');box.id='notification-status';box.setAttribute('aria-label','Notification delivery');box.style.cssText='flex:none;margin:8px 12px;padding:8px;border:1px solid var(--line);border-radius:6px;overflow-wrap:anywhere';
|
|
100
|
+
(document.querySelector('header')||document.querySelector('nav')).after(box);
|
|
101
|
+
async function refresh(){
|
|
102
|
+
if(!token){box.hidden=true;return;}box.hidden=false;
|
|
103
|
+
try{
|
|
104
|
+
var model=await ${request}('GET','/v1/panel');box.replaceChildren();
|
|
105
|
+
if(!model.hold||!model.delivery){box.textContent='โ ๏ธ Notification status is unavailable โ the service did not answer the hold and delivery reading.';return;}
|
|
106
|
+
if(model.hold.active){
|
|
107
|
+
var held=document.createElement('p');held.textContent='๐ '+model.hold.text;held.setAttribute('role','status');held.style.fontWeight='700';
|
|
108
|
+
var release=document.createElement('button');release.textContent='๐ Release notifications';release.onclick=async function(){release.disabled=true;try{for(var path of model.hold.release)await ${request}('POST','/v1/settings',{path:path,value:false});await refresh();}catch(error){box.textContent='โ ๏ธ Hold was not released โ '+error.message;}};box.append(held,release);
|
|
109
|
+
}
|
|
110
|
+
var state=document.createElement('p');state.textContent='๐ข Process: '+model.delivery.process+' ยท Delivery: '+(model.delivery.healthy?'all configured channels measured able to carry':'needs a channel reading or repair');box.append(state);
|
|
111
|
+
var details=document.createElement('details'),summary=document.createElement('summary');summary.textContent='๐ Channel readings';details.append(summary);
|
|
112
|
+
var reason=document.createElement('p');reason.textContent=model.delivery.reason;details.append(reason);
|
|
113
|
+
var table=document.createElement('table');table.style.cssText='width:100%;table-layout:fixed;border-collapse:collapse';var head=document.createElement('tr');['Channel','Measured state'].forEach(function(text){var cell=document.createElement('th');cell.textContent=text;head.append(cell);});table.append(head);
|
|
114
|
+
model.delivery.carriage.forEach(function(reading){var row=document.createElement('tr');[reading.channel,reading.state==='unmeasured'?'UNMEASURED โ no carriage reading':reading.state+(reading.detail?' โ '+reading.detail:'')].forEach(function(text){var cell=document.createElement('td');cell.textContent=text;cell.style.cssText='padding:4px;vertical-align:top;overflow-wrap:anywhere';row.append(cell);});table.append(row);});details.append(table);box.append(details);
|
|
115
|
+
}catch(error){box.replaceChildren();box.textContent='โ ๏ธ Notification status could not be read โ '+error.message;}
|
|
116
|
+
}
|
|
117
|
+
refresh();setInterval(refresh,5000);
|
|
118
|
+
})();`;
|
|
119
|
+
}
|
|
96
120
|
const NAV_KEEPS_WORKSPACE = `
|
|
97
121
|
document.querySelectorAll("nav a").forEach(function (a) { a.search = location.search; });
|
|
98
122
|
`;
|
|
99
123
|
function shell(title, here, body, script) {
|
|
100
124
|
const nav = [["/", "๐ฌ Conversations"], ["/settings", "โ๏ธ Settings"], ["/public-access", "๐ Public access"]]
|
|
101
125
|
.map(([href, text]) => `<a href="${href}"${href === here ? ' class="here"' : ""}>${text}</a>`).join("");
|
|
102
|
-
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${title}</title>${ICON_HEAD}<style>${PAGE_STYLE}${PANEL_STYLE}</style></head><body><nav>${nav}</nav><div class="wrap"><div id="signin"></div>${body}</div><script>${SIGN_IN}${NAV_KEEPS_WORKSPACE}${script}</script><script data-page="${here.slice(1)}">${PICKER_PAGE_SOURCE}</script></body></html>`;
|
|
126
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${title}</title>${ICON_HEAD}<style>${PAGE_STYLE}${PANEL_STYLE}</style></head><body><nav>${nav}</nav><div class="wrap"><div id="signin"></div>${body}</div><script>${SIGN_IN}${NAV_KEEPS_WORKSPACE}${script}${notificationStatusScript("call")}</script><script data-page="${here.slice(1)}">${PICKER_PAGE_SOURCE}</script></body></html>`;
|
|
103
127
|
}
|
|
104
128
|
const SETTINGS_SCRIPT = `
|
|
105
129
|
var root = document.getElementById("root"), said = document.getElementById("said");
|
|
@@ -4,6 +4,7 @@ import { fileURLToPath } from "url";
|
|
|
4
4
|
import { CONVERSATIONS_VIEWS, PAGE_STYLE, SIGN_IN_SCRIPT, servingLine, storedStamp } from "./chatPage.js";
|
|
5
5
|
import { PASSKEY_SCRIPT } from "./passkeyDoor.js";
|
|
6
6
|
import { PROVIDER_CHOICES } from "./providers.js";
|
|
7
|
+
import { notificationStatusScript } from "./panelPage.js";
|
|
7
8
|
import { ICON_HEAD } from "./iconDoor.js";
|
|
8
9
|
const require = createRequire(import.meta.url);
|
|
9
10
|
function asset(name, installed) {
|
|
@@ -291,5 +292,6 @@ function home(){
|
|
|
291
292
|
}
|
|
292
293
|
window.addEventListener("popstate",function(event){render(event.state&&event.state.bn?event.state:rootState());});
|
|
293
294
|
startSignIn();
|
|
295
|
+
${notificationStatusScript("api")}
|
|
294
296
|
</script></body></html>`;
|
|
295
297
|
}
|
package/dist/notify.js
CHANGED
|
@@ -141,7 +141,7 @@ function defaultConfig() {
|
|
|
141
141
|
* Returns true if notifications should be suppressed right now based on DND config.
|
|
142
142
|
* Every priority is held while DND is active โ including high.
|
|
143
143
|
*/
|
|
144
|
-
function isDndActive(cfg) {
|
|
144
|
+
export function isDndActive(cfg) {
|
|
145
145
|
const dnd = cfg.dnd ?? {};
|
|
146
146
|
if (dnd.enabled === true)
|
|
147
147
|
return true; // manual toggle wins
|
|
@@ -1522,7 +1522,7 @@ function refreshReach(cfg = loadConfig()) {
|
|
|
1522
1522
|
// present โ which is what `channelsThatCanCarry` held in this exact spot while
|
|
1523
1523
|
// nothing ever called it: the decision belonged to a caller that no longer
|
|
1524
1524
|
// exists, so the surface Meni reads answered "healthy" from liveness alone.
|
|
1525
|
-
function deliveryReport() {
|
|
1525
|
+
export function deliveryReport() {
|
|
1526
1526
|
const cfg = loadConfig();
|
|
1527
1527
|
secretsReadFailure = null;
|
|
1528
1528
|
const able = deliverableChannels(cfg, loadSecretsForReport());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.383",
|
|
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",
|