omni-notify-mcp 1.3.309 → 1.3.310

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.
@@ -101,9 +101,13 @@ function sameBoard(a, b) {
101
101
  function heldByWords(claim) {
102
102
  return `#${claim.storyId} is held by ${claim.name} (${String(claim.sessionId).replace(/^hold:/, "")}) — heartbeat ${claim.at}${claim.why === undefined ? "" : ` — why: ${claim.why}`}`;
103
103
  }
104
- /** The hold a conversation writes for a story: a `hold` in the conversation's own name, addressed by this machine and this process exactly as the board's engine writes one (#2838). */
105
- function holdOf(name, storyId, board, now) {
106
- return { storyId, name, sessionId: `hold:${hostname()}:${process.pid}`, at: boardStamp(now), kind: "hold", board };
104
+ /** The address every hold of this daemon is written under and released by (#2838). */
105
+ function holdAddress() {
106
+ return `hold:${hostname()}:${process.pid}`;
107
+ }
108
+ /** The hold a conversation writes for a story: a `hold` in the conversation's own name, addressed by this machine and this process exactly as the board's engine writes one (#2838). `drives` names the agent session this conversation runs, so a door can tell this hold from the work of the very session it holds for (#3850). */
109
+ function holdOf(name, storyId, board, now, drives) {
110
+ return { storyId, name, sessionId: holdAddress(), at: boardStamp(now), kind: "hold", board, drives };
107
111
  }
108
112
  /** The claims the file still holds at `now`, lapsed ones dropped exactly as every reader of the file drops them; a file that is not there is a machine that has claimed nothing. */
109
113
  function readClaims(file, now) {
@@ -207,14 +211,16 @@ function writeClaims(file, claims) {
207
211
  }
208
212
  }
209
213
  /** BN's conversation takes the story's hold: the holder's name IS the conversation's id, so every refusal and every door name this conversation. Another session's standing hold, or its fresh `taken` claim, refuses in the file's own words (#2838/#2040). */
210
- function holdStory(file, name, storyId, board, now) {
211
- const claim = holdOf(name, storyId, board, now);
214
+ function holdStory(file, name, storyId, board, now, drives) {
215
+ const claim = holdOf(name, storyId, board, now, drives);
212
216
  underClaimsLock(file, () => {
213
217
  const before = readClaims(file, now);
214
218
  const on = (c) => c.storyId === claim.storyId && sameBoard(c.board, board);
215
219
  const prior = before.find(on);
216
- // The derived sessionId is the same for every conversation of one daemon, so a DIFFERENT conversation in this process is another holder too — its own name is what tells two of them apart, and neither may overwrite the other.
217
- const mine = prior !== undefined && prior.sessionId === claim.sessionId && prior.name === claim.name;
220
+ if (prior !== undefined && prior.sessionId === drives)
221
+ return;
222
+ // The name IS the conversation's id, so a hold in it is this conversation's own even under the address of a BN process that died; a DIFFERENT conversation's hold has another name and neither may overwrite the other.
223
+ const mine = prior !== undefined && prior.kind === "hold" && prior.name === claim.name;
218
224
  if (prior !== undefined && !mine && (prior.kind === "hold" || claim.kind === "hold"))
219
225
  throw new GatewayError(409, heldByWords(prior));
220
226
  writeClaims(file, [...before.filter((c) => !on(c)), claim]);
@@ -222,7 +228,7 @@ function holdStory(file, name, storyId, board, now) {
222
228
  }
223
229
  /** BN drops the hold it wrote when the work on the story ends: only the claim under its own address AND its own name goes — a different conversation of this daemon shares the address and must keep its own claim (#2838). */
224
230
  function releaseStory(file, name, storyId, board, now) {
225
- const mine = holdOf(name, storyId, board, now).sessionId;
231
+ const mine = holdAddress();
226
232
  underClaimsLock(file, () => {
227
233
  const before = readClaims(file, now);
228
234
  const isMine = (c) => c.storyId === storyId && sameBoard(c.board, board) && c.sessionId === mine && c.name === name;
@@ -679,6 +685,7 @@ export class SessionDriver {
679
685
  let beat;
680
686
  if (hold !== undefined) {
681
687
  const held = hold;
688
+ this.refreshHold(c.id, held);
682
689
  beat = setInterval(() => this.refreshHold(c.id, held), HOLD_BEAT_MS);
683
690
  beat.unref();
684
691
  }
@@ -705,13 +712,13 @@ export class SessionDriver {
705
712
  // NULL-OK: field storyId is OPTIONAL and therefore it is ok to check for NULL
706
713
  if (storyId === undefined)
707
714
  return undefined;
708
- holdStory(claimsFile(), conversationId, storyId, project, Date.now());
715
+ holdStory(claimsFile(), conversationId, storyId, project, Date.now(), readConversation(conversationId).sessionId);
709
716
  return { storyId, board: project };
710
717
  }
711
718
  /** The hold is refreshed so it never lapses while the turn it belongs to runs. */
712
719
  refreshHold(conversationId, hold) {
713
720
  try {
714
- holdStory(claimsFile(), conversationId, hold.storyId, hold.board, Date.now());
721
+ holdStory(claimsFile(), conversationId, hold.storyId, hold.board, Date.now(), readConversation(conversationId).sessionId);
715
722
  }
716
723
  catch (err) {
717
724
  if (!(err instanceof Error))
@@ -139,7 +139,7 @@ const PICKER_SOURCE = String.raw `
139
139
  window.sessionStorage.removeItem(moved);
140
140
  }
141
141
  var remembered = served.chosen;
142
- if (remembered !== "" && remembered !== served.current && labels.indexOf(remembered) >= 0 && window.sessionStorage.getItem(moved) !== remembered) {
142
+ if (served.current === "" && remembered !== "" && labels.indexOf(remembered) >= 0 && window.sessionStorage.getItem(moved) !== remembered) {
143
143
  window.sessionStorage.setItem(moved, remembered);
144
144
  window.location.assign(served.workspaces[remembered][page]);
145
145
  return;
@@ -180,7 +180,7 @@ const PICKER_SOURCE = String.raw `
180
180
  window.fetch(workspacesUrl(), { cache: "no-store" }).then(function (response) {
181
181
  return response.ok ? response.json() : null;
182
182
  }).then(function (again) {
183
- if (again !== null && again.chosen !== "" && again.chosen !== again.current && window.sessionStorage.getItem(moved) !== again.chosen && again.workspaces[again.chosen] !== undefined && again.workspaces[again.chosen][page] !== undefined) {
183
+ if (again !== null && again.chosen !== "" && again.chosen !== remembered && again.chosen !== again.current && window.sessionStorage.getItem(moved) !== again.chosen && again.workspaces[again.chosen] !== undefined && again.workspaces[again.chosen][page] !== undefined) {
184
184
  window.sessionStorage.setItem(moved, again.chosen);
185
185
  window.location.assign(again.workspaces[again.chosen][page]);
186
186
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-notify-mcp",
3
- "version": "1.3.309",
3
+ "version": "1.3.310",
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",