opencode-studio-server 1.16.4 → 1.16.7
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/package.json +1 -1
- package/proxy-manager.js +29 -13
- package/.env +0 -2
- package/.env.example +0 -2
- package/backend.log +0 -4
- package/server.live.err.log +0 -0
- package/server.live.log +0 -1
- package/server.log +0 -1
- package/server.out +0 -201
package/package.json
CHANGED
package/proxy-manager.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { spawn, exec } = require('child_process');
|
|
1
|
+
const { spawn, exec, execSync } = require('child_process');
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const os = require('os');
|
|
@@ -12,7 +12,6 @@ const PROXY_AUTH_DIR = path.join(HOME_DIR, '.cli-proxy-api');
|
|
|
12
12
|
let proxyProcess = null;
|
|
13
13
|
let isProxyRunning = false;
|
|
14
14
|
|
|
15
|
-
// Helper to check if binary exists
|
|
16
15
|
const checkBinary = (cmd) => {
|
|
17
16
|
return new Promise((resolve) => {
|
|
18
17
|
if (path.isAbsolute(cmd)) {
|
|
@@ -48,10 +47,8 @@ const getProxyCommand = async () => {
|
|
|
48
47
|
return null;
|
|
49
48
|
};
|
|
50
49
|
|
|
51
|
-
// Config Management
|
|
52
50
|
const loadProxyConfig = () => {
|
|
53
51
|
if (!fs.existsSync(PROXY_CONFIG_FILE)) {
|
|
54
|
-
// Default config
|
|
55
52
|
const defaultConfig = {
|
|
56
53
|
port: 8317,
|
|
57
54
|
cors: true,
|
|
@@ -98,24 +95,24 @@ const saveProxyConfig = (config) => {
|
|
|
98
95
|
}
|
|
99
96
|
};
|
|
100
97
|
|
|
101
|
-
// Process Management
|
|
102
98
|
const startProxy = async () => {
|
|
103
99
|
if (isProxyRunning) return { success: true, message: "Already running" };
|
|
104
100
|
|
|
105
101
|
const cmd = await getProxyCommand();
|
|
106
102
|
if (!cmd) return { success: false, error: "CLIProxyAPI binary not found. Please install it." };
|
|
107
103
|
|
|
108
|
-
// Ensure config exists
|
|
109
104
|
if (!fs.existsSync(PROXY_CONFIG_FILE)) loadProxyConfig();
|
|
110
105
|
|
|
111
|
-
console.log(`Starting proxy with command: ${cmd} -config ${PROXY_CONFIG_FILE}`);
|
|
106
|
+
console.log(`Starting proxy with command: ${cmd} -config "${PROXY_CONFIG_FILE}"`);
|
|
112
107
|
|
|
113
108
|
try {
|
|
114
|
-
// -no-browser flag to prevent it from trying to open browser on startup if that's a thing
|
|
115
109
|
proxyProcess = spawn(cmd, ['-config', PROXY_CONFIG_FILE], {
|
|
116
|
-
detached:
|
|
117
|
-
stdio: 'pipe'
|
|
110
|
+
detached: true,
|
|
111
|
+
stdio: 'pipe',
|
|
112
|
+
windowsHide: true
|
|
118
113
|
});
|
|
114
|
+
|
|
115
|
+
proxyProcess.unref();
|
|
119
116
|
|
|
120
117
|
proxyProcess.stdout.on('data', (data) => {
|
|
121
118
|
console.log(`[Proxy] ${data}`);
|
|
@@ -150,6 +147,27 @@ const stopProxy = () => {
|
|
|
150
147
|
|
|
151
148
|
const getStatus = async () => {
|
|
152
149
|
const cmd = await getProxyCommand();
|
|
150
|
+
|
|
151
|
+
let portBusy = false;
|
|
152
|
+
try {
|
|
153
|
+
if (process.platform === 'win32') {
|
|
154
|
+
const out = execSync('netstat -ano | findstr :8317 | findstr LISTENING', { encoding: 'utf8' });
|
|
155
|
+
portBusy = out.includes('LISTENING');
|
|
156
|
+
} else {
|
|
157
|
+
const out = execSync('lsof -i :8317 | grep LISTEN', { encoding: 'utf8' });
|
|
158
|
+
portBusy = out.length > 0;
|
|
159
|
+
}
|
|
160
|
+
} catch (e) {
|
|
161
|
+
portBusy = false;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (portBusy) {
|
|
165
|
+
isProxyRunning = true;
|
|
166
|
+
} else {
|
|
167
|
+
isProxyRunning = false;
|
|
168
|
+
proxyProcess = null;
|
|
169
|
+
}
|
|
170
|
+
|
|
153
171
|
return {
|
|
154
172
|
running: isProxyRunning,
|
|
155
173
|
pid: proxyProcess?.pid,
|
|
@@ -174,8 +192,6 @@ const runLogin = async (provider) => {
|
|
|
174
192
|
default: return { success: false, error: "Unknown provider" };
|
|
175
193
|
}
|
|
176
194
|
|
|
177
|
-
// Return the command so the UI can spawn a terminal for it
|
|
178
|
-
// We pass the config file so it saves the token to the right place/knows the auth-dir
|
|
179
195
|
const fullCmd = `${cmd} ${loginFlag} -config "${PROXY_CONFIG_FILE}"`;
|
|
180
196
|
|
|
181
197
|
return {
|
|
@@ -209,4 +225,4 @@ module.exports = {
|
|
|
209
225
|
saveProxyConfig,
|
|
210
226
|
runLogin,
|
|
211
227
|
listAccounts
|
|
212
|
-
};
|
|
228
|
+
};
|
package/.env
DELETED
package/.env.example
DELETED
package/backend.log
DELETED
package/server.live.err.log
DELETED
|
File without changes
|
package/server.live.log
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Server running at http://localhost:3001
|
package/server.log
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Acceso denegado.
|
package/server.out
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
2026-01-07T15:36:27.572Z Server running at http://localhost:3001
|
|
2
|
-
2026-01-07T15:36:28.364Z --- Auth Debug ---
|
|
3
|
-
2026-01-07T15:36:28.364Z Active Google Plugin:
|
|
4
|
-
2026-01-07T15:36:28.364Z Found keys in authCfg:
|
|
5
|
-
2026-01-07T15:36:28.364Z Google Auth found!
|
|
6
|
-
2026-01-07T15:36:28.364Z google.antigravity found!
|
|
7
|
-
2026-01-07T15:36:28.364Z google.gemini found!
|
|
8
|
-
2026-01-07T15:36:28.379Z --- Auth Debug ---
|
|
9
|
-
2026-01-07T15:36:28.379Z Active Google Plugin:
|
|
10
|
-
2026-01-07T15:36:28.379Z Found keys in authCfg:
|
|
11
|
-
2026-01-07T15:36:28.379Z Google Auth found!
|
|
12
|
-
2026-01-07T15:36:28.379Z google.antigravity found!
|
|
13
|
-
2026-01-07T15:36:28.379Z google.gemini found!
|
|
14
|
-
2026-01-07T15:36:30.415Z --- Auth Debug ---
|
|
15
|
-
2026-01-07T15:36:30.415Z Active Google Plugin:
|
|
16
|
-
2026-01-07T15:36:30.415Z Found keys in authCfg:
|
|
17
|
-
2026-01-07T15:36:30.415Z Google Auth found!
|
|
18
|
-
2026-01-07T15:36:30.415Z google.antigravity found!
|
|
19
|
-
2026-01-07T15:36:30.415Z google.gemini found!
|
|
20
|
-
2026-01-07T15:36:30.427Z --- Auth Debug ---
|
|
21
|
-
2026-01-07T15:36:30.427Z Active Google Plugin:
|
|
22
|
-
2026-01-07T15:36:30.427Z Found keys in authCfg:
|
|
23
|
-
2026-01-07T15:36:30.427Z Google Auth found!
|
|
24
|
-
2026-01-07T15:36:30.427Z google.antigravity found!
|
|
25
|
-
2026-01-07T15:36:30.427Z google.gemini found!
|
|
26
|
-
2026-01-07T15:36:30.678Z --- Auth Debug ---
|
|
27
|
-
2026-01-07T15:36:30.678Z Active Google Plugin:
|
|
28
|
-
2026-01-07T15:36:30.678Z Found keys in authCfg:
|
|
29
|
-
2026-01-07T15:36:30.678Z Google Auth found!
|
|
30
|
-
2026-01-07T15:36:30.678Z google.antigravity found!
|
|
31
|
-
2026-01-07T15:36:30.678Z google.gemini found!
|
|
32
|
-
2026-01-07T15:36:30.689Z --- Auth Debug ---
|
|
33
|
-
2026-01-07T15:36:30.689Z Active Google Plugin:
|
|
34
|
-
2026-01-07T15:36:30.689Z Found keys in authCfg:
|
|
35
|
-
2026-01-07T15:36:30.689Z Google Auth found!
|
|
36
|
-
2026-01-07T15:36:30.689Z google.antigravity found!
|
|
37
|
-
2026-01-07T15:36:30.689Z google.gemini found!
|
|
38
|
-
2026-01-07T15:36:33.413Z --- Auth Debug ---
|
|
39
|
-
2026-01-07T15:36:33.413Z Active Google Plugin:
|
|
40
|
-
2026-01-07T15:36:33.413Z Found keys in authCfg:
|
|
41
|
-
2026-01-07T15:36:33.413Z Google Auth found!
|
|
42
|
-
2026-01-07T15:36:33.413Z google.antigravity found!
|
|
43
|
-
2026-01-07T15:36:33.413Z google.gemini found!
|
|
44
|
-
2026-01-07T15:36:34.379Z --- Auth Debug ---
|
|
45
|
-
2026-01-07T15:36:34.379Z Active Google Plugin:
|
|
46
|
-
2026-01-07T15:36:34.379Z Found keys in authCfg:
|
|
47
|
-
2026-01-07T15:36:34.379Z Google Auth found!
|
|
48
|
-
2026-01-07T15:36:34.379Z google.antigravity found!
|
|
49
|
-
2026-01-07T15:36:34.379Z google.gemini found!
|
|
50
|
-
2026-01-07T15:36:35.818Z --- Auth Debug ---
|
|
51
|
-
2026-01-07T15:36:35.818Z Active Google Plugin:
|
|
52
|
-
2026-01-07T15:36:35.818Z Found keys in authCfg:
|
|
53
|
-
2026-01-07T15:36:35.818Z Google Auth found!
|
|
54
|
-
2026-01-07T15:36:35.818Z google.antigravity found!
|
|
55
|
-
2026-01-07T15:36:35.818Z google.gemini found!
|
|
56
|
-
2026-01-07T15:36:36.414Z --- Auth Debug ---
|
|
57
|
-
2026-01-07T15:36:36.414Z Active Google Plugin:
|
|
58
|
-
2026-01-07T15:36:36.414Z Found keys in authCfg:
|
|
59
|
-
2026-01-07T15:36:36.414Z Google Auth found!
|
|
60
|
-
2026-01-07T15:36:36.414Z google.antigravity found!
|
|
61
|
-
2026-01-07T15:36:36.414Z google.gemini found!
|
|
62
|
-
2026-01-07T15:36:37.377Z --- Auth Debug ---
|
|
63
|
-
2026-01-07T15:36:37.377Z Active Google Plugin:
|
|
64
|
-
2026-01-07T15:36:37.377Z Found keys in authCfg:
|
|
65
|
-
2026-01-07T15:36:37.377Z Google Auth found!
|
|
66
|
-
2026-01-07T15:36:37.377Z google.antigravity found!
|
|
67
|
-
2026-01-07T15:36:37.377Z google.gemini found!
|
|
68
|
-
2026-01-07T15:36:37.516Z --- Auth Debug ---
|
|
69
|
-
2026-01-07T15:36:37.516Z Active Google Plugin:
|
|
70
|
-
2026-01-07T15:36:37.516Z Found keys in authCfg:
|
|
71
|
-
2026-01-07T15:36:37.516Z Google Auth found!
|
|
72
|
-
2026-01-07T15:36:37.516Z google.antigravity found!
|
|
73
|
-
2026-01-07T15:36:37.516Z google.gemini found!
|
|
74
|
-
2026-01-07T15:36:39.413Z --- Auth Debug ---
|
|
75
|
-
2026-01-07T15:36:39.413Z Active Google Plugin:
|
|
76
|
-
2026-01-07T15:36:39.413Z Found keys in authCfg:
|
|
77
|
-
2026-01-07T15:36:39.413Z Google Auth found!
|
|
78
|
-
2026-01-07T15:36:39.413Z google.antigravity found!
|
|
79
|
-
2026-01-07T15:36:39.413Z google.gemini found!
|
|
80
|
-
2026-01-07T15:36:40.389Z --- Auth Debug ---
|
|
81
|
-
2026-01-07T15:36:40.390Z Active Google Plugin:
|
|
82
|
-
2026-01-07T15:36:40.390Z Found keys in authCfg:
|
|
83
|
-
2026-01-07T15:36:40.390Z Google Auth found!
|
|
84
|
-
2026-01-07T15:36:40.390Z google.antigravity found!
|
|
85
|
-
2026-01-07T15:36:40.390Z google.gemini found!
|
|
86
|
-
2026-01-07T15:36:41.870Z --- Auth Debug ---
|
|
87
|
-
2026-01-07T15:36:41.870Z Active Google Plugin:
|
|
88
|
-
2026-01-07T15:36:41.870Z Found keys in authCfg:
|
|
89
|
-
2026-01-07T15:36:41.870Z Google Auth found!
|
|
90
|
-
2026-01-07T15:36:41.870Z google.antigravity found!
|
|
91
|
-
2026-01-07T15:36:41.870Z google.gemini found!
|
|
92
|
-
2026-01-07T15:36:42.421Z --- Auth Debug ---
|
|
93
|
-
2026-01-07T15:36:42.421Z Active Google Plugin:
|
|
94
|
-
2026-01-07T15:36:42.421Z Found keys in authCfg:
|
|
95
|
-
2026-01-07T15:36:42.421Z Google Auth found!
|
|
96
|
-
2026-01-07T15:36:42.421Z google.antigravity found!
|
|
97
|
-
2026-01-07T15:36:42.421Z google.gemini found!
|
|
98
|
-
2026-01-07T15:36:43.390Z --- Auth Debug ---
|
|
99
|
-
2026-01-07T15:36:43.390Z Active Google Plugin:
|
|
100
|
-
2026-01-07T15:36:43.390Z Found keys in authCfg:
|
|
101
|
-
2026-01-07T15:36:43.390Z Google Auth found!
|
|
102
|
-
2026-01-07T15:36:43.390Z google.antigravity found!
|
|
103
|
-
2026-01-07T15:36:43.390Z google.gemini found!
|
|
104
|
-
2026-01-07T15:36:45.421Z --- Auth Debug ---
|
|
105
|
-
2026-01-07T15:36:45.421Z Active Google Plugin:
|
|
106
|
-
2026-01-07T15:36:45.421Z Found keys in authCfg:
|
|
107
|
-
2026-01-07T15:36:45.421Z Google Auth found!
|
|
108
|
-
2026-01-07T15:36:45.421Z google.antigravity found!
|
|
109
|
-
2026-01-07T15:36:45.421Z google.gemini found!
|
|
110
|
-
2026-01-07T15:36:46.391Z --- Auth Debug ---
|
|
111
|
-
2026-01-07T15:36:46.391Z Active Google Plugin:
|
|
112
|
-
2026-01-07T15:36:46.391Z Found keys in authCfg:
|
|
113
|
-
2026-01-07T15:36:46.391Z Google Auth found!
|
|
114
|
-
2026-01-07T15:36:46.391Z google.antigravity found!
|
|
115
|
-
2026-01-07T15:36:46.391Z google.gemini found!
|
|
116
|
-
2026-01-07T15:36:48.415Z --- Auth Debug ---
|
|
117
|
-
2026-01-07T15:36:48.415Z Active Google Plugin:
|
|
118
|
-
2026-01-07T15:36:48.415Z Found keys in authCfg:
|
|
119
|
-
2026-01-07T15:36:48.415Z Google Auth found!
|
|
120
|
-
2026-01-07T15:36:48.415Z google.antigravity found!
|
|
121
|
-
2026-01-07T15:36:48.415Z google.gemini found!
|
|
122
|
-
2026-01-07T15:36:49.382Z --- Auth Debug ---
|
|
123
|
-
2026-01-07T15:36:49.382Z Active Google Plugin:
|
|
124
|
-
2026-01-07T15:36:49.382Z Found keys in authCfg:
|
|
125
|
-
2026-01-07T15:36:49.382Z Google Auth found!
|
|
126
|
-
2026-01-07T15:36:49.382Z google.antigravity found!
|
|
127
|
-
2026-01-07T15:36:49.382Z google.gemini found!
|
|
128
|
-
2026-01-07T15:36:51.415Z --- Auth Debug ---
|
|
129
|
-
2026-01-07T15:36:51.415Z Active Google Plugin:
|
|
130
|
-
2026-01-07T15:36:51.415Z Found keys in authCfg:
|
|
131
|
-
2026-01-07T15:36:51.415Z Google Auth found!
|
|
132
|
-
2026-01-07T15:36:51.415Z google.antigravity found!
|
|
133
|
-
2026-01-07T15:36:51.415Z google.gemini found!
|
|
134
|
-
2026-01-07T15:36:52.413Z --- Auth Debug ---
|
|
135
|
-
2026-01-07T15:36:52.413Z Active Google Plugin:
|
|
136
|
-
2026-01-07T15:36:52.413Z Found keys in authCfg:
|
|
137
|
-
2026-01-07T15:36:52.413Z Google Auth found!
|
|
138
|
-
2026-01-07T15:36:52.413Z google.antigravity found!
|
|
139
|
-
2026-01-07T15:36:52.413Z google.gemini found!
|
|
140
|
-
2026-01-07T15:36:54.414Z --- Auth Debug ---
|
|
141
|
-
2026-01-07T15:36:54.414Z Active Google Plugin:
|
|
142
|
-
2026-01-07T15:36:54.414Z Found keys in authCfg:
|
|
143
|
-
2026-01-07T15:36:54.414Z Google Auth found!
|
|
144
|
-
2026-01-07T15:36:54.414Z google.antigravity found!
|
|
145
|
-
2026-01-07T15:36:54.414Z google.gemini found!
|
|
146
|
-
2026-01-07T15:36:57.421Z --- Auth Debug ---
|
|
147
|
-
2026-01-07T15:36:57.421Z Active Google Plugin:
|
|
148
|
-
2026-01-07T15:36:57.421Z Found keys in authCfg:
|
|
149
|
-
2026-01-07T15:36:57.421Z Google Auth found!
|
|
150
|
-
2026-01-07T15:36:57.421Z google.antigravity found!
|
|
151
|
-
2026-01-07T15:36:57.421Z google.gemini found!
|
|
152
|
-
2026-01-07T15:37:00.417Z --- Auth Debug ---
|
|
153
|
-
2026-01-07T15:37:00.417Z Active Google Plugin:
|
|
154
|
-
2026-01-07T15:37:00.417Z Found keys in authCfg:
|
|
155
|
-
2026-01-07T15:37:00.417Z Google Auth found!
|
|
156
|
-
2026-01-07T15:37:00.417Z google.antigravity found!
|
|
157
|
-
2026-01-07T15:37:00.417Z google.gemini found!
|
|
158
|
-
2026-01-07T15:37:03.421Z --- Auth Debug ---
|
|
159
|
-
2026-01-07T15:37:03.421Z Active Google Plugin:
|
|
160
|
-
2026-01-07T15:37:03.421Z Found keys in authCfg:
|
|
161
|
-
2026-01-07T15:37:03.421Z Google Auth found!
|
|
162
|
-
2026-01-07T15:37:03.421Z google.antigravity found!
|
|
163
|
-
2026-01-07T15:37:03.421Z google.gemini found!
|
|
164
|
-
2026-01-07T15:37:06.425Z --- Auth Debug ---
|
|
165
|
-
2026-01-07T15:37:06.426Z Active Google Plugin:
|
|
166
|
-
2026-01-07T15:37:06.426Z Found keys in authCfg:
|
|
167
|
-
2026-01-07T15:37:06.426Z Google Auth found!
|
|
168
|
-
2026-01-07T15:37:06.426Z google.antigravity found!
|
|
169
|
-
2026-01-07T15:37:06.426Z google.gemini found!
|
|
170
|
-
2026-01-07T15:37:09.415Z --- Auth Debug ---
|
|
171
|
-
2026-01-07T15:37:09.415Z Active Google Plugin:
|
|
172
|
-
2026-01-07T15:37:09.415Z Found keys in authCfg:
|
|
173
|
-
2026-01-07T15:37:09.415Z Google Auth found!
|
|
174
|
-
2026-01-07T15:37:09.415Z google.antigravity found!
|
|
175
|
-
2026-01-07T15:37:09.415Z google.gemini found!
|
|
176
|
-
2026-01-07T15:37:12.421Z --- Auth Debug ---
|
|
177
|
-
2026-01-07T15:37:12.421Z Active Google Plugin:
|
|
178
|
-
2026-01-07T15:37:12.421Z Found keys in authCfg:
|
|
179
|
-
2026-01-07T15:37:12.421Z Google Auth found!
|
|
180
|
-
2026-01-07T15:37:12.421Z google.antigravity found!
|
|
181
|
-
2026-01-07T15:37:12.421Z google.gemini found!
|
|
182
|
-
2026-01-07T15:37:15.417Z --- Auth Debug ---
|
|
183
|
-
2026-01-07T15:37:15.417Z Active Google Plugin:
|
|
184
|
-
2026-01-07T15:37:15.417Z Found keys in authCfg:
|
|
185
|
-
2026-01-07T15:37:15.417Z Google Auth found!
|
|
186
|
-
2026-01-07T15:37:15.417Z google.antigravity found!
|
|
187
|
-
2026-01-07T15:37:15.417Z google.gemini found!
|
|
188
|
-
2026-01-07T15:37:18.419Z --- Auth Debug ---
|
|
189
|
-
2026-01-07T15:37:18.419Z Active Google Plugin:
|
|
190
|
-
2026-01-07T15:37:18.419Z Found keys in authCfg:
|
|
191
|
-
2026-01-07T15:37:18.419Z Google Auth found!
|
|
192
|
-
2026-01-07T15:37:18.419Z google.antigravity found!
|
|
193
|
-
2026-01-07T15:37:18.419Z google.gemini found!
|
|
194
|
-
2026-01-07T15:37:21.415Z --- Auth Debug ---
|
|
195
|
-
2026-01-07T15:37:21.415Z Active Google Plugin:
|
|
196
|
-
2026-01-07T15:37:21.415Z Found keys in authCfg:
|
|
197
|
-
2026-01-07T15:37:21.415Z Google Auth found!
|
|
198
|
-
2026-01-07T15:37:21.415Z google.antigravity found!
|
|
199
|
-
2026-01-07T15:37:21.415Z google.gemini found!
|
|
200
|
-
2026-01-07T15:37:23.049Z Server file changed, exiting for restart...
|
|
201
|
-
2026-01-07T15:37:23.049Z Server file changed, exiting for restart...
|