omni-notify-mcp 1.3.350 → 1.3.352

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.
@@ -219,7 +219,7 @@ export function logRow(line) {
219
219
  const READ_EVERY_MS = 250;
220
220
  // GATE: how often a session log not found yet is looked for — finding one walks the CLI's session folders, so it is not done on every read.
221
221
  const LOCATE_EVERY_MS = 1_000;
222
- // GATE: how long the CLI's screen must stay still after its first output before a prompt is pasted — a CLI still drawing its start (Codex's "loading") drops a paste.
222
+ // GATE: how long the CLI's screen must stay still, with something drawn on it, before a prompt is pasted — a CLI still drawing its start (Codex's "loading") or still booting behind a blank screen (OpenCode) drops a paste.
223
223
  const SETTLED_MS = 1_500;
224
224
  /** A Windows file another process holds open without sharing it: the next read tries again. */
225
225
  const HELD_BY_ANOTHER = new Set(["EBUSY", "EPERM"]);
@@ -264,7 +264,8 @@ export class LoggedCliSession extends CliSession {
264
264
  this.settled = new Promise((resolve) => { this.markSettled = resolve; });
265
265
  this.terminal.onOutput(() => {
266
266
  clearTimeout(this.still);
267
- this.still = setTimeout(this.markSettled, SETTLED_MS);
267
+ this.still = setTimeout(() => void this.terminal.screenText().then((text) => { if (text !== "")
268
+ this.markSettled(); }), SETTLED_MS);
268
269
  });
269
270
  this.reader = setInterval(() => this.tick(), READ_EVERY_MS);
270
271
  this.reader.unref();
@@ -138,7 +138,8 @@ function saveWorkspaces(folders) {
138
138
  named.set(nameKey(entry), entry);
139
139
  entries.push({ path: entry });
140
140
  }
141
- writeAtomically(workspacesFile(), listText(entries));
141
+ const file = workspacesFile();
142
+ underLock(file, () => writeAtomically(file, listText(entries)));
142
143
  }
143
144
  function listText(entries) {
144
145
  return `${JSON.stringify({ workspaces: entries }, null, 2)}\n`;
@@ -415,7 +416,7 @@ function writtenSettings(root, tool, change, base) {
415
416
  // GATE: how many times a push the remote refused because another box or call pushed first, or a git step that lost a lock to another publish of this process, is tried before the publish throws.
416
417
  const PUBLISH_ATTEMPTS = 3;
417
418
  /** What git says when another publish of this process holds the lock or moved the ref a step needed — that publish finishes, so the step is tried again. */
418
- const CONTENDED = /index\.lock|cannot lock ref|unable to (?:create|lock)|but expected|would be overwritten by merge/i;
419
+ const CONTENDED = /index\.lock|cannot lock ref|unable to (?:create|lock|write)|but expected|would be overwritten by merge/i;
419
420
  const backoff = (attempt) => new Promise((resolve) => setTimeout(resolve, 100 * 2 ** attempt * (0.5 + Math.random())));
420
421
  async function contended(step) {
421
422
  for (let attempt = 1;; attempt++) {
@@ -543,20 +544,22 @@ async function settleHere(root, rel, text, commit) {
543
544
  * commit, or null when origin already holds the file.
544
545
  */
545
546
  async function publishFile(root, file, merge, subject) {
546
- const top = (await git(root, ["rev-parse", "--show-toplevel"])).trim();
547
- const rel = path.relative(top, file).split(path.sep).join("/");
547
+ const rel = `${(await git(path.dirname(file), ["rev-parse", "--show-prefix"])).trim()}${path.basename(file)}`;
548
548
  const published = path.join((await git(root, ["rev-parse", "--absolute-git-dir"])).trim(), "bullseye", "published", rel.split("/").join("__"));
549
549
  for (let attempt = 1;; attempt++) {
550
550
  await contended(() => git(root, ["fetch", "--quiet", "origin", "main"]));
551
551
  const tip = (await git(root, ["rev-parse", "origin/main"])).trim();
552
552
  const theirsText = await bytesAt(root, tip, rel);
553
553
  const baseText = fs.existsSync(published) ? fs.readFileSync(published, "utf8") : await bytesAt(root, "HEAD", rel);
554
- const oursText = fs.readFileSync(file, "utf8");
555
- const { text, contested } = merge(baseText, oursText, theirsText);
556
- if (text !== oursText)
557
- writeAtomically(file, text);
554
+ const { text, contested } = underLock(file, () => {
555
+ const oursText = fs.readFileSync(file, "utf8");
556
+ const joined = merge(baseText, oursText, theirsText);
557
+ if (joined.text !== oursText)
558
+ writeAtomically(file, joined.text);
559
+ return joined;
560
+ });
558
561
  if (contested.length > 0)
559
- console.error(`[workspace-settings] ${rel} in ${top}: ${contested.join(", ")} changed here and on another box at once — the value already on origin stands`);
562
+ console.error(`[workspace-settings] ${rel} in ${root}: ${contested.join(", ")} changed here and on another box at once — the value already on origin stands`);
560
563
  if (text === theirsText) {
561
564
  await settleHere(root, rel, text, tip);
562
565
  writeAtomically(published, text);
@@ -565,16 +568,18 @@ async function publishFile(root, file, merge, subject) {
565
568
  const index = `${published}.${process.pid}.${crypto.randomUUID()}.index`;
566
569
  fs.mkdirSync(path.dirname(index), { recursive: true });
567
570
  try {
568
- await git(root, ["read-tree", tip], undefined, { GIT_INDEX_FILE: index });
569
- const blob = (await git(root, ["hash-object", "-w", "--stdin"], text)).trim();
570
- await git(root, ["update-index", "--add", "--cacheinfo", `100644,${blob},${rel}`], undefined, { GIT_INDEX_FILE: index });
571
- const tree = (await git(root, ["write-tree"], undefined, { GIT_INDEX_FILE: index })).trim();
572
- const commit = (await git(root, ["commit-tree", tree, "-p", tip, "-m", `⚙️ ${subject} from ${os.hostname()}`])).trim();
571
+ const commit = await contended(async () => {
572
+ await git(root, ["read-tree", tip], undefined, { GIT_INDEX_FILE: index });
573
+ const blob = (await git(root, ["hash-object", "-w", "--stdin"], text)).trim();
574
+ await git(root, ["update-index", "--add", "--cacheinfo", `100644,${blob},${rel}`], undefined, { GIT_INDEX_FILE: index });
575
+ const tree = (await git(root, ["write-tree"], undefined, { GIT_INDEX_FILE: index })).trim();
576
+ return (await git(root, ["commit-tree", tree, "-p", tip, "-m", `⚙️ ${subject} from ${os.hostname()}`])).trim();
577
+ });
573
578
  try {
574
579
  await git(root, ["push", "--quiet", "origin", `${commit}:refs/heads/main`]);
575
580
  }
576
581
  catch (refused) {
577
- if (attempt >= PUBLISH_ATTEMPTS || !/\[rejected\]|non-fast-forward|fetch first|incorrect old value|cannot lock ref/i.test(refused.said))
582
+ if (attempt >= PUBLISH_ATTEMPTS || !/\[rejected\]|non-fast-forward|fetch first|incorrect old value|cannot lock ref|unable to write/i.test(refused.said))
578
583
  throw refused;
579
584
  await backoff(attempt);
580
585
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-notify-mcp",
3
- "version": "1.3.350",
3
+ "version": "1.3.352",
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",