opencode-pollinations-plugin 5.5.1 → 5.5.3
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/dist/index.js +1 -1
- package/dist/server/proxy.js +15 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -96,7 +96,7 @@ export const PollinationsPlugin = async (ctx) => {
|
|
|
96
96
|
config.provider = {};
|
|
97
97
|
config.provider['pollinations'] = {
|
|
98
98
|
id: 'pollinations',
|
|
99
|
-
name:
|
|
99
|
+
name: `Pollinations V${loadConfig().version} (Native)`,
|
|
100
100
|
options: { baseURL: localBaseUrl },
|
|
101
101
|
models: modelsObj
|
|
102
102
|
};
|
package/dist/server/proxy.js
CHANGED
|
@@ -211,6 +211,21 @@ export async function handleChatCompletion(req, res, bodyRaw) {
|
|
|
211
211
|
// LOAD QUOTA FOR SAFETY CHECKS
|
|
212
212
|
const { getQuotaStatus, formatQuotaForToast } = await import('./quota.js');
|
|
213
213
|
const quota = await getQuotaStatus(false);
|
|
214
|
+
// RUNTIME RESTRICTION ENFORCEMENT (V5.5.3)
|
|
215
|
+
// If we are in a Managed Mode (Pro/AlwaysFree) BUT the Quota returns 'error'
|
|
216
|
+
// (meaning Profile/Usage access failed or network issue), we MUST downgrade to Manual
|
|
217
|
+
// to avoid "Quota Unreachable" Fallbacks. The user wants to force Manual.
|
|
218
|
+
if ((config.mode === 'alwaysfree' || config.mode === 'pro') && quota.tier === 'error') {
|
|
219
|
+
log(`[SafetyNet] Runtime: Quota Access Lost (Tier=error). Forcing MANUAL Mode.`);
|
|
220
|
+
// 1. Update In-Memory Config (stops downstream fallbacks)
|
|
221
|
+
config.mode = 'manual';
|
|
222
|
+
config.keyHasAccessToProfile = false;
|
|
223
|
+
// 2. Persist
|
|
224
|
+
const { saveConfig } = await import('./config.js');
|
|
225
|
+
saveConfig({ mode: 'manual', keyHasAccessToProfile: false });
|
|
226
|
+
// 3. Notify
|
|
227
|
+
emitStatusToast('warning', "⚠️ Accès Quota Perdu -> Mode MANUAL forcé", "System");
|
|
228
|
+
}
|
|
214
229
|
// A. Resolve Base Target
|
|
215
230
|
if (actualModel.startsWith('enter/')) {
|
|
216
231
|
isEnterprise = true;
|
package/package.json
CHANGED