omni-notify-mcp 1.3.14 → 1.3.21

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "omni-notify-mcp",
3
- "version": "1.3.14",
4
- "description": "An MCP server that lets AI agents (Claude, Cursor, etc.) reach you on any channel — desktop, Telegram, SMS, email — with two-way ask/reply, real-time inbox push, Do Not Disturb, idle gating, multi-session routing, and a one-page web UI for setup. Zero config code; configure once, agents call notify/ask.",
3
+ "version": "1.3.21",
4
+ "description": "Reach your AI agents from anywhere — and let them reach you. Every notification channel is set up in one config UI with one-click server launch: desktop, Telegram, Slack, SMS, email, ntfy. Agents then 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",
7
7
  "bin": {
@@ -12,33 +12,10 @@
12
12
  "dist/",
13
13
  "ui/public/",
14
14
  "assets/",
15
- "config.example.json",
16
- "LICENSE",
17
- "README.md"
18
- ],
19
- "keywords": [
20
- "mcp",
21
- "model-context-protocol",
22
- "notifications",
23
- "ai-agent",
24
- "claude",
25
- "cursor",
26
- "telegram",
27
- "sms",
28
- "email",
29
- "desktop-notifications",
30
- "do-not-disturb",
31
- "idle-detection",
32
- "human-in-the-loop",
33
- "ask-tool",
34
- "two-way",
35
- "sse"
15
+ "scripts/idle-check.ps1",
16
+ "config.example.json"
36
17
  ],
37
18
  "license": "MIT",
38
- "repository": {
39
- "type": "git",
40
- "url": "https://github.com/menih/notify-mcp"
41
- },
42
19
  "engines": {
43
20
  "node": ">=18"
44
21
  },
@@ -0,0 +1,47 @@
1
+ # Returns idle seconds (keyboard/mouse last input) on stdout.
2
+ # Used as a fallback by the get_idle_seconds tool on Windows.
3
+ #
4
+ # Prints nothing and exits non-zero when the reading is not available, so the
5
+ # caller sees "could not measure" rather than a number it cannot trust: a raw
6
+ # subtraction of Environment.TickCount from the last-input timestamp wraps at
7
+ # the 32-bit boundary and would otherwise report the system UPTIME as if it
8
+ # were the user's idle time.
9
+
10
+ $ErrorActionPreference = 'Stop'
11
+
12
+ if (-not ('IdleTime' -as [type])) {
13
+ Add-Type @"
14
+ using System;
15
+ using System.Runtime.InteropServices;
16
+ public class IdleTime {
17
+ [StructLayout(LayoutKind.Sequential)]
18
+ public struct LASTINPUTINFO { public uint cbSize; public uint dwTime; }
19
+ [DllImport("user32.dll")]
20
+ public static extern bool GetLastInputInfo(ref LASTINPUTINFO plii);
21
+ public static long IdleSeconds() {
22
+ LASTINPUTINFO lii = new LASTINPUTINFO();
23
+ lii.cbSize = (uint)Marshal.SizeOf(lii);
24
+ if (!GetLastInputInfo(ref lii)) return -1;
25
+ long idle = (long)(uint)Environment.TickCount - (long)lii.dwTime;
26
+ if (idle < 0) return -1;
27
+ return idle / 1000;
28
+ }
29
+ }
30
+ "@
31
+ }
32
+
33
+ try {
34
+ $seconds = [IdleTime]::IdleSeconds()
35
+ } catch {
36
+ Write-Error "idle-check: GetLastInputInfo failed — $($_.Exception.Message)"
37
+ exit 1
38
+ }
39
+
40
+ if ($seconds -lt 0) {
41
+ Write-Error "idle-check: the OS could not report the last input time"
42
+ exit 1
43
+ }
44
+
45
+ Write-Output $seconds
46
+ exit 0
47
+