opencode-pollinations-plugin 6.2.5 → 6.2.6

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 +12 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -80,20 +80,24 @@ 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 now, so tools get patched BEFORE OpenCode registers them)
84
+ try {
85
+ await ModelRegistry.refresh();
85
86
  const stats = ModelRegistry.stats();
86
87
  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}`));
88
+ // Démarrage du patcher synchrone/asynchrone des descriptions des Outils (Phase 1.5)
89
+ const workerModule = await import('./server/models/worker.js');
90
+ workerModule.ToolRegistryWorker.start();
91
+ log(`[ToolWorker] Started and patched tools for OpenCode.`);
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);
95
99
  const commandHooks = createCommandHooks();
96
- // Build tool registry (conditional on API key presence)
100
+ // Build tool registry (conditional on API key presence) AFTER tools have been patched
97
101
  const toolRegistry = createToolRegistry();
98
102
  log(`[Tools] ${Object.keys(toolRegistry).length} tools registered`);
99
103
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-pollinations-plugin",
3
3
  "displayName": "Pollinations",
4
- "version": "6.2.5",
4
+ "version": "6.2.6",
5
5
  "description": "Native Pollinations.ai Provider Plugin for OpenCode",
6
6
  "publisher": "pollinations",
7
7
  "repository": {