omni-notify-mcp 1.3.500 → 1.3.501
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/chunk.js +16 -3
- package/dist/notify.js +4 -1
- package/package.json +1 -1
package/dist/chunk.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { decisionLink } from "./messaging/decisionDigit.js";
|
|
1
2
|
export const NOTIFY_CHUNK_LIMIT = 500;
|
|
2
3
|
function packChunks(message, body, wordAware) {
|
|
3
4
|
const chunks = [];
|
|
@@ -24,18 +25,30 @@ export function withLead(lead, text) {
|
|
|
24
25
|
export function splitForNotify(message, limit = NOTIFY_CHUNK_LIMIT) {
|
|
25
26
|
if (message.length <= limit)
|
|
26
27
|
return [message];
|
|
28
|
+
// #5063 — a board decision carries its decision link inside the text, and his reply is read against the very part he replied
|
|
29
|
+
// to (notify.ts:1416 → decisionDigit.ts:39). A plain split could strand the link in one part (the words in another), so a
|
|
30
|
+
// reply to the words half found no link and ruled nothing. Every part of a decision notice is sent carrying that link: each
|
|
31
|
+
// part reserves room for it and, if the split left the link out, the link is appended — so a reply to ANY part resolves.
|
|
32
|
+
const link = decisionLink(message);
|
|
33
|
+
const tail = link === undefined ? "" : `\n🔗 ${link}`;
|
|
27
34
|
let parts = Math.ceil(message.length / limit);
|
|
28
35
|
for (;;) {
|
|
29
36
|
const reserve = `(${parts}/${parts}) `.length;
|
|
30
|
-
const needed = Math.ceil(message.length / Math.max(1, limit - reserve));
|
|
37
|
+
const needed = Math.ceil(message.length / Math.max(1, limit - reserve - tail.length));
|
|
31
38
|
if (needed <= parts)
|
|
32
39
|
break;
|
|
33
40
|
parts = needed;
|
|
34
41
|
}
|
|
35
|
-
const body = Math.max(1, limit - `(${parts}/${parts}) `.length);
|
|
42
|
+
const body = Math.max(1, limit - `(${parts}/${parts}) `.length - tail.length);
|
|
36
43
|
let chunks = packChunks(message, body, true);
|
|
37
44
|
if (chunks.length > parts)
|
|
38
45
|
chunks = packChunks(message, body, false);
|
|
39
46
|
const total = chunks.length;
|
|
40
|
-
return chunks.map((chunk, i) =>
|
|
47
|
+
return chunks.map((chunk, i) => {
|
|
48
|
+
const part = withLead(`(${i + 1}/${total})`, chunk);
|
|
49
|
+
if (link === undefined || part.includes(link))
|
|
50
|
+
return part;
|
|
51
|
+
// the split left this part without the link (the footer glyph stranded from its URL): drop the orphaned glyph and carry the link itself
|
|
52
|
+
return `${part.replace(/\s*🔗\s*$/, "")}${tail}`;
|
|
53
|
+
});
|
|
41
54
|
}
|
package/dist/notify.js
CHANGED
|
@@ -3180,7 +3180,10 @@ async function sendChunked(message, priority, clientId) {
|
|
|
3180
3180
|
const buttons = decisionButtons(message);
|
|
3181
3181
|
const topic = topicOfMessage(message);
|
|
3182
3182
|
for (const [i, chunk] of parts.entries()) {
|
|
3183
|
-
|
|
3183
|
+
// #5063 — the buttons ride on EVERY part, not only the last: splitForNotify puts the decision link on every part too, so a
|
|
3184
|
+
// tap on any part's buttons resolves the decision (buttonPick reads the link off the message the button sits on). Attaching
|
|
3185
|
+
// them to the last part alone left every earlier part a dead end for both a tap and a reply.
|
|
3186
|
+
outcomes.push(await sendNotification(withLead(`[${clientId}]`, chunk), priority, clientId, buttons, topic === undefined ? undefined : { ...topic, ships: topic.ships && i === parts.length - 1 }));
|
|
3184
3187
|
}
|
|
3185
3188
|
return outcomes;
|
|
3186
3189
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.501",
|
|
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",
|