ropilot 0.1.24 → 0.1.25
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/lib/proxy.js +22 -0
- package/package.json +1 -1
package/lib/proxy.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
9
9
|
import { join } from 'path';
|
|
10
10
|
import { homedir } from 'os';
|
|
11
|
+
import { spawn } from 'child_process';
|
|
11
12
|
import { getApiKey, EDGE_URL, loadGlobalConfig, saveGlobalConfig } from './config.js';
|
|
12
13
|
|
|
13
14
|
// Plugin version check URL (served from ropilot.ai main server)
|
|
@@ -111,6 +112,24 @@ async function processRequest(apiKey, request) {
|
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Run update in background (non-blocking)
|
|
117
|
+
* Claude/Cursor spawn MCP servers from the project root, so process.cwd() is correct
|
|
118
|
+
*/
|
|
119
|
+
function runBackgroundUpdate() {
|
|
120
|
+
try {
|
|
121
|
+
const child = spawn('npx', ['ropilot', 'update'], {
|
|
122
|
+
cwd: process.cwd(),
|
|
123
|
+
detached: true,
|
|
124
|
+
stdio: 'ignore',
|
|
125
|
+
shell: true
|
|
126
|
+
});
|
|
127
|
+
child.unref();
|
|
128
|
+
} catch (err) {
|
|
129
|
+
// Silently ignore - update is not critical
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
114
133
|
/**
|
|
115
134
|
* Check for plugin updates (runs in background, writes to stderr)
|
|
116
135
|
*/
|
|
@@ -161,6 +180,9 @@ export async function serve() {
|
|
|
161
180
|
process.exit(1);
|
|
162
181
|
}
|
|
163
182
|
|
|
183
|
+
// Run update in background (non-blocking) - keeps prompts fresh
|
|
184
|
+
runBackgroundUpdate();
|
|
185
|
+
|
|
164
186
|
// Check for plugin updates in background (non-blocking)
|
|
165
187
|
checkPluginUpdate();
|
|
166
188
|
|