@robinmordasiewicz/f5xc-api-mcp 3.11.0 → 3.12.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/dist/server.d.ts.map +1 -1
- package/dist/server.js +187 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/discovery/best-practices.d.ts +140 -0
- package/dist/tools/discovery/best-practices.d.ts.map +1 -0
- package/dist/tools/discovery/best-practices.js +499 -0
- package/dist/tools/discovery/best-practices.js.map +1 -0
- package/dist/tools/discovery/cost-estimator.d.ts +114 -0
- package/dist/tools/discovery/cost-estimator.d.ts.map +1 -0
- package/dist/tools/discovery/cost-estimator.js +273 -0
- package/dist/tools/discovery/cost-estimator.js.map +1 -0
- package/dist/tools/discovery/index.d.ts +99 -0
- package/dist/tools/discovery/index.d.ts.map +1 -1
- package/dist/tools/discovery/index.js +99 -0
- package/dist/tools/discovery/index.js.map +1 -1
- package/dist/tools/discovery/resolver.d.ts +119 -0
- package/dist/tools/discovery/resolver.d.ts.map +1 -0
- package/dist/tools/discovery/resolver.js +369 -0
- package/dist/tools/discovery/resolver.js.map +1 -0
- package/dist/tools/generated/dependency-graph.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cost and Performance Estimation
|
|
3
|
+
*
|
|
4
|
+
* Provides token usage estimates, latency expectations, and
|
|
5
|
+
* workflow cost aggregation for F5XC API operations.
|
|
6
|
+
*/
|
|
7
|
+
import { getToolByName } from "../registry.js";
|
|
8
|
+
import { toolExists } from "./index-loader.js";
|
|
9
|
+
/**
|
|
10
|
+
* Latency level to milliseconds mapping
|
|
11
|
+
*/
|
|
12
|
+
const LATENCY_MS_MAP = {
|
|
13
|
+
low: 500,
|
|
14
|
+
moderate: 2000,
|
|
15
|
+
high: 5000,
|
|
16
|
+
unknown: 1500,
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Latency level descriptions
|
|
20
|
+
*/
|
|
21
|
+
const LATENCY_DESCRIPTIONS = {
|
|
22
|
+
low: "Fast operation, typically completes in under 1 second",
|
|
23
|
+
moderate: "Standard operation, may take 1-3 seconds",
|
|
24
|
+
high: "Complex operation, may take 3-10 seconds or involve async processing",
|
|
25
|
+
unknown: "Latency not specified, estimate based on operation type",
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Estimate token count for a string (rough approximation)
|
|
29
|
+
*/
|
|
30
|
+
function estimateTokens(text) {
|
|
31
|
+
// Rough approximation: 1 token per 4 characters for English text
|
|
32
|
+
// JSON tends to be more verbose, so use 1 token per 3.5 characters
|
|
33
|
+
return Math.ceil(text.length / 3.5);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get latency level from tool metadata
|
|
37
|
+
*/
|
|
38
|
+
function getLatencyLevel(toolName) {
|
|
39
|
+
const tool = getToolByName(toolName);
|
|
40
|
+
if (!tool) {
|
|
41
|
+
return "unknown";
|
|
42
|
+
}
|
|
43
|
+
// Check operation metadata for performance impact
|
|
44
|
+
const metadata = tool.operationMetadata;
|
|
45
|
+
if (metadata?.performance_impact?.latency) {
|
|
46
|
+
const latency = metadata.performance_impact.latency;
|
|
47
|
+
if (latency === "low" || latency === "moderate" || latency === "high") {
|
|
48
|
+
return latency;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Fallback: estimate based on operation type
|
|
52
|
+
switch (tool.operation) {
|
|
53
|
+
case "list":
|
|
54
|
+
return "low";
|
|
55
|
+
case "get":
|
|
56
|
+
return "low";
|
|
57
|
+
case "create":
|
|
58
|
+
return "moderate";
|
|
59
|
+
case "update":
|
|
60
|
+
return "moderate";
|
|
61
|
+
case "delete":
|
|
62
|
+
return "moderate";
|
|
63
|
+
default:
|
|
64
|
+
return "unknown";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Estimate tokens for a tool call
|
|
69
|
+
*/
|
|
70
|
+
export function estimateToolTokens(toolName) {
|
|
71
|
+
const tool = getToolByName(toolName);
|
|
72
|
+
if (!tool) {
|
|
73
|
+
// Default estimate for unknown tools
|
|
74
|
+
return {
|
|
75
|
+
schemaTokens: 200,
|
|
76
|
+
requestTokens: 100,
|
|
77
|
+
responseTokens: 300,
|
|
78
|
+
totalTokens: 600,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
// Schema tokens: tool description + parameters
|
|
82
|
+
const descriptionTokens = estimateTokens(tool.description);
|
|
83
|
+
const pathParamTokens = tool.pathParameters.length * 30;
|
|
84
|
+
const queryParamTokens = (tool.queryParameters?.length ?? 0) * 40;
|
|
85
|
+
const schemaTokens = descriptionTokens + pathParamTokens + queryParamTokens;
|
|
86
|
+
// Request tokens: based on operation type
|
|
87
|
+
let requestTokens;
|
|
88
|
+
switch (tool.operation) {
|
|
89
|
+
case "create":
|
|
90
|
+
requestTokens = 500; // Create operations typically have larger request bodies
|
|
91
|
+
break;
|
|
92
|
+
case "update":
|
|
93
|
+
requestTokens = 400;
|
|
94
|
+
break;
|
|
95
|
+
case "list":
|
|
96
|
+
requestTokens = 50; // List operations have minimal request
|
|
97
|
+
break;
|
|
98
|
+
case "get":
|
|
99
|
+
requestTokens = 30;
|
|
100
|
+
break;
|
|
101
|
+
case "delete":
|
|
102
|
+
requestTokens = 30;
|
|
103
|
+
break;
|
|
104
|
+
default:
|
|
105
|
+
requestTokens = 200;
|
|
106
|
+
}
|
|
107
|
+
// Response tokens: based on operation type
|
|
108
|
+
let responseTokens;
|
|
109
|
+
switch (tool.operation) {
|
|
110
|
+
case "list":
|
|
111
|
+
responseTokens = 1000; // List operations can return many items
|
|
112
|
+
break;
|
|
113
|
+
case "get":
|
|
114
|
+
responseTokens = 500;
|
|
115
|
+
break;
|
|
116
|
+
case "create":
|
|
117
|
+
responseTokens = 400;
|
|
118
|
+
break;
|
|
119
|
+
case "update":
|
|
120
|
+
responseTokens = 400;
|
|
121
|
+
break;
|
|
122
|
+
case "delete":
|
|
123
|
+
responseTokens = 100;
|
|
124
|
+
break;
|
|
125
|
+
default:
|
|
126
|
+
responseTokens = 300;
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
schemaTokens,
|
|
130
|
+
requestTokens,
|
|
131
|
+
responseTokens,
|
|
132
|
+
totalTokens: schemaTokens + requestTokens + responseTokens,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Estimate latency for a tool call
|
|
137
|
+
*/
|
|
138
|
+
export function estimateToolLatency(toolName) {
|
|
139
|
+
const level = getLatencyLevel(toolName);
|
|
140
|
+
return {
|
|
141
|
+
level,
|
|
142
|
+
estimatedMs: LATENCY_MS_MAP[level],
|
|
143
|
+
description: LATENCY_DESCRIPTIONS[level],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get complete cost estimate for a single tool
|
|
148
|
+
*/
|
|
149
|
+
export function estimateToolCost(toolName) {
|
|
150
|
+
const exists = toolExists(toolName);
|
|
151
|
+
const tool = getToolByName(toolName);
|
|
152
|
+
return {
|
|
153
|
+
toolName,
|
|
154
|
+
tokens: estimateToolTokens(toolName),
|
|
155
|
+
latency: estimateToolLatency(toolName),
|
|
156
|
+
dangerLevel: tool?.dangerLevel ?? "low",
|
|
157
|
+
exists,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Estimate costs for multiple tools
|
|
162
|
+
*/
|
|
163
|
+
export function estimateMultipleToolsCost(toolNames) {
|
|
164
|
+
return toolNames.map((name) => estimateToolCost(name));
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Aggregate latency levels into average
|
|
168
|
+
*/
|
|
169
|
+
function aggregateLatency(levels) {
|
|
170
|
+
if (levels.length === 0) {
|
|
171
|
+
return "unknown";
|
|
172
|
+
}
|
|
173
|
+
const levelValues = {
|
|
174
|
+
low: 1,
|
|
175
|
+
moderate: 2,
|
|
176
|
+
high: 3,
|
|
177
|
+
unknown: 2,
|
|
178
|
+
};
|
|
179
|
+
const total = levels.reduce((sum, level) => sum + levelValues[level], 0);
|
|
180
|
+
const avg = total / levels.length;
|
|
181
|
+
if (avg < 1.5)
|
|
182
|
+
return "low";
|
|
183
|
+
if (avg < 2.5)
|
|
184
|
+
return "moderate";
|
|
185
|
+
return "high";
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Estimate costs for a creation plan workflow
|
|
189
|
+
*/
|
|
190
|
+
export function estimateWorkflowCost(plan) {
|
|
191
|
+
const warnings = [];
|
|
192
|
+
const latencyLevels = [];
|
|
193
|
+
const steps = plan.steps.map((step) => {
|
|
194
|
+
const tokens = estimateToolTokens(step.toolName);
|
|
195
|
+
const latency = estimateToolLatency(step.toolName);
|
|
196
|
+
if (!toolExists(step.toolName)) {
|
|
197
|
+
warnings.push(`Tool '${step.toolName}' not found - estimates may be inaccurate`);
|
|
198
|
+
}
|
|
199
|
+
latencyLevels.push(latency.level);
|
|
200
|
+
return {
|
|
201
|
+
stepNumber: step.stepNumber,
|
|
202
|
+
toolName: step.toolName,
|
|
203
|
+
tokens: tokens.totalTokens,
|
|
204
|
+
latencyMs: latency.estimatedMs,
|
|
205
|
+
};
|
|
206
|
+
});
|
|
207
|
+
const totalTokens = steps.reduce((sum, step) => sum + step.tokens, 0);
|
|
208
|
+
const estimatedTotalMs = steps.reduce((sum, step) => sum + step.latencyMs, 0);
|
|
209
|
+
return {
|
|
210
|
+
totalTokens,
|
|
211
|
+
averageLatency: aggregateLatency(latencyLevels),
|
|
212
|
+
estimatedTotalMs,
|
|
213
|
+
stepCount: steps.length,
|
|
214
|
+
steps,
|
|
215
|
+
warnings,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Format cost estimate for human-readable output
|
|
220
|
+
*/
|
|
221
|
+
export function formatCostEstimate(estimate) {
|
|
222
|
+
const lines = [];
|
|
223
|
+
lines.push(`# Cost Estimate: ${estimate.toolName}`);
|
|
224
|
+
lines.push("");
|
|
225
|
+
if (!estimate.exists) {
|
|
226
|
+
lines.push("**Warning**: Tool not found - estimates are approximate");
|
|
227
|
+
lines.push("");
|
|
228
|
+
}
|
|
229
|
+
lines.push("## Token Usage");
|
|
230
|
+
lines.push(`- Schema/Description: ~${estimate.tokens.schemaTokens} tokens`);
|
|
231
|
+
lines.push(`- Request Body: ~${estimate.tokens.requestTokens} tokens`);
|
|
232
|
+
lines.push(`- Response: ~${estimate.tokens.responseTokens} tokens`);
|
|
233
|
+
lines.push(`- **Total per call**: ~${estimate.tokens.totalTokens} tokens`);
|
|
234
|
+
lines.push("");
|
|
235
|
+
lines.push("## Latency");
|
|
236
|
+
lines.push(`- Level: ${estimate.latency.level}`);
|
|
237
|
+
lines.push(`- Estimated: ~${estimate.latency.estimatedMs}ms`);
|
|
238
|
+
lines.push(`- ${estimate.latency.description}`);
|
|
239
|
+
lines.push("");
|
|
240
|
+
lines.push("## Risk");
|
|
241
|
+
lines.push(`- Danger Level: ${estimate.dangerLevel}`);
|
|
242
|
+
return lines.join("\n");
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Format workflow cost estimate for human-readable output
|
|
246
|
+
*/
|
|
247
|
+
export function formatWorkflowCostEstimate(estimate) {
|
|
248
|
+
const lines = [];
|
|
249
|
+
lines.push("# Workflow Cost Estimate");
|
|
250
|
+
lines.push("");
|
|
251
|
+
lines.push("## Summary");
|
|
252
|
+
lines.push(`- **Total Steps**: ${estimate.stepCount}`);
|
|
253
|
+
lines.push(`- **Total Tokens**: ~${estimate.totalTokens}`);
|
|
254
|
+
lines.push(`- **Average Latency**: ${estimate.averageLatency}`);
|
|
255
|
+
lines.push(`- **Estimated Total Time**: ~${(estimate.estimatedTotalMs / 1000).toFixed(1)}s`);
|
|
256
|
+
lines.push("");
|
|
257
|
+
if (estimate.warnings.length > 0) {
|
|
258
|
+
lines.push("## Warnings");
|
|
259
|
+
for (const warning of estimate.warnings) {
|
|
260
|
+
lines.push(`- ${warning}`);
|
|
261
|
+
}
|
|
262
|
+
lines.push("");
|
|
263
|
+
}
|
|
264
|
+
lines.push("## Step Breakdown");
|
|
265
|
+
lines.push("");
|
|
266
|
+
lines.push("| Step | Tool | Tokens | Latency |");
|
|
267
|
+
lines.push("|------|------|--------|---------|");
|
|
268
|
+
for (const step of estimate.steps) {
|
|
269
|
+
lines.push(`| ${step.stepNumber} | ${step.toolName} | ~${step.tokens} | ~${step.latencyMs}ms |`);
|
|
270
|
+
}
|
|
271
|
+
return lines.join("\n");
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=cost-estimator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost-estimator.js","sourceRoot":"","sources":["../../../src/tools/discovery/cost-estimator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAuF/C;;GAEG;AACH,MAAM,cAAc,GAAiC;IACnD,GAAG,EAAE,GAAG;IACR,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,oBAAoB,GAAiC;IACzD,GAAG,EAAE,uDAAuD;IAC5D,QAAQ,EAAE,0CAA0C;IACpD,IAAI,EAAE,sEAAsE;IAC5E,OAAO,EAAE,yDAAyD;CACnE,CAAC;AAEF;;GAEG;AACH,SAAS,cAAc,CAAC,IAAY;IAClC,iEAAiE;IACjE,mEAAmE;IACnE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,QAAgB;IACvC,MAAM,IAAI,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,SAAS,CAAC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,oCAAoC,CAAC,CAAC;IACjD,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CACR,KAAK,IAAI,CAAC,UAAU,MAAM,IAAI,CAAC,QAAQ,OAAO,IAAI,CAAC,MAAM,OAAO,IAAI,CAAC,SAAS,MAAM,CACrF,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -27,6 +27,12 @@ export { getConsolidatedIndex, clearConsolidatedCache, getConsolidatedResource,
|
|
|
27
27
|
export { loadDependencyGraph, clearDependencyCache, getResourceDependencies, getCreationOrder, getPrerequisiteResources, getDependentResources, getOneOfGroups, getSubscriptionRequirements, getResourcesRequiringSubscription, getAvailableAddonServices, generateDependencyReport, getDependencyStats, getResourcesInDomain, getAllDependencyDomains, } from "./dependencies.js";
|
|
28
28
|
export type { ValidationError, ValidationResult, ValidateParams } from "./validate.js";
|
|
29
29
|
export { validateToolParams, formatValidationResult } from "./validate.js";
|
|
30
|
+
export type { WorkflowStep, AlternativePath, CreationPlan, ResolveParams, ResolveResult, } from "./resolver.js";
|
|
31
|
+
export { resolveDependencies, formatCreationPlan, generateCompactPlan } from "./resolver.js";
|
|
32
|
+
export type { LatencyLevel, TokenEstimate, LatencyEstimate, ToolCostEstimate, WorkflowCostEstimate, EstimateCostParams, } from "./cost-estimator.js";
|
|
33
|
+
export { estimateToolTokens, estimateToolLatency, estimateToolCost, estimateMultipleToolsCost, estimateWorkflowCost, formatCostEstimate, formatWorkflowCostEstimate, } from "./cost-estimator.js";
|
|
34
|
+
export type { CommonError, DangerAnalysis, RecommendedWorkflow, DomainBestPractices, BestPracticesQuery, BestPracticesResult, } from "./best-practices.js";
|
|
35
|
+
export { getDomainBestPractices, queryBestPractices, getAllDomainsSummary, formatBestPractices, } from "./best-practices.js";
|
|
30
36
|
/**
|
|
31
37
|
* MCP Tool Definitions for the discovery meta-tools
|
|
32
38
|
*
|
|
@@ -260,5 +266,98 @@ export declare const DISCOVERY_TOOLS: {
|
|
|
260
266
|
readonly required: readonly ["toolName"];
|
|
261
267
|
};
|
|
262
268
|
};
|
|
269
|
+
readonly resolveDependencies: {
|
|
270
|
+
readonly name: "f5xc-api-resolve-dependencies";
|
|
271
|
+
readonly description: string;
|
|
272
|
+
readonly inputSchema: {
|
|
273
|
+
readonly type: "object";
|
|
274
|
+
readonly properties: {
|
|
275
|
+
readonly resource: {
|
|
276
|
+
readonly type: "string";
|
|
277
|
+
readonly description: "The target resource to create (e.g., 'http-loadbalancer', 'origin-pool')";
|
|
278
|
+
};
|
|
279
|
+
readonly domain: {
|
|
280
|
+
readonly type: "string";
|
|
281
|
+
readonly description: "The domain containing the resource (e.g., 'virtual', 'network')";
|
|
282
|
+
};
|
|
283
|
+
readonly existingResources: {
|
|
284
|
+
readonly type: "array";
|
|
285
|
+
readonly items: {
|
|
286
|
+
readonly type: "string";
|
|
287
|
+
};
|
|
288
|
+
readonly description: string;
|
|
289
|
+
};
|
|
290
|
+
readonly includeOptional: {
|
|
291
|
+
readonly type: "boolean";
|
|
292
|
+
readonly description: "Include optional dependencies in the plan (default: false)";
|
|
293
|
+
readonly default: false;
|
|
294
|
+
};
|
|
295
|
+
readonly maxDepth: {
|
|
296
|
+
readonly type: "number";
|
|
297
|
+
readonly description: "Maximum depth for dependency traversal (default: 10)";
|
|
298
|
+
readonly default: 10;
|
|
299
|
+
};
|
|
300
|
+
readonly expandAlternatives: {
|
|
301
|
+
readonly type: "boolean";
|
|
302
|
+
readonly description: "Include alternative paths for oneOf choices (default: false)";
|
|
303
|
+
readonly default: false;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
readonly required: readonly ["resource", "domain"];
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
readonly estimateCost: {
|
|
310
|
+
readonly name: "f5xc-api-estimate-cost";
|
|
311
|
+
readonly description: string;
|
|
312
|
+
readonly inputSchema: {
|
|
313
|
+
readonly type: "object";
|
|
314
|
+
readonly properties: {
|
|
315
|
+
readonly toolName: {
|
|
316
|
+
readonly type: "string";
|
|
317
|
+
readonly description: "A single tool name to estimate (e.g., 'f5xc-api-waap-http-loadbalancer-create')";
|
|
318
|
+
};
|
|
319
|
+
readonly toolNames: {
|
|
320
|
+
readonly type: "array";
|
|
321
|
+
readonly items: {
|
|
322
|
+
readonly type: "string";
|
|
323
|
+
};
|
|
324
|
+
readonly description: "Multiple tool names to estimate costs for";
|
|
325
|
+
};
|
|
326
|
+
readonly plan: {
|
|
327
|
+
readonly type: "object";
|
|
328
|
+
readonly description: "A CreationPlan object from f5xc-api-resolve-dependencies to estimate workflow costs";
|
|
329
|
+
};
|
|
330
|
+
readonly detailed: {
|
|
331
|
+
readonly type: "boolean";
|
|
332
|
+
readonly description: "Include detailed breakdown of token usage and latency (default: true)";
|
|
333
|
+
readonly default: true;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
readonly bestPractices: {
|
|
339
|
+
readonly name: "f5xc-api-best-practices";
|
|
340
|
+
readonly description: string;
|
|
341
|
+
readonly inputSchema: {
|
|
342
|
+
readonly type: "object";
|
|
343
|
+
readonly properties: {
|
|
344
|
+
readonly domain: {
|
|
345
|
+
readonly type: "string";
|
|
346
|
+
readonly description: string;
|
|
347
|
+
};
|
|
348
|
+
readonly aspect: {
|
|
349
|
+
readonly type: "string";
|
|
350
|
+
readonly enum: readonly ["errors", "workflows", "danger", "security", "performance", "all"];
|
|
351
|
+
readonly description: string;
|
|
352
|
+
readonly default: "all";
|
|
353
|
+
};
|
|
354
|
+
readonly detailed: {
|
|
355
|
+
readonly type: "boolean";
|
|
356
|
+
readonly description: "Include detailed breakdowns (default: true)";
|
|
357
|
+
readonly default: true;
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
};
|
|
263
362
|
};
|
|
264
363
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/discovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEnG,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGhG,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,YAAY,GACb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGlE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,EACd,2BAA2B,EAC3B,iCAAiC,EACjC,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/discovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEnG,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGhG,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,YAAY,GACb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGlE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,EACd,2BA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiWlB,CAAC"}
|
|
@@ -27,6 +27,9 @@ export { getConsolidatedIndex, clearConsolidatedCache, getConsolidatedResource,
|
|
|
27
27
|
// Dependency discovery exports
|
|
28
28
|
export { loadDependencyGraph, clearDependencyCache, getResourceDependencies, getCreationOrder, getPrerequisiteResources, getDependentResources, getOneOfGroups, getSubscriptionRequirements, getResourcesRequiringSubscription, getAvailableAddonServices, generateDependencyReport, getDependencyStats, getResourcesInDomain, getAllDependencyDomains, } from "./dependencies.js";
|
|
29
29
|
export { validateToolParams, formatValidationResult } from "./validate.js";
|
|
30
|
+
export { resolveDependencies, formatCreationPlan, generateCompactPlan } from "./resolver.js";
|
|
31
|
+
export { estimateToolTokens, estimateToolLatency, estimateToolCost, estimateMultipleToolsCost, estimateWorkflowCost, formatCostEstimate, formatWorkflowCostEstimate, } from "./cost-estimator.js";
|
|
32
|
+
export { getDomainBestPractices, queryBestPractices, getAllDomainsSummary, formatBestPractices, } from "./best-practices.js";
|
|
30
33
|
/**
|
|
31
34
|
* MCP Tool Definitions for the discovery meta-tools
|
|
32
35
|
*
|
|
@@ -258,5 +261,101 @@ export const DISCOVERY_TOOLS = {
|
|
|
258
261
|
required: ["toolName"],
|
|
259
262
|
},
|
|
260
263
|
},
|
|
264
|
+
resolveDependencies: {
|
|
265
|
+
name: "f5xc-api-resolve-dependencies",
|
|
266
|
+
description: "Generate a complete creation plan for an F5XC resource with all transitive dependencies. " +
|
|
267
|
+
"Returns step-by-step workflow with tool names, required inputs, and oneOf choices. " +
|
|
268
|
+
"Essential for understanding what resources must be created before the target resource.",
|
|
269
|
+
inputSchema: {
|
|
270
|
+
type: "object",
|
|
271
|
+
properties: {
|
|
272
|
+
resource: {
|
|
273
|
+
type: "string",
|
|
274
|
+
description: "The target resource to create (e.g., 'http-loadbalancer', 'origin-pool')",
|
|
275
|
+
},
|
|
276
|
+
domain: {
|
|
277
|
+
type: "string",
|
|
278
|
+
description: "The domain containing the resource (e.g., 'virtual', 'network')",
|
|
279
|
+
},
|
|
280
|
+
existingResources: {
|
|
281
|
+
type: "array",
|
|
282
|
+
items: { type: "string" },
|
|
283
|
+
description: "Resources that already exist (will be skipped). Format: 'domain/resource' " +
|
|
284
|
+
"(e.g., ['network/origin-pool', 'certificates/certificate'])",
|
|
285
|
+
},
|
|
286
|
+
includeOptional: {
|
|
287
|
+
type: "boolean",
|
|
288
|
+
description: "Include optional dependencies in the plan (default: false)",
|
|
289
|
+
default: false,
|
|
290
|
+
},
|
|
291
|
+
maxDepth: {
|
|
292
|
+
type: "number",
|
|
293
|
+
description: "Maximum depth for dependency traversal (default: 10)",
|
|
294
|
+
default: 10,
|
|
295
|
+
},
|
|
296
|
+
expandAlternatives: {
|
|
297
|
+
type: "boolean",
|
|
298
|
+
description: "Include alternative paths for oneOf choices (default: false)",
|
|
299
|
+
default: false,
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
required: ["resource", "domain"],
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
estimateCost: {
|
|
306
|
+
name: "f5xc-api-estimate-cost",
|
|
307
|
+
description: "Estimate token usage and latency for F5XC API tool calls. Provides cost estimates for individual tools, " +
|
|
308
|
+
"multiple tools, or complete creation plan workflows. Useful for planning and optimizing API interactions.",
|
|
309
|
+
inputSchema: {
|
|
310
|
+
type: "object",
|
|
311
|
+
properties: {
|
|
312
|
+
toolName: {
|
|
313
|
+
type: "string",
|
|
314
|
+
description: "A single tool name to estimate (e.g., 'f5xc-api-waap-http-loadbalancer-create')",
|
|
315
|
+
},
|
|
316
|
+
toolNames: {
|
|
317
|
+
type: "array",
|
|
318
|
+
items: { type: "string" },
|
|
319
|
+
description: "Multiple tool names to estimate costs for",
|
|
320
|
+
},
|
|
321
|
+
plan: {
|
|
322
|
+
type: "object",
|
|
323
|
+
description: "A CreationPlan object from f5xc-api-resolve-dependencies to estimate workflow costs",
|
|
324
|
+
},
|
|
325
|
+
detailed: {
|
|
326
|
+
type: "boolean",
|
|
327
|
+
description: "Include detailed breakdown of token usage and latency (default: true)",
|
|
328
|
+
default: true,
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
bestPractices: {
|
|
334
|
+
name: "f5xc-api-best-practices",
|
|
335
|
+
description: "Get domain-specific best practices for F5XC API operations. Includes common errors with resolutions, " +
|
|
336
|
+
"recommended workflows, danger level analysis, security notes, and performance tips.",
|
|
337
|
+
inputSchema: {
|
|
338
|
+
type: "object",
|
|
339
|
+
properties: {
|
|
340
|
+
domain: {
|
|
341
|
+
type: "string",
|
|
342
|
+
description: "Domain to get best practices for (e.g., 'virtual', 'dns', 'certificates'). " +
|
|
343
|
+
"Omit to list available domains.",
|
|
344
|
+
},
|
|
345
|
+
aspect: {
|
|
346
|
+
type: "string",
|
|
347
|
+
enum: ["errors", "workflows", "danger", "security", "performance", "all"],
|
|
348
|
+
description: "Specific aspect to retrieve: 'errors' (common errors), 'workflows' (recommended workflows), " +
|
|
349
|
+
"'danger' (danger level analysis), 'security' (security notes), 'performance' (tips), 'all' (default)",
|
|
350
|
+
default: "all",
|
|
351
|
+
},
|
|
352
|
+
detailed: {
|
|
353
|
+
type: "boolean",
|
|
354
|
+
description: "Include detailed breakdowns (default: true)",
|
|
355
|
+
default: true,
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
},
|
|
261
360
|
};
|
|
262
361
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/discovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAeH,uBAAuB;AACvB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B,iBAAiB;AACjB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,mBAAmB;AACnB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAEvB,kBAAkB;AAClB,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAIlE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,+BAA+B;AAC/B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,EACd,2BAA2B,EAC3B,iCAAiC,EACjC,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/discovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAeH,uBAAuB;AACvB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B,iBAAiB;AACjB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,mBAAmB;AACnB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,GACrB,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G,OAAO,EAAE,KAAK;iBACf;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,6CAA6C;oBAC1D,OAAO,EAAE,IAAI;iBACd;aACF;SACF;KACF;CACO,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive Dependency Resolver
|
|
3
|
+
*
|
|
4
|
+
* Generates complete creation plans with all transitive dependencies,
|
|
5
|
+
* step-by-step workflows with tool names and required inputs,
|
|
6
|
+
* and handles oneOf groups with alternative paths.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A single step in a creation workflow
|
|
10
|
+
*/
|
|
11
|
+
export interface WorkflowStep {
|
|
12
|
+
/** Step number in the sequence */
|
|
13
|
+
stepNumber: number;
|
|
14
|
+
/** Action description */
|
|
15
|
+
action: "create" | "configure" | "verify";
|
|
16
|
+
/** Resource domain */
|
|
17
|
+
domain: string;
|
|
18
|
+
/** Resource type */
|
|
19
|
+
resource: string;
|
|
20
|
+
/** Full tool name for this step */
|
|
21
|
+
toolName: string;
|
|
22
|
+
/** Resources that must be created before this step */
|
|
23
|
+
dependsOn: string[];
|
|
24
|
+
/** Whether this step is optional */
|
|
25
|
+
optional: boolean;
|
|
26
|
+
/** Required input parameters */
|
|
27
|
+
requiredInputs: string[];
|
|
28
|
+
/** OneOf choices that must be made for this resource */
|
|
29
|
+
oneOfChoices?: Array<{
|
|
30
|
+
field: string;
|
|
31
|
+
options: string[];
|
|
32
|
+
description?: string;
|
|
33
|
+
}>;
|
|
34
|
+
/** Notes or hints for this step */
|
|
35
|
+
notes?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Alternative path in a creation plan (for oneOf choices)
|
|
39
|
+
*/
|
|
40
|
+
export interface AlternativePath {
|
|
41
|
+
/** Name of the choice field */
|
|
42
|
+
choiceField: string;
|
|
43
|
+
/** Selected option */
|
|
44
|
+
selectedOption: string;
|
|
45
|
+
/** Steps specific to this alternative */
|
|
46
|
+
steps: WorkflowStep[];
|
|
47
|
+
/** Description of what this alternative provides */
|
|
48
|
+
description?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Complete creation plan for a resource
|
|
52
|
+
*/
|
|
53
|
+
export interface CreationPlan {
|
|
54
|
+
/** Target resource to create */
|
|
55
|
+
targetResource: string;
|
|
56
|
+
/** Target domain */
|
|
57
|
+
targetDomain: string;
|
|
58
|
+
/** Total number of steps */
|
|
59
|
+
totalSteps: number;
|
|
60
|
+
/** Ordered workflow steps */
|
|
61
|
+
steps: WorkflowStep[];
|
|
62
|
+
/** Warnings about the plan */
|
|
63
|
+
warnings: string[];
|
|
64
|
+
/** Alternative paths for oneOf choices */
|
|
65
|
+
alternatives: AlternativePath[];
|
|
66
|
+
/** Required subscriptions */
|
|
67
|
+
subscriptions: string[];
|
|
68
|
+
/** Resources that already exist (skip these steps) */
|
|
69
|
+
existingResources?: string[];
|
|
70
|
+
/** Estimated complexity (low, medium, high) */
|
|
71
|
+
complexity: "low" | "medium" | "high";
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Parameters for resolving dependencies
|
|
75
|
+
*/
|
|
76
|
+
export interface ResolveParams {
|
|
77
|
+
/** Target resource to create */
|
|
78
|
+
resource: string;
|
|
79
|
+
/** Domain containing the resource */
|
|
80
|
+
domain: string;
|
|
81
|
+
/** Resources that already exist (will be skipped) */
|
|
82
|
+
existingResources?: string[];
|
|
83
|
+
/** Whether to include optional dependencies */
|
|
84
|
+
includeOptional?: boolean;
|
|
85
|
+
/** Maximum depth for dependency traversal */
|
|
86
|
+
maxDepth?: number;
|
|
87
|
+
/** Whether to expand oneOf alternatives */
|
|
88
|
+
expandAlternatives?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Result of dependency resolution
|
|
92
|
+
*/
|
|
93
|
+
export interface ResolveResult {
|
|
94
|
+
success: boolean;
|
|
95
|
+
plan?: CreationPlan;
|
|
96
|
+
error?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Resolve dependencies and generate a complete creation plan
|
|
100
|
+
*/
|
|
101
|
+
export declare function resolveDependencies(params: ResolveParams): ResolveResult;
|
|
102
|
+
/**
|
|
103
|
+
* Format a creation plan for human-readable output
|
|
104
|
+
*/
|
|
105
|
+
export declare function formatCreationPlan(plan: CreationPlan): string;
|
|
106
|
+
/**
|
|
107
|
+
* Generate a compact JSON creation plan for programmatic use
|
|
108
|
+
*/
|
|
109
|
+
export declare function generateCompactPlan(params: ResolveParams): {
|
|
110
|
+
success: boolean;
|
|
111
|
+
steps?: Array<{
|
|
112
|
+
tool: string;
|
|
113
|
+
resource: string;
|
|
114
|
+
inputs: string[];
|
|
115
|
+
choices?: Record<string, string[]>;
|
|
116
|
+
}>;
|
|
117
|
+
error?: string;
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=resolver.d.ts.map
|