opencode-plugin-boops 2.1.1 → 2.2.0
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 +4 -3
- package/cli/browse +14 -3
- package/cli/main +9 -5
- package/cli/uninstall +8 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,13 +49,14 @@ Then restart OpenCode. The plugin will be automatically downloaded and installed
|
|
|
49
49
|
# Install plugin (adds to OpenCode config)
|
|
50
50
|
npx opencode-plugin-boops install
|
|
51
51
|
|
|
52
|
+
# Configure sounds (TUI browser)
|
|
53
|
+
npx opencode-plugin-boops config # Same as browse
|
|
54
|
+
npx opencode-plugin-boops browse # Browse 448 sounds with semantic tags
|
|
55
|
+
|
|
52
56
|
# Uninstall plugin (removes from config)
|
|
53
57
|
npx opencode-plugin-boops uninstall # Interactive - asks about data cleanup
|
|
54
58
|
npx opencode-plugin-boops uninstall --full # Remove plugin + data
|
|
55
59
|
|
|
56
|
-
# Browse 448 sounds with semantic tags
|
|
57
|
-
npx opencode-plugin-boops browse
|
|
58
|
-
|
|
59
60
|
# Show help
|
|
60
61
|
npx opencode-plugin-boops
|
|
61
62
|
```
|
package/cli/browse
CHANGED
|
@@ -1116,9 +1116,20 @@ async function browse() {
|
|
|
1116
1116
|
const currentSound = config.sounds ? config.sounds[event] : null;
|
|
1117
1117
|
|
|
1118
1118
|
const bg = isSelected ? '\x1b[48;5;235m' : '';
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1119
|
+
|
|
1120
|
+
// Show current sound if selected event has one
|
|
1121
|
+
let eventText;
|
|
1122
|
+
if (isSelected && currentSound) {
|
|
1123
|
+
const soundName = currentSound.length > 15 ? currentSound.slice(0, 12) + '...' : currentSound;
|
|
1124
|
+
const label = event.length > pickerWidth - soundName.length - 10
|
|
1125
|
+
? event.slice(0, pickerWidth - soundName.length - 13) + '...'
|
|
1126
|
+
: event;
|
|
1127
|
+
eventText = `${label} \x1b[38;5;240m→ \x1b[38;5;76m${soundName}\x1b[0m${bg}`.padEnd(pickerWidth - 6 + 20); // +20 for ANSI codes
|
|
1128
|
+
} else {
|
|
1129
|
+
eventText = event.length > pickerWidth - 6
|
|
1130
|
+
? event.slice(0, pickerWidth - 9) + '...'
|
|
1131
|
+
: event.padEnd(pickerWidth - 6);
|
|
1132
|
+
}
|
|
1122
1133
|
|
|
1123
1134
|
const indicator = currentSound ? '•' : ' ';
|
|
1124
1135
|
const indicatorColor = currentSound ? '\x1b[38;5;76m' : '';
|
package/cli/main
CHANGED
|
@@ -10,23 +10,27 @@ import { dirname, join } from "path";
|
|
|
10
10
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
11
|
const __dirname = dirname(__filename);
|
|
12
12
|
|
|
13
|
-
const command = process.argv[2]
|
|
13
|
+
const command = process.argv[2];
|
|
14
14
|
const args = process.argv.slice(3);
|
|
15
15
|
|
|
16
16
|
const commands = {
|
|
17
17
|
install: join(__dirname, "install"),
|
|
18
18
|
uninstall: join(__dirname, "uninstall"),
|
|
19
19
|
browse: join(__dirname, "browse"),
|
|
20
|
+
config: join(__dirname, "browse"), // Alias for browse
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
if
|
|
23
|
+
// Show help if no command or invalid command
|
|
24
|
+
if (!command || !commands[command]) {
|
|
23
25
|
console.log("OpenCode Boops Plugin\n");
|
|
24
26
|
console.log("Usage:");
|
|
25
27
|
console.log(" npx opencode-plugin-boops install - Add plugin to OpenCode config");
|
|
26
28
|
console.log(" npx opencode-plugin-boops uninstall - Remove plugin from config");
|
|
27
|
-
console.log(" npx opencode-plugin-boops
|
|
28
|
-
console.log(" npx opencode-plugin-boops
|
|
29
|
-
|
|
29
|
+
console.log(" npx opencode-plugin-boops config - Configure sounds (TUI)");
|
|
30
|
+
console.log(" npx opencode-plugin-boops browse - Browse and test sounds (same as config)");
|
|
31
|
+
console.log("");
|
|
32
|
+
console.log("448 sounds with semantic tags (human, speech, ding, alarm, etc.)");
|
|
33
|
+
process.exit(command ? 1 : 0);
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
const child = spawn(commands[command], args, {
|
package/cli/uninstall
CHANGED
|
@@ -57,16 +57,19 @@ if (existsSync(CONFIG_PATH)) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// Ask about cleaning up data
|
|
60
|
+
const shouldCleanup = process.argv.includes("--full") || process.argv.includes("-f");
|
|
61
|
+
|
|
62
|
+
if (shouldCleanup) {
|
|
63
|
+
cleanup();
|
|
64
|
+
process.exit(0);
|
|
65
|
+
}
|
|
66
|
+
|
|
60
67
|
const rl = createInterface({
|
|
61
68
|
input: process.stdin,
|
|
62
69
|
output: process.stdout,
|
|
63
70
|
});
|
|
64
71
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (shouldCleanup) {
|
|
68
|
-
cleanup();
|
|
69
|
-
} else {
|
|
72
|
+
{
|
|
70
73
|
console.log("\n📦 Plugin data locations:");
|
|
71
74
|
if (existsSync(PLUGIN_DIR)) {
|
|
72
75
|
console.log(" • Config & data:", PLUGIN_DIR);
|
|
@@ -111,8 +114,4 @@ function cleanup() {
|
|
|
111
114
|
|
|
112
115
|
console.log("\n✨ Uninstall complete!");
|
|
113
116
|
console.log("\n💡 Restart OpenCode to complete the removal");
|
|
114
|
-
|
|
115
|
-
if (!shouldCleanup) {
|
|
116
|
-
rl.close();
|
|
117
|
-
}
|
|
118
117
|
}
|