omni-notify-mcp 1.3.329 → 1.3.331

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 CHANGED
@@ -2523,7 +2523,7 @@ function latestBeat() {
2523
2523
  const [beat, old] = [DAEMON_BEAT_PATH, OLD_DAEMON_BEAT_PATH].map((file) => (existsSync(file) ? JSON.parse(readFileSync(file, "utf8")) : undefined));
2524
2524
  return old !== undefined && (beat === undefined || old.at > beat.at) ? old : beat;
2525
2525
  }
2526
- /** An always-on process is alive and beating — of the given build, when one is named. */
2526
+ /** A daemon is alive and beating — of the given build, when one is named. */
2527
2527
  function daemonBeats(version) {
2528
2528
  const beat = latestBeat();
2529
2529
  if (beat === undefined)
@@ -2561,7 +2561,7 @@ export function yieldGateway() {
2561
2561
  * Once the extension installs a newer build, this process is superseded and the gateway passes to the installed build:
2562
2562
  * a superseded process never takes it while a daemon beats, and one that holds it steps aside once no
2563
2563
  * answer is in flight — the daemon at once, since it starts the installed build in its place, and a
2564
- * bridge once the installed build's always-on process beats to take it over.
2564
+ * bridge once the installed build's daemon beats to take it over.
2565
2565
  */
2566
2566
  function tryOwnGateway(polling, host) {
2567
2567
  if (ownershipAttempting)
@@ -576,6 +576,7 @@ class WebHost {
576
576
  // NULL-OK: field label is OPTIONAL and therefore it is ok to check for NULL
577
577
  this.label = options.label ?? "no folder open";
578
578
  this.service = options.service;
579
+ this.folders = options.folders;
579
580
  return this.listen();
580
581
  }
581
582
  refused(cause) {
@@ -668,7 +669,9 @@ class WebHost {
668
669
  fs.mkdirSync(path.dirname(file), { recursive: true });
669
670
  const temp = `${file}.tmp`;
670
671
  const acts = this.acts === undefined ? {} : { actToken: PROCESS.actToken };
671
- fs.writeFileSync(temp, JSON.stringify({ ...record, token: PROCESS.token, ...acts }), { mode: 0o600 });
672
+ // NULL-OK: field folders is OPTIONAL and therefore it is ok to check for NULL
673
+ const folders = this.folders === undefined ? {} : { folders: this.folders };
674
+ fs.writeFileSync(temp, JSON.stringify({ ...record, token: PROCESS.token, ...acts, ...folders }), { mode: 0o600 });
672
675
  fs.renameSync(temp, file);
673
676
  }
674
677
  publish() {
@@ -1286,6 +1289,35 @@ function writeFrameWithOpcode(socket, opcode, payload) {
1286
1289
  }
1287
1290
  socket.write(Buffer.concat([header, payload]));
1288
1291
  }
1292
+ /** #3983 — the live windows of `extension` on this machine whose act door is open, newest first: each record's pid, port, act key, label and the folders it names. A record that vanished as its window closed is not listed; one that is not JSON THROWS. */
1293
+ function actWindows(extension) {
1294
+ const directory = recordDirectory(extension);
1295
+ if (!fs.existsSync(directory)) {
1296
+ return [];
1297
+ }
1298
+ const windows = [];
1299
+ for (const name of fs.readdirSync(directory)) {
1300
+ const match = /^(\d+)\.json$/.exec(name);
1301
+ if (match === null || !alive(Number(match[1]))) {
1302
+ continue;
1303
+ }
1304
+ let text;
1305
+ try {
1306
+ text = fs.readFileSync(path.join(directory, name), "utf8");
1307
+ }
1308
+ catch (err) {
1309
+ if (err.code !== "ENOENT")
1310
+ throw err;
1311
+ // OWNER: ITER/LOOP — a record removed as its window closed between the listing and the read is a window that is gone; it is not listed and the next record is read.
1312
+ continue;
1313
+ }
1314
+ const record = JSON.parse(text);
1315
+ if (wholeRecord(record) && typeof record.actToken === "string") {
1316
+ windows.push({ pid: record.pid, port: record.port, actToken: record.actToken, label: record.label, folders: record.folders, at: record.at });
1317
+ }
1318
+ }
1319
+ return windows.sort((a, b) => String(b.at).localeCompare(String(a.at)));
1320
+ }
1289
1321
  function listWebUis() {
1290
1322
  return [...PROCESS.records.values()].sort((a, b) => a.extension.localeCompare(b.extension));
1291
1323
  }
@@ -1294,4 +1326,4 @@ function startWebHost(options) {
1294
1326
  void INSTANCE.start(options);
1295
1327
  return { dispose: () => INSTANCE.stop() };
1296
1328
  }
1297
- module.exports = { WebHost, ServiceHost, MirroredWebview, ServedWebview, startWebHost, listWebUis, saveTheme, readTheme, webDocument, repoint, fileOfResourcePath, sha256 };
1329
+ module.exports = { WebHost, ServiceHost, MirroredWebview, ServedWebview, startWebHost, actWindows, listWebUis, saveTheme, readTheme, webDocument, repoint, fileOfResourcePath, sha256 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-notify-mcp",
3
- "version": "1.3.329",
3
+ "version": "1.3.331",
4
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
5
  "main": "dist/index.js",
6
6
  "type": "module",