@delt/claude-alarm 0.6.16 → 0.6.18

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.
@@ -445,7 +445,10 @@
445
445
  transition: opacity 0.15s;
446
446
  }
447
447
  .notif-dismiss:hover { color: var(--red); }
448
- .notif-item .notif-message { color: var(--text-dim); }
448
+ .notif-item .notif-message { color: var(--text-dim); overflow: hidden; word-break: break-word; }
449
+ .notif-item .notif-message h2, .notif-item .notif-message h3, .notif-item .notif-message h4 { font-size: 12px; margin: 2px 0; }
450
+ .notif-item .notif-message pre { font-size: 10px; padding: 4px 6px; max-height: 60px; overflow: hidden; }
451
+ .notif-item .notif-message code { font-size: 10px; }
449
452
  .notif-item .notif-time { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
450
453
  .notif-header {
451
454
  display: flex;
@@ -1198,7 +1201,7 @@
1198
1201
  }
1199
1202
  return `<div class="notif-item" data-session="${n.sessionId}" data-index="${i}">
1200
1203
  <div class="notif-title"><span class="notif-level ${n.level}"></span><span class="notif-title-text">${esc(n.title)}</span><button class="notif-dismiss" data-index="${i}">&times;</button></div>
1201
- <div class="notif-message">${renderMarkdown(n.message)}</div>${permButtons}
1204
+ <div class="notif-message">${esc(stripMarkdown(n.message))}</div>${permButtons}
1202
1205
  <div class="notif-time">${sName} &middot; ${timeStr}</div>
1203
1206
  </div>`;
1204
1207
  }).join('');
@@ -1351,6 +1354,18 @@
1351
1354
  return d.innerHTML;
1352
1355
  }
1353
1356
 
1357
+ function stripMarkdown(s) {
1358
+ return s
1359
+ .replace(/```[\s\S]*?```/g, '') // code blocks
1360
+ .replace(/`([^`]+)`/g, '$1') // inline code
1361
+ .replace(/\*\*(.+?)\*\*/g, '$1') // bold
1362
+ .replace(/\*(.+?)\*/g, '$1') // italic
1363
+ .replace(/^#{1,3}\s+/gm, '') // headings
1364
+ .replace(/^- /gm, '· ') // list items
1365
+ .replace(/\n{2,}/g, '\n') // multiple newlines
1366
+ .trim();
1367
+ }
1368
+
1354
1369
  function renderMarkdown(text) {
1355
1370
  let html = esc(text);
1356
1371
  html = html.replace(/```(\w*)\n?([\s\S]*?)```/g, '<pre><code>$2</code></pre>');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delt/claude-alarm",
3
- "version": "0.6.16",
3
+ "version": "0.6.18",
4
4
  "description": "Monitor and get notifications from multiple Claude Code sessions via MCP Channels",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -445,7 +445,10 @@
445
445
  transition: opacity 0.15s;
446
446
  }
447
447
  .notif-dismiss:hover { color: var(--red); }
448
- .notif-item .notif-message { color: var(--text-dim); }
448
+ .notif-item .notif-message { color: var(--text-dim); overflow: hidden; word-break: break-word; }
449
+ .notif-item .notif-message h2, .notif-item .notif-message h3, .notif-item .notif-message h4 { font-size: 12px; margin: 2px 0; }
450
+ .notif-item .notif-message pre { font-size: 10px; padding: 4px 6px; max-height: 60px; overflow: hidden; }
451
+ .notif-item .notif-message code { font-size: 10px; }
449
452
  .notif-item .notif-time { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
450
453
  .notif-header {
451
454
  display: flex;
@@ -1198,7 +1201,7 @@
1198
1201
  }
1199
1202
  return `<div class="notif-item" data-session="${n.sessionId}" data-index="${i}">
1200
1203
  <div class="notif-title"><span class="notif-level ${n.level}"></span><span class="notif-title-text">${esc(n.title)}</span><button class="notif-dismiss" data-index="${i}">&times;</button></div>
1201
- <div class="notif-message">${renderMarkdown(n.message)}</div>${permButtons}
1204
+ <div class="notif-message">${esc(stripMarkdown(n.message))}</div>${permButtons}
1202
1205
  <div class="notif-time">${sName} &middot; ${timeStr}</div>
1203
1206
  </div>`;
1204
1207
  }).join('');
@@ -1351,6 +1354,18 @@
1351
1354
  return d.innerHTML;
1352
1355
  }
1353
1356
 
1357
+ function stripMarkdown(s) {
1358
+ return s
1359
+ .replace(/```[\s\S]*?```/g, '') // code blocks
1360
+ .replace(/`([^`]+)`/g, '$1') // inline code
1361
+ .replace(/\*\*(.+?)\*\*/g, '$1') // bold
1362
+ .replace(/\*(.+?)\*/g, '$1') // italic
1363
+ .replace(/^#{1,3}\s+/gm, '') // headings
1364
+ .replace(/^- /gm, '· ') // list items
1365
+ .replace(/\n{2,}/g, '\n') // multiple newlines
1366
+ .trim();
1367
+ }
1368
+
1354
1369
  function renderMarkdown(text) {
1355
1370
  let html = esc(text);
1356
1371
  html = html.replace(/```(\w*)\n?([\s\S]*?)```/g, '<pre><code>$2</code></pre>');