opencode-pollinations-plugin 6.1.0-beta.1 → 6.1.0-beta.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.
@@ -445,16 +445,17 @@ function handleConfigCommand(args) {
445
445
  }
446
446
  function handleHelpCommand() {
447
447
  const help = `
448
- ### 🌸 Pollinations Plugin - Commandes V5
448
+ ### 🌸 Pollinations Plugin - Commandes V6 (Economy/Pro)
449
449
 
450
- - **\`/pollinations mode [mode]\`**: Change le mode (manual, alwaysfree, pro).
450
+ - **\`/pollinations mode [mode]\`**: Change le mode (economy, pro, manual).
451
451
  - **\`/pollinations usage [full]\`**: Affiche le dashboard (full = détail).
452
- - **\`/pollinations fallback <main> [agent]\`**: Configure le Safety Net (Free).
452
+ - **\`/pollinations fallback [mode] [model]\`**: Configure le Safety Net pour economy/pro.
453
453
  - **\`/pollinations config [key] [value]\`**:
454
- - \`status_gui\`: none, alert, all (Status Dashboard).
455
- - \`logs_gui\`: none, error, verbose (Logs Techniques).
456
- - \`threshold_tier\`: 0-100 (Alerte %).
457
- - \`threshold_wallet\`: 0-100 (Safety Net %).
454
+ - \`threshold_tier\`: 0-100 (% Alerte Tier).
455
+ - \`threshold_wallet_warn\`: 0-100 (% Alerte Wallet Session).
456
+ - \`threshold_wallet_stop\`: Montage absolu $ (Stop Wallet).
457
+ - \`status_gui\`: none, alert, all.
458
+ - \`logs_gui\`: none, error, verbose.
458
459
  - \`status_bar\`: true/false (Widget).
459
460
  `.trim();
460
461
  return { handled: true, response: help };
@@ -53,10 +53,25 @@ function migrateConfig(config) {
53
53
  }
54
54
  // Migrate old fallbacks structure
55
55
  if (config.fallbacks?.free?.main) {
56
+ if (!config.fallbacks)
57
+ config.fallbacks = {};
56
58
  config.fallbacks.economy = config.fallbacks.free.main.replace('free/', '');
57
59
  delete config.fallbacks.free;
58
60
  logConfig('[Migration] fallbacks.free → fallbacks.economy');
59
61
  }
62
+ // Remove obsolete 'enter' fallback
63
+ if (config.fallbacks?.enter) {
64
+ delete config.fallbacks.enter;
65
+ logConfig('[Migration] Removed obsolete fallbacks.enter');
66
+ }
67
+ // Migrate old wallet threshold
68
+ if (config.thresholds?.wallet) {
69
+ if (!config.thresholds.wallet_warn) {
70
+ config.thresholds.wallet_warn = config.thresholds.wallet;
71
+ }
72
+ delete config.thresholds.wallet;
73
+ logConfig('[Migration] thresholds.wallet → thresholds.wallet_warn');
74
+ }
60
75
  return config;
61
76
  }
62
77
  // SIMPLE LOAD (Direct Disk Read - No Caching, No Watchers)
@@ -85,7 +100,15 @@ function readConfigFromDisk() {
85
100
  try {
86
101
  const raw = fs.readFileSync(CONFIG_FILE, 'utf-8');
87
102
  const custom = JSON.parse(raw);
88
- config = { ...config, ...migrateConfig(custom) };
103
+ const migrated = migrateConfig(custom);
104
+ // DEEP MERGE for nested objects to preserve defaults vs overrides
105
+ config = {
106
+ ...config,
107
+ ...migrated,
108
+ thresholds: { ...config.thresholds, ...(migrated.thresholds || {}) },
109
+ fallbacks: { ...config.fallbacks, ...(migrated.fallbacks || {}) },
110
+ gui: { ...config.gui, ...(migrated.gui || {}) }
111
+ };
89
112
  if (custom.apiKey && custom.apiKey.length > 5)
90
113
  configKey = custom.apiKey;
91
114
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-pollinations-plugin",
3
3
  "displayName": "Pollinations AI (V5.6)",
4
- "version": "6.1.0-beta.1",
4
+ "version": "6.1.0-beta.3",
5
5
  "description": "Native Pollinations.ai Provider Plugin for OpenCode",
6
6
  "publisher": "pollinations",
7
7
  "repository": {