@trops/dash-core 0.1.391 → 0.1.392
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/dist/electron/index.js +31 -4
- package/dist/electron/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -25705,6 +25705,31 @@ function isNodeEsmError(errorText) {
|
|
|
25705
25705
|
);
|
|
25706
25706
|
}
|
|
25707
25707
|
|
|
25708
|
+
/**
|
|
25709
|
+
* When a catalog entry says `command: "node"`, spawn Electron itself in
|
|
25710
|
+
* ELECTRON_RUN_AS_NODE mode rather than the user's system node. This
|
|
25711
|
+
* matters in two ways:
|
|
25712
|
+
*
|
|
25713
|
+
* 1. In a packaged app the MCP server scripts live inside app.asar.
|
|
25714
|
+
* Electron's fs patches understand asar paths; a standalone Node
|
|
25715
|
+
* does not, so system `node` + asar path produces MODULE_NOT_FOUND.
|
|
25716
|
+
* 2. The host no longer depends on the user having a compatible Node
|
|
25717
|
+
* version (18–22) installed on PATH — Electron ships its own.
|
|
25718
|
+
*
|
|
25719
|
+
* Other commands (`npx`, shell scripts, etc.) still run via the
|
|
25720
|
+
* resolved shell PATH, so the PATH/nvm discovery elsewhere in this
|
|
25721
|
+
* file stays relevant for them.
|
|
25722
|
+
*/
|
|
25723
|
+
function resolveNodeCommand(command, env) {
|
|
25724
|
+
if (command === "node" && process.versions.electron) {
|
|
25725
|
+
return {
|
|
25726
|
+
command: process.execPath,
|
|
25727
|
+
env: { ...env, ELECTRON_RUN_AS_NODE: "1" },
|
|
25728
|
+
};
|
|
25729
|
+
}
|
|
25730
|
+
return { command, env };
|
|
25731
|
+
}
|
|
25732
|
+
|
|
25708
25733
|
/**
|
|
25709
25734
|
* Get the user's full shell PATH (including nvm, homebrew, volta, etc.).
|
|
25710
25735
|
* Electron GUI apps on macOS don't inherit the shell PATH, so we
|
|
@@ -26115,10 +26140,11 @@ const mcpController$2 = {
|
|
|
26115
26140
|
}
|
|
26116
26141
|
}
|
|
26117
26142
|
|
|
26143
|
+
const resolved = resolveNodeCommand(mcpConfig.command, env);
|
|
26118
26144
|
transport = new StdioClientTransport({
|
|
26119
|
-
command:
|
|
26145
|
+
command: resolved.command,
|
|
26120
26146
|
args,
|
|
26121
|
-
env,
|
|
26147
|
+
env: resolved.env,
|
|
26122
26148
|
});
|
|
26123
26149
|
}
|
|
26124
26150
|
|
|
@@ -26614,8 +26640,9 @@ const mcpController$2 = {
|
|
|
26614
26640
|
);
|
|
26615
26641
|
|
|
26616
26642
|
return new Promise((resolve) => {
|
|
26617
|
-
const
|
|
26618
|
-
|
|
26643
|
+
const resolvedCmd = resolveNodeCommand(authCommand.command, env);
|
|
26644
|
+
const proc = spawn(resolvedCmd.command, resolvedArgs, {
|
|
26645
|
+
env: resolvedCmd.env,
|
|
26619
26646
|
stdio: ["ignore", "pipe", "pipe"],
|
|
26620
26647
|
// Needed so Windows can launch .cmd/.bat wrappers (npx.cmd, etc).
|
|
26621
26648
|
shell: IS_WINDOWS$1,
|