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.de.md +85 -71
- package/README.es.md +95 -81
- package/README.fr.md +76 -62
- package/README.it.md +90 -76
- package/README.md +60 -50
- package/README.zh.md +144 -0
- package/dist/index.js +8 -12
- package/dist/locales/en.json +1 -1
- package/dist/locales/fr.json +1 -1
- package/dist/server/commands.js +8 -1
- package/dist/server/generate-config.js +5 -4
- package/dist/server/models/fetcher.js +1 -3
- package/dist/server/quota.js +10 -9
- package/dist/server/tier-info.d.ts +31 -0
- package/dist/server/tier-info.js +96 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,55 +1,58 @@
|
|
|
1
|
-
# ๐ธ Pollinations AI Plugin for OpenCode (v6.2.
|
|
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="
|
|
5
|
-
<
|
|
6
|
-
<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
|
-
](https://www.npmjs.com/package/opencode-pollinations-plugin)
|
|
12
|
+
[](https://www.npmjs.com/package/opencode-pollinations-plugin)
|
|
13
|
+
[](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
|
-
|
|
25
|
-
- **
|
|
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?
|
|
30
|
-
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
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
|
|
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`, `
|
|
42
|
-
- `polli_gen_video` : Powerful Text-to-Video and Image-to-Video
|
|
43
|
-
- `polli_gen_audio` & `polli_gen_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
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
104
|
+
## ๐ Native Multilingual Support (i18n)
|
|
95
105
|
|
|
96
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
+
[](https://www.npmjs.com/package/opencode-pollinations-plugin)
|
|
12
|
+
[](https://www.npmjs.com/package/opencode-pollinations-plugin)
|
|
13
|
+
[](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
|
|
84
|
-
|
|
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
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
log(`[ToolWorker]
|
|
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)
|
|
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 {
|
package/dist/locales/en.json
CHANGED
|
@@ -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
|
|
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.",
|
package/dist/locales/fr.json
CHANGED
|
@@ -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
|
|
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.",
|
package/dist/server/commands.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|
package/dist/server/quota.js
CHANGED
|
@@ -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
|
|
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.
|
|
12
|
-
spore: { pollen:
|
|
13
|
-
seed: { pollen:
|
|
14
|
-
flower: { pollen:
|
|
15
|
-
nectar: { pollen:
|
|
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() -
|
|
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 /
|
|
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.
|
|
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
|
+
}
|