@leanmcp/core 0.3.0 → 0.3.1
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/index.js +11 -3
- package/dist/index.mjs +11 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -771,9 +771,17 @@ var init_index = __esm({
|
|
|
771
771
|
let fileName = stack[i].getFileName();
|
|
772
772
|
if (fileName && !fileName.includes("@leanmcp") && !fileName.includes("leanmcp-sdk\\packages\\core") && !fileName.includes("leanmcp-sdk/packages/core") && (fileName.endsWith(".ts") || fileName.endsWith(".js") || fileName.endsWith(".mjs"))) {
|
|
773
773
|
if (fileName.startsWith("file://")) {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
fileName =
|
|
774
|
+
try {
|
|
775
|
+
const url = new URL(fileName);
|
|
776
|
+
fileName = decodeURIComponent(url.pathname);
|
|
777
|
+
if (process.platform === "win32" && fileName.startsWith("/")) {
|
|
778
|
+
fileName = fileName.substring(1);
|
|
779
|
+
}
|
|
780
|
+
} catch (e) {
|
|
781
|
+
fileName = fileName.replace("file://", "");
|
|
782
|
+
if (process.platform === "win32" && fileName.startsWith("/")) {
|
|
783
|
+
fileName = fileName.substring(1);
|
|
784
|
+
}
|
|
777
785
|
}
|
|
778
786
|
}
|
|
779
787
|
return fileName;
|
package/dist/index.mjs
CHANGED
|
@@ -668,9 +668,17 @@ var MCPServer = class {
|
|
|
668
668
|
let fileName = stack[i].getFileName();
|
|
669
669
|
if (fileName && !fileName.includes("@leanmcp") && !fileName.includes("leanmcp-sdk\\packages\\core") && !fileName.includes("leanmcp-sdk/packages/core") && (fileName.endsWith(".ts") || fileName.endsWith(".js") || fileName.endsWith(".mjs"))) {
|
|
670
670
|
if (fileName.startsWith("file://")) {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
fileName =
|
|
671
|
+
try {
|
|
672
|
+
const url = new URL(fileName);
|
|
673
|
+
fileName = decodeURIComponent(url.pathname);
|
|
674
|
+
if (process.platform === "win32" && fileName.startsWith("/")) {
|
|
675
|
+
fileName = fileName.substring(1);
|
|
676
|
+
}
|
|
677
|
+
} catch (e) {
|
|
678
|
+
fileName = fileName.replace("file://", "");
|
|
679
|
+
if (process.platform === "win32" && fileName.startsWith("/")) {
|
|
680
|
+
fileName = fileName.substring(1);
|
|
681
|
+
}
|
|
674
682
|
}
|
|
675
683
|
}
|
|
676
684
|
return fileName;
|