opencode-studio-server 1.14.0 → 1.14.1
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/backend.log +1 -0
- package/package.json +1 -1
- package/proxy-manager.js +16 -0
package/backend.log
CHANGED
package/package.json
CHANGED
package/proxy-manager.js
CHANGED
|
@@ -15,6 +15,9 @@ let isProxyRunning = false;
|
|
|
15
15
|
// Helper to check if binary exists
|
|
16
16
|
const checkBinary = (cmd) => {
|
|
17
17
|
return new Promise((resolve) => {
|
|
18
|
+
if (path.isAbsolute(cmd)) {
|
|
19
|
+
return resolve(fs.existsSync(cmd));
|
|
20
|
+
}
|
|
18
21
|
const checkCmd = process.platform === 'win32' ? `where ${cmd}` : `which ${cmd}`;
|
|
19
22
|
exec(checkCmd, (err) => {
|
|
20
23
|
resolve(!err);
|
|
@@ -23,7 +26,20 @@ const checkBinary = (cmd) => {
|
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
const getProxyCommand = async () => {
|
|
29
|
+
if (process.platform === 'win32') {
|
|
30
|
+
const localAppData = process.env.LOCALAPPDATA;
|
|
31
|
+
if (localAppData) {
|
|
32
|
+
const wingetPath = path.join(localAppData, 'Microsoft', 'WinGet', 'Links', 'CLIProxyAPI.exe');
|
|
33
|
+
if (fs.existsSync(wingetPath)) return wingetPath;
|
|
34
|
+
|
|
35
|
+
const progPath = path.join(localAppData, 'Programs', 'CLIProxyAPI', 'CLIProxyAPI.exe');
|
|
36
|
+
if (fs.existsSync(progPath)) return progPath;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
26
40
|
if (await checkBinary('cliproxyapi')) return 'cliproxyapi';
|
|
41
|
+
if (await checkBinary('CLIProxyAPI')) return 'CLIProxyAPI';
|
|
42
|
+
if (await checkBinary('cliproxyapi.exe')) return 'cliproxyapi.exe';
|
|
27
43
|
if (await checkBinary('cliproxy')) return 'cliproxy';
|
|
28
44
|
return null;
|
|
29
45
|
};
|