@nxuss/lemma 0.5.4 → 0.5.6
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 +30 -0
- package/dist/cjs/cli/lemma-proxy.d.ts +9 -2
- package/dist/cjs/cli/lemma-proxy.d.ts.map +1 -1
- package/dist/cjs/cli/lemma-proxy.js +187 -118
- package/dist/cjs/cli/lemma-proxy.js.map +1 -1
- package/dist/cjs/cloud/BurstRateLimiter.d.ts +26 -0
- package/dist/cjs/cloud/BurstRateLimiter.d.ts.map +1 -0
- package/dist/cjs/cloud/BurstRateLimiter.js +63 -0
- package/dist/cjs/cloud/BurstRateLimiter.js.map +1 -0
- package/dist/cjs/cloud/KeyManager.d.ts +1 -0
- package/dist/cjs/cloud/KeyManager.d.ts.map +1 -1
- package/dist/cjs/cloud/KeyManager.js +28 -1
- package/dist/cjs/cloud/KeyManager.js.map +1 -1
- package/dist/cjs/cloud/PostgresQuotaLimiter.d.ts +60 -0
- package/dist/cjs/cloud/PostgresQuotaLimiter.d.ts.map +1 -0
- package/dist/cjs/cloud/PostgresQuotaLimiter.js +200 -0
- package/dist/cjs/cloud/PostgresQuotaLimiter.js.map +1 -0
- package/dist/cjs/cloud/TenantCache.d.ts +1 -1
- package/dist/cjs/cloud/TenantCache.d.ts.map +1 -1
- package/dist/cjs/cloud/TenantCache.js +21 -3
- package/dist/cjs/cloud/TenantCache.js.map +1 -1
- package/dist/cjs/cloud/server.d.ts +3 -1
- package/dist/cjs/cloud/server.d.ts.map +1 -1
- package/dist/cjs/cloud/server.js +42 -5
- package/dist/cjs/cloud/server.js.map +1 -1
- package/dist/cjs/cloud/types.d.ts +3 -0
- package/dist/cjs/cloud/types.d.ts.map +1 -1
- package/dist/cjs/cloud/types.js +3 -3
- package/dist/cjs/cloud/types.js.map +1 -1
- package/dist/esm/cli/lemma-proxy.d.ts +9 -2
- package/dist/esm/cli/lemma-proxy.d.ts.map +1 -1
- package/dist/esm/cli/lemma-proxy.js +187 -118
- package/dist/esm/cli/lemma-proxy.js.map +1 -1
- package/dist/esm/cloud/BurstRateLimiter.d.ts +26 -0
- package/dist/esm/cloud/BurstRateLimiter.d.ts.map +1 -0
- package/dist/esm/cloud/BurstRateLimiter.js +59 -0
- package/dist/esm/cloud/BurstRateLimiter.js.map +1 -0
- package/dist/esm/cloud/KeyManager.d.ts +1 -0
- package/dist/esm/cloud/KeyManager.d.ts.map +1 -1
- package/dist/esm/cloud/KeyManager.js +28 -1
- package/dist/esm/cloud/KeyManager.js.map +1 -1
- package/dist/esm/cloud/PostgresQuotaLimiter.d.ts +60 -0
- package/dist/esm/cloud/PostgresQuotaLimiter.d.ts.map +1 -0
- package/dist/esm/cloud/PostgresQuotaLimiter.js +196 -0
- package/dist/esm/cloud/PostgresQuotaLimiter.js.map +1 -0
- package/dist/esm/cloud/TenantCache.d.ts +1 -1
- package/dist/esm/cloud/TenantCache.d.ts.map +1 -1
- package/dist/esm/cloud/TenantCache.js +21 -3
- package/dist/esm/cloud/TenantCache.js.map +1 -1
- package/dist/esm/cloud/server.d.ts +3 -1
- package/dist/esm/cloud/server.d.ts.map +1 -1
- package/dist/esm/cloud/server.js +41 -5
- package/dist/esm/cloud/server.js.map +1 -1
- package/dist/esm/cloud/types.d.ts +3 -0
- package/dist/esm/cloud/types.d.ts.map +1 -1
- package/dist/esm/cloud/types.js +3 -3
- package/dist/esm/cloud/types.js.map +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -102,6 +102,36 @@ lemma start
|
|
|
102
102
|
| `lemma status` | Displays active optimization modules, system health, and open connections. |
|
|
103
103
|
| `lemma stats` | Outputs high-density metrics showing your real-time token and financial savings. |
|
|
104
104
|
|
|
105
|
+
### ⚙️ Customization & System Options
|
|
106
|
+
|
|
107
|
+
By default, Lemma works seamlessly with zero configuration. However, if you are running in a sensitive enterprise environment or want absolute control over filesystem modifications, you can customize Lemma's behavior.
|
|
108
|
+
|
|
109
|
+
#### CLI Command Options
|
|
110
|
+
|
|
111
|
+
* **`lemma init --no-configure`**: Initialize the project without writing MCP servers to Claude Desktop or overriding shell environment files.
|
|
112
|
+
* **`lemma start --no-configure`**: Start the proxy without updating editor/IDE configuration mappings.
|
|
113
|
+
* **`lemma start --no-clipboard`**: Start the proxy without spawning the background Clipboard watcher daemon.
|
|
114
|
+
|
|
115
|
+
#### Customizing via `lemma.config.json`
|
|
116
|
+
|
|
117
|
+
Create or edit `lemma.config.json` in your project root to disable or fine-tune specific background daemons:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"system": {
|
|
122
|
+
"autoConfigure": {
|
|
123
|
+
"disabled": false, // Set to true to disable all automated IDE/shell overrides
|
|
124
|
+
"editor": true, // Set to false to prevent Cursor/Windsurf setting updates
|
|
125
|
+
"shell": true, // Set to false to prevent .zshrc/.bashrc overrides
|
|
126
|
+
"claude": true // Set to false to prevent Claude Desktop MCP updates
|
|
127
|
+
},
|
|
128
|
+
"clipboardWatcher": {
|
|
129
|
+
"disabled": false // Set to true to prevent clipboard watching
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
105
135
|
---
|
|
106
136
|
|
|
107
137
|
## 💎 Tier Comparison
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export declare function autoConfigureAll(projectName?: string
|
|
3
|
-
|
|
2
|
+
export declare function autoConfigureAll(projectName?: string, cliOpts?: {
|
|
3
|
+
configure?: boolean;
|
|
4
|
+
editor?: boolean;
|
|
5
|
+
shell?: boolean;
|
|
6
|
+
claude?: boolean;
|
|
7
|
+
}): void;
|
|
8
|
+
export declare function startBackgroundClipboardWatcher(cliOpts?: {
|
|
9
|
+
clipboard?: boolean;
|
|
10
|
+
}): void;
|
|
4
11
|
export declare function performAutoHeal(apply: boolean): Promise<{
|
|
5
12
|
success: boolean;
|
|
6
13
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lemma-proxy.d.ts","sourceRoot":"","sources":["../../../src/cli/lemma-proxy.ts"],"names":[],"mappings":";AA8NA,wBAAgB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"lemma-proxy.d.ts","sourceRoot":"","sources":["../../../src/cli/lemma-proxy.ts"],"names":[],"mappings":";AA8NA,wBAAgB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAsLnJ;AAED,wBAAgB,+BAA+B,CAAC,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CA4DvF;AA+8CD,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"}
|
|
@@ -32,7 +32,7 @@ function getVersion() {
|
|
|
32
32
|
catch { }
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
return '0.5.
|
|
35
|
+
return '0.5.4';
|
|
36
36
|
}
|
|
37
37
|
const VERSION = getVersion();
|
|
38
38
|
const ComplexityRouter_1 = __importDefault(require("../proxy/ComplexityRouter"));
|
|
@@ -217,141 +217,207 @@ function ensureGitIgnore() {
|
|
|
217
217
|
return added;
|
|
218
218
|
}
|
|
219
219
|
const CLIPBOARD_PID_FILE = path_1.default.join(CACHE_DIR, 'clipboard.pid');
|
|
220
|
-
function autoConfigureAll(projectName) {
|
|
220
|
+
function autoConfigureAll(projectName, cliOpts) {
|
|
221
221
|
const project = projectName || detectProject();
|
|
222
222
|
const HOME = process.env.HOME || process.env.USERPROFILE || '~';
|
|
223
|
-
//
|
|
223
|
+
// Load configuration if it exists
|
|
224
|
+
let configDisabled = false;
|
|
225
|
+
let configEditor = true;
|
|
226
|
+
let configShell = true;
|
|
227
|
+
let configClaude = true;
|
|
224
228
|
try {
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
if (
|
|
232
|
-
|
|
233
|
-
|
|
229
|
+
const configPath = path_1.default.join(process.cwd(), 'lemma.config.json');
|
|
230
|
+
if (fs_1.default.existsSync(configPath)) {
|
|
231
|
+
const rawConfig = fs_1.default.readFileSync(configPath, 'utf8');
|
|
232
|
+
const config = JSON.parse(rawConfig);
|
|
233
|
+
const systemConfig = config.system || {};
|
|
234
|
+
const autoConfig = systemConfig.autoConfigure || {};
|
|
235
|
+
if (autoConfig.disabled === true)
|
|
236
|
+
configDisabled = true;
|
|
237
|
+
if (autoConfig.editor === false)
|
|
238
|
+
configEditor = false;
|
|
239
|
+
if (autoConfig.shell === false)
|
|
240
|
+
configShell = false;
|
|
241
|
+
if (autoConfig.claude === false)
|
|
242
|
+
configClaude = false;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
catch { }
|
|
246
|
+
// Merge CLI overrides and config
|
|
247
|
+
const shouldConfigure = cliOpts?.configure !== false && !configDisabled;
|
|
248
|
+
if (!shouldConfigure) {
|
|
249
|
+
console.log(`⏭️ [Auto-Configure] Skipped auto-configuration (disabled via options or config).`);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const runEditor = cliOpts?.editor !== false && configEditor;
|
|
253
|
+
const runShell = cliOpts?.shell !== false && configShell;
|
|
254
|
+
const runClaude = cliOpts?.claude !== false && configClaude;
|
|
255
|
+
// 1. Claude Desktop Config
|
|
256
|
+
if (runClaude) {
|
|
257
|
+
try {
|
|
258
|
+
const isWin = process.platform === 'win32';
|
|
259
|
+
const claudePath = isWin
|
|
260
|
+
? path_1.default.join(process.env.APPDATA || '', 'Claude/claude_desktop_config.json')
|
|
261
|
+
: path_1.default.join(HOME, 'Library/Application Support/Claude/claude_desktop_config.json');
|
|
262
|
+
if (fs_1.default.existsSync(path_1.default.dirname(claudePath))) {
|
|
263
|
+
let config = { mcpServers: {} };
|
|
264
|
+
if (fs_1.default.existsSync(claudePath)) {
|
|
265
|
+
try {
|
|
266
|
+
config = JSON.parse(fs_1.default.readFileSync(claudePath, 'utf8'));
|
|
267
|
+
}
|
|
268
|
+
catch { }
|
|
234
269
|
}
|
|
235
|
-
|
|
270
|
+
if (!config.mcpServers)
|
|
271
|
+
config.mcpServers = {};
|
|
272
|
+
config.mcpServers.lemma = {
|
|
273
|
+
command: 'npx',
|
|
274
|
+
args: ['-y', '@nxuss/lemma', 'mcp'],
|
|
275
|
+
env: { LEMMA_PROJECT: project }
|
|
276
|
+
};
|
|
277
|
+
fs_1.default.writeFileSync(claudePath, JSON.stringify(config, null, 2));
|
|
278
|
+
console.log(`✅ [Claude Desktop] Configured automatically in: ${claudePath} (Restart Claude to activate)`);
|
|
236
279
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
command: 'npx',
|
|
241
|
-
args: ['-y', '@nxuss/lemma', 'mcp'],
|
|
242
|
-
env: { LEMMA_PROJECT: project }
|
|
243
|
-
};
|
|
244
|
-
fs_1.default.writeFileSync(claudePath, JSON.stringify(config, null, 2));
|
|
245
|
-
console.log(`✅ [Claude Desktop] Configured automatically! (Restart Claude to activate)`);
|
|
280
|
+
}
|
|
281
|
+
catch (e) {
|
|
282
|
+
console.log(`⚠️ Could not auto-configure Claude Desktop: ${e.message}`);
|
|
246
283
|
}
|
|
247
284
|
}
|
|
248
|
-
|
|
249
|
-
console.log(
|
|
285
|
+
else {
|
|
286
|
+
console.log(`⏭️ [Claude Desktop] Skip auto-configuration.`);
|
|
250
287
|
}
|
|
251
288
|
// 2. Shell Profiles Environment Override
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
289
|
+
if (runShell) {
|
|
290
|
+
try {
|
|
291
|
+
const profiles = [
|
|
292
|
+
path_1.default.join(HOME, '.zshrc'),
|
|
293
|
+
path_1.default.join(HOME, '.bashrc'),
|
|
294
|
+
path_1.default.join(HOME, '.bash_profile'),
|
|
295
|
+
path_1.default.join(HOME, '.profile')
|
|
296
|
+
];
|
|
297
|
+
const lines = [
|
|
298
|
+
'',
|
|
299
|
+
'# Lemma AI Gateway Overrides',
|
|
300
|
+
'export OPENAI_BASE_URL="http://localhost:8081/v1"',
|
|
301
|
+
'export ANTHROPIC_BASE_URL="http://localhost:8081"',
|
|
302
|
+
'export LEMMA_PROJECT="' + project + '"',
|
|
303
|
+
''
|
|
304
|
+
].join('\n');
|
|
305
|
+
for (const profile of profiles) {
|
|
306
|
+
if (fs_1.default.existsSync(profile)) {
|
|
307
|
+
try {
|
|
308
|
+
const content = fs_1.default.readFileSync(profile, 'utf8');
|
|
309
|
+
if (!content.includes('OPENAI_BASE_URL') && !content.includes('LEMMA_PROJECT')) {
|
|
310
|
+
fs_1.default.appendFileSync(profile, lines);
|
|
311
|
+
console.log(`✅ [Shell Profile] Configured ${path_1.default.basename(profile)} with local redirect variables!`);
|
|
312
|
+
}
|
|
274
313
|
}
|
|
314
|
+
catch { }
|
|
275
315
|
}
|
|
276
|
-
catch { }
|
|
277
316
|
}
|
|
278
317
|
}
|
|
318
|
+
catch (e) {
|
|
319
|
+
console.log(`⚠️ Could not auto-configure shell profiles: ${e.message}`);
|
|
320
|
+
}
|
|
279
321
|
}
|
|
280
|
-
|
|
281
|
-
console.log(
|
|
322
|
+
else {
|
|
323
|
+
console.log(`⏭️ [Shell Profile] Skip auto-configuration.`);
|
|
282
324
|
}
|
|
283
325
|
// 3. Cursor & Windsurf settings.json updates
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
+
if (runEditor) {
|
|
327
|
+
try {
|
|
328
|
+
const isWin = process.platform === 'win32';
|
|
329
|
+
const isMac = process.platform === 'darwin';
|
|
330
|
+
const candidates = [];
|
|
331
|
+
if (isMac) {
|
|
332
|
+
candidates.push({
|
|
333
|
+
name: 'Cursor',
|
|
334
|
+
path: path_1.default.join(HOME, 'Library/Application Support/Cursor/User/settings.json')
|
|
335
|
+
});
|
|
336
|
+
candidates.push({
|
|
337
|
+
name: 'Windsurf',
|
|
338
|
+
path: path_1.default.join(HOME, 'Library/Application Support/Windsurf/User/settings.json')
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
else if (isWin) {
|
|
342
|
+
const appData = process.env.APPDATA || '';
|
|
343
|
+
candidates.push({
|
|
344
|
+
name: 'Cursor',
|
|
345
|
+
path: path_1.default.join(appData, 'Cursor/User/settings.json')
|
|
346
|
+
});
|
|
347
|
+
candidates.push({
|
|
348
|
+
name: 'Windsurf',
|
|
349
|
+
path: path_1.default.join(appData, 'Windsurf/User/settings.json')
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
candidates.push({
|
|
354
|
+
name: 'Cursor',
|
|
355
|
+
path: path_1.default.join(HOME, '.config/Cursor/User/settings.json')
|
|
356
|
+
});
|
|
357
|
+
candidates.push({
|
|
358
|
+
name: 'Windsurf',
|
|
359
|
+
path: path_1.default.join(HOME, '.config/Windsurf/User/settings.json')
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
for (const cand of candidates) {
|
|
363
|
+
const dir = path_1.default.dirname(cand.path);
|
|
364
|
+
if (fs_1.default.existsSync(dir)) {
|
|
365
|
+
let settings = {};
|
|
366
|
+
if (fs_1.default.existsSync(cand.path)) {
|
|
367
|
+
try {
|
|
368
|
+
settings = JSON.parse(fs_1.default.readFileSync(cand.path, 'utf8'));
|
|
369
|
+
}
|
|
370
|
+
catch { }
|
|
326
371
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
372
|
+
let updated = false;
|
|
373
|
+
// Settings configuration to route custom openai/anthropic models through the proxy
|
|
374
|
+
const updates = {
|
|
375
|
+
"openai.baseURL": "http://localhost:8081/v1",
|
|
376
|
+
"openai.apiKey": "dummy-key-for-lemma",
|
|
377
|
+
"anthropic.baseURL": "http://localhost:8081",
|
|
378
|
+
"anthropic.apiKey": "dummy-key-for-lemma"
|
|
379
|
+
};
|
|
380
|
+
for (const [key, value] of Object.entries(updates)) {
|
|
381
|
+
if (settings[key] !== value) {
|
|
382
|
+
settings[key] = value;
|
|
383
|
+
updated = true;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
if (updated) {
|
|
387
|
+
fs_1.default.writeFileSync(cand.path, JSON.stringify(settings, null, 2));
|
|
388
|
+
console.log(`✅ [${cand.name}] Configured editor settings in ${cand.path} to route via local gateway!`);
|
|
341
389
|
}
|
|
342
|
-
}
|
|
343
|
-
if (updated) {
|
|
344
|
-
fs_1.default.writeFileSync(cand.path, JSON.stringify(settings, null, 2));
|
|
345
|
-
console.log(`✅ [${cand.name}] Configured editor settings to route via local gateway!`);
|
|
346
390
|
}
|
|
347
391
|
}
|
|
348
392
|
}
|
|
393
|
+
catch (e) {
|
|
394
|
+
console.log(`⚠️ Could not auto-configure editor settings: ${e.message}`);
|
|
395
|
+
}
|
|
349
396
|
}
|
|
350
|
-
|
|
351
|
-
console.log(
|
|
397
|
+
else {
|
|
398
|
+
console.log(`⏭️ [Editor Settings] Skip auto-configuration.`);
|
|
352
399
|
}
|
|
353
400
|
}
|
|
354
|
-
function startBackgroundClipboardWatcher() {
|
|
401
|
+
function startBackgroundClipboardWatcher(cliOpts) {
|
|
402
|
+
// Load configuration if it exists
|
|
403
|
+
let configDisabled = false;
|
|
404
|
+
try {
|
|
405
|
+
const configPath = path_1.default.join(process.cwd(), 'lemma.config.json');
|
|
406
|
+
if (fs_1.default.existsSync(configPath)) {
|
|
407
|
+
const rawConfig = fs_1.default.readFileSync(configPath, 'utf8');
|
|
408
|
+
const config = JSON.parse(rawConfig);
|
|
409
|
+
const systemConfig = config.system || {};
|
|
410
|
+
const clipConfig = systemConfig.clipboardWatcher || {};
|
|
411
|
+
if (clipConfig.disabled === true)
|
|
412
|
+
configDisabled = true;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
catch { }
|
|
416
|
+
const shouldWatch = cliOpts?.clipboard !== false && !configDisabled;
|
|
417
|
+
if (!shouldWatch) {
|
|
418
|
+
console.log(`⏭️ [Clipboard] Background clipboard watcher is disabled (via options or config).`);
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
355
421
|
try {
|
|
356
422
|
if (fs_1.default.existsSync(CLIPBOARD_PID_FILE)) {
|
|
357
423
|
const oldPid = fs_1.default.readFileSync(CLIPBOARD_PID_FILE, 'utf8');
|
|
@@ -1514,6 +1580,8 @@ commander_1.program.command('start')
|
|
|
1514
1580
|
.option('--project <name>', 'Override project name')
|
|
1515
1581
|
.option('--stack', 'Launch full development stack (Chroma + Router + Dashboard + Autopilot)')
|
|
1516
1582
|
.option('--autopilot', 'Launch background compiler watcher & healer', false)
|
|
1583
|
+
.option('--no-configure', 'Skip automatic configuration of editors, shell overrides, and Claude Desktop')
|
|
1584
|
+
.option('--no-clipboard', 'Skip launching background clipboard watcher')
|
|
1517
1585
|
.action(async (opts) => {
|
|
1518
1586
|
const port = parseInt(opts.port, 10);
|
|
1519
1587
|
// Ensure ChromaDB is running for semantic caching/search
|
|
@@ -1525,15 +1593,15 @@ commander_1.program.command('start')
|
|
|
1525
1593
|
console.log(`💡 Use 'lemma status' for details or 'lemma stop' to restart.\n`);
|
|
1526
1594
|
// Keep configurations up to date even if server was already started
|
|
1527
1595
|
const runningProject = resp.data.project || detectProject();
|
|
1528
|
-
autoConfigureAll(runningProject);
|
|
1529
|
-
startBackgroundClipboardWatcher();
|
|
1596
|
+
autoConfigureAll(runningProject, { configure: opts.configure });
|
|
1597
|
+
startBackgroundClipboardWatcher({ clipboard: opts.clipboard });
|
|
1530
1598
|
process.exit(0);
|
|
1531
1599
|
}
|
|
1532
1600
|
}
|
|
1533
1601
|
catch { }
|
|
1534
1602
|
const startProject = opts.project || detectProject();
|
|
1535
|
-
autoConfigureAll(startProject);
|
|
1536
|
-
startBackgroundClipboardWatcher();
|
|
1603
|
+
autoConfigureAll(startProject, { configure: opts.configure });
|
|
1604
|
+
startBackgroundClipboardWatcher({ clipboard: opts.clipboard });
|
|
1537
1605
|
// Automatically enable autopilot if stack is enabled and user is Pro
|
|
1538
1606
|
const runAutopilot = opts.autopilot || opts.stack;
|
|
1539
1607
|
if (runAutopilot) {
|
|
@@ -1709,7 +1777,8 @@ commander_1.program.command('activate <key>')
|
|
|
1709
1777
|
});
|
|
1710
1778
|
commander_1.program.command('init')
|
|
1711
1779
|
.description('Initialize Lemma in the current project (auto-discovery)')
|
|
1712
|
-
.
|
|
1780
|
+
.option('--no-configure', 'Skip automatic configuration of editors, shell overrides, and Claude Desktop')
|
|
1781
|
+
.action(async (opts) => {
|
|
1713
1782
|
const project = detectProject();
|
|
1714
1783
|
console.log(`\n🛠️ Initializing Lemma for [${project}]...`);
|
|
1715
1784
|
// Ensure ChromaDB is running for semantic caching/search
|
|
@@ -1739,7 +1808,7 @@ commander_1.program.command('init')
|
|
|
1739
1808
|
console.log('✅ Created .env with Lemma configuration');
|
|
1740
1809
|
}
|
|
1741
1810
|
console.log('\n🧠 \x1b[35mAuto-Setup MCP and redirection overrides for AI IDEs...\x1b[0m');
|
|
1742
|
-
autoConfigureAll(project);
|
|
1811
|
+
autoConfigureAll(project, { configure: opts.configure });
|
|
1743
1812
|
console.log('\n✨ Project initialized for the Agentic Era!');
|
|
1744
1813
|
console.log('🚀 Run "lemma start" to begin.\n');
|
|
1745
1814
|
});
|