@carrierllc/mcp 0.13.77 → 0.13.78

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.
@@ -1915,7 +1915,7 @@ function storefrontScreen(input) {
1915
1915
  // package.json
1916
1916
  var package_default = {
1917
1917
  name: "@carrierllc/mcp",
1918
- version: "0.13.77",
1918
+ version: "0.13.78",
1919
1919
  description: "Carrier MCP \u2014 natural-language control of MVNO/eSIM fleets via the network 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).",
1920
1920
  license: "MIT",
1921
1921
  author: "Carrier (Lifecycle Innovations Limited)",
@@ -2837,112 +2837,6 @@ function packageTemplateModifyFromToolJson(changes, method) {
2837
2837
  return packageTemplateModifyParams(body, method);
2838
2838
  }
2839
2839
 
2840
- // ../../packages/ocs-client/dist/chunk-CGMK4FTD.js
2841
- var DEFAULT_OCS_BUDGET = {
2842
- attemptMs: 3e4,
2843
- maxAttempts: 3,
2844
- totalMs: 75e3
2845
- };
2846
- var OCS_METHOD_BUDGETS = {
2847
- // 3.4 MB, 88-128 s measured. 180 s is 1.4x the slowest observation. One
2848
- // attempt: payload size does not vary, so a retry only doubles the wait.
2849
- getCustomerTariff: { attemptMs: 18e4, maxAttempts: 1, totalMs: 18e4 }
2850
- };
2851
- var MIN_ATTEMPT_BUDGET_MS = 1e3;
2852
- var BACKOFF_BASE_MS = 500;
2853
- var OcsTimeoutError = class extends Error {
2854
- constructor(method, timeoutMs, budgetMs = timeoutMs, attempts = 1) {
2855
- super(
2856
- `[${method}] OCS request timed out after ${timeoutMs}ms` + (attempts > 1 ? ` on each of ${attempts} attempts` : "") + (budgetMs > timeoutMs ? ` (budget ${budgetMs}ms)` : "") + `. The upstream did not deliver a complete response in time \u2014 usually an oversized payload or a wedged upstream. Narrow the request, or raise OCS_TIMEOUT_MS / OCS_TOTAL_TIMEOUT_MS if this method is legitimately slower here.`
2857
- );
2858
- this.method = method;
2859
- this.timeoutMs = timeoutMs;
2860
- this.budgetMs = budgetMs;
2861
- this.attempts = attempts;
2862
- this.name = "OcsTimeoutError";
2863
- }
2864
- method;
2865
- timeoutMs;
2866
- budgetMs;
2867
- attempts;
2868
- };
2869
- function envInt(name) {
2870
- const proc = globalThis["process"];
2871
- const parsed = Number(proc?.env?.[name]);
2872
- return Number.isFinite(parsed) && parsed > 0 ? parsed : void 0;
2873
- }
2874
- function ocsBudgetFor(method) {
2875
- const base = OCS_METHOD_BUDGETS[method] ?? DEFAULT_OCS_BUDGET;
2876
- const attemptMs = envInt("OCS_TIMEOUT_MS") ?? base.attemptMs;
2877
- const totalMs = Math.max(envInt("OCS_TOTAL_TIMEOUT_MS") ?? base.totalMs, attemptMs);
2878
- return { attemptMs, maxAttempts: base.maxAttempts, totalMs };
2879
- }
2880
- function sleep2(ms, signal) {
2881
- return new Promise((resolve) => {
2882
- const timer = setTimeout(finish, ms);
2883
- function finish() {
2884
- clearTimeout(timer);
2885
- signal.removeEventListener("abort", finish);
2886
- resolve();
2887
- }
2888
- signal.addEventListener("abort", finish, { once: true });
2889
- });
2890
- }
2891
- async function withDeadline(work, deadline, ms) {
2892
- let timer;
2893
- try {
2894
- return await Promise.race([
2895
- work,
2896
- new Promise((_resolve, reject) => {
2897
- timer = setTimeout(() => reject(deadline), ms);
2898
- })
2899
- ]);
2900
- } finally {
2901
- if (timer !== void 0) clearTimeout(timer);
2902
- }
2903
- }
2904
- async function runWithBudget(method, attempt, budget = ocsBudgetFor(method)) {
2905
- const deadlineAt = Date.now() + budget.totalMs;
2906
- const budgetController = new AbortController();
2907
- const budgetTimer = setTimeout(() => budgetController.abort(), budget.totalMs);
2908
- let attempts = 0;
2909
- let lastTimeout;
2910
- try {
2911
- for (let i = 0; i < budget.maxAttempts; i++) {
2912
- const remaining = deadlineAt - Date.now();
2913
- if (remaining < MIN_ATTEMPT_BUDGET_MS) break;
2914
- const attemptMs = Math.min(budget.attemptMs, remaining);
2915
- attempts++;
2916
- const attemptController = new AbortController();
2917
- const onBudgetAbort = () => attemptController.abort();
2918
- budgetController.signal.addEventListener("abort", onBudgetAbort, { once: true });
2919
- const attemptTimer = setTimeout(() => attemptController.abort(), attemptMs);
2920
- const breach = new OcsTimeoutError(method, attemptMs, budget.totalMs, attempts);
2921
- try {
2922
- return await withDeadline(
2923
- attempt(attemptController.signal, attemptMs),
2924
- breach,
2925
- attemptMs
2926
- );
2927
- } catch (err) {
2928
- if (!(err instanceof OcsTimeoutError)) throw err;
2929
- lastTimeout = new OcsTimeoutError(method, attemptMs, budget.totalMs, attempts);
2930
- } finally {
2931
- clearTimeout(attemptTimer);
2932
- budgetController.signal.removeEventListener("abort", onBudgetAbort);
2933
- attemptController.abort();
2934
- }
2935
- if (i === budget.maxAttempts - 1) break;
2936
- const backoff = Math.random() * BACKOFF_BASE_MS * 2 ** i;
2937
- if (Date.now() + backoff + MIN_ATTEMPT_BUDGET_MS > deadlineAt) break;
2938
- await sleep2(backoff, budgetController.signal);
2939
- }
2940
- } finally {
2941
- clearTimeout(budgetTimer);
2942
- }
2943
- throw lastTimeout ?? new OcsTimeoutError(method, budget.attemptMs, budget.totalMs, Math.max(attempts, 1));
2944
- }
2945
-
2946
2840
  // ../../packages/ocs-client/dist/chunk-6YTL46MO.js
2947
2841
  import { z } from "zod";
2948
2842
  var OCS_V1_METHODS = /* @__PURE__ */ new Set([
@@ -3186,7 +3080,113 @@ var HealthResponse = z.object({
3186
3080
  build_sha: z.string()
3187
3081
  });
3188
3082
 
3189
- // ../../packages/ocs-client/dist/chunk-VMZAN7GX.js
3083
+ // ../../packages/ocs-client/dist/chunk-CGMK4FTD.js
3084
+ var DEFAULT_OCS_BUDGET = {
3085
+ attemptMs: 3e4,
3086
+ maxAttempts: 3,
3087
+ totalMs: 75e3
3088
+ };
3089
+ var OCS_METHOD_BUDGETS = {
3090
+ // 3.4 MB, 88-128 s measured. 180 s is 1.4x the slowest observation. One
3091
+ // attempt: payload size does not vary, so a retry only doubles the wait.
3092
+ getCustomerTariff: { attemptMs: 18e4, maxAttempts: 1, totalMs: 18e4 }
3093
+ };
3094
+ var MIN_ATTEMPT_BUDGET_MS = 1e3;
3095
+ var BACKOFF_BASE_MS = 500;
3096
+ var OcsTimeoutError = class extends Error {
3097
+ constructor(method, timeoutMs, budgetMs = timeoutMs, attempts = 1) {
3098
+ super(
3099
+ `[${method}] OCS request timed out after ${timeoutMs}ms` + (attempts > 1 ? ` on each of ${attempts} attempts` : "") + (budgetMs > timeoutMs ? ` (budget ${budgetMs}ms)` : "") + `. The upstream did not deliver a complete response in time \u2014 usually an oversized payload or a wedged upstream. Narrow the request, or raise OCS_TIMEOUT_MS / OCS_TOTAL_TIMEOUT_MS if this method is legitimately slower here.`
3100
+ );
3101
+ this.method = method;
3102
+ this.timeoutMs = timeoutMs;
3103
+ this.budgetMs = budgetMs;
3104
+ this.attempts = attempts;
3105
+ this.name = "OcsTimeoutError";
3106
+ }
3107
+ method;
3108
+ timeoutMs;
3109
+ budgetMs;
3110
+ attempts;
3111
+ };
3112
+ function envInt(name) {
3113
+ const proc = globalThis["process"];
3114
+ const parsed = Number(proc?.env?.[name]);
3115
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : void 0;
3116
+ }
3117
+ function ocsBudgetFor(method) {
3118
+ const base = OCS_METHOD_BUDGETS[method] ?? DEFAULT_OCS_BUDGET;
3119
+ const attemptMs = envInt("OCS_TIMEOUT_MS") ?? base.attemptMs;
3120
+ const totalMs = Math.max(envInt("OCS_TOTAL_TIMEOUT_MS") ?? base.totalMs, attemptMs);
3121
+ return { attemptMs, maxAttempts: base.maxAttempts, totalMs };
3122
+ }
3123
+ function sleep2(ms, signal) {
3124
+ return new Promise((resolve) => {
3125
+ const timer = setTimeout(finish, ms);
3126
+ function finish() {
3127
+ clearTimeout(timer);
3128
+ signal.removeEventListener("abort", finish);
3129
+ resolve();
3130
+ }
3131
+ signal.addEventListener("abort", finish, { once: true });
3132
+ });
3133
+ }
3134
+ async function withDeadline(work, deadline, ms) {
3135
+ let timer;
3136
+ try {
3137
+ return await Promise.race([
3138
+ work,
3139
+ new Promise((_resolve, reject) => {
3140
+ timer = setTimeout(() => reject(deadline), ms);
3141
+ })
3142
+ ]);
3143
+ } finally {
3144
+ if (timer !== void 0) clearTimeout(timer);
3145
+ }
3146
+ }
3147
+ async function runWithBudget(method, attempt, budget = ocsBudgetFor(method)) {
3148
+ const deadlineAt = Date.now() + budget.totalMs;
3149
+ const budgetController = new AbortController();
3150
+ const budgetTimer = setTimeout(() => budgetController.abort(), budget.totalMs);
3151
+ let attempts = 0;
3152
+ let lastTimeout;
3153
+ try {
3154
+ for (let i = 0; i < budget.maxAttempts; i++) {
3155
+ const remaining = deadlineAt - Date.now();
3156
+ if (remaining < MIN_ATTEMPT_BUDGET_MS) break;
3157
+ const attemptMs = Math.min(budget.attemptMs, remaining);
3158
+ attempts++;
3159
+ const attemptController = new AbortController();
3160
+ const onBudgetAbort = () => attemptController.abort();
3161
+ budgetController.signal.addEventListener("abort", onBudgetAbort, { once: true });
3162
+ const attemptTimer = setTimeout(() => attemptController.abort(), attemptMs);
3163
+ const breach = new OcsTimeoutError(method, attemptMs, budget.totalMs, attempts);
3164
+ try {
3165
+ return await withDeadline(
3166
+ attempt(attemptController.signal, attemptMs),
3167
+ breach,
3168
+ attemptMs
3169
+ );
3170
+ } catch (err) {
3171
+ if (!(err instanceof OcsTimeoutError)) throw err;
3172
+ lastTimeout = new OcsTimeoutError(method, attemptMs, budget.totalMs, attempts);
3173
+ } finally {
3174
+ clearTimeout(attemptTimer);
3175
+ budgetController.signal.removeEventListener("abort", onBudgetAbort);
3176
+ attemptController.abort();
3177
+ }
3178
+ if (i === budget.maxAttempts - 1) break;
3179
+ const backoff = Math.random() * BACKOFF_BASE_MS * 2 ** i;
3180
+ if (Date.now() + backoff + MIN_ATTEMPT_BUDGET_MS > deadlineAt) break;
3181
+ await sleep2(backoff, budgetController.signal);
3182
+ }
3183
+ } finally {
3184
+ clearTimeout(budgetTimer);
3185
+ }
3186
+ throw lastTimeout ?? new OcsTimeoutError(method, budget.attemptMs, budget.totalMs, Math.max(attempts, 1));
3187
+ }
3188
+
3189
+ // ../../packages/ocs-client/dist/chunk-UEDNRACY.js
3190
3190
  var RATE_LIMIT = 10;
3191
3191
  var WINDOW_MS = 1e3;
3192
3192
  var windows = /* @__PURE__ */ new Map();
@@ -6161,4 +6161,4 @@ export {
6161
6161
  package_default,
6162
6162
  CARRIER_VERSION
6163
6163
  };
6164
- //# sourceMappingURL=chunk-WQYJ7M3Q.js.map
6164
+ //# sourceMappingURL=chunk-G7BQL3FL.js.map