@nxuss/lemma 0.4.7 → 0.4.8
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/lemma-proxy.cjs +26 -0
- package/package.json +1 -1
package/lemma-proxy.cjs
CHANGED
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
|
|
7
|
+
// Automatically load environment variables from the user's workspace using a zero-dependency parser
|
|
8
|
+
function loadEnvFile(filePath) {
|
|
9
|
+
if (fs.existsSync(filePath)) {
|
|
10
|
+
try {
|
|
11
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
12
|
+
const lines = content.split('\n');
|
|
13
|
+
for (const line of lines) {
|
|
14
|
+
const cleanLine = line.trim();
|
|
15
|
+
if (!cleanLine || cleanLine.startsWith('#')) continue;
|
|
16
|
+
const idx = cleanLine.indexOf('=');
|
|
17
|
+
if (idx === -1) continue;
|
|
18
|
+
const key = cleanLine.substring(0, idx).trim();
|
|
19
|
+
let val = cleanLine.substring(idx + 1).trim();
|
|
20
|
+
if ((val.startsWith('"') && val.endsWith('"')) || (val.startsWith("'") && val.endsWith("'"))) {
|
|
21
|
+
val = val.substring(1, val.length - 1);
|
|
22
|
+
}
|
|
23
|
+
process.env[key] = val;
|
|
24
|
+
}
|
|
25
|
+
} catch (e) {}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
loadEnvFile(path.join(process.cwd(), '.env'));
|
|
30
|
+
loadEnvFile(path.join(process.cwd(), '.env.local'));
|
|
31
|
+
|
|
32
|
+
|
|
7
33
|
// Target path in the compiled CommonJS distribution
|
|
8
34
|
const distPath = path.join(__dirname, 'dist', 'cjs', 'cli', 'lemma-proxy.js');
|
|
9
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxuss/lemma",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "Intelligent AI Gateway for IDEs & Agents — Semantic cache, Privacy Firewall, and Autonomous Cost-Optimization.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|