opencode-pollinations-plugin 5.8.0 → 5.8.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.
@@ -19,9 +19,14 @@ function log(msg) {
19
19
  // Force output to stderr for CLI visibility if needed, but clean.
20
20
  }
21
21
  // Fetch Helper
22
+ // Fetch Helper
22
23
  function fetchJson(url, headers = {}) {
23
24
  return new Promise((resolve, reject) => {
24
- const req = https.get(url, { headers }, (res) => {
25
+ const finalHeaders = {
26
+ ...headers,
27
+ 'User-Agent': 'Mozilla/5.0 (compatible; OpenCode/5.8.1; +https://opencode.ai)'
28
+ };
29
+ const req = https.get(url, { headers: finalHeaders }, (res) => {
25
30
  let data = '';
26
31
  res.on('data', chunk => data += chunk);
27
32
  res.on('end', () => {
@@ -39,7 +44,7 @@ function fetchJson(url, headers = {}) {
39
44
  log(`Network Error for ${url}: ${e.message}`);
40
45
  reject(e);
41
46
  });
42
- req.setTimeout(5000, () => {
47
+ req.setTimeout(15000, () => {
43
48
  req.destroy();
44
49
  reject(new Error('Timeout'));
45
50
  });
@@ -53,11 +58,10 @@ function formatName(id, censored = true) {
53
58
  return clean;
54
59
  }
55
60
  // --- MAIN GENERATOR logic ---
56
- // --- MAIN GENERATOR logic ---
57
61
  export async function generatePollinationsConfig(forceApiKey, forceStrict = false) {
58
62
  const config = loadConfig();
59
63
  const modelsOutput = [];
60
- log(`Starting Configuration (V5.1.22 Hot-Reload)...`);
64
+ log(`Starting Configuration (v5.8.1)...`);
61
65
  // Use forced key (from Hook) or cached key
62
66
  const effectiveKey = forceApiKey || config.apiKey;
63
67
  // 1. FREE UNIVERSE
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": "5.8.0",
4
+ "version": "5.8.1",
5
5
  "description": "Native Pollinations.ai Provider Plugin for OpenCode",
6
6
  "publisher": "pollinations",
7
7
  "repository": {