@robinmordasiewicz/f5xc-api-mcp 2.0.3-2601050134 → 2.0.10-2601051503
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/generator/domain-metadata.d.ts +207 -7
- package/dist/generator/domain-metadata.d.ts.map +1 -1
- package/dist/generator/domain-metadata.js +293 -21
- package/dist/generator/domain-metadata.js.map +1 -1
- package/dist/generator/naming/acronyms.d.ts +9 -2
- package/dist/generator/naming/acronyms.d.ts.map +1 -1
- package/dist/generator/naming/acronyms.js +35 -129
- package/dist/generator/naming/acronyms.js.map +1 -1
- package/dist/generator/naming/index.d.ts +1 -1
- package/dist/generator/naming/index.d.ts.map +1 -1
- package/dist/generator/naming/index.js +1 -1
- package/dist/generator/naming/index.js.map +1 -1
- package/dist/generator/openapi-parser.d.ts +23 -0
- package/dist/generator/openapi-parser.d.ts.map +1 -1
- package/dist/generator/openapi-parser.js +14 -0
- package/dist/generator/openapi-parser.js.map +1 -1
- package/dist/prompts/error-resolution.d.ts +7 -24
- package/dist/prompts/error-resolution.d.ts.map +1 -1
- package/dist/prompts/error-resolution.js +94 -296
- package/dist/prompts/error-resolution.js.map +1 -1
- package/dist/prompts/index.d.ts +2 -2
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +3 -3
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/workflows.d.ts +8 -16
- package/dist/prompts/workflows.d.ts.map +1 -1
- package/dist/prompts/workflows.js +100 -306
- package/dist/prompts/workflows.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +9 -7
- package/dist/server.js.map +1 -1
- package/dist/tools/discovery/best-practices.d.ts +4 -0
- package/dist/tools/discovery/best-practices.d.ts.map +1 -1
- package/dist/tools/discovery/best-practices.js +158 -225
- package/dist/tools/discovery/best-practices.js.map +1 -1
- package/dist/tools/discovery/cost-estimator.d.ts.map +1 -1
- package/dist/tools/discovery/cost-estimator.js +16 -4
- package/dist/tools/discovery/cost-estimator.js.map +1 -1
- package/dist/tools/discovery/index-loader.d.ts.map +1 -1
- package/dist/tools/discovery/index-loader.js +2 -0
- package/dist/tools/discovery/index-loader.js.map +1 -1
- package/dist/tools/discovery/types.d.ts +2 -0
- package/dist/tools/discovery/types.d.ts.map +1 -1
- package/dist/tools/generated/dependency-graph.json +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +2 -2
- package/dist/version.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/specs/domains/admin_console_and_ui.json +25 -25
- package/specs/domains/ai_services.json +21 -21
- package/specs/domains/api.json +173 -183
- package/specs/domains/authentication.json +45 -45
- package/specs/domains/bigip.json +94 -94
- package/specs/domains/billing_and_usage.json +63 -63
- package/specs/domains/blindfold.json +109 -109
- package/specs/domains/bot_and_threat_defense.json +65 -65
- package/specs/domains/cdn.json +177 -557
- package/specs/domains/ce_management.json +111 -111
- package/specs/domains/certificates.json +75 -75
- package/specs/domains/cloud_infrastructure.json +112 -112
- package/specs/domains/container_services.json +91 -146
- package/specs/domains/data_and_privacy_security.json +66 -66
- package/specs/domains/data_intelligence.json +62 -62
- package/specs/domains/ddos.json +154 -154
- package/specs/domains/dns.json +148 -168
- package/specs/domains/managed_kubernetes.json +85 -85
- package/specs/domains/marketplace.json +103 -103
- package/specs/domains/network.json +230 -230
- package/specs/domains/network_security.json +187 -197
- package/specs/domains/nginx_one.json +62 -62
- package/specs/domains/object_storage.json +12 -12
- package/specs/domains/observability.json +102 -102
- package/specs/domains/rate_limiting.json +52 -52
- package/specs/domains/secops_and_incident_response.json +36 -36
- package/specs/domains/service_mesh.json +119 -124
- package/specs/domains/shape.json +313 -313
- package/specs/domains/sites.json +349 -349
- package/specs/domains/statistics.json +225 -225
- package/specs/domains/support.json +108 -108
- package/specs/domains/telemetry_and_insights.json +72 -72
- package/specs/domains/tenant_and_identity.json +268 -273
- package/specs/domains/threat_campaign.json +66 -86
- package/specs/domains/users.json +66 -66
- package/specs/domains/virtual.json +244 -874
- package/specs/domains/vpm_and_node_management.json +1 -1
- package/specs/domains/waf.json +139 -334
- package/specs/index.json +1661 -184
|
@@ -2,339 +2,131 @@
|
|
|
2
2
|
* Error Resolution Prompts (Phase B)
|
|
3
3
|
*
|
|
4
4
|
* Provides guided diagnosis and resolution workflows for common
|
|
5
|
-
* F5XC API errors.
|
|
6
|
-
* systematically with framework-specific guidance.
|
|
5
|
+
* F5XC API errors. Prompts are now sourced from upstream x-f5xc-error-resolution (v2.0.8+).
|
|
7
6
|
*/
|
|
7
|
+
import { getHttpErrorResolution, getAllHttpErrorCodes, } from "../generator/domain-metadata.js";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Convert upstream HttpErrorResolution to ErrorPrompt format
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
function convertToErrorPrompt(error) {
|
|
12
|
+
// Build template from upstream data
|
|
13
|
+
const causesList = error.commonCauses.map((cause, i) => `${i + 1}. ${cause}`).join("\n");
|
|
14
|
+
const stepsList = error.diagnosticSteps
|
|
15
|
+
.map((step) => {
|
|
16
|
+
let content = `### Step ${step.step}: ${step.action}\n`;
|
|
17
|
+
content += `${step.description}\n`;
|
|
18
|
+
if (step.command) {
|
|
19
|
+
content += `\n\`\`\`\n${step.command}\n\`\`\`\n`;
|
|
20
|
+
}
|
|
21
|
+
return content;
|
|
22
|
+
})
|
|
23
|
+
.join("\n");
|
|
24
|
+
const preventionList = error.prevention.map((p) => `- ${p}`).join("\n");
|
|
25
|
+
const relatedList = error.relatedErrors.length > 0
|
|
26
|
+
? `\n## Related Errors\n${error.relatedErrors.map((e) => `- ${e}`).join("\n")}`
|
|
27
|
+
: "";
|
|
28
|
+
const template = `# ${error.code} ${error.name} - Resolution Guide
|
|
29
|
+
|
|
30
|
+
${error.description}
|
|
28
31
|
|
|
29
32
|
## Common Causes
|
|
30
|
-
|
|
31
|
-
2. **Expired Token**: API token has expired and needs regeneration
|
|
32
|
-
3. **Invalid Token**: Token was revoked or is malformed
|
|
33
|
-
4. **Wrong Tenant**: Token is for a different F5XC tenant
|
|
33
|
+
${causesList}
|
|
34
34
|
|
|
35
35
|
## Diagnosis Steps
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
### Step 2: Validate Token
|
|
43
|
-
Use f5xc-api-server-info to check authentication status.
|
|
44
|
-
If not authenticated, the token needs to be set or refreshed.
|
|
45
|
-
|
|
46
|
-
### Step 3: Token Regeneration
|
|
47
|
-
If the token is expired:
|
|
48
|
-
1. Log into F5 Distributed Cloud Console
|
|
49
|
-
2. Navigate to Account Settings → Credentials
|
|
50
|
-
3. Generate a new API Token
|
|
51
|
-
4. Set F5XC_API_TOKEN with the new value
|
|
52
|
-
|
|
53
|
-
## Related Tools
|
|
54
|
-
- f5xc-api-server-info: Check current authentication status
|
|
55
|
-
- f5xc-api-search-tools: Find authentication-related operations
|
|
56
|
-
|
|
37
|
+
${stepsList}
|
|
38
|
+
## Prevention
|
|
39
|
+
${preventionList}
|
|
40
|
+
${relatedList}
|
|
57
41
|
## Resolution Checklist
|
|
58
|
-
- [ ]
|
|
59
|
-
- [ ]
|
|
60
|
-
- [ ]
|
|
61
|
-
- [ ]
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
* 403 Forbidden - Authorization Issues
|
|
66
|
-
*/
|
|
67
|
-
export const error403Prompt = {
|
|
68
|
-
code: 403,
|
|
69
|
-
name: "resolve-403-forbidden",
|
|
70
|
-
description: "Diagnose and resolve authorization failures (403 Forbidden)",
|
|
71
|
-
arguments: [
|
|
42
|
+
- [ ] Review error details and context
|
|
43
|
+
- [ ] Follow diagnostic steps systematically
|
|
44
|
+
- [ ] Apply appropriate resolution
|
|
45
|
+
- [ ] Verify operation succeeds after fix
|
|
46
|
+
`;
|
|
47
|
+
// Standard arguments for error prompts
|
|
48
|
+
const args = [
|
|
72
49
|
{
|
|
73
50
|
name: "operation",
|
|
74
51
|
description: "The API operation that failed",
|
|
75
52
|
required: false,
|
|
76
53
|
},
|
|
77
54
|
{
|
|
78
|
-
name: "
|
|
79
|
-
description: "The
|
|
80
|
-
required: false,
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: "resource",
|
|
84
|
-
description: "The resource type being accessed",
|
|
85
|
-
required: false,
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
template: `# 403 Forbidden - Authorization Resolution
|
|
89
|
-
|
|
90
|
-
## Common Causes
|
|
91
|
-
1. **Insufficient Permissions**: User lacks RBAC permissions for this operation
|
|
92
|
-
2. **Namespace Restrictions**: User cannot access resources in this namespace
|
|
93
|
-
3. **Resource-Level Policies**: Resource has access restrictions
|
|
94
|
-
4. **Subscription Required**: Operation requires an addon service subscription
|
|
95
|
-
|
|
96
|
-
## Diagnosis Steps
|
|
97
|
-
|
|
98
|
-
### Step 1: Check User Roles
|
|
99
|
-
Verify your user account has appropriate roles:
|
|
100
|
-
- Namespace Admin: Full access within namespace
|
|
101
|
-
- Tenant Admin: Full access across tenant
|
|
102
|
-
- Custom roles: Check specific permissions
|
|
103
|
-
|
|
104
|
-
### Step 2: Verify Namespace Access
|
|
105
|
-
Ensure you have access to the target namespace.
|
|
106
|
-
Use f5xc-api-search-tools with query "namespace" to find namespace operations.
|
|
107
|
-
|
|
108
|
-
### Step 3: Check Subscription Requirements
|
|
109
|
-
Some features require addon subscriptions:
|
|
110
|
-
- WAAP Advanced features
|
|
111
|
-
- Bot Defense
|
|
112
|
-
- API Security
|
|
113
|
-
|
|
114
|
-
Use f5xc-api-dependencies with action="subscriptions" to check requirements.
|
|
115
|
-
|
|
116
|
-
## Related Tools
|
|
117
|
-
- f5xc-api-dependencies: Check subscription requirements
|
|
118
|
-
- f5xc-api-search-tools: Find user/role operations
|
|
119
|
-
|
|
120
|
-
## Resolution Checklist
|
|
121
|
-
- [ ] Verify user role includes required permissions
|
|
122
|
-
- [ ] Confirm namespace access is granted
|
|
123
|
-
- [ ] Check if addon subscription is required
|
|
124
|
-
- [ ] Contact tenant admin if permissions needed
|
|
125
|
-
`,
|
|
126
|
-
};
|
|
127
|
-
/**
|
|
128
|
-
* 404 Not Found - Resource Issues
|
|
129
|
-
*/
|
|
130
|
-
export const error404Prompt = {
|
|
131
|
-
code: 404,
|
|
132
|
-
name: "resolve-404-not-found",
|
|
133
|
-
description: "Diagnose and resolve resource not found errors (404 Not Found)",
|
|
134
|
-
arguments: [
|
|
135
|
-
{
|
|
136
|
-
name: "resource_type",
|
|
137
|
-
description: "The type of resource (e.g., 'http-loadbalancer')",
|
|
138
|
-
required: false,
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: "resource_name",
|
|
142
|
-
description: "The name of the missing resource",
|
|
55
|
+
name: "error_message",
|
|
56
|
+
description: "The specific error message received",
|
|
143
57
|
required: false,
|
|
144
58
|
},
|
|
145
|
-
|
|
59
|
+
];
|
|
60
|
+
// Add context-specific arguments based on error type
|
|
61
|
+
if (error.code === 403 || error.code === 404) {
|
|
62
|
+
args.push({
|
|
146
63
|
name: "namespace",
|
|
147
|
-
description: "The namespace being
|
|
64
|
+
description: "The namespace being accessed",
|
|
148
65
|
required: false,
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
template: `# 404 Not Found - Resource Resolution
|
|
152
|
-
|
|
153
|
-
## Common Causes
|
|
154
|
-
1. **Resource Doesn't Exist**: The specified resource hasn't been created
|
|
155
|
-
2. **Wrong Namespace**: Resource exists in a different namespace
|
|
156
|
-
3. **Typo in Name**: Resource name is misspelled
|
|
157
|
-
4. **Deleted Resource**: Resource was previously deleted
|
|
158
|
-
5. **Wrong Domain**: Using incorrect API domain for this resource type
|
|
159
|
-
|
|
160
|
-
## Diagnosis Steps
|
|
161
|
-
|
|
162
|
-
### Step 1: Verify Resource Exists
|
|
163
|
-
Use the list operation to check if the resource exists:
|
|
164
|
-
- Search for list operations: f5xc-api-search-tools with query "list [resource_type]"
|
|
165
|
-
- Execute list in the target namespace
|
|
166
|
-
|
|
167
|
-
### Step 2: Check Other Namespaces
|
|
168
|
-
The resource might exist in a different namespace:
|
|
169
|
-
- List all namespaces
|
|
170
|
-
- Search for resource in each namespace
|
|
171
|
-
|
|
172
|
-
### Step 3: Verify Resource Type
|
|
173
|
-
Ensure you're using the correct resource type and API domain:
|
|
174
|
-
- Use f5xc-api-search-resources to find the correct resource
|
|
175
|
-
- Check domain matches (e.g., 'virtual' for load balancers)
|
|
176
|
-
|
|
177
|
-
## Related Tools
|
|
178
|
-
- f5xc-api-search-resources: Find resources by name
|
|
179
|
-
- f5xc-api-search-tools: Find list operations
|
|
180
|
-
|
|
181
|
-
## Resolution Checklist
|
|
182
|
-
- [ ] Verify resource name spelling
|
|
183
|
-
- [ ] Check correct namespace is specified
|
|
184
|
-
- [ ] Use list operation to find existing resources
|
|
185
|
-
- [ ] Create resource if it doesn't exist
|
|
186
|
-
`,
|
|
187
|
-
};
|
|
188
|
-
/**
|
|
189
|
-
* 409 Conflict - Resource Conflict Issues
|
|
190
|
-
*/
|
|
191
|
-
export const error409Prompt = {
|
|
192
|
-
code: 409,
|
|
193
|
-
name: "resolve-409-conflict",
|
|
194
|
-
description: "Diagnose and resolve resource conflict errors (409 Conflict)",
|
|
195
|
-
arguments: [
|
|
196
|
-
{
|
|
66
|
+
});
|
|
67
|
+
args.push({
|
|
197
68
|
name: "resource_type",
|
|
198
|
-
description: "The type of resource
|
|
69
|
+
description: "The type of resource being accessed",
|
|
199
70
|
required: false,
|
|
200
|
-
}
|
|
201
|
-
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if (error.code === 409) {
|
|
74
|
+
args.push({
|
|
202
75
|
name: "resource_name",
|
|
203
76
|
description: "The name of the conflicting resource",
|
|
204
77
|
required: false,
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
3. **State Conflict**: Resource is in a transitional state
|
|
218
|
-
4. **Dependency Conflict**: Operation conflicts with dependent resources
|
|
219
|
-
5. **Concurrent Modification**: Race condition with another update
|
|
220
|
-
|
|
221
|
-
## Diagnosis Steps
|
|
222
|
-
|
|
223
|
-
### Step 1: Check for Existing Resource
|
|
224
|
-
Use get/list operations to check current resource state:
|
|
225
|
-
- If creating: resource may already exist
|
|
226
|
-
- If updating: resource may have been modified
|
|
227
|
-
|
|
228
|
-
### Step 2: Check Resource Dependencies
|
|
229
|
-
Use f5xc-api-dependencies to understand relationships:
|
|
230
|
-
- Check what depends on this resource
|
|
231
|
-
- Check what this resource depends on
|
|
232
|
-
|
|
233
|
-
### Step 3: Handle Version Conflicts
|
|
234
|
-
For update operations:
|
|
235
|
-
- Fetch latest version of resource
|
|
236
|
-
- Apply changes to fresh copy
|
|
237
|
-
- Retry update with current version
|
|
238
|
-
|
|
239
|
-
## Related Tools
|
|
240
|
-
- f5xc-api-dependencies: Check resource relationships
|
|
241
|
-
- f5xc-api-describe-tool: Get full schema for retry
|
|
242
|
-
|
|
243
|
-
## Resolution Checklist
|
|
244
|
-
- [ ] Check if resource already exists (for creates)
|
|
245
|
-
- [ ] Fetch latest resource version (for updates)
|
|
246
|
-
- [ ] Wait for transitional states to complete
|
|
247
|
-
- [ ] Resolve dependency conflicts first
|
|
248
|
-
- [ ] Retry operation with fresh data
|
|
249
|
-
`,
|
|
250
|
-
};
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
code: error.code,
|
|
82
|
+
name: `resolve-${error.code}-${error.name.toLowerCase().replace(/\s+/g, "-")}`,
|
|
83
|
+
description: `Diagnose and resolve ${error.name} errors (${error.code})`,
|
|
84
|
+
arguments: args,
|
|
85
|
+
template,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// Cache for generated error prompts
|
|
89
|
+
let cachedErrorPrompts = null;
|
|
251
90
|
/**
|
|
252
|
-
*
|
|
91
|
+
* Load error prompts from upstream data
|
|
253
92
|
*/
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
required: false,
|
|
268
|
-
},
|
|
269
|
-
],
|
|
270
|
-
template: `# 500 Internal Server Error - Resolution Guide
|
|
271
|
-
|
|
272
|
-
## Common Causes
|
|
273
|
-
1. **Transient Service Issue**: Temporary backend problem
|
|
274
|
-
2. **Invalid Request Body**: Malformed or invalid request data
|
|
275
|
-
3. **Backend Timeout**: Long-running operation timed out
|
|
276
|
-
4. **Service Maintenance**: Planned or unplanned maintenance
|
|
277
|
-
5. **Rate Limiting**: Too many requests in short period
|
|
278
|
-
|
|
279
|
-
## Diagnosis Steps
|
|
280
|
-
|
|
281
|
-
### Step 1: Validate Request
|
|
282
|
-
Check if request body is valid:
|
|
283
|
-
- Use f5xc-api-describe-tool to verify parameter requirements
|
|
284
|
-
- Check required fields and formats
|
|
285
|
-
- Validate JSON structure
|
|
286
|
-
|
|
287
|
-
### Step 2: Retry with Exponential Backoff
|
|
288
|
-
For transient issues:
|
|
289
|
-
- Wait 1 second, retry
|
|
290
|
-
- If fails, wait 2 seconds, retry
|
|
291
|
-
- Continue doubling wait time (max 30 seconds)
|
|
292
|
-
|
|
293
|
-
### Step 3: Simplify Operation
|
|
294
|
-
Try breaking complex operations into simpler steps:
|
|
295
|
-
- Create dependencies separately
|
|
296
|
-
- Reduce request complexity
|
|
297
|
-
- Check for optional fields causing issues
|
|
298
|
-
|
|
299
|
-
### Step 4: Check Service Status
|
|
300
|
-
If errors persist:
|
|
301
|
-
- Check F5 Distributed Cloud status page
|
|
302
|
-
- Review system announcements
|
|
303
|
-
- Contact F5 support if widespread issue
|
|
304
|
-
|
|
305
|
-
## Related Tools
|
|
306
|
-
- f5xc-api-describe-tool: Validate request schema
|
|
307
|
-
- f5xc-api-dependencies: Check prerequisites
|
|
308
|
-
|
|
309
|
-
## Resolution Checklist
|
|
310
|
-
- [ ] Validate request body against schema
|
|
311
|
-
- [ ] Retry with exponential backoff
|
|
312
|
-
- [ ] Simplify request if complex
|
|
313
|
-
- [ ] Check F5 service status
|
|
314
|
-
- [ ] Contact support if persistent
|
|
315
|
-
`,
|
|
316
|
-
};
|
|
93
|
+
function loadErrorPrompts() {
|
|
94
|
+
if (cachedErrorPrompts) {
|
|
95
|
+
return cachedErrorPrompts;
|
|
96
|
+
}
|
|
97
|
+
const codes = getAllHttpErrorCodes();
|
|
98
|
+
cachedErrorPrompts = codes
|
|
99
|
+
.map((code) => {
|
|
100
|
+
const resolution = getHttpErrorResolution(code);
|
|
101
|
+
return resolution ? convertToErrorPrompt(resolution) : null;
|
|
102
|
+
})
|
|
103
|
+
.filter((p) => p !== null);
|
|
104
|
+
return cachedErrorPrompts;
|
|
105
|
+
}
|
|
317
106
|
/**
|
|
318
|
-
*
|
|
107
|
+
* Get all error prompts (dynamically generated from upstream)
|
|
319
108
|
*/
|
|
320
|
-
export
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
error404Prompt,
|
|
324
|
-
error409Prompt,
|
|
325
|
-
error500Prompt,
|
|
326
|
-
];
|
|
109
|
+
export function getErrorPrompts() {
|
|
110
|
+
return loadErrorPrompts();
|
|
111
|
+
}
|
|
327
112
|
/**
|
|
328
113
|
* Get error prompt by HTTP status code
|
|
329
114
|
*/
|
|
330
115
|
export function getErrorPrompt(code) {
|
|
331
|
-
|
|
116
|
+
const resolution = getHttpErrorResolution(code);
|
|
117
|
+
if (resolution) {
|
|
118
|
+
return convertToErrorPrompt(resolution);
|
|
119
|
+
}
|
|
120
|
+
// Fall back to searching all prompts
|
|
121
|
+
const prompts = loadErrorPrompts();
|
|
122
|
+
return prompts.find((p) => p.code === code);
|
|
332
123
|
}
|
|
333
124
|
/**
|
|
334
125
|
* Get error prompt by name
|
|
335
126
|
*/
|
|
336
127
|
export function getErrorPromptByName(name) {
|
|
337
|
-
|
|
128
|
+
const prompts = loadErrorPrompts();
|
|
129
|
+
return prompts.find((p) => p.name === name);
|
|
338
130
|
}
|
|
339
131
|
/**
|
|
340
132
|
* Process error prompt template with arguments
|
|
@@ -347,4 +139,10 @@ export function processErrorTemplate(prompt, args) {
|
|
|
347
139
|
}
|
|
348
140
|
return processed;
|
|
349
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Clear cached error prompts (useful for testing)
|
|
144
|
+
*/
|
|
145
|
+
export function clearErrorCache() {
|
|
146
|
+
cachedErrorPrompts = null;
|
|
147
|
+
}
|
|
350
148
|
//# sourceMappingURL=error-resolution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-resolution.js","sourceRoot":"","sources":["../../src/prompts/error-resolution.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"error-resolution.js","sourceRoot":"","sources":["../../src/prompts/error-resolution.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GAGrB,MAAM,iCAAiC,CAAC;AA8BzC;;GAEG;AACH,SAAS,oBAAoB,CAAC,KAA0B;IACtD,oCAAoC;IACpC,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEzF,MAAM,SAAS,GAAG,KAAK,CAAC,eA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AC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,kBAAkB,GAAG,IAAI,CAAC;AAC5B,CAAC"}
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Prompts Module - Export all prompt utilities
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
4
|
+
export { getWorkflowPrompts, getWorkflowPrompt, processPromptTemplate, clearWorkflowCache, } from "./workflows.js";
|
|
5
5
|
export type { WorkflowPrompt, WorkflowArgument } from "./workflows.js";
|
|
6
|
-
export {
|
|
6
|
+
export { getErrorPrompts, getErrorPrompt, getErrorPromptByName, processErrorTemplate, clearErrorCache, } from "./error-resolution.js";
|
|
7
7
|
export type { ErrorPrompt, ErrorPromptArgument } from "./error-resolution.js";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvE,OAAO,EACL,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Prompts Module - Export all prompt utilities
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
5
|
-
// Phase B: Error resolution prompts
|
|
6
|
-
export {
|
|
4
|
+
export { getWorkflowPrompts, getWorkflowPrompt, processPromptTemplate, clearWorkflowCache, } from "./workflows.js";
|
|
5
|
+
// Phase B: Error resolution prompts (now sourced from upstream)
|
|
6
|
+
export { getErrorPrompts, getErrorPrompt, getErrorPromptByName, processErrorTemplate, clearErrorCache, } from "./error-resolution.js";
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAIxB,gEAAgE;AAChE,OAAO,EACL,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,GAChB,MAAM,uBAAuB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* MCP Workflow Prompts
|
|
3
3
|
*
|
|
4
4
|
* Provides guided workflows for common F5XC operations.
|
|
5
|
-
*
|
|
5
|
+
* Workflows are now sourced from upstream x-f5xc-guided-workflows (v2.0.8+).
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Workflow prompt definition
|
|
@@ -29,27 +29,19 @@ export interface WorkflowArgument {
|
|
|
29
29
|
required: boolean;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* All workflow prompts (dynamically generated from upstream)
|
|
33
33
|
*/
|
|
34
|
-
export declare
|
|
34
|
+
export declare function getWorkflowPrompts(): WorkflowPrompt[];
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
export declare const configureWafPrompt: WorkflowPrompt;
|
|
39
|
-
/**
|
|
40
|
-
* Create Multi-Cloud Site workflow
|
|
41
|
-
*/
|
|
42
|
-
export declare const createMultiCloudSitePrompt: WorkflowPrompt;
|
|
43
|
-
/**
|
|
44
|
-
* All workflow prompts
|
|
45
|
-
*/
|
|
46
|
-
export declare const WORKFLOW_PROMPTS: WorkflowPrompt[];
|
|
47
|
-
/**
|
|
48
|
-
* Get workflow prompt by name
|
|
36
|
+
* Get workflow prompt by name/ID
|
|
49
37
|
*/
|
|
50
38
|
export declare function getWorkflowPrompt(name: string): WorkflowPrompt | undefined;
|
|
51
39
|
/**
|
|
52
40
|
* Process prompt template with arguments
|
|
53
41
|
*/
|
|
54
42
|
export declare function processPromptTemplate(template: string, args: Record<string, string>): string;
|
|
43
|
+
/**
|
|
44
|
+
* Clear cached workflow prompts (useful for testing)
|
|
45
|
+
*/
|
|
46
|
+
export declare function clearWorkflowCache(): void;
|
|
55
47
|
//# sourceMappingURL=workflows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/prompts/workflows.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/prompts/workflows.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAyGD;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAErD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAU1E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAuB5F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|