@provartesting/provardx-cli 1.5.0-dev.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -12
- package/bin/mcp-start.js +74 -0
- package/lib/commands/provar/auth/clear.d.ts +7 -0
- package/lib/commands/provar/auth/clear.js +36 -0
- package/lib/commands/provar/auth/clear.js.map +1 -0
- package/lib/commands/provar/auth/login.d.ts +10 -0
- package/lib/commands/provar/auth/login.js +90 -0
- package/lib/commands/provar/auth/login.js.map +1 -0
- package/lib/commands/provar/auth/rotate.d.ts +7 -0
- package/lib/commands/provar/auth/rotate.js +42 -0
- package/lib/commands/provar/auth/rotate.js.map +1 -0
- package/lib/commands/provar/auth/status.d.ts +7 -0
- package/lib/commands/provar/auth/status.js +107 -0
- package/lib/commands/provar/auth/status.js.map +1 -0
- package/lib/commands/provar/mcp/start.d.ts +2 -0
- package/lib/commands/provar/mcp/start.js +14 -1
- package/lib/commands/provar/mcp/start.js.map +1 -1
- package/lib/mcp/docs/NITROX_CATALOG_SOURCE.json +6 -0
- package/lib/mcp/docs/NITROX_COMPONENT_CATALOG.md +2001 -0
- package/lib/mcp/docs/PROVAR_TEST_STEP_REFERENCE.md +1430 -0
- package/lib/mcp/docs/PROVAR_TOOL_GUIDE.md +175 -0
- package/lib/mcp/licensing/algasClient.js +14 -5
- package/lib/mcp/licensing/algasClient.js.map +1 -1
- package/lib/mcp/licensing/ideDetection.d.ts +0 -12
- package/lib/mcp/licensing/ideDetection.js +1 -73
- package/lib/mcp/licensing/ideDetection.js.map +1 -1
- package/lib/mcp/licensing/licenseCache.js +7 -1
- package/lib/mcp/licensing/licenseCache.js.map +1 -1
- package/lib/mcp/licensing/licenseValidator.d.ts +3 -3
- package/lib/mcp/licensing/licenseValidator.js +11 -4
- package/lib/mcp/licensing/licenseValidator.js.map +1 -1
- package/lib/mcp/prompts/guidePrompts.d.ts +4 -0
- package/lib/mcp/prompts/guidePrompts.js +324 -0
- package/lib/mcp/prompts/guidePrompts.js.map +1 -0
- package/lib/mcp/prompts/index.d.ts +2 -0
- package/lib/mcp/prompts/index.js +23 -0
- package/lib/mcp/prompts/index.js.map +1 -0
- package/lib/mcp/prompts/loopPrompts.d.ts +6 -0
- package/lib/mcp/prompts/loopPrompts.js +435 -0
- package/lib/mcp/prompts/loopPrompts.js.map +1 -0
- package/lib/mcp/prompts/migrationPrompts.d.ts +4 -0
- package/lib/mcp/prompts/migrationPrompts.js +207 -0
- package/lib/mcp/prompts/migrationPrompts.js.map +1 -0
- package/lib/mcp/rules/provar_best_practices_rules.json +256 -544
- package/lib/mcp/security/pathPolicy.d.ts +5 -0
- package/lib/mcp/security/pathPolicy.js +58 -3
- package/lib/mcp/security/pathPolicy.js.map +1 -1
- package/lib/mcp/server.d.ts +17 -0
- package/lib/mcp/server.js +151 -6
- package/lib/mcp/server.js.map +1 -1
- package/lib/mcp/tools/antTools.d.ts +15 -0
- package/lib/mcp/tools/antTools.js +347 -170
- package/lib/mcp/tools/antTools.js.map +1 -1
- package/lib/mcp/tools/automationTools.d.ts +18 -8
- package/lib/mcp/tools/automationTools.js +332 -176
- package/lib/mcp/tools/automationTools.js.map +1 -1
- package/lib/mcp/tools/bestPracticesEngine.js +161 -23
- package/lib/mcp/tools/bestPracticesEngine.js.map +1 -1
- package/lib/mcp/tools/connectionTools.d.ts +4 -0
- package/lib/mcp/tools/connectionTools.js +172 -0
- package/lib/mcp/tools/connectionTools.js.map +1 -0
- package/lib/mcp/tools/defectTools.d.ts +1 -1
- package/lib/mcp/tools/defectTools.js +56 -50
- package/lib/mcp/tools/defectTools.js.map +1 -1
- package/lib/mcp/tools/hierarchyValidate.d.ts +1 -1
- package/lib/mcp/tools/hierarchyValidate.js +127 -42
- package/lib/mcp/tools/hierarchyValidate.js.map +1 -1
- package/lib/mcp/tools/nitroXTools.d.ts +23 -0
- package/lib/mcp/tools/nitroXTools.js +823 -0
- package/lib/mcp/tools/nitroXTools.js.map +1 -0
- package/lib/mcp/tools/pageObjectGenerate.js +132 -57
- package/lib/mcp/tools/pageObjectGenerate.js.map +1 -1
- package/lib/mcp/tools/pageObjectValidate.js +136 -46
- package/lib/mcp/tools/pageObjectValidate.js.map +1 -1
- package/lib/mcp/tools/projectInspect.js +51 -30
- package/lib/mcp/tools/projectInspect.js.map +1 -1
- package/lib/mcp/tools/projectValidateFromPath.js +70 -49
- package/lib/mcp/tools/projectValidateFromPath.js.map +1 -1
- package/lib/mcp/tools/propertiesTools.d.ts +2 -0
- package/lib/mcp/tools/propertiesTools.js +332 -78
- package/lib/mcp/tools/propertiesTools.js.map +1 -1
- package/lib/mcp/tools/qualityHubApiTools.d.ts +3 -0
- package/lib/mcp/tools/qualityHubApiTools.js +138 -0
- package/lib/mcp/tools/qualityHubApiTools.js.map +1 -0
- package/lib/mcp/tools/qualityHubTools.js +219 -70
- package/lib/mcp/tools/qualityHubTools.js.map +1 -1
- package/lib/mcp/tools/rcaTools.d.ts +3 -2
- package/lib/mcp/tools/rcaTools.js +189 -56
- package/lib/mcp/tools/rcaTools.js.map +1 -1
- package/lib/mcp/tools/sfSpawn.d.ts +25 -3
- package/lib/mcp/tools/sfSpawn.js +154 -6
- package/lib/mcp/tools/sfSpawn.js.map +1 -1
- package/lib/mcp/tools/testCaseGenerate.js +226 -78
- package/lib/mcp/tools/testCaseGenerate.js.map +1 -1
- package/lib/mcp/tools/testCaseStepTools.d.ts +4 -0
- package/lib/mcp/tools/testCaseStepTools.js +226 -0
- package/lib/mcp/tools/testCaseStepTools.js.map +1 -0
- package/lib/mcp/tools/testCaseValidate.d.ts +11 -0
- package/lib/mcp/tools/testCaseValidate.js +300 -44
- package/lib/mcp/tools/testCaseValidate.js.map +1 -1
- package/lib/mcp/tools/testPlanTools.d.ts +1 -0
- package/lib/mcp/tools/testPlanTools.js +299 -59
- package/lib/mcp/tools/testPlanTools.js.map +1 -1
- package/lib/mcp/tools/testPlanValidate.js +56 -18
- package/lib/mcp/tools/testPlanValidate.js.map +1 -1
- package/lib/mcp/tools/testSuiteValidate.js +37 -11
- package/lib/mcp/tools/testSuiteValidate.js.map +1 -1
- package/lib/mcp/update/updateChecker.d.ts +14 -0
- package/lib/mcp/update/updateChecker.js +228 -0
- package/lib/mcp/update/updateChecker.js.map +1 -0
- package/lib/services/auth/credentials.d.ts +21 -0
- package/lib/services/auth/credentials.js +75 -0
- package/lib/services/auth/credentials.js.map +1 -0
- package/lib/services/auth/loginFlow.d.ts +68 -0
- package/lib/services/auth/loginFlow.js +216 -0
- package/lib/services/auth/loginFlow.js.map +1 -0
- package/lib/services/projectValidation.d.ts +5 -2
- package/lib/services/projectValidation.js +83 -31
- package/lib/services/projectValidation.js.map +1 -1
- package/lib/services/qualityHub/client.d.ts +161 -0
- package/lib/services/qualityHub/client.js +226 -0
- package/lib/services/qualityHub/client.js.map +1 -0
- package/messages/sf.provar.auth.clear.md +16 -0
- package/messages/sf.provar.auth.login.md +31 -0
- package/messages/sf.provar.auth.rotate.md +23 -0
- package/messages/sf.provar.auth.status.md +16 -0
- package/messages/sf.provar.mcp.start.md +83 -48
- package/oclif.manifest.json +325 -28
- package/package.json +23 -12
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Provar Limited.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
// ── Prompt: provar.guide.onboarding ──────────────────────────────────────────
|
|
9
|
+
export function registerOnboardingPrompt(server) {
|
|
10
|
+
server.prompt('provar.guide.onboarding', 'First-time setup guide for a Provar project. Walks through project discovery, connection verification, properties configuration, and a first test run. Use this when a user is getting started with ProvarDX for the first time.', {
|
|
11
|
+
projectPath: z
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Absolute path to the Provar project root (the folder containing .testproject). If omitted, the guide will ask the user for it.'),
|
|
15
|
+
mode: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('"local" (default) for running tests via Provar Automation on this machine. "quality-hub" for remote execution via a connected Quality Hub org.'),
|
|
19
|
+
}, ({ projectPath, mode }) => ({
|
|
20
|
+
messages: [
|
|
21
|
+
{
|
|
22
|
+
role: 'user',
|
|
23
|
+
content: {
|
|
24
|
+
type: 'text',
|
|
25
|
+
text: `You are a ProvarDX setup assistant. Help the user connect their Provar project and run their first test.
|
|
26
|
+
|
|
27
|
+
## Context
|
|
28
|
+
|
|
29
|
+
${projectPath
|
|
30
|
+
? `The user's Provar project is at: ${projectPath}`
|
|
31
|
+
: 'Ask the user for the path to their Provar project root (the folder containing .testproject). Common locations: ~/ProvarProjects/<name> on Mac/Linux, C:\\Users\\<name>\\ProvarProjects\\<name> on Windows. The marker file is .testproject at the project root.'}
|
|
32
|
+
|
|
33
|
+
Execution mode: ${mode === 'quality-hub' ? 'Quality Hub (remote)' : 'Local (Provar Automation)'}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Workflow
|
|
37
|
+
|
|
38
|
+
Follow these steps in order. Stop and report if any step fails — do not skip ahead.
|
|
39
|
+
|
|
40
|
+
### Step 1 — Verify the server is reachable
|
|
41
|
+
Call: provardx_ping
|
|
42
|
+
If this fails, the MCP server is not running. Tell the user to run: sf provar mcp start --allowed-paths <parent-dir-of-project>
|
|
43
|
+
|
|
44
|
+
### Step 2 — Inspect the project
|
|
45
|
+
Call: provar_project_inspect with the project path.
|
|
46
|
+
|
|
47
|
+
If PATH_NOT_ALLOWED: the MCP server's --allowed-paths doesn't include this directory. Ask the user to restart with the correct path.
|
|
48
|
+
If PATH_NOT_FOUND: confirm the path with the user — typos and path separator differences (/ vs \\) are common.
|
|
49
|
+
|
|
50
|
+
From the result, summarise in plain language:
|
|
51
|
+
- How many test cases were found and where
|
|
52
|
+
- Which Salesforce connections are configured
|
|
53
|
+
- Whether a provardx-properties.json already exists
|
|
54
|
+
|
|
55
|
+
### Step 3 — Check connections
|
|
56
|
+
Call: provar_connection_list with the project path.
|
|
57
|
+
|
|
58
|
+
If no connections appear, the project isn't connected to any org yet. Ask the user to open Provar IDE → Project → Connections → Add Connection.
|
|
59
|
+
|
|
60
|
+
${mode === 'quality-hub'
|
|
61
|
+
? `### Step 4 — Connect to Quality Hub
|
|
62
|
+
Call: provar_qualityhub_connect with the user's SF org alias.
|
|
63
|
+
Then: provar_qualityhub_display to confirm the correct org is connected.
|
|
64
|
+
|
|
65
|
+
If NOT_AUTHENTICATED: the user needs to run: sf org login web -o <alias>
|
|
66
|
+
|
|
67
|
+
### Step 5 — Retrieve available test cases
|
|
68
|
+
Call: provar_qualityhub_testcase_retrieve to show what's available to run.
|
|
69
|
+
Ask the user which plan they'd like to run first (pass the plan name via --plan-name flag).
|
|
70
|
+
|
|
71
|
+
### Step 6 — Run first test
|
|
72
|
+
Call: provar_qualityhub_testrun with flags: ["--plan-name", "<chosen plan name>"].
|
|
73
|
+
Poll with provar_qualityhub_testrun_report every 30–60 seconds until the run completes.
|
|
74
|
+
Stop polling after 20 minutes and ask the user to check Quality Hub directly.`
|
|
75
|
+
: `### Step 4 — Configure properties
|
|
76
|
+
If a provardx-properties.json was found in step 2:
|
|
77
|
+
Call: provar_properties_read to show the user the current config.
|
|
78
|
+
Confirm provarHome and connectionName look correct.
|
|
79
|
+
|
|
80
|
+
If no properties file was found:
|
|
81
|
+
Call: provar_properties_generate with output_path (e.g. <project_path>/provardx-properties.json) and optionally project_path.
|
|
82
|
+
Then call: provar_properties_set to set connectionName to the first connection name from step 3.
|
|
83
|
+
|
|
84
|
+
### Step 5 — Register the config
|
|
85
|
+
Call: provar_automation_config_load with the properties file path.
|
|
86
|
+
This must succeed before compile or test run. If it fails:
|
|
87
|
+
MISSING_FILE: the path is wrong — recheck it.
|
|
88
|
+
AUTOMATION_CONFIG_LOAD_FAILED: call provar_properties_validate to find the issue.
|
|
89
|
+
|
|
90
|
+
### Step 6 — Compile
|
|
91
|
+
Call: provar_automation_compile with the project path.
|
|
92
|
+
If this fails with ClassNotFoundException or CompilationException, call provar_pageobject_validate on any .java files in src/pageobjects/ to find the issue.
|
|
93
|
+
|
|
94
|
+
### Step 7 — Run a first test
|
|
95
|
+
Ask the user which test case they'd like to run (or suggest the first one from the inspect result).
|
|
96
|
+
Call: provar_automation_testrun with the properties path and the chosen test.`}
|
|
97
|
+
|
|
98
|
+
## Common First-Time Issues
|
|
99
|
+
|
|
100
|
+
| Error | Cause | Fix |
|
|
101
|
+
|-------|-------|-----|
|
|
102
|
+
| PATH_NOT_ALLOWED | --allowed-paths too narrow | Restart MCP server with parent directory included |
|
|
103
|
+
| MISSING_FILE on compile/run | config_load skipped or failed | Run provar_automation_config_load first |
|
|
104
|
+
| No connections returned | Project not connected to org | Open Provar IDE → Connections → Add |
|
|
105
|
+
| [DOWNLOAD_ERROR] on metadata | Salesforce auth expired | Re-authenticate connection in Provar IDE |
|
|
106
|
+
| ClassNotFoundException | Page objects not compiled | Run provar_automation_compile before testrun |
|
|
107
|
+
|
|
108
|
+
## Finishing Up
|
|
109
|
+
|
|
110
|
+
After a successful first run, summarise in 3 sentences:
|
|
111
|
+
1. What project was connected and how many test cases it has
|
|
112
|
+
2. Which connection/org is active
|
|
113
|
+
3. What they can do next (run more tests, add to CI, generate new tests)`,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
// ── Prompt: provar.guide.troubleshoot ────────────────────────────────────────
|
|
120
|
+
export function registerTroubleshootPrompt(server) {
|
|
121
|
+
server.prompt('provar.guide.troubleshoot', 'Systematic failure diagnosis for Provar test runs. Classifies the error, maps it to a root cause, and gives an actionable fix. Use when a test failed, a tool returned an error, or an agent is looping without progress.', {
|
|
122
|
+
errorMessage: z
|
|
123
|
+
.string()
|
|
124
|
+
.optional()
|
|
125
|
+
.describe('The error message, tool output, or failure description. Paste as much as available — the more detail, the better the diagnosis.'),
|
|
126
|
+
projectPath: z.string().optional().describe('Absolute path to the Provar project root, if available.'),
|
|
127
|
+
}, ({ errorMessage, projectPath }) => ({
|
|
128
|
+
messages: [
|
|
129
|
+
{
|
|
130
|
+
role: 'user',
|
|
131
|
+
content: {
|
|
132
|
+
type: 'text',
|
|
133
|
+
text: `You are a ProvarDX diagnostics expert. Identify the root cause of the failure and give an actionable fix.
|
|
134
|
+
|
|
135
|
+
${errorMessage
|
|
136
|
+
? `## Failure to diagnose\n\n${errorMessage}`
|
|
137
|
+
: 'Ask the user to share the error message, tool output, or a description of what went wrong.'}
|
|
138
|
+
${projectPath ? `\nProject path: ${projectPath}` : ''}
|
|
139
|
+
|
|
140
|
+
## Loop Detection Rule
|
|
141
|
+
|
|
142
|
+
If you have tried the same fix 3 times and the error hasn't changed, STOP. Tell the user what you tried and ask them to confirm the environment (org auth, file paths, Provar install).
|
|
143
|
+
|
|
144
|
+
## Step 1 — Run RCA if a test report exists
|
|
145
|
+
|
|
146
|
+
If there is a completed test run, use the RCA tool first:
|
|
147
|
+
Call: provar_testrun_report_locate (with project path if available)
|
|
148
|
+
Call: provar_testrun_rca with project_path (required) and optionally mode: "rca"
|
|
149
|
+
|
|
150
|
+
The RCA tool classifies each failure and gives a recommendation per failure. Use it before reading raw stack traces.
|
|
151
|
+
|
|
152
|
+
## Step 2 — Classify by error pattern
|
|
153
|
+
|
|
154
|
+
| Pattern in the error | Category | Action |
|
|
155
|
+
|---------------------|----------|--------|
|
|
156
|
+
| PATH_NOT_ALLOWED | Path policy | Ask user to restart MCP server with --allowed-paths set to the project parent dir |
|
|
157
|
+
| MISSING_FILE, AUTOMATION_CONFIG_LOAD_FAILED | Missing prerequisite | Run provar_automation_config_load with the properties file path |
|
|
158
|
+
| [DOWNLOAD_ERROR], INVALID_LOGIN, AuthenticationException | Salesforce auth | User must re-authenticate the connection in Provar IDE — cannot fix via MCP |
|
|
159
|
+
| ClassNotFoundException, CompilationException | Compile missing | Run provar_automation_compile; run provar_pageobject_validate first if compile fails |
|
|
160
|
+
| NoSuchElementException, StaleElementReferenceException | Stale locator | User must re-capture the element in Provar IDE — tell them which test step failed |
|
|
161
|
+
| TimeoutException, ElementClickInterceptedException | UI timing | Increase step timeout or check org performance |
|
|
162
|
+
| SessionNotCreatedException, Chrome version must be between | WebDriver mismatch | Update ChromeDriver to match installed Chrome |
|
|
163
|
+
| AssertionException, UiAssert | Assertion | Verify expected value is correct for current org data state |
|
|
164
|
+
| Required fields are missing | Salesforce required field | Check field-level security for the running user |
|
|
165
|
+
| FIELD_CUSTOM_VALIDATION_EXCEPTION | Salesforce validation rule | Review validation rules on the target object |
|
|
166
|
+
| INVALID_CROSS_REFERENCE_KEY | Record not found | Verify referenced record exists and running user has access |
|
|
167
|
+
| bad value for restricted picklist | Picklist mismatch | Run provar_automation_metadata_download; check for trailing spaces |
|
|
168
|
+
| LicenseException, license.*expired | License | Contact Provar support — not fixable via MCP |
|
|
169
|
+
| caseCall.*cannot.*resolv | Broken callable | Run provar_project_validate; look for PROJ-CALLABLE violations |
|
|
170
|
+
|
|
171
|
+
## Step 3 — Know when to escalate
|
|
172
|
+
|
|
173
|
+
Stop and ask the user when:
|
|
174
|
+
- The fix requires action in Provar IDE (re-authenticate, re-capture element)
|
|
175
|
+
- The fix requires action in a Salesforce org (data, permissions, validation rules)
|
|
176
|
+
- The error is LicenseException
|
|
177
|
+
- The RCA category is UNKNOWN with no recommendation
|
|
178
|
+
|
|
179
|
+
When escalating, tell the user: what you tried, what the error says, your best diagnosis, and the specific action they need to take.
|
|
180
|
+
|
|
181
|
+
## Reading Provar output
|
|
182
|
+
|
|
183
|
+
Signal lines to look for:
|
|
184
|
+
PASSED: <test-name>
|
|
185
|
+
FAILED: <test-name>
|
|
186
|
+
Provar test run complete: X passed, Y failed
|
|
187
|
+
|
|
188
|
+
Safely ignore:
|
|
189
|
+
com.networknt.schema.*
|
|
190
|
+
SEVERE.*Failed to configure logger.*\\.lck
|
|
191
|
+
Loading index of metadata`,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
// ── Prompt: provar.guide.orchestration ───────────────────────────────────────
|
|
198
|
+
export function registerOrchestrationPrompt(server) {
|
|
199
|
+
server.prompt('provar.guide.orchestration', 'Task sequencing guide for multi-step Provar workflows. Shows the correct tool order for common tasks (run tests, author tests, debug failures, Quality Hub), prerequisite dependencies, and when to stop and ask the user.', {
|
|
200
|
+
task: z
|
|
201
|
+
.string()
|
|
202
|
+
.optional()
|
|
203
|
+
.describe('The type of task to sequence: "run-local" (local test execution), "run-quality-hub" (remote runs), "author-test" (writing new tests), "debug-failures" (diagnosing failures), "nitrox" (LWC/Screen Flow work). Omit for a general overview of all flows.'),
|
|
204
|
+
}, ({ task }) => {
|
|
205
|
+
const flows = {
|
|
206
|
+
'run-local': `## Run Tests Locally
|
|
207
|
+
|
|
208
|
+
Required sequence — do not skip steps:
|
|
209
|
+
|
|
210
|
+
1. provar_project_inspect → confirm project root and connections exist
|
|
211
|
+
2. provar_properties_read OR provar_properties_generate (output_path required; set connectionName via provar_properties_set)
|
|
212
|
+
3. provar_automation_config_load ← MUST succeed before step 4
|
|
213
|
+
4. provar_automation_compile ← MUST succeed before step 5
|
|
214
|
+
5. provar_automation_testrun
|
|
215
|
+
6. provar_testrun_report_locate → find where results landed
|
|
216
|
+
7. provar_testrun_rca → classify any failures`,
|
|
217
|
+
'run-quality-hub': `## Run Tests via Quality Hub
|
|
218
|
+
|
|
219
|
+
1. provar_qualityhub_connect → once per session
|
|
220
|
+
2. provar_qualityhub_display → confirm correct org
|
|
221
|
+
3. provar_qualityhub_testrun → returns run_id
|
|
222
|
+
4. provar_qualityhub_testrun_report → poll every 30–60s until terminal status
|
|
223
|
+
Stop polling after 20 minutes — ask user to check Quality Hub directly
|
|
224
|
+
5. provar_testrun_rca → if failures, classify them
|
|
225
|
+
6. provar_qualityhub_defect_create → optional, create defects for failures`,
|
|
226
|
+
'author-test': `## Author a New Test Case
|
|
227
|
+
|
|
228
|
+
1. provar_project_inspect → find coverage gaps before writing
|
|
229
|
+
2. provar_automation_metadata_download → if SF metadata is stale (missing fields/objects)
|
|
230
|
+
3. provar_pageobject_generate → if a new page object is needed
|
|
231
|
+
4. provar_pageobject_validate → validate before compile
|
|
232
|
+
5. provar_automation_compile → after any page object change
|
|
233
|
+
6. provar_testcase_generate → create the test case file
|
|
234
|
+
7. provar_testcase_step_edit → add steps (repeat as needed)
|
|
235
|
+
8. provar_testcase_validate → MUST pass before adding to a plan
|
|
236
|
+
9. provar_testplan_add-instance → add to an existing plan
|
|
237
|
+
10. provar_testplan_validate → validate the plan`,
|
|
238
|
+
'debug-failures': `## Debug Failing Tests
|
|
239
|
+
|
|
240
|
+
1. provar_testrun_report_locate → find the report file
|
|
241
|
+
2. provar_testrun_rca → classify failures by category
|
|
242
|
+
|
|
243
|
+
Then act on the category:
|
|
244
|
+
AUTH failure → user must re-authenticate in Provar IDE (cannot fix via MCP)
|
|
245
|
+
LOCATOR failure → user must re-capture element in Provar IDE
|
|
246
|
+
COMPILE failure → provar_automation_compile, then provar_pageobject_validate if compile fails
|
|
247
|
+
CALLABLE failure → provar_project_validate, fix PROJ-CALLABLE violations
|
|
248
|
+
DATA failure → advise user on org data state
|
|
249
|
+
UNKNOWN → escalate to user with full RCA output`,
|
|
250
|
+
nitrox: `## NitroX (LWC / Screen Flows / Industry Components)
|
|
251
|
+
|
|
252
|
+
1. provar_nitrox_discover → see what's already modeled in the project
|
|
253
|
+
2. provar_nitrox_generate → for the target component
|
|
254
|
+
3. provar_nitrox_validate → always validate immediately after generate
|
|
255
|
+
4. provar_nitrox_patch → to update an existing model
|
|
256
|
+
5. provar_nitrox_validate → always validate after patch
|
|
257
|
+
|
|
258
|
+
After adding a NitroX model to a page object, run provar_automation_compile.`,
|
|
259
|
+
general: `## All Canonical Task Flows
|
|
260
|
+
|
|
261
|
+
### Prerequisite graph (hard constraints)
|
|
262
|
+
provardx_ping → (confirms server is up — always run first in a fresh session)
|
|
263
|
+
|
|
264
|
+
provar_properties_* or provar_properties_generate
|
|
265
|
+
└── provar_automation_config_load
|
|
266
|
+
└── provar_automation_compile
|
|
267
|
+
└── provar_automation_testrun
|
|
268
|
+
└── provar_testrun_report_locate
|
|
269
|
+
└── provar_testrun_rca
|
|
270
|
+
|
|
271
|
+
provar_qualityhub_connect
|
|
272
|
+
└── provar_qualityhub_testrun
|
|
273
|
+
└── provar_qualityhub_testrun_report
|
|
274
|
+
|
|
275
|
+
provar_pageobject_validate
|
|
276
|
+
└── provar_automation_compile (validate before compile — errors are clearer)
|
|
277
|
+
|
|
278
|
+
provar_nitrox_generate OR provar_nitrox_patch
|
|
279
|
+
└── provar_nitrox_validate (always validate after)
|
|
280
|
+
|
|
281
|
+
provar_testcase_generate OR provar_testcase_step_edit
|
|
282
|
+
└── provar_testcase_validate
|
|
283
|
+
└── provar_testplan_add-instance
|
|
284
|
+
└── provar_testplan_validate
|
|
285
|
+
|
|
286
|
+
### Safe to run in parallel (no dependency between them)
|
|
287
|
+
- provar_project_inspect + provar_connection_list
|
|
288
|
+
- provar_pageobject_validate on multiple files
|
|
289
|
+
- provar_testcase_validate on multiple files
|
|
290
|
+
- provar_nitrox_validate on multiple models
|
|
291
|
+
|
|
292
|
+
### Stopping rules
|
|
293
|
+
Stop and return to the user when:
|
|
294
|
+
1. The same fix has been tried 3 times with identical output
|
|
295
|
+
2. The fix requires action in Provar IDE or a Salesforce org
|
|
296
|
+
3. A LicenseException appears
|
|
297
|
+
4. RCA returns UNKNOWN with no recommendation
|
|
298
|
+
5. The task requires a decision only the user can make (which plan, which connection, which org)`,
|
|
299
|
+
};
|
|
300
|
+
const flowContent = flows[task ?? 'general'] ?? flows['general'];
|
|
301
|
+
return {
|
|
302
|
+
messages: [
|
|
303
|
+
{
|
|
304
|
+
role: 'user',
|
|
305
|
+
content: {
|
|
306
|
+
type: 'text',
|
|
307
|
+
text: `You are a ProvarDX workflow coordinator. Follow the task sequence below exactly.
|
|
308
|
+
|
|
309
|
+
${flowContent}
|
|
310
|
+
|
|
311
|
+
## Rules for all tasks
|
|
312
|
+
- Always call provardx_ping first in a fresh session to confirm the server is up
|
|
313
|
+
- Always call provar_project_inspect before any authoring task
|
|
314
|
+
- provar_automation_config_load must succeed before compile or testrun — no exceptions
|
|
315
|
+
- Validate before execute: testcase_validate before adding to a plan, pageobject_validate before compile
|
|
316
|
+
- All paths must be within the --allowed-paths configured for this MCP server
|
|
317
|
+
- Stop and ask the user when you hit a stopping rule (see above)`,
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
};
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
//# sourceMappingURL=guidePrompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guidePrompts.js","sourceRoot":"","sources":["../../../src/mcp/prompts/guidePrompts.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Provar Limited.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { registerCrtMigrationPrompt, registerSeleniumMigrationPrompt, registerPlaywrightMigrationPrompt, } from './migrationPrompts.js';
|
|
8
|
+
import { registerLoopGeneratePrompt, registerLoopFixPrompt, registerLoopReviewPrompt, registerLoopCoveragePrompt, registerLoopDbPrompt, } from './loopPrompts.js';
|
|
9
|
+
import { registerOnboardingPrompt, registerTroubleshootPrompt, registerOrchestrationPrompt } from './guidePrompts.js';
|
|
10
|
+
export function registerAllPrompts(server) {
|
|
11
|
+
registerCrtMigrationPrompt(server);
|
|
12
|
+
registerSeleniumMigrationPrompt(server);
|
|
13
|
+
registerPlaywrightMigrationPrompt(server);
|
|
14
|
+
registerLoopGeneratePrompt(server);
|
|
15
|
+
registerLoopFixPrompt(server);
|
|
16
|
+
registerLoopReviewPrompt(server);
|
|
17
|
+
registerLoopCoveragePrompt(server);
|
|
18
|
+
registerLoopDbPrompt(server);
|
|
19
|
+
registerOnboardingPrompt(server);
|
|
20
|
+
registerTroubleshootPrompt(server);
|
|
21
|
+
registerOrchestrationPrompt(server);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEtH,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,0BAA0B,CAAC,MAAM,CAAC,CAAC;IACnC,+BAA+B,CAAC,MAAM,CAAC,CAAC;IACxC,iCAAiC,CAAC,MAAM,CAAC,CAAC;IAC1C,0BAA0B,CAAC,MAAM,CAAC,CAAC;IACnC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACjC,0BAA0B,CAAC,MAAM,CAAC,CAAC;IACnC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC7B,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACjC,0BAA0B,CAAC,MAAM,CAAC,CAAC;IACnC,2BAA2B,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
export declare function registerLoopGeneratePrompt(server: McpServer): void;
|
|
3
|
+
export declare function registerLoopFixPrompt(server: McpServer): void;
|
|
4
|
+
export declare function registerLoopReviewPrompt(server: McpServer): void;
|
|
5
|
+
export declare function registerLoopCoveragePrompt(server: McpServer): void;
|
|
6
|
+
export declare function registerLoopDbPrompt(server: McpServer): void;
|