opencode-pollinations-plugin 6.2.5 → 6.2.7-1

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,15 +80,19 @@ 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 (non-blocking, fire-and-forget)
84
- ModelRegistry.refresh().then(() => {
83
+ // INIT MODEL REGISTRY (blocking, requires full load before tools are exported)
84
+ try {
85
+ const configLocal = loadConfig();
86
+ await ModelRegistry.refresh(configLocal.apiKey);
85
87
  const stats = ModelRegistry.stats();
86
88
  log(`[ModelRegistry] Ready: ${stats.image} image, ${stats.video} video, ${stats.audio} audio, ${stats.text} text`);
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}`));
89
+ // Initialisation synchrone du patcher des descriptions des Outils
90
+ const module = await import('./server/models/worker.js');
91
+ module.ToolRegistryWorker.start();
92
+ }
93
+ catch (e) {
94
+ log(`[ModelRegistry] Init failed (will use fallback): ${e}`);
95
+ }
92
96
  setGlobalClient(ctx.client);
93
97
  setClientForCommands(ctx.client);
94
98
  const toastHooks = createToastHooks(ctx.client);
@@ -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
 
@@ -2,6 +2,7 @@ import * as https from 'https';
2
2
  import * as fs from 'fs';
3
3
  import * as path from 'path';
4
4
  import { loadConfig, CONFIG_FILE } from './config.js';
5
+ import { ModelRegistry } from './models/cache.js';
5
6
  import { log as logSystem } from './logger.js';
6
7
  // --- LOGGING ---
7
8
  function log(msg) {
@@ -82,14 +83,12 @@ export async function generatePollinationsConfig(forceApiKey, forceStrict = fals
82
83
  // 2. ENTERPRISE UNIVERSE
83
84
  if (effectiveKey && effectiveKey.length > 5 && effectiveKey !== 'dummy') {
84
85
  try {
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', {});
89
- const enterList = Array.isArray(enterListRaw) ? enterListRaw : (enterListRaw.data || []);
86
+ // Utilise le cache centralisé fusionné (V1 + Détaillé) au lieu de re-télécharger
87
+ const enterList = ModelRegistry.list('text');
90
88
  const paidModels = [];
91
89
  enterList.forEach((m) => {
92
- // All models exposed — no tool-based filtering
90
+ if (m.tools === false)
91
+ return; // OpenCode UI chat nécessite explicitement les tools
93
92
  const mapped = mapModel(m, 'enter/', '');
94
93
  modelsOutput.push(mapped);
95
94
  if (m.paid_only) {
@@ -19,7 +19,7 @@ const STATIC_FALLBACK = [
19
19
  { name: 'klein', description: 'FLUX.2 Klein 4B', category: 'image', aliases: [], pricing: { currency: 'pollen', completionImageTokens: 0.008 }, paid_only: false, supportsI2X: true, outputType: 'image', input_modalities: ['text', 'image'], output_modalities: ['image'], costHeader: 'x-usage-completion-image-tokens' },
20
20
  { name: 'kontext', description: 'FLUX.1 Kontext', category: 'image', aliases: [], pricing: { currency: 'pollen', completionImageTokens: 0.04 }, paid_only: true, supportsI2X: true, outputType: 'image', input_modalities: ['text', 'image'], output_modalities: ['image'], costHeader: 'x-usage-completion-image-tokens' },
21
21
  // Video — essential
22
- { name: 'grok-video', description: 'Grok Video', category: 'video', aliases: [], pricing: { currency: 'pollen', completionVideoSeconds: 0.0025 }, paid_only: false, supportsI2X: true, outputType: 'video', input_modalities: ['text', 'image'], output_modalities: ['video'], durationRange: [1, 15], aspectRatios: ['16:9', '9:16', '1:1', '4:3'], costHeader: 'x-usage-completion-video-seconds', genTimeEstimate: '~10s' },
22
+ { name: 'grok-video-pro', description: 'Grok Video Pro', category: 'video', aliases: [], pricing: { currency: 'pollen', completionVideoSeconds: 0.0025 }, paid_only: false, supportsI2X: true, outputType: 'video', input_modalities: ['text', 'image'], output_modalities: ['video'], durationRange: [1, 15], aspectRatios: ['16:9', '9:16', '1:1', '4:3'], costHeader: 'x-usage-completion-video-seconds', genTimeEstimate: '~10s' },
23
23
  { name: 'veo', description: 'Veo 3.1 Fast', category: 'video', aliases: [], pricing: { currency: 'pollen', completionVideoSeconds: 0.15 }, paid_only: true, supportsI2X: true, outputType: 'video', input_modalities: ['text', 'image'], output_modalities: ['video'], durationRange: [4, 8], aspectRatios: ['16:9', '9:16', '1:1'], costHeader: 'x-usage-completion-video-seconds', genTimeEstimate: '~45-68s' },
24
24
  // Audio — essential
25
25
  { name: 'elevenlabs', description: 'ElevenLabs v3 TTS', category: 'audio', aliases: [], pricing: { currency: 'pollen', completionAudioTokens: 0.00018 }, paid_only: false, supportsI2X: false, outputType: 'audio', input_modalities: ['text'], output_modalities: ['audio'] },
@@ -78,7 +78,7 @@ function mapRawToModel(raw, fallbackCategory, averageCost) {
78
78
  tools: raw.tools,
79
79
  reasoning: raw.reasoning,
80
80
  is_specialized: raw.is_specialized,
81
- context_window: raw.context_window,
81
+ context_window: raw.context_window || raw.context_length,
82
82
  averageCost: averageCost !== undefined && !isNaN(averageCost) ? averageCost : undefined,
83
83
  };
84
84
  // Apply local patches from manual.ts
@@ -112,11 +112,10 @@ export async function fetchAllModels(apiKey) {
112
112
  ];
113
113
  const statsPromise = fetchJson('https://enter.pollinations.ai/api/model-stats', headers).catch(() => ({ data: [] }));
114
114
  const openapiPromise = fetchJson('https://enter.pollinations.ai/api/docs/open-api/generate-schema', headers).catch(() => ({}));
115
+ const v1ModelsPromise = fetchJson('https://gen.pollinations.ai/v1/models', headers).catch(() => ({ data: [] }));
115
116
  const fetches = endpoints.map(async ({ url, fallbackCategory }) => {
116
117
  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, {});
118
+ const raw = await fetchJson(url, headers);
120
119
  return { url, fallbackCategory, raw };
121
120
  }
122
121
  catch (e) {
@@ -124,9 +123,16 @@ export async function fetchAllModels(apiKey) {
124
123
  return { url, fallbackCategory, raw: [] };
125
124
  }
126
125
  });
127
- const resultsRaw = await Promise.all([...fetches, statsPromise, openapiPromise]);
126
+ const resultsRaw = await Promise.all([...fetches, statsPromise, openapiPromise, v1ModelsPromise]);
127
+ const v1ModelsRaw = resultsRaw.pop();
128
128
  const openapiRaw = resultsRaw.pop();
129
129
  const statsRaw = resultsRaw.pop();
130
+ // Index V1 endpoints to extract structural modalities and properties
131
+ const v1List = Array.isArray(v1ModelsRaw) ? v1ModelsRaw : (v1ModelsRaw?.data || []);
132
+ const v1Map = new Map();
133
+ for (const v of v1List) {
134
+ v1Map.set(v.id || v.name, v);
135
+ }
130
136
  const statsList = Array.isArray(statsRaw?.data) ? statsRaw.data : [];
131
137
  const statsMap = new Map();
132
138
  for (const s of statsList) {
@@ -139,6 +145,20 @@ export async function fetchAllModels(apiKey) {
139
145
  for (const item of list) {
140
146
  const modelId = item.name || item.id;
141
147
  const avgCost = statsMap.get(modelId);
148
+ const v1Item = v1Map.get(modelId);
149
+ // Merge structuraux de la V1 vers l'Item
150
+ if (v1Item) {
151
+ if (v1Item.input_modalities)
152
+ item.input_modalities = v1Item.input_modalities;
153
+ if (v1Item.output_modalities)
154
+ item.output_modalities = v1Item.output_modalities;
155
+ if (v1Item.context_length)
156
+ item.context_length = v1Item.context_length;
157
+ if (v1Item.tools !== undefined)
158
+ item.tools = v1Item.tools;
159
+ if (v1Item.reasoning !== undefined)
160
+ item.reasoning = v1Item.reasoning;
161
+ }
142
162
  const model = mapRawToModel(item, res.fallbackCategory, avgCost);
143
163
  const uniqueId = model.name;
144
164
  if (!seen.has(uniqueId)) {
@@ -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;