@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/mcp.js
CHANGED
|
@@ -444,6 +444,29 @@ function redactShopperPii(value) {
|
|
|
444
444
|
return walk(value, null, 0);
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
+
// ../core-scopes/src/public-payment.ts
|
|
448
|
+
var RAW_PROCESSOR_KEYS = ["processorResponse", "gr4vy_payment_method"];
|
|
449
|
+
var RAW = new Set(RAW_PROCESSOR_KEYS);
|
|
450
|
+
function isPlainObject2(value) {
|
|
451
|
+
if (value === null || typeof value !== "object") return false;
|
|
452
|
+
const proto = Object.getPrototypeOf(value);
|
|
453
|
+
return proto === Object.prototype || proto === null;
|
|
454
|
+
}
|
|
455
|
+
function strip(value, depth) {
|
|
456
|
+
if (depth > 32) return value;
|
|
457
|
+
if (Array.isArray(value)) return value.map((v) => strip(v, depth + 1));
|
|
458
|
+
if (!isPlainObject2(value)) return value;
|
|
459
|
+
const out = {};
|
|
460
|
+
for (const [key, child] of Object.entries(value)) {
|
|
461
|
+
if (RAW.has(key)) continue;
|
|
462
|
+
out[key] = strip(child, depth + 1);
|
|
463
|
+
}
|
|
464
|
+
return out;
|
|
465
|
+
}
|
|
466
|
+
function stripRawProcessorData(value) {
|
|
467
|
+
return strip(value, 0);
|
|
468
|
+
}
|
|
469
|
+
|
|
447
470
|
// ../action-catalog/src/actions.ts
|
|
448
471
|
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.";
|
|
449
472
|
var ACTIONS = [
|
|
@@ -3178,7 +3201,7 @@ var OAUTH_PROJECTIONS = {
|
|
|
3178
3201
|
};
|
|
3179
3202
|
|
|
3180
3203
|
// src/server.ts
|
|
3181
|
-
var VERSION = true ? "0.4.
|
|
3204
|
+
var VERSION = true ? "0.4.1" : "0.0.0-dev";
|
|
3182
3205
|
function registerableActions(policy) {
|
|
3183
3206
|
const isProduction = policy.identity.environment.providerEnvironment === "production";
|
|
3184
3207
|
return actionsForChannel("mcp").filter((action) => {
|
|
@@ -3291,7 +3314,7 @@ function createServer(options) {
|
|
|
3291
3314
|
isError: true
|
|
3292
3315
|
};
|
|
3293
3316
|
}
|
|
3294
|
-
const result = await handler(ctx, args ?? {});
|
|
3317
|
+
const result = stripRawProcessorData(await handler(ctx, args ?? {}));
|
|
3295
3318
|
const shown = redactPii ? redactShopperPii(project(result, OAUTH_PROJECTIONS[action.id])) : result;
|
|
3296
3319
|
return { content: [{ type: "text", text: formatResult(shown) }] };
|
|
3297
3320
|
} catch (error) {
|