@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 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
- fileName = fileName.replace("file:///", "").replace("file://", "");
775
- if (process.platform === "win32" && fileName.startsWith("/")) {
776
- fileName = fileName.substring(1);
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
- fileName = fileName.replace("file:///", "").replace("file://", "");
672
- if (process.platform === "win32" && fileName.startsWith("/")) {
673
- fileName = fileName.substring(1);
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leanmcp/core",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Core library implementing decorators, reflection, and MCP runtime server",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",