@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.
Files changed (42) hide show
  1. package/README.md +56 -1
  2. package/dist/cjs/cli/lemma-proxy.d.ts.map +1 -1
  3. package/dist/cjs/cli/lemma-proxy.js +23 -7
  4. package/dist/cjs/cli/lemma-proxy.js.map +1 -1
  5. package/dist/cjs/cloud/server.d.ts.map +1 -1
  6. package/dist/cjs/cloud/server.js +81 -3
  7. package/dist/cjs/cloud/server.js.map +1 -1
  8. package/dist/cjs/config/index.d.ts.map +1 -1
  9. package/dist/cjs/config/index.js +2 -1
  10. package/dist/cjs/config/index.js.map +1 -1
  11. package/dist/cjs/mcp/tools.js +23 -0
  12. package/dist/cjs/mcp/tools.js.map +1 -1
  13. package/dist/cjs/mcp/utils.d.ts +13 -0
  14. package/dist/cjs/mcp/utils.d.ts.map +1 -1
  15. package/dist/cjs/mcp/utils.js +61 -0
  16. package/dist/cjs/mcp/utils.js.map +1 -1
  17. package/dist/cjs/proxy/KeyManager.d.ts.map +1 -1
  18. package/dist/cjs/proxy/KeyManager.js +9 -1
  19. package/dist/cjs/proxy/KeyManager.js.map +1 -1
  20. package/dist/cjs/types/index.d.ts +1 -0
  21. package/dist/cjs/types/index.d.ts.map +1 -1
  22. package/dist/esm/cli/lemma-proxy.d.ts.map +1 -1
  23. package/dist/esm/cli/lemma-proxy.js +23 -7
  24. package/dist/esm/cli/lemma-proxy.js.map +1 -1
  25. package/dist/esm/cloud/server.d.ts.map +1 -1
  26. package/dist/esm/cloud/server.js +81 -3
  27. package/dist/esm/cloud/server.js.map +1 -1
  28. package/dist/esm/config/index.d.ts.map +1 -1
  29. package/dist/esm/config/index.js +2 -1
  30. package/dist/esm/config/index.js.map +1 -1
  31. package/dist/esm/mcp/tools.js +24 -1
  32. package/dist/esm/mcp/tools.js.map +1 -1
  33. package/dist/esm/mcp/utils.d.ts +13 -0
  34. package/dist/esm/mcp/utils.d.ts.map +1 -1
  35. package/dist/esm/mcp/utils.js +59 -0
  36. package/dist/esm/mcp/utils.js.map +1 -1
  37. package/dist/esm/proxy/KeyManager.d.ts.map +1 -1
  38. package/dist/esm/proxy/KeyManager.js +9 -1
  39. package/dist/esm/proxy/KeyManager.js.map +1 -1
  40. package/dist/esm/types/index.d.ts +1 -0
  41. package/dist/esm/types/index.d.ts.map +1 -1
  42. package/package.json +4 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🧠 Lemma v0.8.0
1
+ # 🧠 Lemma v0.8.1
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@nxuss/lemma.svg?color=orange&style=flat-square)](https://www.npmjs.com/package/@nxuss/lemma)
4
4
  [![License](https://img.shields.io/npm/l/@nxuss/lemma.svg?color=blue&style=flat-square)](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;AA2iED,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"}
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
- server.listen(this.port, async () => {
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
- try {
2056
- const { startClipboardWatcher } = require('../utils/ClipboardWatcher');
2057
- startClipboardWatcher(1000);
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
- catch (err) {
2060
- console.warn(`⚠️ Could not auto-initialize Clipboard Watcher: ${err.message}`);
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());