@joy-loyalty/mcp 0.3.7 → 0.4.0
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/build/config.js +15 -1
- package/build/index.js +3616 -220
- package/package.json +2 -2
package/build/config.js
CHANGED
|
@@ -48,8 +48,22 @@ export function loadConfig(env = process.env) {
|
|
|
48
48
|
// Writes require the merchant secret key AND an explicit opt-in flag. Having the
|
|
49
49
|
// secret key alone is not consent: it is the only key a merchant has.
|
|
50
50
|
const writesEnabled = mode === 'merchant' && env.JOY_MCP_ENABLE_WRITES === 'true';
|
|
51
|
+
// Configuration writes need their own opt-in on top of member writes: the
|
|
52
|
+
// blast radius is the whole storefront, not one member. Compared as a STRING
|
|
53
|
+
// because every value in an MCP client's "env" block must be quoted — a JSON
|
|
54
|
+
// boolean makes Claude Desktop reject the entire server (dogfood round 2).
|
|
55
|
+
const configWritesEnabled = writesEnabled && env.JOY_MCP_ENABLE_CONFIG_WRITES === 'true';
|
|
51
56
|
// 0 is meaningful: "always dry-run every deduction" (most conservative)
|
|
52
57
|
const rawThreshold = Number(env.JOY_MCP_DEDUCT_DRYRUN_THRESHOLD ?? '1000');
|
|
53
58
|
const deductDryRunThreshold = Number.isFinite(rawThreshold) && rawThreshold >= 0 ? rawThreshold : 1000;
|
|
54
|
-
return {
|
|
59
|
+
return {
|
|
60
|
+
apiBaseUrl,
|
|
61
|
+
appKey,
|
|
62
|
+
secretKey,
|
|
63
|
+
privateBotKey,
|
|
64
|
+
mode,
|
|
65
|
+
writesEnabled,
|
|
66
|
+
configWritesEnabled,
|
|
67
|
+
deductDryRunThreshold
|
|
68
|
+
};
|
|
55
69
|
}
|