@robinmordasiewicz/f5xc-api-mcp 3.10.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/prompts/error-resolution.d.ts +70 -0
- package/dist/prompts/error-resolution.d.ts.map +1 -0
- package/dist/prompts/error-resolution.js +350 -0
- package/dist/prompts/error-resolution.js.map +1 -0
- package/dist/prompts/index.d.ts +2 -0
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +2 -0
- package/dist/prompts/index.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +265 -3
- 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-loader.d.ts.map +1 -1
- package/dist/tools/discovery/index-loader.js +3 -0
- package/dist/tools/discovery/index-loader.js.map +1 -1
- package/dist/tools/discovery/index.d.ts +145 -0
- package/dist/tools/discovery/index.d.ts.map +1 -1
- package/dist/tools/discovery/index.js +141 -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/discovery/search.d.ts.map +1 -1
- package/dist/tools/discovery/search.js +23 -2
- package/dist/tools/discovery/search.js.map +1 -1
- package/dist/tools/discovery/types.d.ts +21 -0
- package/dist/tools/discovery/types.d.ts.map +1 -1
- package/dist/tools/discovery/validate.d.ts +63 -0
- package/dist/tools/discovery/validate.d.ts.map +1 -0
- package/dist/tools/discovery/validate.js +239 -0
- package/dist/tools/discovery/validate.js.map +1 -0
- package/dist/tools/generated/dependency-graph.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Resolution Prompts (Phase B)
|
|
3
|
+
*
|
|
4
|
+
* Provides guided diagnosis and resolution workflows for common
|
|
5
|
+
* F5XC API errors. These prompts help users troubleshoot issues
|
|
6
|
+
* systematically with framework-specific guidance.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Error resolution prompt definition
|
|
10
|
+
*/
|
|
11
|
+
export interface ErrorPrompt {
|
|
12
|
+
/** HTTP status code */
|
|
13
|
+
code: number;
|
|
14
|
+
/** Error type name */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Human-readable description */
|
|
17
|
+
description: string;
|
|
18
|
+
/** Prompt arguments */
|
|
19
|
+
arguments: ErrorPromptArgument[];
|
|
20
|
+
/** Prompt template */
|
|
21
|
+
template: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Error prompt argument
|
|
25
|
+
*/
|
|
26
|
+
export interface ErrorPromptArgument {
|
|
27
|
+
/** Argument name */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Argument description */
|
|
30
|
+
description: string;
|
|
31
|
+
/** Whether argument is required */
|
|
32
|
+
required: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 401 Unauthorized - Authentication Issues
|
|
36
|
+
*/
|
|
37
|
+
export declare const error401Prompt: ErrorPrompt;
|
|
38
|
+
/**
|
|
39
|
+
* 403 Forbidden - Authorization Issues
|
|
40
|
+
*/
|
|
41
|
+
export declare const error403Prompt: ErrorPrompt;
|
|
42
|
+
/**
|
|
43
|
+
* 404 Not Found - Resource Issues
|
|
44
|
+
*/
|
|
45
|
+
export declare const error404Prompt: ErrorPrompt;
|
|
46
|
+
/**
|
|
47
|
+
* 409 Conflict - Resource Conflict Issues
|
|
48
|
+
*/
|
|
49
|
+
export declare const error409Prompt: ErrorPrompt;
|
|
50
|
+
/**
|
|
51
|
+
* 500 Internal Server Error - Server Issues
|
|
52
|
+
*/
|
|
53
|
+
export declare const error500Prompt: ErrorPrompt;
|
|
54
|
+
/**
|
|
55
|
+
* All error resolution prompts
|
|
56
|
+
*/
|
|
57
|
+
export declare const ERROR_PROMPTS: ErrorPrompt[];
|
|
58
|
+
/**
|
|
59
|
+
* Get error prompt by HTTP status code
|
|
60
|
+
*/
|
|
61
|
+
export declare function getErrorPrompt(code: number): ErrorPrompt | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Get error prompt by name
|
|
64
|
+
*/
|
|
65
|
+
export declare function getErrorPromptByName(name: string): ErrorPrompt | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Process error prompt template with arguments
|
|
68
|
+
*/
|
|
69
|
+
export declare function processErrorTemplate(prompt: ErrorPrompt, args: Record<string, string>): string;
|
|
70
|
+
//# sourceMappingURL=error-resolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-resolution.d.ts","sourceRoot":"","sources":["../../src/prompts/error-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,WAoD5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,WA2D5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,WAyD5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,WA2D5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,WA8D5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,WAAW,EAMtC,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEpE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAE1E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAS9F"}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Resolution Prompts (Phase B)
|
|
3
|
+
*
|
|
4
|
+
* Provides guided diagnosis and resolution workflows for common
|
|
5
|
+
* F5XC API errors. These prompts help users troubleshoot issues
|
|
6
|
+
* systematically with framework-specific guidance.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* 401 Unauthorized - Authentication Issues
|
|
10
|
+
*/
|
|
11
|
+
export const error401Prompt = {
|
|
12
|
+
code: 401,
|
|
13
|
+
name: "resolve-401-unauthorized",
|
|
14
|
+
description: "Diagnose and resolve authentication failures (401 Unauthorized)",
|
|
15
|
+
arguments: [
|
|
16
|
+
{
|
|
17
|
+
name: "operation",
|
|
18
|
+
description: "The API operation that failed (e.g., 'create http-loadbalancer')",
|
|
19
|
+
required: false,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "error_message",
|
|
23
|
+
description: "The specific error message received",
|
|
24
|
+
required: false,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
template: `# 401 Unauthorized - Authentication Resolution
|
|
28
|
+
|
|
29
|
+
## Common Causes
|
|
30
|
+
1. **Missing API Token**: F5XC_API_TOKEN environment variable not set
|
|
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
|
|
34
|
+
|
|
35
|
+
## Diagnosis Steps
|
|
36
|
+
|
|
37
|
+
### Step 1: Verify Token Configuration
|
|
38
|
+
Check if the API token is properly configured:
|
|
39
|
+
- Environment variable: F5XC_API_TOKEN
|
|
40
|
+
- Tenant URL: F5XC_API_URL
|
|
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
|
+
|
|
57
|
+
## Resolution Checklist
|
|
58
|
+
- [ ] Verify F5XC_API_TOKEN is set
|
|
59
|
+
- [ ] Verify F5XC_API_URL points to correct tenant
|
|
60
|
+
- [ ] Check token expiration in Console
|
|
61
|
+
- [ ] Regenerate token if needed
|
|
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: [
|
|
72
|
+
{
|
|
73
|
+
name: "operation",
|
|
74
|
+
description: "The API operation that failed",
|
|
75
|
+
required: false,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "namespace",
|
|
79
|
+
description: "The namespace where the operation was attempted",
|
|
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",
|
|
143
|
+
required: false,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "namespace",
|
|
147
|
+
description: "The namespace being searched",
|
|
148
|
+
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
|
+
{
|
|
197
|
+
name: "resource_type",
|
|
198
|
+
description: "The type of resource involved",
|
|
199
|
+
required: false,
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "resource_name",
|
|
203
|
+
description: "The name of the conflicting resource",
|
|
204
|
+
required: false,
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "operation",
|
|
208
|
+
description: "The operation attempted (create/update/delete)",
|
|
209
|
+
required: false,
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
template: `# 409 Conflict - Resource Conflict Resolution
|
|
213
|
+
|
|
214
|
+
## Common Causes
|
|
215
|
+
1. **Duplicate Name**: Resource with same name already exists
|
|
216
|
+
2. **Version Conflict**: Resource was modified by another operation
|
|
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
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* 500 Internal Server Error - Server Issues
|
|
253
|
+
*/
|
|
254
|
+
export const error500Prompt = {
|
|
255
|
+
code: 500,
|
|
256
|
+
name: "resolve-500-internal-error",
|
|
257
|
+
description: "Diagnose and handle internal server errors (500 Internal Server Error)",
|
|
258
|
+
arguments: [
|
|
259
|
+
{
|
|
260
|
+
name: "operation",
|
|
261
|
+
description: "The operation that triggered the error",
|
|
262
|
+
required: false,
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: "error_message",
|
|
266
|
+
description: "Any specific error message received",
|
|
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
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* All error resolution prompts
|
|
319
|
+
*/
|
|
320
|
+
export const ERROR_PROMPTS = [
|
|
321
|
+
error401Prompt,
|
|
322
|
+
error403Prompt,
|
|
323
|
+
error404Prompt,
|
|
324
|
+
error409Prompt,
|
|
325
|
+
error500Prompt,
|
|
326
|
+
];
|
|
327
|
+
/**
|
|
328
|
+
* Get error prompt by HTTP status code
|
|
329
|
+
*/
|
|
330
|
+
export function getErrorPrompt(code) {
|
|
331
|
+
return ERROR_PROMPTS.find((p) => p.code === code);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Get error prompt by name
|
|
335
|
+
*/
|
|
336
|
+
export function getErrorPromptByName(name) {
|
|
337
|
+
return ERROR_PROMPTS.find((p) => p.name === name);
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Process error prompt template with arguments
|
|
341
|
+
*/
|
|
342
|
+
export function processErrorTemplate(prompt, args) {
|
|
343
|
+
let processed = prompt.template;
|
|
344
|
+
for (const [key, value] of Object.entries(args)) {
|
|
345
|
+
const placeholder = new RegExp(`\\{\\{${key}\\}\\}`, "g");
|
|
346
|
+
processed = processed.replace(placeholder, value || `[${key}]`);
|
|
347
|
+
}
|
|
348
|
+
return processed;
|
|
349
|
+
}
|
|
350
|
+
//# sourceMappingURL=error-resolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-resolution.js","sourceRoot":"","sources":["../../src/prompts/error-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8BH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,iEAAiE;IAC9E,SAAS,EAAE;QACT;YACE,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,kEAAkE;YAC/E,QAAQ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AAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAmB,EAAE,IAA4B;IACpF,IAAI,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAEhC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,SAAS,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC1D,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,IAAI,IAAI,GAAG,GAAG,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { WORKFLOW_PROMPTS, getWorkflowPrompt, processPromptTemplate, deployHttpLoadBalancerPrompt, configureWafPrompt, createMultiCloudSitePrompt, generateTerraformPrompt, } from "./workflows.js";
|
|
5
5
|
export type { WorkflowPrompt, WorkflowArgument } from "./workflows.js";
|
|
6
|
+
export { ERROR_PROMPTS, getErrorPrompt, getErrorPromptByName, processErrorTemplate, error401Prompt, error403Prompt, error404Prompt, error409Prompt, error500Prompt, } from "./error-resolution.js";
|
|
7
|
+
export type { ErrorPrompt, ErrorPromptArgument } from "./error-resolution.js";
|
|
6
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,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,4BAA4B,EAC5B,kBAAkB,EAClB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,4BAA4B,EAC5B,kBAAkB,EAClB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvE,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
* Prompts Module - Export all prompt utilities
|
|
3
3
|
*/
|
|
4
4
|
export { WORKFLOW_PROMPTS, getWorkflowPrompt, processPromptTemplate, deployHttpLoadBalancerPrompt, configureWafPrompt, createMultiCloudSitePrompt, generateTerraformPrompt, } from "./workflows.js";
|
|
5
|
+
// Phase B: Error resolution prompts
|
|
6
|
+
export { ERROR_PROMPTS, getErrorPrompt, getErrorPromptByName, processErrorTemplate, error401Prompt, error403Prompt, error404Prompt, error409Prompt, error500Prompt, } from "./error-resolution.js";
|
|
5
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,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,4BAA4B,EAC5B,kBAAkB,EAClB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,4BAA4B,EAC5B,kBAAkB,EAClB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAIxB,oCAAoC;AACpC,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,uBAAuB,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,iBAAiB,EAAY,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,iBAAiB,EAAY,MAAM,8BAA8B,CAAC;AAyC3E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;AAED;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,SAAS,CAAqC;gBAE1C,MAAM,EAAE,YAAY;IAmBhC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAM5B;;;;;;;OAOG;IACH,OAAO,CAAC,aAAa;IAupBrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmCzB;;OAEG;IACH,OAAO,CAAC,eAAe;IAuFvB;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAa5B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3B;;OAEG;IACH,YAAY,IAAI,SAAS;IAIzB;;OAEG;IACH,oBAAoB,IAAI,iBAAiB;CAG1C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,aAAa,CAQ/D"}
|