@carrierllc/mcp 0.13.72 → 0.13.74
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/README.md +5 -6
- package/dist/{chunk-NGNLWI7W.js → chunk-X7U4FBUH.js} +109 -109
- package/dist/{chunk-NGNLWI7W.js.map → chunk-X7U4FBUH.js.map} +1 -1
- package/dist/cli.js +27 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.js +206 -134
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/plugin/carrier/skills/issue-esim/SKILL.md +4 -4
- package/plugin/carrier/skills/provision/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -230,7 +230,7 @@ flags. Two rules apply everywhere:
|
|
|
230
230
|
### Stdio server (token env)
|
|
231
231
|
|
|
232
232
|
```bash
|
|
233
|
-
|
|
233
|
+
CARRIER_OCS_API_TOKEN=your_key npx -y -p @carrierllc/mcp carrier-mcp
|
|
234
234
|
```
|
|
235
235
|
|
|
236
236
|
Get a key at [mcp.carrier.llc](https://mcp.carrier.llc) or an org API key from the console.
|
|
@@ -248,7 +248,7 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
|
|
|
248
248
|
"command": "npx",
|
|
249
249
|
"args": ["-y", "-p", "@carrierllc/mcp", "carrier-mcp"],
|
|
250
250
|
"env": {
|
|
251
|
-
"
|
|
251
|
+
"CARRIER_OCS_API_TOKEN": "YOUR_KEY"
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
}
|
|
@@ -266,7 +266,7 @@ Add to `~/.cursor/mcp.json`:
|
|
|
266
266
|
"command": "npx",
|
|
267
267
|
"args": ["-y", "-p", "@carrierllc/mcp", "carrier-mcp"],
|
|
268
268
|
"env": {
|
|
269
|
-
"
|
|
269
|
+
"CARRIER_OCS_API_TOKEN": "YOUR_KEY"
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
}
|
|
@@ -284,7 +284,7 @@ Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
|
284
284
|
"command": "npx",
|
|
285
285
|
"args": ["-y", "-p", "@carrierllc/mcp", "carrier-mcp"],
|
|
286
286
|
"env": {
|
|
287
|
-
"
|
|
287
|
+
"CARRIER_OCS_API_TOKEN": "YOUR_KEY"
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
}
|
|
@@ -314,8 +314,7 @@ For multi-user deployments with OAuth 2.1 + PKCE, use the remote endpoint:
|
|
|
314
314
|
|----------|----------|---------|-------------|
|
|
315
315
|
| `CARRIER_API_TOKEN` | Inventory issuance | — | Your own authenticated Carrier API credential. Required for durable `assign_package` inventory; never falls back to an OCS token. |
|
|
316
316
|
| `CARRIER_API_BASE_URL` | No | `https://api.carrier.llc` | Carrier REST API origin for durable inventory. Do not use the OCS provider URL. |
|
|
317
|
-
| `
|
|
318
|
-
| `CARRIER_OCS_API_TOKEN` | Alternative | — | Alias for `ESIMVAULT_API_TOKEN` |
|
|
317
|
+
| `CARRIER_OCS_API_TOKEN` | Explicit OCS tools | — | Your OCS API token; not a Carrier API credential. Older releases used a different variable name; it is still read |
|
|
319
318
|
| `CARRIER_OCS_BASE_URL` | No | `https://ocs.esimvault.cloud` | OCS base URL (no trailing slash) |
|
|
320
319
|
| `BROWSER_USE_API_KEY` | No | — | Browser Use Cloud key. Enables the browsing agent (`ui_agent_ask`). Runs are billed to this key at roughly **$0.20–1.00 each** |
|
|
321
320
|
| `CARRIER_BROWSER_USE_MAX_RUNS` | No | `10` | Browser-agent runs allowed per CLI process. `0` disables the agent. See the caveats below |
|
|
@@ -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.
|
|
1918
|
+
version: "0.13.74",
|
|
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,6 +2837,112 @@ 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
|
+
|
|
2840
2946
|
// ../../packages/ocs-client/dist/chunk-6YTL46MO.js
|
|
2841
2947
|
import { z } from "zod";
|
|
2842
2948
|
var OCS_V1_METHODS = /* @__PURE__ */ new Set([
|
|
@@ -3080,113 +3186,7 @@ var HealthResponse = z.object({
|
|
|
3080
3186
|
build_sha: z.string()
|
|
3081
3187
|
});
|
|
3082
3188
|
|
|
3083
|
-
// ../../packages/ocs-client/dist/chunk-
|
|
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-STAIW6BD.js
|
|
3189
|
+
// ../../packages/ocs-client/dist/chunk-VMZAN7GX.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-
|
|
6164
|
+
//# sourceMappingURL=chunk-X7U4FBUH.js.map
|