opencode-plugin-boops 2.5.1 → 2.5.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/cli/browse +2 -26
- package/package.json +2 -2
package/cli/browse
CHANGED
|
@@ -5,6 +5,7 @@ import { fileURLToPath } from "url";
|
|
|
5
5
|
import { homedir } from "os";
|
|
6
6
|
import { spawn, exec } from "child_process";
|
|
7
7
|
import https from "https";
|
|
8
|
+
import { parse } from "smol-toml";
|
|
8
9
|
|
|
9
10
|
// Get the directory where this script is located
|
|
10
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -96,32 +97,7 @@ function loadCurrentConfig() {
|
|
|
96
97
|
|
|
97
98
|
try {
|
|
98
99
|
const content = readFileSync(configPath, "utf-8");
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
// Simple TOML parser for our use case
|
|
102
|
-
const lines = content.split("\n");
|
|
103
|
-
let currentSection = null;
|
|
104
|
-
|
|
105
|
-
for (const line of lines) {
|
|
106
|
-
const trimmed = line.trim();
|
|
107
|
-
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
108
|
-
|
|
109
|
-
// Section header
|
|
110
|
-
if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
111
|
-
currentSection = trimmed.slice(1, -1);
|
|
112
|
-
if (!config[currentSection]) config[currentSection] = {};
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Key = value (handle quoted keys like "session.error")
|
|
117
|
-
const match = trimmed.match(/^"?([^"=]+)"?\s*=\s*"?([^"]+)"?$/);
|
|
118
|
-
if (match && currentSection) {
|
|
119
|
-
const [, key, value] = match;
|
|
120
|
-
config[currentSection][key.trim()] = value.trim().replace(/"/g, "");
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return config;
|
|
100
|
+
return parse(content);
|
|
125
101
|
} catch (e) {
|
|
126
102
|
return {};
|
|
127
103
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-plugin-boops",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "Sound notifications for OpenCode - plays pleasant sounds when tasks complete or input is needed",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"smol-toml": "^1.3.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
|
-
"postinstall": "node -e \"const fs=require('fs'),p=require('path'),h=require('os').homedir(),d=p.join(h,'.config','opencode','plugins','boops');fs.mkdirSync(d,{recursive:true});const cfg=p.join(d,'boops.toml');if(!fs.existsSync(cfg))fs.copyFileSync(
|
|
36
|
+
"postinstall": "node -e \"const fs=require('fs'),p=require('path'),h=require('os').homedir(),d=p.join(h,'.config','opencode','plugins','boops');fs.mkdirSync(d,{recursive:true});const cfg=p.join(d,'boops.toml');const defaultTpl=p.join(__dirname,'boops.default.toml');if(!fs.existsSync(cfg)||fs.statSync(cfg).size<500){fs.copyFileSync(defaultTpl,cfg);console.log('✓ Created default config')}fs.copyFileSync(p.join(__dirname,'cli','browse'),p.join(d,'browse'));fs.copyFileSync(p.join(__dirname,'sounds.json'),p.join(d,'sounds.json'));fs.chmodSync(p.join(d,'browse'),0o755);console.log('✓ Installed to ~/.config/opencode/plugins/boops/')\""
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"index.ts",
|