opencode-pollinations-plugin 5.1.19 → 5.1.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.
- package/bin/setup.js +9 -0
- package/dist/server/config.d.ts +1 -1
- package/dist/server/config.js +2 -2
- package/package.json +2 -1
package/bin/setup.js
CHANGED
|
@@ -7,6 +7,15 @@ import { fileURLToPath } from 'url';
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
8
|
const __dirname = path.dirname(__filename);
|
|
9
9
|
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
|
|
12
|
+
// VERSION CHECK
|
|
13
|
+
if (args.includes('--version') || args.includes('-v')) {
|
|
14
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'), 'utf8'));
|
|
15
|
+
console.log(pkg.version);
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}
|
|
18
|
+
|
|
10
19
|
console.log('🌸 Pollinations Plugin Setup');
|
|
11
20
|
|
|
12
21
|
// 1. Locate Config
|
package/dist/server/config.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface PollinationsConfigV5 {
|
|
|
25
25
|
export declare function subscribeToConfigChange(callback: () => void): void;
|
|
26
26
|
export declare function loadConfig(): PollinationsConfigV5;
|
|
27
27
|
export declare function saveConfig(updates: Partial<PollinationsConfigV5>): {
|
|
28
|
-
version:
|
|
28
|
+
version: string;
|
|
29
29
|
mode: "manual" | "alwaysfree" | "pro";
|
|
30
30
|
apiKey?: string;
|
|
31
31
|
gui: {
|
package/dist/server/config.js
CHANGED
|
@@ -172,13 +172,13 @@ function readConfigFromDisk() {
|
|
|
172
172
|
if (!keyFound && config.mode === 'pro') {
|
|
173
173
|
config.mode = 'manual';
|
|
174
174
|
}
|
|
175
|
-
return config;
|
|
175
|
+
return { ...config, version: PKG_VERSION };
|
|
176
176
|
}
|
|
177
177
|
export function saveConfig(updates) {
|
|
178
178
|
try {
|
|
179
179
|
// We must base updates on current state (even if cached is slightly old, we refresh first?)
|
|
180
180
|
const current = readConfigFromDisk(); // Read disk for safety before write
|
|
181
|
-
const updated = { ...current, ...updates, version:
|
|
181
|
+
const updated = { ...current, ...updates, version: PKG_VERSION };
|
|
182
182
|
if (!fs.existsSync(CONFIG_DIR_POLLI)) {
|
|
183
183
|
fs.mkdirSync(CONFIG_DIR_POLLI, { recursive: true });
|
|
184
184
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-pollinations-plugin",
|
|
3
3
|
"displayName": "Pollinations AI (V5.1)",
|
|
4
|
-
"version": "5.1.
|
|
4
|
+
"version": "5.1.21",
|
|
5
5
|
"description": "Native Pollinations.ai Provider Plugin for OpenCode",
|
|
6
6
|
"publisher": "pollinations",
|
|
7
7
|
"repository": {
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsc",
|
|
31
|
+
"prepare": "npm run build",
|
|
31
32
|
"package": "npx vsce package"
|
|
32
33
|
},
|
|
33
34
|
"contributes": {
|