@carrierllc/mcp 0.2.3 → 0.2.4
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/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -74,6 +74,9 @@ async function checkCallQuota(env, sub, tier) {
|
|
|
74
74
|
if (tier === "enterprise") {
|
|
75
75
|
return { allowed: true, remaining: Infinity, resetAt, tier };
|
|
76
76
|
}
|
|
77
|
+
if (!env.CARRIER_USERS) {
|
|
78
|
+
return { allowed: true, remaining: Infinity, resetAt, tier };
|
|
79
|
+
}
|
|
77
80
|
const month = currentMonth();
|
|
78
81
|
const usageKey = `usage:${sub}:${month}`;
|
|
79
82
|
const raw = await env.CARRIER_USERS.get(usageKey, "json").catch(() => null);
|
|
@@ -87,6 +90,7 @@ async function checkCallQuota(env, sub, tier) {
|
|
|
87
90
|
};
|
|
88
91
|
}
|
|
89
92
|
function recordUsage(env, sub, tier) {
|
|
93
|
+
if (!env.CARRIER_USERS) return;
|
|
90
94
|
(async () => {
|
|
91
95
|
const month = currentMonth();
|
|
92
96
|
const usageKey = `usage:${sub}:${month}`;
|
|
@@ -107,6 +111,7 @@ function recordUsage(env, sub, tier) {
|
|
|
107
111
|
async function pushStripeUsageRecord(env, sub, quantity) {
|
|
108
112
|
const stripeKey = env.STRIPE_SECRET_KEY;
|
|
109
113
|
if (!stripeKey) return;
|
|
114
|
+
if (!env.CARRIER_USERS) return;
|
|
110
115
|
const subItemId = await env.CARRIER_USERS.get(`stripe_sub_item_id:${sub}`);
|
|
111
116
|
if (!subItemId) return;
|
|
112
117
|
const body = new URLSearchParams({
|
|
@@ -9370,7 +9375,7 @@ var audit = (_row) => {
|
|
|
9370
9375
|
var getUserToken = async (_sub) => token;
|
|
9371
9376
|
var toolCtx = { env: stdioEnv, props, audit, getUserToken };
|
|
9372
9377
|
var server = new McpServer(
|
|
9373
|
-
{ name: "carrier-mcp", version: "0.2.
|
|
9378
|
+
{ name: "carrier-mcp", version: "0.2.4" },
|
|
9374
9379
|
{
|
|
9375
9380
|
instructions: "Carrier MCP \u2014 single-user stdio mode. Full tool registry (mirrors the deployed Worker)."
|
|
9376
9381
|
}
|