ai-notify 0.4.5 → 0.4.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/notify.mjs +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-notify",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Desktop, sound, and spoken notifications for terminal AI coding agents (Claude Code, Codex, Gemini, ...) — with one mute switch that covers all of them, across every terminal.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/notify.mjs CHANGED
@@ -193,7 +193,13 @@ export const emit = ({ provider = 'default', event = 'done', label = '', message
193
193
  // 3. the auto-derived label — only when speakLabel is on (else slow filler).
194
194
  const envName = (process.env.AI_NOTIFY_LABEL || '').trim();
195
195
  const spokenName = envName || pane.speakName || (config.speakLabel === true && label ? label : '');
196
- const speakText = spokenName ? `${spokenName}、${spokenBody}` : spokenBody;
196
+ // Join the pane name to the read-out as the SUBJECT. Japanese needs the は
197
+ // topic particle ("ジョンは、…") — a bare comma ("ジョン、…") reads as calling
198
+ // out TO John, not saying John is the one finishing / waiting. Other languages
199
+ // just get a comma.
200
+ const isJa = (s) => /[぀-ヿ㐀-鿿ヲ-゚]/.test(s); // kana / kanji / half-width kana
201
+ const joinName = (name, body) => (name ? `${name}${isJa(body) ? 'は、' : ', '}${body}` : body);
202
+ const speakText = joinName(spokenName, spokenBody);
197
203
 
198
204
  // Per-pane voice (precedence: $AI_NOTIFY_* env > this pane's pick > global).
199
205
  const tts = pane.tts || config.tts;
@@ -238,7 +244,7 @@ export const emit = ({ provider = 'default', event = 'done', label = '', message
238
244
  speakTone = tsundere.axisFor(eff);
239
245
  outVol = Math.min(2, Math.max(0, vol * tsundere.volumeMul(tier, ts.volumeBoost !== false)));
240
246
  outText = tsundere.wrap(spokenBody, eff, tier, ts.lang || 'ja', nextCounter('tsundere'));
241
- if (spokenName) outText = `${spokenName}、${outText}`;
247
+ if (spokenName) outText = joinName(spokenName, outText);
242
248
  if (tts === 'voicevox') {
243
249
  const sm = ts.styleMap || voicevox.resolveStyles(outSpeaker, config.voicevox?.url);
244
250
  const axis = tsundere.axisFor(eff);