opencode-pollinations-plugin 6.0.0-beta.21 → 6.0.0-beta.22
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/dist/index.js +6 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17,13 +17,12 @@ function log(msg) {
|
|
|
17
17
|
}
|
|
18
18
|
// === PROXY SERVER (Singleton with Fixed Port) ===
|
|
19
19
|
const DEFAULT_PORT = 18888;
|
|
20
|
-
|
|
21
|
-
let existingPort = 0;
|
|
20
|
+
const GLOBAL_SERVER_KEY = '__POLLINATIONS_PROXY_SERVER__';
|
|
22
21
|
const startProxy = () => {
|
|
23
|
-
//
|
|
24
|
-
if (
|
|
25
|
-
log(`[Proxy] Reusing existing server on port ${
|
|
26
|
-
return Promise.resolve(
|
|
22
|
+
// Check if server exists in global scope (survives module reloads)
|
|
23
|
+
if (global[GLOBAL_SERVER_KEY]) {
|
|
24
|
+
log(`[Proxy] Reusing existing global server on port ${DEFAULT_PORT}`);
|
|
25
|
+
return Promise.resolve(DEFAULT_PORT);
|
|
27
26
|
}
|
|
28
27
|
return new Promise((resolve) => {
|
|
29
28
|
const server = http.createServer(async (req, res) => {
|
|
@@ -73,8 +72,7 @@ const startProxy = () => {
|
|
|
73
72
|
server.listen(port, '127.0.0.1', () => {
|
|
74
73
|
// @ts-ignore
|
|
75
74
|
const assignedPort = server.address().port;
|
|
76
|
-
|
|
77
|
-
existingPort = assignedPort;
|
|
75
|
+
global[GLOBAL_SERVER_KEY] = server;
|
|
78
76
|
log(`[Proxy] Started v${require('../package.json').version} on port ${assignedPort}${port === 0 ? ' (dynamic fallback)' : ''}`);
|
|
79
77
|
resolve(assignedPort);
|
|
80
78
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-pollinations-plugin",
|
|
3
3
|
"displayName": "Pollinations AI (V5.6)",
|
|
4
|
-
"version": "6.0.0-beta.
|
|
4
|
+
"version": "6.0.0-beta.22",
|
|
5
5
|
"description": "Native Pollinations.ai Provider Plugin for OpenCode",
|
|
6
6
|
"publisher": "pollinations",
|
|
7
7
|
"repository": {
|