@carrierllc/mcp 0.11.13 → 0.11.15

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.
@@ -1792,7 +1792,7 @@ function storefrontScreen(input) {
1792
1792
  // package.json
1793
1793
  var package_default = {
1794
1794
  name: "@carrierllc/mcp",
1795
- version: "0.11.13",
1795
+ version: "0.11.15",
1796
1796
  description: "Carrier MCP \u2014 natural-language control of MVNO/eSIM fleets via eSIMVault OCS. Stdio mode for direct integration with Claude Desktop, Cursor, Windsurf, and MCP-compatible clients. Ships the `carrier` CLI (plugin install + white-label eSIM storefront scaffold).",
1797
1797
  license: "MIT",
1798
1798
  author: "Carrier (Lifecycle Innovations Limited)",
@@ -2219,7 +2219,7 @@ async function runWithBudget(method, attempt, budget = ocsBudgetFor(method)) {
2219
2219
  throw lastTimeout ?? new OcsTimeoutError(method, budget.attemptMs, budget.totalMs, Math.max(attempts, 1));
2220
2220
  }
2221
2221
 
2222
- // ../../packages/ocs-client/dist/chunk-LNE7YTGH.js
2222
+ // ../../packages/ocs-client/dist/chunk-KELMML73.js
2223
2223
  var RATE_LIMIT = 10;
2224
2224
  var WINDOW_MS = 1e3;
2225
2225
  var windows = /* @__PURE__ */ new Map();
@@ -2557,12 +2557,18 @@ function ocsErrorMessage(code, rawMsg, rawBody) {
2557
2557
  var BACKOFF_BASE_MS2 = 500;
2558
2558
  var BACKOFF_MAX_MS = 4e3;
2559
2559
  var BACKOFF_MAX_RETRIES = 3;
2560
+ var TRAFFIC_CONTROL_BACKOFF_BASE_MS = 1e3;
2561
+ var TRAFFIC_CONTROL_BACKOFF_MAX_MS = 16e3;
2562
+ var TRAFFIC_CONTROL_MAX_RETRIES = 6;
2560
2563
  var BACKOFF_JITTER = 0.25;
2561
2564
  async function retryWithBackoff(fn) {
2562
2565
  let lastError;
2563
- for (let attempt = 0; attempt <= BACKOFF_MAX_RETRIES; attempt++) {
2566
+ let maxRetries = BACKOFF_MAX_RETRIES;
2567
+ let backoffBaseMs = BACKOFF_BASE_MS2;
2568
+ let backoffMaxMs = BACKOFF_MAX_MS;
2569
+ for (let attempt = 0; attempt <= maxRetries; attempt++) {
2564
2570
  if (attempt > 0) {
2565
- const base = Math.min(BACKOFF_BASE_MS2 * Math.pow(2, attempt - 1), BACKOFF_MAX_MS);
2571
+ const base = Math.min(backoffBaseMs * Math.pow(2, attempt - 1), backoffMaxMs);
2566
2572
  const jitter = base * BACKOFF_JITTER * (2 * Math.random() - 1);
2567
2573
  const delay = Math.max(0, Math.round(base + jitter));
2568
2574
  await new Promise((r) => setTimeout(r, delay));
@@ -2571,8 +2577,11 @@ async function retryWithBackoff(fn) {
2571
2577
  return await fn();
2572
2578
  } catch (err) {
2573
2579
  lastError = err;
2574
- if (err instanceof OcsApiError && err.code !== 100) {
2575
- throw err;
2580
+ if (err instanceof OcsApiError) {
2581
+ if (err.code !== 100) throw err;
2582
+ maxRetries = TRAFFIC_CONTROL_MAX_RETRIES;
2583
+ backoffBaseMs = TRAFFIC_CONTROL_BACKOFF_BASE_MS;
2584
+ backoffMaxMs = TRAFFIC_CONTROL_BACKOFF_MAX_MS;
2576
2585
  }
2577
2586
  if (err instanceof OcsContractError) {
2578
2587
  throw err;
@@ -4174,18 +4183,6 @@ function gyCountryHistoryFromResponse(response) {
4174
4183
  }
4175
4184
 
4176
4185
  // src/lib/storefront-logo.ts
4177
- var OPENAI_KEY_NAMES = [
4178
- "OPENAI_API_KEY",
4179
- "OPENAI_KEY",
4180
- "CARRIER_OPENAI_API_KEY"
4181
- ];
4182
- function firstImageKey(env = process.env) {
4183
- for (const name of OPENAI_KEY_NAMES) {
4184
- const v = env[name];
4185
- if (v && v.trim() && !v.startsWith("__") && !v.includes("PLACEHOLD")) return v.trim();
4186
- }
4187
- return void 0;
4188
- }
4189
4186
  function clampHex(hex, fallback) {
4190
4187
  const h = hex.trim();
4191
4188
  return /^#[0-9a-fA-F]{6}$/.test(h) ? h.toUpperCase() : fallback;
@@ -4246,50 +4243,10 @@ function generateStorefrontLogoSvg(name, accent = "#FF6B35") {
4246
4243
  function escapeXml(s) {
4247
4244
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
4248
4245
  }
4249
- function logoPrompt(name, accent, tagline) {
4250
- return [
4251
- `App icon / brand mark for "${name}", a travel eSIM storefront.`,
4252
- tagline ? `Tagline: ${tagline}.` : "",
4253
- `Flat vector, single centered symbol, no letters unless they are a refined monogram of "${name[0] ?? "C"}".`,
4254
- `Color: ${accent} on warm cream #FAFAF7. Soft squircle icon, premium, simple, high contrast.`,
4255
- `No photorealism, no mockups, no shadows of devices, no watermarks.`
4256
- ].filter(Boolean).join(" ");
4257
- }
4258
- async function tryOpenAiLogoPng(name, accent, apiKey, tagline) {
4259
- try {
4260
- const res = await fetch("https://api.openai.com/v1/images/generations", {
4261
- method: "POST",
4262
- headers: {
4263
- Authorization: `Bearer ${apiKey}`,
4264
- "Content-Type": "application/json"
4265
- },
4266
- body: JSON.stringify({
4267
- model: "dall-e-3",
4268
- prompt: logoPrompt(name, accent, tagline),
4269
- size: "1024x1024",
4270
- quality: "hd",
4271
- response_format: "b64_json",
4272
- n: 1
4273
- })
4274
- });
4275
- if (!res.ok) return void 0;
4276
- const json = await res.json();
4277
- return json.data?.[0]?.b64_json;
4278
- } catch {
4279
- return void 0;
4280
- }
4281
- }
4282
4246
  async function generateStorefrontLogo(input) {
4283
4247
  const name = input.name.trim() || "Carrier";
4284
4248
  const accent = clampHex(input.accent ?? "#FF6B35", "#FF6B35");
4285
4249
  const svg = generateStorefrontLogoSvg(name, accent);
4286
- const key = firstImageKey(input.env ?? (typeof process !== "undefined" ? process.env : {}));
4287
- if (key) {
4288
- const png = await tryOpenAiLogoPng(name, accent, key, input.tagline);
4289
- if (png) {
4290
- return { svg, filename: "logo.svg", source: "openai", pngBase64: png };
4291
- }
4292
- }
4293
4250
  return { svg, filename: "logo.svg", source: "svg" };
4294
4251
  }
4295
4252
 
@@ -4379,4 +4336,4 @@ export {
4379
4336
  storefrontScreen,
4380
4337
  CARRIER_VERSION
4381
4338
  };
4382
- //# sourceMappingURL=chunk-AVWTFPEQ.js.map
4339
+ //# sourceMappingURL=chunk-MLPMMUQ2.js.map