@robinmordasiewicz/f5xc-api-mcp 2.0.20-2601080407 → 2.0.21-2601081701

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.
Files changed (67) hide show
  1. package/dist/server.d.ts.map +1 -1
  2. package/dist/server.js +100 -2
  3. package/dist/server.js.map +1 -1
  4. package/dist/tools/discovery/describe.d.ts +2 -0
  5. package/dist/tools/discovery/describe.d.ts.map +1 -1
  6. package/dist/tools/discovery/describe.js +2 -0
  7. package/dist/tools/discovery/describe.js.map +1 -1
  8. package/dist/tools/discovery/index.d.ts +31 -0
  9. package/dist/tools/discovery/index.d.ts.map +1 -1
  10. package/dist/tools/discovery/index.js +38 -0
  11. package/dist/tools/discovery/index.js.map +1 -1
  12. package/dist/tools/discovery/schema-loader.d.ts +142 -0
  13. package/dist/tools/discovery/schema-loader.d.ts.map +1 -0
  14. package/dist/tools/discovery/schema-loader.js +322 -0
  15. package/dist/tools/discovery/schema-loader.js.map +1 -0
  16. package/dist/tools/discovery/schema.d.ts +134 -0
  17. package/dist/tools/discovery/schema.d.ts.map +1 -0
  18. package/dist/tools/discovery/schema.js +380 -0
  19. package/dist/tools/discovery/schema.js.map +1 -0
  20. package/dist/tools/discovery/suggest-params.d.ts +87 -0
  21. package/dist/tools/discovery/suggest-params.d.ts.map +1 -0
  22. package/dist/tools/discovery/suggest-params.js +427 -0
  23. package/dist/tools/discovery/suggest-params.js.map +1 -0
  24. package/dist/tools/generated/dependency-graph.json +1 -1
  25. package/dist/version.d.ts +2 -2
  26. package/dist/version.js +2 -2
  27. package/manifest.json +1 -1
  28. package/package.json +1 -1
  29. package/specs/domains/admin_console_and_ui.json +26 -25
  30. package/specs/domains/ai_services.json +22 -22
  31. package/specs/domains/api.json +174 -175
  32. package/specs/domains/authentication.json +48 -47
  33. package/specs/domains/bigip.json +95 -95
  34. package/specs/domains/billing_and_usage.json +64 -64
  35. package/specs/domains/blindfold.json +110 -110
  36. package/specs/domains/bot_and_threat_defense.json +66 -65
  37. package/specs/domains/cdn.json +178 -179
  38. package/specs/domains/ce_management.json +77 -78
  39. package/specs/domains/certificates.json +76 -76
  40. package/specs/domains/cloud_infrastructure.json +113 -113
  41. package/specs/domains/container_services.json +92 -92
  42. package/specs/domains/data_and_privacy_security.json +67 -67
  43. package/specs/domains/data_intelligence.json +65 -65
  44. package/specs/domains/ddos.json +155 -156
  45. package/specs/domains/dns.json +149 -149
  46. package/specs/domains/managed_kubernetes.json +86 -86
  47. package/specs/domains/marketplace.json +104 -104
  48. package/specs/domains/network.json +231 -232
  49. package/specs/domains/network_security.json +188 -188
  50. package/specs/domains/nginx_one.json +63 -63
  51. package/specs/domains/object_storage.json +13 -13
  52. package/specs/domains/observability.json +103 -104
  53. package/specs/domains/rate_limiting.json +53 -53
  54. package/specs/domains/secops_and_incident_response.json +37 -37
  55. package/specs/domains/service_mesh.json +120 -120
  56. package/specs/domains/shape.json +314 -315
  57. package/specs/domains/sites.json +350 -350
  58. package/specs/domains/statistics.json +226 -227
  59. package/specs/domains/support.json +109 -109
  60. package/specs/domains/telemetry_and_insights.json +75 -74
  61. package/specs/domains/tenant_and_identity.json +269 -272
  62. package/specs/domains/threat_campaign.json +69 -68
  63. package/specs/domains/users.json +67 -66
  64. package/specs/domains/virtual.json +245 -245
  65. package/specs/domains/vpm_and_node_management.json +4 -3
  66. package/specs/domains/waf.json +140 -141
  67. package/specs/index.json +17 -17
@@ -0,0 +1,380 @@
1
+ /**
2
+ * Schema Retrieval Module
3
+ *
4
+ * Provides full JSON schemas for F5XC API request bodies to eliminate
5
+ * guessing by AI assistants when constructing API payloads.
6
+ *
7
+ * Enhanced with $ref resolution, minimum configuration extraction,
8
+ * and smart example generation.
9
+ */
10
+ import { getToolByName } from "../registry.js";
11
+ import { getResolvedRequestBodySchema as resolveSchema, getMinimumConfigurationFromSchema, extractRequiredFields, extractMutuallyExclusiveGroups, } from "./schema-loader.js";
12
+ /**
13
+ * Get the raw JSON schema for a tool's request body (may contain $refs)
14
+ *
15
+ * @param toolName - The exact tool name
16
+ * @returns Raw JSON schema or null if not found
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * const schema = getRequestBodySchema("f5xc-api-virtual-http-loadbalancer-create");
21
+ * if (schema) {
22
+ * console.log(JSON.stringify(schema, null, 2));
23
+ * }
24
+ * ```
25
+ */
26
+ export function getRequestBodySchema(toolName) {
27
+ const tool = getToolByName(toolName);
28
+ if (!tool || !tool.requestBodySchema) {
29
+ return null;
30
+ }
31
+ return tool.requestBodySchema;
32
+ }
33
+ /**
34
+ * Get fully resolved request body schema (all $refs expanded)
35
+ *
36
+ * This is the recommended function for AI assistants as it provides
37
+ * the complete schema structure without any unresolved references.
38
+ *
39
+ * @param toolName - The exact tool name
40
+ * @returns Fully resolved schema or null if not found
41
+ *
42
+ * @example
43
+ * ```typescript
44
+ * const schema = getResolvedRequestBodySchema("f5xc-api-virtual-http-loadbalancer-create");
45
+ * if (schema) {
46
+ * // schema.properties contains all nested structures
47
+ * console.log(schema.properties);
48
+ * }
49
+ * ```
50
+ */
51
+ export function getResolvedRequestBodySchema(toolName) {
52
+ return resolveSchema(toolName);
53
+ }
54
+ /**
55
+ * Get the full JSON schema for a tool's response
56
+ *
57
+ * @param toolName - The exact tool name
58
+ * @returns Complete JSON schema or null if not found
59
+ */
60
+ export function getResponseSchema(toolName) {
61
+ const tool = getToolByName(toolName);
62
+ if (!tool || !tool.responseSchema) {
63
+ return null;
64
+ }
65
+ return tool.responseSchema;
66
+ }
67
+ /**
68
+ * Get both request and response schemas for a tool
69
+ *
70
+ * @param toolName - The exact tool name
71
+ * @returns Object with request and response schemas
72
+ */
73
+ export function getToolSchemas(toolName) {
74
+ const tool = getToolByName(toolName);
75
+ if (!tool) {
76
+ return {};
77
+ }
78
+ return {
79
+ requestBody: tool.requestBodySchema ?? undefined,
80
+ response: tool.responseSchema ?? undefined,
81
+ };
82
+ }
83
+ /**
84
+ * Get x-f5xc-minimum-configuration from a tool's request body schema
85
+ *
86
+ * This contains rich examples (JSON, YAML, cURL), required fields,
87
+ * and mutually exclusive field groups from the OpenAPI spec.
88
+ *
89
+ * @param toolName - The exact tool name
90
+ * @returns Minimum configuration or null if not found
91
+ */
92
+ export function getMinimumConfiguration(toolName) {
93
+ return getMinimumConfigurationFromSchema(toolName);
94
+ }
95
+ /**
96
+ * Get all required fields for a tool's request body
97
+ *
98
+ * Combines required fields from:
99
+ * 1. Schema 'required' arrays (recursively)
100
+ * 2. x-f5xc-minimum-configuration.required_fields
101
+ *
102
+ * @param toolName - The exact tool name
103
+ * @returns Array of required field paths (e.g., ["metadata.name", "spec.domains"])
104
+ */
105
+ export function getRequiredFields(toolName) {
106
+ const requiredSet = new Set();
107
+ // Get from resolved schema
108
+ const schema = resolveSchema(toolName);
109
+ if (schema) {
110
+ for (const field of extractRequiredFields(schema)) {
111
+ requiredSet.add(field);
112
+ }
113
+ }
114
+ // Get from minimum configuration
115
+ const minConfig = getMinimumConfigurationFromSchema(toolName);
116
+ if (minConfig?.required_fields) {
117
+ for (const field of minConfig.required_fields) {
118
+ requiredSet.add(field);
119
+ }
120
+ }
121
+ return Array.from(requiredSet).sort();
122
+ }
123
+ /**
124
+ * Get mutually exclusive field groups for a tool
125
+ *
126
+ * These indicate fields where only one option should be specified.
127
+ *
128
+ * @param toolName - The exact tool name
129
+ * @returns Array of mutually exclusive groups
130
+ */
131
+ export function getMutuallyExclusiveFields(toolName) {
132
+ const groups = [];
133
+ // Get from resolved schema (x-ves-oneof-field-* and oneOf/anyOf)
134
+ const schema = resolveSchema(toolName);
135
+ if (schema) {
136
+ groups.push(...extractMutuallyExclusiveGroups(schema));
137
+ }
138
+ // Get from minimum configuration
139
+ const minConfig = getMinimumConfigurationFromSchema(toolName);
140
+ if (minConfig?.mutually_exclusive_groups) {
141
+ for (const group of minConfig.mutually_exclusive_groups) {
142
+ groups.push({
143
+ fieldPath: group.fields.join(" | "),
144
+ options: group.fields.map((f) => ({ fieldName: f })),
145
+ reason: group.reason,
146
+ });
147
+ }
148
+ }
149
+ return groups;
150
+ }
151
+ /**
152
+ * Smart defaults for common field patterns
153
+ */
154
+ const SMART_DEFAULTS = {
155
+ name: (toolName) => `my-${extractResourceFromTool(toolName)}`,
156
+ "metadata.name": (toolName) => `my-${extractResourceFromTool(toolName)}`,
157
+ namespace: () => "default",
158
+ "metadata.namespace": () => "default",
159
+ port: () => 80,
160
+ listen_port: () => 80,
161
+ domains: () => ["example.com"],
162
+ hostnames: () => ["example.com"],
163
+ timeout: () => 30,
164
+ connect_timeout: () => 30,
165
+ idle_timeout: () => 60,
166
+ retries: () => 3,
167
+ enabled: () => true,
168
+ active: () => true,
169
+ path: () => "/",
170
+ url_path: () => "/",
171
+ method: () => "GET",
172
+ protocol: () => "HTTP",
173
+ };
174
+ /**
175
+ * Extract resource type from tool name
176
+ */
177
+ function extractResourceFromTool(toolName) {
178
+ // f5xc-api-virtual-http-loadbalancer-create -> http-loadbalancer
179
+ const parts = toolName.replace("f5xc-api-", "").split("-");
180
+ // Remove domain (first part) and operation (last part)
181
+ if (parts.length > 2) {
182
+ parts.shift(); // Remove domain
183
+ parts.pop(); // Remove operation
184
+ return parts.join("-");
185
+ }
186
+ return parts.join("-");
187
+ }
188
+ /**
189
+ * Generate smart default value for a field
190
+ */
191
+ function getSmartDefault(fieldPath, schema, toolName) {
192
+ // Check for explicit example in schema
193
+ if (schema.example !== undefined) {
194
+ return schema.example;
195
+ }
196
+ if (schema["x-ves-example"] !== undefined) {
197
+ return schema["x-ves-example"];
198
+ }
199
+ // Check smart defaults by field name
200
+ const fieldName = fieldPath.split(".").pop() || fieldPath;
201
+ if (SMART_DEFAULTS[fieldPath]) {
202
+ return SMART_DEFAULTS[fieldPath](toolName, schema);
203
+ }
204
+ if (SMART_DEFAULTS[fieldName]) {
205
+ return SMART_DEFAULTS[fieldName](toolName, schema);
206
+ }
207
+ // Handle enums
208
+ if (schema.enum && Array.isArray(schema.enum) && schema.enum.length > 0) {
209
+ return schema.enum[0];
210
+ }
211
+ // Handle default values
212
+ if (schema.default !== undefined) {
213
+ return schema.default;
214
+ }
215
+ // Type-based defaults
216
+ switch (schema.type) {
217
+ case "string":
218
+ return "example-value";
219
+ case "integer":
220
+ case "number":
221
+ return 1;
222
+ case "boolean":
223
+ return false;
224
+ case "array":
225
+ return [];
226
+ case "object":
227
+ return {};
228
+ default:
229
+ return null;
230
+ }
231
+ }
232
+ /**
233
+ * Generate example payload from resolved schema with smart defaults
234
+ */
235
+ function generateFromResolvedSchema(schema, toolName, path = "") {
236
+ // For objects, build example from properties
237
+ if (schema.type === "object" && schema.properties) {
238
+ const example = {};
239
+ for (const [key, propSchema] of Object.entries(schema.properties)) {
240
+ const propPath = path ? `${path}.${key}` : key;
241
+ const value = generateFromResolvedSchema(propSchema, toolName, propPath);
242
+ if (value !== null && value !== undefined) {
243
+ example[key] = value;
244
+ }
245
+ }
246
+ return Object.keys(example).length > 0 ? example : null;
247
+ }
248
+ // For arrays, generate one item example
249
+ if (schema.type === "array" && schema.items) {
250
+ const itemExample = generateFromResolvedSchema(schema.items, toolName, `${path}[]`);
251
+ return itemExample !== null ? [itemExample] : [];
252
+ }
253
+ // For primitives, use smart defaults
254
+ return getSmartDefault(path, schema, toolName);
255
+ }
256
+ /**
257
+ * Extract example values from OpenAPI schema (legacy function)
258
+ *
259
+ * Recursively traverses the schema to find example values for complex objects
260
+ */
261
+ function extractExamplesFromSchema(schema) {
262
+ // If schema has an example, return it
263
+ if ("example" in schema && schema.example !== undefined) {
264
+ return schema.example;
265
+ }
266
+ // If schema has examples array, return first example
267
+ if ("examples" in schema && Array.isArray(schema.examples) && schema.examples.length > 0) {
268
+ return schema.examples[0];
269
+ }
270
+ // Handle $ref - now we can resolve references!
271
+ if ("$ref" in schema) {
272
+ // The caller should use generateSmartExamplePayload instead
273
+ return null;
274
+ }
275
+ // For object schemas, recursively build example from properties
276
+ if (schema.type === "object" && "properties" in schema) {
277
+ const properties = schema.properties;
278
+ const example = {};
279
+ for (const [key, propSchema] of Object.entries(properties)) {
280
+ const propExample = extractExamplesFromSchema(propSchema);
281
+ if (propExample !== null) {
282
+ example[key] = propExample;
283
+ }
284
+ }
285
+ return Object.keys(example).length > 0 ? example : null;
286
+ }
287
+ // For array schemas, create example array with one item
288
+ if (schema.type === "array" && "items" in schema) {
289
+ const itemSchema = schema.items;
290
+ const itemExample = extractExamplesFromSchema(itemSchema);
291
+ if (itemExample !== null) {
292
+ return [itemExample];
293
+ }
294
+ }
295
+ // For primitive types, provide reasonable defaults
296
+ switch (schema.type) {
297
+ case "string":
298
+ return schema.enum && Array.isArray(schema.enum) ? schema.enum[0] : "example-value";
299
+ case "number":
300
+ case "integer":
301
+ return schema.default ?? 1;
302
+ case "boolean":
303
+ return schema.default ?? false;
304
+ default:
305
+ return null;
306
+ }
307
+ }
308
+ /**
309
+ * Generate example payload from request body schema (legacy function)
310
+ *
311
+ * This helps AI assistants understand the structure of complex nested objects
312
+ * without having to guess the format.
313
+ *
314
+ * @param toolName - The exact tool name
315
+ * @returns Example payload or null if no schema found
316
+ *
317
+ * @deprecated Use generateSmartExamplePayload for better results with $ref resolution
318
+ */
319
+ export function generateExamplePayload(toolName) {
320
+ const schema = getRequestBodySchema(toolName);
321
+ if (!schema) {
322
+ return null;
323
+ }
324
+ return extractExamplesFromSchema(schema);
325
+ }
326
+ /**
327
+ * Generate smart example payload with $ref resolution and intelligent defaults
328
+ *
329
+ * This is the recommended function for generating example payloads as it:
330
+ * 1. Resolves all $ref pointers
331
+ * 2. Uses smart defaults based on field names
332
+ * 3. Falls back to x-f5xc-minimum-configuration examples when available
333
+ *
334
+ * @param toolName - The exact tool name
335
+ * @returns Complete example payload or null if no schema found
336
+ */
337
+ export function generateSmartExamplePayload(toolName) {
338
+ // First, try to get example from minimum configuration (most reliable)
339
+ const minConfig = getMinimumConfigurationFromSchema(toolName);
340
+ if (minConfig?.example_json) {
341
+ try {
342
+ return JSON.parse(minConfig.example_json);
343
+ }
344
+ catch {
345
+ // Invalid JSON, continue to schema-based generation
346
+ }
347
+ }
348
+ // Generate from resolved schema with smart defaults
349
+ const schema = resolveSchema(toolName);
350
+ if (!schema) {
351
+ return null;
352
+ }
353
+ const example = generateFromResolvedSchema(schema, toolName);
354
+ return example;
355
+ }
356
+ /**
357
+ * Get comprehensive schema information for a tool
358
+ *
359
+ * This combines all schema-related data into a single response,
360
+ * ideal for AI assistants that need full context.
361
+ *
362
+ * @param toolName - The exact tool name
363
+ * @returns Comprehensive schema info or null if not found
364
+ */
365
+ export function getComprehensiveSchemaInfo(toolName) {
366
+ const schema = resolveSchema(toolName);
367
+ if (!schema) {
368
+ return null;
369
+ }
370
+ const minConfig = getMinimumConfigurationFromSchema(toolName);
371
+ return {
372
+ resolvedSchema: schema,
373
+ requiredFields: getRequiredFields(toolName),
374
+ mutuallyExclusiveGroups: getMutuallyExclusiveFields(toolName),
375
+ examplePayload: generateSmartExamplePayload(toolName),
376
+ minimumConfiguration: minConfig,
377
+ curlExample: minConfig?.example_curl || null,
378
+ };
379
+ }
380
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/tools/discovery/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EACL,4BAA4B,IAAI,aAAa,EAC7C,iCAAiC,EACjC,qBAAqB,EACrB,8BAA8B,GAI/B,MAAM,oBAAoB,CAAC;AAK5B;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,MAAM,IAAI,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IAErC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC,iBAAiB,CAAC;AAChC,CAAC;AAED;;;;;;;;;;;;;;;;;GAiB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AAC;YACP,oDAAoD;QACtD,CAAC;IACH,CAAC;IAED,oDAAoD;IACpD,MAAM,MAAM,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,0BAA0B,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7D,OAAO,OAAyC,CAAC;AACnD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAAgB;IAQzD,MAAM,MAAM,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,SAAS,GAAG,iCAAiC,CAAC,QAAQ,CAAC,CAAC;IAE9D,OAAO;QACL,cAAc,EAAE,MAAM;QACtB,cAAc,EAAE,iBAAiB,CAAC,QAAQ,CAAC;QAC3C,uBAAuB,EAAE,0BAA0B,CAAC,QAAQ,CAAC;QAC7D,cAAc,EAAE,2BAA2B,CAAC,QAAQ,CAAC;QACrD,oBAAoB,EAAE,SAAS;QAC/B,WAAW,EAAE,SAAS,EAAE,YAAY,IAAI,IAAI;KAC7C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Parameter Suggestion Module
3
+ *
4
+ * Provides pre-built example payloads for common F5XC API operations
5
+ * to help AI assistants construct correct request bodies without guessing.
6
+ *
7
+ * Enhanced with schema-based generation and smart defaults fallback.
8
+ */
9
+ import { type MutuallyExclusiveGroup } from "./schema.js";
10
+ /**
11
+ * Extended suggestion result with rich metadata
12
+ */
13
+ export interface SuggestionResult {
14
+ /** The example payload to use */
15
+ examplePayload: Record<string, unknown>;
16
+ /** Human-readable description */
17
+ description: string;
18
+ /** Source of the example */
19
+ source: "curated" | "spec" | "generated";
20
+ /** Required fields that must be provided */
21
+ requiredFields?: string[];
22
+ /** Mutually exclusive field groups */
23
+ mutuallyExclusiveGroups?: MutuallyExclusiveGroup[];
24
+ /** Usage notes and tips */
25
+ notes?: string[];
26
+ /** cURL example if available */
27
+ curlExample?: string;
28
+ /** YAML example if available */
29
+ yamlExample?: string;
30
+ }
31
+ /**
32
+ * Get suggested parameters for a tool with fallback chain
33
+ *
34
+ * Priority order:
35
+ * 1. x-f5xc-minimum-configuration.example_json (from spec)
36
+ * 2. COMMON_EXAMPLES (curated)
37
+ * 3. Schema-generated with smart defaults
38
+ *
39
+ * @param toolName - The exact tool name
40
+ * @returns Suggested parameters with metadata or null if unavailable
41
+ */
42
+ export declare function suggestParameters(toolName: string): SuggestionResult | null;
43
+ /**
44
+ * Get suggested parameters (legacy interface for backward compatibility)
45
+ *
46
+ * @deprecated Use suggestParameters() for richer metadata
47
+ */
48
+ export declare function suggestParametersLegacy(toolName: string): {
49
+ examplePayload: Record<string, unknown>;
50
+ description: string;
51
+ notes?: string[];
52
+ } | null;
53
+ /**
54
+ * Get all available example tools (curated only)
55
+ *
56
+ * @returns List of tool names that have curated pre-built examples
57
+ */
58
+ export declare function getAvailableExamples(): string[];
59
+ /**
60
+ * Check if a tool has suggested parameters (from any source)
61
+ *
62
+ * @param toolName - The exact tool name
63
+ * @returns True if examples are available from any source
64
+ */
65
+ export declare function hasSuggestedParameters(toolName: string): boolean;
66
+ /**
67
+ * Check if a tool has curated examples (not generated)
68
+ *
69
+ * @param toolName - The exact tool name
70
+ * @returns True if curated examples exist
71
+ */
72
+ export declare function hasCuratedExample(toolName: string): boolean;
73
+ /**
74
+ * Get suggestion source for a tool
75
+ *
76
+ * @param toolName - The exact tool name
77
+ * @returns Source type or null if no suggestions available
78
+ */
79
+ export declare function getSuggestionSource(toolName: string): "curated" | "spec" | "generated" | null;
80
+ /**
81
+ * Get statistics about available suggestions
82
+ */
83
+ export declare function getSuggestionStats(): {
84
+ curatedCount: number;
85
+ curatedTools: string[];
86
+ };
87
+ //# sourceMappingURL=suggest-params.d.ts.map
@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