@peac/mcp-server 0.13.0 → 0.13.2

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/cli.cjs CHANGED
@@ -49,7 +49,7 @@ var SERVER_NAME, SERVER_VERSION, MCP_PROTOCOL_VERSION;
49
49
  var init_constants = __esm({
50
50
  "src/infra/constants.ts"() {
51
51
  SERVER_NAME = "peac-mcp-server";
52
- SERVER_VERSION = "0.13.0";
52
+ SERVER_VERSION = "0.13.2";
53
53
  MCP_PROTOCOL_VERSION = "2025-11-25";
54
54
  }
55
55
  });
@@ -553,33 +553,33 @@ init_constants();
553
553
  // src/infra/errors.ts
554
554
  var McpServerError = class extends Error {
555
555
  code;
556
- constructor(code, message) {
557
- super(message);
556
+ constructor(code, message, options) {
557
+ super(message, options);
558
558
  this.name = "McpServerError";
559
559
  this.code = code;
560
560
  }
561
561
  };
562
562
  var KeyLoadError = class extends McpServerError {
563
- constructor(message) {
564
- super("E_MCP_KEY_LOAD", message);
563
+ constructor(message, options) {
564
+ super("E_MCP_KEY_LOAD", message, options);
565
565
  this.name = "KeyLoadError";
566
566
  }
567
567
  };
568
568
  var PolicyLoadError = class extends McpServerError {
569
- constructor(message) {
570
- super("E_MCP_POLICY_LOAD", message);
569
+ constructor(message, options) {
570
+ super("E_MCP_POLICY_LOAD", message, options);
571
571
  this.name = "PolicyLoadError";
572
572
  }
573
573
  };
574
574
  var JwksLoadError = class extends McpServerError {
575
- constructor(message) {
576
- super("E_MCP_JWKS_LOAD", message);
575
+ constructor(message, options) {
576
+ super("E_MCP_JWKS_LOAD", message, options);
577
577
  this.name = "JwksLoadError";
578
578
  }
579
579
  };
580
580
  var PathTraversalError = class extends McpServerError {
581
- constructor(message) {
582
- super("E_MCP_PATH_TRAVERSAL", message);
581
+ constructor(message, options) {
582
+ super("E_MCP_PATH_TRAVERSAL", message, options);
583
583
  this.name = "PathTraversalError";
584
584
  }
585
585
  };
@@ -663,7 +663,8 @@ async function loadPolicy(filePath) {
663
663
  raw = await promises.readFile(filePath, "utf-8");
664
664
  } catch (err) {
665
665
  throw new PolicyLoadError(
666
- `Failed to read policy file: ${filePath} -- ${err instanceof Error ? err.message : String(err)}`
666
+ `Failed to read policy file: ${filePath} -- ${err instanceof Error ? err.message : String(err)}`,
667
+ { cause: err }
667
668
  );
668
669
  }
669
670
  try {
@@ -679,8 +680,8 @@ async function loadPolicy(filePath) {
679
680
  let parsed;
680
681
  try {
681
682
  parsed = JSON.parse(raw);
682
- } catch {
683
- throw new PolicyLoadError(`Policy file is not valid JSON: ${filePath}`);
683
+ } catch (err) {
684
+ throw new PolicyLoadError(`Policy file is not valid JSON: ${filePath}`, { cause: err });
684
685
  }
685
686
  const result = PolicySchema.safeParse(parsed);
686
687
  if (!result.success) {
@@ -705,7 +706,8 @@ async function loadIssuerKey(schemeUri) {
705
706
  raw = await promises.readFile(filePath, "utf-8");
706
707
  } catch (err) {
707
708
  throw new KeyLoadError(
708
- `Failed to read key file: ${filePath} -- ${err instanceof Error ? err.message : String(err)}`
709
+ `Failed to read key file: ${filePath} -- ${err instanceof Error ? err.message : String(err)}`,
710
+ { cause: err }
709
711
  );
710
712
  }
711
713
  } else {
@@ -716,8 +718,8 @@ async function loadIssuerKey(schemeUri) {
716
718
  let jwk;
717
719
  try {
718
720
  jwk = JSON.parse(raw);
719
- } catch {
720
- throw new KeyLoadError("Key data is not valid JSON");
721
+ } catch (err) {
722
+ throw new KeyLoadError("Key data is not valid JSON", { cause: err });
721
723
  }
722
724
  if (typeof jwk !== "object" || jwk === null || !("kty" in jwk) || !("crv" in jwk) || !("d" in jwk)) {
723
725
  throw new KeyLoadError("JWK must contain kty, crv, and d fields");
@@ -759,14 +761,15 @@ async function loadJwksFile(filePath) {
759
761
  raw = await promises.readFile(filePath, "utf-8");
760
762
  } catch (err) {
761
763
  throw new JwksLoadError(
762
- `Failed to read JWKS file: ${filePath} -- ${err instanceof Error ? err.message : String(err)}`
764
+ `Failed to read JWKS file: ${filePath} -- ${err instanceof Error ? err.message : String(err)}`,
765
+ { cause: err }
763
766
  );
764
767
  }
765
768
  let parsed;
766
769
  try {
767
770
  parsed = JSON.parse(raw);
768
- } catch {
769
- throw new JwksLoadError(`JWKS file is not valid JSON: ${filePath}`);
771
+ } catch (err) {
772
+ throw new JwksLoadError(`JWKS file is not valid JSON: ${filePath}`, { cause: err });
770
773
  }
771
774
  if (typeof parsed !== "object" || parsed === null || !("keys" in parsed)) {
772
775
  throw new JwksLoadError('JWKS must contain a "keys" array');