claude-code-notify-lite 1.0.4 → 1.0.5

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/audio.js +14 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-notify-lite",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Task completion notifications for Claude Code - Cross-platform, lightweight, and easy to use",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/audio.js CHANGED
@@ -50,17 +50,20 @@ function playWithAfplay(soundPath, volume) {
50
50
  function playWithPowershell(soundPath) {
51
51
  return new Promise((resolve) => {
52
52
  logger.info('Playing sound with PowerShell', { soundPath });
53
- const escapedPath = soundPath.replace(/\\/g, '\\\\');
54
- const psScript = [
55
- 'Add-Type -AssemblyName PresentationCore',
56
- '$player = New-Object System.Windows.Media.MediaPlayer',
57
- `$player.Open([System.Uri]"${escapedPath}")`,
58
- 'Start-Sleep -Milliseconds 300',
59
- '$player.Play()',
60
- 'Start-Sleep -Seconds 3'
61
- ].join('; ');
62
-
63
- exec(`powershell -NoProfile -ExecutionPolicy Bypass -Command "${psScript}"`,
53
+
54
+ const psScript = `
55
+ Add-Type -AssemblyName PresentationCore
56
+ $player = New-Object System.Windows.Media.MediaPlayer
57
+ $player.Open([System.Uri]'${soundPath.replace(/'/g, "''")}')
58
+ Start-Sleep -Milliseconds 300
59
+ $player.Play()
60
+ Start-Sleep -Seconds 3
61
+ $player.Close()
62
+ `;
63
+
64
+ const base64Command = Buffer.from(psScript, 'utf16le').toString('base64');
65
+
66
+ exec(`powershell -NoProfile -ExecutionPolicy Bypass -EncodedCommand ${base64Command}`,
64
67
  { encoding: 'utf8', windowsHide: true },
65
68
  (err) => {
66
69
  if (err) {