@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/lib.cjs CHANGED
@@ -344,6 +344,29 @@ function redactShopperPii(value) {
344
344
  return walk(value, null, 0);
345
345
  }
346
346
 
347
+ // ../core-scopes/src/public-payment.ts
348
+ var RAW_PROCESSOR_KEYS = ["processorResponse", "gr4vy_payment_method"];
349
+ var RAW = new Set(RAW_PROCESSOR_KEYS);
350
+ function isPlainObject2(value) {
351
+ if (value === null || typeof value !== "object") return false;
352
+ const proto = Object.getPrototypeOf(value);
353
+ return proto === Object.prototype || proto === null;
354
+ }
355
+ function strip(value, depth) {
356
+ if (depth > 32) return value;
357
+ if (Array.isArray(value)) return value.map((v) => strip(v, depth + 1));
358
+ if (!isPlainObject2(value)) return value;
359
+ const out = {};
360
+ for (const [key, child] of Object.entries(value)) {
361
+ if (RAW.has(key)) continue;
362
+ out[key] = strip(child, depth + 1);
363
+ }
364
+ return out;
365
+ }
366
+ function stripRawProcessorData(value) {
367
+ return strip(value, 0);
368
+ }
369
+
347
370
  // ../action-catalog/src/actions.ts
348
371
  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.";
349
372
  var ACTIONS = [
@@ -3205,7 +3228,7 @@ var OAUTH_PROJECTIONS = {
3205
3228
  };
3206
3229
 
3207
3230
  // src/server.ts
3208
- var VERSION = true ? "0.4.0" : "0.0.0-dev";
3231
+ var VERSION = true ? "0.4.1" : "0.0.0-dev";
3209
3232
  function registerableActions(policy) {
3210
3233
  const isProduction = policy.identity.environment.providerEnvironment === "production";
3211
3234
  return actionsForChannel("mcp").filter((action) => {
@@ -3318,7 +3341,7 @@ function createServer(options) {
3318
3341
  isError: true
3319
3342
  };
3320
3343
  }
3321
- const result = await handler(ctx, args ?? {});
3344
+ const result = stripRawProcessorData(await handler(ctx, args ?? {}));
3322
3345
  const shown = redactPii ? redactShopperPii(project(result, OAUTH_PROJECTIONS[action.id])) : result;
3323
3346
  return { content: [{ type: "text", text: formatResult(shown) }] };
3324
3347
  } catch (error) {