opencode-pollinations-plugin 6.2.6 โ†’ 6.2.7

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,55 +1,58 @@
1
- # ๐ŸŒธ Pollinations AI Plugin for OpenCode (v6.2.0)
1
+ # ๐ŸŒธ Pollinations AI Plugin for OpenCode (v6.2.7)
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 a continuous universe of free basic AI models, or leverage premium enterprise models with our generous Daily Free Tiers directly from your editor.
4
+ <img src="https://avatars.githubusercontent.com/u/88394740?s=400&v=4" alt="Pollinations.ai Logo" width="180">
5
+ <h3>The Ultimate Bridge between OpenCode and the Pollinations.ai Ecosystem.</h3>
6
+ <p><em>Access a continuous universe of free basic AI models, or leverage premium enterprise models with our generous <b>Hourly Free Tiers</b> directly from your local terminal.</em></p>
9
7
  </div>
10
8
 
11
9
  <div align="center">
12
10
 
13
- ![Version](https://img.shields.io/badge/version-v6.2.0-blue.svg)
14
- ![License](https://img.shields.io/badge/license-MIT-green.svg)
15
- ![Status](https://img.shields.io/badge/status-Stable-success.svg)
11
+ [![NPM Version](https://img.shields.io/npm/v/opencode-pollinations-plugin?color=blue&style=for-the-badge)](https://www.npmjs.com/package/opencode-pollinations-plugin)
12
+ [![Downloads](https://img.shields.io/npm/dt/opencode-pollinations-plugin?color=success&style=for-the-badge)](https://www.npmjs.com/package/opencode-pollinations-plugin)
13
+ [![License](https://img.shields.io/badge/license-MIT-green.svg?style=for-the-badge)](LICENSE)
16
14
 
17
15
  </div>
18
16
 
17
+ ---
18
+
19
19
  ## ๐Ÿ“– Philosophy: Open AI for Creators
20
20
 
21
21
  > **"No closed doors, no corporate hoops โ€” just good tools and good people."**
22
22
 
23
- Pollinations.ai is an open-source platform created by and for the community. We offer a unified, direct API for generating images, text, audio, and video.
24
- - **Transparent**: Our code, roadmap, and discussions are public.
25
- - **Fair Economy**: A single currency (**Pollen**) for all media and models. Predictable and transparent pricing.
23
+ **Pollinations.ai** is an open-source platform created by and for the community. We offer a unified, direct API for generating **images, text, audio, and video**.
24
+
25
+ - ๐ŸŒ **Transparent**: Our code, roadmap, and discussions are fully public.
26
+ - โš–๏ธ **Fair Economy**: A single currency (**Pollen ๐ŸŒป**) for all media and models. Predictable and transparent pricing. No vendor lock-in.
26
27
 
27
28
  ---
28
29
 
29
- ## โœจ What's new in V6.2? (The Anti-Hallucination Update)
30
- - **100% Dynamic Engine**: Hardcoded model lists, default configurations, and fixed prices are gone! In V6.2, OpenCode's AI agent now fetches the latest LLM models, parameters, tags (`[๐Ÿ’Ž Paid]`, `[๐ŸŒฟ Free]`, limits), and cost approximations dynamically from the Pollinations APIs.
31
- - **Robust Security**: Protection against path traversal and strict URL verifications are fully integrated.
32
- - **Improved Web Search**: The `polli_web_search` component maps seamlessly to current web-enabled and specialized groundings options like Google Gemini Fast, Perplexity, and Custom specialized assistants.
30
+ ## โœจ What's new in V6.2.7?
31
+
32
+ - โฑ๏ธ **Hourly Quotas**: Say goodbye to daily limits! Developer tiers now reset **every single hour** at `:00`, ensuring you always have fresh credits available throughout your coding sessions.
33
+ - โšก **100% Dynamic Engine**: Hardcoded model lists, default configurations, and fixed prices are gone! In V6.2, OpenCode's AI agent now fetches the latest LLMs (`[๐Ÿ’Ž Paid]`, `[๐ŸŒฟ Free]`, limits), and cost approximations dynamically from the Pollinations APIs.
34
+ - ๐Ÿ›ก๏ธ **Robust Security**: Protection against path traversal and strict URL verifications are fully integrated.
35
+ - ๐Ÿ” **Improved Web Search**: The `polli_web_search` component maps seamlessly to current web-enabled and specialized groundings options like Google Gemini Fast, Perplexity, and Custom assistants.
33
36
 
34
37
  ---
35
38
 
36
- ## ๐Ÿงฐ Tools & Commands V6.2
39
+ ## ๐Ÿงฐ Tools & Commands
37
40
 
38
41
  Beyond text discussion, connecting your key gives OpenCode Agents access to our AI Media Tools powered by Pollinations models:
39
42
 
40
43
  ### ๐Ÿ’Ž Integrated Generative Tools (ENTER ONLY - requires API key)
41
- - `polli_gen_image` : State-of-the-art imagery models (`Flux`, `Sana`, `Gemini`).
42
- - `polli_gen_video` : Powerful Text-to-Video and Image-to-Video capabilities (`Wan`, `Veo`, `LTX`, `Reveal`).
43
- - `polli_gen_audio` & `polli_gen_music` : Magical voice synthesis (ElevenLabs, TTS) and Generative Music.
44
- - `polli_stt` : High-flying voice transcription (Whisper V3).
45
- - `polli_web_search` : Connected Web & Specialized Search context (`gemini-search`, `perplexity...`).
44
+ - ๐ŸŽจ `polli_gen_image` : State-of-the-art imagery models (`Flux`, `Sana`, `Midjourney`, etc.).
45
+ - ๐ŸŽฌ `polli_gen_video` : Powerful Text-to-Video and Image-to-Video models (`Wan`, `Veo`, `LTX`, `Reveal`).
46
+ - ๐Ÿ”Š `polli_gen_audio` & `polli_gen_music` : Voice synthesis (ElevenLabs, OpenAI TTS) and Generative Music.
47
+ - ๐ŸŽ™๏ธ `polli_stt` : High-flying voice transcription (Whisper V3).
48
+ - ๐ŸŒ `polli_web_search` : Connected Web & Specialized Search context (`gemini-search`, `perplexity...`).
46
49
 
47
50
  ### ๐Ÿงฐ Free Creator Bonus Tools (Always available)
48
- - `remove_background` : Built-in ultra-fast image background removal.
49
- - `gen_qrcode(diagram and palettes)`, `extract_frames`, `extract_audio`, `file_to_url`: Utilities.
51
+ - โœ‚๏ธ `remove_background` : Built-in ultra-fast AI image background removal.
52
+ - ๐Ÿ› ๏ธ `gen_qrcode`, `gen_diagram`, `extract_frames`, `extract_audio`, `file_to_url`: Dev utilities.
50
53
 
51
54
  ### ๐Ÿ’ป Complete List of Terminal Commands
52
- Use the alias **`/poll`** or **`/pollinations`**.
55
+ Use the alias **`/poll`** or **`/pollinations`** anytime inside your conversation terminal:
53
56
  - `/poll help` : Displays the interactive help table.
54
57
  - `/poll connect` : Bring Your Own Key configuration tool (Interactive).
55
58
  - `/poll usage full` : Real-time dashboard (Stats), active Freetiers, and Wallet Balance.
@@ -57,50 +60,59 @@ Use the alias **`/poll`** or **`/pollinations`**.
57
60
  - `/poll models` : Check the status of available Models.
58
61
  - `/poll pricing` : View real-time unified pricing (Average Cost Estimate).
59
62
  - `/poll fallback` : Define the ultimate Safety Net Chat model.
60
- - `/poll mode` : Change mode without going through the API.
61
63
  - `/poll infos` : Discover community rules and the leveling system.
62
64
 
63
- ### ๐Ÿ›ก๏ธ The "Cost Guard" & the "Safety Net"
64
- We have introduced fundamental protections to ensure your workflow never interrupts and your wallet (Wallet or free tiers) is under your control.
65
- - **Safety Net**: If you use premium models and your daily Pollen quota runs out in the middle of a chat session, the plugin silently and automatically switches to a free model. *No more blocking errors (429).*
66
- - **Cost Guard for Tools**: OpenCode Agents can be zealous. If an Agent tries to spend too many Pollens to generate a heavy video or music, the plugin intercepts the request. We have implemented an asynchronous flow that asks for your manual confirmation before executing costly generations. You stay in control.
65
+ ---
66
+
67
+ ## ๐Ÿ›ก๏ธ The "Cost Guard" & the "Safety Net"
67
68
 
68
- ### ๐ŸŒ Native Multilingual Support (i18n)
69
- Pollinations for OpenCode natively speaks your language.
70
- - The Engine Interface, Notifications (Toasts), Tool Returns, and Commands are fully translated into **English (Default)**, **French**, **Spanish**, **German**, and **Italian**.
71
- - Type `/poll config lang <fr|es|de|it>` in the terminal to switch instantly.
69
+ We have introduced fundamental protections to ensure your workflow never interrupts and your budget (Wallet or Free Tiers) is under your control:
70
+
71
+ - ๐Ÿ›Ÿ **Safety Net**: If you use premium models and your hourly Pollen quota runs out in the middle of a chat session, the plugin silently and automatically switches to a free model. *No more blocking errors (429).*
72
+ - ๐Ÿšฆ **Cost Guard for Tools**: OpenCode Agents can be zealous. If an Agent tries to spend too many Pollens to generate a heavy video or music, the plugin intercepts the request. An asynchronous flow will ask for your manual confirmation before executing costly generations. You stay in control.
72
73
 
73
74
  ---
74
75
 
75
76
  ## ๐Ÿ Understanding Pollens & "Free Tiers"
76
77
 
77
- In the past, Pollinations mainly relied on ad-funded network traffic. Today, running massive models (like Claude 4.5, Flux Pro, Wan Video) costs money. Pollinations therefore introduces the **Enter Universe** which requires an API key and unlocks cutting-edge models.
78
+ In the past, Pollinations mainly relied on ad-funded network traffic. Today, running massive models (like Claude 3.5 Sonnet, Flux Pro, Wan Video) costs money. The **Enter Universe** unlocks cutting-edge models through an API key.
78
79
 
79
80
  **But wait, you don't need a credit card!**
80
81
 
81
- **Pollen** is our unified credit system ($1 โ‰ˆ 1 Pollen). By connecting a simple Free API Key, you unlock daily Pollen reloads according to your Developer Tier:
82
+ **Pollen ๐ŸŒป** is our unified credit system ($1 โ‰ˆ 1 Pollen). By connecting a simple Free API Key, you unlock **hourly** Pollen reloads according to your Developer Tier:
83
+
84
+ | Tier | Hourly Reload โฑ๏ธ | Daily Estimate* | Condition |
85
+ | :--- | :--- | :--- | :--- |
86
+ | ๐Ÿฆ  **Microbe** | **0.01 Pollen / hour** | ~0.24 / day | Just register! |
87
+ | ๐Ÿ„ **Spore** | **0.01 Pollen / hour** | ~0.24 / day | Automatic verification |
88
+ | ๐ŸŒฑ **Seed** | **0.15 Pollen / hour** | ~3.6 / day | Active GitHub Developer (8+ points) |
89
+ | ๐ŸŒธ **Flower** | **0.40 Pollen / hour** | ~9.6 / day | **Publish an App** (Like this Plugin!) |
90
+ | ๐Ÿฏ **Nectar** | **0.80 Pollen / hour** | ~19.2 / day | Coming soon ๐Ÿ”ฎ |
82
91
 
83
- | Tier | Daily Reload | Condition |
84
- | :--- | :--- | :--- |
85
- | ๐Ÿฆ  **Microbe** | **0.1 Pollen/day** | Just register! |
86
- | ๐Ÿ„ **Spore** | **1 Pollen/day** | Automatic verification |
87
- | ๐ŸŒฑ **Seed** | **3 Pollen/day** | Active GitHub Developer (8+ points) |
88
- | ๐ŸŒธ **Flower** | **10 Pollen/day** | **Publish an App** (Like this Plugin!) |
92
+ _*Daily estimates are approximate (~24h ร— hourly rate). Actual reset occurs automatically at the top of every hour (XX:00)._
89
93
 
90
94
  > ๐ŸŽ **Get your Free Personal Key (BYOK) on [Pollinations.ai](https://enter.pollinations.ai/authorize?redirect_url=https://github.com/fkom13/opencode-pollinations-plugin) to boost OpenCode!**
91
95
 
92
- *(Note: We still maintain the "Free Universe" fallback for basic chat (`openai-fast`) which requires no key, but its capacity is very limited and mainly designed as a safety net).*
96
+ **How It Works:**
97
+ 1. Your free tier quota (e.g., 0.40 ๐ŸŒป/hour for Flower) is consumed first.
98
+ 2. When quota is exhausted, the safety net gracefully switches you to free fallback variants.
99
+ 3. Wallet balance (if purchased) is used for premium models only when the free quota is insufficient.
100
+ 4. Boom! ๐Ÿ’ฅ Quota resets completely at the start of the next hour.
101
+
102
+ ---
93
103
 
94
- Paid pollens allow you to access even more powerful and premium models.
104
+ ## ๐ŸŒ Native Multilingual Support (i18n)
95
105
 
96
- Daily free tier pollen credits are consumed before touching the wallet (purchased pollen) except for paid models.
106
+ Pollinations for OpenCode natively speaks your language:
107
+ - The Engine Interface, Notifications (Toasts), Tool Returns, and Terminal Commands are fully translated into **English**, **French**, **Spanish**, **German**, **Italian**, and **Chinese**.
108
+ - Type `/poll config lang <en|fr|es|de|it|zh>` in the terminal to switch instantly.
97
109
 
98
110
  ---
99
111
 
100
112
  ## ๐Ÿš€ Getting Started & Onboarding
101
113
 
102
114
  ### ๐Ÿง 1. Cross-Platform Configuration (NPM Installation)
103
- This plugin is **fully cross-platform** (Windows, macOS, Linux) and detects its ports dynamically.
115
+ This plugin is **fully cross-platform** (Windows, macOS, Linux) and detects OpenCode ports dynamically.
104
116
 
105
117
  1. Global installation:
106
118
  ```bash
@@ -113,13 +125,11 @@ This plugin is **fully cross-platform** (Windows, macOS, Linux) and detects its
113
125
  *(Or inject it manually into `~/.config/opencode/opencode.json`)*
114
126
 
115
127
  ### ๐Ÿ”‘ 2. Interactive Onboarding
116
- Once in OpenCode, simply type the following command in the Agent Terminal:
128
+ Once inside OpenCode, simply type the following command in the Agent Terminal:
117
129
  ```bash
118
130
  /poll connect
119
131
  ```
120
- An interactive conversational assistant will guide you to inject your Pollinations Key and configure your space. *Restart OpenCode to update the list of models in the UI interface.*
121
-
122
-
132
+ An interactive conversational assistant will guide you to inject your Pollinations Key and configure your workspace. *(Restart OpenCode to update the UI models list).*
123
133
 
124
134
  ---
125
135
 
package/README.zh.md ADDED
@@ -0,0 +1,144 @@
1
+ # ๐ŸŒธ Pollinations AI ๆ’ไปถ - OpenCode็‰ˆ (v6.2.7)
2
+
3
+ <div align="center">
4
+ <img src="https://avatars.githubusercontent.com/u/88394740?s=400&v=4" alt="Pollinations.ai Logo" width="180">
5
+ <h3>่ฟžๆŽฅ OpenCode ็ปˆ็ซฏไธŽ Pollinations.ai ็”Ÿๆ€็š„็ปˆๆžๆกฅๆข</h3>
6
+ <p><em>็›ดๆŽฅ้€š่ฟ‡ไฝ ็š„ๆœฌๅœฐ็ปˆ็ซฏ๏ผŒ้šๆ—ถ้šๅœฐ่ฎฟ้—ฎ่ฟž็ปญ็š„ๅ…่ดนAIๅŸบ็ก€ๆจกๅž‹๏ผŒๆˆ–ๅœจๆˆ‘ไปฌๆ…ทๆ…จ็š„ <b>ๆฏๅฐๆ—ถๅ…่ดน้ขๅบฆ (Hourly Free Tiers)</b> ๆ”ฏๆŒไธ‹๏ผŒไฝฟ็”จ้กถ็บงไผไธšๅคงๆจกๅž‹ใ€‚</em></p>
7
+ </div>
8
+
9
+ <div align="center">
10
+
11
+ [![NPM Version](https://img.shields.io/npm/v/opencode-pollinations-plugin?color=blue&style=for-the-badge)](https://www.npmjs.com/package/opencode-pollinations-plugin)
12
+ [![Downloads](https://img.shields.io/npm/dt/opencode-pollinations-plugin?color=success&style=for-the-badge)](https://www.npmjs.com/package/opencode-pollinations-plugin)
13
+ [![License](https://img.shields.io/badge/license-MIT-green.svg?style=for-the-badge)](LICENSE)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## ๐Ÿ“– ็†ๅฟต: ๅˆ›ไฝœ่€…็š„ๅผ€ๆบAIๅนณๅฐ
20
+
21
+ > **"ๆฒกๆœ‰ๅ•†ไธšๅฃๅž’๏ผŒๆฒกๆœ‰้š่—็š„้šœ็ข โ€” ๅชๆœ‰ไผ˜็ง€็š„ๅทฅๅ…ทๅ’Œๅ‹ๅ–„็š„็คพๅŒบใ€‚"**
22
+
23
+ **Pollinations.ai** ๆ˜ฏไธ€ไธช็”ฑ็คพๅŒบๆž„ๅปบ็š„ๅผ€ๆบAIๅนณๅฐใ€‚ๆˆ‘ไปฌไธบๅ›พๅƒใ€ๆ–‡ๆœฌใ€้Ÿณ้ข‘ๅ’Œ่ง†้ข‘็š„็”ŸๆˆๅŠŸ่ƒฝๆไพ›็›ด่ง‚ใ€็ปŸไธ€็š„ APIใ€‚
24
+
25
+ - ๐ŸŒ **ๅฎŒๅ…จ้€ๆ˜Ž**: ๆˆ‘ไปฌ็š„ๅบ•ๅฑ‚ไปฃ็ ใ€ๅผ€ๅ‘่ทฏ็บฟๅ›พ(Roadmap)ไปฅ่‡ด็คพๅŒบๆŽข่ฎจๅ…จ้ƒจๅฏนๅค–ๅ…ฌๅผ€ใ€‚
26
+ - โš–๏ธ **ๅ…ฌๅนณ็š„็ปๆตŽๆจกๅผ**: ๅ…จๅนณๅฐไฝฟ็”จ็ปŸไธ€่ฎก้‡ๅ•ไฝ (**Pollen ๐ŸŒป**) ไปฃๆ›ฟ็น็็š„็‚นๅˆธใ€‚้€ๆ˜Žๅฎšไปท๏ผŒๆฐธไธๅผบๅˆถ้”ๅฎšๅนณๅฐ (No Vendor Lock-in)ใ€‚
27
+
28
+ ---
29
+
30
+ ## โœจ V6.2.7 ๆ–ฐ็ฏ‡็ซ 
31
+
32
+ - โฑ๏ธ **ๅฐๆ—ถ็บง้ขๅบฆๅˆทๆ–ฐ**: ๅ‘Šๅˆซๆผซ้•ฟ็š„ๆฏๆ—ฅ้™้ข็ญ‰ๅพ…๏ผ็Žฐๆœ‰็š„ๅผ€ๅ‘่€…็ญ‰็บง็Žฐๅœจๅฐ†ๅœจ **ๆฏไธชๆ•ด็‚น** (`:00`) ๆธ…้›ถๅนถ้‡ๆ–ฐไธ‹ๆ”พๅฑžไบŽไฝ ็š„่Šฑ็ฒ‰(Pollen)ใ€‚่ฟ™็กฎไฟๆ‚จ็š„ไปฃ็ ็”Ÿๆˆๅ’Œๅˆ›ๆ„ๆต‹่ฏ•ไธ่ขซไธญๆ–ญ๏ผ
33
+ - โšก **100% ๅŠจๆ€ไบ‘็ซฏๅผ•ๆ“Ž**: ๅœจ V6.2 ไธญ๏ผŒไปฃ็†ๅŠฉๆ‰‹ๅฆ‚ไปŠ่ƒฝๅคŸ่‡ชไธปๅ‘ Pollinations API ๅ‰ๅฐๅ‘้€ๆŸฅ่ฏข่ฏทๆฑ‚๏ผŒ่‡ชๅŠจ่ฏปๅ–ๅนถๆณจๅ…ฅๅ…จ็ฝ‘ๆœ€ๆ–ฐ็š„ AI ๆจกๅž‹่กจ (`[๐Ÿ’Ž Paid]`, `[๐ŸŒฟ Free]`) ใ€ๅŠจๆ€ๆœ€้ซ˜้™้ขไธŽๅฎžๆ—ถๆœŸๆœ›ๆถˆ่ดนๆ•ฐๆฎ๏ผŒ็กฌ็ผ–็ ็š„ๆ—ถไปฃๅฎฃๅ‘Š็ป“ๆŸใ€‚
34
+ - ๐Ÿ›ก๏ธ **ไธฅๆ ผ็š„ๅฎ‰ๅ…จๆ‹ฆๆˆชๆœบๅˆถ**: ไปŽๅบ•ๅฑ‚้‡ๆž„้˜ฒๆญข่ถŠ็•ŒๆŸฅๅบ“ๆผๆดž๏ผŒๅฏนไปปไฝ•ๆถ‰ๅŠ่ต„้‡‘ๅ˜ๅŠจ็š„้žๆณ• URL ๅ’Œๅ‚ๆ•ฐ็ป“ๆž„ๅฎžๆ–ฝๆทฑๅบฆๅฐๅ ตใ€‚
35
+ - ๐Ÿ” **็ช็ ดๆ€ง็š„ๆœ็ดขๅทฅๅ…ท**: `polli_web_search` ๆœ็ดขๆจกๅž‹็ŽฐๅœจๅทฒๅฎŒ็พŽๆ— ็ผ็ป“ๅˆ่ฏธๅฆ‚ Google Gemini Fastใ€Perplexity ๆญค็ฑปๅธฆๆœ‰่‡ชไธปๅฎžๆ—ถๆœ็ดข็š„ๅผบๅŠฒๅŠฉๆ‰‹ใ€‚
36
+
37
+ ---
38
+
39
+ ## ๐Ÿงฐ ๅ†…็ฝฎ็ฅžๅ…ตๅˆฉๅ™จ
40
+
41
+ ่ฟžๆŽฅไฝ ็š„ไธชไบบ API ๅฏ†้’ฅ (Key) ไน‹ๅŽ๏ผŒๅณๅฏ่ต‹ไบˆ OpenCode Agent ๅฎŒๅ…จ่ฎฟ้—ฎๆˆ‘ไปฌๅœจๅŽๅฐๅ‡†ๅค‡็š„ๅคšๅช’ไฝ“ๅคงๆ ธๅฟƒ็ฎ—ๅŠ›ๅทฅๅ…ท็š„ๆƒ้™๏ผš
42
+
43
+ ### ๐Ÿ’Ž ้ซ˜็บง็”Ÿๆˆ็ฝ‘็ปœ้›†็พค (ENTER ONLY - ้œ€ๆไพ›APIๅฏ†้’ฅ)
44
+ - ๐ŸŽจ `polli_gen_image` : ็›ฎๅ‰ไธ–็•Œๆœ€็Ÿฅๅ็š„่ง†่ง‰ๆ ธๅฟƒ (`Flux`, `Sana`, `Midjourney`, ็ญ‰็ญ‰)ใ€‚
45
+ - ๐ŸŽฌ `polli_gen_video` : ๅผบๅคง็š„ ๆ–‡็”Ÿ่ง†้ข‘ (T2V) ไธŽ ๅ›พ็”Ÿ่ง†้ข‘ (I2V) ๅผ•ๆ“Ž (`Wan`, `Veo`, `LTX`, `Reveal`)ใ€‚
46
+ - ๐Ÿ”Š `polli_gen_audio` & `polli_gen_music` : ๆ‹Ÿ็œŸๅบฆๆž้ซ˜็š„่‡ช็„ถไบบๅฃฐๅˆๆˆ (ElevenLabs, OpenAI TTS) ๅ’Œ ๆ™บ่ƒฝ่ƒŒๆ™ฏ้Ÿณไน็ผ–ๆ›ฒใ€‚
47
+ - ๐ŸŽ™๏ธ `polli_stt` : ๅชฒ็พŽไธ“ๅฎถ็š„ AI ่ฏญ่จ€ๆ–‡ๅญ—่ฝฌๅŒ–ๆŠ“ๅ–่ฝจ้“ (ๅŸบไบŽ Whisper V3)ใ€‚
48
+ - ๐ŸŒ `polli_web_search` : ้ขๅ‘ๅ…จ็ƒไบ’่”ไธŽๆทฑๅบฆ่ต„ๆ–™่ฐƒ็ ”่พ…ๅŠฉๆจกๅž‹ (`gemini-search`, `perplexity...`)ใ€‚
49
+
50
+ ### ๐Ÿงฐ ๅ…่ดน็š„ๅˆ›ไฝœ่€…่พ…ๅŠฉ็ณป็ปŸ (ๆฐธ่ฟœๅฏไปฅไฝฟ็”จ)
51
+ - โœ‚๏ธ `remove_background` : ่ถ…ๅฟซๅŽŸ็”Ÿ AI ่‡ชๅŠจๆŠ ๅ›พๅŠŸ่ƒฝใ€‚
52
+ - ๐Ÿ› ๏ธ ้…ๅˆ `gen_qrcode`ไบŒ็ปด็ ใ€`extract_frames`ๅˆ†ๅธง,ใ€ไปฅๅŠๅผ€ๅ‘ไธŠไผ ๅทฅๅ…ท `file_to_url` ็ญ‰ๅฎž็”จๅŠŸ่ƒฝๆๅ‡ๆ•ˆ็އใ€‚
53
+
54
+ ### ๐Ÿ’ป ๆœฌๅœฐ็ปˆ็ซฏๅ‘ฝไปค้›†ๅˆ—่กจ
55
+ ไฝ ้šๆ—ถๅฏไปฅๅœจ่Šๅคฉ็š„็ปˆ็ซฏๅ‘ผๅซไปฃๅท **`/poll`**๏ผˆๆŽจ่๏ผ‰ๆˆ– **`/pollinations`**:
56
+ - `/poll help` : ๆ‰“ๅผ€ไบคไบ’ๅ‘ฝไปคๅคงๅ…จๅˆ—่กจใ€‚
57
+ - `/poll connect` : "่‡ชๅธฆๅฏ†้’ฅ (BYOK)" ็š„ไบคไบ’ๅฏผๅ…ฅๆŽฅๅฃ่ฎพๅฎšใ€‚
58
+ - `/poll usage full` : ไธชไบบ่ต„ๆ–™ๆŽงๅˆถๅฐ็œ‹ๆฟ๏ผŒๅฏ่ง‚ๆต‹ๆถˆ่€—ๅ‰ฉไฝ™ๅฎžๆ—ถๅ…่ดนๆต้‡ๅ’Œ้ข„ๅญ˜่Šฑ็ฒ‰ไฝ™้ขใ€‚
59
+ - `/poll config` : ๆ›ดๅๅ‘ไบŽ็ณป็ปŸ็š„ๅ‚ๆ•ฐไฟฎๆญฃๆฏ”ๅฆ‚่ฏญ่จ€ใ€้˜ฒ็ˆ†้ขๅบฆ็š„่ฐƒ่Š‚ใ€‚
60
+ - `/poll models` : ๅณๅˆปไธ€่งˆๆ‰€ๆœ‰็Šถๆ€ๆ˜ฏๅœจ็บฟ็š„ๆ”ฏๆŒๅบ“ๆจกๅž‹ใ€‚
61
+ - `/poll pricing` : ๆ ธๅฏนๅ…จ็ฝ‘ Pollen (ๆœŸๆœ›ๆŠ˜็บฟ่Šฑ่ดน) ๅนณๅ‡ๅˆ—่กจไปทๆ ผใ€‚
62
+ - `/poll fallback` : ๅฎšไน‰ๅœจๅ…่ดนๆœๅŠกๅดฉๆบƒๆ—ถไฝ ็š„็ดงๆ€ฅๅบ•ๅฑ‚ๅคงๆจกๅž‹้€š้“ใ€‚
63
+ - `/poll infos` : ไธ€็ฏ‡็ป™ๆ–ฐ่€็”จๆˆท้˜…่ฏปๅ…ณไบŽ็ญ‰็บง็ฆๅˆฉ่ฏฆ่งฃๅ’ŒๅŸบ็ก€็คพ็พคๅ…ฌ็บฆ็š„้•ฟๆ–‡ไป‹็ปใ€‚
64
+
65
+ ---
66
+
67
+ ## ๐Ÿ›ก๏ธ "Cost Guard" ่ญฆๅซ็ณป็ปŸ ๏ผ† "ๅฎ‰ๅ…จ้™่ฝ่ทฏ็บฟ" (Safety Net)
68
+
69
+ ๆˆ‘ไปฌ้žๅธธๅœจไนŽๆ‚จ็š„็งไบบ่ต„ไบงๅ’Œๅฎ่ดตๅผ€ๅ‘ๅทฅๅบ๏ผŒๅ› ๆญค่ฎพ็ฝฎไบ†่ฟ™ไบ›ไฟๆŠคๅธฆ็กฎไฟๆ‚จ้ซ˜ๆž•ๆ— ๅฟง:
70
+
71
+ - ๐Ÿ›Ÿ **ๅฎ‰ๅ…จ้™่ฝ่ทฏ็บฟ (Safety Net)**: ๅฆ‚ๆžœไฝ ๅœจๅ†™็จ‹ๅบ็š„ๆทฑๅคœ็”จๅ…‰ไบ†ๆฏๅฐๆ—ถ็š„้ซ˜้ขๅบฆ้…็ป™๏ผŒๆญคๆ—ถไฝ ็š„ๆ‰€ๆœ‰ Premium ่ฐƒๅบฆๅ‘ฝไปคๅฐฑไผš่งฆๅ‘ๆ‹ฆๆˆช๏ผŒๅนถๅฎ‰้™ๅฟซ้€Ÿ็š„ๅ›ž้€€้™่ฝ่‡ณ ๅ…่ดน้€š็”จๅž‹ๅคงๆจกๅž‹ (Free fallback models)ใ€‚*ๆ‹’็ป่ฎฉไฝ ๅ› ไธบ 429 Error ๅคฑ่”ใ€‚*
72
+ - ๐Ÿšฆ **้˜ฒ็ˆ†้ข„่ญฆ (Cost Guard)**: OpenCode็š„่‡ชๅŠจๅŠฉๆ‰‹ๆœ‰ๆ—ถไผšๆ“…ไฝœไธปๅผ ๆถˆ่€—่ฟ็ฎ—็”Ÿๆˆ็‰นๅˆซๅคๆ‚็š„่ถ…้•ฟ่ง†้ข‘๏ผŒไฝ†ๅœจ่ฟ™้‡Œไธๅญ˜ๅœจ่ขซๅ‰ฒ้Ÿญ่œใ€‚ๆ‰€ๆœ‰่ถ…ๅ‡บ่ญฆๆˆ’้˜ˆๅ€ผ็š„่ต„ๆบไปปๅŠกๅ‡ไผš่ขซๆ‰“ๆ–ญๅนถๅ†ป็ป“ๆŒ‚่ตทใ€‚็ณป็ปŸๅผนๅ‡บๅฎ‰ๅ…จ่ดจ่ฏข้€š้“๏ผˆ่ฆๆฑ‚ๆ‚จๅฟ…้กปไบฒ่‡ชๅœจๅ…ฌๅฑๅ›žๅคๆ‰ง่กŒ็กฎ่ฎค๏ผ‰ๅฎƒๆ‰่ƒฝ็ปง็ปญๆ‰ฃ่Šฑ็ฒ‰ๅทฅไฝœใ€‚ๆ‚จๅฏไปฅๅฎŒๅ…จๆŠŠๆŽงๆฏไธ€็ฌ”ๅธ็›ฎใ€‚
73
+
74
+ ---
75
+
76
+ ## ๐Ÿ ๅฟซ้€ŸๆŽŒๆก Pollens ไธŽ "ๅผ€ๅ‘่€…็ญ‰็บง (Free Tiers)"
77
+
78
+ ๅœจ่ฟ‡ๅŽป๏ผŒPollinations ไธป่ฆ้€š่ฟ‡ๅนฟๅ‘Šๅนณๅฐๅ…ปๆดปๅคง้‡ๅ…ฌ็›Š่Š‚็‚นใ€‚ไฝ†ไปŠๅคฉ๏ผŒ่ถ…ๅคงไฝ“้‡ๆจกๅž‹ (Claude 3.5 Sonnet, Wan Video ็”š่‡ณ Flux Pro็ญ‰) ๆถˆ่€—ๆœๅŠกๅ™จ่ต„ๆบๅฏ่ฐ“็‡ƒ็ƒงใ€‚ๆ‰€ไปฅ้œ€่ฆๅŠ ๅ…ฅ่ขซ็งฐไน‹ไธบ **Enter Universe** ็š„ไธ–็•Œ่Žทๅ–ๅ‡ญ่ฏ้€š่กŒ๏ผˆ่ฟ™ๅฐฑ้œ€่ฆๆœ‰ API ๅฏ†้’ฅไบ†๏ผ‰ใ€‚
79
+
80
+ **ๅˆซๆ€ฅ๏ผŒไฝ ไธไธ€ๅฎš้ž่ฆ็ป‘็”จ้‚ฃๆ„š่ ขๆˆ–้บป็ƒฆ็š„้“ถ่กŒๅกๆ”ฏไป˜้ชŒ่ฏ๏ผ**
81
+
82
+ **Pollen ๐ŸŒป** (่Šฑ็ฒ‰) ๆ˜ฏไธ€็งๆ ‡ๅ‡†ๅŒ–ๅ‡ญ่ฏ่™šๆ‹Ÿ่ฎก่ดนไปฃๅธ (ๆข็ฎ—: 1$ ไฝ™้ข็บฆ โ‰ˆ 1ไธช Pollen)ใ€‚ๆ— ่ฎบไฝ ๆ˜ฏไฝ•่ฎธไบบ๏ผŒๅช่ฆๆ‹ฅๆœ‰ไธ€ไธชๅฎŒๅ…จๅ…่ดน็”ณ่ฏท้€š่ฟ‡็š„API KEY ๅนถ่ฝฝๅ…ฅๅณๅฏไบซๅ— **ๆฏไธชๅฐๆ—ถ(Hourly)** ไธ‹ๆ”พ็š„่กฅ็ป™็™ฝๅซ–ๆŒ‡ๆ ‡๏ผไฝ ็š„ไบงๅ‡บ่ดก็Œฎ่ถŠ้ซ˜๏ผˆๅณไธ‹้ขๅˆ—่กจไธญๆ‰€่พพๅˆฐ็š„็ญ‰็บงTier้˜ถๆฎต๏ผ‰ๆฏๅฐๆ—ถๆ”ถๅค็š„่ต„ๆบ่ถŠๅคš๏ผš
83
+
84
+ | Tier (็งฐๅท) | ๆฏๅฐๆ—ถ่Žทๅ–่กฅ่ดด้‡ โฑ๏ธ | ๆ— ้™ๅพช็Žฏๅ‚่€ƒๅ€ผ* | ่พพๆˆๆกไปถ |
85
+ | :--- | :--- | :--- | :--- |
86
+ | ๐Ÿฆ  **Microbe (ๅพฎ็”Ÿ็‰ฉ)** | **0.01 Pollen / ๅฐๆ—ถ** | ๆฏๅคฉ็บฆ ~0.24 | ไป…ไป…ๅช่ฆ็™ปๅฝ•๏ผ |
87
+ | ๐Ÿ„ **Spore (ๅญขๅญ)** | **0.01 Pollen / ๅฐๆ—ถ** | ๆฏๅคฉ็บฆ ~0.24 | ่‡ชๅŠจๅฎ‰ๅ…จๅฎกๆ ธๆฟ€ๆดป็ณป็ปŸ |
88
+ | ๐ŸŒฑ **Seed (ๆ ‘็ง)** | **0.15 Pollen / ๅฐๆ—ถ** | ๆฏๅคฉ็บฆ ~3.6 | GitHub ๆดป่ทƒๅผ€ๅ‘ๆˆๅ‘˜ (ๆ€ปๅˆ†่พพ 8+) |
89
+ | ๐ŸŒธ **Flower (่Šฑๆœต)** | **0.40 Pollen / ๅฐๆ—ถ** | ๆฏๅคฉ็บฆ ~9.6 | **่‡ณๅฐ‘ๆœ‰ๅฎŒๆˆๅนถ้ฆ–ๅ‘่ฟ‡ไธ€ๆฌพๅบ”็”จๅœจๅธ‚ๅœบ๏ผ** |
90
+ | ๐Ÿฏ **Nectar (่Šฑ่œœ)** | **0.80 Pollen / ๅฐๆ—ถ** | ๆฏๅคฉ็บฆ ~19.2 | ๐Ÿ”ฎ ็ญ‰ๅพ…่งฃ้”ไธญ... |
91
+
92
+ _*ๆ‰€ๅˆ—ๅ‡บๆฏๅคฉ่ฟ‘ไผผๆœ€ๅคงๆ€ป้ขๅปบ็ซ‹ๅœจๅ‰็ฝฎๆปกๆถˆ(~24h ร— hourly rate)ไธบ็†่ฎบไธŠ้™ใ€‚็œŸๅฎž็š„่Šฑ็ฒ‰้‡้ƒฝไผšๅ‡†ๆ—ถๅœจ้›ถ็‚น่ฟ‡็š„ไธ€ๅˆ†้’Ÿ (XX:00) ็ปŸไธ€็Œๆปกๆฑ ๅญ้‡Œใ€‚_
93
+
94
+ > ๐ŸŽ **่ฏทๅ‰ๅพ€ [Pollinations.ai](https://enter.pollinations.ai/authorize?redirect_url=https://github.com/fkom13/opencode-pollinations-plugin) ๆžๅฎš่ฟ™ๆŠŠๆ— ๆ•Œ็š„็ฅžๅบ™้’ฅๅŒ™ (BYOK) ไปฅๆœ€ๅคงๅŒ–ๆ‚จ็š„ OpenCode ไฝ“้ชŒ!**
95
+
96
+ **ๅ…ทไฝ“ๆถˆ่ดนๅทฅไฝœๆตๅพช็Žฏ้กบๅบ๏ผš**
97
+ 1. ไผ˜ๅ…ˆไฝฟ็”จๆฏๅฐๆ—ถ็š„้›ถ่Šฑ้’ฑๅŸบ็ก€็ญ‰็บง (ไพ‹ๅฆ‚ไฝ ๆ˜ฏFlower,้‚ฃไนˆๅ‰ 0.40 ๐ŸŒป ็š„ๆถˆ่ดนๅ…จ็”ฑ่ฟ™ๅ—ๆŠฅ้”€)ใ€‚
98
+ 2. ๆŠฅ้”€ๅˆธ่ŠฑๅฎŒไบ†? ็ณป็ปŸ็ซ‹ๅˆปๅˆ‡ไธบไธ็”จ้’ฑๆ€ง่ƒฝ่พƒๆ…ขไธ€็‚น็‚น็š„ๅ…่ดน้€š้“ไธบไฝ ๆ‰“ๅทฅใ€‚
99
+ 3. ๅ€˜่‹ฅ่‡ชๅทฑ่ฟ˜ไนฐไบ†ๅขžๅ€ผๅ‚จๅ€ผ (Wallet), ็„ถๅŽ้‡ๅˆฐไป˜่ดนๅบ”็”จๆ‰ไฝฟ็”จ Wallet้‡Œ็œŸๆญฃ็š„่Šฑ็ฒ‰ใ€‚
100
+ 4. Boom! ๐Ÿ’ฅ ไธ‹ไธชๅฐๆ—ถๅผ€ๅง‹ไบ†, ๆ‰€ๆœ‰็š„้ขๅบฆ่กฅ็ป™็ซ‹ๅˆปๆ‹‰ๅˆฐๅ…จๆปก็Šถๆ€ใ€‚็ˆฝ๏ผ
101
+
102
+ ---
103
+
104
+ ## ๐ŸŒ ้ฆ–ๅ‘ๅ…จ็ƒๅŒ–ๆœฌๅœฐๆ”ฏๆŒ (i18n)
105
+
106
+ Pollinations for OpenCode ๅทฒๆไพ›ๆฏ่ฏญๅŽŸ็”Ÿ่ฏญ่จ€ๆ”ฏๆŒ๏ผŒๆฒŸ้€šๆ— ็ผ้กบ็•…:
107
+ - ๆ’ไปถไธป็จ‹ๅบ็š„ๅ†…้ƒจๆŽงๅˆถๆจกๅ—็•Œ้ขใ€ๆถˆๆฏๆจชๅน…ๆ้†’(Toasts)ใ€ๅ‘ฝไปคๅ‚ๆ•ฐ็•Œ้ขไธŽๅทฅๅ…ทๅ้ฆˆ้ƒฝๅทฒไธบๆ‚จ่ดดๅฟƒๅœฐๆ”ฏๆŒ **่‹ฑ่ฏญ**ใ€**ๆณ•่ฏญ**ใ€**่ฅฟ็ญ็‰™่ฏญ**ใ€**ๅพท่ฏญ**ใ€**ๆ„ๅคงๅˆฉ่ฏญ** ๅ’Œ **ไธญๆ–‡**ใ€‚
108
+ - ๅฏ้šๆ—ถไฝฟ็”จไธ€้”ฎ้ญ”ๆณ•ๅฃไปค `/poll config lang <en|fr|es|de|it|zh>`๏ผŒ็ปˆ็ซฏ็•Œ้ขไพฟ่ƒฝ็žฌๆฏ่ฝฌๆข่ฏญ็ณป็Šถๆ€ใ€‚
109
+
110
+ ---
111
+
112
+ ## ๐Ÿš€ ่ตทๆญฅๅ‘ๅฏผๆŒ‡ๅผ• (Onboarding)
113
+
114
+ ### ๐Ÿง 1. ่ทจๅนณๅฐ็ณป็ปŸ้ข„ๆกˆ้…็ฝฎ (NPM)
115
+ ๅ…จ็ณป็ปˆ็ซฏ็ณป็ปŸ้€šๅƒ **ๅฎŒๅ…จๆ”ฏๆŒ่ทจๅนณๅฐๆžถๆž„ๅ…ผๅฎน** (ๆถต็›– Windows, macOS, ไธŽ Linux)๏ผŒๅนถๆœ‰ๆŽข้’ˆ้šๆ—ถๆฃ€ๆต‹ OpenCode ๆœๅŠกๆ‰€ๅœจ็ฝ‘็ปœ็ซฏๅฃใ€‚
116
+
117
+ 1. ่ฟ›ๅ…ฅ็ณป็ปŸๅŽŸ็”ŸๅŽๅฐ(ไฝฟ็”จNode็š„ๅŒ…ๅผ•ๆ“Ž็ฎก็†)๏ผŒ้ƒจ็ฝฒไบŽๅ…ฌๅ…ฑ็Žฏๅขƒๅ˜้‡ๅ†…:
118
+ ```bash
119
+ npm install -g opencode-pollinations-plugin
120
+ ```
121
+ 2. ่ฐƒ็”จๅนถ่‡ชไธปๅŒน้…้…็ฝฎๆ–‡ไปถๆŒ‚่ฝฝๅ…ฅๅ…จๅฑ€็ณป็ปŸ:
122
+ ```bash
123
+ npx opencode-pollinations-plugin
124
+ ```
125
+ *(ๆœ‰ๅผบ่ฟซ็—‡ไนŸๅฏไปฅ่‡ชๅทฑๅŽปๅ†™ๅœจๆœฌๅœฐ้š่—็š„ๅญ˜ๆ”พๆ–‡ๆœฌๆ–‡ไปถ `~/.config/opencode/opencode.json` ้‡ŒไนŸๅฏไปฅ็š„)*
126
+
127
+ ### ๐Ÿ”‘ 2. ๅ…ฅๅœบๅˆๅง‹ๅŒ–ๅผ•ๅฏผ็•Œ้ข
128
+ ้ƒจ็ฝฒๅฅฝไบ†ไปฅๅŽๅฝ“ไฝ ็œ‹ๅ‘ OpenCode ไผš่ฏๆ ๏ผŒๅช้œ€่ฆ่ฟ™ๅฑ€็บฏๅ‘ฝไปค่กŒๅ‘Š่ฏ‰AI๏ผš
129
+ ```bash
130
+ /poll connect
131
+ ```
132
+ ็„ถๅŽๅฎƒไผšๅผ€ๅฏๆž็ฎ€ๅŒ–็š„ๅ…จ่‡ช้—ฎ่‡ช็ญ”ๅบ”็ญ”ไฝ“็ณปๅธฎไฝ ้…็ฝฎไธŠๆ–‡ไฝ ๆ‹ฟๅˆฐ็š„ Api KEY๏ผ*(ๅฆ‚ๆžœไฝ ็œ‹ๅˆฐ้‚ฃไธช้€‰ๅคงๆจกๅž‹้‚ฃไธชๆ‹‰ไธ‹็š„ UIๅ›พๅฝข็ป„ไปถ่ฟ˜ๆ˜ฏ้ป‘็š„ๅฐฑๅฟ…้กป้‡ๆ–ฐ่ฝฝๅ…ฅ้‡ๅฏๅฏๅŠจไธ€่พน OpenCode)*
133
+
134
+ ---
135
+
136
+ ## ๐Ÿ”— ็›ธๅ…ณ่”็ป“ๅŒบๅŸŸ
137
+
138
+ - **ๅŽป่Žทๅ–ไธ€ๆžš่ƒฝ่ฎฉไฝ ไธŠๅคฉ็š„ Pollen ็ง˜้’ฅๅง**: [pollinations.ai](https://pollinations.ai)
139
+ - **ๅœจ่ฟ™้‡Œๅคงๅ–Šๆ•‘ๅ‘ฝๆˆ–็‚ซ่€€ไฝœๅ“ (ๅฎ˜ๆ–นDiscord Discord)**: [ๆฌข่ฟŽๅŠ ๅ…ฅๅฎถๅบญ๏ผ](https://discord.gg/pollinations-ai-885844321461485618)
140
+ - **ๆŸฅ็œ‹็›ฎๅ‰ OpenCode ่ฟ™็‰‡็”Ÿๆœบๅ‹ƒๅ‹ƒ็š„ๅฎ‡ๅฎ™็”Ÿๆ€**: [opencode.ai](https://opencode.ai/docs/ecosystem#plugins)
141
+
142
+ ## ๐Ÿ“œ ๆบ็ ๆกไพ‹ไธŽ่ง„่Œƒ (License)
143
+
144
+ ๅ…จ้ข้ตๅพช MIT ๅผ€ๆบไธŽๅˆ†ไบซๅ่ฎฎ. ไปฃ็ ๆบไบŽ็ƒญ่ก€็š„ๅคงๅฐ† [fkom13](https://github.com/fkom13) & The Pollinations Community. ไธ€่ตทๅŠชๅŠ›้€ ่ฎฟๆœชๆฅๅง๏ผ
package/dist/index.js CHANGED
@@ -80,24 +80,20 @@ export const PollinationsPlugin = async (ctx) => {
80
80
  // START PROXY
81
81
  const port = await startProxy();
82
82
  const localBaseUrl = `http://127.0.0.1:${port}/v1`;
83
- // INIT MODEL REGISTRY (blocking now, so tools get patched BEFORE OpenCode registers them)
84
- try {
85
- await ModelRegistry.refresh();
83
+ // INIT MODEL REGISTRY (non-blocking, fire-and-forget)
84
+ ModelRegistry.refresh().then(() => {
86
85
  const stats = ModelRegistry.stats();
87
86
  log(`[ModelRegistry] Ready: ${stats.image} image, ${stats.video} video, ${stats.audio} audio, ${stats.text} text`);
88
- // Dรฉmarrage du patcher synchrone/asynchrone des descriptions des Outils (Phase 1.5)
89
- const workerModule = await import('./server/models/worker.js');
90
- workerModule.ToolRegistryWorker.start();
91
- log(`[ToolWorker] Started and patched tools for OpenCode.`);
92
- }
93
- catch (e) {
94
- log(`[ModelRegistry] Init failed (will use fallback): ${e}`);
95
- }
87
+ // Dรฉmarrage du patcher asynchrone des descriptions des Outils (Phase 1.5)
88
+ import('./server/models/worker.js').then(module => {
89
+ module.ToolRegistryWorker.start();
90
+ }).catch(e => log(`[ToolWorker] Failed to load worker: ${e}`));
91
+ }).catch(e => log(`[ModelRegistry] Init failed (will use fallback): ${e}`));
96
92
  setGlobalClient(ctx.client);
97
93
  setClientForCommands(ctx.client);
98
94
  const toastHooks = createToastHooks(ctx.client);
99
95
  const commandHooks = createCommandHooks();
100
- // Build tool registry (conditional on API key presence) AFTER tools have been patched
96
+ // Build tool registry (conditional on API key presence)
101
97
  const toolRegistry = createToolRegistry();
102
98
  log(`[Tools] ${Object.keys(toolRegistry).length} tools registered`);
103
99
  return {
@@ -104,7 +104,7 @@
104
104
  "tiers_title": "> **Your tiers:** {emoji} {tier}",
105
105
  "about": "## ๐ŸŒ What is pollinations.ai ?\npollinations.ai is an open-source AI platform built by and for the community. We provide a unified API for Image, Text, Audio, and Video. Everything is open: our code, roadmap, conversations. Hundreds of devs are already building apps, games, bots, and crazy experiments with us. Join us!\n\nNo black boxes. No vendor lock-in. Just a friendly API and a Discord full of helpful people.",
106
106
  "levels_title": "## ๐Ÿ“ˆ Upgrade Your Tier",
107
- "levels_list": "For developers creating with pollinations.ai. Level up to earn more daily Pollen.\n\n- ๐Ÿฆ  **Microbe** (0.1 pollen/day) : Sign up\n- ๐Ÿ„ **Spore** (1 pollen/day) : Automatic verification\n- ๐ŸŒฑ **Seed** (3 pollen/day) : 8+ dev points\n- ๐ŸŒธ **Flower** (10 pollen/day) : Publish an app\n- ๐Ÿฏ **Nectar** (20 pollen/day) : Coming soon ๐Ÿ”ฎ",
107
+ "levels_list": "For developers creating with pollinations.ai. Level up to earn more Pollen.\n\n{tier_table}\n\n> โš ๏ธ **v6.2.4+**: Quotas are now **hourly** (reset at :00). Daily quota is an estimate (~24h ร— hourly rate).",
108
108
  "beta_note": "โœจ *We are in beta! Learning what works best for our community.*",
109
109
  "pollen_title": "## ๐Ÿ’Ž What is Pollen ?",
110
110
  "pollen_get": "Running AI models costs money. Pollen is our way to keep servers running without ads or selling data. A simple, unified credit for all models โ€” predictable, transparent, no surprises.\n\n**$1 โ‰ˆ 1 Pollen** (prices subject to change). You spend it on API calls.",
@@ -104,7 +104,7 @@
104
104
  "tiers_title": "> **Your tiers:** {emoji} {tier}",
105
105
  "about": "## ๐ŸŒ Qu'est-ce que pollinations.ai ?\npollinations.ai est une plateforme d'IA open-source construite par et pour la communautรฉ. Nous offrons une API unifiรฉe pour les images, le texte, l'audio et la vidรฉo. Tout fonctionne de maniรจre ouverte : notre code, notre feuille de route, nos conversations. Des centaines de dรฉveloppeurs construisent dรฉjร  des outils, des jeux, des bots et des expรฉriences farfelues avec nous. Vous รชtes les bienvenus !\n\nPas de boรฎtes noires. Pas de dรฉpendance exclusive (vendor lock-in). Juste une API conviviale et un Discord rempli de personnes qui s'entraident rรฉellement.",
106
106
  "levels_title": "## ๐Ÿ“ˆ ร‰voluez votre Palier (Tier)",
107
- "levels_list": "Pour les dรฉveloppeurs qui crรฉent avec pollinations.ai. Montez de niveau pour gagner plus de Pollen quotidien.\n\n- ๐Ÿฆ  **Microbe** (0.1 pollen/jour) : Pour dรฉbloquer : S'inscrire\n- ๐Ÿ„ **Spore** (1 pollen/jour) : Pour dรฉbloquer : Vรฉrification automatique\n- ๐ŸŒฑ **Seed** (3 pollen/jour) : Pour dรฉbloquer : 8+ points dev\n- ๐ŸŒธ **Flower** (10 pollen/jour) : Pour dรฉbloquer : Publier une application\n- ๐Ÿฏ **Nectar** (20 pollen/jour) : Bientรดt disponible ๐Ÿ”ฎ",
107
+ "levels_list": "Pour les dรฉveloppeurs qui crรฉent avec pollinations.ai. Montez de niveau pour gagner plus de Pollen.\n\n{tier_table}\n\n> โš ๏ธ **Nouveau (v6.2.4)** : Les quotas sont maintenant **horaires** (reset ร  :00). Le quota journalier est une estimation (~24h ร— taux horaire).",
108
108
  "beta_note": "โœจ *Nous sommes en bรชta ! Nous apprenons ce qui fonctionne le mieux pour notre communautรฉ.*",
109
109
  "pollen_title": "## ๐Ÿ’Ž Qu'est-ce que le Pollen ?",
110
110
  "pollen_get": "Faire tourner des modรจles d'IA coรปte de l'argent. Le Pollen est notre moyen de faire fonctionner les serveurs sans publicitรฉ ni revente de vos donnรฉes. Un crรฉdit simple et unique pour tous les modรจles โ€” prรฉvisible, transparent, sans surprises.\n\n**$1 โ‰ˆ 1 Pollen** (les prix peuvent รฉvoluer). Vous le dรฉpensez pour faire des appels API.",
@@ -5,6 +5,7 @@ import { emitStatusToast } from './toast.js';
5
5
  import { generatePollinationsConfig } from './generate-config.js';
6
6
  import { ModelRegistry } from './models/index.js';
7
7
  import { t } from '../locales/index.js';
8
+ import { formatTierTable } from './tier-info.js';
8
9
  function checkEndpoint(ep, key) {
9
10
  return new Promise((resolve) => {
10
11
  const req = https.request({
@@ -689,6 +690,9 @@ export async function handleInfosCommand() {
689
690
  microbe: '๐Ÿฆ ', spore: '๐Ÿ„', seed: '๐ŸŒฑ', flower: '๐ŸŒธ', nectar: '๐Ÿฏ', anonymous: '๐Ÿ‘ค'
690
691
  };
691
692
  const tierEmoji = emojis[tier] || 'โ“';
693
+ // Get dynamic tier table based on user's language
694
+ const userLang = (config.lang || 'en');
695
+ const tierTable = formatTierTable(userLang);
692
696
  const response = `${t('commands.infos.title', { name })}
693
697
  ${t('commands.infos.features_title')}
694
698
  ${t('commands.infos.features_free')}
@@ -701,7 +705,10 @@ ${t('commands.infos.tiers_title', { emoji: tierEmoji, tier: tier.toUpperCase() }
701
705
  ${t('commands.infos.about')}
702
706
 
703
707
  ${t('commands.infos.levels_title')}
704
- ${t('commands.infos.levels_list')}
708
+
709
+ ${tierTable}
710
+
711
+ > โš ๏ธ **v6.2.4+** : Les quotas sont **horaires** (reset ร  :00). Le quota journalier est une estimation (~24h ร— taux horaire).
705
712
 
706
713
  ${t('commands.infos.beta_note')}
707
714
 
@@ -83,13 +83,14 @@ export async function generatePollinationsConfig(forceApiKey, forceStrict = fals
83
83
  if (effectiveKey && effectiveKey.length > 5 && effectiveKey !== 'dummy') {
84
84
  try {
85
85
  // Use /text/models for full metadata (input_modalities, tools, reasoning, pricing)
86
- // We fetch WITHOUT the Authorization header because the authenticated API currently filters out some models
87
- // like claude-airforce and step-3.5-flash. By fetching anonymously, we get the full list of 28 models.
88
- const enterListRaw = await fetchJson('https://gen.pollinations.ai/text/models', {});
86
+ const enterListRaw = await fetchJson('https://gen.pollinations.ai/text/models', {
87
+ 'Authorization': `Bearer ${effectiveKey}`
88
+ });
89
89
  const enterList = Array.isArray(enterListRaw) ? enterListRaw : (enterListRaw.data || []);
90
90
  const paidModels = [];
91
91
  enterList.forEach((m) => {
92
- // All models exposed โ€” no tool-based filtering
92
+ if (m.tools === false)
93
+ return;
93
94
  const mapped = mapModel(m, 'enter/', '');
94
95
  modelsOutput.push(mapped);
95
96
  if (m.paid_only) {
@@ -114,9 +114,7 @@ export async function fetchAllModels(apiKey) {
114
114
  const openapiPromise = fetchJson('https://enter.pollinations.ai/api/docs/open-api/generate-schema', headers).catch(() => ({}));
115
115
  const fetches = endpoints.map(async ({ url, fallbackCategory }) => {
116
116
  try {
117
- // Fetch model lists anonymously (no headers) to bypass API-side model filtering
118
- // which currently hides models like claude-airforce to authenticated users.
119
- const raw = await fetchJson(url, {});
117
+ const raw = await fetchJson(url, headers);
120
118
  return { url, fallbackCategory, raw };
121
119
  }
122
120
  catch (e) {
@@ -4,15 +4,16 @@ import { loadConfig } from './config.js';
4
4
  const CACHE_TTL = 30000; // 30 secondes
5
5
  let cachedQuota = null;
6
6
  let lastQuotaFetch = 0;
7
- const ONE_DAY_MS = 24 * 60 * 60 * 1000;
7
+ const ONE_HOUR_MS = 60 * 60 * 1000;
8
8
  const HISTORY_RETENTION_MS = 48 * 60 * 60 * 1000; // 48h history
9
- // === TIER LIMITS ===
9
+ // === TIER LIMITS (HOURLY) ===
10
+ // https://pollinations.ai/pricing - Quotas refreshed every hour
10
11
  const TIER_LIMITS = {
11
- microbe: { pollen: 0.1, emoji: '๐Ÿฆ ' },
12
- spore: { pollen: 1, emoji: '๐Ÿฆ ' },
13
- seed: { pollen: 3, emoji: '๐ŸŒฑ' },
14
- flower: { pollen: 10, emoji: '๐ŸŒธ' },
15
- nectar: { pollen: 20, emoji: '๐Ÿฏ' },
12
+ microbe: { pollen: 0.01, emoji: '๐Ÿฆ ' },
13
+ spore: { pollen: 0.01, emoji: '๐Ÿ„' },
14
+ seed: { pollen: 0.15, emoji: '๐ŸŒฑ' },
15
+ flower: { pollen: 0.4, emoji: '๐ŸŒธ' },
16
+ nectar: { pollen: 0.8, emoji: '๐Ÿฏ' },
16
17
  };
17
18
  // === LOGGING ===
18
19
  import { logApi } from './logger.js';
@@ -173,11 +174,11 @@ function fetchAPI(endpoint, apiKey) {
173
174
  }
174
175
  function calculateResetInfo(nextResetAt) {
175
176
  const nextReset = new Date(nextResetAt);
176
- const lastReset = new Date(nextReset.getTime() - ONE_DAY_MS);
177
+ const lastReset = new Date(nextReset.getTime() - ONE_HOUR_MS);
177
178
  const now = new Date();
178
179
  const timeUntilReset = Math.max(0, nextReset.getTime() - now.getTime());
179
180
  const timeSinceReset = Math.max(0, now.getTime() - lastReset.getTime());
180
- const progressPercent = Math.min(100, (timeSinceReset / ONE_DAY_MS) * 100);
181
+ const progressPercent = Math.min(100, (timeSinceReset / ONE_HOUR_MS) * 100);
181
182
  return {
182
183
  nextReset,
183
184
  lastReset,
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Tier Information - Central Configuration
3
+ *
4
+ * Hourly quota system (Pollinations API v2026-03)
5
+ * Quotas reset every hour at :00
6
+ */
7
+ export interface TierInfo {
8
+ name: string;
9
+ emoji: string;
10
+ hourlyPollen: number;
11
+ dailyEstimate: number;
12
+ condition: string;
13
+ conditionKey: string;
14
+ }
15
+ export declare const TIER_INFO: Record<string, TierInfo>;
16
+ /**
17
+ * Get tier info by name
18
+ */
19
+ export declare function getTierInfo(tierName: string): TierInfo | undefined;
20
+ /**
21
+ * Get all tiers as array (sorted by hourlyPollen)
22
+ */
23
+ export declare function getAllTiers(): TierInfo[];
24
+ /**
25
+ * Format tier list for display (markdown table)
26
+ */
27
+ export declare function formatTierTable(lang?: 'en' | 'fr' | 'es' | 'de' | 'it'): string;
28
+ /**
29
+ * Get dynamic tier description with hourly rates
30
+ */
31
+ export declare function getTierDescription(lang?: 'en' | 'fr' | 'es' | 'de' | 'it'): string;
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Tier Information - Central Configuration
3
+ *
4
+ * Hourly quota system (Pollinations API v2026-03)
5
+ * Quotas reset every hour at :00
6
+ */
7
+ export const TIER_INFO = {
8
+ microbe: {
9
+ name: 'Microbe',
10
+ emoji: '๐Ÿฆ ',
11
+ hourlyPollen: 0.01,
12
+ dailyEstimate: 0.24,
13
+ condition: 'Just register!',
14
+ conditionKey: 'tier.condition.signup',
15
+ },
16
+ spore: {
17
+ name: 'Spore',
18
+ emoji: '๐Ÿ„',
19
+ hourlyPollen: 0.01,
20
+ dailyEstimate: 0.24,
21
+ condition: 'Automatic verification',
22
+ conditionKey: 'tier.condition.auto_verify',
23
+ },
24
+ seed: {
25
+ name: 'Seed',
26
+ emoji: '๐ŸŒฑ',
27
+ hourlyPollen: 0.15,
28
+ dailyEstimate: 3.6,
29
+ condition: '8+ dev points (weekly auto-upgrade)',
30
+ conditionKey: 'tier.condition.dev_points',
31
+ },
32
+ flower: {
33
+ name: 'Flower',
34
+ emoji: '๐ŸŒธ',
35
+ hourlyPollen: 0.4,
36
+ dailyEstimate: 9.6,
37
+ condition: 'Publish an app',
38
+ conditionKey: 'tier.condition.publish_app',
39
+ },
40
+ nectar: {
41
+ name: 'Nectar',
42
+ emoji: '๐Ÿฏ',
43
+ hourlyPollen: 0.8,
44
+ dailyEstimate: 19.2,
45
+ condition: 'Coming soon ๐Ÿ”ฎ',
46
+ conditionKey: 'tier.condition.coming_soon',
47
+ },
48
+ };
49
+ /**
50
+ * Get tier info by name
51
+ */
52
+ export function getTierInfo(tierName) {
53
+ return TIER_INFO[tierName.toLowerCase()];
54
+ }
55
+ /**
56
+ * Get all tiers as array (sorted by hourlyPollen)
57
+ */
58
+ export function getAllTiers() {
59
+ return Object.values(TIER_INFO).sort((a, b) => a.hourlyPollen - b.hourlyPollen);
60
+ }
61
+ /**
62
+ * Format tier list for display (markdown table)
63
+ */
64
+ export function formatTierTable(lang = 'en') {
65
+ const tiers = getAllTiers();
66
+ const headers = {
67
+ en: '| Tier | Hourly | Daily (est.) | Condition |',
68
+ fr: '| Palier | Horaire | Journalier (est.) | Condition |',
69
+ es: '| Nivel | Por hora | Diario (est.) | Condiciรณn |',
70
+ de: '| Stufe | Pro Stunde | Tรคglich (ca.) | Bedingung |',
71
+ it: '| Livello | Orario | Giornaliero (stima) | Condizione |',
72
+ };
73
+ const separator = '|------|---------|----------------|-----------|';
74
+ const rows = tiers.map(tier => {
75
+ const conditionText = lang === 'fr' ? tier.condition : tier.condition;
76
+ return `| ${tier.emoji} **${tier.name}** | **${tier.hourlyPollen} pollen/h** | ~${tier.dailyEstimate}/day | ${conditionText} |`;
77
+ });
78
+ return [headers[lang], separator, ...rows].join('\n');
79
+ }
80
+ /**
81
+ * Get dynamic tier description with hourly rates
82
+ */
83
+ export function getTierDescription(lang = 'en') {
84
+ const isFrench = lang === 'fr';
85
+ const pollenWord = isFrench ? 'Pollen' : 'Pollen';
86
+ const perHour = isFrench ? '/heure' : '/hour';
87
+ const perDay = isFrench ? '/jour (est.)' : '/day (est.)';
88
+ const tiers = getAllTiers();
89
+ const lines = tiers.map(tier => {
90
+ const conditionText = isFrench ?
91
+ (tier.conditionKey === 'tier.condition.publish_app' ? '**Publier une App** (comme ce plugin !)' : tier.condition) :
92
+ tier.condition;
93
+ return `- ${tier.emoji} **${tier.name}** (**${tier.hourlyPollen} ${pollenWord}${perHour}** โ‰ˆ ~${tier.dailyEstimate}${perDay}) : ${conditionText}`;
94
+ });
95
+ return lines.join('\n');
96
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-pollinations-plugin",
3
3
  "displayName": "Pollinations",
4
- "version": "6.2.6",
4
+ "version": "6.2.7",
5
5
  "description": "Native Pollinations.ai Provider Plugin for OpenCode",
6
6
  "publisher": "pollinations",
7
7
  "repository": {
@@ -61,4 +61,4 @@
61
61
  "@types/qrcode": "^1.5.6",
62
62
  "typescript": "^5.0.0"
63
63
  }
64
- }
64
+ }