@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/contract-index.json +1 -1
- package/dist/docs-index.json +1 -1
- package/dist/lib.cjs +9 -4
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.js +9 -4
- package/dist/lib.js.map +1 -1
- package/dist/mcp.js +9 -4
- package/dist/mcp.js.map +1 -1
- package/package.json +3 -3
package/dist/lib.cjs
CHANGED
|
@@ -1728,6 +1728,7 @@ var ThrottleError = class extends Error {
|
|
|
1728
1728
|
statusCode;
|
|
1729
1729
|
details;
|
|
1730
1730
|
body;
|
|
1731
|
+
requestId;
|
|
1731
1732
|
constructor(args) {
|
|
1732
1733
|
super(args.message);
|
|
1733
1734
|
this.name = "ThrottleError";
|
|
@@ -1735,14 +1736,17 @@ var ThrottleError = class extends Error {
|
|
|
1735
1736
|
this.statusCode = args.statusCode;
|
|
1736
1737
|
this.details = args.details;
|
|
1737
1738
|
this.body = args.body;
|
|
1739
|
+
const fromBody = args.body?.meta?.requestId;
|
|
1740
|
+
const fromHeader = typeof args.responseHeaders?.get === "function" ? args.responseHeaders.get("x-request-id") : args.responseHeaders?.["x-request-id"];
|
|
1741
|
+
this.requestId = args.requestId ?? (typeof fromBody === "string" ? fromBody : void 0) ?? (typeof fromHeader === "string" ? fromHeader : void 0);
|
|
1738
1742
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
1739
1743
|
}
|
|
1740
1744
|
};
|
|
1741
1745
|
|
|
1742
1746
|
// src/client.ts
|
|
1743
1747
|
var ThrottleApiError = class extends ThrottleError {
|
|
1744
|
-
constructor(code, message, statusCode, details) {
|
|
1745
|
-
super({ code, message, statusCode, details });
|
|
1748
|
+
constructor(code, message, statusCode, details, responseHeaders) {
|
|
1749
|
+
super({ code, message, statusCode, details, responseHeaders });
|
|
1746
1750
|
this.name = "ThrottleApiError";
|
|
1747
1751
|
}
|
|
1748
1752
|
};
|
|
@@ -1808,7 +1812,8 @@ var ThrottleClient = class {
|
|
|
1808
1812
|
err?.code ?? `http_${res.status}`,
|
|
1809
1813
|
err?.message ?? `Request failed (${res.status}): ${text.slice(0, 200)}`,
|
|
1810
1814
|
res.status,
|
|
1811
|
-
err?.details
|
|
1815
|
+
err?.details,
|
|
1816
|
+
res.headers
|
|
1812
1817
|
);
|
|
1813
1818
|
}
|
|
1814
1819
|
return parsed;
|
|
@@ -3149,7 +3154,7 @@ var OAUTH_PROJECTIONS = {
|
|
|
3149
3154
|
};
|
|
3150
3155
|
|
|
3151
3156
|
// src/server.ts
|
|
3152
|
-
var VERSION = true ? "0.2.
|
|
3157
|
+
var VERSION = true ? "0.2.2" : "0.0.0-dev";
|
|
3153
3158
|
function registerableActions(policy) {
|
|
3154
3159
|
const isProduction = policy.identity.environment.providerEnvironment === "production";
|
|
3155
3160
|
return actionsForChannel("mcp").filter((action) => {
|