@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/mcp.js
CHANGED
|
@@ -9,6 +9,7 @@ var ThrottleError = class extends Error {
|
|
|
9
9
|
statusCode;
|
|
10
10
|
details;
|
|
11
11
|
body;
|
|
12
|
+
requestId;
|
|
12
13
|
constructor(args) {
|
|
13
14
|
super(args.message);
|
|
14
15
|
this.name = "ThrottleError";
|
|
@@ -16,14 +17,17 @@ var ThrottleError = class extends Error {
|
|
|
16
17
|
this.statusCode = args.statusCode;
|
|
17
18
|
this.details = args.details;
|
|
18
19
|
this.body = args.body;
|
|
20
|
+
const fromBody = args.body?.meta?.requestId;
|
|
21
|
+
const fromHeader = typeof args.responseHeaders?.get === "function" ? args.responseHeaders.get("x-request-id") : args.responseHeaders?.["x-request-id"];
|
|
22
|
+
this.requestId = args.requestId ?? (typeof fromBody === "string" ? fromBody : void 0) ?? (typeof fromHeader === "string" ? fromHeader : void 0);
|
|
19
23
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
20
24
|
}
|
|
21
25
|
};
|
|
22
26
|
|
|
23
27
|
// src/client.ts
|
|
24
28
|
var ThrottleApiError = class extends ThrottleError {
|
|
25
|
-
constructor(code, message, statusCode, details) {
|
|
26
|
-
super({ code, message, statusCode, details });
|
|
29
|
+
constructor(code, message, statusCode, details, responseHeaders) {
|
|
30
|
+
super({ code, message, statusCode, details, responseHeaders });
|
|
27
31
|
this.name = "ThrottleApiError";
|
|
28
32
|
}
|
|
29
33
|
};
|
|
@@ -89,7 +93,8 @@ var ThrottleClient = class {
|
|
|
89
93
|
err?.code ?? `http_${res.status}`,
|
|
90
94
|
err?.message ?? `Request failed (${res.status}): ${text.slice(0, 200)}`,
|
|
91
95
|
res.status,
|
|
92
|
-
err?.details
|
|
96
|
+
err?.details,
|
|
97
|
+
res.headers
|
|
93
98
|
);
|
|
94
99
|
}
|
|
95
100
|
return parsed;
|
|
@@ -3122,7 +3127,7 @@ var OAUTH_PROJECTIONS = {
|
|
|
3122
3127
|
};
|
|
3123
3128
|
|
|
3124
3129
|
// src/server.ts
|
|
3125
|
-
var VERSION = true ? "0.2.
|
|
3130
|
+
var VERSION = true ? "0.2.2" : "0.0.0-dev";
|
|
3126
3131
|
function registerableActions(policy) {
|
|
3127
3132
|
const isProduction = policy.identity.environment.providerEnvironment === "production";
|
|
3128
3133
|
return actionsForChannel("mcp").filter((action) => {
|