klaudio 0.11.2 → 0.11.3
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/README.md +96 -96
- package/bin/cli.js +44 -44
- package/package.json +40 -44
- package/src/cache.js +306 -306
- package/src/cli.js +1821 -1821
- package/src/extractor.js +213 -213
- package/src/installer.js +369 -368
- package/src/notify.js +138 -135
- package/src/player.js +488 -488
- package/src/presets.js +87 -87
- package/src/scanner.js +445 -445
- package/src/scumm.js +560 -560
- package/src/tts.js +391 -391
package/src/presets.js
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { join, dirname } from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
|
|
4
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
-
// Detect compiled bun binary: import.meta.url starts with "bun:" or "B:/"
|
|
6
|
-
const isCompiledBinary = import.meta.url.startsWith("bun:") || import.meta.url.startsWith("B:/~BUN/");
|
|
7
|
-
const SOUNDS_DIR = isCompiledBinary
|
|
8
|
-
? join(dirname(process.execPath), "sounds")
|
|
9
|
-
: join(__dirname, "..", "sounds");
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Sound events that can be configured.
|
|
13
|
-
*/
|
|
14
|
-
export const EVENTS = {
|
|
15
|
-
notification: {
|
|
16
|
-
name: "Notification",
|
|
17
|
-
description: "Plays when Claude sends a notification (e.g. long task finished in background)",
|
|
18
|
-
hookEvent: "Notification",
|
|
19
|
-
copilotHookEvent: null, // Copilot doesn't have this yet
|
|
20
|
-
},
|
|
21
|
-
stop: {
|
|
22
|
-
name: "Task Complete",
|
|
23
|
-
description: "Plays when Claude finishes a response",
|
|
24
|
-
hookEvent: "Stop",
|
|
25
|
-
copilotHookEvent: "sessionEnd",
|
|
26
|
-
},
|
|
27
|
-
approval: {
|
|
28
|
-
name: "Waiting for Approval",
|
|
29
|
-
description: "Plays when Claude waits for you to approve an action",
|
|
30
|
-
hookEvent: null, // Uses PreToolUse/PostToolUse timer, not a direct hook
|
|
31
|
-
copilotHookEvent: null,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Built-in presets with their sound file mappings.
|
|
37
|
-
*/
|
|
38
|
-
export const PRESETS = {
|
|
39
|
-
"retro-8bit": {
|
|
40
|
-
name: "Retro 8-bit",
|
|
41
|
-
icon: "🎮",
|
|
42
|
-
description: "Chiptune bleeps, bloops, and victory jingles",
|
|
43
|
-
sounds: {
|
|
44
|
-
stop: join(SOUNDS_DIR, "retro-8bit", "stop.wav"),
|
|
45
|
-
notification: join(SOUNDS_DIR, "retro-8bit", "notification.wav"),
|
|
46
|
-
approval: join(SOUNDS_DIR, "retro-8bit", "notification.wav"),
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
"minimal-zen": {
|
|
50
|
-
name: "Minimal Zen",
|
|
51
|
-
icon: "🔔",
|
|
52
|
-
description: "Soft chimes and gentle tones",
|
|
53
|
-
sounds: {
|
|
54
|
-
stop: join(SOUNDS_DIR, "minimal-zen", "stop.wav"),
|
|
55
|
-
notification: join(SOUNDS_DIR, "minimal-zen", "notification.wav"),
|
|
56
|
-
approval: join(SOUNDS_DIR, "minimal-zen", "notification.wav"),
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
"sci-fi-terminal": {
|
|
60
|
-
name: "Sci-Fi Terminal",
|
|
61
|
-
icon: "🚀",
|
|
62
|
-
description: "Futuristic UI bleeps and digital notifications",
|
|
63
|
-
sounds: {
|
|
64
|
-
stop: join(SOUNDS_DIR, "sci-fi-terminal", "stop.wav"),
|
|
65
|
-
notification: join(SOUNDS_DIR, "sci-fi-terminal", "notification.wav"),
|
|
66
|
-
approval: join(SOUNDS_DIR, "sci-fi-terminal", "notification.wav"),
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
"victory-fanfare": {
|
|
70
|
-
name: "Victory Fanfare",
|
|
71
|
-
icon: "🏆",
|
|
72
|
-
description: "Celebratory jingles for task completion",
|
|
73
|
-
sounds: {
|
|
74
|
-
stop: join(SOUNDS_DIR, "victory-fanfare", "stop.wav"),
|
|
75
|
-
notification: join(SOUNDS_DIR, "victory-fanfare", "notification.wav"),
|
|
76
|
-
approval: join(SOUNDS_DIR, "victory-fanfare", "notification.wav"),
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export function getPresetSoundPath(presetId, eventId) {
|
|
82
|
-
return PRESETS[presetId]?.sounds[eventId];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function getSoundsDir() {
|
|
86
|
-
return SOUNDS_DIR;
|
|
87
|
-
}
|
|
1
|
+
import { join, dirname } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
|
|
4
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
// Detect compiled bun binary: import.meta.url starts with "bun:" or "B:/"
|
|
6
|
+
const isCompiledBinary = import.meta.url.startsWith("bun:") || import.meta.url.startsWith("B:/~BUN/");
|
|
7
|
+
const SOUNDS_DIR = isCompiledBinary
|
|
8
|
+
? join(dirname(process.execPath), "sounds")
|
|
9
|
+
: join(__dirname, "..", "sounds");
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Sound events that can be configured.
|
|
13
|
+
*/
|
|
14
|
+
export const EVENTS = {
|
|
15
|
+
notification: {
|
|
16
|
+
name: "Notification",
|
|
17
|
+
description: "Plays when Claude sends a notification (e.g. long task finished in background)",
|
|
18
|
+
hookEvent: "Notification",
|
|
19
|
+
copilotHookEvent: null, // Copilot doesn't have this yet
|
|
20
|
+
},
|
|
21
|
+
stop: {
|
|
22
|
+
name: "Task Complete",
|
|
23
|
+
description: "Plays when Claude finishes a response",
|
|
24
|
+
hookEvent: "Stop",
|
|
25
|
+
copilotHookEvent: "sessionEnd",
|
|
26
|
+
},
|
|
27
|
+
approval: {
|
|
28
|
+
name: "Waiting for Approval",
|
|
29
|
+
description: "Plays when Claude waits for you to approve an action",
|
|
30
|
+
hookEvent: null, // Uses PreToolUse/PostToolUse timer, not a direct hook
|
|
31
|
+
copilotHookEvent: null,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Built-in presets with their sound file mappings.
|
|
37
|
+
*/
|
|
38
|
+
export const PRESETS = {
|
|
39
|
+
"retro-8bit": {
|
|
40
|
+
name: "Retro 8-bit",
|
|
41
|
+
icon: "🎮",
|
|
42
|
+
description: "Chiptune bleeps, bloops, and victory jingles",
|
|
43
|
+
sounds: {
|
|
44
|
+
stop: join(SOUNDS_DIR, "retro-8bit", "stop.wav"),
|
|
45
|
+
notification: join(SOUNDS_DIR, "retro-8bit", "notification.wav"),
|
|
46
|
+
approval: join(SOUNDS_DIR, "retro-8bit", "notification.wav"),
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
"minimal-zen": {
|
|
50
|
+
name: "Minimal Zen",
|
|
51
|
+
icon: "🔔",
|
|
52
|
+
description: "Soft chimes and gentle tones",
|
|
53
|
+
sounds: {
|
|
54
|
+
stop: join(SOUNDS_DIR, "minimal-zen", "stop.wav"),
|
|
55
|
+
notification: join(SOUNDS_DIR, "minimal-zen", "notification.wav"),
|
|
56
|
+
approval: join(SOUNDS_DIR, "minimal-zen", "notification.wav"),
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
"sci-fi-terminal": {
|
|
60
|
+
name: "Sci-Fi Terminal",
|
|
61
|
+
icon: "🚀",
|
|
62
|
+
description: "Futuristic UI bleeps and digital notifications",
|
|
63
|
+
sounds: {
|
|
64
|
+
stop: join(SOUNDS_DIR, "sci-fi-terminal", "stop.wav"),
|
|
65
|
+
notification: join(SOUNDS_DIR, "sci-fi-terminal", "notification.wav"),
|
|
66
|
+
approval: join(SOUNDS_DIR, "sci-fi-terminal", "notification.wav"),
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
"victory-fanfare": {
|
|
70
|
+
name: "Victory Fanfare",
|
|
71
|
+
icon: "🏆",
|
|
72
|
+
description: "Celebratory jingles for task completion",
|
|
73
|
+
sounds: {
|
|
74
|
+
stop: join(SOUNDS_DIR, "victory-fanfare", "stop.wav"),
|
|
75
|
+
notification: join(SOUNDS_DIR, "victory-fanfare", "notification.wav"),
|
|
76
|
+
approval: join(SOUNDS_DIR, "victory-fanfare", "notification.wav"),
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export function getPresetSoundPath(presetId, eventId) {
|
|
82
|
+
return PRESETS[presetId]?.sounds[eventId];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function getSoundsDir() {
|
|
86
|
+
return SOUNDS_DIR;
|
|
87
|
+
}
|