opencode-pollinations-plugin 6.1.0-beta.11 β†’ 6.1.0-beta.12

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.
Files changed (2) hide show
  1. package/README.md +278 -156
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,172 +1,294 @@
1
- # 🌸 Pollinations AI Plugin for OpenCode (v6.1-beta)
1
+ # 🌸 Pollinations AI Plugin for OpenCode
2
2
 
3
3
  <div align="center">
4
- <img src="https://avatars.githubusercontent.com/u/88394740?s=400&v=4" alt="Pollinations.ai Logo" width="200">
5
- <br>
6
- <b>The Bridge between OpenCode and the Pollinations.ai Ecosystem.</b>
7
- <br>
8
- Access unlimited free AI models or premium enterprise models directly within your editor.
9
- </div>
10
-
11
- <div align="center">
12
-
13
- ![Version](https://img.shields.io/badge/version-6.1.0--beta.10-blue.svg)
4
+ <img src="https://avatars.githubusercontent.com/u/88394740?s=400&v=4" alt="Pollinations.ai Logo" width="180">
5
+ <br><br>
6
+ <b>The most complete bridge between OpenCode and the Pollinations.ai ecosystem.</b><br>
7
+ Free AI models, multimodal generation, and smart quota management β€” directly in your editor.
8
+ <br><br>
9
+
10
+ ![Version](https://img.shields.io/badge/version-6.1.0--beta-blue.svg)
11
+ ![Downloads](https://img.shields.io/npm/dt/opencode-pollinations-plugin?label=downloads&color=brightgreen)
14
12
  ![License](https://img.shields.io/badge/license-MIT-green.svg)
15
13
  ![Status](https://img.shields.io/badge/status-Beta-orange.svg)
14
+ ![OpenCode](https://img.shields.io/badge/OpenCode-Plugin-purple.svg)
16
15
 
17
16
  </div>
18
17
 
19
- ## πŸ“– Philosophy: Open AI for Creators
18
+ ---
20
19
 
21
20
  > **"No closed doors, no corporate hoops β€” just good tools and good people."**
21
+ >
22
+ > Pollinations.ai is an open-source platform built by and for the creative community. This plugin brings it entirely inside OpenCode: text, image, audio, video, music, diagrams, and more β€” with a transparent fallback system that means you're *never* blocked.
23
+
24
+ ---
25
+
26
+ ## ✨ What's New in v6.1-beta
27
+
28
+ The jump from v5.9 to v6.1 is not incremental. The plugin has grown from a smart proxy into a **full multimodal agent toolkit**:
29
+
30
+ - **15+ native tools** for generation, design, and media processing β€” usable directly in OpenCode's agent mode
31
+ - **Ledger quota system**: local `~/.pollinations/usage_history.json` tracking for 100% accurate usage with zero lag
32
+ - **Stealth notifications**: status toasts now only fire in relevant contexts, no more noise
33
+ - **Background removal** with multi-key rotation and automatic fallback to free provider
34
+ - **Video, music, audio generation** via the Pollinations API
35
+ - **Web search + scraping** integrated as agent tools
36
+
37
+ ---
38
+
39
+ ## πŸš€ Quick Start
40
+
41
+ ```bash
42
+ # Install globally
43
+ npm install -g opencode-pollinations-plugin
44
+ ```
45
+
46
+ Then in OpenCode:
47
+ ```
48
+ /connect
49
+ ```
50
+ Select **pollinations** β†’ Enter your API key from [enter.pollinations.ai](https://enter.pollinations.ai), or leave blank to use the free tier.
51
+
52
+ Select any `pollinations/*` model and start chatting. **No key required to get started.**
53
+
54
+ > ⚠️ After connecting a new key, restart OpenCode once for the model list to update.
55
+
56
+ ---
57
+
58
+ ## 🌐 Free Universe β€” No Key Required
59
+
60
+ Access a wide range of models with **zero setup**, supported by Pollinations' ad model:
61
+
62
+ | Model | Speed | Context | Notes |
63
+ |-------|:-----:|:-------:|-------|
64
+ | `openai` / `openai-large` | Fast | 128k | GPT-4o class |
65
+ | `gemini` / `gemini-search` | Fast | 1M | Google Gemini |
66
+ | `mistral` / `qwen-coder` | Fast | 32k | Code-focused |
67
+ | `nova-fast` / `grok` | Very Fast | 32k | Quick tasks |
68
+ | `deepseek` / `kimi` | Medium | 128k | Reasoning |
69
+
70
+ > πŸ’‘ Using Gemini with tool calls? The plugin auto-detects incompatibilities and transparently falls back to OpenAI β€” your workflow never breaks.
71
+
72
+ ---
73
+
74
+ ## πŸ’Ž Pro Mode β€” Unlock Premium Models
75
+
76
+ Connect your [Pollinations API key](https://enter.pollinations.ai) to access enterprise-grade models charged in **Pollen** (the unified credit, ~$1 = 1 Pollen):
77
+
78
+ | Model | Provider | Notes |
79
+ |-------|----------|-------|
80
+ | `claude` / `claude-large` | Anthropic | Requires wallet credits |
81
+ | `gemini-large` | Google | Requires wallet credits |
82
+ | `gpt-4o` / `openai-large` | OpenAI | Daily grant available |
83
+ | `deepseek-coder` | DeepSeek | Daily grant available |
84
+
85
+ ### πŸ›‘οΈ Safety Net β€” You're Never Blocked
86
+
87
+ If your quota or wallet runs low mid-session, the plugin switches automatically to a free model, injects a visible warning in the response stream, and continues. No errors. No broken sessions.
88
+
89
+ ---
90
+
91
+ ## πŸ”§ Agent Tools (v6.1 β€” New)
92
+
93
+ When OpenCode uses the plugin in agent mode, it gets access to a rich toolbox organized in three categories:
94
+
95
+ ### 🎨 Pollinations Generation Tools
96
+
97
+ These tools call the Pollinations APIs directly, enabling the AI to generate media as part of its reasoning:
98
+
99
+ | Tool | Description |
100
+ |------|-------------|
101
+ | `gen_image` | Generate images from a text prompt (Flux, SDXL, etc.) |
102
+ | `gen_audio` | Generate speech or sound effects |
103
+ | `gen_music` | Generate music from a description |
104
+ | `gen_video` | Generate short video clips |
105
+ | `transcribe_audio` | Transcribe an audio file to text |
106
+ | `deepsearch` | Multi-step AI-powered research |
107
+ | `search_crawl_scrape` | Web search with full page scraping |
108
+
109
+ ### πŸ–ŒοΈ Design Tools
110
+
111
+ | Tool | Description |
112
+ |------|-------------|
113
+ | `gen_diagram` | Generate diagrams (flowcharts, architecture, etc.) |
114
+ | `gen_palette` | Create color palettes from a description or image |
115
+ | `gen_qrcode` | Generate styled QR codes |
116
+
117
+ ### ⚑ Power Tools
118
+
119
+ | Tool | Description |
120
+ |------|-------------|
121
+ | `remove_background` | Remove image backgrounds (free or BackgroundCut HD) |
122
+ | `rmbg_keys` | Manage BackgroundCut API keys with rotation |
123
+ | `extract_audio` | Extract the audio track from a video file |
124
+ | `extract_frames` | Extract frames from a video at a given interval |
125
+ | `file_to_url` | Upload a local file and return a public URL |
22
126
 
23
- Pollinations.ai is an open-source platform built by and for the community. We provide a unified API for image, text, audio, and video generation.
24
- - **Transparent**: Our code, roadmap, and discussions are open.
25
- - **Community Driven**: Features are prioritized based on what *you* need.
26
- - **Fair**: One single currency (**Pollen**) for all models. No complex subscriptions.
27
-
28
- ## πŸ“Έ Gallery
29
-
30
- <p align="center">
31
- <img src="https://github.com/fkom13/opencode-pollinations-plugin/raw/main/docs/images/connect.png" alt="Connect Command" width="800">
32
- <br>
33
- <em>Easy Connection with /connect or /pollinations config apiKey</em>
34
- </p>
35
-
36
- <p align="center">
37
- <img src="https://github.com/fkom13/opencode-pollinations-plugin/raw/main/docs/images/usage_dashboard.png" alt="Usage Dashboard" width="800">
38
- <br>
39
- <em>Integrated Usage Dashboard (/pollinations usage)</em>
40
- </p>
41
-
42
- <p align="center">
43
- <img src="https://github.com/fkom13/opencode-pollinations-plugin/raw/main/docs/images/models.png" alt="Models" width="800">
44
- <br>
45
- <em>Wide Range of Models (Mistral, OpenAI, Gemini, Claude)</em>
46
- </p>
47
-
48
- <p align="center">
49
- <img src="https://github.com/fkom13/opencode-pollinations-plugin/raw/main/docs/images/free_add.png" alt="Free Chat Example" width="800">
50
- <br>
51
- <em>Free Universe Chat (Supported by Pollinations Ads)</em>
52
- </p>
53
-
54
- <p align="center">
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
- <br>
58
- <em>Integrated Plan Building Workflow</em>
59
- </p>
60
-
61
- ## ✨ Features
62
-
63
- - **🌍 Free Universe**: Access generic models (`openai`, `mistral`, `gemini`) for **FREE**, unlimited time, no API key required.
64
- - **πŸ›‘οΈ Robust Quota System (New v6.1)**: Local "Ledger" technology (`~/.pollinations/usage_history.json`) ensures 100% accurate usage tracking, zero lag, and no wallet drain.
65
- - **πŸš€ Pro Mode**: Connect your Pollinations API Key to access Premium Models (`claude-3-opus`, `gpt-4o`, `deepseek-coder`).
66
- - **πŸ” Limited Key Support**: Use keys restricted to "Generation Only". The plugin automatically disables Advanced Features (Dashboard/Quota) but allows full generation in Manual Mode.
67
- - **πŸ›‘οΈ Safety Net V5**: never get blocked.
68
- - **Transparent Fallback**: If your Pro quota runs out mid-chat, the plugin automatically switches to a free model instantly. No errors, just a seamless experience.
69
- - **Smart Mode Switching**: Prevents Limited Keys from entering "Pro" mode to avoid confusing errors.
70
- - **πŸ“Š Real-time Dashboard**: Track your **Pollen** usage, Tier Status, and Wallet Balance inside OpenCode.
71
- - **πŸ”‡ Stealth Mode**: Status notifications are now strictly limited to Pollinations Enter (Paid) sessions. No more cluttered notifications when using other providers like Nvidia or Google AI.
72
-
73
- ### πŸ“š Documentation
74
-
75
- - **[User Manual](docs/technical/manual.md)**
76
- - **[API Reference](docs/technical/api_reference.md)**
77
- - **[Architecture](docs/technical/architecture.md)**
78
-
79
- ## 🐝 Understanding Pollen & Tiers
80
-
81
- **Pollen** is our unified credit system. $1 β‰ˆ 1 Pollen.
82
- You spend it to verify API calls on premium models.
83
-
84
- ### Tiers (Free Daily Grants during Beta)
85
-
86
- | Tier | Grant | Requirement |
87
- | :--- | :--- | :--- |
88
- | **🦠 Spore** | **1 Pollen/day** | Just Sign Up! |
89
- | **🌱 Seed** | **3 Pollen/day** | Active GitHub Developer (8+ points) |
90
- | **🌸 Flower** | **10 Pollen/day** | **Publish an App** (Like this Plugin!) |
91
- | **🍯 Nectar** | **20 Pollen/day** | Major Contributors (Coming Soon) |
92
-
93
- > 🎁 **Beta Bonus**: Buy one Pollen pack, get one free!
94
-
95
- ### 🐧 Platform Support & Dynamic Ports (v5.4.6+)
96
- This plugin is **true Cross-Platform** (Windows, macOS, Linux).
97
- - **Dynamic Port Allocation**: No more port conflicts! The plugin automatically finds an available port on startup.
98
- - **Tools Support**: Using tools with Gemini (Free) triggers an **Automatic Intelligent Fallback** to OpenAI to ensure your workflow never breaks.
99
-
100
- > **Note**: Legacy static port (10001) logic has been replaced with system-assigned ports (0). This eliminates "Address in use" errors and effectively removes the need for Linux-specific `fuser` commands, making the plugin fully **Cross-Platform**.
101
-
102
- This plugin is part of the **OpenCode Ecosystem**.
103
-
104
- ### Option 1: NPM (Instant Setup) (Recommended)
105
- This method automatically configures OpenCode to load the plugin.
106
-
107
- 1. Install global:
108
- ```bash
109
- npm install -g opencode-pollinations-plugin
110
- ```
111
- 2. Run the Auto-Setup (Magic):
112
- ```bash
113
- npx opencode-pollinations-plugin
114
- ```
115
- *This detects your OpenCode config and injects the plugin path automatically.*
116
-
117
- ### Option 2: Manual Configuration
118
- 1. Install globally as above.
119
- 2. Edit `~/.config/opencode/opencode.json`:
120
- ```json
121
- {
122
- "plugin": [
123
- "opencode-pollinations-plugin"
124
- ]
125
- }
126
- ```
127
- *Note: If OpenCode fails to find it, use the absolute path to the global install.*
128
-
129
- ## πŸš€ Publication (The "Registry")
130
- OpenCode uses NPM as its registry. To publish:
131
-
132
- 1. **Publish to NPM**:
133
- ```bash
134
- npm login
135
- npm publish
136
- ```
137
- 2. **Join Ecosystem**: Submit a Pull Request to [OpenCode Ecosystem](https://github.com/opencode-ai/ecosystem) to list your plugin officially.
138
- *Once accepted, users can find it via documentation or future registry commands.*
139
-
140
- ## πŸš€ Getting Started
141
-
142
- ### 1. The Basics (Free Mode)
143
- Just type in the chat. You are in **Manual Mode** by default.
144
- - Model: `openai-fast` (GPT-OSS 20b)
145
- - Model: `mistral` (Mistral Small 3.1)
146
- - ...
147
-
148
- ### πŸ”‘ Configuration (API Key)
149
-
150
- 1. Run the setup command:
151
- ```bash
152
- /connect
153
- ```
154
- 2. Choose "pollinations" and enter your key if you have one (or leave blank for free tier).
155
- 3. **IMPORTANT**: You must **restart OpenCode** for the model list to update with your new tier (e.g. to see Paid models).
156
-
157
- ### πŸ€– Models
158
-
159
- ### πŸ”‘ Types de ClΓ©s SupportΓ©s
160
- - **Clés Standard (`sk-...`)**: Accès complet (Modèles + Dashboard Usage + Quota).
161
- - **Clés Limitées**: Accès Génération uniquement. Le dashboard affichera une alerte de restriction.
162
- - **Support Legacy**: Les anciennes clΓ©s (`sk_...`) sont aussi acceptΓ©es.
127
+ > **Background Removal** supports multi-key rotation: if one BackgroundCut key is exhausted or rate-limited, the plugin automatically rotates to the next available key, then falls back to the free provider if all keys fail.
128
+
129
+ ---
130
+
131
+ ## πŸ‘οΈ Vision Support
132
+
133
+ Paste images directly into the chat or use an image URL. The plugin handles encoding automatically.
134
+
135
+ | Model | Vision | Reasoning | Tools |
136
+ |-------|:------:|:---------:|:-----:|
137
+ | `openai` / `openai-large` | βœ… | β€” | βœ… |
138
+ | `gemini` / `gemini-search` | βœ… | β€” | βœ… |
139
+ | `claude` / `claude-large` | βœ… | β€” | βœ… |
140
+ | `kimi` | βœ… | βœ… | β€” |
141
+ | `openai-audio` | βœ… | β€” | βœ… |
142
+
143
+ ---
144
+
145
+ ## πŸ’° Understanding Pollen & Tiers
146
+
147
+ **Pollen** is Pollinations' unified credit system. **$1 β‰ˆ 1 Pollen.**
148
+
149
+ Every registered user receives a **daily Pollen grant** based on their tier:
150
+
151
+ | Tier | Daily Grant | Requirement |
152
+ |:-----|:------------|:------------|
153
+ | 🦠 **Microbe** | 0.1 Pollen | Flagged accounts |
154
+ | 🌱 **Spore** | 1 Pollen | Sign up |
155
+ | 🌿 **Seed** | 3 Pollen | Active GitHub dev (8+ points) |
156
+ | 🌸 **Flower** | 10 Pollen | Published app |
157
+ | 🍯 **Nectar** | 20 Pollen | Major contributor |
158
+
159
+ > 🌸 Publishing this plugin to the OpenCode ecosystem earned its author **Flower** tier (10 Pollen/day). [Register here to claim yours.](https://enter.pollinations.ai)
160
+
161
+ Certain models (`claude-large`, `gemini-large`, `veo`, `seedream-pro`) are **Paid-Only**: they require wallet credits on top of (or instead of) daily grants.
162
+
163
+ ---
164
+
165
+ ## πŸ“Š Commands
166
+
167
+ ```
168
+ /pollinations usage # View Pollen balance + tier status
169
+ /pollinations usage full # Detailed per-model breakdown
170
+ /pollinations mode [manual|alwaysfree|pro] # Change routing mode
171
+ /pollinations status # Plugin health check
172
+ /pollinations config [key] [value] # Read or write config values
173
+ /pollinations fallback <main> [agent] # Configure fallback models
174
+ /pollinations help # Full command reference
175
+ ```
176
+
177
+ Aliases: `/poll` works as a shorthand for all commands.
178
+
179
+ ### Config Keys
180
+
181
+ | Key | Values | Description |
182
+ |-----|--------|-------------|
183
+ | `status_gui` | `none` / `alert` / `all` | Toast verbosity |
184
+ | `logs_gui` | `none` / `error` / `verbose` | Technical log verbosity |
185
+ | `threshold_tier` | `0-100` | Alert threshold for tier (%) |
186
+ | `threshold_wallet` | `0-100` | Safety Net trigger ($) |
187
+ | `status_bar` | `true` / `false` | Status bar widget |
188
+
189
+ ---
190
+
191
+ ## πŸ”‘ API Key Types
192
+
193
+ | Type | Access |
194
+ |------|--------|
195
+ | **Standard (`pk_...`)** | Full access: models, usage dashboard, quota |
196
+ | **Limited** | Generation only. Dashboard shows a restriction alert. The plugin auto-switches to Manual mode to avoid quota errors. |
197
+ | **Legacy (`sk_...`)** | Accepted for backward compatibility |
198
+
199
+ ---
200
+
201
+ ## πŸ› οΈ Routing Modes
202
+
203
+ | Mode | Behavior |
204
+ |------|----------|
205
+ | `manual` | You choose the model, no automatic switching |
206
+ | `alwaysfree` | Only free models, never charges Pollen |
207
+ | `pro` | Enterprise models with automatic free fallback when quota/wallet is low |
208
+
209
+ ---
210
+
211
+ ## πŸ—οΈ Architecture (Summary)
212
+
213
+ The plugin runs a **local HTTP proxy** on a dynamically assigned port (system port 0 β€” no conflicts, cross-platform). OpenCode points its `pollinations` provider at this proxy. The proxy reads your config, checks quota, applies model-specific sanitizations, and forwards requests to the correct Pollinations endpoint.
214
+
215
+ ```
216
+ OpenCode TUI
217
+ β”‚ POST /v1/chat/completions
218
+ β–Ό
219
+ Local Proxy (Dynamic Port)
220
+ β”œβ”€β”€ Safety Net Logic (quota check, fallback)
221
+ β”œβ”€β”€ Model Sanitization (Azure/Vertex/Gemini/Kimi)
222
+ └── Route to:
223
+ β”œβ”€β”€ text.pollinations.ai (Free Universe)
224
+ └── gen.pollinations.ai (Enterprise Universe)
225
+ ```
226
+
227
+ Config is read from (highest priority first):
228
+ 1. `~/.pollinations/config.json`
229
+ 2. `~/.local/share/opencode/auth.json`
230
+ 3. `~/.config/opencode/opencode.json`
231
+
232
+ ---
233
+
234
+ ## πŸ—ΊοΈ Roadmap
235
+
236
+ ### βœ… Shipped (v5.x β†’ v6.1-beta)
237
+ - Free + Enterprise proxy with transparent fallback (Safety Net)
238
+ - Dynamic port allocation β€” cross-platform (no more `fuser`, no port conflicts)
239
+ - Pollen/tier quota tracking with local Ledger
240
+ - Agent tools: image, audio, music, video generation
241
+ - Agent tools: web search, scraping, deep research
242
+ - Design tools: diagrams, palettes, QR codes
243
+ - Power tools: background removal with key rotation, frame/audio extraction
244
+ - Stealth notification mode (toasts only in relevant sessions)
245
+ - Limited-key support with automatic mode switching
246
+ - Gemini tools auto-fallback to OpenAI
247
+ - Enterprise schema sanitization (Azure, Vertex, Bedrock, Kimi)
248
+
249
+ ### πŸ”œ Next (v6.2 β€” v6.5, 2026)
250
+ - **Config file watcher** β€” hot-reload without restarting OpenCode
251
+ - **Signature map rotation** β€” LRU eviction to prevent unbounded memory growth
252
+ - **Unit tests** β€” coverage for `proxy.ts`, `quota.ts`, `tools/`
253
+ - **`/poll status` one-liner** β€” faster than opening the dashboard
254
+ - **Structured logging** β€” JSON format, configurable log levels, log rotation
255
+ - **Model search** β€” `/poll models <query>` to filter the model list
256
+
257
+ ### πŸ”­ Longer Term (v7.0+, 2027)
258
+ - **Smart Router** β€” cost-aware and latency-aware model selection
259
+ - **Multi-provider failover** β€” fallback to OpenRouter if Pollinations is unreachable
260
+ - **Web Dashboard** β€” browser UI for monitoring, config, and analytics
261
+ - **Team features** β€” shared quotas and API keys
262
+ - **Persistent memory** β€” vector DB integration for long-running agents
263
+
264
+ > Community ideas with the most votes: API usage alerts, conversation export (Markdown/JSON), model comparison mode. Open an issue to vote!
265
+
266
+ ---
267
+
268
+ ## 🀝 Contributing
269
+
270
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions, code guidelines, and priority areas (testing, docs, i18n, DevOps).
271
+
272
+ ### Areas Where Help Is Needed
273
+ - πŸ§ͺ **Testing** β€” Unit + integration tests for the proxy and tools
274
+ - πŸ“š **Docs** β€” User guides, tool examples
275
+ - 🌍 **i18n** β€” French/English consistency, German and Spanish translations
276
+ - 🎨 **UX** β€” Command output formatting improvements
277
+
278
+ ---
163
279
 
164
280
  ## πŸ”— Links
165
281
 
166
- - **Sign up Pollinations Beta (more and best free tiers access and paids models)**: [pollinations.ai](https://enter.pollinations.ai)
167
- - **Pollinations Website**: [pollinations.ai](https://pollinations.ai)
168
- - **Discord Community**: [Join us!](https://discord.gg/pollinations-ai-885844321461485618)
169
- - **OpenCode Ecosystem**: [opencode.ai](https://opencode.ai/docs/ecosystem#plugins)
282
+ | Resource | Link |
283
+ |----------|------|
284
+ | Sign up for Pollinations (free tiers + paid models) | [enter.pollinations.ai](https://enter.pollinations.ai) |
285
+ | Pollinations website | [pollinations.ai](https://pollinations.ai) |
286
+ | Pollinations GitHub | [github.com/pollinations/pollinations](https://github.com/pollinations/pollinations) |
287
+ | Discord community | [Join us!](https://discord.gg/pollinations-ai-885844321461485618) |
288
+ | OpenCode ecosystem | [opencode.ai/docs/ecosystem](https://opencode.ai/docs/ecosystem#plugins) |
289
+ | Plugin author | [@fkom13](https://github.com/fkom13) |
290
+
291
+ ---
170
292
 
171
293
  ## πŸ“œ License
172
294
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-pollinations-plugin",
3
3
  "displayName": "Pollinations AI (V5.9)",
4
- "version": "6.1.0-beta.11",
4
+ "version": "6.1.0-beta.12",
5
5
  "description": "Native Pollinations.ai Provider Plugin for OpenCode",
6
6
  "publisher": "pollinations",
7
7
  "repository": {