@nxuss/lemma 0.7.7 → 0.7.9

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.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>lemma Dashboard - Agent Orchestration Hub</title>
8
- <script type="module" crossorigin src="/dashboard/assets/index-DSYfE1bL.js"></script>
8
+ <script type="module" crossorigin src="/dashboard/assets/index-DiidVeI5.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/dashboard/assets/index-DtEKr0hI.css">
10
10
  </head>
11
11
  <body>
@@ -1 +1 @@
1
- {"version":3,"file":"lemma-proxy.d.ts","sourceRoot":"","sources":["../../../src/cli/lemma-proxy.ts"],"names":[],"mappings":";AAwWA,wBAAgB,+BAA+B,CAAC,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CA4DvF;AAmhED,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":";AAqZA,wBAAgB,+BAA+B,CAAC,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CA4DvF;AAkiED,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"}
@@ -15,6 +15,7 @@ const chromadb_1 = require("chromadb");
15
15
  const https_1 = __importDefault(require("https"));
16
16
  const http_1 = __importDefault(require("http"));
17
17
  const axios_1 = __importDefault(require("axios"));
18
+ const readline_1 = __importDefault(require("readline"));
18
19
  function getVersion() {
19
20
  const paths = [
20
21
  path_1.default.join(__dirname, '../../package.json'),
@@ -34,6 +35,10 @@ function getVersion() {
34
35
  return '0.5.4';
35
36
  }
36
37
  const VERSION = getVersion();
38
+ function ask(query) {
39
+ const rl = readline_1.default.createInterface({ input: process.stdin, output: process.stdout });
40
+ return new Promise(resolve => rl.question(query, ans => { rl.close(); resolve(ans); }));
41
+ }
37
42
  const ComplexityRouter_1 = __importDefault(require("../proxy/ComplexityRouter"));
38
43
  const SemanticScrubber_1 = __importDefault(require("../security/SemanticScrubber"));
39
44
  const CloudSyncClient_1 = __importDefault(require("../cloud/CloudSyncClient"));
@@ -269,6 +274,49 @@ function autoConfigureAll(project, opts) {
269
274
  }
270
275
  }
271
276
  }
277
+ // Register lemma MCP server in VS Code config (.vscode/mcp.json)
278
+ const vscodeConfigFile = path_1.default.join(process.cwd(), '.vscode', 'mcp.json');
279
+ const vscodeConfigDir = path_1.default.dirname(vscodeConfigFile);
280
+ if (fs_1.default.existsSync(vscodeConfigDir)) {
281
+ let vscodeConfig = { servers: {} };
282
+ try {
283
+ if (fs_1.default.existsSync(vscodeConfigFile)) {
284
+ vscodeConfig = JSON.parse(fs_1.default.readFileSync(vscodeConfigFile, 'utf8'));
285
+ }
286
+ }
287
+ catch { }
288
+ if (!vscodeConfig.servers)
289
+ vscodeConfig.servers = {};
290
+ if (!vscodeConfig.servers.lemma) {
291
+ vscodeConfig.servers.lemma = {
292
+ type: 'stdio',
293
+ command: 'lemma',
294
+ args: ['mcp'],
295
+ };
296
+ try {
297
+ fs_1.default.writeFileSync(vscodeConfigFile, JSON.stringify(vscodeConfig, null, 2));
298
+ console.log('✅ [VS Code] Registered lemma MCP server in .vscode/mcp.json');
299
+ }
300
+ catch { }
301
+ }
302
+ }
303
+ else {
304
+ try {
305
+ fs_1.default.mkdirSync(path_1.default.join(process.cwd(), '.vscode'), { recursive: true });
306
+ const vscodeConfig = {
307
+ servers: {
308
+ lemma: {
309
+ type: 'stdio',
310
+ command: 'lemma',
311
+ args: ['mcp'],
312
+ },
313
+ },
314
+ };
315
+ fs_1.default.writeFileSync(path_1.default.join(process.cwd(), '.vscode', 'mcp.json'), JSON.stringify(vscodeConfig, null, 2));
316
+ console.log('✅ [VS Code] Registered lemma MCP server in .vscode/mcp.json');
317
+ }
318
+ catch { }
319
+ }
272
320
  // Register lemma MCP server in Codex CLI config (~/.codex/config.toml)
273
321
  const codexConfigFile = path_1.default.join(process.env.HOME || '~', '.codex', 'config.toml');
274
322
  const codexConfigDir = path_1.default.dirname(codexConfigFile);
@@ -1324,7 +1372,7 @@ class LemmaServer {
1324
1372
  const responseObj = JSON.parse(meta.response);
1325
1373
  const contentText = responseObj.choices?.[0]?.message?.content || responseObj.content?.[0]?.text || '';
1326
1374
  const promptText = typeof meta.prompt === 'string' ? meta.prompt : 'Architecture Note';
1327
- archMemoriesText += `#### 📌 Decisión: ${promptText}\n${contentText.substring(0, 500)}${contentText.length > 500 ? '...' : ''}\n\n`;
1375
+ archMemoriesText += `#### 📌 Decision: ${promptText}\n${contentText.substring(0, 500)}${contentText.length > 500 ? '...' : ''}\n\n`;
1328
1376
  }
1329
1377
  catch { }
1330
1378
  }
@@ -1358,7 +1406,7 @@ class LemmaServer {
1358
1406
  `1. **Respect Core Stack:** Adhere strictly to the codebase structure and libraries listed above.`,
1359
1407
  `2. **Leverage the Brain:** Use Lemma MCP tools (\`search_memory\` and \`store_memory\`) to retrieve past solutions and register key architectural changes.`,
1360
1408
  `3. **Optimize Context:** Keep conversations focused. Lemma transparently compresses repetitive logs and file blocks to protect context window limits.`,
1361
- `4. **Cortafuegos Local:** Do not worry about API key exposures. Lemma automatically masks local private variables and credentials.`
1409
+ ` 4. **Privacy Firewall:** Do not worry about API key exposures. Lemma automatically masks local private variables and credentials.`
1362
1410
  ].filter(Boolean).join('\n');
1363
1411
  res.json({ success: true, markdown: mentalModel });
1364
1412
  }
@@ -2002,7 +2050,7 @@ commander_1.program
2002
2050
  .version(VERSION)
2003
2051
  .addHelpText('after', `
2004
2052
  \x1b[1mPlan Comparison\x1b[0m
2005
- \x1b[32mFree\x1b[0m 500 req/mo · Exact cache · Privacy firewall · MCP tools
2053
+ \x1b[32mFree\x1b[0m ${FREE_LIMIT} req/mo · Exact cache · Privacy firewall · MCP tools
2006
2054
  \x1b[35mPro\x1b[0m Unlimited · Semantic cache · Cloud sync · Autopilot · Heal
2007
2055
  \x1b[36mhttps://lemma.nxus.studio/upgrade\x1b[0m
2008
2056
 
@@ -2254,6 +2302,7 @@ commander_1.program.command('activate <key>')
2254
2302
  commander_1.program.command('init')
2255
2303
  .description('Initialize Lemma in the current project (auto-discovery)')
2256
2304
  .option('--no-configure', 'Skip automatic configuration of editors, shell overrides, and Claude Desktop')
2305
+ .option('--yes', 'Skip prompts and accept defaults')
2257
2306
  .action(async (opts) => {
2258
2307
  const project = detectProject();
2259
2308
  console.log(`\n🛠️ Initializing Lemma for [${project}]...`);
@@ -2283,8 +2332,23 @@ commander_1.program.command('init')
2283
2332
  fs_1.default.writeFileSync(envFile, lemmaConfig);
2284
2333
  console.log('✅ Created .env with Lemma configuration');
2285
2334
  }
2286
- console.log('\n🧠 \x1b[35mAuto-Setup MCP and redirection overrides for AI IDEs...\x1b[0m');
2287
- autoConfigureAll(project, { configure: opts.configure });
2335
+ // Prompt before modifying IDE configs unless --yes or --no-configure
2336
+ if (opts.configure !== false) {
2337
+ if (opts.yes) {
2338
+ console.log('\n🧠 \x1b[35mAuto-configuring MCP for AI IDEs...\x1b[0m');
2339
+ }
2340
+ else {
2341
+ const ans = await ask('\n🧠 Configure MCP servers for your IDEs (Claude, Cursor, Windsurf, VS Code, Kiro, Codex)? (Y/n): ');
2342
+ if (ans.toLowerCase() === 'n' || ans.toLowerCase() === 'no') {
2343
+ opts.configure = false;
2344
+ console.log('⏭️ Skipping IDE auto-configuration');
2345
+ }
2346
+ else {
2347
+ console.log(' Auto-configuring...');
2348
+ }
2349
+ }
2350
+ }
2351
+ autoConfigureAll(project, { configure: opts.configure !== false });
2288
2352
  injectIdeRules(project);
2289
2353
  console.log('\n✨ Project initialized for the Agentic Era!\n');
2290
2354
  console.log('\x1b[1mNext steps:\x1b[0m');