@nxuss/lemma 0.8.0 → 0.8.1
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/README.md +56 -1
- package/dist/cjs/cli/lemma-proxy.d.ts.map +1 -1
- package/dist/cjs/cli/lemma-proxy.js +23 -7
- package/dist/cjs/cli/lemma-proxy.js.map +1 -1
- package/dist/cjs/cloud/server.d.ts.map +1 -1
- package/dist/cjs/cloud/server.js +81 -3
- package/dist/cjs/cloud/server.js.map +1 -1
- package/dist/cjs/config/index.d.ts.map +1 -1
- package/dist/cjs/config/index.js +2 -1
- package/dist/cjs/config/index.js.map +1 -1
- package/dist/cjs/mcp/tools.js +23 -0
- package/dist/cjs/mcp/tools.js.map +1 -1
- package/dist/cjs/mcp/utils.d.ts +13 -0
- package/dist/cjs/mcp/utils.d.ts.map +1 -1
- package/dist/cjs/mcp/utils.js +61 -0
- package/dist/cjs/mcp/utils.js.map +1 -1
- package/dist/cjs/proxy/KeyManager.d.ts.map +1 -1
- package/dist/cjs/proxy/KeyManager.js +9 -1
- package/dist/cjs/proxy/KeyManager.js.map +1 -1
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/esm/cli/lemma-proxy.d.ts.map +1 -1
- package/dist/esm/cli/lemma-proxy.js +23 -7
- package/dist/esm/cli/lemma-proxy.js.map +1 -1
- package/dist/esm/cloud/server.d.ts.map +1 -1
- package/dist/esm/cloud/server.js +81 -3
- package/dist/esm/cloud/server.js.map +1 -1
- package/dist/esm/config/index.d.ts.map +1 -1
- package/dist/esm/config/index.js +2 -1
- package/dist/esm/config/index.js.map +1 -1
- package/dist/esm/mcp/tools.js +24 -1
- package/dist/esm/mcp/tools.js.map +1 -1
- package/dist/esm/mcp/utils.d.ts +13 -0
- package/dist/esm/mcp/utils.d.ts.map +1 -1
- package/dist/esm/mcp/utils.js +59 -0
- package/dist/esm/mcp/utils.js.map +1 -1
- package/dist/esm/proxy/KeyManager.d.ts.map +1 -1
- package/dist/esm/proxy/KeyManager.js +9 -1
- package/dist/esm/proxy/KeyManager.js.map +1 -1
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/index.d.ts.map +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 🧠 Lemma v0.8.
|
|
1
|
+
# 🧠 Lemma v0.8.1
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@nxuss/lemma)
|
|
4
4
|
[](https://github.com/Nxusbets/lemma/blob/main/LICENSE)
|
|
@@ -302,4 +302,59 @@ Add the following to your `claude_desktop_config.json` configuration file:
|
|
|
302
302
|
|
|
303
303
|
---
|
|
304
304
|
|
|
305
|
+
## 🔒 Security & Privacy
|
|
306
|
+
|
|
307
|
+
### Network Binding
|
|
308
|
+
By default, Lemma binds only to `127.0.0.1` (localhost). It is **not accessible from the network** unless you explicitly set:
|
|
309
|
+
```env
|
|
310
|
+
LEMMA_BIND_HOST=0.0.0.0
|
|
311
|
+
```
|
|
312
|
+
> ⚠️ If you do expose Lemma to the network, always enable authentication first:
|
|
313
|
+
> ```env
|
|
314
|
+
> AUTH_ENABLED=true
|
|
315
|
+
> AUTH_REQUIRE_API_KEY=true
|
|
316
|
+
> AUTH_ALLOWED_ORIGINS=https://yourdomain.com
|
|
317
|
+
> ```
|
|
318
|
+
|
|
319
|
+
### 📋 Clipboard Watcher Disclosure
|
|
320
|
+
The **Clipboard Telepathic Watcher** polls your system clipboard every 1 second to automatically compress code you copy. This is disclosed in the startup banner. To disable it:
|
|
321
|
+
```env
|
|
322
|
+
# In your .env
|
|
323
|
+
LEMMA_DISABLE_CLIPBOARD=true
|
|
324
|
+
```
|
|
325
|
+
Or via CLI flag: `lemma start --no-clipboard`
|
|
326
|
+
|
|
327
|
+
### MCP Command Allowlist
|
|
328
|
+
The `run_workspace_command` MCP tool only executes commands from an allowlist. Default safe prefixes include `npm`, `npx`, `git`, `tsc`, `node`, `jest`, `eslint`, `ls`, `grep`, and more.
|
|
329
|
+
|
|
330
|
+
To extend the allowlist for your project, add to `lemma.config.json`:
|
|
331
|
+
```json
|
|
332
|
+
{
|
|
333
|
+
"mcp": {
|
|
334
|
+
"allowedCommandPrefixes": ["your-tool", "another-cmd"]
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
### License Security (Cloud Server)
|
|
340
|
+
When running the cloud server in production, set a private license salt:
|
|
341
|
+
```env
|
|
342
|
+
# Generate with: openssl rand -hex 32
|
|
343
|
+
LEMMA_LICENSE_SALT=your-random-64-char-hex-string
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### Stripe Webhooks (Cloud Server)
|
|
347
|
+
The Stripe webhook endpoint requires a webhook signing secret in production:
|
|
348
|
+
```env
|
|
349
|
+
STRIPE_WEBHOOK_SECRET=whsec_...
|
|
350
|
+
```
|
|
351
|
+
Get this from **Stripe Dashboard → Developers → Webhooks → Signing Secret**. Without it, the endpoint is disabled in `NODE_ENV=production`.
|
|
352
|
+
|
|
353
|
+
For local testing: `STRIPE_SKIP_SIGNATURE_VERIFY=true`
|
|
354
|
+
|
|
355
|
+
### Full Security Template
|
|
356
|
+
See [`.env.security.example`](.env.security.example) for all security-related environment variables.
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
305
360
|
MIT © Nxus Studio | [Upgrade to Lemma Pro](https://lemma.nxus.studio/upgrade)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lemma-proxy.d.ts","sourceRoot":"","sources":["../../../src/cli/lemma-proxy.ts"],"names":[],"mappings":";AA0bA,wBAAgB,+BAA+B,CAAC,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CA4DvF;
|
|
1
|
+
{"version":3,"file":"lemma-proxy.d.ts","sourceRoot":"","sources":["../../../src/cli/lemma-proxy.ts"],"names":[],"mappings":";AA0bA,wBAAgB,+BAA+B,CAAC,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CA4DvF;AA2jED,wBAAsB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA6KhL"}
|
|
@@ -2006,14 +2006,23 @@ Adjusted Answer:`;
|
|
|
2006
2006
|
}
|
|
2007
2007
|
throw e;
|
|
2008
2008
|
});
|
|
2009
|
-
|
|
2009
|
+
const BIND_HOST = process.env.LEMMA_BIND_HOST || '127.0.0.1';
|
|
2010
|
+
server.listen(this.port, BIND_HOST, async () => {
|
|
2010
2011
|
fs_1.default.writeFileSync(PID_FILE, String(process.pid));
|
|
2011
2012
|
fs_1.default.writeFileSync(PORT_FILE, String(this.port));
|
|
2013
|
+
// Security warning if binding to all interfaces without auth
|
|
2014
|
+
if (BIND_HOST !== '127.0.0.1' && BIND_HOST !== 'localhost') {
|
|
2015
|
+
const authEnabled = process.env.AUTH_ENABLED === 'true';
|
|
2016
|
+
if (!authEnabled) {
|
|
2017
|
+
console.warn(`\n\x1b[33m⚠️ [SECURITY] Lemma proxy is bound to ${BIND_HOST} (all interfaces) with AUTH_ENABLED=false.`);
|
|
2018
|
+
console.warn(` Set AUTH_ENABLED=true and AUTH_REQUIRE_API_KEY=true before exposing to any network.\x1b[0m\n`);
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2012
2021
|
const pro = await isPro();
|
|
2013
2022
|
console.log(`\x1b[1m\x1b[35m┌──────────────────────────────────────────────────────────┐\x1b[0m`);
|
|
2014
2023
|
console.log(`\x1b[1m\x1b[35m│ 🚀 LEMMA PROXY v${VERSION} — THE UNIVERSAL AI GATEWAY │\x1b[0m`);
|
|
2015
2024
|
console.log(`\x1b[1m\x1b[35m└──────────────────────────────────────────────────────────┘\x1b[0m`);
|
|
2016
|
-
console.log(`\n📁 Project : ${this.projectName}\n🔌 Port : ${this.port}`);
|
|
2025
|
+
console.log(`\n📁 Project : ${this.projectName}\n🔌 Port : ${this.port} (bound to ${BIND_HOST})`);
|
|
2017
2026
|
if (this.dashboardPath && fs_1.default.existsSync(this.dashboardPath)) {
|
|
2018
2027
|
console.log(`📊 Dashboard UI : \x1b[36mhttp://localhost:${this.port}/dashboard/\x1b[0m`);
|
|
2019
2028
|
if (this.openBrowser) {
|
|
@@ -2052,12 +2061,19 @@ Adjusted Answer:`;
|
|
|
2052
2061
|
console.log(`\n \x1b[1m\x1b[33mlemma mcp\x1b[0m\n`);
|
|
2053
2062
|
console.log('────────────────────────────────────────────────\n');
|
|
2054
2063
|
// Auto-start the Local Clipboard Optimizer Watcher in the background
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2064
|
+
const clipboardDisabled = process.env.LEMMA_DISABLE_CLIPBOARD === 'true';
|
|
2065
|
+
if (clipboardDisabled) {
|
|
2066
|
+
console.log(`📋 Clipboard Watcher : \x1b[90m[DISABLED via LEMMA_DISABLE_CLIPBOARD]\x1b[0m`);
|
|
2058
2067
|
}
|
|
2059
|
-
|
|
2060
|
-
console.
|
|
2068
|
+
else {
|
|
2069
|
+
console.log(`📋 Clipboard Watcher : \x1b[33m[ACTIVE]\x1b[0m — polling clipboard every 1s (disable: LEMMA_DISABLE_CLIPBOARD=true)`);
|
|
2070
|
+
try {
|
|
2071
|
+
const { startClipboardWatcher } = require('../utils/ClipboardWatcher');
|
|
2072
|
+
startClipboardWatcher(1000);
|
|
2073
|
+
}
|
|
2074
|
+
catch (err) {
|
|
2075
|
+
console.warn(`⚠️ Could not auto-initialize Clipboard Watcher: ${err.message}`);
|
|
2076
|
+
}
|
|
2061
2077
|
}
|
|
2062
2078
|
});
|
|
2063
2079
|
process.on('SIGTERM', () => server.close());
|