opencode-pollinations-plugin 5.8.0 → 5.8.2
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/server/generate-config.d.ts +4 -0
- package/dist/server/generate-config.js +55 -15
- package/package.json +1 -1
- package/dist/debug_check.js +0 -36
- package/dist/provider.d.ts +0 -1
- package/dist/provider.js +0 -135
- package/dist/provider_v1.d.ts +0 -1
- package/dist/provider_v1.js +0 -135
- package/dist/test-require.js +0 -9
|
@@ -8,6 +8,10 @@ interface OpenCodeModel {
|
|
|
8
8
|
context?: number;
|
|
9
9
|
output?: number;
|
|
10
10
|
};
|
|
11
|
+
modalities?: {
|
|
12
|
+
input?: string[];
|
|
13
|
+
output?: string[];
|
|
14
|
+
};
|
|
11
15
|
}
|
|
12
16
|
export declare function generatePollinationsConfig(forceApiKey?: string, forceStrict?: boolean): Promise<OpenCodeModel[]>;
|
|
13
17
|
export {};
|
|
@@ -19,9 +19,14 @@ function log(msg) {
|
|
|
19
19
|
// Force output to stderr for CLI visibility if needed, but clean.
|
|
20
20
|
}
|
|
21
21
|
// Fetch Helper
|
|
22
|
+
// Fetch Helper
|
|
22
23
|
function fetchJson(url, headers = {}) {
|
|
23
24
|
return new Promise((resolve, reject) => {
|
|
24
|
-
const
|
|
25
|
+
const finalHeaders = {
|
|
26
|
+
...headers,
|
|
27
|
+
'User-Agent': 'Mozilla/5.0 (compatible; OpenCode/5.8.1; +https://opencode.ai)'
|
|
28
|
+
};
|
|
29
|
+
const req = https.get(url, { headers: finalHeaders }, (res) => {
|
|
25
30
|
let data = '';
|
|
26
31
|
res.on('data', chunk => data += chunk);
|
|
27
32
|
res.on('end', () => {
|
|
@@ -39,7 +44,7 @@ function fetchJson(url, headers = {}) {
|
|
|
39
44
|
log(`Network Error for ${url}: ${e.message}`);
|
|
40
45
|
reject(e);
|
|
41
46
|
});
|
|
42
|
-
req.setTimeout(
|
|
47
|
+
req.setTimeout(15000, () => {
|
|
43
48
|
req.destroy();
|
|
44
49
|
reject(new Error('Timeout'));
|
|
45
50
|
});
|
|
@@ -53,37 +58,72 @@ function formatName(id, censored = true) {
|
|
|
53
58
|
return clean;
|
|
54
59
|
}
|
|
55
60
|
// --- MAIN GENERATOR logic ---
|
|
56
|
-
// --- MAIN GENERATOR logic ---
|
|
57
61
|
export async function generatePollinationsConfig(forceApiKey, forceStrict = false) {
|
|
58
62
|
const config = loadConfig();
|
|
59
63
|
const modelsOutput = [];
|
|
60
|
-
log(`Starting Configuration (
|
|
64
|
+
log(`Starting Configuration (v5.8.2)...`);
|
|
61
65
|
// Use forced key (from Hook) or cached key
|
|
62
66
|
const effectiveKey = forceApiKey || config.apiKey;
|
|
63
67
|
// 1. FREE UNIVERSE
|
|
64
68
|
try {
|
|
65
|
-
// Switch to main models endpoint
|
|
69
|
+
// Switch to main models endpoint
|
|
66
70
|
const freeList = await fetchJson('https://text.pollinations.ai/models');
|
|
67
71
|
const list = Array.isArray(freeList) ? freeList : (freeList.data || []);
|
|
68
|
-
list.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
if (list.length > 0) {
|
|
73
|
+
list.forEach((m) => {
|
|
74
|
+
const mapped = mapModel(m, 'free/', '[Free] ');
|
|
75
|
+
modelsOutput.push(mapped);
|
|
76
|
+
});
|
|
77
|
+
log(`Fetched ${modelsOutput.length} Free models.`);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
throw new Error('Empty list returned from Free API');
|
|
81
|
+
}
|
|
73
82
|
}
|
|
74
83
|
catch (e) {
|
|
75
84
|
log(`Error fetching Free models: ${e}`);
|
|
76
|
-
// Fallback Robust (Offline support)
|
|
77
|
-
modelsOutput.push({
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
// Fallback Robust (Offline support) - NOW WITH ICONS
|
|
86
|
+
modelsOutput.push({
|
|
87
|
+
id: "free/mistral",
|
|
88
|
+
name: "[Free] Mistral Nemo (Fallback) 💻",
|
|
89
|
+
object: "model",
|
|
90
|
+
variants: { safe_tokens: { options: { maxTokens: 8000 } } },
|
|
91
|
+
modalities: { input: ['text'], output: ['text'] }
|
|
92
|
+
});
|
|
93
|
+
modelsOutput.push({
|
|
94
|
+
id: "free/openai",
|
|
95
|
+
name: "[Free] OpenAI (Fallback) 👁️💻",
|
|
96
|
+
object: "model",
|
|
97
|
+
variants: {},
|
|
98
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
99
|
+
});
|
|
100
|
+
modelsOutput.push({
|
|
101
|
+
id: "free/gemini",
|
|
102
|
+
name: "[Free] Gemini Flash (Fallback) 👁️💻",
|
|
103
|
+
object: "model",
|
|
104
|
+
variants: { high_reasoning: { options: { reasoningEffort: "high", budgetTokens: 16000 } } },
|
|
105
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
106
|
+
});
|
|
107
|
+
modelsOutput.push({
|
|
108
|
+
id: "free/searchgpt",
|
|
109
|
+
name: "[Free] SearchGPT (Fallback) 🔍",
|
|
110
|
+
object: "model",
|
|
111
|
+
variants: {},
|
|
112
|
+
modalities: { input: ['text'], output: ['text'] }
|
|
113
|
+
});
|
|
80
114
|
}
|
|
81
115
|
// 1.5 FORCE ENSURE CRITICAL MODELS
|
|
82
116
|
// Sometimes the API list changes or is cached weirdly. We force vital models.
|
|
83
117
|
const hasGemini = modelsOutput.find(m => m.id === 'free/gemini');
|
|
84
118
|
if (!hasGemini) {
|
|
85
119
|
log(`[ConfigGen] Force-injecting free/gemini.`);
|
|
86
|
-
modelsOutput.push({
|
|
120
|
+
modelsOutput.push({
|
|
121
|
+
id: "free/gemini",
|
|
122
|
+
name: "[Free] Gemini Flash (Force) 👁️💻",
|
|
123
|
+
object: "model",
|
|
124
|
+
variants: {},
|
|
125
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
126
|
+
});
|
|
87
127
|
}
|
|
88
128
|
// ALIAS Removed for Clean Config
|
|
89
129
|
// const hasGeminiAlias = modelsOutput.find(m => m.id === 'pollinations/free/gemini');
|
package/package.json
CHANGED
package/dist/debug_check.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as https from 'https';
|
|
2
|
-
|
|
3
|
-
function checkEndpoint(ep, key) {
|
|
4
|
-
return new Promise((resolve) => {
|
|
5
|
-
console.log(`Checking ${ep}...`);
|
|
6
|
-
const req = https.request({
|
|
7
|
-
hostname: 'gen.pollinations.ai',
|
|
8
|
-
path: ep,
|
|
9
|
-
method: 'GET',
|
|
10
|
-
headers: { 'Authorization': `Bearer ${key}` }
|
|
11
|
-
}, (res) => {
|
|
12
|
-
console.log(`Status Code: ${res.statusCode}`);
|
|
13
|
-
let data = '';
|
|
14
|
-
res.on('data', chunk => data += chunk);
|
|
15
|
-
res.on('end', () => {
|
|
16
|
-
console.log(`Headers:`, res.headers);
|
|
17
|
-
console.log(`Body Full: ${data}`);
|
|
18
|
-
if (res.statusCode === 200) resolve({ ok: true, body: data });
|
|
19
|
-
else resolve({ ok: false, status: res.statusCode, body: data });
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
req.on('error', (e) => {
|
|
23
|
-
console.log(`Error: ${e.message}`);
|
|
24
|
-
resolve({ ok: false, status: e.message || 'Error' });
|
|
25
|
-
});
|
|
26
|
-
req.setTimeout(10000, () => req.destroy());
|
|
27
|
-
req.end();
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const KEY = "plln_sk_F7a4RcBG4AVCeBSo6lnS36EKwm0nPn1O";
|
|
32
|
-
|
|
33
|
-
(async () => {
|
|
34
|
-
const res = await checkEndpoint('/account/profile', KEY);
|
|
35
|
-
console.log('Result:', res);
|
|
36
|
-
})();
|
package/dist/provider.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createPollinationsFetch: (apiKey: string) => (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
package/dist/provider.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
// Removed invalid imports
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
// --- Sanitization Helpers (Ported from Gateway/Upstream) ---
|
|
4
|
-
function safeId(id) {
|
|
5
|
-
if (!id)
|
|
6
|
-
return id;
|
|
7
|
-
if (id.length > 30)
|
|
8
|
-
return id.substring(0, 30);
|
|
9
|
-
return id;
|
|
10
|
-
}
|
|
11
|
-
function logDebug(message, data) {
|
|
12
|
-
try {
|
|
13
|
-
const timestamp = new Date().toISOString();
|
|
14
|
-
let logMsg = `[${timestamp}] ${message}`;
|
|
15
|
-
if (data) {
|
|
16
|
-
logMsg += `\n${JSON.stringify(data, null, 2)}`;
|
|
17
|
-
}
|
|
18
|
-
fs.appendFileSync('/tmp/opencode_pollinations_debug.log', logMsg + '\n\n');
|
|
19
|
-
}
|
|
20
|
-
catch (e) {
|
|
21
|
-
// ignore logging errors
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function sanitizeTools(tools) {
|
|
25
|
-
if (!Array.isArray(tools))
|
|
26
|
-
return tools;
|
|
27
|
-
const cleanSchema = (schema) => {
|
|
28
|
-
if (!schema || typeof schema !== "object")
|
|
29
|
-
return;
|
|
30
|
-
if (schema.optional !== undefined)
|
|
31
|
-
delete schema.optional;
|
|
32
|
-
if (schema.ref !== undefined)
|
|
33
|
-
delete schema.ref;
|
|
34
|
-
if (schema["$ref"] !== undefined)
|
|
35
|
-
delete schema["$ref"];
|
|
36
|
-
if (schema.properties) {
|
|
37
|
-
for (const key in schema.properties)
|
|
38
|
-
cleanSchema(schema.properties[key]);
|
|
39
|
-
}
|
|
40
|
-
if (schema.items)
|
|
41
|
-
cleanSchema(schema.items);
|
|
42
|
-
};
|
|
43
|
-
return tools.map((tool) => {
|
|
44
|
-
const newTool = { ...tool };
|
|
45
|
-
if (newTool.function && newTool.function.parameters) {
|
|
46
|
-
cleanSchema(newTool.function.parameters);
|
|
47
|
-
}
|
|
48
|
-
return newTool;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function filterTools(tools, maxCount = 120) {
|
|
52
|
-
if (!Array.isArray(tools))
|
|
53
|
-
return [];
|
|
54
|
-
if (tools.length <= maxCount)
|
|
55
|
-
return tools;
|
|
56
|
-
const priorities = [
|
|
57
|
-
"bash", "read", "write", "edit", "webfetch", "glob", "grep",
|
|
58
|
-
"searxng_remote_search", "deepsearch_deep_search", "google_search",
|
|
59
|
-
"task", "todowrite"
|
|
60
|
-
];
|
|
61
|
-
const priorityTools = tools.filter((t) => priorities.includes(t.function.name));
|
|
62
|
-
const otherTools = tools.filter((t) => !priorities.includes(t.function.name));
|
|
63
|
-
const slotsLeft = maxCount - priorityTools.length;
|
|
64
|
-
const othersKept = otherTools.slice(0, Math.max(0, slotsLeft));
|
|
65
|
-
logDebug(`[POLLI-PLUGIN] Filtering tools: ${tools.length} -> ${priorityTools.length + othersKept.length}`);
|
|
66
|
-
return [...priorityTools, ...othersKept];
|
|
67
|
-
}
|
|
68
|
-
// --- Fetch Implementation ---
|
|
69
|
-
export const createPollinationsFetch = (apiKey) => async (input, init) => {
|
|
70
|
-
let url = input.toString();
|
|
71
|
-
const options = init || {};
|
|
72
|
-
let body = null;
|
|
73
|
-
if (options.body && typeof options.body === "string") {
|
|
74
|
-
try {
|
|
75
|
-
body = JSON.parse(options.body);
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
// Not JSON, ignore
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
// --- INTERCEPTION & SANITIZATION ---
|
|
82
|
-
if (body) {
|
|
83
|
-
let model = body.model || "";
|
|
84
|
-
// 0. Model Name Normalization
|
|
85
|
-
if (typeof model === "string" && model.startsWith("pollinations/enter/")) {
|
|
86
|
-
body.model = model.replace("pollinations/enter/", "");
|
|
87
|
-
model = body.model;
|
|
88
|
-
}
|
|
89
|
-
// FIX: Remove stream_options (causes 400 on some OpenAI proxies)
|
|
90
|
-
if (body.stream_options) {
|
|
91
|
-
delete body.stream_options;
|
|
92
|
-
}
|
|
93
|
-
// 1. Azure Tool Limit Fix
|
|
94
|
-
if ((model.includes("openai") || model.includes("gpt")) && body.tools) {
|
|
95
|
-
if (body.tools.length > 120) {
|
|
96
|
-
body.tools = filterTools(body.tools, 120);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// 2. Vertex/Gemini Schema Fix
|
|
100
|
-
if (model.includes("gemini") && body.tools) {
|
|
101
|
-
body.tools = sanitizeTools(body.tools);
|
|
102
|
-
}
|
|
103
|
-
// Re-serialize body
|
|
104
|
-
options.body = JSON.stringify(body);
|
|
105
|
-
}
|
|
106
|
-
// Ensure Headers
|
|
107
|
-
const headers = new Headers(options.headers || {});
|
|
108
|
-
headers.set("Authorization", `Bearer ${apiKey}`);
|
|
109
|
-
headers.set("Content-Type", "application/json");
|
|
110
|
-
options.headers = headers;
|
|
111
|
-
logDebug(`Req: ${url}`, body);
|
|
112
|
-
try {
|
|
113
|
-
const response = await global.fetch(url, options);
|
|
114
|
-
// Log response status
|
|
115
|
-
// We clone to read text for debugging errors
|
|
116
|
-
if (!response.ok) {
|
|
117
|
-
try {
|
|
118
|
-
const clone = response.clone();
|
|
119
|
-
const text = await clone.text();
|
|
120
|
-
logDebug(`Res (Error): ${response.status}`, text);
|
|
121
|
-
}
|
|
122
|
-
catch (e) {
|
|
123
|
-
logDebug(`Res (Error): ${response.status} (Read failed)`);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
logDebug(`Res (OK): ${response.status}`);
|
|
128
|
-
}
|
|
129
|
-
return response;
|
|
130
|
-
}
|
|
131
|
-
catch (e) {
|
|
132
|
-
logDebug(`Fetch Error: ${e.message}`);
|
|
133
|
-
throw e;
|
|
134
|
-
}
|
|
135
|
-
};
|
package/dist/provider_v1.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createPollinationsFetch: (apiKey: string) => (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
package/dist/provider_v1.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
// Removed invalid imports
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
// --- Sanitization Helpers (Ported from Gateway/Upstream) ---
|
|
4
|
-
function safeId(id) {
|
|
5
|
-
if (!id)
|
|
6
|
-
return id;
|
|
7
|
-
if (id.length > 30)
|
|
8
|
-
return id.substring(0, 30);
|
|
9
|
-
return id;
|
|
10
|
-
}
|
|
11
|
-
function logDebug(message, data) {
|
|
12
|
-
try {
|
|
13
|
-
const timestamp = new Date().toISOString();
|
|
14
|
-
let logMsg = `[${timestamp}] ${message}`;
|
|
15
|
-
if (data) {
|
|
16
|
-
logMsg += `\n${JSON.stringify(data, null, 2)}`;
|
|
17
|
-
}
|
|
18
|
-
fs.appendFileSync('/tmp/opencode_pollinations_debug.log', logMsg + '\n\n');
|
|
19
|
-
}
|
|
20
|
-
catch (e) {
|
|
21
|
-
// ignore logging errors
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function sanitizeTools(tools) {
|
|
25
|
-
if (!Array.isArray(tools))
|
|
26
|
-
return tools;
|
|
27
|
-
const cleanSchema = (schema) => {
|
|
28
|
-
if (!schema || typeof schema !== "object")
|
|
29
|
-
return;
|
|
30
|
-
if (schema.optional !== undefined)
|
|
31
|
-
delete schema.optional;
|
|
32
|
-
if (schema.ref !== undefined)
|
|
33
|
-
delete schema.ref;
|
|
34
|
-
if (schema["$ref"] !== undefined)
|
|
35
|
-
delete schema["$ref"];
|
|
36
|
-
if (schema.properties) {
|
|
37
|
-
for (const key in schema.properties)
|
|
38
|
-
cleanSchema(schema.properties[key]);
|
|
39
|
-
}
|
|
40
|
-
if (schema.items)
|
|
41
|
-
cleanSchema(schema.items);
|
|
42
|
-
};
|
|
43
|
-
return tools.map((tool) => {
|
|
44
|
-
const newTool = { ...tool };
|
|
45
|
-
if (newTool.function && newTool.function.parameters) {
|
|
46
|
-
cleanSchema(newTool.function.parameters);
|
|
47
|
-
}
|
|
48
|
-
return newTool;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function filterTools(tools, maxCount = 120) {
|
|
52
|
-
if (!Array.isArray(tools))
|
|
53
|
-
return [];
|
|
54
|
-
if (tools.length <= maxCount)
|
|
55
|
-
return tools;
|
|
56
|
-
const priorities = [
|
|
57
|
-
"bash", "read", "write", "edit", "webfetch", "glob", "grep",
|
|
58
|
-
"searxng_remote_search", "deepsearch_deep_search", "google_search",
|
|
59
|
-
"task", "todowrite"
|
|
60
|
-
];
|
|
61
|
-
const priorityTools = tools.filter((t) => priorities.includes(t.function.name));
|
|
62
|
-
const otherTools = tools.filter((t) => !priorities.includes(t.function.name));
|
|
63
|
-
const slotsLeft = maxCount - priorityTools.length;
|
|
64
|
-
const othersKept = otherTools.slice(0, Math.max(0, slotsLeft));
|
|
65
|
-
logDebug(`[POLLI-PLUGIN] Filtering tools: ${tools.length} -> ${priorityTools.length + othersKept.length}`);
|
|
66
|
-
return [...priorityTools, ...othersKept];
|
|
67
|
-
}
|
|
68
|
-
// --- Fetch Implementation ---
|
|
69
|
-
export const createPollinationsFetch = (apiKey) => async (input, init) => {
|
|
70
|
-
let url = input.toString();
|
|
71
|
-
const options = init || {};
|
|
72
|
-
let body = null;
|
|
73
|
-
if (options.body && typeof options.body === "string") {
|
|
74
|
-
try {
|
|
75
|
-
body = JSON.parse(options.body);
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
// Not JSON, ignore
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
// --- INTERCEPTION & SANITIZATION ---
|
|
82
|
-
if (body) {
|
|
83
|
-
let model = body.model || "";
|
|
84
|
-
// 0. Model Name Normalization
|
|
85
|
-
if (typeof model === "string" && model.startsWith("pollinations/enter/")) {
|
|
86
|
-
body.model = model.replace("pollinations/enter/", "");
|
|
87
|
-
model = body.model;
|
|
88
|
-
}
|
|
89
|
-
// FIX: Remove stream_options (causes 400 on some OpenAI proxies)
|
|
90
|
-
if (body.stream_options) {
|
|
91
|
-
delete body.stream_options;
|
|
92
|
-
}
|
|
93
|
-
// 1. Azure Tool Limit Fix
|
|
94
|
-
if ((model.includes("openai") || model.includes("gpt")) && body.tools) {
|
|
95
|
-
if (body.tools.length > 120) {
|
|
96
|
-
body.tools = filterTools(body.tools, 120);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// 2. Vertex/Gemini Schema Fix
|
|
100
|
-
if (model.includes("gemini") && body.tools) {
|
|
101
|
-
body.tools = sanitizeTools(body.tools);
|
|
102
|
-
}
|
|
103
|
-
// Re-serialize body
|
|
104
|
-
options.body = JSON.stringify(body);
|
|
105
|
-
}
|
|
106
|
-
// Ensure Headers
|
|
107
|
-
const headers = new Headers(options.headers || {});
|
|
108
|
-
headers.set("Authorization", `Bearer ${apiKey}`);
|
|
109
|
-
headers.set("Content-Type", "application/json");
|
|
110
|
-
options.headers = headers;
|
|
111
|
-
logDebug(`Req: ${url}`, body);
|
|
112
|
-
try {
|
|
113
|
-
const response = await global.fetch(url, options);
|
|
114
|
-
// Log response status
|
|
115
|
-
// We clone to read text for debugging errors
|
|
116
|
-
if (!response.ok) {
|
|
117
|
-
try {
|
|
118
|
-
const clone = response.clone();
|
|
119
|
-
const text = await clone.text();
|
|
120
|
-
logDebug(`Res (Error): ${response.status}`, text);
|
|
121
|
-
}
|
|
122
|
-
catch (e) {
|
|
123
|
-
logDebug(`Res (Error): ${response.status} (Read failed)`);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
logDebug(`Res (OK): ${response.status}`);
|
|
128
|
-
}
|
|
129
|
-
return response;
|
|
130
|
-
}
|
|
131
|
-
catch (e) {
|
|
132
|
-
logDebug(`Fetch Error: ${e.message}`);
|
|
133
|
-
throw e;
|
|
134
|
-
}
|
|
135
|
-
};
|
package/dist/test-require.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module';
|
|
2
|
-
const require = createRequire(import.meta.url);
|
|
3
|
-
try {
|
|
4
|
-
const pkg = require('../package.json');
|
|
5
|
-
console.log("SUCCESS: Loaded version " + pkg.version);
|
|
6
|
-
} catch (e) {
|
|
7
|
-
console.error("FAILURE:", e.message);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|