opencode-pollinations-plugin 6.4.8 → 6.4.10
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 +17 -14
- package/README.es.md +17 -14
- package/README.fr.md +17 -14
- package/README.it.md +17 -14
- package/README.md +33 -34
- package/README.zh.md +17 -14
- package/bin/setup.js +139 -0
- package/dist/index.js +4 -6
- package/dist/locales/de.json +10 -4
- package/dist/locales/en.json +11 -4
- package/dist/locales/es.json +10 -4
- package/dist/locales/fr.json +11 -4
- package/dist/locales/it.json +10 -4
- package/dist/locales/zh.json +11 -4
- package/dist/server/commands.js +12 -71
- package/dist/server/config.js +1 -1
- package/dist/server/generate-config.js +2 -2
- package/dist/server/models/cache.js +3 -0
- package/dist/server/models/fetcher.d.ts +3 -2
- package/dist/server/models/fetcher.js +26 -4
- package/dist/server/models/types.d.ts +3 -1
- package/dist/server/proxy.js +8 -27
- package/dist/server/quota.d.ts +24 -0
- package/dist/server/quota.js +8 -2
- package/dist/server/scripts/pollinations_pricing.js +6 -3
- package/package.json +63 -62
package/README.de.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
# 🌸 Pollinations AI Plugin für OpenCode (v6.4)
|
|
1
|
+
# 🌸 Pollinations AI Plugin für OpenCode (v6.4.9)
|
|
2
2
|
|
|
3
|
-
## ✨ Neu in v6.4.
|
|
3
|
+
## ✨ Neu in v6.4.9
|
|
4
4
|
|
|
5
|
-
- 🎯 **Quests & Gamification
|
|
6
|
-
- 🆓 **Kostenlose
|
|
7
|
-
- `
|
|
8
|
-
- `
|
|
9
|
-
- `image_enhancer`
|
|
10
|
-
-
|
|
11
|
-
-
|
|
5
|
+
- 🎯 **Quests & Gamification**: `polli_quests` + `/poll quests`. Plugin-Nutzung erfüllt Quests **rückwirkend**.
|
|
6
|
+
- 🆓 **Kostenlose Tools (kein Schlüssel)** — für **jedes** OpenCode-Modell:
|
|
7
|
+
- `gen_edit_image_free` — generieren **und** bearbeiten (~20/Tag)
|
|
8
|
+
- `gen_video_free` — Text→Video (~5/Tag)
|
|
9
|
+
- `object_remover` / `image_upscaler` / `image_enhancer` — kostenlose Bildverarbeitung
|
|
10
|
+
- `remove_background` — kostenloses KI-Freistellen (rmbg / bgeraser)
|
|
11
|
+
- 🔐 **1-Klick-Login**: `/poll login` + `polli_login`. `/poll connect sk_...` bleibt verfügbar.
|
|
12
|
+
- 🧊 **Vollständiger Modellkatalog**: text, image, video, audio, **3D**, **embeddings**, realtime.
|
|
13
|
+
- 🧪 **CI + Packaging**: Node ≥ 18, CLI `npx opencode-pollinations-plugin`, Unit- + i18n-Tests.
|
|
14
|
+
- 🌍 **6 Sprachen**: en, fr, es, de, it, zh — Onboarding und Commands ausgerichtet.
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
<div align="center">
|
|
@@ -94,11 +97,11 @@ Das **Pollen 🌻** ist unser zentrales Kreditsystem (1$ ≈ 1 Pollen). Verbinde
|
|
|
94
97
|
|
|
95
98
|
| Tier (Stufe) | Stündliche Aufladung ⏱️ | Schätzung Tag* | Voraussetzung |
|
|
96
99
|
| :--- | :--- | :--- | :--- |
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
100
|
+
| 🍄 **Spore** | **0.01 Pollen / Std.** | ~0.24 / Tag | Neues Konto (Standard) |
|
|
101
|
+
| 🌱 **Seed** | **0.15 Pollen / Std.** | ~3.6 / Tag | Aktives Community-Mitglied |
|
|
102
|
+
| 🌸 **Flower** | **0.40 Pollen / Std.** | ~9.6 / Tag | Quests abschließen & beitragen |
|
|
103
|
+
| 🍯 **Nectar** | **0.80 Pollen / Std.** | ~19.2 / Tag | Top-Mitwirkender |
|
|
104
|
+
| 🐝 **Router** | **10 Pollen / Std.** | ~240 / Tag | Speziell / nur auf Einladung |
|
|
102
105
|
|
|
103
106
|
_*Tägliche Schätzungen sind nur Näherungswerte (~24h × Stundenrate). Das Reset findet automatisch zur vollen Stunde (XX:00) statt._
|
|
104
107
|
|
package/README.es.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
# 🌸 Pollinations AI Plugin para OpenCode (v6.4)
|
|
1
|
+
# 🌸 Pollinations AI Plugin para OpenCode (v6.4.9)
|
|
2
2
|
|
|
3
|
-
## ✨ Novedades v6.4.
|
|
3
|
+
## ✨ Novedades v6.4.9
|
|
4
4
|
|
|
5
|
-
- 🎯 **
|
|
6
|
-
- 🆓 **
|
|
7
|
-
- `
|
|
8
|
-
- `
|
|
9
|
-
- `image_enhancer`
|
|
10
|
-
-
|
|
11
|
-
-
|
|
5
|
+
- 🎯 **Quests & Gamificación**: `polli_quests` + `/poll quests`. Usar el plugin completa quests **retroactivamente**.
|
|
6
|
+
- 🆓 **Herramientas gratis (sin clave)** — para **cualquier** modelo OpenCode:
|
|
7
|
+
- `gen_edit_image_free` — generar **y** editar (~20/día)
|
|
8
|
+
- `gen_video_free` — texto→vídeo (~5/día)
|
|
9
|
+
- `object_remover` / `image_upscaler` / `image_enhancer` — procesado de imagen gratis
|
|
10
|
+
- `remove_background` — recorte IA gratis (rmbg / bgeraser)
|
|
11
|
+
- 🔐 **Login en 1 clic**: `/poll login` + `polli_login`. `/poll connect sk_...` sigue disponible.
|
|
12
|
+
- 🧊 **Catálogo completo**: text, image, video, audio, **3D**, **embeddings**, realtime.
|
|
13
|
+
- 🧪 **CI + packaging**: Node ≥ 18, CLI `npx opencode-pollinations-plugin`, tests unit + i18n.
|
|
14
|
+
- 🌍 **6 idiomas**: en, fr, es, de, it, zh — onboarding y comandos alineados.
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
<div align="center">
|
|
@@ -94,11 +97,11 @@ El **Pollen 🌻** dicta la ley unificada del crédito (1$ ≈ 1 Pollen). Sólo
|
|
|
94
97
|
|
|
95
98
|
| Tier | Recarga Hora ⏱️ | Aprox Diario* | Requisito a Cumplir |
|
|
96
99
|
| :--- | :--- | :--- | :--- |
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
100
|
+
| 🍄 **Spore** | **0.01 Pollen / hora** | ~0.24 /día | Cuenta nueva (predeterminado) |
|
|
101
|
+
| 🌱 **Seed** | **0.15 Pollen / hora** | ~3.6 /día | Miembro activo de la comunidad |
|
|
102
|
+
| 🌸 **Flower** | **0.40 Pollen / hora** | ~9.6 /día | Completa Misiones y contribuye |
|
|
103
|
+
| 🍯 **Nectar** | **0.80 Pollen / hora** | ~19.2 /día | Principal contribuidor |
|
|
104
|
+
| 🐝 **Router** | **10 Pollen / hora** | ~240 /día | Especial / solo por invitación |
|
|
102
105
|
|
|
103
106
|
_*Los cálculos diarios solo son estimaciones teóricas (~24h × cuota/hora). El reinicio limpio sucede exacto en el minuto `:00` de las horas del reloj._
|
|
104
107
|
|
package/README.fr.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
# 🌸 Plugin Pollinations AI pour OpenCode (v6.4)
|
|
1
|
+
# 🌸 Plugin Pollinations AI pour OpenCode (v6.4.9)
|
|
2
2
|
|
|
3
|
-
## ✨ Nouveautés v6.4.
|
|
3
|
+
## ✨ Nouveautés v6.4.9
|
|
4
4
|
|
|
5
|
-
- 🎯 **Quêtes & Gamification** : `polli_quests` + `/poll quests
|
|
6
|
-
- 🆓 **
|
|
7
|
-
- `
|
|
8
|
-
- `
|
|
9
|
-
- `image_enhancer`
|
|
10
|
-
-
|
|
11
|
-
-
|
|
5
|
+
- 🎯 **Quêtes & Gamification** : `polli_quests` + `/poll quests`. Utiliser le plugin complète des quêtes **rétroactivement**.
|
|
6
|
+
- 🆓 **Outils gratuits (sans clé)** — pour **n'importe quel** modèle OpenCode :
|
|
7
|
+
- `gen_edit_image_free` — génération **et** édition (~20/jour)
|
|
8
|
+
- `gen_video_free` — texte→vidéo (~5/jour)
|
|
9
|
+
- `object_remover` / `image_upscaler` / `image_enhancer` — traitement d'image gratuit
|
|
10
|
+
- `remove_background` — détourage IA gratuit (rmbg / bgeraser)
|
|
11
|
+
- 🔐 **Connexion 1 clic** : `/poll login` + `polli_login`. `/poll connect sk_...` reste disponible.
|
|
12
|
+
- 🧊 **Catalogue modèles complet** : text, image, video, audio, **3D**, **embeddings**, realtime.
|
|
13
|
+
- 🧪 **CI + packaging** : Node ≥ 18, CLI `npx opencode-pollinations-plugin`, tests unit + i18n.
|
|
14
|
+
- 🌍 **6 langues** : en, fr, es, de, it, zh — onboarding et commandes alignés.
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
<div align="center">
|
|
@@ -94,11 +97,11 @@ Le **Pollen 🌻** est notre système de crédit unifié (1$ ≈ 1 Pollen). En c
|
|
|
94
97
|
|
|
95
98
|
| Tier | Recharge Horaire ⏱️ | Estimation Jour* | Condition |
|
|
96
99
|
| :--- | :--- | :--- | :--- |
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
100
|
+
| 🍄 **Spore** | **0.01 Pollen / heure** | ~0.24 / jour | Nouveau compte (par défaut) |
|
|
101
|
+
| 🌱 **Seed** | **0.15 Pollen / heure** | ~3.6 / jour | Membre actif de la communauté |
|
|
102
|
+
| 🌸 **Flower** | **0.40 Pollen / heure** | ~9.6 / jour | Compléter des Quêtes et contribuer |
|
|
103
|
+
| 🍯 **Nectar** | **0.80 Pollen / heure** | ~19.2 / jour | Contributeur de premier plan |
|
|
104
|
+
| 🐝 **Router** | **10 Pollen / heure** | ~240 / jour | Spécial / sur invitation |
|
|
102
105
|
|
|
103
106
|
_*Les estimations quotidiennes sont approximatives (~24h × taux horaire). La réinitialisation réelle s'effectue automatiquement au début de chaque heure (XX:00)._
|
|
104
107
|
|
package/README.it.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
# 🌸 Pollinations AI Plugin per OpenCode (v6.4)
|
|
1
|
+
# 🌸 Pollinations AI Plugin per OpenCode (v6.4.9)
|
|
2
2
|
|
|
3
|
-
## ✨ Novità v6.4.
|
|
3
|
+
## ✨ Novità v6.4.9
|
|
4
4
|
|
|
5
|
-
- 🎯 **Quest
|
|
6
|
-
- 🆓 **
|
|
7
|
-
- `
|
|
8
|
-
- `
|
|
9
|
-
- `image_enhancer`
|
|
10
|
-
-
|
|
11
|
-
-
|
|
5
|
+
- 🎯 **Quest & Gamification**: `polli_quests` + `/poll quests`. Usare il plugin completa le quest **retroattivamente**.
|
|
6
|
+
- 🆓 **Strumenti gratis (senza chiave)** — per **qualsiasi** modello OpenCode:
|
|
7
|
+
- `gen_edit_image_free` — genera **e** modifica (~20/giorno)
|
|
8
|
+
- `gen_video_free` — testo→video (~5/giorno)
|
|
9
|
+
- `object_remover` / `image_upscaler` / `image_enhancer` — elaborazione immagini gratis
|
|
10
|
+
- `remove_background` — ritaglio IA gratis (rmbg / bgeraser)
|
|
11
|
+
- 🔐 **Login in 1 clic**: `/poll login` + `polli_login`. `/poll connect sk_...` resta disponibile.
|
|
12
|
+
- 🧊 **Catalogo modelli completo**: text, image, video, audio, **3D**, **embeddings**, realtime.
|
|
13
|
+
- 🧪 **CI + packaging**: Node ≥ 18, CLI `npx opencode-pollinations-plugin`, test unit + i18n.
|
|
14
|
+
- 🌍 **6 lingue**: en, fr, es, de, it, zh — onboarding e comandi allineati.
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
<div align="center">
|
|
@@ -94,11 +97,11 @@ Il **Pollen 🌻** è un sistema universale (1$ ≈ 1 Pollen). Immettendo una pr
|
|
|
94
97
|
|
|
95
98
|
| Tier (Livello) | Ricarica Oraria ⏱️ | Stima Giorno* | Requisito richiesto |
|
|
96
99
|
| :--- | :--- | :--- | :--- |
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
100
|
+
| 🍄 **Spore** | **0.01 Pollen / ora** | ~0.24 / giorno | Nuovo account (predefinito) |
|
|
101
|
+
| 🌱 **Seed** | **0.15 Pollen / ora** | ~3.6 / giorno | Membro attivo della community |
|
|
102
|
+
| 🌸 **Flower** | **0.40 Pollen / ora** | ~9.6 / giorno | Completa le Missioni e contribuisci |
|
|
103
|
+
| 🍯 **Nectar** | **0.80 Pollen / ora** | ~19.2 / giorno | Contributore di punta |
|
|
104
|
+
| 🐝 **Router** | **10 Pollen / ora** | ~240 / giorno | Speciale / solo su invito |
|
|
102
105
|
|
|
103
106
|
_*La stima giornaliera è puramente teorica (~24h × quota oraria). I Pollen si rinfrescano in modo corretto all'istante di ogni cambio ora (`:00`)._
|
|
104
107
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 🌸 Pollinations AI Plugin for OpenCode (v6.4)
|
|
1
|
+
# 🌸 Pollinations AI Plugin for OpenCode (v6.4.9)
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
<img src="https://avatars.githubusercontent.com/u/88394740?s=400&v=4" alt="Pollinations.ai Logo" width="180">
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
## ✨ What's new in v6.4?
|
|
30
|
+
## ✨ What's new in v6.4.9?
|
|
31
31
|
|
|
32
|
-
- 🎯 **Quests & Gamification**:
|
|
33
|
-
- 🆓 **Free
|
|
32
|
+
- 🎯 **Quests & Gamification**: `polli_quests` + `/poll quests`. Using this plugin completes several quests **retroactively** — free Pollen may already be waiting.
|
|
33
|
+
- 🆓 **Free tools (no key required)** — usable by **any** OpenCode model:
|
|
34
34
|
- `gen_edit_image_free` — generate **and edit** images (~20/day).
|
|
35
|
-
- `gen_video_free` — text-to-video
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
35
|
+
- `gen_video_free` — text-to-video (~5/day), optional first frame & audio.
|
|
36
|
+
- `object_remover` / `image_upscaler` / `image_enhancer` — free image processing.
|
|
37
|
+
- `remove_background` — free AI cutout (rmbg / bgeraser).
|
|
38
|
+
- 🔐 **1-Click Device Login**: `/poll login` + `polli_login` (like `gh auth login`). Manual `/poll connect sk_...` still works.
|
|
39
|
+
- 🧊 **Full model catalog**: text, image, video, audio, **3D**, **embeddings**, realtime.
|
|
40
|
+
- 🧪 **CI + packaging**: Node 18+ only (no VS Code leftovers), `npx opencode-pollinations-plugin` setup CLI restored, unit + i18n tests.
|
|
41
|
+
- 🌍 **6 languages**: en, fr, es, de, it, zh — onboarding, commands, and free-tool strings aligned.
|
|
42
42
|
|
|
43
43
|
---
|
|
44
44
|
|
|
@@ -56,7 +56,10 @@ Beyond text discussion, connecting your key gives OpenCode Agents access to our
|
|
|
56
56
|
### 🧰 Free Creator Bonus Tools (Always available — no API key needed)
|
|
57
57
|
- 🆓 `gen_edit_image_free` : Generate **and edit** images for free (~20/day, any model, no key).
|
|
58
58
|
- 🆓 `gen_video_free` : Free text-to-video with optional first-frame image & audio (~5/day, no key).
|
|
59
|
-
-
|
|
59
|
+
- 🧹 `object_remover` : Remove objects by prompt for free (30-120s, no key).
|
|
60
|
+
- 📐 `image_upscaler` : Upscale images 2x/4x for free (30-120s, no key).
|
|
61
|
+
- ✨ `image_enhancer` : AI image enhancement — denoise, sharpen, restore (30-120s, no key).
|
|
62
|
+
- ✂️ `remove_background` : AI background removal via rmbg (bgeraser.com) — free.
|
|
60
63
|
- 🛠️ `gen_qrcode`, `gen_diagram`, `gen_palette`, `extract_frames`, `extract_audio`, `file_to_url`: Dev utilities.
|
|
61
64
|
|
|
62
65
|
### 💻 Complete List of Terminal Commands
|
|
@@ -83,34 +86,29 @@ We have introduced fundamental protections to ensure your workflow never interru
|
|
|
83
86
|
|
|
84
87
|
---
|
|
85
88
|
|
|
86
|
-
## 🐝 Understanding
|
|
89
|
+
## 🐝 Understanding Quest Pollen & Hourly Refill
|
|
87
90
|
|
|
88
|
-
In the past, Pollinations
|
|
91
|
+
In the past, Pollinations relied on tier grants. Today, you earn free Pollen by completing **Quests** and get **hourly refills** based on your contribution level:
|
|
89
92
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
**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:
|
|
93
|
-
|
|
94
|
-
| Tier | Hourly Reload ⏱️ | Daily Estimate* | Condition |
|
|
93
|
+
| Level | Hourly Refill ⏱️ | Daily Estimate* | Condition |
|
|
95
94
|
| :--- | :--- | :--- | :--- |
|
|
96
|
-
|
|
|
97
|
-
| 🍄 **Spore** | **0.01 Pollen / hour** | ~0.24 / day | Automatic verification |
|
|
95
|
+
| 🍄 **Spore** | **0.01 Pollen / hour** | ~0.24 / day | New account (default) |
|
|
98
96
|
| 🌱 **Seed** | **0.15 Pollen / hour** | ~3.6 / day | Active community member |
|
|
99
|
-
| 🌸 **Flower** | **0.40 Pollen / hour** | ~9.6 / day |
|
|
97
|
+
| 🌸 **Flower** | **0.40 Pollen / hour** | ~9.6 / day | Complete Quests & contribute |
|
|
100
98
|
| 🍯 **Nectar** | **0.80 Pollen / hour** | ~19.2 / day | Top contributor |
|
|
101
99
|
| 🐝 **Router** | **10 Pollen / hour** | ~240 / day | Special / invite-only |
|
|
102
100
|
|
|
103
|
-
_*Daily estimates are approximate (~24h × hourly rate).
|
|
101
|
+
_*Daily estimates are approximate (~24h × hourly rate). Refill resets automatically at the top of every hour (XX:00). Quest Pollen lasts 12 months since last account activity._
|
|
104
102
|
|
|
105
|
-
> 🎯 **Earn
|
|
103
|
+
> 🎯 **Earn free Pollen by completing Quests!** Just using this plugin completes several quests retroactively. Run `/poll quests` to see what you can claim.
|
|
106
104
|
|
|
107
|
-
> 🎁 **Get your Free Personal Key (BYOK) on [Pollinations
|
|
105
|
+
> 🎁 **Get your Free Personal Key (BYOK) on [Pollinations](https://enter.pollinations.ai) to boost OpenCode!**
|
|
108
106
|
|
|
109
107
|
**How It Works:**
|
|
110
|
-
1. Your
|
|
111
|
-
2.
|
|
112
|
-
3.
|
|
113
|
-
4.
|
|
108
|
+
1. Your Quest Pollen (hourly refill + accumulated quest rewards) is consumed first on all regular models.
|
|
109
|
+
2. 💎 Paid-only models always use purchased Pollen.
|
|
110
|
+
3. When Quest Pollen is exhausted, the safety net gracefully switches you to free fallback variants.
|
|
111
|
+
4. ⏰ Refill resets at the top of the next hour.
|
|
114
112
|
|
|
115
113
|
---
|
|
116
114
|
|
|
@@ -125,17 +123,18 @@ Pollinations for OpenCode natively speaks your language:
|
|
|
125
123
|
## 🚀 Getting Started & Onboarding
|
|
126
124
|
|
|
127
125
|
### 🐧 1. Cross-Platform Configuration (NPM Installation)
|
|
128
|
-
This plugin is **fully cross-platform** (Windows, macOS, Linux) and
|
|
126
|
+
This plugin is **fully cross-platform** (Windows, macOS, Linux; Node **≥ 18**) and starts a local proxy on a dynamic port.
|
|
129
127
|
|
|
130
|
-
1.
|
|
128
|
+
1. Install (global or project-local):
|
|
131
129
|
```bash
|
|
132
130
|
npm install -g opencode-pollinations-plugin
|
|
133
131
|
```
|
|
134
|
-
2. Auto-
|
|
132
|
+
2. Auto-inject into OpenCode config:
|
|
135
133
|
```bash
|
|
136
134
|
npx opencode-pollinations-plugin
|
|
135
|
+
# or: npx opencode-pollinations-plugin --check
|
|
137
136
|
```
|
|
138
|
-
*(
|
|
137
|
+
*(Writes `opencode-pollinations-plugin` into `~/.config/opencode/opencode.json` — or `$OPENCODE_CONFIG_DIR/opencode.json`.)*
|
|
139
138
|
|
|
140
139
|
### 🔑 2. Interactive Onboarding
|
|
141
140
|
|
|
@@ -157,7 +156,7 @@ Create a **Secret** key yourself on [enter.pollinations.ai](https://enter.pollin
|
|
|
157
156
|
|
|
158
157
|
## 🔗 Links
|
|
159
158
|
|
|
160
|
-
- **
|
|
159
|
+
- **Dashboard**: [enter.pollinations.ai](https://enter.pollinations.ai)
|
|
161
160
|
- **Discord Community**: [Join us!](https://discord.gg/pollinations-ai-885844321461485618)
|
|
162
161
|
- **OpenCode Ecosystem**: [opencode.ai](https://opencode.ai/docs/ecosystem#plugins)
|
|
163
162
|
|
package/README.zh.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
# 🌸 Pollinations AI 插件 - OpenCode版 (v6.4)
|
|
1
|
+
# 🌸 Pollinations AI 插件 - OpenCode版 (v6.4.9)
|
|
2
2
|
|
|
3
|
-
## ✨ v6.4.
|
|
3
|
+
## ✨ v6.4.9 新功能
|
|
4
4
|
|
|
5
|
-
- 🎯
|
|
6
|
-
- 🆓
|
|
7
|
-
- `
|
|
8
|
-
- `
|
|
9
|
-
- `
|
|
10
|
-
-
|
|
11
|
-
-
|
|
5
|
+
- 🎯 **任务与游戏化**:`polli_quests` + `/poll quests`。使用本插件可**追溯**完成多项任务。
|
|
6
|
+
- 🆓 **免费工具(无需密钥)** — 适用于**任何** OpenCode 模型:
|
|
7
|
+
- `gen_edit_image_free` — 生成**与**编辑(约 20/天)
|
|
8
|
+
- `gen_video_free` — 文本→视频(约 5/天)
|
|
9
|
+
- `object_remover` / `image_upscaler` / `image_enhancer` — 免费图像处理
|
|
10
|
+
- `remove_background` — 免费 AI 抠图(rmbg / bgeraser)
|
|
11
|
+
- 🔐 **一键登录**:`/poll login` + `polli_login`。仍可用 `/poll connect sk_...`。
|
|
12
|
+
- 🧊 **完整模型目录**:text、image、video、audio、**3D**、**embeddings**、realtime。
|
|
13
|
+
- 🧪 **CI + 打包**:Node ≥ 18,CLI `npx opencode-pollinations-plugin`,单元 + i18n 测试。
|
|
14
|
+
- 🌍 **6 种语言**:en、fr、es、de、it、zh — 引导与命令对齐。
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
<div align="center">
|
|
@@ -94,11 +97,11 @@
|
|
|
94
97
|
|
|
95
98
|
| Tier (称号) | 每小时获取补贴量 ⏱️ | 无限循环参考值* | 达成条件 |
|
|
96
99
|
| :--- | :--- | :--- | :--- |
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
100
|
+
| 🍄 **Spore (孢子)** | **0.01 Pollen / 小时** | 每天约 ~0.24 | 新账户(默认) |
|
|
101
|
+
| 🌱 **Seed (树种)** | **0.15 Pollen / 小时** | 每天约 ~3.6 | 活跃的社区成员 |
|
|
102
|
+
| 🌸 **Flower (花朵)** | **0.40 Pollen / 小时** | 每天约 ~9.6 | 完成任务并贡献 |
|
|
103
|
+
| 🍯 **Nectar (花蜜)** | **0.80 Pollen / 小时** | 每天约 ~19.2 | 顶级贡献者 |
|
|
104
|
+
| 🐝 **Router (路由)** | **10 Pollen / 小时** | 每天约 ~240 | 特殊 / 仅限邀请 |
|
|
102
105
|
|
|
103
106
|
_*所列出每天近似最大总额建立在前置满消(~24h × hourly rate)为理论上限。真实的花粉量都会准时在零点过的一分钟 (XX:00) 统一灌满池子里。_
|
|
104
107
|
|
package/bin/setup.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* opencode-pollinations-plugin setup CLI
|
|
4
|
+
* Injects the plugin into ~/.config/opencode/opencode.json (or OPENCODE_CONFIG_DIR).
|
|
5
|
+
*/
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as os from 'os';
|
|
8
|
+
import * as path from 'path';
|
|
9
|
+
import { createRequire } from 'module';
|
|
10
|
+
import { fileURLToPath } from 'url';
|
|
11
|
+
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const pkg = require(path.join(__dirname, '..', 'package.json'));
|
|
15
|
+
|
|
16
|
+
const PLUGIN_SPEC = 'opencode-pollinations-plugin';
|
|
17
|
+
|
|
18
|
+
function getConfigPaths() {
|
|
19
|
+
const custom = process.env.OPENCODE_CONFIG_DIR;
|
|
20
|
+
const base = custom
|
|
21
|
+
? path.resolve(custom)
|
|
22
|
+
: path.join(os.homedir(), '.config', 'opencode');
|
|
23
|
+
return {
|
|
24
|
+
dir: base,
|
|
25
|
+
file: path.join(base, 'opencode.json'),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function loadJson(file) {
|
|
30
|
+
if (!fs.existsSync(file)) return {};
|
|
31
|
+
try {
|
|
32
|
+
return JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
33
|
+
} catch (e) {
|
|
34
|
+
console.error(`❌ Failed to parse ${file}: ${e.message}`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function saveJson(file, data) {
|
|
40
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
41
|
+
fs.writeFileSync(file, JSON.stringify(data, null, 2) + '\n', 'utf-8');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function ensurePlugin(config) {
|
|
45
|
+
const plugins = Array.isArray(config.plugin)
|
|
46
|
+
? [...config.plugin]
|
|
47
|
+
: Array.isArray(config.plugins)
|
|
48
|
+
? [...config.plugins]
|
|
49
|
+
: [];
|
|
50
|
+
|
|
51
|
+
const already = plugins.some((p) => {
|
|
52
|
+
if (typeof p === 'string') {
|
|
53
|
+
return p === PLUGIN_SPEC || p.includes('opencode-pollinations-plugin');
|
|
54
|
+
}
|
|
55
|
+
if (p && typeof p === 'object') {
|
|
56
|
+
const id = p.id || p.name || p.package || '';
|
|
57
|
+
return String(id).includes('opencode-pollinations-plugin');
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
if (!already) {
|
|
63
|
+
plugins.push(PLUGIN_SPEC);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Prefer singular "plugin" (OpenCode current) but keep existing key if present
|
|
67
|
+
if (Array.isArray(config.plugins) && !Array.isArray(config.plugin)) {
|
|
68
|
+
config.plugins = plugins;
|
|
69
|
+
} else {
|
|
70
|
+
config.plugin = plugins;
|
|
71
|
+
if (config.plugins) delete config.plugins;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return { config, already, count: plugins.length };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function printHelp() {
|
|
78
|
+
console.log(`
|
|
79
|
+
🌸 opencode-pollinations-plugin v${pkg.version}
|
|
80
|
+
|
|
81
|
+
Usage:
|
|
82
|
+
npx opencode-pollinations-plugin Inject plugin into OpenCode config
|
|
83
|
+
npx opencode-pollinations-plugin --check Check if plugin is already configured
|
|
84
|
+
npx opencode-pollinations-plugin --help Show this help
|
|
85
|
+
|
|
86
|
+
Config file:
|
|
87
|
+
$OPENCODE_CONFIG_DIR/opencode.json
|
|
88
|
+
or ~/.config/opencode/opencode.json
|
|
89
|
+
|
|
90
|
+
After install:
|
|
91
|
+
1. Restart OpenCode
|
|
92
|
+
2. Run: /poll login (or /poll connect sk_...)
|
|
93
|
+
3. Run: /poll help
|
|
94
|
+
`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function main() {
|
|
98
|
+
const args = process.argv.slice(2);
|
|
99
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
100
|
+
printHelp();
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const { dir, file } = getConfigPaths();
|
|
105
|
+
const checkOnly = args.includes('--check');
|
|
106
|
+
|
|
107
|
+
console.log(`🌸 Pollinations OpenCode Plugin v${pkg.version}`);
|
|
108
|
+
console.log(`📁 Config: ${file}`);
|
|
109
|
+
|
|
110
|
+
const config = loadJson(file);
|
|
111
|
+
const { config: next, already, count } = ensurePlugin(config);
|
|
112
|
+
|
|
113
|
+
if (checkOnly) {
|
|
114
|
+
if (already) {
|
|
115
|
+
console.log(`✅ Plugin already configured (${count} plugin entr${count === 1 ? 'y' : 'ies'})`);
|
|
116
|
+
process.exit(0);
|
|
117
|
+
}
|
|
118
|
+
console.log('❌ Plugin not found in config');
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (already) {
|
|
123
|
+
console.log('✅ Plugin already present in config — nothing to change.');
|
|
124
|
+
} else {
|
|
125
|
+
saveJson(file, next);
|
|
126
|
+
console.log('✅ Plugin injected into OpenCode config.');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
console.log(`
|
|
130
|
+
Next steps:
|
|
131
|
+
1. Restart OpenCode
|
|
132
|
+
2. /poll login # 1-click device login
|
|
133
|
+
or /poll connect sk_...
|
|
134
|
+
3. /poll help # commands & free tools
|
|
135
|
+
4. /poll quests # free Pollen waiting to claim
|
|
136
|
+
`);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
main();
|
package/dist/index.js
CHANGED
|
@@ -14,8 +14,6 @@ const sessionModels = new Map();
|
|
|
14
14
|
const startProxy = () => {
|
|
15
15
|
return new Promise((resolve) => {
|
|
16
16
|
const server = http.createServer(async (req, res) => {
|
|
17
|
-
// ... (Request Handling) ...
|
|
18
|
-
// We reuse the existing logic structure but simplified startup
|
|
19
17
|
log(`[Proxy] Request: ${req.method} ${req.url}`);
|
|
20
18
|
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
21
19
|
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
|
|
@@ -37,7 +35,7 @@ const startProxy = () => {
|
|
|
37
35
|
}
|
|
38
36
|
if (req.method === 'POST' && (req.url === '/v1/chat/completions' || req.url === '/chat/completions')) {
|
|
39
37
|
const chunks = [];
|
|
40
|
-
req.on('data', chunk => chunks.push(chunk));
|
|
38
|
+
req.on('data', (chunk) => chunks.push(chunk));
|
|
41
39
|
req.on('end', async () => {
|
|
42
40
|
try {
|
|
43
41
|
const bodyRaw = Buffer.concat(chunks).toString();
|
|
@@ -59,8 +57,8 @@ const startProxy = () => {
|
|
|
59
57
|
});
|
|
60
58
|
// Listen on random port (0) to avoid conflicts (CLI/IDE)
|
|
61
59
|
server.listen(0, '127.0.0.1', () => {
|
|
62
|
-
|
|
63
|
-
const assignedPort =
|
|
60
|
+
const addr = server.address();
|
|
61
|
+
const assignedPort = addr?.port ?? 0;
|
|
64
62
|
log(`[Proxy] Started v${require('../package.json').version} (Dynamic Port) on port ${assignedPort}`);
|
|
65
63
|
resolve(assignedPort);
|
|
66
64
|
});
|
|
@@ -85,7 +83,7 @@ export const PollinationsPlugin = async (ctx) => {
|
|
|
85
83
|
const configLocal = loadConfig();
|
|
86
84
|
await ModelRegistry.refresh(configLocal.apiKey);
|
|
87
85
|
const stats = ModelRegistry.stats();
|
|
88
|
-
log(`[ModelRegistry] Ready:
|
|
86
|
+
log(`[ModelRegistry] Ready: image=${stats.image} video=${stats.video} audio=${stats.audio} text=${stats.text} 3d=${stats['3d']} emb=${stats.embedding} rt=${stats.realtime}`);
|
|
89
87
|
// Initialisation synchrone du patcher des descriptions des Outils
|
|
90
88
|
const module = await import('./server/models/worker.js');
|
|
91
89
|
module.ToolRegistryWorker.start();
|
package/dist/locales/de.json
CHANGED
|
@@ -104,19 +104,22 @@
|
|
|
104
104
|
"image": "Bilder",
|
|
105
105
|
"video": "Videos",
|
|
106
106
|
"audio": "Audio",
|
|
107
|
-
"text": "Text & Chat"
|
|
107
|
+
"text": "Text & Chat",
|
|
108
|
+
"3d": "3D",
|
|
109
|
+
"embedding": "Embeddings",
|
|
110
|
+
"realtime": "Echtzeit"
|
|
108
111
|
},
|
|
109
112
|
"cat_title": "### {emoji} {label} ({count})",
|
|
110
113
|
"enter_headers1": "| Name | ID | Beschreibung | Flags | In | Out-Kosten |",
|
|
111
114
|
"enter_headers2": "|------|----|--------------|-------|----|------------|",
|
|
112
115
|
"capabilities": "\n**Capabilities :** `💎` Paid-only `💬` Chat/Reasoning `👁️` Vision/Images `🎙️` Audio `🔍` Search `💻` Code",
|
|
113
116
|
"other": "**Input :** `📝` Text `🖼️` Image `🎤` Audio",
|
|
114
|
-
"enter_error": "⚠️ Fehler beim Abrufen der
|
|
117
|
+
"enter_error": "⚠️ Fehler beim Abrufen der Enter-Modelle."
|
|
115
118
|
},
|
|
116
119
|
"infos": {
|
|
117
120
|
"title": "## 🍯💚 POLLINATIONS OPENCODE PLUGIN 💚🍯\n\nWillkommen **{name}** beim Pollinations OpenCode Plugin!\n\nDieses Plugin ermöglicht es, Code und Bilder zu generieren, Videos zu analysieren und nahtlos mit den besten KI-Modellen zu interagieren. Greifen Sie über Chat, Refactoring oder Terminal auf erstklassige LLMs zu.",
|
|
118
121
|
"features_title": "**Was dieses Plugin Ihnen bietet! :**",
|
|
119
|
-
"features_free": "**🛠️ Kostenlose Tools (Immer verfugbar):**\n- `gen_qrcode` / `gen_diagram` / `gen_palette` : Visuals und Dev-Tools.\n- `remove_background` : Hintergrundentfernung.\n- `extract_frames` / `extract_audio` : Medien-Extraktion.\n- `file_to_url` : Online-Hosting.\n- `gen_edit_image_free` : Kostenlose Bild-Generierung & Bearbeitung (~20/Tag).\n- `gen_video_free` : Kostenlose Video-Generierung (~5/Tag).\n- `object_remover` :
|
|
122
|
+
"features_free": "**🛠️ Kostenlose Tools (Immer verfugbar):**\n- `gen_qrcode` / `gen_diagram` / `gen_palette` : Visuals und Dev-Tools.\n- `remove_background` : KI-Hintergrundentfernung (rmbg / bgeraser — kostenlos).\n- `extract_frames` / `extract_audio` : Medien-Extraktion.\n- `file_to_url` : Online-Hosting.\n- `gen_edit_image_free` : Kostenlose Bild-Generierung & Bearbeitung (~20/Tag).\n- `gen_video_free` : Kostenlose Video-Generierung (~5/Tag).\n- `object_remover` : Objekte per Prompt entfernen (kostenlos, direkt).\n- `image_upscaler` : Hochskalierung 2x/4x (kostenlos, direkt).\n- `image_enhancer` : KI-Bildverbesserung (kostenlos, direkt).",
|
|
120
123
|
"features_pro": "**💎 Pollinations Tools (Premium - Automatisiert mit Key):**\n- `polli_gen_image` : Bildgen (Flux, Gemini) + Image-to-Image.\n- `polli_gen_video` : Text-to-Video / Image-to-Video (Veo, Wan...).\n- `polli_gen_audio`/`polli_stt` : Whisper STT, ElevenLabs TTS.\n- `polli_gen_music` : Generative Musik-Engine.\n- `polli_web_search` : Verbundene Websuche.",
|
|
121
124
|
"features_config": "- **Granulare Konfiguration**, Modus- und Token-Management, Kostenschutz...",
|
|
122
125
|
"tiers_title": "> **Dein Quest Pollen Refill:** {emoji} {tier}",
|
|
@@ -469,7 +472,7 @@
|
|
|
469
472
|
"resources": "### 📚 Ressourcen\n* **Dashboard:** enter.pollinations.ai\n* **Discord:** Community beitreten\n* **Plugin:** github.com/fkom13/opencode-pollinations-plugin",
|
|
470
473
|
"free_models_success": "Verfügbare Modelle: {models}",
|
|
471
474
|
"free_models_error": "⚠️ Modelle konnten nicht abgerufen werden.",
|
|
472
|
-
"onboarding": "## 🌸 Willkommen beim Pollinations-Plugin\n\n**Sofortiger kostenloser Zugang — kein Schlüssel nötig**\nDieses Plugin bietet eine vollständige Umgebung für Chat, Codegenerierung und Medienbearbeitung (Bild-, Video-, Audiogenerierung, Extraktionstools...).\n\nWähle ein `pollinations/free/*`-Modell aus der Liste und beginne zu chatten.\n{freeText}\n\n**🆓 Kostenlose Bonus-Tools (kein Schlüssel):** `gen_edit_image_free
|
|
475
|
+
"onboarding": "## 🌸 Willkommen beim Pollinations-Plugin\n\n**Sofortiger kostenloser Zugang — kein Schlüssel nötig**\nDieses Plugin bietet eine vollständige Umgebung für Chat, Codegenerierung und Medienbearbeitung (Bild-, Video-, Audiogenerierung, Extraktionstools...).\n\nWähle ein `pollinations/free/*`-Modell aus der Liste und beginne zu chatten.\n{freeText}\n\n**🆓 Kostenlose Bonus-Tools (kein Schlüssel):** `gen_edit_image_free`, `gen_video_free`, `object_remover`, `image_upscaler`, `image_enhancer`, `remove_background` — gratis Bild/Video + lokale Verarbeitung.\n\n---\n\n## 🚀 Multimedia-Agenten und Tools für Entwickler\n\nClaude Opus, GPT-5, Gemini 3, Veo & Wan Videogenerierung, ElevenLabs Musik... entfessle die volle Kraft der Pollinations-API!\n\nDieses Plugin nutzt ein **BYOK**-Modell (Bring Your Own Key): mit deinem eigenen API-Schlüssel kann der OpenCode-Agent direkt mit Premium-Tools interagieren und deine Mediendateien in deinem Workspace erstellen.\n\n**Schritt 1 — Kostenloses Konto erstellen**\n👉 **https://enter.pollinations.ai**\n\n**Schritt 2 — API-Schlüssel generieren**\nErstelle im Bereich **API Keys** auf `enter.pollinations.ai` einen **Secret**-Schlüssel (`sk_...`).\n\n**Schritt 3 — Schlüssel verbinden**\n```bash\n/poll connect sk_dein_schluessel\n```\n*(Der Schlüssel wird sofort in deiner OpenCode-Umgebung registriert und schaltet Pro-Modelle frei!)*\n\n---\n\n## 💰 Pollen, Stufen & Quests\nDeine **Stufe** gibt dir ein stündliches kostenloses Pollen-Guthaben (z. B. 🌸 Flower ≈ 0,4/h). Zusätzlich belohnen dich **Quests** mit kostenlosem Pollen — und allein die Nutzung dieses Plugins schließt mehrere rückwirkend ab! Siehe `/poll quests`.\n\nWenn das kostenlose Pollen aufgebraucht ist, zahlst du aus deiner Wallet ($1 ≈ 1 Pollen, kein Abo, kein Ablauf).\n\n**Hilfe?** Gib `/poll help` ein. Offizieller Discord: https://discord.gg/pollinations-ai-885844321461485618"
|
|
473
476
|
},
|
|
474
477
|
"cost_guard": {
|
|
475
478
|
"cost_validated_max": "💰 Kosten validiert (Theoretisches Max: {maxCost})",
|
|
@@ -485,7 +488,10 @@
|
|
|
485
488
|
"condition": {
|
|
486
489
|
"signup": "Einfach registrieren!",
|
|
487
490
|
"auto_verify": "Automatische Verifizierung",
|
|
491
|
+
"under_review": "Konto wird überprüft",
|
|
492
|
+
"default": "Neues Konto (Standard)",
|
|
488
493
|
"community": "Aktives Community-Mitglied",
|
|
494
|
+
"quests": "Quests abschließen & beitragen",
|
|
489
495
|
"publish_app": "Eine App veröffentlichen",
|
|
490
496
|
"top_contributor": "Top-Mitwirkender",
|
|
491
497
|
"special": "Speziell / nur auf Einladung"
|