@usethrottle/mcp 0.2.1 → 0.2.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/lib.js CHANGED
@@ -1696,6 +1696,7 @@ var ThrottleError = class extends Error {
1696
1696
  statusCode;
1697
1697
  details;
1698
1698
  body;
1699
+ requestId;
1699
1700
  constructor(args) {
1700
1701
  super(args.message);
1701
1702
  this.name = "ThrottleError";
@@ -1703,14 +1704,17 @@ var ThrottleError = class extends Error {
1703
1704
  this.statusCode = args.statusCode;
1704
1705
  this.details = args.details;
1705
1706
  this.body = args.body;
1707
+ const fromBody = args.body?.meta?.requestId;
1708
+ const fromHeader = typeof args.responseHeaders?.get === "function" ? args.responseHeaders.get("x-request-id") : args.responseHeaders?.["x-request-id"];
1709
+ this.requestId = args.requestId ?? (typeof fromBody === "string" ? fromBody : void 0) ?? (typeof fromHeader === "string" ? fromHeader : void 0);
1706
1710
  Object.setPrototypeOf(this, new.target.prototype);
1707
1711
  }
1708
1712
  };
1709
1713
 
1710
1714
  // src/client.ts
1711
1715
  var ThrottleApiError = class extends ThrottleError {
1712
- constructor(code, message, statusCode, details) {
1713
- super({ code, message, statusCode, details });
1716
+ constructor(code, message, statusCode, details, responseHeaders) {
1717
+ super({ code, message, statusCode, details, responseHeaders });
1714
1718
  this.name = "ThrottleApiError";
1715
1719
  }
1716
1720
  };
@@ -1776,7 +1780,8 @@ var ThrottleClient = class {
1776
1780
  err?.code ?? `http_${res.status}`,
1777
1781
  err?.message ?? `Request failed (${res.status}): ${text.slice(0, 200)}`,
1778
1782
  res.status,
1779
- err?.details
1783
+ err?.details,
1784
+ res.headers
1780
1785
  );
1781
1786
  }
1782
1787
  return parsed;
@@ -3117,7 +3122,7 @@ var OAUTH_PROJECTIONS = {
3117
3122
  };
3118
3123
 
3119
3124
  // src/server.ts
3120
- var VERSION = true ? "0.2.1" : "0.0.0-dev";
3125
+ var VERSION = true ? "0.2.2" : "0.0.0-dev";
3121
3126
  function registerableActions(policy) {
3122
3127
  const isProduction = policy.identity.environment.providerEnvironment === "production";
3123
3128
  return actionsForChannel("mcp").filter((action) => {