neuronlayer 0.1.1 → 0.1.2

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.

Potentially problematic release.


This version of neuronlayer might be problematic. Click here for more details.

package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neuronlayer",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Persistent memory layer for AI coding assistants - MCP server that makes AI truly understand your codebase",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -36,26 +36,26 @@
36
36
  "license": "MIT",
37
37
  "repository": {
38
38
  "type": "git",
39
- "url": "git+https://github.com/abhisavakar/memorylayer.git"
39
+ "url": "git+https://github.com/abhisavakar/neuronlayer.git"
40
40
  },
41
41
  "bugs": {
42
- "url": "https://github.com/abhisavakar/memorylayer/issues"
42
+ "url": "https://github.com/abhisavakar/neuronlayer/issues"
43
43
  },
44
- "homepage": "https://github.com/abhisavakar/memorylayer#readme",
44
+ "homepage": "https://github.com/abhisavakar/neuronlayer#readme",
45
45
  "dependencies": {
46
- "@modelcontextprotocol/sdk": "^1.0.0",
46
+ "@modelcontextprotocol/sdk": "^1.27.0",
47
47
  "@xenova/transformers": "^2.17.0",
48
- "better-sqlite3": "^11.0.0",
49
- "chokidar": "^3.6.0",
50
- "glob": "^10.0.0",
51
- "web-tree-sitter": "^0.22.0"
48
+ "better-sqlite3": "^11.8.0",
49
+ "chokidar": "^4.0.0",
50
+ "glob": "^13.0.0",
51
+ "web-tree-sitter": "^0.24.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/better-sqlite3": "^7.6.0",
55
- "@types/node": "^20.0.0",
56
- "esbuild": "^0.20.0",
57
- "typescript": "^5.4.0",
58
- "vitest": "^1.3.0"
55
+ "@types/node": "^22.0.0",
56
+ "esbuild": "^0.25.0",
57
+ "typescript": "^5.7.0",
58
+ "vitest": "^3.0.0"
59
59
  },
60
60
  "engines": {
61
61
  "node": ">=18.0.0"
@@ -232,31 +232,13 @@ export function showProject(projectId?: string): CommandResult {
232
232
  };
233
233
  }
234
234
 
235
- // Initialize neuronlayer for current project + auto-configure Claude Desktop
236
- export function initProject(projectPath?: string): CommandResult {
237
- const targetPath = projectPath || process.cwd();
238
-
239
- // 1. Register the project
240
- const addResult = addProject(targetPath);
241
- if (!addResult.success) {
242
- return addResult;
243
- }
244
-
245
- const projectInfo = addResult.data as ProjectInfo;
246
-
247
- // 2. Find Claude Desktop config
248
- const platform = process.platform;
249
- let configPath: string;
250
-
251
- if (platform === 'win32') {
252
- configPath = join(homedir(), 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json');
253
- } else if (platform === 'darwin') {
254
- configPath = join(homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
255
- } else {
256
- configPath = join(homedir(), '.config', 'claude', 'claude_desktop_config.json');
257
- }
258
-
259
- // 3. Read or create config
235
+ // Helper to configure an MCP client
236
+ function configureMCPClient(
237
+ clientName: string,
238
+ configPath: string,
239
+ serverName: string,
240
+ projectPath: string
241
+ ): { success: boolean; message: string } {
260
242
  let config: { mcpServers?: Record<string, unknown> } = { mcpServers: {} };
261
243
 
262
244
  try {
@@ -265,7 +247,8 @@ export function initProject(projectPath?: string): CommandResult {
265
247
  config = JSON.parse(content);
266
248
  } else {
267
249
  // Create directory if needed
268
- const configDir = configPath.substring(0, configPath.lastIndexOf(platform === 'win32' ? '\\' : '/'));
250
+ const sep = process.platform === 'win32' ? '\\' : '/';
251
+ const configDir = configPath.substring(0, configPath.lastIndexOf(sep));
269
252
  mkdirSync(configDir, { recursive: true });
270
253
  }
271
254
  } catch {
@@ -276,40 +259,92 @@ export function initProject(projectPath?: string): CommandResult {
276
259
  config.mcpServers = {};
277
260
  }
278
261
 
279
- // 4. Add neuronlayer server for this project
280
- const serverName = `neuronlayer-${projectInfo.name.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
281
-
282
262
  config.mcpServers[serverName] = {
283
263
  command: 'npx',
284
- args: ['-y', 'neuronlayer', '--project', targetPath]
264
+ args: ['-y', 'neuronlayer', '--project', projectPath]
285
265
  };
286
266
 
287
- // 5. Write config
288
267
  try {
289
268
  writeFileSync(configPath, JSON.stringify(config, null, 2));
269
+ return { success: true, message: `${clientName}: ${configPath}` };
290
270
  } catch (err) {
291
- return {
292
- success: false,
293
- message: `Failed to write Claude Desktop config: ${err instanceof Error ? err.message : String(err)}`
294
- };
271
+ return { success: false, message: `${clientName}: Failed - ${err instanceof Error ? err.message : String(err)}` };
295
272
  }
273
+ }
296
274
 
297
- return {
298
- success: true,
299
- message: `
275
+ // Initialize neuronlayer for current project + auto-configure Claude Desktop & OpenCode
276
+ export function initProject(projectPath?: string): CommandResult {
277
+ const targetPath = projectPath || process.cwd();
278
+
279
+ // 1. Register the project
280
+ const addResult = addProject(targetPath);
281
+ if (!addResult.success) {
282
+ return addResult;
283
+ }
284
+
285
+ const projectInfo = addResult.data as ProjectInfo;
286
+ const serverName = `neuronlayer-${projectInfo.name.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
287
+ const platform = process.platform;
288
+
289
+ const configuredClients: string[] = [];
290
+ const failedClients: string[] = [];
291
+
292
+ // 2. Configure Claude Desktop
293
+ let claudeConfigPath: string;
294
+ if (platform === 'win32') {
295
+ claudeConfigPath = join(homedir(), 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json');
296
+ } else if (platform === 'darwin') {
297
+ claudeConfigPath = join(homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
298
+ } else {
299
+ claudeConfigPath = join(homedir(), '.config', 'claude', 'claude_desktop_config.json');
300
+ }
301
+
302
+ const claudeResult = configureMCPClient('Claude Desktop', claudeConfigPath, serverName, targetPath);
303
+ if (claudeResult.success) {
304
+ configuredClients.push(claudeResult.message);
305
+ } else {
306
+ failedClients.push(claudeResult.message);
307
+ }
308
+
309
+ // 3. Configure OpenCode
310
+ const openCodeConfigPath = join(homedir(), '.opencode', 'config.json');
311
+ const openCodeResult = configureMCPClient('OpenCode', openCodeConfigPath, serverName, targetPath);
312
+ if (openCodeResult.success) {
313
+ configuredClients.push(openCodeResult.message);
314
+ } else {
315
+ failedClients.push(openCodeResult.message);
316
+ }
317
+
318
+ // 4. Configure Claude Code (CLI) - uses same config location as Claude Desktop on some systems
319
+ // Also check for .claude.json in home directory
320
+ const claudeCodeConfigPath = join(homedir(), '.claude.json');
321
+ const claudeCodeResult = configureMCPClient('Claude Code', claudeCodeConfigPath, serverName, targetPath);
322
+ if (claudeCodeResult.success) {
323
+ configuredClients.push(claudeCodeResult.message);
324
+ }
325
+
326
+ // Build result message
327
+ let message = `
300
328
  NeuronLayer initialized!
301
329
 
302
330
  Project: ${projectInfo.name}
303
331
  Path: ${targetPath}
304
332
  Data: ${projectInfo.dataDir}
305
333
 
306
- Claude Desktop configured:
307
- Config: ${configPath}
308
- Server: ${serverName}
334
+ Configured MCP Clients:
335
+ ${configuredClients.map(c => ' ' + c).join('\n')}
336
+ `;
337
+
338
+ if (failedClients.length > 0) {
339
+ message += `\nFailed:\n${failedClients.map(c => ' ✗ ' + c).join('\n')}`;
340
+ }
309
341
 
310
- Restart Claude Desktop to activate.
311
- `.trim(),
312
- data: { projectInfo, configPath, serverName }
342
+ message += `\n\nRestart your AI tools to activate.`;
343
+
344
+ return {
345
+ success: true,
346
+ message: message.trim(),
347
+ data: { projectInfo, serverName, configuredClients }
313
348
  };
314
349
  }
315
350
 
@@ -361,7 +396,7 @@ EXAMPLES:
361
396
  # Discover projects
362
397
  memorylayer projects discover
363
398
 
364
- For more information, visit: https://github.com/your-org/memorylayer
399
+ For more information, visit: https://github.com/abhisavakar/neuronlayer
365
400
  `);
366
401
  }
367
402