@skyramp/mcp 0.2.6 → 0.2.150-rc.mntnc

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 (233) hide show
  1. package/build/commands/commandLibrary.d.ts +12 -0
  2. package/build/commands/recommendTestsAndExecuteCommand.d.ts +2 -0
  3. package/build/commands/testThisEndpointCommand.d.ts +2 -0
  4. package/build/index.d.ts +2 -0
  5. package/build/index.js +6 -4
  6. package/build/playwright/PlaywrightTraceService.d.ts +32 -0
  7. package/build/playwright/index.d.ts +3 -0
  8. package/build/playwright/registerPlaywrightTools.d.ts +8 -0
  9. package/build/playwright/registerPlaywrightTools.js +12 -11
  10. package/build/playwright/traceRecordingPrompt.d.ts +13 -0
  11. package/build/playwright/traceRecordingPrompt.js +3 -11
  12. package/build/prompts/code-reuse.d.ts +1 -0
  13. package/build/prompts/enhance-assertions/contractProviderAssertionsPrompt.d.ts +2 -0
  14. package/build/prompts/enhance-assertions/integrationAssertionsPrompt.d.ts +2 -0
  15. package/build/prompts/enhance-assertions/sharedAssertionRules.d.ts +15 -0
  16. package/build/prompts/enhance-assertions/uiAssertionsPrompt.d.ts +2 -0
  17. package/build/prompts/enhance-assertions/uiAssertionsPrompt.js +24 -5
  18. package/build/prompts/fix-error-prompt.d.ts +1 -0
  19. package/build/prompts/initialize-workspace/initializeWorkspacePrompt.d.ts +1 -0
  20. package/build/prompts/modularization/integration-test-modularization.d.ts +1 -0
  21. package/build/prompts/modularization/ui-test-modularization.d.ts +1 -0
  22. package/build/prompts/personas.d.ts +21 -0
  23. package/build/prompts/pom-aware-code-reuse.d.ts +1 -0
  24. package/build/prompts/startTraceCollectionPrompts.d.ts +2 -0
  25. package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.d.ts +2 -0
  26. package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.js +114 -0
  27. package/build/prompts/sut-setup/modes/dockerComposePrompt.d.ts +2 -0
  28. package/build/prompts/sut-setup/modes/dockerComposePrompt.js +292 -0
  29. package/build/prompts/sut-setup/shared.d.ts +39 -0
  30. package/build/prompts/sut-setup/shared.js +132 -0
  31. package/build/prompts/test-maintenance/actionsInstructions.d.ts +35 -0
  32. package/build/prompts/test-maintenance/drift-analysis-prompt.d.ts +4 -0
  33. package/build/prompts/test-maintenance/driftAnalysisSections.d.ts +13 -0
  34. package/build/prompts/test-maintenance/driftAnalysisSections.js +9 -3
  35. package/build/prompts/test-recommendation/analysisOutputPrompt.d.ts +84 -0
  36. package/build/prompts/test-recommendation/analysisOutputPrompt.js +1 -1
  37. package/build/prompts/test-recommendation/analysisOutputPrompt.test.d.ts +1 -0
  38. package/build/prompts/test-recommendation/analysisOutputPrompt.test.js +1 -0
  39. package/build/prompts/test-recommendation/diffExecutionPlan.d.ts +17 -0
  40. package/build/prompts/test-recommendation/diffExecutionPlan.js +7 -16
  41. package/build/prompts/test-recommendation/fullRepoCatalog.d.ts +7 -0
  42. package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.d.ts +1 -0
  43. package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.js +1 -0
  44. package/build/prompts/test-recommendation/promptPlan.d.ts +203 -0
  45. package/build/prompts/test-recommendation/promptPlan.test.d.ts +1 -0
  46. package/build/prompts/test-recommendation/recommendationSections.d.ts +35 -0
  47. package/build/prompts/test-recommendation/recommendationShared.d.ts +31 -0
  48. package/build/prompts/test-recommendation/registerRecommendTestsPrompt.d.ts +7 -0
  49. package/build/prompts/test-recommendation/scopeAssessment.d.ts +55 -0
  50. package/build/prompts/test-recommendation/scopeAssessment.js +2 -2
  51. package/build/prompts/test-recommendation/scopeAssessment.test.d.ts +1 -0
  52. package/build/prompts/test-recommendation/scopeAssessment.test.js +1 -0
  53. package/build/prompts/test-recommendation/test-recommendation-prompt.d.ts +6 -0
  54. package/build/prompts/test-recommendation/test-recommendation-prompt.js +4 -4
  55. package/build/prompts/test-recommendation/test-recommendation-prompt.test.d.ts +1 -0
  56. package/build/prompts/test-recommendation/test-recommendation-prompt.test.js +6 -99
  57. package/build/prompts/testbot/testbot-prompts.d.ts +11 -0
  58. package/build/prompts/testbot/testbot-prompts.js +213 -42
  59. package/build/prompts/testbot/testbot-prompts.test.d.ts +1 -0
  60. package/build/prompts/testbot/testbot-prompts.test.js +15 -117
  61. package/build/resources/analysisResources.d.ts +17 -0
  62. package/build/resources/progressResource.d.ts +2 -0
  63. package/build/resources/sutSetupResource.d.ts +2 -0
  64. package/build/resources/sutSetupResource.js +45 -0
  65. package/build/resources/testbotResource.d.ts +2 -0
  66. package/build/resources/testbotResource.js +1 -1
  67. package/build/services/AnalyticsService.d.ts +13 -0
  68. package/build/services/AnalyticsService.test.d.ts +1 -0
  69. package/build/services/AnalyticsService.test.js +86 -0
  70. package/build/services/ModularizationService.d.ts +11 -0
  71. package/build/services/ScenarioGenerationService.d.ts +37 -0
  72. package/build/services/ScenarioGenerationService.integration.test.d.ts +1 -0
  73. package/build/services/ScenarioGenerationService.integration.test.js +4 -0
  74. package/build/services/ScenarioGenerationService.test.d.ts +1 -0
  75. package/build/services/TestDiscoveryService.d.ts +128 -0
  76. package/build/services/TestDiscoveryService.js +22 -12
  77. package/build/services/TestDiscoveryService.test.d.ts +1 -0
  78. package/build/services/TestDiscoveryService.test.js +4 -3
  79. package/build/services/TestExecutionService.d.ts +55 -0
  80. package/build/services/TestExecutionService.js +158 -26
  81. package/build/services/TestExecutionService.test.d.ts +1 -0
  82. package/build/services/TestExecutionService.test.js +339 -25
  83. package/build/services/TestGenerationService.d.ts +56 -0
  84. package/build/services/TestGenerationService.test.d.ts +1 -0
  85. package/build/services/TestGenerationService.test.js +10 -8
  86. package/build/services/containerEnv.d.ts +14 -0
  87. package/build/tool-phase-coverage.test.d.ts +1 -0
  88. package/build/tool-phase-coverage.test.js +2 -0
  89. package/build/tool-phases.d.ts +38 -0
  90. package/build/tools/auth/loginTool.d.ts +2 -0
  91. package/build/tools/auth/logoutTool.d.ts +2 -0
  92. package/build/tools/code-refactor/codeReuseTool.d.ts +2 -0
  93. package/build/tools/code-refactor/enhanceAssertionsTool.d.ts +2 -0
  94. package/build/tools/code-refactor/modularizationTool.d.ts +2 -0
  95. package/build/tools/executeSkyrampTestTool.d.ts +2 -0
  96. package/build/tools/executeSkyrampTestTool.js +17 -4
  97. package/build/tools/fixErrorTool.d.ts +2 -0
  98. package/build/tools/generate-tests/generateBatchScenarioRestTool.d.ts +45 -0
  99. package/build/tools/generate-tests/generateBatchScenarioRestTool.js +1 -1
  100. package/build/tools/generate-tests/generateBatchScenarioRestTool.test.d.ts +1 -0
  101. package/build/tools/generate-tests/generateBatchScenarioRestTool.test.js +11 -9
  102. package/build/tools/generate-tests/generateContractRestTool.d.ts +31 -0
  103. package/build/tools/generate-tests/generateE2ERestTool.d.ts +13 -0
  104. package/build/tools/generate-tests/generateFuzzRestTool.d.ts +10 -0
  105. package/build/tools/generate-tests/generateIntegrationRestTool.d.ts +16 -0
  106. package/build/tools/generate-tests/generateLoadRestTool.d.ts +18 -0
  107. package/build/tools/generate-tests/generateLoadRestTool.test.d.ts +1 -0
  108. package/build/tools/generate-tests/generateMockRestTool.d.ts +64 -0
  109. package/build/tools/generate-tests/generateSmokeRestTool.d.ts +8 -0
  110. package/build/tools/generate-tests/generateUIRestTool.d.ts +14 -0
  111. package/build/tools/generate-tests/generateUIRestTool.js +1 -1
  112. package/build/tools/generate-tests/loadTestSchema.d.ts +39 -0
  113. package/build/tools/one-click/oneClickTool.d.ts +11 -0
  114. package/build/tools/submitReportTool.d.ts +384 -0
  115. package/build/tools/submitReportTool.js +225 -37
  116. package/build/tools/submitReportTool.test.d.ts +1 -0
  117. package/build/tools/submitReportTool.test.js +479 -55
  118. package/build/tools/test-management/actionsTool.d.ts +10 -0
  119. package/build/tools/test-management/actionsTool.js +10 -0
  120. package/build/tools/test-management/analyzeChangesTool.d.ts +26 -0
  121. package/build/tools/test-management/analyzeChangesTool.js +128 -48
  122. package/build/tools/test-management/analyzeChangesTool.test.d.ts +1 -0
  123. package/build/tools/test-management/analyzeChangesTool.test.js +80 -73
  124. package/build/tools/test-management/analyzeTestHealthTool.d.ts +2 -0
  125. package/build/tools/test-management/analyzeTestHealthTool.js +6 -3
  126. package/build/tools/test-management/index.d.ts +3 -0
  127. package/build/tools/test-management/index.js +0 -1
  128. package/build/tools/trace/resolveSaveStoragePath.d.ts +7 -0
  129. package/build/tools/trace/resolveSaveStoragePath.test.d.ts +1 -0
  130. package/build/tools/trace/resolveSessionPaths.d.ts +40 -0
  131. package/build/tools/trace/resolveSessionPaths.test.d.ts +1 -0
  132. package/build/tools/trace/sessionState.d.ts +2 -0
  133. package/build/tools/trace/sessionState.test.d.ts +1 -0
  134. package/build/tools/trace/startTraceCollectionTool.d.ts +2 -0
  135. package/build/tools/trace/stopTraceCollectionTool.d.ts +2 -0
  136. package/build/tools/workspace/initScanWorkspaceTool.d.ts +4 -0
  137. package/build/tools/workspace/initializeWorkspaceTool.d.ts +2 -0
  138. package/build/tools/workspace/initializeWorkspaceTool.test.d.ts +1 -0
  139. package/build/tools/workspace/initializeWorkspaceTool.test.js +134 -0
  140. package/build/types/OneClickCommands.d.ts +68 -0
  141. package/build/types/RepositoryAnalysis.d.ts +3004 -0
  142. package/build/types/TestAnalysis.d.ts +97 -0
  143. package/build/types/TestExecution.d.ts +63 -0
  144. package/build/types/TestExecution.js +11 -1
  145. package/build/types/TestRecommendation.d.ts +12 -0
  146. package/build/types/TestTypes.d.ts +234 -0
  147. package/build/types/TestbotReport.d.ts +68 -0
  148. package/build/types/TestbotReport.js +1 -0
  149. package/build/types/index.d.ts +4 -0
  150. package/build/types/index.js +3 -0
  151. package/build/utils/AnalysisStateManager.d.ts +182 -0
  152. package/build/utils/AnalysisStateManager.js +10 -1
  153. package/build/utils/AnalysisStateManager.test.d.ts +1 -0
  154. package/build/utils/analyze-openapi.d.ts +1 -0
  155. package/build/utils/branchDiff.d.ts +18 -0
  156. package/build/utils/dartRouteExtractor.d.ts +45 -0
  157. package/build/utils/dartRouteExtractor.test.d.ts +1 -0
  158. package/build/utils/docker.d.ts +19 -0
  159. package/build/utils/docker.test.d.ts +1 -0
  160. package/build/utils/docker.test.js +10 -9
  161. package/build/utils/featureFlags.d.ts +37 -0
  162. package/build/utils/featureFlags.test.d.ts +1 -0
  163. package/build/utils/gitStaging.d.ts +24 -0
  164. package/build/utils/gitStaging.test.d.ts +1 -0
  165. package/build/utils/gitStaging.test.js +13 -7
  166. package/build/utils/httpDefaults.d.ts +10 -0
  167. package/build/utils/httpDefaults.test.d.ts +1 -0
  168. package/build/utils/initAgent.d.ts +36 -0
  169. package/build/utils/language-helper.d.ts +6 -0
  170. package/build/utils/logger.d.ts +11 -0
  171. package/build/utils/normalizeParams.d.ts +14 -0
  172. package/build/utils/normalizeSkyrampImports.d.ts +13 -0
  173. package/build/utils/pr-comment-parser.d.ts +31 -0
  174. package/build/utils/pr-comment-parser.test.d.ts +1 -0
  175. package/build/utils/pr-comment-parser.test.js +6 -5
  176. package/build/utils/projectMetadata.d.ts +15 -0
  177. package/build/utils/projectMetadata.test.d.ts +1 -0
  178. package/build/utils/proxy-terminal.d.ts +2 -0
  179. package/build/utils/repoScanner.d.ts +27 -0
  180. package/build/utils/repoScanner.test.d.ts +1 -0
  181. package/build/utils/routeParsers.d.ts +53 -0
  182. package/build/utils/routeParsers.js +31 -38
  183. package/build/utils/routeParsers.test.d.ts +1 -0
  184. package/build/utils/scenarioDrafting.d.ts +71 -0
  185. package/build/utils/scenarioDrafting.js +23 -1
  186. package/build/utils/scenarioDrafting.test.d.ts +1 -0
  187. package/build/utils/skyrampMdContent.d.ts +5 -0
  188. package/build/utils/sourceRouteExtractor.d.ts +48 -0
  189. package/build/utils/sourceRouteExtractor.test.d.ts +1 -0
  190. package/build/utils/telemetry.d.ts +32 -0
  191. package/build/utils/telemetry.test.d.ts +1 -0
  192. package/build/utils/trace-parser.d.ts +32 -0
  193. package/build/utils/trace-parser.test.d.ts +6 -0
  194. package/build/utils/uiPageEnumerator.d.ts +146 -0
  195. package/build/utils/uiPageEnumerator.js +58 -14
  196. package/build/utils/uiPageEnumerator.test.d.ts +1 -0
  197. package/build/utils/uiPageEnumerator.test.js +223 -43
  198. package/build/utils/utils.d.ts +45 -0
  199. package/build/utils/utils.js +10 -0
  200. package/build/utils/utils.test.d.ts +1 -0
  201. package/build/utils/versions.d.ts +3 -0
  202. package/build/utils/versions.js +1 -1
  203. package/build/utils/workspaceAuth.d.ts +127 -0
  204. package/build/utils/workspaceAuth.test.d.ts +1 -0
  205. package/build/utils/workspaceAuth.test.js +25 -25
  206. package/build/workspace/index.d.ts +1 -0
  207. package/build/workspace/workspace.d.ts +390 -0
  208. package/build/workspace/workspace.test.d.ts +1 -0
  209. package/node_modules/playwright/LICENSE +202 -0
  210. package/node_modules/playwright/NOTICE +5 -0
  211. package/node_modules/playwright/README.md +168 -0
  212. package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +13 -9
  213. package/node_modules/playwright/lib/mcp/test/skyRampExport.js +4 -3
  214. package/node_modules/playwright/node_modules/playwright-core/LICENSE +202 -0
  215. package/node_modules/playwright/node_modules/playwright-core/NOTICE +5 -0
  216. package/node_modules/playwright/node_modules/playwright-core/ThirdPartyNotices.txt +23 -126
  217. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/assets/{codeMirrorModule-B0JOjboO.js → codeMirrorModule-B5kqh2EV.js} +1 -1
  218. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/assets/{defaultSettingsView-1anWeyDf.js → defaultSettingsView-CZ9npQ3N.js} +79 -79
  219. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/{index.Cc5029a3.js → index.BCnxj-_b.js} +1 -1
  220. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/index.html +2 -2
  221. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/{uiMode.Wo5yvvVh.js → uiMode.1Ym0Ivn8.js} +1 -1
  222. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +2 -2
  223. package/node_modules/playwright/node_modules/playwright-core/package.json +1 -1
  224. package/node_modules/playwright/package.json +1 -1
  225. package/package.json +16 -4
  226. package/build/tools/test-management/uiAnalyzeChangesTool.js +0 -155
  227. package/build/tools/test-management/uiAnalyzeChangesTool.test.js +0 -147
  228. package/node_modules/playwright/node_modules/playwright-core/.DS_Store +0 -0
  229. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/.bin/node-which +0 -52
  230. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/.bin/is-docker +0 -5
  231. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/.bin/mime +0 -46
  232. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/.bin/yaml +0 -11
  233. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/index.CP3Y8Zsb.js +0 -2
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  import { stripVTControlCharacters } from "util";
3
3
  import { TestExecutionService } from "../services/TestExecutionService.js";
4
4
  import { AnalyticsService } from "../services/AnalyticsService.js";
5
+ import { TestExecutionStatus } from "../types/TestExecution.js";
5
6
  import { getWorkspaceBaseUrl } from "../utils/workspaceAuth.js";
6
7
  import { ProgrammingLanguage, TestType } from "../types/TestTypes.js";
7
8
  import { StateManager } from "../utils/AnalysisStateManager.js";
@@ -66,7 +67,11 @@ For detailed documentation visit: https://www.skyramp.dev/docs/quickstart`,
66
67
  stateFile: z
67
68
  .string()
68
69
  .optional()
69
- .describe("Optional path to state file from skyramp_analyze_changes. When provided, execution results (passed/failed, errors, duration) will be written back to enrich the test health analysis."),
70
+ .describe("Path to state file from skyramp_analyze_changes. Always pass when available results are written back so skyramp_submit_report can override before/afterStatus with ground-truth pass/fail."),
71
+ phase: z
72
+ .enum(["before", "after"])
73
+ .optional()
74
+ .describe("Execution phase for maintained tests: 'before' captures pre-edit baseline; 'after' (default) records post-edit result."),
70
75
  },
71
76
  _meta: {
72
77
  keywords: ["run test", "execute test"],
@@ -147,7 +152,12 @@ For detailed documentation visit: https://www.skyramp.dev/docs/quickstart`,
147
152
  if (stateData && stateData.existingTests) {
148
153
  const testIndex = stateData.existingTests.findIndex((t) => t.testFile === params.testFile);
149
154
  if (testIndex >= 0) {
150
- stateData.existingTests[testIndex].execution = result;
155
+ if (params.phase === "before") {
156
+ stateData.existingTests[testIndex].executionBefore = result;
157
+ }
158
+ else {
159
+ stateData.existingTests[testIndex].executionAfter = result;
160
+ }
151
161
  await stateManager.writeData(stateData);
152
162
  logger.info(`Updated stateFile with execution results for ${params.testFile}`);
153
163
  }
@@ -163,7 +173,7 @@ For detailed documentation visit: https://www.skyramp.dev/docs/quickstart`,
163
173
  }
164
174
  // Progress is already reported by TestExecutionService
165
175
  // Only report final status if not already at 100%
166
- if (!result.passed) {
176
+ if (result.status !== TestExecutionStatus.Pass) {
167
177
  errorResult = {
168
178
  content: [
169
179
  {
@@ -177,11 +187,14 @@ For detailed documentation visit: https://www.skyramp.dev/docs/quickstart`,
177
187
  return errorResult;
178
188
  }
179
189
  // Success - progress already reported by TestExecutionService
190
+ const videoInfo = result.videoPath
191
+ ? `\n\nVideo recording: ${result.videoPath}`
192
+ : "";
180
193
  return {
181
194
  content: [
182
195
  {
183
196
  type: "text",
184
- text: `Test execution result: ${stripVTControlCharacters(result.output || "")}`,
197
+ text: `Test execution result: ${stripVTControlCharacters(result.output || "")}${videoInfo}`,
185
198
  },
186
199
  ],
187
200
  };
@@ -0,0 +1,2 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerFixErrorTool(server: McpServer): void;
@@ -0,0 +1,45 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
3
+ import { HttpMethod } from "../../types/TestTypes.js";
4
+ export declare const stepSchema: z.ZodEffects<z.ZodObject<{
5
+ method: z.ZodNativeEnum<typeof HttpMethod>;
6
+ path: z.ZodString;
7
+ requestBody: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
8
+ queryParams: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
9
+ responseBody: z.ZodOptional<z.ZodString>;
10
+ statusCode: z.ZodOptional<z.ZodNumber>;
11
+ responseHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ path: string;
14
+ method: HttpMethod;
15
+ queryParams?: string | undefined;
16
+ statusCode?: number | undefined;
17
+ requestBody?: string | undefined;
18
+ responseBody?: string | undefined;
19
+ responseHeaders?: Record<string, string[]> | undefined;
20
+ }, {
21
+ path: string;
22
+ method: HttpMethod;
23
+ queryParams?: string | undefined;
24
+ statusCode?: number | undefined;
25
+ requestBody?: string | undefined;
26
+ responseBody?: string | undefined;
27
+ responseHeaders?: Record<string, string[]> | undefined;
28
+ }>, {
29
+ path: string;
30
+ method: HttpMethod;
31
+ queryParams?: string | undefined;
32
+ statusCode?: number | undefined;
33
+ requestBody?: string | undefined;
34
+ responseBody?: string | undefined;
35
+ responseHeaders?: Record<string, string[]> | undefined;
36
+ }, {
37
+ path: string;
38
+ method: HttpMethod;
39
+ queryParams?: string | undefined;
40
+ statusCode?: number | undefined;
41
+ requestBody?: string | undefined;
42
+ responseBody?: string | undefined;
43
+ responseHeaders?: Record<string, string[]> | undefined;
44
+ }>;
45
+ export declare function registerBatchScenarioTestTool(server: McpServer): void;
@@ -67,7 +67,7 @@ CRITICAL: For search/filter/list endpoints (e.g., GET /products/search?q=bear&li
67
67
  responseBody: z
68
68
  .string()
69
69
  .optional()
70
- .describe("JSON string of the expected response body"),
70
+ .describe("JSON string of the expected response body. For steps that produce an id used by later steps, include that id field with a realistic UUID generated fresh for this scenario — the backend chains by value-matching any subsequent step path or requestBody that contains the same UUID."),
71
71
  statusCode: z
72
72
  .number()
73
73
  .optional()
@@ -1,10 +1,13 @@
1
- jest.mock("../../services/ScenarioGenerationService.js", () => ({
1
+ // @ts-nocheck - Jest ESM type inference issues
2
+ import { jest } from "@jest/globals";
3
+ import fs from "fs";
4
+ jest.unstable_mockModule("../../services/ScenarioGenerationService.js", () => ({
2
5
  ScenarioGenerationService: jest.fn().mockImplementation(() => ({
3
6
  generateTraceRequestFromInput: jest.fn().mockReturnValue(null),
4
7
  })),
5
8
  }));
6
- jest.mock("../../services/AnalyticsService.js", () => ({ AnalyticsService: { pushMCPToolEvent: jest.fn().mockResolvedValue(undefined) } }));
7
- jest.mock("../../utils/workspaceAuth.js", () => ({
9
+ jest.unstable_mockModule("../../services/AnalyticsService.js", () => ({ AnalyticsService: { pushMCPToolEvent: jest.fn().mockResolvedValue(undefined) } }));
10
+ jest.unstable_mockModule("../../utils/workspaceAuth.js", () => ({
8
11
  getWorkspaceAuthConfig: jest.fn().mockResolvedValue({ authHeader: undefined, authType: "none" }),
9
12
  WorkspaceAuthType: { None: "none" },
10
13
  getDefaultAuthHeader: jest.fn().mockReturnValue(""),
@@ -12,10 +15,10 @@ jest.mock("../../utils/workspaceAuth.js", () => ({
12
15
  getAuthScheme: jest.fn().mockReturnValue(""),
13
16
  readWorkspaceConfigRaw: jest.fn().mockResolvedValue(null),
14
17
  }));
15
- jest.mock("../../utils/logger.js", () => ({ logger: { info: jest.fn(), warning: jest.fn(), error: jest.fn() } }));
16
- jest.mock("../../prompts/personas.js", () => ({ getPersonaPrefix: () => "" }));
17
- import fs from "fs";
18
- import { stepSchema, registerBatchScenarioTestTool } from "./generateBatchScenarioRestTool.js";
18
+ jest.unstable_mockModule("../../utils/logger.js", () => ({ logger: { info: jest.fn(), warning: jest.fn(), error: jest.fn() } }));
19
+ jest.unstable_mockModule("../../prompts/personas.js", () => ({ getPersonaPrefix: () => "" }));
20
+ const { stepSchema, registerBatchScenarioTestTool } = await import("./generateBatchScenarioRestTool.js");
21
+ const { ScenarioGenerationService } = await import("../../services/ScenarioGenerationService.js");
19
22
  /** Build a minimal mock McpServer, register the tool, and return the captured handler. */
20
23
  function captureHandler() {
21
24
  let capturedHandler;
@@ -191,8 +194,7 @@ describe("generateBatchScenarioRestTool — spec path validation (Change 3)", ()
191
194
  readFileSyncSpy = jest.spyOn(fs, "readFileSync").mockReturnValue(fakeSpec);
192
195
  writeFileSyncSpy = jest.spyOn(fs, "writeFileSync").mockImplementation(() => { });
193
196
  // Return a valid trace so tests reach the success path (where the warning is appended)
194
- const ScenarioSvc = require("../../services/ScenarioGenerationService.js").ScenarioGenerationService;
195
- ScenarioSvc.mockImplementation(() => ({
197
+ ScenarioGenerationService.mockImplementation(() => ({
196
198
  generateTraceRequestFromInput: jest.fn().mockReturnValue({ method: "GET", path: "/mock" }),
197
199
  }));
198
200
  });
@@ -0,0 +1,31 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { TestType } from "../../types/TestTypes.js";
3
+ import { TestGenerationService, BaseTestParams } from "../../services/TestGenerationService.js";
4
+ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
5
+ type ContractParams = BaseTestParams & {
6
+ enhanceAssertions?: boolean;
7
+ assertOptions?: string;
8
+ responseData?: string;
9
+ providerMode?: boolean;
10
+ consumerMode?: boolean;
11
+ providerOutput?: string;
12
+ consumerOutput?: string;
13
+ parentRequestData?: Record<string, string>;
14
+ parentStatusCode?: Record<string, string>;
15
+ parentFormParams?: Record<string, string>;
16
+ skipProvisionParents?: boolean;
17
+ };
18
+ export declare class ContractTestService extends TestGenerationService {
19
+ protected getTestType(): TestType;
20
+ protected handleApiAnalysis(params: BaseTestParams): Promise<CallToolResult | null>;
21
+ generateTest(params: ContractParams & Record<string, any>): Promise<CallToolResult>;
22
+ private buildSampleDataSection;
23
+ private buildPlaceholderReplacementBlock;
24
+ private buildSampleDataInstructions;
25
+ private buildProviderPostGenInstructions;
26
+ private buildConsumerStubReplacementInstructions;
27
+ protected validateInputs(params: ContractParams): CallToolResult;
28
+ protected buildGenerationOptions(params: ContractParams): any;
29
+ }
30
+ export declare function registerContractTestTool(server: McpServer): void;
31
+ export {};
@@ -0,0 +1,13 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { TestType } from "../../types/TestTypes.js";
3
+ import { TestGenerationService, BaseTestParams } from "../../services/TestGenerationService.js";
4
+ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
5
+ export declare class E2ETestService extends TestGenerationService {
6
+ protected getTestType(): TestType;
7
+ protected buildGenerationOptions(params: BaseTestParams & {
8
+ responseData?: string;
9
+ playwrightInput?: string;
10
+ }): any;
11
+ protected handleApiAnalysis(params: BaseTestParams): Promise<CallToolResult | null>;
12
+ }
13
+ export declare function registerE2ETestTool(server: McpServer): void;
@@ -0,0 +1,10 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { TestType } from "../../types/TestTypes.js";
3
+ import { TestGenerationService, BaseTestParams } from "../../services/TestGenerationService.js";
4
+ export declare class FuzzTestService extends TestGenerationService {
5
+ protected getTestType(): TestType;
6
+ protected buildGenerationOptions(params: BaseTestParams & {
7
+ responseData?: string;
8
+ }): any;
9
+ }
10
+ export declare function registerFuzzTestTool(server: McpServer): void;
@@ -0,0 +1,16 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { TestType } from "../../types/TestTypes.js";
3
+ import { TestGenerationService, BaseTestParams } from "../../services/TestGenerationService.js";
4
+ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
5
+ export declare class IntegrationTestService extends TestGenerationService {
6
+ protected getTestType(): TestType;
7
+ generateTest(params: BaseTestParams & Record<string, any>): Promise<CallToolResult>;
8
+ private buildAssertionEnhancementInstructions;
9
+ protected buildGenerationOptions(params: BaseTestParams & {
10
+ responseData?: string;
11
+ playwrightInput?: string;
12
+ scenarioFile?: string;
13
+ }): any;
14
+ protected handleApiAnalysis(_params: BaseTestParams): Promise<CallToolResult | null>;
15
+ }
16
+ export declare function registerIntegrationTestTool(server: McpServer): void;
@@ -0,0 +1,18 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { TestType } from "../../types/TestTypes.js";
3
+ import { TestGenerationService, BaseTestParams } from "../../services/TestGenerationService.js";
4
+ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
5
+ export { loadTestSchema, numericString } from "./loadTestSchema.js";
6
+ export declare class LoadTestService extends TestGenerationService {
7
+ protected getTestType(): TestType;
8
+ protected buildGenerationOptions(params: BaseTestParams & {
9
+ loadCount?: string;
10
+ loadDuration?: string;
11
+ loadNumThreads?: string;
12
+ loadRampupDuration?: string;
13
+ loadRampupInterval?: string;
14
+ loadTargetRPS?: string;
15
+ }): any;
16
+ protected handleApiAnalysis(params: BaseTestParams): Promise<CallToolResult | null>;
17
+ }
18
+ export declare function registerLoadTestTool(server: McpServer): void;
@@ -0,0 +1,64 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { TestType } from "../../types/TestTypes.js";
3
+ import { TestGenerationService } from "../../services/TestGenerationService.js";
4
+ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
5
+ type MockParams = {
6
+ endpointURL?: string;
7
+ method?: string;
8
+ apiSchema?: string;
9
+ responseData?: string;
10
+ responseStatusCode?: string;
11
+ requestData?: string;
12
+ formParams?: string;
13
+ requestAware?: boolean;
14
+ trace?: string;
15
+ mockPort?: number;
16
+ optionalFields?: boolean;
17
+ language?: string;
18
+ framework?: string;
19
+ output?: string;
20
+ outputDir: string;
21
+ force: boolean;
22
+ deployDashboard?: boolean;
23
+ runtime?: string;
24
+ dockerNetwork?: string;
25
+ dockerWorkerPort?: number;
26
+ k8sNamespace?: string;
27
+ k8sConfig?: string;
28
+ k8sContext?: string;
29
+ prompt?: string;
30
+ };
31
+ export declare class MockGenerationService extends TestGenerationService {
32
+ protected getTestType(): TestType;
33
+ generateTest(params: MockParams & Record<string, any>): Promise<CallToolResult>;
34
+ private buildReorganizationInstructions;
35
+ protected buildGenerationOptions(params: MockParams): {
36
+ uri: string | undefined;
37
+ method: string | undefined;
38
+ apiSchema: string[];
39
+ language: string;
40
+ framework: string;
41
+ output: string | undefined;
42
+ outputDir: string;
43
+ force: boolean;
44
+ deployDashboard: boolean | undefined;
45
+ runtime: string | undefined;
46
+ dockerNetwork: string | undefined;
47
+ dockerWorkerPort: string;
48
+ k8sNamespace: string | undefined;
49
+ k8sConfig: string | undefined;
50
+ k8sContext: string | undefined;
51
+ requestData: string | undefined;
52
+ responseData: string | undefined;
53
+ responseStatusCode: string | undefined;
54
+ formParams: string | undefined;
55
+ requestAware: boolean | undefined;
56
+ traceFilePath: string | undefined;
57
+ entrypoint: string;
58
+ mockPort: number;
59
+ optionalFields: boolean;
60
+ };
61
+ protected executeGeneration(generateOptions: any): Promise<string>;
62
+ }
63
+ export declare function registerMockTool(server: McpServer): void;
64
+ export {};
@@ -0,0 +1,8 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { TestType } from "../../types/TestTypes.js";
3
+ import { TestGenerationService, BaseTestParams } from "../../services/TestGenerationService.js";
4
+ export declare class SmokeTestService extends TestGenerationService {
5
+ protected getTestType(): TestType;
6
+ protected buildGenerationOptions(params: BaseTestParams): any;
7
+ }
8
+ export declare function registerSmokeTestTool(server: McpServer): void;
@@ -0,0 +1,14 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { TestType } from "../../types/TestTypes.js";
3
+ import { BaseTestParams, TestGenerationService } from "../../services/TestGenerationService.js";
4
+ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
5
+ export declare class UITestService extends TestGenerationService {
6
+ protected getTestType(): TestType;
7
+ protected buildGenerationOptions(params: BaseTestParams & {
8
+ playwrightInput?: string;
9
+ }): any;
10
+ protected handleApiAnalysis(params: BaseTestParams): Promise<CallToolResult | null>;
11
+ generateTest(params: BaseTestParams & Record<string, any>): Promise<CallToolResult>;
12
+ private buildUIPostGenInstructions;
13
+ }
14
+ export declare function registerUITestTool(server: McpServer): void;
@@ -96,7 +96,7 @@ This tells you exactly which frontend files changed so you record traces for the
96
96
 
97
97
  **Typical pipeline:** Use the \`browser_*\` tools (\`browser_navigate\`, \`browser_click\`, \`browser_type\`, etc.) to record user interactions, then call \`skyramp_export_zip\` to export a trace zip, then pass the absolute path to that zip as \`playwrightInput\` here.
98
98
 
99
- **DOM Analyzer tools for blueprint-aware recording:** alongside the basic \`browser_*\` interaction tools, the Skyramp MCP exposes \`browser_blueprint\` (canonical PageBlueprint capture), \`browser_blueprint_diff\` (structured before/after delta), \`browser_widget_contract_lookup\` (interaction recipe for custom widgets by fingerprint), and the sitemap tools \`browser_sitemap_build\` / \`browser_sitemap_query\`. These enable semantic target selection and delta-derived assertions: capture a blueprint before each meaningful action, perform the action, then capture again — the diff between the two grounds your assertions in observable state changes rather than author guesses about what "success" looks like.
99
+ **DOM Analyzer tools for blueprint-aware recording:** alongside the basic \`browser_*\` interaction tools, the Skyramp MCP exposes \`browser_blueprint\` (canonical PageBlueprint capture). This enables semantic target selection and delta-derived assertions: capture a blueprint before each meaningful action, perform the action, then capture again — the delta between the two grounds your assertions in observable state changes rather than author guesses about what "success" looks like.
100
100
 
101
101
  **CRITICAL: Do NOT use skyramp_start_trace_collection/skyramp_stop_trace_collection for UI test recording — use browser_* tools + skyramp_export_zip instead.**`,
102
102
  inputSchema: uiTestSchema,
@@ -0,0 +1,39 @@
1
+ import { z } from "zod";
2
+ export declare const numericString: (description: string) => z.ZodEffects<z.ZodString, string, string>;
3
+ export declare const loadTestSchema: {
4
+ loadCount: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
5
+ loadDuration: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
6
+ loadNumThreads: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
7
+ loadRampupDuration: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
8
+ loadRampupInterval: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
9
+ loadTargetRPS: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
10
+ trace: z.ZodDefault<z.ZodString>;
11
+ include: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
12
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
13
+ endpointURL: z.ZodDefault<z.ZodString>;
14
+ deployDashboard: z.ZodDefault<z.ZodBoolean>;
15
+ runtime: z.ZodDefault<z.ZodNativeEnum<typeof import("../../types/TestTypes.js").RuntimeEnvironment>>;
16
+ dockerNetwork: z.ZodDefault<z.ZodString>;
17
+ dockerWorkerPort: z.ZodDefault<z.ZodNumber>;
18
+ k8sNamespace: z.ZodDefault<z.ZodString>;
19
+ k8sConfig: z.ZodDefault<z.ZodString>;
20
+ k8sContext: z.ZodDefault<z.ZodString>;
21
+ authHeader: z.ZodDefault<z.ZodString>;
22
+ authScheme: z.ZodDefault<z.ZodString>;
23
+ insecure: z.ZodDefault<z.ZodBoolean>;
24
+ output: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
25
+ outputDir: z.ZodString;
26
+ force: z.ZodDefault<z.ZodBoolean>;
27
+ mockPort: z.ZodDefault<z.ZodNumber>;
28
+ optionalFields: z.ZodDefault<z.ZodBoolean>;
29
+ prompt: z.ZodString;
30
+ language: z.ZodNativeEnum<typeof import("../../types/TestTypes.js").ProgrammingLanguage>;
31
+ framework: z.ZodString;
32
+ method: z.ZodDefault<z.ZodUnion<[z.ZodNativeEnum<typeof import("../../types/TestTypes.js").HttpMethod>, z.ZodLiteral<"">]>>;
33
+ apiSchema: z.ZodDefault<z.ZodString>;
34
+ pathParams: z.ZodDefault<z.ZodString>;
35
+ queryParams: z.ZodDefault<z.ZodString>;
36
+ formParams: z.ZodDefault<z.ZodString>;
37
+ requestData: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
38
+ responseStatusCode: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
39
+ };
@@ -0,0 +1,11 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ /** User params passed to workflow builder (optional fields may be undefined) */
3
+ export type OneClickParams = {
4
+ workflow: string;
5
+ repositoryPath: string;
6
+ endpointURL?: string;
7
+ apiSchema?: string;
8
+ topN?: number;
9
+ token?: string;
10
+ };
11
+ export declare function registerOneClickTool(server: McpServer): void;