@trops/dash-core 0.1.45 → 0.1.47
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 +44 -0
- package/dist/electron/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -4773,6 +4773,33 @@ const {
|
|
|
4773
4773
|
const path$6 = require$$1$1;
|
|
4774
4774
|
const fs$5 = require$$2;
|
|
4775
4775
|
|
|
4776
|
+
/**
|
|
4777
|
+
* Cached shell PATH result (resolved once, reused for all spawns).
|
|
4778
|
+
*/
|
|
4779
|
+
let _shellPath = null;
|
|
4780
|
+
|
|
4781
|
+
/**
|
|
4782
|
+
* Get the user's full shell PATH (including nvm, homebrew, volta, etc.).
|
|
4783
|
+
* Electron GUI apps on macOS don't inherit the shell PATH, so we
|
|
4784
|
+
* resolve it once by invoking a login shell.
|
|
4785
|
+
*/
|
|
4786
|
+
function getShellPath() {
|
|
4787
|
+
if (_shellPath !== null) return _shellPath;
|
|
4788
|
+
|
|
4789
|
+
try {
|
|
4790
|
+
const { execSync } = require("child_process");
|
|
4791
|
+
const shell = process.env.SHELL || "/bin/bash";
|
|
4792
|
+
_shellPath = execSync(`${shell} -ilc 'echo -n "$PATH"'`, {
|
|
4793
|
+
encoding: "utf8",
|
|
4794
|
+
timeout: 5000,
|
|
4795
|
+
});
|
|
4796
|
+
} catch {
|
|
4797
|
+
_shellPath = process.env.PATH || "";
|
|
4798
|
+
}
|
|
4799
|
+
|
|
4800
|
+
return _shellPath;
|
|
4801
|
+
}
|
|
4802
|
+
|
|
4776
4803
|
/**
|
|
4777
4804
|
* Active MCP server connections
|
|
4778
4805
|
* Map<string, { client: Client, transport: Transport, tools: Array, status: string }>
|
|
@@ -4886,6 +4913,9 @@ const mcpController$1 = {
|
|
|
4886
4913
|
} else {
|
|
4887
4914
|
// stdio transport (default) - spawn a local child process
|
|
4888
4915
|
const env = { ...process.env };
|
|
4916
|
+
// Ensure full shell PATH is available (Electron GUI apps
|
|
4917
|
+
// on macOS don't inherit nvm/homebrew paths)
|
|
4918
|
+
env.PATH = getShellPath();
|
|
4889
4919
|
if (mcpConfig.envMapping && credentials) {
|
|
4890
4920
|
Object.entries(mcpConfig.envMapping).forEach(
|
|
4891
4921
|
([envVar, credentialKey]) => {
|
|
@@ -8641,6 +8671,20 @@ var dynamicWidgetLoaderExports = dynamicWidgetLoader$2.exports;
|
|
|
8641
8671
|
|
|
8642
8672
|
for (const candidate of candidates) {
|
|
8643
8673
|
if (fs.existsSync(candidate)) {
|
|
8674
|
+
// Skip ESM files — the eval pipeline requires CJS
|
|
8675
|
+
if (candidate.endsWith(".js") && !candidate.endsWith(".cjs.js")) {
|
|
8676
|
+
try {
|
|
8677
|
+
const head = fs.readFileSync(candidate, "utf8").slice(0, 256);
|
|
8678
|
+
if (/^\s*(import\s|export\s)/m.test(head)) {
|
|
8679
|
+
console.log(
|
|
8680
|
+
`[WidgetRegistry] Skipping ESM bundle: ${candidate}`,
|
|
8681
|
+
);
|
|
8682
|
+
continue;
|
|
8683
|
+
}
|
|
8684
|
+
} catch (_) {
|
|
8685
|
+
// Non-fatal — allow fallthrough
|
|
8686
|
+
}
|
|
8687
|
+
}
|
|
8644
8688
|
return candidate;
|
|
8645
8689
|
}
|
|
8646
8690
|
}
|