@carrierllc/mcp 0.2.1 → 0.2.2
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.d.ts +0 -13
- package/dist/index.js +8394 -77
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/dist/.metadata_never_index +0 -0
- package/dist/apps/app-state.d.ts +0 -19
- package/dist/apps/app-state.d.ts.map +0 -1
- package/dist/apps/app-state.js +0 -28
- package/dist/apps/app-state.js.map +0 -1
- package/dist/apps/balance-topup.d.ts +0 -19
- package/dist/apps/balance-topup.d.ts.map +0 -1
- package/dist/apps/balance-topup.js +0 -121
- package/dist/apps/balance-topup.js.map +0 -1
- package/dist/apps/fleet-health-app.d.ts +0 -29
- package/dist/apps/fleet-health-app.d.ts.map +0 -1
- package/dist/apps/fleet-health-app.js +0 -152
- package/dist/apps/fleet-health-app.js.map +0 -1
- package/dist/apps/index.d.ts +0 -37
- package/dist/apps/index.d.ts.map +0 -1
- package/dist/apps/index.js +0 -42
- package/dist/apps/index.js.map +0 -1
- package/dist/apps/provisioning-wizard.d.ts +0 -11
- package/dist/apps/provisioning-wizard.d.ts.map +0 -1
- package/dist/apps/provisioning-wizard.js +0 -345
- package/dist/apps/provisioning-wizard.js.map +0 -1
- package/dist/audit.d.ts +0 -31
- package/dist/audit.d.ts.map +0 -1
- package/dist/audit.js +0 -42
- package/dist/audit.js.map +0 -1
- package/dist/billing-thresholds.d.ts +0 -71
- package/dist/billing-thresholds.d.ts.map +0 -1
- package/dist/billing-thresholds.js +0 -238
- package/dist/billing-thresholds.js.map +0 -1
- package/dist/billing.d.ts +0 -95
- package/dist/billing.d.ts.map +0 -1
- package/dist/billing.js +0 -239
- package/dist/billing.js.map +0 -1
- package/dist/clerk.d.ts +0 -125
- package/dist/clerk.d.ts.map +0 -1
- package/dist/clerk.js +0 -389
- package/dist/clerk.js.map +0 -1
- package/dist/client.d.ts +0 -35
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -85
- package/dist/client.js.map +0 -1
- package/dist/credits.d.ts +0 -165
- package/dist/credits.d.ts.map +0 -1
- package/dist/credits.js +0 -483
- package/dist/credits.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/intelligence.d.ts +0 -4
- package/dist/intelligence.d.ts.map +0 -1
- package/dist/intelligence.js +0 -977
- package/dist/intelligence.js.map +0 -1
- package/dist/list-recent-ocs-events.d.ts +0 -48
- package/dist/list-recent-ocs-events.d.ts.map +0 -1
- package/dist/list-recent-ocs-events.js +0 -160
- package/dist/list-recent-ocs-events.js.map +0 -1
- package/dist/manus-client.d.ts +0 -429
- package/dist/manus-client.d.ts.map +0 -1
- package/dist/manus-client.js +0 -401
- package/dist/manus-client.js.map +0 -1
- package/dist/manus-common.d.ts +0 -5
- package/dist/manus-common.d.ts.map +0 -1
- package/dist/manus-common.js +0 -5
- package/dist/manus-common.js.map +0 -1
- package/dist/manus-schedule.d.ts +0 -74
- package/dist/manus-schedule.d.ts.map +0 -1
- package/dist/manus-schedule.js +0 -213
- package/dist/manus-schedule.js.map +0 -1
- package/dist/manus-usage.d.ts +0 -32
- package/dist/manus-usage.d.ts.map +0 -1
- package/dist/manus-usage.js +0 -120
- package/dist/manus-usage.js.map +0 -1
- package/dist/manus-webhook.d.ts +0 -60
- package/dist/manus-webhook.d.ts.map +0 -1
- package/dist/manus-webhook.js +0 -361
- package/dist/manus-webhook.js.map +0 -1
- package/dist/pricing-tools.d.ts +0 -26
- package/dist/pricing-tools.d.ts.map +0 -1
- package/dist/pricing-tools.js +0 -428
- package/dist/pricing-tools.js.map +0 -1
- package/dist/projects-tools.d.ts +0 -39
- package/dist/projects-tools.d.ts.map +0 -1
- package/dist/projects-tools.js +0 -545
- package/dist/projects-tools.js.map +0 -1
- package/dist/prompts.d.ts +0 -7
- package/dist/prompts.d.ts.map +0 -1
- package/dist/prompts.js +0 -151
- package/dist/prompts.js.map +0 -1
- package/dist/stripe-connect-tools.d.ts +0 -33
- package/dist/stripe-connect-tools.d.ts.map +0 -1
- package/dist/stripe-connect-tools.js +0 -504
- package/dist/stripe-connect-tools.js.map +0 -1
- package/dist/timing-safe-equal.d.ts +0 -5
- package/dist/timing-safe-equal.d.ts.map +0 -1
- package/dist/timing-safe-equal.js +0 -13
- package/dist/timing-safe-equal.js.map +0 -1
- package/dist/tools-backlog.d.ts +0 -37
- package/dist/tools-backlog.d.ts.map +0 -1
- package/dist/tools-backlog.js +0 -410
- package/dist/tools-backlog.js.map +0 -1
- package/dist/tools-carrier-ask.d.ts +0 -138
- package/dist/tools-carrier-ask.d.ts.map +0 -1
- package/dist/tools-carrier-ask.js +0 -913
- package/dist/tools-carrier-ask.js.map +0 -1
- package/dist/tools-pricing.d.ts +0 -18
- package/dist/tools-pricing.d.ts.map +0 -1
- package/dist/tools-pricing.js +0 -172
- package/dist/tools-pricing.js.map +0 -1
- package/dist/tools-ui-agent-ask.d.ts +0 -29
- package/dist/tools-ui-agent-ask.d.ts.map +0 -1
- package/dist/tools-ui-agent-ask.js +0 -272
- package/dist/tools-ui-agent-ask.js.map +0 -1
- package/dist/tools-ui-agent-schedule.d.ts +0 -29
- package/dist/tools-ui-agent-schedule.d.ts.map +0 -1
- package/dist/tools-ui-agent-schedule.js +0 -517
- package/dist/tools-ui-agent-schedule.js.map +0 -1
- package/dist/tools-ui-agent.d.ts +0 -40
- package/dist/tools-ui-agent.d.ts.map +0 -1
- package/dist/tools-ui-agent.js +0 -508
- package/dist/tools-ui-agent.js.map +0 -1
- package/dist/tools.d.ts +0 -60
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -1384
- package/dist/tools.js.map +0 -1
- package/dist/types.d.ts +0 -298
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -5
- package/dist/types.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carrierllc/mcp",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Carrier MCP
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Carrier MCP — natural-language control of MVNO/eSIM fleets via eSIMVault OCS. Stdio mode for direct integration with Claude Desktop, Cursor, Windsurf, and MCP-compatible clients.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Carrier (Lifecycle Innovations Limited)",
|
|
7
7
|
"homepage": "https://mcp.carrier.llc",
|
|
@@ -16,28 +16,28 @@
|
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "tsup",
|
|
20
20
|
"type-check": "tsc --noEmit",
|
|
21
21
|
"lint": "eslint src",
|
|
22
22
|
"prepublishOnly": "pnpm run build"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
27
|
-
"zod": "^4.0.0",
|
|
25
|
+
"@clerk/backend": "^3.4.7",
|
|
28
26
|
"@modelcontextprotocol/ext-apps": "^1.7.1",
|
|
27
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
29
28
|
"@noble/hashes": "^1.8.0",
|
|
30
29
|
"@sentry/cloudflare": "^10.52.0",
|
|
31
30
|
"aws4fetch": "^1.0.20",
|
|
32
|
-
"
|
|
31
|
+
"zod": "^4.0.0"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
34
|
+
"@cloudflare/workers-types": "^4",
|
|
35
35
|
"@types/node": "^22",
|
|
36
|
-
"typescript": "^5.5.0",
|
|
37
|
-
"eslint": "^9",
|
|
38
36
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
39
37
|
"@typescript-eslint/parser": "^8.0.0",
|
|
40
|
-
"
|
|
38
|
+
"eslint": "^9",
|
|
39
|
+
"tsup": "^8.5.1",
|
|
40
|
+
"typescript": "^5.5.0"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
43
43
|
"mcp",
|
|
File without changes
|
package/dist/apps/app-state.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v1.2b — Wizard Session KV helpers
|
|
3
|
-
*
|
|
4
|
-
* Stores ephemeral 3-step wizard state in CARRIER_USERS KV.
|
|
5
|
-
* Key pattern: app-session:<sub>:<wizardId>
|
|
6
|
-
* TTL: 600 seconds (10 minutes).
|
|
7
|
-
*/
|
|
8
|
-
import type { Env } from "../types.js";
|
|
9
|
-
export interface WizardSession {
|
|
10
|
-
step: "select-subscriber" | "select-package" | "confirm";
|
|
11
|
-
subscriber_iccid?: string;
|
|
12
|
-
package_template_id?: number;
|
|
13
|
-
dry_run: boolean;
|
|
14
|
-
initiated_at: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function loadWizardSession(env: Env, sub: string, wizardId: string): Promise<WizardSession | null>;
|
|
17
|
-
export declare function saveWizardSession(env: Env, sub: string, wizardId: string, session: WizardSession): Promise<void>;
|
|
18
|
-
export declare function deleteWizardSession(env: Env, sub: string, wizardId: string): Promise<void>;
|
|
19
|
-
//# sourceMappingURL=app-state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-state.d.ts","sourceRoot":"","sources":["../../src/apps/app-state.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,mBAAmB,GAAG,gBAAgB,GAAG,SAAS,CAAC;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAQ/B;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
package/dist/apps/app-state.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v1.2b — Wizard Session KV helpers
|
|
3
|
-
*
|
|
4
|
-
* Stores ephemeral 3-step wizard state in CARRIER_USERS KV.
|
|
5
|
-
* Key pattern: app-session:<sub>:<wizardId>
|
|
6
|
-
* TTL: 600 seconds (10 minutes).
|
|
7
|
-
*/
|
|
8
|
-
function sessionKey(sub, wizardId) {
|
|
9
|
-
return `app-session:${sub}:${wizardId}`;
|
|
10
|
-
}
|
|
11
|
-
export async function loadWizardSession(env, sub, wizardId) {
|
|
12
|
-
const raw = await env.CARRIER_USERS.get(sessionKey(sub, wizardId));
|
|
13
|
-
if (!raw)
|
|
14
|
-
return null;
|
|
15
|
-
try {
|
|
16
|
-
return JSON.parse(raw);
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export async function saveWizardSession(env, sub, wizardId, session) {
|
|
23
|
-
await env.CARRIER_USERS.put(sessionKey(sub, wizardId), JSON.stringify(session), { expirationTtl: 600 });
|
|
24
|
-
}
|
|
25
|
-
export async function deleteWizardSession(env, sub, wizardId) {
|
|
26
|
-
await env.CARRIER_USERS.delete(sessionKey(sub, wizardId));
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=app-state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-state.js","sourceRoot":"","sources":["../../src/apps/app-state.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,SAAS,UAAU,CAAC,GAAW,EAAE,QAAgB;IAC/C,OAAO,eAAe,GAAG,IAAI,QAAQ,EAAE,CAAC;AAC1C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAAQ,EACR,GAAW,EACX,QAAgB;IAEhB,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;IACnE,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAAQ,EACR,GAAW,EACX,QAAgB,EAChB,OAAsB;IAEtB,MAAM,GAAG,CAAC,aAAa,CAAC,GAAG,CACzB,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,EACzB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EACvB,EAAE,aAAa,EAAE,GAAG,EAAE,CACvB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,GAAQ,EACR,GAAW,EACX,QAAgB;IAEhB,MAAM,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v1.2d — Balance Top-up Form MCP App
|
|
3
|
-
*
|
|
4
|
-
* Enterprise-only inline form for adjusting account balances via
|
|
5
|
-
* `modify_account_balance`. Supports preview-only mode before committing.
|
|
6
|
-
* Scoped to `admin` — pairs with MFA gate from PR #46.
|
|
7
|
-
*/
|
|
8
|
-
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
|
-
import type { ToolContext } from "../tools.js";
|
|
10
|
-
export interface BalanceTopupStructuredContent {
|
|
11
|
-
iccid: string;
|
|
12
|
-
delta: number;
|
|
13
|
-
current_balance?: number;
|
|
14
|
-
new_balance?: number;
|
|
15
|
-
preview: boolean;
|
|
16
|
-
success?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare function registerBalanceTopupApp(server: McpServer, ctx: ToolContext): void;
|
|
19
|
-
//# sourceMappingURL=balance-topup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"balance-topup.d.ts","sourceRoot":"","sources":["../../src/apps/balance-topup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAmB/C,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,WAAW,GACf,IAAI,CAyIN"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v1.2d — Balance Top-up Form MCP App
|
|
3
|
-
*
|
|
4
|
-
* Enterprise-only inline form for adjusting account balances via
|
|
5
|
-
* `modify_account_balance`. Supports preview-only mode before committing.
|
|
6
|
-
* Scoped to `admin` — pairs with MFA gate from PR #46.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
import { registerAppTool, registerAppResource, RESOURCE_MIME_TYPE, } from "@modelcontextprotocol/ext-apps/server";
|
|
10
|
-
import { OcsClient } from "../client.js";
|
|
11
|
-
import { wrapHandler, TOOL_SCOPES } from "../tools.js";
|
|
12
|
-
async function safeCallWithToken(client, _token, method, params = {}) {
|
|
13
|
-
try {
|
|
14
|
-
return { data: await client.call(method, params), error: null };
|
|
15
|
-
}
|
|
16
|
-
catch (err) {
|
|
17
|
-
return {
|
|
18
|
-
data: null,
|
|
19
|
-
error: err instanceof Error ? err.message : String(err),
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export function registerBalanceTopupApp(server, ctx) {
|
|
24
|
-
// Tier guard — enterprise only
|
|
25
|
-
if (ctx.props.tier !== "enterprise")
|
|
26
|
-
return;
|
|
27
|
-
// ── Resource ─────────────────────────────────────────────────────────────
|
|
28
|
-
registerAppResource(server, "Balance Top-up Form", "ui://balance-topup-form", {
|
|
29
|
-
description: "Admin balance top-up form — enter an ICCID and delta amount to preview and commit account balance adjustments. Enterprise only. Requires recent MFA verification.",
|
|
30
|
-
}, async () => {
|
|
31
|
-
let html;
|
|
32
|
-
try {
|
|
33
|
-
const resp = await ctx.env.ASSETS.fetch(new Request("https://internal/views/balance-topup/index.html"));
|
|
34
|
-
html = await resp.text();
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
html = "<html><body><p>Balance top-up form unavailable.</p></body></html>";
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
contents: [
|
|
41
|
-
{
|
|
42
|
-
uri: "ui://balance-topup-form",
|
|
43
|
-
mimeType: RESOURCE_MIME_TYPE,
|
|
44
|
-
text: html,
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
// ── Tool ─────────────────────────────────────────────────────────────────
|
|
50
|
-
registerAppTool(server, "balance_topup_form", {
|
|
51
|
-
title: "Balance Top-up Form",
|
|
52
|
-
description: "Enterprise admin tool: preview or commit an account balance adjustment. Set preview=true to fetch projection (no OCS write); preview=false (default) to execute. Requires admin scope + recent MFA.",
|
|
53
|
-
inputSchema: {
|
|
54
|
-
iccid: z.string().describe("The subscriber ICCID for the account lookup"),
|
|
55
|
-
delta: z
|
|
56
|
-
.number()
|
|
57
|
-
.describe("Amount to add (positive) or deduct (negative) from the account balance"),
|
|
58
|
-
preview: z
|
|
59
|
-
.boolean()
|
|
60
|
-
.default(true)
|
|
61
|
-
.describe("If true, return preview without writing. If false, execute the balance change."),
|
|
62
|
-
},
|
|
63
|
-
annotations: { destructiveHint: true },
|
|
64
|
-
_meta: {
|
|
65
|
-
ui: {
|
|
66
|
-
resourceUri: "ui://balance-topup-form",
|
|
67
|
-
visibility: ["model", "app"],
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
}, wrapHandler("modify_account_balance", "modifyAccountBalance", TOOL_SCOPES["modify_account_balance"], ctx, async ({ iccid, delta, preview }) => {
|
|
71
|
-
const token = await ctx.getUserToken(ctx.props.sub);
|
|
72
|
-
const client = new OcsClient(ctx.env.CARRIER_OCS_BASE_URL, token);
|
|
73
|
-
if (preview === true) {
|
|
74
|
-
// Preview path — fetch current subscriber balance, return projection
|
|
75
|
-
const result = await safeCallWithToken(client, token, "getSingleSubscriber", { iccid });
|
|
76
|
-
const currentBalance = result.data
|
|
77
|
-
? Number(result.data["balance"] ?? result.data["accountBalance"] ?? 0)
|
|
78
|
-
: 0;
|
|
79
|
-
const newBalance = currentBalance + delta;
|
|
80
|
-
const structured = {
|
|
81
|
-
iccid,
|
|
82
|
-
delta,
|
|
83
|
-
current_balance: currentBalance,
|
|
84
|
-
new_balance: newBalance,
|
|
85
|
-
preview: true,
|
|
86
|
-
};
|
|
87
|
-
return {
|
|
88
|
-
content: [
|
|
89
|
-
{
|
|
90
|
-
type: "text",
|
|
91
|
-
text: `[Preview] ICCID: ${iccid} | Current balance: ${currentBalance} | Delta: ${delta >= 0 ? "+" : ""}${delta} | New balance: ${newBalance}. No changes made.`,
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
structuredContent: structured,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
// Execute path — call modify_account_balance via OCS
|
|
98
|
-
const execResult = await safeCallWithToken(client, token, "modifyAccountBalance", { subscriber: iccid, adaptBalance: delta });
|
|
99
|
-
if (execResult.error) {
|
|
100
|
-
return {
|
|
101
|
-
isError: true,
|
|
102
|
-
content: [{ type: "text", text: `Error: ${execResult.error}` }],
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
const newBalance = execResult.data
|
|
106
|
-
? Number(execResult.data["balance"] ?? execResult.data["newBalance"] ?? 0)
|
|
107
|
-
: delta;
|
|
108
|
-
const structured = {
|
|
109
|
-
iccid,
|
|
110
|
-
delta,
|
|
111
|
-
new_balance: newBalance,
|
|
112
|
-
preview: false,
|
|
113
|
-
success: true,
|
|
114
|
-
};
|
|
115
|
-
return {
|
|
116
|
-
content: [{ type: "text", text: "Balance updated." }],
|
|
117
|
-
structuredContent: structured,
|
|
118
|
-
};
|
|
119
|
-
}));
|
|
120
|
-
}
|
|
121
|
-
//# sourceMappingURL=balance-topup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"balance-topup.js","sourceRoot":"","sources":["../../src/apps/balance-topup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEvD,KAAK,UAAU,iBAAiB,CAC9B,MAAiB,EACjB,MAAc,EACd,MAAc,EACd,SAAoD,EAAE;IAEtD,IAAI,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC,IAAI,CAAI,MAAM,EAA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dashboard MCP App
|
|
3
|
-
*
|
|
4
|
-
* Registers a UI-enabled tool `fleet_health_app` that returns structured data
|
|
5
|
-
* for rendering charts in the sandboxed iframe view, alongside the
|
|
6
|
-
* `ui://fleet-health-dashboard` resource that serves the HTML panel.
|
|
7
|
-
*/
|
|
8
|
-
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
|
-
import type { ToolContext } from "../tools.js";
|
|
10
|
-
export interface FleetHealthStructuredContent {
|
|
11
|
-
utilization: number;
|
|
12
|
-
totalActive: number;
|
|
13
|
-
totalSuspended: number;
|
|
14
|
-
totalInventory: number;
|
|
15
|
-
totalOther: number;
|
|
16
|
-
totalAccounts: number;
|
|
17
|
-
lowBalanceCount: number;
|
|
18
|
-
accountList: Array<{
|
|
19
|
-
name: string;
|
|
20
|
-
balance: number;
|
|
21
|
-
active: number;
|
|
22
|
-
suspended: number;
|
|
23
|
-
inventory: number;
|
|
24
|
-
other: number;
|
|
25
|
-
}>;
|
|
26
|
-
[key: string]: unknown;
|
|
27
|
-
}
|
|
28
|
-
export declare function registerFleetHealthApp(server: McpServer, ctx: ToolContext): void;
|
|
29
|
-
//# sourceMappingURL=fleet-health-app.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fleet-health-app.d.ts","sourceRoot":"","sources":["../../src/apps/fleet-health-app.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkB/C,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,KAAK,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;IAGH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,WAAW,GACf,IAAI,CAgLN"}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v1.2a — Fleet Health Dashboard MCP App
|
|
3
|
-
*
|
|
4
|
-
* Registers a UI-enabled tool `fleet_health_app` that returns structured data
|
|
5
|
-
* for rendering charts in the sandboxed iframe view, alongside the
|
|
6
|
-
* `ui://fleet-health-dashboard` resource that serves the HTML panel.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
import { registerAppTool, registerAppResource, RESOURCE_MIME_TYPE, } from "@modelcontextprotocol/ext-apps/server";
|
|
10
|
-
import { OcsClient } from "../client.js";
|
|
11
|
-
async function safeCallWithToken(client, _token, method, params = {}) {
|
|
12
|
-
try {
|
|
13
|
-
return { data: await client.call(method, params), error: null };
|
|
14
|
-
}
|
|
15
|
-
catch (err) {
|
|
16
|
-
return {
|
|
17
|
-
data: null,
|
|
18
|
-
error: err instanceof Error ? err.message : String(err),
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export function registerFleetHealthApp(server, ctx) {
|
|
23
|
-
// ── Resource ─────────────────────────────────────────────────────────────
|
|
24
|
-
registerAppResource(server, "Fleet Health Dashboard", "ui://fleet-health-dashboard", {
|
|
25
|
-
description: "Interactive Fleet Health Dashboard — eSIM status charts, account breakdown, low-balance alerts.",
|
|
26
|
-
}, async () => {
|
|
27
|
-
let html;
|
|
28
|
-
try {
|
|
29
|
-
const resp = await ctx.env.ASSETS.fetch(new Request("https://internal/views/fleet-health/index.html"));
|
|
30
|
-
html = await resp.text();
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
html = "<html><body><p>Dashboard unavailable.</p></body></html>";
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
contents: [
|
|
37
|
-
{
|
|
38
|
-
uri: "ui://fleet-health-dashboard",
|
|
39
|
-
mimeType: RESOURCE_MIME_TYPE,
|
|
40
|
-
text: html,
|
|
41
|
-
_meta: {
|
|
42
|
-
ui: {
|
|
43
|
-
csp: {
|
|
44
|
-
resourceDomains: ["https://cdn.jsdelivr.net"],
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
// ── Tool ─────────────────────────────────────────────────────────────────
|
|
53
|
-
registerAppTool(server, "fleet_health_app", {
|
|
54
|
-
title: "Fleet Health Dashboard",
|
|
55
|
-
description: "Renders an interactive Fleet Health Dashboard with eSIM status charts, top-10 account breakdown, and low-balance alerts. Returns structuredContent for the chart panel.",
|
|
56
|
-
inputSchema: {
|
|
57
|
-
accountId: z
|
|
58
|
-
.number()
|
|
59
|
-
.optional()
|
|
60
|
-
.describe("Filter to a specific account (omit for all)"),
|
|
61
|
-
},
|
|
62
|
-
annotations: { readOnlyHint: true },
|
|
63
|
-
_meta: {
|
|
64
|
-
ui: {
|
|
65
|
-
resourceUri: "ui://fleet-health-dashboard",
|
|
66
|
-
visibility: ["model", "app"],
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
}, async ({ accountId }) => {
|
|
70
|
-
const token = await ctx.getUserToken(ctx.props.sub);
|
|
71
|
-
const client = new OcsClient(ctx.env.CARRIER_OCS_BASE_URL, token);
|
|
72
|
-
const [statusResult, accountsResult] = await Promise.all([
|
|
73
|
-
safeCallWithToken(client, token, "esimStatusPerAccount", accountId !== undefined ? { accountId } : {}),
|
|
74
|
-
safeCallWithToken(client, token, "listResellerAccount", {}),
|
|
75
|
-
]);
|
|
76
|
-
let totalActive = 0;
|
|
77
|
-
let totalSuspended = 0;
|
|
78
|
-
let totalInventory = 0;
|
|
79
|
-
let totalOther = 0;
|
|
80
|
-
const accountList = [];
|
|
81
|
-
if (statusResult.data && Array.isArray(statusResult.data)) {
|
|
82
|
-
for (const account of statusResult.data) {
|
|
83
|
-
const active = Number(account["active"] ?? 0);
|
|
84
|
-
const suspended = Number(account["suspended"] ?? 0);
|
|
85
|
-
const inventory = Number(account["inventory"] ?? account["notActivated"] ?? 0);
|
|
86
|
-
const other = Number(account["other"] ?? account["terminated"] ?? 0);
|
|
87
|
-
totalActive += active;
|
|
88
|
-
totalSuspended += suspended;
|
|
89
|
-
totalInventory += inventory;
|
|
90
|
-
totalOther += other;
|
|
91
|
-
accountList.push({
|
|
92
|
-
name: String(account["name"] ?? account["accountId"] ?? "?"),
|
|
93
|
-
balance: 0,
|
|
94
|
-
active,
|
|
95
|
-
suspended,
|
|
96
|
-
inventory,
|
|
97
|
-
other,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
// Merge balance data from accounts list
|
|
102
|
-
if (accountsResult.data && Array.isArray(accountsResult.data)) {
|
|
103
|
-
for (const a of accountsResult.data) {
|
|
104
|
-
const aName = String(a["name"] ?? a["accountId"] ?? "?");
|
|
105
|
-
const entry = accountList.find((e) => e.name === aName);
|
|
106
|
-
if (entry) {
|
|
107
|
-
entry.balance = Number(a["balance"] ?? 0);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const total = totalActive + totalSuspended + totalInventory + totalOther;
|
|
112
|
-
const utilization = total > 0
|
|
113
|
-
? Math.round((totalActive / total) * 1000) / 10
|
|
114
|
-
: 0;
|
|
115
|
-
const totalAccounts = accountsResult.data && Array.isArray(accountsResult.data)
|
|
116
|
-
? accountsResult.data.length
|
|
117
|
-
: accountList.length;
|
|
118
|
-
const lowBalanceCount = accountsResult.data && Array.isArray(accountsResult.data)
|
|
119
|
-
? accountsResult.data.filter((a) => Number(a["balance"] ?? 0) < 10)
|
|
120
|
-
.length
|
|
121
|
-
: 0;
|
|
122
|
-
// Sort accountList by total eSIMs descending for top-10 bar chart
|
|
123
|
-
const sortedAccounts = [...accountList]
|
|
124
|
-
.sort((a, b) => b.active + b.suspended + b.inventory + b.other -
|
|
125
|
-
(a.active + a.suspended + a.inventory + a.other))
|
|
126
|
-
.slice(0, 10);
|
|
127
|
-
const errors = [statusResult.error, accountsResult.error]
|
|
128
|
-
.filter(Boolean)
|
|
129
|
-
.join("; ");
|
|
130
|
-
const summaryLines = [
|
|
131
|
-
`Fleet Utilization: ${utilization}%`,
|
|
132
|
-
`Active: ${totalActive} | Suspended: ${totalSuspended} | Inventory: ${totalInventory} | Other: ${totalOther}`,
|
|
133
|
-
`Total Accounts: ${totalAccounts} | Low Balance (<10): ${lowBalanceCount}`,
|
|
134
|
-
...(errors ? [`Errors: ${errors}`] : []),
|
|
135
|
-
];
|
|
136
|
-
const structuredContent = {
|
|
137
|
-
utilization,
|
|
138
|
-
totalActive,
|
|
139
|
-
totalSuspended,
|
|
140
|
-
totalInventory,
|
|
141
|
-
totalOther,
|
|
142
|
-
totalAccounts,
|
|
143
|
-
lowBalanceCount,
|
|
144
|
-
accountList: sortedAccounts,
|
|
145
|
-
};
|
|
146
|
-
return {
|
|
147
|
-
content: [{ type: "text", text: summaryLines.join("\n") }],
|
|
148
|
-
structuredContent,
|
|
149
|
-
};
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
//# sourceMappingURL=fleet-health-app.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fleet-health-app.js","sourceRoot":"","sources":["../../src/apps/fleet-health-app.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OA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AAC,SAAS,GAAG,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,CACnD;aACA,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAEhB,MAAM,MAAM,GAAG,CAAC,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC;aACtD,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,MAAM,YAAY,GAAG;YACnB,sBAAsB,WAAW,GAAG;YACpC,WAAW,WAAW,iBAAiB,cAAc,iBAAiB,cAAc,aAAa,UAAU,EAAE;YAC7G,mBAAmB,aAAa,yBAAyB,eAAe,EAAE;YAC1E,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC,CAAC;QAEF,MAAM,iBAAiB,GAAiC;YACtD,WAAW;YACX,WAAW;YACX,cAAc;YACd,cAAc;YACd,UAAU;YACV,aAAa;YACb,eAAe;YACf,WAAW,EAAE,cAAc;SAC5B,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACnE,iBAAiB;SAClB,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/apps/index.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Apps barrel — v1.2+
|
|
3
|
-
*
|
|
4
|
-
* Registers all UI-enabled tools and `ui://` HTML resources on every session.
|
|
5
|
-
* Tools carry `_meta.ui.resourceUri` per the MCP Apps spec; MCP-Apps-capable
|
|
6
|
-
* clients (Claude Desktop, Claude.ai with MCP Apps support) render the
|
|
7
|
-
* associated `ui://` resource as a sandboxed iframe. Clients that don't
|
|
8
|
-
* speak MCP Apps simply ignore the `_meta.ui` metadata and call the tool
|
|
9
|
-
* as a normal tool with structured output.
|
|
10
|
-
*
|
|
11
|
-
* Per-app tier gates live INSIDE each register*() function. The previous
|
|
12
|
-
* version of this barrel gated the whole registration block on
|
|
13
|
-
* `getUiCapability` from the client's `initialize` capabilities — that
|
|
14
|
-
* was overly aggressive and hid the tools from clients (including
|
|
15
|
-
* Claude Code) that don't yet advertise `io.modelcontextprotocol/ui`
|
|
16
|
-
* but can still execute structured-output tools.
|
|
17
|
-
*
|
|
18
|
-
* Sub-phase ownership:
|
|
19
|
-
* v1.2a — fleet-health-app
|
|
20
|
-
* v1.2b — provisioning-wizard
|
|
21
|
-
* v1.2d — balance-topup-form
|
|
22
|
-
*/
|
|
23
|
-
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
24
|
-
import type { ToolContext } from "../tools.js";
|
|
25
|
-
import { registerFleetHealthApp } from "./fleet-health-app.js";
|
|
26
|
-
import { registerProvisioningWizard } from "./provisioning-wizard.js";
|
|
27
|
-
import { registerBalanceTopupApp } from "./balance-topup.js";
|
|
28
|
-
export { registerFleetHealthApp, registerProvisioningWizard, registerBalanceTopupApp, };
|
|
29
|
-
/**
|
|
30
|
-
* Register all MCP App tools and resources.
|
|
31
|
-
*
|
|
32
|
-
* Always registers unconditionally — tier gates are enforced inside each
|
|
33
|
-
* register*() function. MCP-Apps-capable clients render the iframes;
|
|
34
|
-
* other clients see the tools as normal structured-output tools.
|
|
35
|
-
*/
|
|
36
|
-
export declare function registerAllApps(server: McpServer, ctx: ToolContext): void;
|
|
37
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/apps/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apps/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,GACxB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CASzE"}
|
package/dist/apps/index.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Apps barrel — v1.2+
|
|
3
|
-
*
|
|
4
|
-
* Registers all UI-enabled tools and `ui://` HTML resources on every session.
|
|
5
|
-
* Tools carry `_meta.ui.resourceUri` per the MCP Apps spec; MCP-Apps-capable
|
|
6
|
-
* clients (Claude Desktop, Claude.ai with MCP Apps support) render the
|
|
7
|
-
* associated `ui://` resource as a sandboxed iframe. Clients that don't
|
|
8
|
-
* speak MCP Apps simply ignore the `_meta.ui` metadata and call the tool
|
|
9
|
-
* as a normal tool with structured output.
|
|
10
|
-
*
|
|
11
|
-
* Per-app tier gates live INSIDE each register*() function. The previous
|
|
12
|
-
* version of this barrel gated the whole registration block on
|
|
13
|
-
* `getUiCapability` from the client's `initialize` capabilities — that
|
|
14
|
-
* was overly aggressive and hid the tools from clients (including
|
|
15
|
-
* Claude Code) that don't yet advertise `io.modelcontextprotocol/ui`
|
|
16
|
-
* but can still execute structured-output tools.
|
|
17
|
-
*
|
|
18
|
-
* Sub-phase ownership:
|
|
19
|
-
* v1.2a — fleet-health-app
|
|
20
|
-
* v1.2b — provisioning-wizard
|
|
21
|
-
* v1.2d — balance-topup-form
|
|
22
|
-
*/
|
|
23
|
-
import { registerFleetHealthApp } from "./fleet-health-app.js";
|
|
24
|
-
import { registerProvisioningWizard } from "./provisioning-wizard.js";
|
|
25
|
-
import { registerBalanceTopupApp } from "./balance-topup.js";
|
|
26
|
-
export { registerFleetHealthApp, registerProvisioningWizard, registerBalanceTopupApp, };
|
|
27
|
-
/**
|
|
28
|
-
* Register all MCP App tools and resources.
|
|
29
|
-
*
|
|
30
|
-
* Always registers unconditionally — tier gates are enforced inside each
|
|
31
|
-
* register*() function. MCP-Apps-capable clients render the iframes;
|
|
32
|
-
* other clients see the tools as normal structured-output tools.
|
|
33
|
-
*/
|
|
34
|
-
export function registerAllApps(server, ctx) {
|
|
35
|
-
// v1.2a — Fleet Health Dashboard (free+, read scope)
|
|
36
|
-
registerFleetHealthApp(server, ctx);
|
|
37
|
-
// v1.2b — eSIM Provisioning Wizard (pro+, write scope; tier-gated internally)
|
|
38
|
-
registerProvisioningWizard(server, ctx);
|
|
39
|
-
// v1.2d — Balance Top-up Form (enterprise only, admin scope; tier-gated internally)
|
|
40
|
-
registerBalanceTopupApp(server, ctx);
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
package/dist/apps/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apps/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,GACxB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,MAAiB,EAAE,GAAgB;IACjE,qDAAqD;IACrD,sBAAsB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEpC,8EAA8E;IAC9E,0BAA0B,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAExC,oFAAoF;IACpF,uBAAuB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v1.2b — eSIM Provisioning Wizard MCP App
|
|
3
|
-
*
|
|
4
|
-
* 3-step wizard: select subscriber → select package → confirm + execute.
|
|
5
|
-
* Tier-gated: pro and enterprise only (free tier is skipped).
|
|
6
|
-
* Step 2→3 fetches package template details for preview; step 3 (confirm) calls affectPackageToSubscriber.
|
|
7
|
-
*/
|
|
8
|
-
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
|
-
import type { ToolContext } from "../tools.js";
|
|
10
|
-
export declare function registerProvisioningWizard(server: McpServer, ctx: ToolContext): void;
|
|
11
|
-
//# sourceMappingURL=provisioning-wizard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provisioning-wizard.d.ts","sourceRoot":"","sources":["../../src/apps/provisioning-wizard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAmC/C,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,WAAW,GACf,IAAI,CAmYN"}
|