omni-notify-mcp 1.3.350 → 1.3.351
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.
|
@@ -138,7 +138,8 @@ function saveWorkspaces(folders) {
|
|
|
138
138
|
named.set(nameKey(entry), entry);
|
|
139
139
|
entries.push({ path: entry });
|
|
140
140
|
}
|
|
141
|
-
|
|
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
|
|
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
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
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 ${
|
|
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
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
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.
|
|
3
|
+
"version": "1.3.351",
|
|
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",
|