@usethrottle/mcp 0.4.0 → 0.4.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/contract-index.json +1 -1
- package/dist/docs-index.json +1 -1
- package/dist/lib.cjs +25 -2
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.js +25 -2
- package/dist/lib.js.map +1 -1
- package/dist/mcp.js +25 -2
- package/dist/mcp.js.map +1 -1
- package/package.json +3 -3
package/dist/lib.js
CHANGED
|
@@ -312,6 +312,29 @@ function redactShopperPii(value) {
|
|
|
312
312
|
return walk(value, null, 0);
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
+
// ../core-scopes/src/public-payment.ts
|
|
316
|
+
var RAW_PROCESSOR_KEYS = ["processorResponse", "gr4vy_payment_method"];
|
|
317
|
+
var RAW = new Set(RAW_PROCESSOR_KEYS);
|
|
318
|
+
function isPlainObject2(value) {
|
|
319
|
+
if (value === null || typeof value !== "object") return false;
|
|
320
|
+
const proto = Object.getPrototypeOf(value);
|
|
321
|
+
return proto === Object.prototype || proto === null;
|
|
322
|
+
}
|
|
323
|
+
function strip(value, depth) {
|
|
324
|
+
if (depth > 32) return value;
|
|
325
|
+
if (Array.isArray(value)) return value.map((v) => strip(v, depth + 1));
|
|
326
|
+
if (!isPlainObject2(value)) return value;
|
|
327
|
+
const out = {};
|
|
328
|
+
for (const [key, child] of Object.entries(value)) {
|
|
329
|
+
if (RAW.has(key)) continue;
|
|
330
|
+
out[key] = strip(child, depth + 1);
|
|
331
|
+
}
|
|
332
|
+
return out;
|
|
333
|
+
}
|
|
334
|
+
function stripRawProcessorData(value) {
|
|
335
|
+
return strip(value, 0);
|
|
336
|
+
}
|
|
337
|
+
|
|
315
338
|
// ../action-catalog/src/actions.ts
|
|
316
339
|
var OAUTH_WITHHELD = "Over an OAuth connection (ChatGPT, Claude) these are withheld, because a buyer can type them: line-item and quote-item names, SKUs and reference ids; company; every address line except the country; the merchant's external ids; notes, messages, reasons and metadata. Describe items by quantity and amount, and say the rest is withheld rather than missing.";
|
|
317
340
|
var ACTIONS = [
|
|
@@ -3173,7 +3196,7 @@ var OAUTH_PROJECTIONS = {
|
|
|
3173
3196
|
};
|
|
3174
3197
|
|
|
3175
3198
|
// src/server.ts
|
|
3176
|
-
var VERSION = true ? "0.4.
|
|
3199
|
+
var VERSION = true ? "0.4.1" : "0.0.0-dev";
|
|
3177
3200
|
function registerableActions(policy) {
|
|
3178
3201
|
const isProduction = policy.identity.environment.providerEnvironment === "production";
|
|
3179
3202
|
return actionsForChannel("mcp").filter((action) => {
|
|
@@ -3286,7 +3309,7 @@ function createServer(options) {
|
|
|
3286
3309
|
isError: true
|
|
3287
3310
|
};
|
|
3288
3311
|
}
|
|
3289
|
-
const result = await handler(ctx, args ?? {});
|
|
3312
|
+
const result = stripRawProcessorData(await handler(ctx, args ?? {}));
|
|
3290
3313
|
const shown = redactPii ? redactShopperPii(project(result, OAUTH_PROJECTIONS[action.id])) : result;
|
|
3291
3314
|
return { content: [{ type: "text", text: formatResult(shown) }] };
|
|
3292
3315
|
} catch (error) {
|