@usethrottle/mcp 0.3.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 = [
@@ -2706,7 +2729,9 @@ var LINE_RECURRING = {
2706
2729
  intervalUnit: S,
2707
2730
  intervalCount: S,
2708
2731
  totalPayments: S,
2709
- trialDays: S
2732
+ trialDays: S,
2733
+ // A custom installment schedule: amounts and gaps are numbers and unit tokens, no free text.
2734
+ schedule: [{ amount: S, intervalUnit: S, intervalCount: S }]
2710
2735
  };
2711
2736
  var LINE_ITEM = {
2712
2737
  id: S,
@@ -2718,7 +2743,7 @@ var LINE_ITEM = {
2718
2743
  taxAmount: S,
2719
2744
  total: S,
2720
2745
  // amount = renewal price on a trial line (whose unitPrice is 0); count = the old display mirror.
2721
- recurring: { ...LINE_RECURRING, amount: S, count: S },
2746
+ recurring: { ...LINE_RECURRING, amount: S, count: S, scheduleUnitTotal: S },
2722
2747
  subscriptionId: S
2723
2748
  };
2724
2749
  var ORDER = {
@@ -2825,6 +2850,18 @@ var SUBSCRIPTION = {
2825
2850
  pendingQuantity: S,
2826
2851
  pendingIntervalUnit: S,
2827
2852
  pendingIntervalCount: S,
2853
+ scheduleTotal: S,
2854
+ nextPaymentAmount: S,
2855
+ paymentSchedule: [{
2856
+ index: S,
2857
+ amount: S,
2858
+ discount: S,
2859
+ net: S,
2860
+ intervalUnit: S,
2861
+ intervalCount: S,
2862
+ status: S,
2863
+ dueAt: S
2864
+ }],
2828
2865
  createdAt: S
2829
2866
  };
2830
2867
  var QUOTE_SUMMARY = {
@@ -3047,7 +3084,9 @@ var OAUTH_PROJECTIONS = {
3047
3084
  trialDays: S,
3048
3085
  trialEndsAt: S,
3049
3086
  planChargedToday: S,
3050
- taxApplies: S
3087
+ taxApplies: S,
3088
+ scheduleGapUnits: [S],
3089
+ schedule: [{ net: S, dueAt: S }]
3051
3090
  }]
3052
3091
  },
3053
3092
  cart: section({
@@ -3189,7 +3228,7 @@ var OAUTH_PROJECTIONS = {
3189
3228
  };
3190
3229
 
3191
3230
  // src/server.ts
3192
- var VERSION = true ? "0.3.0" : "0.0.0-dev";
3231
+ var VERSION = true ? "0.4.1" : "0.0.0-dev";
3193
3232
  function registerableActions(policy) {
3194
3233
  const isProduction = policy.identity.environment.providerEnvironment === "production";
3195
3234
  return actionsForChannel("mcp").filter((action) => {
@@ -3302,7 +3341,7 @@ function createServer(options) {
3302
3341
  isError: true
3303
3342
  };
3304
3343
  }
3305
- const result = await handler(ctx, args ?? {});
3344
+ const result = stripRawProcessorData(await handler(ctx, args ?? {}));
3306
3345
  const shown = redactPii ? redactShopperPii(project(result, OAUTH_PROJECTIONS[action.id])) : result;
3307
3346
  return { content: [{ type: "text", text: formatResult(shown) }] };
3308
3347
  } catch (error) {