@provartesting/provardx-cli 1.5.0-dev.2 → 1.5.1

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 (147) hide show
  1. package/README.md +163 -12
  2. package/bin/mcp-start.js +74 -0
  3. package/lib/commands/provar/auth/clear.d.ts +7 -0
  4. package/lib/commands/provar/auth/clear.js +36 -0
  5. package/lib/commands/provar/auth/clear.js.map +1 -0
  6. package/lib/commands/provar/auth/login.d.ts +10 -0
  7. package/lib/commands/provar/auth/login.js +90 -0
  8. package/lib/commands/provar/auth/login.js.map +1 -0
  9. package/lib/commands/provar/auth/rotate.d.ts +7 -0
  10. package/lib/commands/provar/auth/rotate.js +42 -0
  11. package/lib/commands/provar/auth/rotate.js.map +1 -0
  12. package/lib/commands/provar/auth/status.d.ts +7 -0
  13. package/lib/commands/provar/auth/status.js +107 -0
  14. package/lib/commands/provar/auth/status.js.map +1 -0
  15. package/lib/commands/provar/mcp/start.d.ts +2 -0
  16. package/lib/commands/provar/mcp/start.js +14 -1
  17. package/lib/commands/provar/mcp/start.js.map +1 -1
  18. package/lib/mcp/docs/NITROX_CATALOG_SOURCE.json +6 -0
  19. package/lib/mcp/docs/NITROX_COMPONENT_CATALOG.md +2001 -0
  20. package/lib/mcp/docs/PROVAR_TEST_STEP_REFERENCE.md +1430 -0
  21. package/lib/mcp/docs/PROVAR_TOOL_GUIDE.md +187 -0
  22. package/lib/mcp/licensing/algasClient.js +14 -5
  23. package/lib/mcp/licensing/algasClient.js.map +1 -1
  24. package/lib/mcp/licensing/ideDetection.d.ts +0 -12
  25. package/lib/mcp/licensing/ideDetection.js +1 -73
  26. package/lib/mcp/licensing/ideDetection.js.map +1 -1
  27. package/lib/mcp/licensing/licenseCache.js +7 -1
  28. package/lib/mcp/licensing/licenseCache.js.map +1 -1
  29. package/lib/mcp/licensing/licenseValidator.d.ts +3 -3
  30. package/lib/mcp/licensing/licenseValidator.js +11 -4
  31. package/lib/mcp/licensing/licenseValidator.js.map +1 -1
  32. package/lib/mcp/prompts/guidePrompts.d.ts +4 -0
  33. package/lib/mcp/prompts/guidePrompts.js +334 -0
  34. package/lib/mcp/prompts/guidePrompts.js.map +1 -0
  35. package/lib/mcp/prompts/index.d.ts +2 -0
  36. package/lib/mcp/prompts/index.js +23 -0
  37. package/lib/mcp/prompts/index.js.map +1 -0
  38. package/lib/mcp/prompts/loopPrompts.d.ts +6 -0
  39. package/lib/mcp/prompts/loopPrompts.js +435 -0
  40. package/lib/mcp/prompts/loopPrompts.js.map +1 -0
  41. package/lib/mcp/prompts/migrationPrompts.d.ts +4 -0
  42. package/lib/mcp/prompts/migrationPrompts.js +207 -0
  43. package/lib/mcp/prompts/migrationPrompts.js.map +1 -0
  44. package/lib/mcp/rules/provar_best_practices_rules.json +256 -544
  45. package/lib/mcp/security/pathPolicy.d.ts +5 -0
  46. package/lib/mcp/security/pathPolicy.js +58 -3
  47. package/lib/mcp/security/pathPolicy.js.map +1 -1
  48. package/lib/mcp/server.d.ts +18 -0
  49. package/lib/mcp/server.js +232 -19
  50. package/lib/mcp/server.js.map +1 -1
  51. package/lib/mcp/tools/antTools.d.ts +15 -0
  52. package/lib/mcp/tools/antTools.js +369 -170
  53. package/lib/mcp/tools/antTools.js.map +1 -1
  54. package/lib/mcp/tools/automationTools.d.ts +18 -8
  55. package/lib/mcp/tools/automationTools.js +333 -176
  56. package/lib/mcp/tools/automationTools.js.map +1 -1
  57. package/lib/mcp/tools/bestPracticesEngine.js +161 -23
  58. package/lib/mcp/tools/bestPracticesEngine.js.map +1 -1
  59. package/lib/mcp/tools/connectionTools.d.ts +4 -0
  60. package/lib/mcp/tools/connectionTools.js +242 -0
  61. package/lib/mcp/tools/connectionTools.js.map +1 -0
  62. package/lib/mcp/tools/defectTools.d.ts +1 -1
  63. package/lib/mcp/tools/defectTools.js +61 -50
  64. package/lib/mcp/tools/defectTools.js.map +1 -1
  65. package/lib/mcp/tools/descHelper.d.ts +5 -0
  66. package/lib/mcp/tools/descHelper.js +14 -0
  67. package/lib/mcp/tools/descHelper.js.map +1 -0
  68. package/lib/mcp/tools/hierarchyValidate.d.ts +1 -1
  69. package/lib/mcp/tools/hierarchyValidate.js +127 -42
  70. package/lib/mcp/tools/hierarchyValidate.js.map +1 -1
  71. package/lib/mcp/tools/nitroXTools.d.ts +23 -0
  72. package/lib/mcp/tools/nitroXTools.js +863 -0
  73. package/lib/mcp/tools/nitroXTools.js.map +1 -0
  74. package/lib/mcp/tools/pageObjectGenerate.js +150 -57
  75. package/lib/mcp/tools/pageObjectGenerate.js.map +1 -1
  76. package/lib/mcp/tools/pageObjectValidate.js +143 -46
  77. package/lib/mcp/tools/pageObjectValidate.js.map +1 -1
  78. package/lib/mcp/tools/projectInspect.js +79 -32
  79. package/lib/mcp/tools/projectInspect.js.map +1 -1
  80. package/lib/mcp/tools/projectValidateFromPath.js +185 -58
  81. package/lib/mcp/tools/projectValidateFromPath.js.map +1 -1
  82. package/lib/mcp/tools/propertiesTools.d.ts +2 -0
  83. package/lib/mcp/tools/propertiesTools.js +358 -78
  84. package/lib/mcp/tools/propertiesTools.js.map +1 -1
  85. package/lib/mcp/tools/qualityHubApiTools.d.ts +3 -0
  86. package/lib/mcp/tools/qualityHubApiTools.js +139 -0
  87. package/lib/mcp/tools/qualityHubApiTools.js.map +1 -0
  88. package/lib/mcp/tools/qualityHubTools.js +292 -72
  89. package/lib/mcp/tools/qualityHubTools.js.map +1 -1
  90. package/lib/mcp/tools/rcaTools.d.ts +3 -2
  91. package/lib/mcp/tools/rcaTools.js +194 -56
  92. package/lib/mcp/tools/rcaTools.js.map +1 -1
  93. package/lib/mcp/tools/sfSpawn.d.ts +25 -3
  94. package/lib/mcp/tools/sfSpawn.js +154 -6
  95. package/lib/mcp/tools/sfSpawn.js.map +1 -1
  96. package/lib/mcp/tools/testCaseGenerate.js +285 -78
  97. package/lib/mcp/tools/testCaseGenerate.js.map +1 -1
  98. package/lib/mcp/tools/testCaseStepTools.d.ts +4 -0
  99. package/lib/mcp/tools/testCaseStepTools.js +244 -0
  100. package/lib/mcp/tools/testCaseStepTools.js.map +1 -0
  101. package/lib/mcp/tools/testCaseValidate.d.ts +11 -0
  102. package/lib/mcp/tools/testCaseValidate.js +381 -46
  103. package/lib/mcp/tools/testCaseValidate.js.map +1 -1
  104. package/lib/mcp/tools/testPlanTools.d.ts +1 -0
  105. package/lib/mcp/tools/testPlanTools.js +316 -59
  106. package/lib/mcp/tools/testPlanTools.js.map +1 -1
  107. package/lib/mcp/tools/testPlanValidate.js +114 -23
  108. package/lib/mcp/tools/testPlanValidate.js.map +1 -1
  109. package/lib/mcp/tools/testSuiteValidate.js +130 -15
  110. package/lib/mcp/tools/testSuiteValidate.js.map +1 -1
  111. package/lib/mcp/update/updateChecker.d.ts +14 -0
  112. package/lib/mcp/update/updateChecker.js +228 -0
  113. package/lib/mcp/update/updateChecker.js.map +1 -0
  114. package/lib/mcp/utils/detailLevel.d.ts +9 -0
  115. package/lib/mcp/utils/detailLevel.js +20 -0
  116. package/lib/mcp/utils/detailLevel.js.map +1 -0
  117. package/lib/mcp/utils/fieldMask.d.ts +17 -0
  118. package/lib/mcp/utils/fieldMask.js +75 -0
  119. package/lib/mcp/utils/fieldMask.js.map +1 -0
  120. package/lib/mcp/utils/tokenMeta.d.ts +40 -0
  121. package/lib/mcp/utils/tokenMeta.js +90 -0
  122. package/lib/mcp/utils/tokenMeta.js.map +1 -0
  123. package/lib/mcp/utils/validationDiff.d.ts +57 -0
  124. package/lib/mcp/utils/validationDiff.js +191 -0
  125. package/lib/mcp/utils/validationDiff.js.map +1 -0
  126. package/lib/mcp/utils/validationScore.d.ts +15 -0
  127. package/lib/mcp/utils/validationScore.js +31 -0
  128. package/lib/mcp/utils/validationScore.js.map +1 -0
  129. package/lib/services/auth/credentials.d.ts +21 -0
  130. package/lib/services/auth/credentials.js +75 -0
  131. package/lib/services/auth/credentials.js.map +1 -0
  132. package/lib/services/auth/loginFlow.d.ts +68 -0
  133. package/lib/services/auth/loginFlow.js +216 -0
  134. package/lib/services/auth/loginFlow.js.map +1 -0
  135. package/lib/services/projectValidation.d.ts +5 -2
  136. package/lib/services/projectValidation.js +83 -31
  137. package/lib/services/projectValidation.js.map +1 -1
  138. package/lib/services/qualityHub/client.d.ts +161 -0
  139. package/lib/services/qualityHub/client.js +226 -0
  140. package/lib/services/qualityHub/client.js.map +1 -0
  141. package/messages/sf.provar.auth.clear.md +16 -0
  142. package/messages/sf.provar.auth.login.md +31 -0
  143. package/messages/sf.provar.auth.rotate.md +23 -0
  144. package/messages/sf.provar.auth.status.md +16 -0
  145. package/messages/sf.provar.mcp.start.md +83 -48
  146. package/oclif.manifest.json +325 -28
  147. package/package.json +35 -12
@@ -0,0 +1,334 @@
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
+ Construct the full step tree in a single \`provar_testcase_generate\` call.
229
+ \`provar_testcase_step_edit\` is for amending an existing case, not for
230
+ building one step-by-step (that pattern drops scenarios and flattens nesting).
231
+
232
+ 1. provar_project_inspect → find coverage gaps before writing
233
+ 2. provar_qualityhub_examples_retrieve → ground in corpus examples for the step types you need
234
+ 3. provar_automation_metadata_download → if SF metadata is stale (missing fields/objects)
235
+ 4. provar_pageobject_generate → only if a new page object is needed
236
+ 5. provar_pageobject_validate → validate before compile
237
+ 6. provar_automation_compile → after any page object change
238
+ 7. provar_testcase_generate → single call, pass ALL steps in one payload
239
+ 8. provar_testcase_validate → MUST pass before adding to a plan
240
+ 9. provar_testplan_add-instance → add to an existing plan
241
+ 10. provar_testplan_validate → validate the plan
242
+
243
+ Use provar_testcase_step_edit only to amend an existing validated test case
244
+ (single-step add, attribute fix, debug edit) — never to construct one from scratch.`,
245
+ 'debug-failures': `## Debug Failing Tests
246
+
247
+ 1. provar_testrun_report_locate → find the report file
248
+ 2. provar_testrun_rca → classify failures by category
249
+
250
+ Then act on the category:
251
+ AUTH failure → user must re-authenticate in Provar IDE (cannot fix via MCP)
252
+ LOCATOR failure → user must re-capture element in Provar IDE
253
+ COMPILE failure → provar_automation_compile, then provar_pageobject_validate if compile fails
254
+ CALLABLE failure → provar_project_validate, fix PROJ-CALLABLE violations
255
+ DATA failure → advise user on org data state
256
+ UNKNOWN → escalate to user with full RCA output`,
257
+ nitrox: `## NitroX (LWC / Screen Flows / Industry Components)
258
+
259
+ 1. provar_nitrox_discover → see what's already modeled in the project
260
+ 2. provar_nitrox_generate → for the target component
261
+ 3. provar_nitrox_validate → always validate immediately after generate
262
+ 4. provar_nitrox_patch → to update an existing model
263
+ 5. provar_nitrox_validate → always validate after patch
264
+
265
+ After adding a NitroX model to a page object, run provar_automation_compile.`,
266
+ general: `## All Canonical Task Flows
267
+
268
+ ### Prerequisite graph (hard constraints)
269
+ provardx_ping → (confirms server is up — always run first in a fresh session)
270
+
271
+ provar_properties_* or provar_properties_generate
272
+ └── provar_automation_config_load
273
+ └── provar_automation_compile
274
+ └── provar_automation_testrun
275
+ └── provar_testrun_report_locate
276
+ └── provar_testrun_rca
277
+
278
+ provar_qualityhub_connect
279
+ └── provar_qualityhub_testrun
280
+ └── provar_qualityhub_testrun_report
281
+
282
+ provar_pageobject_validate
283
+ └── provar_automation_compile (validate before compile — errors are clearer)
284
+
285
+ provar_nitrox_generate OR provar_nitrox_patch
286
+ └── provar_nitrox_validate (always validate after)
287
+
288
+ provar_testcase_generate (construct full case — pass ALL steps in one call)
289
+ └── provar_testcase_validate
290
+ └── provar_testplan_add-instance
291
+ └── provar_testplan_validate
292
+
293
+ provar_testcase_step_edit (amend an existing validated case only — never construct)
294
+ └── provar_testcase_validate
295
+
296
+ ### Safe to run in parallel (no dependency between them)
297
+ - provar_project_inspect + provar_connection_list
298
+ - provar_pageobject_validate on multiple files
299
+ - provar_testcase_validate on multiple files
300
+ - provar_nitrox_validate on multiple models
301
+
302
+ ### Stopping rules
303
+ Stop and return to the user when:
304
+ 1. The same fix has been tried 3 times with identical output
305
+ 2. The fix requires action in Provar IDE or a Salesforce org
306
+ 3. A LicenseException appears
307
+ 4. RCA returns UNKNOWN with no recommendation
308
+ 5. The task requires a decision only the user can make (which plan, which connection, which org)`,
309
+ };
310
+ const flowContent = flows[task ?? 'general'] ?? flows['general'];
311
+ return {
312
+ messages: [
313
+ {
314
+ role: 'user',
315
+ content: {
316
+ type: 'text',
317
+ text: `You are a ProvarDX workflow coordinator. Follow the task sequence below exactly.
318
+
319
+ ${flowContent}
320
+
321
+ ## Rules for all tasks
322
+ - Always call provardx_ping first in a fresh session to confirm the server is up
323
+ - Always call provar_project_inspect before any authoring task
324
+ - provar_automation_config_load must succeed before compile or testrun — no exceptions
325
+ - Validate before execute: testcase_validate before adding to a plan, pageobject_validate before compile
326
+ - All paths must be within the --allowed-paths configured for this MCP server
327
+ - Stop and ask the user when you hit a stopping rule (see above)`,
328
+ },
329
+ },
330
+ ],
331
+ };
332
+ });
333
+ }
334
+ //# 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,2 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerAllPrompts(server: McpServer): void;
@@ -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;