@carrierllc/mcp 0.13.74 → 0.13.75
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/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
verifyStorefront,
|
|
92
92
|
withOcsListSummary,
|
|
93
93
|
withTemplateResellerId
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-LO324UTL.js";
|
|
95
95
|
import "./chunk-SHKKVIIA.js";
|
|
96
96
|
|
|
97
97
|
// src/index.ts
|
|
@@ -355,6 +355,7 @@ function createAiCreditBilling(env) {
|
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
357
|
var MIN_AI_TOPUP_CENTS = 1e3;
|
|
358
|
+
var MAX_AI_TOPUP_CENTS = 1e5;
|
|
358
359
|
var AI_TIER_POLICY = {
|
|
359
360
|
free: { limit: 5, window: "day" },
|
|
360
361
|
pro: { limit: 1e3, window: "month" },
|
|
@@ -7539,10 +7540,10 @@ function registerAiWalletTools(server2, ctx) {
|
|
|
7539
7540
|
"ai_wallet_auto_topup",
|
|
7540
7541
|
{
|
|
7541
7542
|
title: "AI Wallet Auto Top-up Settings",
|
|
7542
|
-
description: "Read or change automatic EUR replenishment for the separate AI-credit wallet. This does not charge a card and does not change the eSIM connectivity wallet. Params: enabled (optional boolean), amount_cents (optional integer nominal EUR cents, minimum 1000). Omitting both reads the current setting. Omitting amount while disabling preserves the saved amount. Sending only an amount changes the amount and keeps the current on/off setting.",
|
|
7543
|
+
description: "Read or change automatic EUR replenishment for the separate AI-credit wallet. This does not charge a card and does not change the eSIM connectivity wallet. Params: enabled (optional boolean), amount_cents (optional integer nominal EUR cents, minimum 1000, maximum 100000). Omitting both reads the current setting. Omitting amount while disabling preserves the saved amount. Sending only an amount changes the amount and keeps the current on/off setting. Reading is open to any organisation member; org admin required to change.",
|
|
7543
7544
|
inputSchema: {
|
|
7544
7545
|
enabled: z10.boolean().optional(),
|
|
7545
|
-
amount_cents: z10.number().int().min(MIN_AI_TOPUP_CENTS).optional()
|
|
7546
|
+
amount_cents: z10.number().int().min(MIN_AI_TOPUP_CENTS).max(MAX_AI_TOPUP_CENTS).optional()
|
|
7546
7547
|
},
|
|
7547
7548
|
outputSchema: {
|
|
7548
7549
|
org_id: z10.string(),
|
|
@@ -7562,6 +7563,24 @@ function registerAiWalletTools(server2, ctx) {
|
|
|
7562
7563
|
content: [{ type: "text", text: "AI auto top-up is not available on this deployment." }]
|
|
7563
7564
|
};
|
|
7564
7565
|
}
|
|
7566
|
+
const writing = enabled !== void 0 || amount_cents !== void 0;
|
|
7567
|
+
let admin = false;
|
|
7568
|
+
if (writing && ctx.props.org_id && ctx.props.org_role === "org:admin" && ctx.isOrgAdmin) {
|
|
7569
|
+
try {
|
|
7570
|
+
admin = await ctx.isOrgAdmin(ctx.props.org_id);
|
|
7571
|
+
} catch {
|
|
7572
|
+
admin = false;
|
|
7573
|
+
}
|
|
7574
|
+
}
|
|
7575
|
+
if (writing && ctx.props.org_id && !admin) {
|
|
7576
|
+
return {
|
|
7577
|
+
isError: true,
|
|
7578
|
+
content: [{
|
|
7579
|
+
type: "text",
|
|
7580
|
+
text: "Changing AI auto top-up needs an organisation admin. Sign in again as an org admin, or ask one to change it. Reading the setting is still allowed."
|
|
7581
|
+
}]
|
|
7582
|
+
};
|
|
7583
|
+
}
|
|
7565
7584
|
try {
|
|
7566
7585
|
const state = enabled === void 0 && amount_cents === void 0 ? await aiWallet(ctx.env, orgId, "GET") : await aiWallet(ctx.env, orgId, "PUT", {
|
|
7567
7586
|
...enabled === void 0 ? {} : { enabled },
|