opencode-pollinations-plugin 5.4.15 → 5.4.17

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🌸 Pollinations AI Plugin for OpenCode (v5.4.8)
1
+ # 🌸 Pollinations AI Plugin for OpenCode (v5.4.16)
2
2
 
3
3
  <div align="center">
4
4
  <img src="https://avatars.githubusercontent.com/u/88394740?s=400&v=4" alt="Pollinations.ai Logo" width="200">
@@ -10,7 +10,7 @@
10
10
 
11
11
  <div align="center">
12
12
 
13
- ![Version](https://img.shields.io/badge/version-5.4.8-blue.svg)
13
+ ![Version](https://img.shields.io/badge/version-5.4.16-blue.svg)
14
14
  ![License](https://img.shields.io/badge/license-MIT-green.svg)
15
15
  ![Status](https://img.shields.io/badge/status-Stable-success.svg)
16
16
 
@@ -46,14 +46,14 @@ Pollinations.ai is an open-source platform built by and for the community. We pr
46
46
  </p>
47
47
 
48
48
  <p align="center">
49
- <img src="docs/images/free_add.png" alt="Free Chat Example" width="800">
49
+ <img src="https://github.com/fkom13/opencode-pollinations-plugin/raw/main/docs/images/free_add.png" alt="Free Chat Example" width="800">
50
50
  <br>
51
51
  <em>Free Universe Chat (Supported by Pollinations Ads)</em>
52
52
  </p>
53
53
 
54
54
  <p align="center">
55
- <img src="docs/images/plan_1.png" alt="Plan Build Step 1" width="400">
56
- <img src="docs/images/plan_2.png" alt="Plan Build Step 2" width="400">
55
+ <img src="https://github.com/fkom13/opencode-pollinations-plugin/raw/main/docs/images/plan_1.png" alt="Plan Build Step 1" width="400">
56
+ <img src="https://github.com/fkom13/opencode-pollinations-plugin/raw/main/docs/images/plan_2.png" alt="Plan Build Step 2" width="400">
57
57
  <br>
58
58
  <em>Integrated Plan Building Workflow</em>
59
59
  </p>
package/dist/index.js CHANGED
@@ -6,6 +6,8 @@ import { handleChatCompletion } from './server/proxy.js';
6
6
  import { createToastHooks, setGlobalClient } from './server/toast.js';
7
7
  import { createStatusHooks } from './server/status.js';
8
8
  import { createCommandHooks } from './server/commands.js';
9
+ import { createRequire } from 'module';
10
+ const require = createRequire(import.meta.url);
9
11
  const LOG_FILE = '/tmp/opencode_pollinations_v4.log';
10
12
  function log(msg) {
11
13
  try {
@@ -94,9 +96,11 @@ export const PollinationsPlugin = async (ctx) => {
94
96
  }
95
97
  if (!config.provider)
96
98
  config.provider = {};
99
+ // Dynamic Provider Name
100
+ const version = require('../package.json').version;
97
101
  config.provider['pollinations'] = {
98
102
  id: 'pollinations',
99
- name: 'Pollinations V5.2 (Native)',
103
+ name: `Pollinations AI (v${version})`,
100
104
  options: { baseURL: localBaseUrl },
101
105
  models: modelsObj
102
106
  };
@@ -226,7 +226,7 @@ async function handleConnectCommand(args) {
226
226
  const enterpriseModels = models.filter(m => m.id.startsWith('enter/'));
227
227
  if (enterpriseModels.length > 0) {
228
228
  // SUCCESS
229
- saveConfig({ apiKey: key, mode: 'pro' });
229
+ saveConfig({ apiKey: key }); // Don't force mode 'pro'. Let user decide.
230
230
  const masked = key.substring(0, 6) + '...';
231
231
  // Count Paid Only models found
232
232
  const diamondCount = enterpriseModels.filter(m => m.name.includes('💎')).length;
@@ -128,14 +128,16 @@ function readConfigFromDisk() {
128
128
  // 4. APPLY
129
129
  if (finalKey) {
130
130
  config.apiKey = finalKey;
131
- config.mode = 'pro';
132
- // logConfig(`Loaded Key from ${source}`); // Debug
131
+ // config.mode = 'pro'; // REMOVED: Mode is decoupled from Key presence.
133
132
  }
134
133
  else {
135
134
  // Ensure no phantom key remains
136
135
  delete config.apiKey;
137
- if (config.mode === 'pro')
138
- config.mode = 'manual';
136
+ // if (config.mode === 'pro') config.mode = 'manual'; // OPTIONAL: Downgrade if no key? User says "No link".
137
+ // Actually, if I am in PRO mode and lose my key, I am broken. Falling back to manual is safer?
138
+ // User said "Manual mode is like standard API".
139
+ // Let's REMOVE this auto-downgrade too to be strictly "Decoupled".
140
+ // If user is in PRO without key, they get "Missing Key" error, which is correct.
139
141
  }
140
142
  return { ...config, version: PKG_VERSION };
141
143
  }
@@ -85,11 +85,11 @@ export async function generatePollinationsConfig(forceApiKey, forceStrict = fals
85
85
  log(`[ConfigGen] Force-injecting free/gemini.`);
86
86
  modelsOutput.push({ id: "free/gemini", name: "[Free] Gemini Flash (Force)", object: "model", variants: {} });
87
87
  }
88
- // ALIAS for Full ID matching (Fix ProviderModelNotFoundError) - ALWAYS CHECK SEPARATELY
89
- const hasGeminiAlias = modelsOutput.find(m => m.id === 'pollinations/free/gemini');
90
- if (!hasGeminiAlias) {
91
- modelsOutput.push({ id: "pollinations/free/gemini", name: "[Free] Gemini Flash (Alias)", object: "model", variants: {} });
92
- }
88
+ // ALIAS Removed for Clean Config
89
+ // const hasGeminiAlias = modelsOutput.find(m => m.id === 'pollinations/free/gemini');
90
+ // if (!hasGeminiAlias) {
91
+ // modelsOutput.push({ id: "pollinations/free/gemini", name: "[Free] Gemini Flash (Alias)", object: "model", variants: {} });
92
+ // }
93
93
  // 2. ENTERPRISE UNIVERSE
94
94
  if (effectiveKey && effectiveKey.length > 5 && effectiveKey !== 'dummy') {
95
95
  try {
@@ -0,0 +1,9 @@
1
+ import { createRequire } from 'module';
2
+ const require = createRequire(import.meta.url);
3
+ try {
4
+ const pkg = require('../package.json');
5
+ console.log("SUCCESS: Loaded version " + pkg.version);
6
+ } catch (e) {
7
+ console.error("FAILURE:", e.message);
8
+ process.exit(1);
9
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-pollinations-plugin",
3
3
  "displayName": "Pollinations AI (V5.1)",
4
- "version": "5.4.15",
4
+ "version": "5.4.17",
5
5
  "description": "Native Pollinations.ai Provider Plugin for OpenCode",
6
6
  "publisher": "pollinations",
7
7
  "repository": {