neuronlayer 0.2.1 → 0.2.3
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 +3 -1
- package/dist/index.js +47 -21
- package/dist/index.js.map +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -37,7 +37,9 @@ cd your-project
|
|
|
37
37
|
neuronlayer init
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
This registers your project and configures Claude Desktop, Claude Code, and
|
|
40
|
+
This registers your project and configures Claude Desktop, Claude Code, OpenCode, and Cursor automatically. Restart your AI tool and you're ready.
|
|
41
|
+
|
|
42
|
+
> **Windows users**: If upgrading, close any AI tools using NeuronLayer first (or run `taskkill /f /im node.exe`) before reinstalling. Windows locks native binaries while they're in use.
|
|
41
43
|
|
|
42
44
|
---
|
|
43
45
|
|
package/dist/index.js
CHANGED
|
@@ -2986,7 +2986,7 @@ var require_compile = __commonJS({
|
|
|
2986
2986
|
const schOrFunc = root.refs[ref];
|
|
2987
2987
|
if (schOrFunc)
|
|
2988
2988
|
return schOrFunc;
|
|
2989
|
-
let _sch =
|
|
2989
|
+
let _sch = resolve4.call(this, root, ref);
|
|
2990
2990
|
if (_sch === void 0) {
|
|
2991
2991
|
const schema = (_a2 = root.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref];
|
|
2992
2992
|
const { schemaId } = this.opts;
|
|
@@ -3013,7 +3013,7 @@ var require_compile = __commonJS({
|
|
|
3013
3013
|
function sameSchemaEnv(s1, s2) {
|
|
3014
3014
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
3015
3015
|
}
|
|
3016
|
-
function
|
|
3016
|
+
function resolve4(root, ref) {
|
|
3017
3017
|
let sch;
|
|
3018
3018
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
3019
3019
|
ref = sch;
|
|
@@ -3588,7 +3588,7 @@ var require_fast_uri = __commonJS({
|
|
|
3588
3588
|
}
|
|
3589
3589
|
return uri;
|
|
3590
3590
|
}
|
|
3591
|
-
function
|
|
3591
|
+
function resolve4(baseURI, relativeURI, options) {
|
|
3592
3592
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
3593
3593
|
const resolved = resolveComponent(parse3(baseURI, schemelessOptions), parse3(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
3594
3594
|
schemelessOptions.skipEscape = true;
|
|
@@ -3815,7 +3815,7 @@ var require_fast_uri = __commonJS({
|
|
|
3815
3815
|
var fastUri = {
|
|
3816
3816
|
SCHEMES,
|
|
3817
3817
|
normalize,
|
|
3818
|
-
resolve:
|
|
3818
|
+
resolve: resolve4,
|
|
3819
3819
|
resolveComponent,
|
|
3820
3820
|
equal,
|
|
3821
3821
|
serialize,
|
|
@@ -19578,7 +19578,7 @@ var Protocol = class {
|
|
|
19578
19578
|
return;
|
|
19579
19579
|
}
|
|
19580
19580
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
|
|
19581
|
-
await new Promise((
|
|
19581
|
+
await new Promise((resolve4) => setTimeout(resolve4, pollInterval));
|
|
19582
19582
|
options?.signal?.throwIfAborted();
|
|
19583
19583
|
}
|
|
19584
19584
|
} catch (error2) {
|
|
@@ -19595,7 +19595,7 @@ var Protocol = class {
|
|
|
19595
19595
|
*/
|
|
19596
19596
|
request(request, resultSchema, options) {
|
|
19597
19597
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
19598
|
-
return new Promise((
|
|
19598
|
+
return new Promise((resolve4, reject) => {
|
|
19599
19599
|
const earlyReject = (error2) => {
|
|
19600
19600
|
reject(error2);
|
|
19601
19601
|
};
|
|
@@ -19673,7 +19673,7 @@ var Protocol = class {
|
|
|
19673
19673
|
if (!parseResult.success) {
|
|
19674
19674
|
reject(parseResult.error);
|
|
19675
19675
|
} else {
|
|
19676
|
-
|
|
19676
|
+
resolve4(parseResult.data);
|
|
19677
19677
|
}
|
|
19678
19678
|
} catch (error2) {
|
|
19679
19679
|
reject(error2);
|
|
@@ -19934,12 +19934,12 @@ var Protocol = class {
|
|
|
19934
19934
|
}
|
|
19935
19935
|
} catch {
|
|
19936
19936
|
}
|
|
19937
|
-
return new Promise((
|
|
19937
|
+
return new Promise((resolve4, reject) => {
|
|
19938
19938
|
if (signal.aborted) {
|
|
19939
19939
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
19940
19940
|
return;
|
|
19941
19941
|
}
|
|
19942
|
-
const timeoutId = setTimeout(
|
|
19942
|
+
const timeoutId = setTimeout(resolve4, interval);
|
|
19943
19943
|
signal.addEventListener("abort", () => {
|
|
19944
19944
|
clearTimeout(timeoutId);
|
|
19945
19945
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -20809,12 +20809,12 @@ var StdioServerTransport = class {
|
|
|
20809
20809
|
this.onclose?.();
|
|
20810
20810
|
}
|
|
20811
20811
|
send(message) {
|
|
20812
|
-
return new Promise((
|
|
20812
|
+
return new Promise((resolve4) => {
|
|
20813
20813
|
const json2 = serializeMessage(message);
|
|
20814
20814
|
if (this._stdout.write(json2)) {
|
|
20815
|
-
|
|
20815
|
+
resolve4();
|
|
20816
20816
|
} else {
|
|
20817
|
-
this._stdout.once("drain",
|
|
20817
|
+
this._stdout.once("drain", resolve4);
|
|
20818
20818
|
}
|
|
20819
20819
|
});
|
|
20820
20820
|
}
|
|
@@ -22020,7 +22020,7 @@ var EmbeddingGenerator = class {
|
|
|
22020
22020
|
if (this.initialized) return;
|
|
22021
22021
|
if (this.initializing) {
|
|
22022
22022
|
while (this.initializing) {
|
|
22023
|
-
await new Promise((
|
|
22023
|
+
await new Promise((resolve4) => setTimeout(resolve4, 100));
|
|
22024
22024
|
}
|
|
22025
22025
|
return;
|
|
22026
22026
|
}
|
|
@@ -38856,12 +38856,12 @@ var HTTPServer = class {
|
|
|
38856
38856
|
}
|
|
38857
38857
|
}
|
|
38858
38858
|
readBody(req) {
|
|
38859
|
-
return new Promise((
|
|
38859
|
+
return new Promise((resolve4, reject) => {
|
|
38860
38860
|
let body = "";
|
|
38861
38861
|
req.on("data", (chunk) => {
|
|
38862
38862
|
body += chunk;
|
|
38863
38863
|
});
|
|
38864
|
-
req.on("end", () =>
|
|
38864
|
+
req.on("end", () => resolve4(body));
|
|
38865
38865
|
req.on("error", reject);
|
|
38866
38866
|
});
|
|
38867
38867
|
}
|
|
@@ -39052,7 +39052,7 @@ function parseArgs(args) {
|
|
|
39052
39052
|
}
|
|
39053
39053
|
|
|
39054
39054
|
// src/cli/commands.ts
|
|
39055
|
-
import { join as join15 } from "path";
|
|
39055
|
+
import { join as join15, resolve as resolve3 } from "path";
|
|
39056
39056
|
import { existsSync as existsSync15, readFileSync as readFileSync12, writeFileSync as writeFileSync6, mkdirSync as mkdirSync8 } from "fs";
|
|
39057
39057
|
import { homedir as homedir2 } from "os";
|
|
39058
39058
|
var projectManager = new ProjectManager();
|
|
@@ -39270,15 +39270,42 @@ function configureProjectMCP(configPath, projectPath) {
|
|
|
39270
39270
|
if (!config2.mcpServers) {
|
|
39271
39271
|
config2.mcpServers = {};
|
|
39272
39272
|
}
|
|
39273
|
+
const absoluteProjectPath = resolve3(projectPath);
|
|
39273
39274
|
config2.mcpServers["neuronlayer"] = {
|
|
39274
39275
|
command: "npx",
|
|
39275
|
-
args: ["-y", "neuronlayer", "--project",
|
|
39276
|
+
args: ["-y", "neuronlayer", "--project", absoluteProjectPath]
|
|
39276
39277
|
};
|
|
39277
39278
|
try {
|
|
39278
39279
|
writeFileSync6(configPath, JSON.stringify(config2, null, 2));
|
|
39279
|
-
return { success: true, message: `Claude Code: ${configPath} (project-local)` };
|
|
39280
|
+
return { success: true, message: `Claude Code / OpenCode: ${configPath} (project-local)` };
|
|
39280
39281
|
} catch (err) {
|
|
39281
|
-
return { success: false, message: `Claude Code: Failed - ${err instanceof Error ? err.message : String(err)}` };
|
|
39282
|
+
return { success: false, message: `Claude Code / OpenCode: Failed - ${err instanceof Error ? err.message : String(err)}` };
|
|
39283
|
+
}
|
|
39284
|
+
}
|
|
39285
|
+
function configureOpenCode(projectPath) {
|
|
39286
|
+
const configPath = join15(projectPath, "opencode.json");
|
|
39287
|
+
let config2 = {};
|
|
39288
|
+
try {
|
|
39289
|
+
if (existsSync15(configPath)) {
|
|
39290
|
+
const content = readFileSync12(configPath, "utf-8");
|
|
39291
|
+
config2 = JSON.parse(content);
|
|
39292
|
+
}
|
|
39293
|
+
} catch {
|
|
39294
|
+
}
|
|
39295
|
+
if (!config2.mcp || typeof config2.mcp !== "object") {
|
|
39296
|
+
config2.mcp = {};
|
|
39297
|
+
}
|
|
39298
|
+
const absoluteProjectPath = resolve3(projectPath);
|
|
39299
|
+
config2.mcp["neuronlayer"] = {
|
|
39300
|
+
type: "local",
|
|
39301
|
+
command: ["npx", "-y", "neuronlayer", "--project", absoluteProjectPath],
|
|
39302
|
+
enabled: true
|
|
39303
|
+
};
|
|
39304
|
+
try {
|
|
39305
|
+
writeFileSync6(configPath, JSON.stringify(config2, null, 2));
|
|
39306
|
+
return { success: true, message: `OpenCode: ${configPath}` };
|
|
39307
|
+
} catch (err) {
|
|
39308
|
+
return { success: false, message: `OpenCode: Failed - ${err instanceof Error ? err.message : String(err)}` };
|
|
39282
39309
|
}
|
|
39283
39310
|
}
|
|
39284
39311
|
function initProject(projectPath) {
|
|
@@ -39306,8 +39333,7 @@ function initProject(projectPath) {
|
|
|
39306
39333
|
} else {
|
|
39307
39334
|
failedClients.push(claudeResult.message);
|
|
39308
39335
|
}
|
|
39309
|
-
const
|
|
39310
|
-
const openCodeResult = configureMCPClient("OpenCode", openCodeConfigPath, serverName, targetPath);
|
|
39336
|
+
const openCodeResult = configureOpenCode(targetPath);
|
|
39311
39337
|
if (openCodeResult.success) {
|
|
39312
39338
|
configuredClients.push(openCodeResult.message);
|
|
39313
39339
|
} else {
|