@carrierllc/mcp 0.0.1 → 0.2.0
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 +216 -3
- package/dist/apps/app-state.d.ts +19 -0
- package/dist/apps/app-state.d.ts.map +1 -0
- package/dist/apps/app-state.js +28 -0
- package/dist/apps/app-state.js.map +1 -0
- package/dist/apps/balance-topup.d.ts +19 -0
- package/dist/apps/balance-topup.d.ts.map +1 -0
- package/dist/apps/balance-topup.js +121 -0
- package/dist/apps/balance-topup.js.map +1 -0
- package/dist/apps/fleet-health-app.d.ts +29 -0
- package/dist/apps/fleet-health-app.d.ts.map +1 -0
- package/dist/apps/fleet-health-app.js +152 -0
- package/dist/apps/fleet-health-app.js.map +1 -0
- package/dist/apps/index.d.ts +37 -0
- package/dist/apps/index.d.ts.map +1 -0
- package/dist/apps/index.js +42 -0
- package/dist/apps/index.js.map +1 -0
- package/dist/apps/provisioning-wizard.d.ts +11 -0
- package/dist/apps/provisioning-wizard.d.ts.map +1 -0
- package/dist/apps/provisioning-wizard.js +345 -0
- package/dist/apps/provisioning-wizard.js.map +1 -0
- package/dist/audit.d.ts +31 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/audit.js +42 -0
- package/dist/audit.js.map +1 -0
- package/dist/billing-thresholds.d.ts +71 -0
- package/dist/billing-thresholds.d.ts.map +1 -0
- package/dist/billing-thresholds.js +238 -0
- package/dist/billing-thresholds.js.map +1 -0
- package/dist/billing.d.ts +95 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +239 -0
- package/dist/billing.js.map +1 -0
- package/dist/clerk.d.ts +125 -0
- package/dist/clerk.d.ts.map +1 -0
- package/dist/clerk.js +389 -0
- package/dist/clerk.js.map +1 -0
- package/dist/client.d.ts +35 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +75 -0
- package/dist/client.js.map +1 -0
- package/dist/credits.d.ts +165 -0
- package/dist/credits.d.ts.map +1 -0
- package/dist/credits.js +483 -0
- package/dist/credits.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/intelligence.d.ts +4 -0
- package/dist/intelligence.d.ts.map +1 -0
- package/dist/intelligence.js +899 -0
- package/dist/intelligence.js.map +1 -0
- package/dist/list-recent-ocs-events.d.ts +48 -0
- package/dist/list-recent-ocs-events.d.ts.map +1 -0
- package/dist/list-recent-ocs-events.js +160 -0
- package/dist/list-recent-ocs-events.js.map +1 -0
- package/dist/manus-client.d.ts +429 -0
- package/dist/manus-client.d.ts.map +1 -0
- package/dist/manus-client.js +401 -0
- package/dist/manus-client.js.map +1 -0
- package/dist/manus-common.d.ts +5 -0
- package/dist/manus-common.d.ts.map +1 -0
- package/dist/manus-common.js +5 -0
- package/dist/manus-common.js.map +1 -0
- package/dist/manus-schedule.d.ts +74 -0
- package/dist/manus-schedule.d.ts.map +1 -0
- package/dist/manus-schedule.js +213 -0
- package/dist/manus-schedule.js.map +1 -0
- package/dist/manus-usage.d.ts +32 -0
- package/dist/manus-usage.d.ts.map +1 -0
- package/dist/manus-usage.js +120 -0
- package/dist/manus-usage.js.map +1 -0
- package/dist/manus-webhook.d.ts +60 -0
- package/dist/manus-webhook.d.ts.map +1 -0
- package/dist/manus-webhook.js +361 -0
- package/dist/manus-webhook.js.map +1 -0
- package/dist/pricing-tools.d.ts +26 -0
- package/dist/pricing-tools.d.ts.map +1 -0
- package/dist/pricing-tools.js +428 -0
- package/dist/pricing-tools.js.map +1 -0
- package/dist/projects-tools.d.ts +39 -0
- package/dist/projects-tools.d.ts.map +1 -0
- package/dist/projects-tools.js +545 -0
- package/dist/projects-tools.js.map +1 -0
- package/dist/prompts.d.ts +7 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +151 -0
- package/dist/prompts.js.map +1 -0
- package/dist/stripe-connect-tools.d.ts +33 -0
- package/dist/stripe-connect-tools.d.ts.map +1 -0
- package/dist/stripe-connect-tools.js +504 -0
- package/dist/stripe-connect-tools.js.map +1 -0
- package/dist/timing-safe-equal.d.ts +5 -0
- package/dist/timing-safe-equal.d.ts.map +1 -0
- package/dist/timing-safe-equal.js +13 -0
- package/dist/timing-safe-equal.js.map +1 -0
- package/dist/tools-backlog.d.ts +28 -0
- package/dist/tools-backlog.d.ts.map +1 -0
- package/dist/tools-backlog.js +315 -0
- package/dist/tools-backlog.js.map +1 -0
- package/dist/tools-carrier-ask.d.ts +138 -0
- package/dist/tools-carrier-ask.d.ts.map +1 -0
- package/dist/tools-carrier-ask.js +913 -0
- package/dist/tools-carrier-ask.js.map +1 -0
- package/dist/tools-pricing.d.ts +18 -0
- package/dist/tools-pricing.d.ts.map +1 -0
- package/dist/tools-pricing.js +172 -0
- package/dist/tools-pricing.js.map +1 -0
- package/dist/tools-ui-agent-ask.d.ts +29 -0
- package/dist/tools-ui-agent-ask.d.ts.map +1 -0
- package/dist/tools-ui-agent-ask.js +272 -0
- package/dist/tools-ui-agent-ask.js.map +1 -0
- package/dist/tools-ui-agent-schedule.d.ts +29 -0
- package/dist/tools-ui-agent-schedule.d.ts.map +1 -0
- package/dist/tools-ui-agent-schedule.js +517 -0
- package/dist/tools-ui-agent-schedule.js.map +1 -0
- package/dist/tools-ui-agent.d.ts +40 -0
- package/dist/tools-ui-agent.d.ts.map +1 -0
- package/dist/tools-ui-agent.js +508 -0
- package/dist/tools-ui-agent.js.map +1 -0
- package/dist/tools.d.ts +60 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +1295 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +291 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +55 -7
- package/index.js +0 -1
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carrier MCP — UI-Agent tools (v1.1.1).
|
|
3
|
+
*
|
|
4
|
+
* These tools handle OCS operations that are NOT exposed via the OCS REST API
|
|
5
|
+
* (confirmed by NOC/Bridge4IP on 2026-05-13). Instead of calling OCS JSON-RPC,
|
|
6
|
+
* they spawn a Manus "lite" agent that drives the OCS web dashboard via browser
|
|
7
|
+
* automation to complete the operation.
|
|
8
|
+
*
|
|
9
|
+
* Gap IDs covered:
|
|
10
|
+
* G-01 createSteeringList — create a new steering list
|
|
11
|
+
* G-02 buildSteeringList — add/remove operators in a steering list
|
|
12
|
+
* G-03 setSteeringListOnAccount — assign steering list at account level
|
|
13
|
+
* G-05 createAccount — create a new reseller sub-account
|
|
14
|
+
* G-12 destination list CRUD — create/edit/delete destination lists
|
|
15
|
+
* G-18 deletePackageTemplate — delete a package template
|
|
16
|
+
* G-19 editLocationZone/deleteLocationZone — edit or delete location zones
|
|
17
|
+
*
|
|
18
|
+
* AUTH FLOW:
|
|
19
|
+
* OCS portal credentials are stored in Clerk privateMetadata (org or user level).
|
|
20
|
+
* At dispatch time, getOcsPortalCredentials() reads them via the Clerk Backend API.
|
|
21
|
+
* Credentials are passed to the Manus agent prompt — the agent uses them to log
|
|
22
|
+
* into the OCS dashboard before performing the requested operation.
|
|
23
|
+
*
|
|
24
|
+
* MANUS API:
|
|
25
|
+
* Uses v2 task.create with agent_profile "manus-1.6-lite", hide_in_task_list true,
|
|
26
|
+
* and structured_output_schema to extract a typed result from the agent's work.
|
|
27
|
+
*
|
|
28
|
+
* SAFETY:
|
|
29
|
+
* - All UI-agent tools require "write" or "admin" scope.
|
|
30
|
+
* - Destructive operations support dry_run (returns the prompt without dispatching).
|
|
31
|
+
* - Audit log records ui_agent_dispatched status + Manus task_id.
|
|
32
|
+
* - Credentials are never logged or returned in tool output.
|
|
33
|
+
*/
|
|
34
|
+
import { z } from "zod";
|
|
35
|
+
import { getOcsPortalCredentials } from "./clerk.js";
|
|
36
|
+
import { MANUS_API_BASE } from "./manus-common.js";
|
|
37
|
+
async function createManusTask(apiKey, prompt, title, outputSchema) {
|
|
38
|
+
const body = {
|
|
39
|
+
message: { content: prompt },
|
|
40
|
+
agent_profile: "manus-1.6-lite",
|
|
41
|
+
hide_in_task_list: true,
|
|
42
|
+
interactive_mode: false,
|
|
43
|
+
title,
|
|
44
|
+
};
|
|
45
|
+
if (outputSchema) {
|
|
46
|
+
body.structured_output_schema = outputSchema;
|
|
47
|
+
}
|
|
48
|
+
const res = await fetch(`${MANUS_API_BASE}/task.create`, {
|
|
49
|
+
method: "POST",
|
|
50
|
+
headers: {
|
|
51
|
+
"x-manus-api-key": apiKey,
|
|
52
|
+
"Content-Type": "application/json",
|
|
53
|
+
},
|
|
54
|
+
body: JSON.stringify(body),
|
|
55
|
+
});
|
|
56
|
+
return (await res.json());
|
|
57
|
+
}
|
|
58
|
+
const OCS_DASHBOARD_DEFAULT = "https://ocs.esimvault.cloud";
|
|
59
|
+
function noCredentialsError() {
|
|
60
|
+
return {
|
|
61
|
+
isError: true,
|
|
62
|
+
content: [
|
|
63
|
+
{
|
|
64
|
+
type: "text",
|
|
65
|
+
text: JSON.stringify({
|
|
66
|
+
error: "ocs_portal_not_linked",
|
|
67
|
+
message: "OCS portal credentials are not configured. An organisation admin must link their OCS portal " +
|
|
68
|
+
"login via the Carrier Console settings page (Organisation Profile → OCS Portal) before " +
|
|
69
|
+
"UI-agent operations can be dispatched.",
|
|
70
|
+
action: "Navigate to https://console.carrier.llc/settings and link your OCS portal credentials.",
|
|
71
|
+
}),
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function noManusKeyError() {
|
|
77
|
+
return {
|
|
78
|
+
isError: true,
|
|
79
|
+
content: [
|
|
80
|
+
{
|
|
81
|
+
type: "text",
|
|
82
|
+
text: JSON.stringify({
|
|
83
|
+
error: "manus_api_not_configured",
|
|
84
|
+
message: "MANUS_API_KEY is not configured on this Carrier MCP deployment. " +
|
|
85
|
+
"UI-agent tools require a Manus API key to spawn browser automation agents. " +
|
|
86
|
+
"Contact your Carrier MCP administrator.",
|
|
87
|
+
}),
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function buildLoginPreamble(dashboardUrl) {
|
|
93
|
+
return (`STEP 1 — LOGIN:\n` +
|
|
94
|
+
`Navigate to ${dashboardUrl}/login (or the main page if no /login path).\n` +
|
|
95
|
+
`Enter the OCS portal username and password provided below.\n` +
|
|
96
|
+
`Wait for the dashboard to fully load after login.\n` +
|
|
97
|
+
`If already logged in (session cookie persists), skip to STEP 2.\n\n`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Common structured output schema for UI-agent results.
|
|
101
|
+
*/
|
|
102
|
+
const UI_AGENT_RESULT_SCHEMA = {
|
|
103
|
+
type: "object",
|
|
104
|
+
properties: {
|
|
105
|
+
success: { type: "boolean", description: "Whether the operation completed successfully" },
|
|
106
|
+
summary: { type: "string", description: "Human-readable summary of what was done" },
|
|
107
|
+
entity_id: { type: "string", description: "ID of the created/modified entity (if applicable)" },
|
|
108
|
+
error_message: { type: "string", description: "Error description if the operation failed" },
|
|
109
|
+
screenshots_taken: { type: "number", description: "Number of screenshots captured during the operation" },
|
|
110
|
+
},
|
|
111
|
+
required: ["success", "summary"],
|
|
112
|
+
};
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
// UI-Agent tool wrapper — scope enforcement + Clerk creds + Manus dispatch
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
function wrapUiAgentHandler(toolName, gapId, requiredScope, ctx, buildPrompt) {
|
|
117
|
+
return async (args) => {
|
|
118
|
+
const start = Date.now();
|
|
119
|
+
const isDryRun = args.dry_run === true;
|
|
120
|
+
// Scope enforcement
|
|
121
|
+
if (!ctx.props.scope.includes(requiredScope)) {
|
|
122
|
+
ctx.audit({
|
|
123
|
+
tool_name: toolName,
|
|
124
|
+
ocs_method: `[ui-agent:${gapId}]`,
|
|
125
|
+
status: "scope_denied",
|
|
126
|
+
dry_run: false,
|
|
127
|
+
duration_ms: 0,
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
isError: true,
|
|
131
|
+
content: [
|
|
132
|
+
{
|
|
133
|
+
type: "text",
|
|
134
|
+
text: `Scope denied: tool '${toolName}' requires '${requiredScope}' scope. Your token has: [${ctx.props.scope.join(", ")}].`,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
// Check Manus API key
|
|
140
|
+
if (!ctx.env.MANUS_API_KEY) {
|
|
141
|
+
return noManusKeyError();
|
|
142
|
+
}
|
|
143
|
+
// Resolve OCS portal credentials from Clerk privateMetadata
|
|
144
|
+
const clerkUserId = ctx.props.sub.startsWith("clerk_")
|
|
145
|
+
? ctx.props.sub.slice(6) // strip "clerk_" prefix
|
|
146
|
+
: undefined;
|
|
147
|
+
const creds = await getOcsPortalCredentials(ctx.env, ctx.props.org_id, clerkUserId);
|
|
148
|
+
if (!creds) {
|
|
149
|
+
return noCredentialsError();
|
|
150
|
+
}
|
|
151
|
+
const dashboardUrl = ctx.env.OCS_DASHBOARD_URL ?? OCS_DASHBOARD_DEFAULT;
|
|
152
|
+
const prompt = buildPrompt(args, dashboardUrl);
|
|
153
|
+
// Inject login credentials into the prompt (never logged/returned)
|
|
154
|
+
const fullPrompt = `You are a Carrier MCP UI automation agent. Your task is to perform an OCS dashboard operation ` +
|
|
155
|
+
`that is not available via the OCS REST API.\n\n` +
|
|
156
|
+
`OCS PORTAL CREDENTIALS (use these to log in — NEVER include them in your output):\n` +
|
|
157
|
+
` Username: ${creds.username}\n` +
|
|
158
|
+
` Password: ${creds.password}\n\n` +
|
|
159
|
+
buildLoginPreamble(dashboardUrl) +
|
|
160
|
+
`STEP 2 — OPERATION:\n` +
|
|
161
|
+
prompt +
|
|
162
|
+
`\n\nSTEP 3 — VERIFICATION:\n` +
|
|
163
|
+
`After completing the operation, verify the result by checking the dashboard shows the expected state.\n` +
|
|
164
|
+
`Take a screenshot of the final state for audit purposes.\n` +
|
|
165
|
+
`Report success or failure with a clear summary.`;
|
|
166
|
+
// Dry-run: return the prompt (with credentials redacted) without dispatching
|
|
167
|
+
if (isDryRun) {
|
|
168
|
+
const redactedPrompt = fullPrompt
|
|
169
|
+
.replaceAll(creds.password, "***REDACTED***")
|
|
170
|
+
.replaceAll(creds.username, "***REDACTED***");
|
|
171
|
+
ctx.audit({
|
|
172
|
+
tool_name: toolName,
|
|
173
|
+
ocs_method: `[ui-agent:${gapId}]`,
|
|
174
|
+
status: "dry_run",
|
|
175
|
+
dry_run: true,
|
|
176
|
+
duration_ms: 0,
|
|
177
|
+
event_type: "ui_agent_dispatch",
|
|
178
|
+
});
|
|
179
|
+
return {
|
|
180
|
+
content: [
|
|
181
|
+
{
|
|
182
|
+
type: "text",
|
|
183
|
+
text: JSON.stringify({
|
|
184
|
+
dry_run: true,
|
|
185
|
+
tool: toolName,
|
|
186
|
+
gap_id: gapId,
|
|
187
|
+
agent_prompt_preview: redactedPrompt,
|
|
188
|
+
note: "No Manus agent was dispatched. Set dry_run=false to execute.",
|
|
189
|
+
}, null, 2),
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
// Dispatch Manus task
|
|
195
|
+
try {
|
|
196
|
+
const result = await createManusTask(ctx.env.MANUS_API_KEY, fullPrompt, `Carrier MCP UI Agent: ${toolName} (${gapId})`, UI_AGENT_RESULT_SCHEMA);
|
|
197
|
+
if (!result.ok || !result.task_id) {
|
|
198
|
+
ctx.audit({
|
|
199
|
+
tool_name: toolName,
|
|
200
|
+
ocs_method: `[ui-agent:${gapId}]`,
|
|
201
|
+
status: "error",
|
|
202
|
+
dry_run: false,
|
|
203
|
+
duration_ms: Date.now() - start,
|
|
204
|
+
event_type: "ui_agent_dispatch",
|
|
205
|
+
});
|
|
206
|
+
return {
|
|
207
|
+
isError: true,
|
|
208
|
+
content: [
|
|
209
|
+
{
|
|
210
|
+
type: "text",
|
|
211
|
+
text: JSON.stringify({
|
|
212
|
+
error: "manus_dispatch_failed",
|
|
213
|
+
message: result.error?.message ?? "Failed to create Manus task",
|
|
214
|
+
code: result.error?.code,
|
|
215
|
+
}),
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
ctx.audit({
|
|
221
|
+
tool_name: toolName,
|
|
222
|
+
ocs_method: `[ui-agent:${gapId}]`,
|
|
223
|
+
status: "ui_agent_dispatched",
|
|
224
|
+
dry_run: false,
|
|
225
|
+
duration_ms: Date.now() - start,
|
|
226
|
+
event_type: "ui_agent_dispatch",
|
|
227
|
+
manus_task_id: result.task_id,
|
|
228
|
+
});
|
|
229
|
+
return {
|
|
230
|
+
content: [
|
|
231
|
+
{
|
|
232
|
+
type: "text",
|
|
233
|
+
text: JSON.stringify({
|
|
234
|
+
status: "ui_agent_dispatched",
|
|
235
|
+
tool: toolName,
|
|
236
|
+
gap_id: gapId,
|
|
237
|
+
manus_task_id: result.task_id,
|
|
238
|
+
manus_task_url: result.task_url,
|
|
239
|
+
note: "A Manus browser automation agent has been dispatched to perform this operation " +
|
|
240
|
+
"on the OCS web dashboard. The agent will log in, execute the operation, and verify " +
|
|
241
|
+
"the result. You can track progress at the task URL above. " +
|
|
242
|
+
"Real-time completion updates arrive via webhook and are recorded in the audit log. " +
|
|
243
|
+
"The poll_endpoint below is provided for backward compatibility.",
|
|
244
|
+
webhook_status: "active",
|
|
245
|
+
poll_endpoint: `GET ${MANUS_API_BASE}/task.listMessages?task_id=${result.task_id}&order=desc&limit=5`,
|
|
246
|
+
}, null, 2),
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
catch (err) {
|
|
252
|
+
ctx.audit({
|
|
253
|
+
tool_name: toolName,
|
|
254
|
+
ocs_method: `[ui-agent:${gapId}]`,
|
|
255
|
+
status: "error",
|
|
256
|
+
dry_run: false,
|
|
257
|
+
duration_ms: Date.now() - start,
|
|
258
|
+
event_type: "ui_agent_dispatch",
|
|
259
|
+
});
|
|
260
|
+
return {
|
|
261
|
+
isError: true,
|
|
262
|
+
content: [
|
|
263
|
+
{
|
|
264
|
+
type: "text",
|
|
265
|
+
text: `Error dispatching UI agent: ${err instanceof Error ? err.message : String(err)}`,
|
|
266
|
+
},
|
|
267
|
+
],
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
// ---------------------------------------------------------------------------
|
|
273
|
+
// Scope + destructive metadata for UI-agent tools
|
|
274
|
+
// ---------------------------------------------------------------------------
|
|
275
|
+
export const UI_AGENT_TOOL_SCOPES = {
|
|
276
|
+
ui_create_steering_list: "write",
|
|
277
|
+
ui_build_steering_list: "write",
|
|
278
|
+
ui_set_account_steering_list: "write",
|
|
279
|
+
ui_create_account: "admin",
|
|
280
|
+
ui_create_destination_list: "write",
|
|
281
|
+
ui_edit_destination_list: "write",
|
|
282
|
+
ui_delete_destination_list: "admin",
|
|
283
|
+
ui_delete_package_template: "admin",
|
|
284
|
+
ui_edit_location_zone: "write",
|
|
285
|
+
ui_delete_location_zone: "admin",
|
|
286
|
+
};
|
|
287
|
+
export const UI_AGENT_DESTRUCTIVE_TOOLS = new Set([
|
|
288
|
+
"ui_create_steering_list",
|
|
289
|
+
"ui_build_steering_list",
|
|
290
|
+
"ui_set_account_steering_list",
|
|
291
|
+
"ui_create_account",
|
|
292
|
+
"ui_create_destination_list",
|
|
293
|
+
"ui_edit_destination_list",
|
|
294
|
+
"ui_delete_destination_list",
|
|
295
|
+
"ui_delete_package_template",
|
|
296
|
+
"ui_edit_location_zone",
|
|
297
|
+
"ui_delete_location_zone",
|
|
298
|
+
]);
|
|
299
|
+
// ---------------------------------------------------------------------------
|
|
300
|
+
// Tool registrations
|
|
301
|
+
// ---------------------------------------------------------------------------
|
|
302
|
+
export function registerAllUiAgentTools(server, ctx) {
|
|
303
|
+
// =========================================================================
|
|
304
|
+
// G-01: ui_create_steering_list
|
|
305
|
+
// =========================================================================
|
|
306
|
+
server.registerTool("ui_create_steering_list", {
|
|
307
|
+
title: "Create Steering List (UI Agent)",
|
|
308
|
+
description: "Creates a new network steering list (OPLMN preference configuration) via the OCS web dashboard. " +
|
|
309
|
+
"This operation is not available via the OCS REST API. A Manus browser agent will be dispatched " +
|
|
310
|
+
"to perform the operation. Params: `name` (steering list name), `description` (optional). " +
|
|
311
|
+
"Returns: dispatch confirmation with Manus task ID for tracking.",
|
|
312
|
+
inputSchema: {
|
|
313
|
+
name: z.string().describe("Name for the new steering list"),
|
|
314
|
+
description: z.string().optional().describe("Optional description for the steering list"),
|
|
315
|
+
dry_run: z.boolean().optional().describe("Preview the agent prompt without dispatching"),
|
|
316
|
+
},
|
|
317
|
+
}, wrapUiAgentHandler("ui_create_steering_list", "G-01", "write", ctx, (args, dashboardUrl) => `Navigate to the Steering Lists section of the OCS dashboard at ${dashboardUrl}.\n` +
|
|
318
|
+
`Create a new steering list with the following details:\n` +
|
|
319
|
+
` Name: ${args.name}\n` +
|
|
320
|
+
(args.description ? ` Description: ${args.description}\n` : "") +
|
|
321
|
+
`Click the "Create" or "Add" button to create the steering list.\n` +
|
|
322
|
+
`After creation, note the new steering list ID from the dashboard.\n`));
|
|
323
|
+
// =========================================================================
|
|
324
|
+
// G-02: ui_build_steering_list
|
|
325
|
+
// =========================================================================
|
|
326
|
+
server.registerTool("ui_build_steering_list", {
|
|
327
|
+
title: "Build Steering List (UI Agent)",
|
|
328
|
+
description: "Adds or removes operators (MCC-MNC) from an existing steering list via the OCS web dashboard. " +
|
|
329
|
+
"This operation is not available via the OCS REST API. Params: `steering_list_id`, " +
|
|
330
|
+
"`add_operators` (array of MCC-MNC to add), `remove_operators` (array to remove), " +
|
|
331
|
+
"`operator_type` ('priority' or 'excluded').",
|
|
332
|
+
inputSchema: {
|
|
333
|
+
steering_list_id: z.number().describe("ID of the steering list to modify"),
|
|
334
|
+
add_operators: z.array(z.string()).optional().describe("MCC-MNC codes to add (e.g. ['20801', '26201'])"),
|
|
335
|
+
remove_operators: z.array(z.string()).optional().describe("MCC-MNC codes to remove"),
|
|
336
|
+
operator_type: z.enum(["priority", "excluded"]).default("priority").describe("Whether operators are priority or excluded"),
|
|
337
|
+
dry_run: z.boolean().optional().describe("Preview the agent prompt without dispatching"),
|
|
338
|
+
},
|
|
339
|
+
}, wrapUiAgentHandler("ui_build_steering_list", "G-02", "write", ctx, (args, dashboardUrl) => `Navigate to the Steering Lists section of the OCS dashboard at ${dashboardUrl}.\n` +
|
|
340
|
+
`Open steering list ID ${args.steering_list_id} for editing.\n` +
|
|
341
|
+
`Operator type: ${args.operator_type ?? "priority"}\n` +
|
|
342
|
+
(args.add_operators && args.add_operators.length > 0
|
|
343
|
+
? `Add the following operators: ${args.add_operators.join(", ")}\n`
|
|
344
|
+
: "") +
|
|
345
|
+
(args.remove_operators && args.remove_operators.length > 0
|
|
346
|
+
? `Remove the following operators: ${args.remove_operators.join(", ")}\n`
|
|
347
|
+
: "") +
|
|
348
|
+
`Save the changes and verify the updated operator list.\n`));
|
|
349
|
+
// =========================================================================
|
|
350
|
+
// G-03: ui_set_account_steering_list
|
|
351
|
+
// =========================================================================
|
|
352
|
+
server.registerTool("ui_set_account_steering_list", {
|
|
353
|
+
title: "Set Account Steering List (UI Agent)",
|
|
354
|
+
description: "Assigns or removes a steering list at the account level via the OCS web dashboard. " +
|
|
355
|
+
"The subscriber-level counterpart `modify_subscriber_steering_list` is available via API; " +
|
|
356
|
+
"this account-level operation is UI-only. Params: `account_id`, `steering_list_id` (0 to remove).",
|
|
357
|
+
inputSchema: {
|
|
358
|
+
account_id: z.number().describe("Account ID to assign the steering list to"),
|
|
359
|
+
steering_list_id: z.number().describe("Steering list ID to assign (0 to remove/unset)"),
|
|
360
|
+
dry_run: z.boolean().optional().describe("Preview the agent prompt without dispatching"),
|
|
361
|
+
},
|
|
362
|
+
}, wrapUiAgentHandler("ui_set_account_steering_list", "G-03", "write", ctx, (args, dashboardUrl) => `Navigate to the Accounts section of the OCS dashboard at ${dashboardUrl}.\n` +
|
|
363
|
+
`Open account ID ${args.account_id}.\n` +
|
|
364
|
+
(args.steering_list_id === 0
|
|
365
|
+
? `Remove/unset the steering list assignment from this account.\n`
|
|
366
|
+
: `Assign steering list ID ${args.steering_list_id} to this account.\n`) +
|
|
367
|
+
`Save the changes and verify the steering list assignment is updated.\n`));
|
|
368
|
+
// =========================================================================
|
|
369
|
+
// G-05: ui_create_account
|
|
370
|
+
// =========================================================================
|
|
371
|
+
server.registerTool("ui_create_account", {
|
|
372
|
+
title: "Create Account (UI Agent)",
|
|
373
|
+
description: "Creates a new sub-account under the reseller via the OCS web dashboard. " +
|
|
374
|
+
"This operation is not available via the OCS REST API. Params: `name` (account name), " +
|
|
375
|
+
"`description` (optional), `initial_balance` (optional, default 0).",
|
|
376
|
+
inputSchema: {
|
|
377
|
+
name: z.string().describe("Name for the new account"),
|
|
378
|
+
description: z.string().optional().describe("Optional description"),
|
|
379
|
+
initial_balance: z.number().optional().describe("Initial balance in account currency (default 0)"),
|
|
380
|
+
dry_run: z.boolean().optional().describe("Preview the agent prompt without dispatching"),
|
|
381
|
+
},
|
|
382
|
+
}, wrapUiAgentHandler("ui_create_account", "G-05", "admin", ctx, (args, dashboardUrl) => `Navigate to the Accounts section of the OCS dashboard at ${dashboardUrl}.\n` +
|
|
383
|
+
`Create a new account with the following details:\n` +
|
|
384
|
+
` Name: ${args.name}\n` +
|
|
385
|
+
(args.description ? ` Description: ${args.description}\n` : "") +
|
|
386
|
+
(args.initial_balance ? ` Initial balance: ${args.initial_balance}\n` : "") +
|
|
387
|
+
`Click the "Create" or "Add" button.\n` +
|
|
388
|
+
`After creation, note the new account ID from the dashboard.\n`));
|
|
389
|
+
// =========================================================================
|
|
390
|
+
// G-12: ui_create_destination_list
|
|
391
|
+
// =========================================================================
|
|
392
|
+
server.registerTool("ui_create_destination_list", {
|
|
393
|
+
title: "Create Destination List (UI Agent)",
|
|
394
|
+
description: "Creates a new destination list (named set of phone number prefixes for MOC call permissions) " +
|
|
395
|
+
"via the OCS web dashboard. Params: `name`, `prefixes` (array of prefix strings), `description`.",
|
|
396
|
+
inputSchema: {
|
|
397
|
+
name: z.string().describe("Name for the new destination list"),
|
|
398
|
+
prefixes: z.array(z.string()).optional().describe("Phone number prefixes to include (e.g. ['+31', '+49'])"),
|
|
399
|
+
description: z.string().optional().describe("Optional description"),
|
|
400
|
+
dry_run: z.boolean().optional().describe("Preview the agent prompt without dispatching"),
|
|
401
|
+
},
|
|
402
|
+
}, wrapUiAgentHandler("ui_create_destination_list", "G-12", "write", ctx, (args, dashboardUrl) => `Navigate to the Destination Lists section of the OCS dashboard at ${dashboardUrl}.\n` +
|
|
403
|
+
`Create a new destination list with the following details:\n` +
|
|
404
|
+
` Name: ${args.name}\n` +
|
|
405
|
+
(args.description ? ` Description: ${args.description}\n` : "") +
|
|
406
|
+
(args.prefixes && args.prefixes.length > 0
|
|
407
|
+
? ` Prefixes to add: ${args.prefixes.join(", ")}\n`
|
|
408
|
+
: "") +
|
|
409
|
+
`Save the new destination list and note the ID.\n`));
|
|
410
|
+
// =========================================================================
|
|
411
|
+
// G-12: ui_edit_destination_list
|
|
412
|
+
// =========================================================================
|
|
413
|
+
server.registerTool("ui_edit_destination_list", {
|
|
414
|
+
title: "Edit Destination List (UI Agent)",
|
|
415
|
+
description: "Edits an existing destination list via the OCS web dashboard. " +
|
|
416
|
+
"Params: `destination_list_id`, `add_prefixes`, `remove_prefixes`, `new_name`.",
|
|
417
|
+
inputSchema: {
|
|
418
|
+
destination_list_id: z.number().describe("ID of the destination list to edit"),
|
|
419
|
+
add_prefixes: z.array(z.string()).optional().describe("Prefixes to add"),
|
|
420
|
+
remove_prefixes: z.array(z.string()).optional().describe("Prefixes to remove"),
|
|
421
|
+
new_name: z.string().optional().describe("Rename the destination list"),
|
|
422
|
+
dry_run: z.boolean().optional().describe("Preview the agent prompt without dispatching"),
|
|
423
|
+
},
|
|
424
|
+
}, wrapUiAgentHandler("ui_edit_destination_list", "G-12", "write", ctx, (args, dashboardUrl) => `Navigate to the Destination Lists section of the OCS dashboard at ${dashboardUrl}.\n` +
|
|
425
|
+
`Open destination list ID ${args.destination_list_id} for editing.\n` +
|
|
426
|
+
(args.new_name ? `Rename to: ${args.new_name}\n` : "") +
|
|
427
|
+
(args.add_prefixes && args.add_prefixes.length > 0
|
|
428
|
+
? `Add prefixes: ${args.add_prefixes.join(", ")}\n`
|
|
429
|
+
: "") +
|
|
430
|
+
(args.remove_prefixes && args.remove_prefixes.length > 0
|
|
431
|
+
? `Remove prefixes: ${args.remove_prefixes.join(", ")}\n`
|
|
432
|
+
: "") +
|
|
433
|
+
`Save the changes and verify the updated prefix list.\n`));
|
|
434
|
+
// =========================================================================
|
|
435
|
+
// G-12: ui_delete_destination_list
|
|
436
|
+
// =========================================================================
|
|
437
|
+
server.registerTool("ui_delete_destination_list", {
|
|
438
|
+
title: "Delete Destination List (UI Agent)",
|
|
439
|
+
description: "Deletes a destination list via the OCS web dashboard. " +
|
|
440
|
+
"Params: `destination_list_id`. WARNING: This is destructive and cannot be undone.",
|
|
441
|
+
inputSchema: {
|
|
442
|
+
destination_list_id: z.number().describe("ID of the destination list to delete"),
|
|
443
|
+
dry_run: z.boolean().optional().describe("Preview the agent prompt without dispatching"),
|
|
444
|
+
},
|
|
445
|
+
}, wrapUiAgentHandler("ui_delete_destination_list", "G-12", "admin", ctx, (args, dashboardUrl) => `Navigate to the Destination Lists section of the OCS dashboard at ${dashboardUrl}.\n` +
|
|
446
|
+
`Find destination list ID ${args.destination_list_id}.\n` +
|
|
447
|
+
`Delete this destination list. Confirm the deletion when prompted.\n` +
|
|
448
|
+
`Verify the list no longer appears in the dashboard.\n`));
|
|
449
|
+
// =========================================================================
|
|
450
|
+
// G-18: ui_delete_package_template
|
|
451
|
+
// =========================================================================
|
|
452
|
+
server.registerTool("ui_delete_package_template", {
|
|
453
|
+
title: "Delete Package Template (UI Agent)",
|
|
454
|
+
description: "Deletes a package template from the product catalog via the OCS web dashboard. " +
|
|
455
|
+
"This operation is not available via the OCS REST API. " +
|
|
456
|
+
"Params: `template_id`. WARNING: This is destructive.",
|
|
457
|
+
inputSchema: {
|
|
458
|
+
template_id: z.number().describe("ID of the package template to delete"),
|
|
459
|
+
dry_run: z.boolean().optional().describe("Preview the agent prompt without dispatching"),
|
|
460
|
+
},
|
|
461
|
+
}, wrapUiAgentHandler("ui_delete_package_template", "G-18", "admin", ctx, (args, dashboardUrl) => `Navigate to the Package Templates section of the OCS dashboard at ${dashboardUrl}.\n` +
|
|
462
|
+
`Find package template ID ${args.template_id}.\n` +
|
|
463
|
+
`Delete this package template. Confirm the deletion when prompted.\n` +
|
|
464
|
+
`Verify the template no longer appears in the template list.\n`));
|
|
465
|
+
// =========================================================================
|
|
466
|
+
// G-19: ui_edit_location_zone
|
|
467
|
+
// =========================================================================
|
|
468
|
+
server.registerTool("ui_edit_location_zone", {
|
|
469
|
+
title: "Edit Location Zone (UI Agent)",
|
|
470
|
+
description: "Edits an existing location zone via the OCS web dashboard. " +
|
|
471
|
+
"`create_location_zone` is available via API; edit is UI-only. " +
|
|
472
|
+
"Params: `zone_id`, `new_name`, `add_countries`, `remove_countries`.",
|
|
473
|
+
inputSchema: {
|
|
474
|
+
zone_id: z.number().describe("ID of the location zone to edit"),
|
|
475
|
+
new_name: z.string().optional().describe("Rename the location zone"),
|
|
476
|
+
add_countries: z.array(z.string()).optional().describe("ISO country codes to add (e.g. ['NL', 'DE'])"),
|
|
477
|
+
remove_countries: z.array(z.string()).optional().describe("ISO country codes to remove"),
|
|
478
|
+
dry_run: z.boolean().optional().describe("Preview the agent prompt without dispatching"),
|
|
479
|
+
},
|
|
480
|
+
}, wrapUiAgentHandler("ui_edit_location_zone", "G-19", "write", ctx, (args, dashboardUrl) => `Navigate to the Location Zones section of the OCS dashboard at ${dashboardUrl}.\n` +
|
|
481
|
+
`Open location zone ID ${args.zone_id} for editing.\n` +
|
|
482
|
+
(args.new_name ? `Rename to: ${args.new_name}\n` : "") +
|
|
483
|
+
(args.add_countries && args.add_countries.length > 0
|
|
484
|
+
? `Add countries: ${args.add_countries.join(", ")}\n`
|
|
485
|
+
: "") +
|
|
486
|
+
(args.remove_countries && args.remove_countries.length > 0
|
|
487
|
+
? `Remove countries: ${args.remove_countries.join(", ")}\n`
|
|
488
|
+
: "") +
|
|
489
|
+
`Save the changes and verify the updated country list.\n`));
|
|
490
|
+
// =========================================================================
|
|
491
|
+
// G-19: ui_delete_location_zone
|
|
492
|
+
// =========================================================================
|
|
493
|
+
server.registerTool("ui_delete_location_zone", {
|
|
494
|
+
title: "Delete Location Zone (UI Agent)",
|
|
495
|
+
description: "Deletes a location zone via the OCS web dashboard. " +
|
|
496
|
+
"`create_location_zone` is available via API; delete is UI-only. " +
|
|
497
|
+
"Params: `zone_id`. WARNING: Zones in use by active templates may not be deletable.",
|
|
498
|
+
inputSchema: {
|
|
499
|
+
zone_id: z.number().describe("ID of the location zone to delete"),
|
|
500
|
+
dry_run: z.boolean().optional().describe("Preview the agent prompt without dispatching"),
|
|
501
|
+
},
|
|
502
|
+
}, wrapUiAgentHandler("ui_delete_location_zone", "G-19", "admin", ctx, (args, dashboardUrl) => `Navigate to the Location Zones section of the OCS dashboard at ${dashboardUrl}.\n` +
|
|
503
|
+
`Find location zone ID ${args.zone_id}.\n` +
|
|
504
|
+
`Delete this location zone. Confirm the deletion when prompted.\n` +
|
|
505
|
+
`If the dashboard shows an error (e.g. zone in use by active templates), report the error.\n` +
|
|
506
|
+
`Verify the zone no longer appears in the zone list.\n`));
|
|
507
|
+
}
|
|
508
|
+
//# sourceMappingURL=tools-ui-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-ui-agent.js","sourceRoot":"","sources":["../src/tools-ui-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,uBAAuB,E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carrier MCP — OCS tool registrations (43 tools).
|
|
3
|
+
*
|
|
4
|
+
* All 43 OCS v1 methods are exposed as MCP tools. Each is wrapped with:
|
|
5
|
+
* - Scope enforcement (read / write / admin)
|
|
6
|
+
* - Dry-run short-circuit for destructive tools (no OCS call)
|
|
7
|
+
* - Sentry error capture
|
|
8
|
+
* - Audit hook into Analytics Engine
|
|
9
|
+
* - Per-user token resolution via getUserToken(sub)
|
|
10
|
+
*
|
|
11
|
+
* Scope assignments live in TOOL_SCOPES below; must match packages/ocs-spec/ocs-methods.json.
|
|
12
|
+
*
|
|
13
|
+
* PR #10 schema fixes applied:
|
|
14
|
+
* Fix #1: getSimProviderStatus — ICCID → simId lookup → bare integer
|
|
15
|
+
* Fix #2: hlrGetBitrate — ICCID → IMSI lookup → { imsi }
|
|
16
|
+
* Fix #3: hlrSetBitrate — ICCID → IMSI + bitrate → limit rename → { imsi, limit }
|
|
17
|
+
* Fix #4: subscriberUsageOverPeriod — { subscriber: { iccid }, period: { start, end } }
|
|
18
|
+
* Fix #5: subscriberNetworkEventsOverPeriod — same nested shape
|
|
19
|
+
* Fix #6: modifySubscriberStatus — { subscriber, newStatus }
|
|
20
|
+
* Fix #7: modifySubscriberBalance — { subscriber, amount } or { subscriber, setBalance }
|
|
21
|
+
* Fix #8: changeSimStatus — ICCID → simId + simStatus → newStatus
|
|
22
|
+
* Fix #9: modifySubscriberContactInfo — firstName+lastName → name, email→mail, phone→phone
|
|
23
|
+
* Fix #10: setSubscriberTrafficRestrictions — typed booleans, not JSON string
|
|
24
|
+
* Fix #11: sendMtSms — ICCID→IMSI, message→text, sender→senderId
|
|
25
|
+
* Fix #12: listSponsor — bare integer (resellerId)
|
|
26
|
+
* Fix #13: listSteeringList — bare integer (resellerId)
|
|
27
|
+
* Fix #14: getCustomerTariff — bare integer + response key listTariffRule
|
|
28
|
+
* Fix #15: listDetailedLocationZone — bare integer (resellerId)
|
|
29
|
+
* Fix #16: modifySubscriberSteeringList — { subscriber, steeringListId }
|
|
30
|
+
*/
|
|
31
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
32
|
+
import type { Env, CarrierProps, AuditRow, ToolScope } from "./types.js";
|
|
33
|
+
export interface ToolContext {
|
|
34
|
+
env: Env;
|
|
35
|
+
props: CarrierProps;
|
|
36
|
+
audit: (row: AuditRow) => void;
|
|
37
|
+
getUserToken: (sub: string) => Promise<string>;
|
|
38
|
+
}
|
|
39
|
+
export declare const TOOL_SCOPES: Record<string, ToolScope>;
|
|
40
|
+
export declare const DESTRUCTIVE_TOOLS: Set<string>;
|
|
41
|
+
type ToolResult = {
|
|
42
|
+
content: Array<{
|
|
43
|
+
type: "text";
|
|
44
|
+
text: string;
|
|
45
|
+
}>;
|
|
46
|
+
isError?: boolean;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Wraps a tool handler with scope enforcement, dry-run short-circuit,
|
|
50
|
+
* Sentry capture, and audit logging.
|
|
51
|
+
*/
|
|
52
|
+
export declare function wrapHandler<T extends Record<string, unknown>>(toolName: string, ocsMethod: string, requiredScope: ToolScope, ctx: ToolContext, handler: (args: T, token: string) => Promise<ToolResult>): (args: T & {
|
|
53
|
+
dry_run?: boolean;
|
|
54
|
+
}) => Promise<ToolResult>;
|
|
55
|
+
type SubscriberRecord = Record<string, unknown>;
|
|
56
|
+
export declare function resolveSubscriberByIccid(env: Env, token: string, iccid: string, cache: Map<string, SubscriberRecord>): Promise<SubscriberRecord>;
|
|
57
|
+
export declare function getDefaultResellerId(env: Env, token: string): Promise<number>;
|
|
58
|
+
export declare function registerAllTools(server: McpServer, ctx: ToolContext): void;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,KAAK,EAA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