omni-notify-mcp 1.3.493 → 1.3.494

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/daemon.js CHANGED
@@ -12,7 +12,7 @@ import { spawn } from "child_process";
12
12
  import { createWriteStream, existsSync, readFileSync, mkdirSync, renameSync } from "fs";
13
13
  import { join } from "path";
14
14
  import { fileURLToPath } from "url";
15
- import { DAEMON_BEAT_PATH, CONFIG_DIR, DAEMON_TAG, PACKAGE_VERSION, startNotifyServer, takePendingInbox, writeRecordFile, yieldGateway } from "./notify.js";
15
+ import { DAEMON_BEAT_PATH, CONFIG_DIR, DAEMON_TAG, PACKAGE_VERSION, smsReachesOwner, startNotifyServer, takePendingInbox, textOwner, writeRecordFile, yieldGateway } from "./notify.js";
16
16
  import { startNotifyDoor } from "./gateway/notifyDoor.js";
17
17
  import { announceTakeover, inThisBoot } from "./shared/webhost/originHandover.js";
18
18
  import { TunnelRunner } from "./gateway/tunnel.js";
@@ -140,7 +140,11 @@ let handedOver;
140
140
  const tunnel = new TunnelRunner();
141
141
  const daemonHost = {
142
142
  clientId: DAEMON_TAG, tag: DAEMON_TAG,
143
- bindDoor: async (settings) => (await import("./gateway/restDoor.js")).startRestDoor(settings),
143
+ bindDoor: async (settings) => {
144
+ // #4247 — the sign-in doors text Meni's code through notify, handed in here so passkeyDoor imports no notification code.
145
+ (await import("./gateway/passkeyDoor.js")).setOwnerTexter({ reaches: smsReachesOwner, text: textOwner });
146
+ return (await import("./gateway/restDoor.js")).startRestDoor(settings);
147
+ },
144
148
  findOtherOwner: async (port) => (await import("./gateway/lanProbe.js")).findOtherBn(port),
145
149
  onDoorOwned: (port) => {
146
150
  // #4231 — BN holds no agent CLI: the cluster keeps every chat CLI and its background subagents (#4814), so a BN release never waits on one.
@@ -6,7 +6,6 @@ import { hostname, uptime } from "os";
6
6
  import { join } from "path";
7
7
  import { generateAuthenticationOptions, generateRegistrationOptions, verifyAuthenticationResponse, verifyRegistrationResponse } from "@simplewebauthn/server";
8
8
  import QRCode from "qrcode";
9
- import { smsReachesOwner, textOwner } from "../notify.js";
10
9
  import { CONFIG_DIR, GatewayError, readGatewaySettings } from "../gatewaySettings.js";
11
10
  import { ICON_HEAD } from "./iconDoor.js";
12
11
  const PASSKEY_PREFIX = "/passkey/";
@@ -54,6 +53,20 @@ export function ownerRegistry() {
54
53
  return { origins: names.filter((name) => !outside.includes(name)).map((name) => `https://${name}`), rpID, outside };
55
54
  }
56
55
  const OWNER_RP_NAME = "Bullseye";
56
+ let noTexterSaid = false;
57
+ /** No sender handed in: SMS reaches nobody, said ONCE on stderr so a gateway older than setOwnerTexter shows in its log instead of only as a lost SMS sign-in. */
58
+ const NO_TEXTER = {
59
+ reaches: () => {
60
+ if (!noTexterSaid)
61
+ process.stderr.write("[agent-gateway] this process handed the sign-in door no SMS sender (setOwnerTexter), so no code can be texted and SMS sign-ins do not stand; a gateway older than passkeyDoor's setOwnerTexter must be redeployed\n");
62
+ noTexterSaid = true;
63
+ return false;
64
+ },
65
+ text: async () => { throw new Error("this process gave the sign-in door no SMS sender"); },
66
+ };
67
+ let ownerTexter = NO_TEXTER;
68
+ /** Every door in this process texts through the sender its booting process hands in here. */
69
+ export function setOwnerTexter(texter) { ownerTexter = texter; }
57
70
  // GATE: a lock file nobody can read as a lock (half written, damaged) is taken over once it is this old; a readable lock is only ever taken from a holder that is gone.
58
71
  const OWNER_LOCK_UNREADABLE_MS = 30_000;
59
72
  // GATE: a change to a file the doors share (the owner registry, a door's session store) waits this long for another process's change to finish, then answers 409 and changes nothing.
@@ -421,7 +434,7 @@ export function createSignInDoor({ storeFile, product, short, home, host: doorHo
421
434
  if (legacyRetired(store))
422
435
  return false;
423
436
  if (approval === SMS)
424
- return locked(store) && smsReachesOwner();
437
+ return locked(store) && ownerTexter.reaches();
425
438
  // NULL-OK: field authenticator is OPTIONAL and therefore it is ok to check for NULL
426
439
  if (approval.startsWith(AUTHENTICATOR))
427
440
  return store.authenticator !== undefined && `${AUTHENTICATOR}${store.authenticator.id}` === approval;
@@ -468,7 +481,7 @@ export function createSignInDoor({ storeFile, product, short, home, host: doorHo
468
481
  const host = String(req.headers["x-forwarded-host"] ?? req.headers.host ?? "").split(",")[0].trim().replace(/:\d+$/, "").toLowerCase();
469
482
  const retired = legacyRetired(store);
470
483
  const codes = !retired && locked(store);
471
- return { enrolled: locked(store), local: fromThisMachine(req), passkey: (!retired && store.passkeys.some((passkey) => passkey.rpID === host)) || (host === doorHost && ownerCredentials().length > 0), authenticator: codes && store.authenticator !== undefined, sms: codes && smsReachesOwner(), codesShut: codesShut(store) };
484
+ return { enrolled: locked(store), local: fromThisMachine(req), passkey: (!retired && store.passkeys.some((passkey) => passkey.rpID === host)) || (host === doorHost && ownerCredentials().length > 0), authenticator: codes && store.authenticator !== undefined, sms: codes && ownerTexter.reaches(), codesShut: codesShut(store) };
472
485
  }
473
486
  function ownerEnrolTicket(host, replaces) {
474
487
  if (host.toLowerCase() !== doorHost)
@@ -725,7 +738,7 @@ ${locked(store) ? "" : `<p class="mut">Until an owner passkey is registered, not
725
738
  /** Texts a fresh 6-digit code to Meni's mobile; it replaces any earlier one, and only one goes out a minute. */
726
739
  async function smsSend(from) {
727
740
  codesClosed(readStore());
728
- if (!smsReachesOwner())
741
+ if (!ownerTexter.reaches())
729
742
  throw new GatewayError(404, "no SMS channel reaches Meni's mobile");
730
743
  codesOpen(readStore());
731
744
  const now = Date.now();
@@ -738,7 +751,7 @@ ${locked(store) ? "" : `<p class="mut">Until an owner passkey is registered, not
738
751
  textedCode = sent;
739
752
  const minutes = SMS_CODE_LIFETIME_MS / 60_000;
740
753
  try {
741
- await textOwner(`${short} sign-in code: ${code}. It works once, for ${minutes} minutes. If you did not ask for it, someone is at your ${short} sign-in page.`);
754
+ await ownerTexter.text(`${short} sign-in code: ${code}. It works once, for ${minutes} minutes. If you did not ask for it, someone is at your ${short} sign-in page.`);
742
755
  }
743
756
  catch (err) {
744
757
  if (textedCode === sent)
@@ -813,7 +826,7 @@ ${locked(store) ? "" : `<p class="mut">Until an owner passkey is registered, not
813
826
  const enrollments = [...tickets.entries()].filter(([, ticket]) => ticket.exp > now).map(([key, ticket]) => ({ ref: key.slice(0, SESSION_REF_LENGTH), host: ticket.host, exp: ticket.exp }));
814
827
  const registry = ownerRegistry();
815
828
  const owner = { rpID: registry.rpID, origins: registry.origins, outside: registry.outside, legacyRetired: legacyRetired(store), credentials: readOwners().credentials.map(({ id, device, createdAt }) => ({ id, device, createdAt })) };
816
- return { locked: locked(store), sms: smsReachesOwner(), passkeys: store.passkeys.map(({ id, rpID, device, createdAt }) => ({ id, rpID, device, createdAt })), owner, authenticator, sessions, enrollments };
829
+ return { locked: locked(store), sms: ownerTexter.reaches(), passkeys: store.passkeys.map(({ id, rpID, device, createdAt }) => ({ id, rpID, device, createdAt })), owner, authenticator, sessions, enrollments };
817
830
  }
818
831
  /** Revokes one session by its reference, or every session when none is given; the next request carrying it is refused. Returns how many went. */
819
832
  function revokeSessions(ref) {
@@ -2,8 +2,8 @@
2
2
  * #4247 — the leaf every BullseyeNotif door shares with notify: where BN's config lives, the gateway's token settings,
3
3
  * the refusal type every door answers with, the atomic record write and the installed build's version.
4
4
  * It imports nothing of BN's own, so the doors (oauthDoor, restDoor, tunnel, publicAccess, gatewayInstall, panelPage,
5
- * agentGateway) no longer reach into notify.ts for it; passkeyDoor's one remaining tie to notify.ts is the SMS sign-in
6
- * code (smsReachesOwner, textOwner) and notifyDoor's is the MCP server it serves.
5
+ * agentGateway, passkeyDoor) no longer reach into notify.ts for it; passkeyDoor's SMS sender is handed in by the process
6
+ * that boots it (setOwnerTexter), and notifyDoor's one remaining tie to notify.ts is the MCP server it serves.
7
7
  * notify.ts re-exports every name here, so a caller that still imports them from notify.js reads the same values.
8
8
  */
9
9
  import { existsSync, readFileSync, renameSync, rmSync, writeFileSync } from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-notify-mcp",
3
- "version": "1.3.493",
3
+ "version": "1.3.494",
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",