@delt/claude-alarm 0.6.9 → 0.6.11

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/cli.js CHANGED
@@ -535,8 +535,7 @@ ${sessionList}`);
535
535
  try {
536
536
  const p = JSON.parse(inputPreview);
537
537
  if (p.command) preview = `$ ${p.command}`;
538
- else if (p.title && p.message) preview = `${p.title}
539
- ${p.message}`;
538
+ else if (p.title && p.message) preview = p.message;
540
539
  else if (p.file_path) {
541
540
  preview = p.file_path;
542
541
  if (p.content) {
@@ -559,8 +558,18 @@ ${p.message}`;
559
558
  const isShort = !previewSlice.includes("\n") && previewSlice.length < 100;
560
559
  const previewHtml = isShort ? `<code>${this.escHtml(previewSlice)}</code>` : this.escHtml(previewSlice);
561
560
  let displayTool = toolName;
562
- const mcpMatch = toolName.match(/__([^_]+)$/);
563
- if (mcpMatch) displayTool = mcpMatch[1].charAt(0).toUpperCase() + mcpMatch[1].slice(1);
561
+ if ((toolName.endsWith("__notify") || toolName === "notify") && inputPreview) {
562
+ try {
563
+ const pp = JSON.parse(inputPreview);
564
+ if (pp.title) displayTool = pp.title;
565
+ } catch {
566
+ const tm = inputPreview.match(/"title"\s*:\s*"((?:[^"\\]|\\.)*)"/);
567
+ if (tm) displayTool = tm[1];
568
+ }
569
+ } else {
570
+ const mcpMatch = toolName.match(/__([^_]+)$/);
571
+ if (mcpMatch) displayTool = mcpMatch[1].charAt(0).toUpperCase() + mcpMatch[1].slice(1);
572
+ }
564
573
  const text = `\u26A0\uFE0F <b>Permission Request</b> \u2014 ${this.escHtml(sessionLabel)}
565
574
 
566
575
  \u{1F527} <b>${this.escHtml(displayTool)}</b>