opencode-studio-server 1.9.0 → 1.9.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/cli.js +7 -1
- package/index.js +6 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -127,4 +127,10 @@ if (shouldOpenBrowser) {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
// Start the server
|
|
130
|
-
require('./index.js');
|
|
130
|
+
const server = require('./index.js');
|
|
131
|
+
if (server.startServer) {
|
|
132
|
+
server.startServer();
|
|
133
|
+
} else {
|
|
134
|
+
// Fallback if not exported (should not happen with new version)
|
|
135
|
+
console.error('Failed to start server: startServer not found');
|
|
136
|
+
}
|
package/index.js
CHANGED
|
@@ -2817,13 +2817,18 @@ app.post('/api/presets/:id/apply', (req, res) => {
|
|
|
2817
2817
|
});
|
|
2818
2818
|
|
|
2819
2819
|
// Start watcher on server start
|
|
2820
|
-
|
|
2820
|
+
function startServer() {
|
|
2821
2821
|
setupLogWatcher();
|
|
2822
2822
|
importExistingAuth();
|
|
2823
2823
|
app.listen(PORT, () => console.log(`Server running at http://localhost:${PORT}`));
|
|
2824
2824
|
}
|
|
2825
2825
|
|
|
2826
|
+
if (require.main === module) {
|
|
2827
|
+
startServer();
|
|
2828
|
+
}
|
|
2829
|
+
|
|
2826
2830
|
module.exports = {
|
|
2831
|
+
startServer,
|
|
2827
2832
|
rotateAccount,
|
|
2828
2833
|
processLogLine,
|
|
2829
2834
|
loadPoolMetadata,
|