opencode-pollinations-plugin 6.0.0-beta.20 → 6.0.0-beta.21

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -214,14 +214,25 @@ export const PollinationsPlugin = async (ctx) => {
214
214
  return {
215
215
  // AUTH HOOK: Native /connect integration
216
216
  auth: createAuthHook(),
217
- // EVENT HOOK: Listen for auth/installation updates (triggered by /connect)
217
+ // EVENT HOOK: Listen for changes that might indicate /connect completed
218
218
  event: async ({ event }) => {
219
- log(`[Event] Received: ${event.type}`);
220
- // React to installation.updated (fired after /connect completes)
221
- if (event.type === 'installation.updated') {
222
- log('[Event] installation.updated detected - triggering hot-reload');
219
+ // Log only relevant events (auth-related)
220
+ if (event.type === 'installation.updated' ||
221
+ event.type === 'server.connected') {
222
+ log(`[Event] Relevant event: ${event.type}`);
223
223
  await refreshProviderConfig();
224
224
  }
225
+ // Also watch for tui.command.execute (when user types /connect)
226
+ // Note: This fires at START of /connect, not at completion
227
+ // The AuthHook handles the actual key update
228
+ if (event.type === 'tui.command.execute') {
229
+ const cmd = event.command || event.data?.command;
230
+ if (cmd === 'connect' || cmd === '/connect') {
231
+ log('[Event] /connect command detected - will refresh after auth hook completes');
232
+ // Small delay to let auth hook complete
233
+ setTimeout(() => refreshProviderConfig(), 2000);
234
+ }
235
+ }
225
236
  },
226
237
  async config(config) {
227
238
  log("[Hook] config() called");
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.0.0-beta.20",
4
+ "version": "6.0.0-beta.21",
5
5
  "description": "Native Pollinations.ai Provider Plugin for OpenCode",
6
6
  "publisher": "pollinations",
7
7
  "repository": {