@skyramp/mcp 0.3.2-rc.pom-4 → 0.3.2

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 (132) hide show
  1. package/build/adapters/jestAdapter.d.ts +14 -0
  2. package/build/adapters/jestAdapter.js +113 -0
  3. package/build/adapters/mochaAdapter.d.ts +13 -0
  4. package/build/adapters/mochaAdapter.js +87 -0
  5. package/build/adapters/playwrightAdapter.d.ts +17 -0
  6. package/build/adapters/playwrightAdapter.js +182 -0
  7. package/build/adapters/pytestAdapter.d.ts +15 -0
  8. package/build/adapters/pytestAdapter.js +108 -0
  9. package/build/commands/commandLibrary.d.ts +1 -0
  10. package/build/commands/commandLibrary.js +19 -13
  11. package/build/commands/localDevTestChangesCommand.d.ts +15 -0
  12. package/build/commands/localDevTestChangesCommand.js +201 -0
  13. package/build/index.js +82 -6
  14. package/build/prompts/code-reuse.js +3 -0
  15. package/build/prompts/enhance-assertions/sharedAssertionRules.d.ts +1 -0
  16. package/build/prompts/enhance-assertions/sharedAssertionRules.js +17 -0
  17. package/build/prompts/initialize-workspace/initializeWorkspacePrompt.js +11 -9
  18. package/build/prompts/local-dev/local-dev-plan.d.ts +35 -0
  19. package/build/prompts/local-dev/local-dev-plan.js +429 -0
  20. package/build/prompts/local-dev/local-dev-prompts.d.ts +4 -0
  21. package/build/prompts/local-dev/local-dev-prompts.js +190 -0
  22. package/build/prompts/prompt-utils.d.ts +8 -0
  23. package/build/prompts/prompt-utils.js +33 -0
  24. package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.js +70 -7
  25. package/build/prompts/sut-setup/modes/dockerComposePrompt.js +1 -1
  26. package/build/prompts/sut-setup/shared.js +19 -17
  27. package/build/prompts/test-maintenance/drift-analysis-prompt.d.ts +10 -1
  28. package/build/prompts/test-maintenance/drift-analysis-prompt.js +54 -1
  29. package/build/prompts/test-recommendation/analysisOutputPrompt.js +21 -29
  30. package/build/prompts/test-recommendation/scopeAssessment.d.ts +5 -2
  31. package/build/prompts/test-recommendation/scopeAssessment.js +78 -6
  32. package/build/prompts/test-recommendation/test-recommendation-prompt.js +41 -4
  33. package/build/prompts/testbot/testbot-prompts.d.ts +0 -5
  34. package/build/prompts/testbot/testbot-prompts.js +39 -55
  35. package/build/recommendation/planRanker.d.ts +15 -2
  36. package/build/recommendation/planRanker.js +76 -5
  37. package/build/resources/testbotResource.js +2 -1
  38. package/build/services/AnalyticsService.d.ts +1 -1
  39. package/build/services/TestExecutionService.d.ts +2 -1
  40. package/build/services/TestExecutionService.js +8 -3
  41. package/build/services/TestGenerationService.d.ts +2 -2
  42. package/build/services/TestGenerationService.js +39 -21
  43. package/build/services/containerEnv.js +3 -1
  44. package/build/tool-phases.js +7 -0
  45. package/build/tools/code-refactor/codeReuseTool.js +43 -4
  46. package/build/tools/code-refactor/enhanceAssertionsTool.js +68 -18
  47. package/build/tools/code-refactor/reuse-outcome.d.ts +109 -0
  48. package/build/tools/code-refactor/reuse-outcome.js +158 -0
  49. package/build/tools/code-refactor/reuse-state.d.ts +45 -0
  50. package/build/tools/code-refactor/reuse-state.js +140 -0
  51. package/build/tools/enrichTestWithMocksTool.d.ts +28 -0
  52. package/build/tools/enrichTestWithMocksTool.js +726 -0
  53. package/build/tools/executeSkyrampTestTool.d.ts +11 -0
  54. package/build/tools/executeSkyrampTestTool.js +62 -21
  55. package/build/tools/generate-tests/batchMockGenerationTool.d.ts +106 -0
  56. package/build/tools/generate-tests/batchMockGenerationTool.js +545 -0
  57. package/build/tools/generate-tests/generateBatchScenarioRestTool.js +25 -23
  58. package/build/tools/generate-tests/generateContractRestTool.js +2 -2
  59. package/build/tools/generate-tests/generateE2ERestTool.d.ts +1 -1
  60. package/build/tools/generate-tests/generateE2ERestTool.js +1 -1
  61. package/build/tools/generate-tests/generateLoadRestTool.d.ts +1 -1
  62. package/build/tools/generate-tests/generateLoadRestTool.js +1 -1
  63. package/build/tools/generate-tests/generateMockRestTool.d.ts +179 -6
  64. package/build/tools/generate-tests/generateMockRestTool.js +391 -22
  65. package/build/tools/generate-tests/loadTestSchema.d.ts +1 -1
  66. package/build/tools/generate-tests/planGuard.js +2 -22
  67. package/build/tools/generateEnrichedIntegrationTestTool.d.ts +25 -0
  68. package/build/tools/generateEnrichedIntegrationTestTool.js +235 -0
  69. package/build/tools/localDevWorkerComposeTool.d.ts +24 -0
  70. package/build/tools/localDevWorkerComposeTool.js +264 -0
  71. package/build/tools/one-click/oneClickTool.d.ts +13 -0
  72. package/build/tools/one-click/oneClickTool.js +195 -24
  73. package/build/tools/preflightMockCheckTool.d.ts +2 -0
  74. package/build/tools/preflightMockCheckTool.js +96 -0
  75. package/build/tools/queryProxyMocksTool.d.ts +70 -0
  76. package/build/tools/queryProxyMocksTool.js +522 -0
  77. package/build/tools/runExistingTestsTool.d.ts +138 -0
  78. package/build/tools/runExistingTestsTool.js +644 -0
  79. package/build/tools/submitReportTool.js +30 -1
  80. package/build/tools/test-management/analyzeChangesTool.d.ts +2 -1
  81. package/build/tools/test-management/analyzeChangesTool.js +63 -40
  82. package/build/tools/test-management/analyzeTestHealthTool.d.ts +11 -0
  83. package/build/tools/test-management/analyzeTestHealthTool.js +63 -1
  84. package/build/tools/test-management/registerTestPlanTool.js +55 -7
  85. package/build/tools/trace/startTraceCollectionTool.js +3 -3
  86. package/build/types/ExternalTestExecution.d.ts +67 -0
  87. package/build/types/ExternalTestExecution.js +8 -0
  88. package/build/types/OneClickCommands.d.ts +1 -1
  89. package/build/types/Recommendation.d.ts +20 -0
  90. package/build/types/Recommendation.js +32 -6
  91. package/build/types/RepositoryAnalysis.d.ts +131 -14
  92. package/build/types/RepositoryAnalysis.js +16 -2
  93. package/build/types/ReuseOutcome.d.ts +63 -0
  94. package/build/types/ReuseOutcome.js +33 -0
  95. package/build/types/TestExecution.d.ts +1 -0
  96. package/build/types/TestTypes.d.ts +25 -7
  97. package/build/types/TestTypes.js +25 -7
  98. package/build/types/TestbotReport.d.ts +7 -0
  99. package/build/types/index.d.ts +2 -0
  100. package/build/types/index.js +1 -0
  101. package/build/utils/AnalysisStateManager.d.ts +33 -0
  102. package/build/utils/AnalysisStateManager.js +36 -2
  103. package/build/utils/analyze-openapi.js +18 -1
  104. package/build/utils/branchDiff.d.ts +17 -1
  105. package/build/utils/branchDiff.js +99 -14
  106. package/build/utils/featureFlags.d.ts +31 -0
  107. package/build/utils/featureFlags.js +37 -0
  108. package/build/utils/grpcMockValidation.d.ts +1 -0
  109. package/build/utils/grpcMockValidation.js +49 -0
  110. package/build/utils/httpMethodValidation.d.ts +4 -0
  111. package/build/utils/httpMethodValidation.js +15 -0
  112. package/build/utils/logger.js +1 -1
  113. package/build/utils/mockCompatibility.d.ts +49 -0
  114. package/build/utils/mockCompatibility.js +82 -0
  115. package/build/utils/pom-verify/verify.d.ts +5 -0
  116. package/build/utils/pom-verify/verify.js +1 -0
  117. package/build/utils/progress.js +10 -5
  118. package/build/utils/proxy-terminal.js +3 -3
  119. package/build/utils/routeParsers.d.ts +3 -9
  120. package/build/utils/routeParsers.js +79 -4
  121. package/build/utils/utils.js +2 -2
  122. package/build/utils/versions.d.ts +4 -3
  123. package/build/utils/versions.js +3 -1
  124. package/build/utils/workspaceAuth.d.ts +46 -0
  125. package/build/utils/workspaceAuth.js +156 -1
  126. package/build/workspace/frameworks.d.ts +11 -0
  127. package/build/workspace/frameworks.js +22 -0
  128. package/build/workspace/testSuites.d.ts +20 -0
  129. package/build/workspace/testSuites.js +17 -0
  130. package/build/workspace/workspace.d.ts +206 -24
  131. package/build/workspace/workspace.js +52 -2
  132. package/package.json +5 -2
@@ -145,6 +145,22 @@ export interface BranchDiffContext {
145
145
  affectedServices: string[];
146
146
  summary?: string;
147
147
  }
148
+ export interface RouteDiscoveryInfo {
149
+ /** Files the LLM should inspect to infer endpoint methods and paths from source. */
150
+ candidateFiles: string[];
151
+ /** Static scanner output. Best-effort hints only, not an authoritative catalog. */
152
+ staticHints: Array<{
153
+ path: string;
154
+ methods: string[];
155
+ sourceFile: string;
156
+ }>;
157
+ /** OpenAPI paths from workspace config. Authoritative when specFetchSucceeded is true. */
158
+ openApiPaths: string[];
159
+ /** Router/module entry points that help the LLM reconstruct full mounted paths. */
160
+ routerMountContext: string[];
161
+ /** Full diff file path when available; read this to ground endpoint extraction in changed code. */
162
+ diffFilePath?: string;
163
+ }
148
164
  export interface RepositoryAnalysis {
149
165
  metadata: AnalysisMetadata;
150
166
  projectClassification: ProjectClassification;
@@ -155,6 +171,7 @@ export interface RepositoryAnalysis {
155
171
  authentication: AuthenticationInfo;
156
172
  infrastructure: InfrastructureInfo;
157
173
  existingTests: ExistingTestInfo;
174
+ routeDiscovery?: RouteDiscoveryInfo;
158
175
  branchDiffContext?: BranchDiffContext;
159
176
  }
160
177
  export interface AnalysisMetadata {
@@ -542,6 +559,7 @@ export declare const endpointMethodSchema: z.ZodObject<{
542
559
  }, "strip", z.ZodTypeAny, {
543
560
  method: string;
544
561
  description: string;
562
+ sourceFile: string;
545
563
  queryParams: {
546
564
  type: string;
547
565
  name: string;
@@ -550,7 +568,6 @@ export declare const endpointMethodSchema: z.ZodObject<{
550
568
  constraints?: string | undefined;
551
569
  }[];
552
570
  authRequired: boolean;
553
- sourceFile: string;
554
571
  interactions: {
555
572
  type: "error" | "success" | "edge-case";
556
573
  description: string;
@@ -581,6 +598,7 @@ export declare const endpointMethodSchema: z.ZodObject<{
581
598
  }, {
582
599
  method: string;
583
600
  description: string;
601
+ sourceFile: string;
584
602
  queryParams: {
585
603
  type: string;
586
604
  name: string;
@@ -589,7 +607,6 @@ export declare const endpointMethodSchema: z.ZodObject<{
589
607
  constraints?: string | undefined;
590
608
  }[];
591
609
  authRequired: boolean;
592
- sourceFile: string;
593
610
  interactions: {
594
611
  type: "error" | "success" | "edge-case";
595
612
  description: string;
@@ -784,6 +801,7 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
784
801
  }, "strip", z.ZodTypeAny, {
785
802
  method: string;
786
803
  description: string;
804
+ sourceFile: string;
787
805
  queryParams: {
788
806
  type: string;
789
807
  name: string;
@@ -792,7 +810,6 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
792
810
  constraints?: string | undefined;
793
811
  }[];
794
812
  authRequired: boolean;
795
- sourceFile: string;
796
813
  interactions: {
797
814
  type: "error" | "success" | "edge-case";
798
815
  description: string;
@@ -823,6 +840,7 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
823
840
  }, {
824
841
  method: string;
825
842
  description: string;
843
+ sourceFile: string;
826
844
  queryParams: {
827
845
  type: string;
828
846
  name: string;
@@ -831,7 +849,6 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
831
849
  constraints?: string | undefined;
832
850
  }[];
833
851
  authRequired: boolean;
834
- sourceFile: string;
835
852
  interactions: {
836
853
  type: "error" | "success" | "edge-case";
837
854
  description: string;
@@ -873,6 +890,7 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
873
890
  methods: {
874
891
  method: string;
875
892
  description: string;
893
+ sourceFile: string;
876
894
  queryParams: {
877
895
  type: string;
878
896
  name: string;
@@ -881,7 +899,6 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
881
899
  constraints?: string | undefined;
882
900
  }[];
883
901
  authRequired: boolean;
884
- sourceFile: string;
885
902
  interactions: {
886
903
  type: "error" | "success" | "edge-case";
887
904
  description: string;
@@ -923,6 +940,7 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
923
940
  methods: {
924
941
  method: string;
925
942
  description: string;
943
+ sourceFile: string;
926
944
  queryParams: {
927
945
  type: string;
928
946
  name: string;
@@ -931,7 +949,6 @@ export declare const enrichedEndpointSchema: z.ZodObject<{
931
949
  constraints?: string | undefined;
932
950
  }[];
933
951
  authRequired: boolean;
934
- sourceFile: string;
935
952
  interactions: {
936
953
  type: "error" | "success" | "edge-case";
937
954
  description: string;
@@ -1423,6 +1440,45 @@ export declare const branchDiffContextSchema: z.ZodObject<{
1423
1440
  }[] | undefined;
1424
1441
  summary?: string | undefined;
1425
1442
  }>;
1443
+ export declare const routeDiscoveryInfoSchema: z.ZodObject<{
1444
+ candidateFiles: z.ZodArray<z.ZodString, "many">;
1445
+ staticHints: z.ZodArray<z.ZodObject<{
1446
+ path: z.ZodString;
1447
+ methods: z.ZodArray<z.ZodString, "many">;
1448
+ sourceFile: z.ZodString;
1449
+ }, "strip", z.ZodTypeAny, {
1450
+ path: string;
1451
+ sourceFile: string;
1452
+ methods: string[];
1453
+ }, {
1454
+ path: string;
1455
+ sourceFile: string;
1456
+ methods: string[];
1457
+ }>, "many">;
1458
+ openApiPaths: z.ZodArray<z.ZodString, "many">;
1459
+ routerMountContext: z.ZodArray<z.ZodString, "many">;
1460
+ diffFilePath: z.ZodOptional<z.ZodString>;
1461
+ }, "strip", z.ZodTypeAny, {
1462
+ candidateFiles: string[];
1463
+ staticHints: {
1464
+ path: string;
1465
+ sourceFile: string;
1466
+ methods: string[];
1467
+ }[];
1468
+ openApiPaths: string[];
1469
+ routerMountContext: string[];
1470
+ diffFilePath?: string | undefined;
1471
+ }, {
1472
+ candidateFiles: string[];
1473
+ staticHints: {
1474
+ path: string;
1475
+ sourceFile: string;
1476
+ methods: string[];
1477
+ }[];
1478
+ openApiPaths: string[];
1479
+ routerMountContext: string[];
1480
+ diffFilePath?: string | undefined;
1481
+ }>;
1426
1482
  export declare const analysisMetadataSchema: z.ZodObject<{
1427
1483
  repositoryName: z.ZodString;
1428
1484
  analysisDate: z.ZodString;
@@ -2057,6 +2113,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2057
2113
  }, "strip", z.ZodTypeAny, {
2058
2114
  method: string;
2059
2115
  description: string;
2116
+ sourceFile: string;
2060
2117
  queryParams: {
2061
2118
  type: string;
2062
2119
  name: string;
@@ -2065,7 +2122,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2065
2122
  constraints?: string | undefined;
2066
2123
  }[];
2067
2124
  authRequired: boolean;
2068
- sourceFile: string;
2069
2125
  interactions: {
2070
2126
  type: "error" | "success" | "edge-case";
2071
2127
  description: string;
@@ -2096,6 +2152,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2096
2152
  }, {
2097
2153
  method: string;
2098
2154
  description: string;
2155
+ sourceFile: string;
2099
2156
  queryParams: {
2100
2157
  type: string;
2101
2158
  name: string;
@@ -2104,7 +2161,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2104
2161
  constraints?: string | undefined;
2105
2162
  }[];
2106
2163
  authRequired: boolean;
2107
- sourceFile: string;
2108
2164
  interactions: {
2109
2165
  type: "error" | "success" | "edge-case";
2110
2166
  description: string;
@@ -2146,6 +2202,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2146
2202
  methods: {
2147
2203
  method: string;
2148
2204
  description: string;
2205
+ sourceFile: string;
2149
2206
  queryParams: {
2150
2207
  type: string;
2151
2208
  name: string;
@@ -2154,7 +2211,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2154
2211
  constraints?: string | undefined;
2155
2212
  }[];
2156
2213
  authRequired: boolean;
2157
- sourceFile: string;
2158
2214
  interactions: {
2159
2215
  type: "error" | "success" | "edge-case";
2160
2216
  description: string;
@@ -2196,6 +2252,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2196
2252
  methods: {
2197
2253
  method: string;
2198
2254
  description: string;
2255
+ sourceFile: string;
2199
2256
  queryParams: {
2200
2257
  type: string;
2201
2258
  name: string;
@@ -2204,7 +2261,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2204
2261
  constraints?: string | undefined;
2205
2262
  }[];
2206
2263
  authRequired: boolean;
2207
- sourceFile: string;
2208
2264
  interactions: {
2209
2265
  type: "error" | "success" | "edge-case";
2210
2266
  description: string;
@@ -2250,6 +2306,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2250
2306
  methods: {
2251
2307
  method: string;
2252
2308
  description: string;
2309
+ sourceFile: string;
2253
2310
  queryParams: {
2254
2311
  type: string;
2255
2312
  name: string;
@@ -2258,7 +2315,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2258
2315
  constraints?: string | undefined;
2259
2316
  }[];
2260
2317
  authRequired: boolean;
2261
- sourceFile: string;
2262
2318
  interactions: {
2263
2319
  type: "error" | "success" | "edge-case";
2264
2320
  description: string;
@@ -2304,6 +2360,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2304
2360
  methods: {
2305
2361
  method: string;
2306
2362
  description: string;
2363
+ sourceFile: string;
2307
2364
  queryParams: {
2308
2365
  type: string;
2309
2366
  name: string;
@@ -2312,7 +2369,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2312
2369
  constraints?: string | undefined;
2313
2370
  }[];
2314
2371
  authRequired: boolean;
2315
- sourceFile: string;
2316
2372
  interactions: {
2317
2373
  type: "error" | "success" | "edge-case";
2318
2374
  description: string;
@@ -2440,6 +2496,45 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2440
2496
  estimatedCoverage?: number | undefined;
2441
2497
  relevantExternalTestPaths?: string[] | undefined;
2442
2498
  }>;
2499
+ routeDiscovery: z.ZodOptional<z.ZodObject<{
2500
+ candidateFiles: z.ZodArray<z.ZodString, "many">;
2501
+ staticHints: z.ZodArray<z.ZodObject<{
2502
+ path: z.ZodString;
2503
+ methods: z.ZodArray<z.ZodString, "many">;
2504
+ sourceFile: z.ZodString;
2505
+ }, "strip", z.ZodTypeAny, {
2506
+ path: string;
2507
+ sourceFile: string;
2508
+ methods: string[];
2509
+ }, {
2510
+ path: string;
2511
+ sourceFile: string;
2512
+ methods: string[];
2513
+ }>, "many">;
2514
+ openApiPaths: z.ZodArray<z.ZodString, "many">;
2515
+ routerMountContext: z.ZodArray<z.ZodString, "many">;
2516
+ diffFilePath: z.ZodOptional<z.ZodString>;
2517
+ }, "strip", z.ZodTypeAny, {
2518
+ candidateFiles: string[];
2519
+ staticHints: {
2520
+ path: string;
2521
+ sourceFile: string;
2522
+ methods: string[];
2523
+ }[];
2524
+ openApiPaths: string[];
2525
+ routerMountContext: string[];
2526
+ diffFilePath?: string | undefined;
2527
+ }, {
2528
+ candidateFiles: string[];
2529
+ staticHints: {
2530
+ path: string;
2531
+ sourceFile: string;
2532
+ methods: string[];
2533
+ }[];
2534
+ openApiPaths: string[];
2535
+ routerMountContext: string[];
2536
+ diffFilePath?: string | undefined;
2537
+ }>>;
2443
2538
  branchDiffContext: z.ZodOptional<z.ZodObject<{
2444
2539
  currentBranch: z.ZodString;
2445
2540
  baseBranch: z.ZodString;
@@ -2700,6 +2795,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2700
2795
  methods: {
2701
2796
  method: string;
2702
2797
  description: string;
2798
+ sourceFile: string;
2703
2799
  queryParams: {
2704
2800
  type: string;
2705
2801
  name: string;
@@ -2708,7 +2804,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2708
2804
  constraints?: string | undefined;
2709
2805
  }[];
2710
2806
  authRequired: boolean;
2711
- sourceFile: string;
2712
2807
  interactions: {
2713
2808
  type: "error" | "success" | "edge-case";
2714
2809
  description: string;
@@ -2768,6 +2863,17 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2768
2863
  estimatedCoverage?: number | undefined;
2769
2864
  relevantExternalTestPaths?: string[] | undefined;
2770
2865
  };
2866
+ routeDiscovery?: {
2867
+ candidateFiles: string[];
2868
+ staticHints: {
2869
+ path: string;
2870
+ sourceFile: string;
2871
+ methods: string[];
2872
+ }[];
2873
+ openApiPaths: string[];
2874
+ routerMountContext: string[];
2875
+ diffFilePath?: string | undefined;
2876
+ } | undefined;
2771
2877
  branchDiffContext?: {
2772
2878
  currentBranch: string;
2773
2879
  baseBranch: string;
@@ -2902,6 +3008,7 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2902
3008
  methods: {
2903
3009
  method: string;
2904
3010
  description: string;
3011
+ sourceFile: string;
2905
3012
  queryParams: {
2906
3013
  type: string;
2907
3014
  name: string;
@@ -2910,7 +3017,6 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2910
3017
  constraints?: string | undefined;
2911
3018
  }[];
2912
3019
  authRequired: boolean;
2913
- sourceFile: string;
2914
3020
  interactions: {
2915
3021
  type: "error" | "success" | "edge-case";
2916
3022
  description: string;
@@ -2970,6 +3076,17 @@ export declare const repositoryAnalysisSchema: z.ZodObject<{
2970
3076
  estimatedCoverage?: number | undefined;
2971
3077
  relevantExternalTestPaths?: string[] | undefined;
2972
3078
  };
3079
+ routeDiscovery?: {
3080
+ candidateFiles: string[];
3081
+ staticHints: {
3082
+ path: string;
3083
+ sourceFile: string;
3084
+ methods: string[];
3085
+ }[];
3086
+ openApiPaths: string[];
3087
+ routerMountContext: string[];
3088
+ diffFilePath?: string | undefined;
3089
+ } | undefined;
2973
3090
  branchDiffContext?: {
2974
3091
  currentBranch: string;
2975
3092
  baseBranch: string;
@@ -128,17 +128,30 @@ export const branchDiffContextSchema = z.object({
128
128
  changeType: z.enum(["added", "modified", "removed"]),
129
129
  })),
130
130
  })),
131
- removedEndpoints: z.array(z.object({
131
+ removedEndpoints: z
132
+ .array(z.object({
132
133
  path: z.string(),
133
134
  methods: z.array(z.object({
134
135
  method: z.string(),
135
136
  sourceFile: z.string(),
136
137
  changeType: z.literal("removed"),
137
138
  })),
138
- })).optional(),
139
+ }))
140
+ .optional(),
139
141
  affectedServices: z.array(z.string()),
140
142
  summary: z.string().optional(),
141
143
  });
144
+ export const routeDiscoveryInfoSchema = z.object({
145
+ candidateFiles: z.array(z.string()),
146
+ staticHints: z.array(z.object({
147
+ path: z.string(),
148
+ methods: z.array(z.string()),
149
+ sourceFile: z.string(),
150
+ })),
151
+ openApiPaths: z.array(z.string()),
152
+ routerMountContext: z.array(z.string()),
153
+ diffFilePath: z.string().optional(),
154
+ });
142
155
  export const analysisMetadataSchema = z.object({
143
156
  repositoryName: z.string(),
144
157
  analysisDate: z.string(),
@@ -239,5 +252,6 @@ export const repositoryAnalysisSchema = z.object({
239
252
  estimatedCoverage: z.number().optional(),
240
253
  relevantExternalTestPaths: z.array(z.string()).optional(),
241
254
  }),
255
+ routeDiscovery: routeDiscoveryInfoSchema.optional(),
242
256
  branchDiffContext: branchDiffContextSchema.optional(),
243
257
  });
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The POM code-reuse shape carried in a TestbotReport — the wire contract between
3
+ * this server and the consumers that render it (test-bot.git).
4
+ *
5
+ * Lives in types/ rather than beside the derivation logic in
6
+ * tools/code-refactor/reuse-outcome.ts, and is re-exported from types/index.ts,
7
+ * so consumers have exactly one definition to import. The enums matter here as
8
+ * VALUES, not just types: a renderer validating an incoming `verification` or
9
+ * `declinedBy` needs the actual members to compare against, which a structurally
10
+ * inherited type cannot provide.
11
+ *
12
+ * The internal record that run state keeps between the verify pass and the report
13
+ * step (`ReuseRecord`) deliberately stays private to the derivation module — it is
14
+ * not part of this contract and must never reach a report.
15
+ */
16
+ /** Which gate declined a POM member. */
17
+ export declare enum ReuseDeclinedBy {
18
+ /** The mapping table never promoted it — no call was ever written. */
19
+ NotMapped = "not-mapped",
20
+ /** It was substituted, then verification rejected it and the raw form was
21
+ * restored. A `passed` verdict does NOT cover this: it counts only the calls
22
+ * that survived. */
23
+ DemotedByVerify = "demoted-by-verify"
24
+ }
25
+ /** Outcome of the reuse verification loop for a spec. */
26
+ export declare enum ReuseVerificationOutcome {
27
+ Passed = "passed",
28
+ Failed = "failed",
29
+ /** No page-object layer existed to reuse. */
30
+ SkippedNoPom = "skipped-no-pom"
31
+ }
32
+ /** A POM member the refactor did not reuse. Keyed on the member rather than the
33
+ * file: a class is routinely part-reused (a property substituted while a method
34
+ * from the same class is demoted), so a file-level list would show that file as
35
+ * reused and lose the decline. */
36
+ export interface ReuseSkippedEntry {
37
+ /** The POM file BASENAME the decline was attributed to — the name the agent
38
+ * wrote in its `// kept inline: <file basename> — <reason>` comment, which is
39
+ * what the decline is parsed out of. A class name appears only in `member`. */
40
+ pageObject: string;
41
+ /** `<binding>.<member>` as the verification report names it. Absent when the
42
+ * decline cannot be attributed to one member — a file with several declines
43
+ * gives no way to say which is which. */
44
+ member?: string;
45
+ declinedBy?: ReuseDeclinedBy;
46
+ reason: string;
47
+ }
48
+ /**
49
+ * What lands in a report's `reuse` field, for a UI test whose generation ran POM
50
+ * code reuse. Every member is optional: consumers must render from whatever
51
+ * subset is present, and omit the summary entirely when the object is absent (as
52
+ * it is for non-UI tests, and in reports from versions predating the field).
53
+ *
54
+ * `candidatesDetected` counts FILES while the call counts count CALLS — an
55
+ * indicator, never a fraction. Do not render the pair as a ratio or percentage.
56
+ */
57
+ export interface ReuseOutcome {
58
+ candidatesDetected?: number;
59
+ callsReused?: number;
60
+ callsVerified?: number;
61
+ verification?: ReuseVerificationOutcome;
62
+ skipped?: ReuseSkippedEntry[];
63
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The POM code-reuse shape carried in a TestbotReport — the wire contract between
3
+ * this server and the consumers that render it (test-bot.git).
4
+ *
5
+ * Lives in types/ rather than beside the derivation logic in
6
+ * tools/code-refactor/reuse-outcome.ts, and is re-exported from types/index.ts,
7
+ * so consumers have exactly one definition to import. The enums matter here as
8
+ * VALUES, not just types: a renderer validating an incoming `verification` or
9
+ * `declinedBy` needs the actual members to compare against, which a structurally
10
+ * inherited type cannot provide.
11
+ *
12
+ * The internal record that run state keeps between the verify pass and the report
13
+ * step (`ReuseRecord`) deliberately stays private to the derivation module — it is
14
+ * not part of this contract and must never reach a report.
15
+ */
16
+ /** Which gate declined a POM member. */
17
+ export var ReuseDeclinedBy;
18
+ (function (ReuseDeclinedBy) {
19
+ /** The mapping table never promoted it — no call was ever written. */
20
+ ReuseDeclinedBy["NotMapped"] = "not-mapped";
21
+ /** It was substituted, then verification rejected it and the raw form was
22
+ * restored. A `passed` verdict does NOT cover this: it counts only the calls
23
+ * that survived. */
24
+ ReuseDeclinedBy["DemotedByVerify"] = "demoted-by-verify";
25
+ })(ReuseDeclinedBy || (ReuseDeclinedBy = {}));
26
+ /** Outcome of the reuse verification loop for a spec. */
27
+ export var ReuseVerificationOutcome;
28
+ (function (ReuseVerificationOutcome) {
29
+ ReuseVerificationOutcome["Passed"] = "passed";
30
+ ReuseVerificationOutcome["Failed"] = "failed";
31
+ /** No page-object layer existed to reuse. */
32
+ ReuseVerificationOutcome["SkippedNoPom"] = "skipped-no-pom";
33
+ })(ReuseVerificationOutcome || (ReuseVerificationOutcome = {}));
@@ -44,6 +44,7 @@ export interface TestExecutionOptions {
44
44
  token?: string;
45
45
  timeout?: number;
46
46
  playwrightSaveStoragePath?: string;
47
+ dockerNetwork?: string;
47
48
  useHostNetwork?: boolean;
48
49
  }
49
50
  /**
@@ -15,10 +15,19 @@ export declare enum TestType {
15
15
  INTEGRATION = "integration",
16
16
  E2E = "e2e",
17
17
  UI = "ui",
18
- MOCK = "mock",
19
18
  UNIT = "unit",
20
19
  UNKNOWN = "unknown"
21
20
  }
21
+ /**
22
+ * Mock is not a test type — mock files are deployed via apply_mock(),
23
+ * not executed as tests. Kept as a standalone constant for mock generation.
24
+ */
25
+ export declare const MOCK_TYPE: "mock";
26
+ export declare enum MockProtocol {
27
+ Rest = "rest",
28
+ Grpc = "grpc",
29
+ Kafka = "kafka"
30
+ }
22
31
  export declare enum HttpMethod {
23
32
  GET = "GET",
24
33
  POST = "POST",
@@ -31,7 +40,16 @@ export declare enum HttpMethod {
31
40
  export declare enum RuntimeEnvironment {
32
41
  LOCAL = "local",
33
42
  DOCKER = "docker",
34
- KUBERNETES = "kubernetes"
43
+ KUBERNETES = "k8s"
44
+ }
45
+ export declare const runtimeEnvironmentSchema: z.ZodNativeEnum<typeof RuntimeEnvironment>;
46
+ export declare const runtimeEnvironmentInputSchema: z.ZodEffects<z.ZodNativeEnum<typeof RuntimeEnvironment>, RuntimeEnvironment, unknown>;
47
+ export declare function normalizeRuntimeEnvironment(value: RuntimeEnvironment | "kubernetes"): RuntimeEnvironment;
48
+ export interface TestConfig {
49
+ testType: TestType;
50
+ toolName: string;
51
+ description: string;
52
+ additionalFields?: Record<string, z.ZodSchema>;
35
53
  }
36
54
  export declare const languageSchema: z.ZodObject<{
37
55
  language: z.ZodNativeEnum<typeof ProgrammingLanguage>;
@@ -45,7 +63,7 @@ export declare const languageSchema: z.ZodObject<{
45
63
  }>;
46
64
  export declare const baseSchema: z.ZodObject<{
47
65
  deployDashboard: z.ZodDefault<z.ZodBoolean>;
48
- runtime: z.ZodDefault<z.ZodNativeEnum<typeof RuntimeEnvironment>>;
66
+ runtime: z.ZodDefault<z.ZodEffects<z.ZodNativeEnum<typeof RuntimeEnvironment>, RuntimeEnvironment, unknown>>;
49
67
  dockerNetwork: z.ZodDefault<z.ZodString>;
50
68
  dockerWorkerPort: z.ZodDefault<z.ZodNumber>;
51
69
  k8sNamespace: z.ZodDefault<z.ZodString>;
@@ -87,7 +105,7 @@ export declare const baseSchema: z.ZodObject<{
87
105
  outputDir: string;
88
106
  prompt: string;
89
107
  deployDashboard?: boolean | undefined;
90
- runtime?: RuntimeEnvironment | undefined;
108
+ runtime?: unknown;
91
109
  dockerNetwork?: string | undefined;
92
110
  dockerWorkerPort?: number | undefined;
93
111
  k8sNamespace?: string | undefined;
@@ -125,7 +143,7 @@ export declare const basePlaywrightSchema: z.ZodObject<{
125
143
  }>;
126
144
  export declare const baseTraceSchema: z.ZodObject<{
127
145
  deployDashboard: z.ZodDefault<z.ZodBoolean>;
128
- runtime: z.ZodDefault<z.ZodNativeEnum<typeof RuntimeEnvironment>>;
146
+ runtime: z.ZodDefault<z.ZodEffects<z.ZodNativeEnum<typeof RuntimeEnvironment>, RuntimeEnvironment, unknown>>;
129
147
  dockerNetwork: z.ZodDefault<z.ZodString>;
130
148
  dockerWorkerPort: z.ZodDefault<z.ZodNumber>;
131
149
  k8sNamespace: z.ZodDefault<z.ZodString>;
@@ -174,7 +192,7 @@ export declare const baseTraceSchema: z.ZodObject<{
174
192
  prompt: string;
175
193
  trace: string;
176
194
  deployDashboard?: boolean | undefined;
177
- runtime?: RuntimeEnvironment | undefined;
195
+ runtime?: unknown;
178
196
  dockerNetwork?: string | undefined;
179
197
  dockerWorkerPort?: number | undefined;
180
198
  k8sNamespace?: string | undefined;
@@ -192,7 +210,7 @@ export declare const baseTraceSchema: z.ZodObject<{
192
210
  }>;
193
211
  export declare const baseTestSchema: {
194
212
  deployDashboard: z.ZodDefault<z.ZodBoolean>;
195
- runtime: z.ZodDefault<z.ZodNativeEnum<typeof RuntimeEnvironment>>;
213
+ runtime: z.ZodDefault<z.ZodEffects<z.ZodNativeEnum<typeof RuntimeEnvironment>, RuntimeEnvironment, unknown>>;
196
214
  dockerNetwork: z.ZodDefault<z.ZodString>;
197
215
  dockerWorkerPort: z.ZodDefault<z.ZodNumber>;
198
216
  k8sNamespace: z.ZodDefault<z.ZodString>;
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { SUPPORTED_FRAMEWORKS } from "../workspace/frameworks.js";
2
3
  export const SESSION_STORAGE_FILENAME = "skyramp_session_storage.json";
3
4
  export const AUTH_PLACEHOLDER_TOKEN = "SKYRAMP_PLACEHOLDER_TOKEN";
4
5
  export var ProgrammingLanguage;
@@ -17,10 +18,20 @@ export var TestType;
17
18
  TestType["INTEGRATION"] = "integration";
18
19
  TestType["E2E"] = "e2e";
19
20
  TestType["UI"] = "ui";
20
- TestType["MOCK"] = "mock";
21
21
  TestType["UNIT"] = "unit";
22
22
  TestType["UNKNOWN"] = "unknown";
23
23
  })(TestType || (TestType = {}));
24
+ /**
25
+ * Mock is not a test type — mock files are deployed via apply_mock(),
26
+ * not executed as tests. Kept as a standalone constant for mock generation.
27
+ */
28
+ export const MOCK_TYPE = "mock";
29
+ export var MockProtocol;
30
+ (function (MockProtocol) {
31
+ MockProtocol["Rest"] = "rest";
32
+ MockProtocol["Grpc"] = "grpc";
33
+ MockProtocol["Kafka"] = "kafka";
34
+ })(MockProtocol || (MockProtocol = {}));
24
35
  export var HttpMethod;
25
36
  (function (HttpMethod) {
26
37
  HttpMethod["GET"] = "GET";
@@ -35,15 +46,21 @@ export var RuntimeEnvironment;
35
46
  (function (RuntimeEnvironment) {
36
47
  RuntimeEnvironment["LOCAL"] = "local";
37
48
  RuntimeEnvironment["DOCKER"] = "docker";
38
- RuntimeEnvironment["KUBERNETES"] = "kubernetes";
49
+ RuntimeEnvironment["KUBERNETES"] = "k8s";
39
50
  })(RuntimeEnvironment || (RuntimeEnvironment = {}));
51
+ export const runtimeEnvironmentSchema = z.nativeEnum(RuntimeEnvironment);
52
+ export const runtimeEnvironmentInputSchema = z.preprocess((value) => (value === "kubernetes" ? RuntimeEnvironment.KUBERNETES : value), runtimeEnvironmentSchema);
53
+ export function normalizeRuntimeEnvironment(value) {
54
+ return value === "kubernetes" ? RuntimeEnvironment.KUBERNETES : value;
55
+ }
40
56
  export const languageSchema = z.object({
41
57
  language: z
42
58
  .nativeEnum(ProgrammingLanguage)
43
59
  .describe("Programming language for the generated test (default: python). Must be one of: python, typescript, javascript, java"),
44
60
  framework: z
45
61
  .string()
46
- .describe("Testing framework to use (e.g., pytest for python, playwright for javascript and typescript, junit for java, etc.)"),
62
+ .describe(`Testing framework to use. Supported: ${SUPPORTED_FRAMEWORKS.join(", ")} ` +
63
+ `(e.g. pytest for python, playwright/vitest/jest for js/ts, junit for java).`),
47
64
  });
48
65
  export const baseSchema = z.object({
49
66
  ...languageSchema.shape,
@@ -51,10 +68,9 @@ export const baseSchema = z.object({
51
68
  .boolean()
52
69
  .default(false)
53
70
  .describe("Whether to deploy the Skyramp dashboard for test monitoring"),
54
- runtime: z
55
- .nativeEnum(RuntimeEnvironment)
71
+ runtime: runtimeEnvironmentInputSchema
56
72
  .default(RuntimeEnvironment.LOCAL)
57
- .describe("Runtime environment (docker, kubernetes, local)"),
73
+ .describe("Runtime environment (local, docker, or k8s; accepts kubernetes as an alias)"),
58
74
  dockerNetwork: z
59
75
  .string()
60
76
  .default("")
@@ -199,7 +215,9 @@ export const baseTestSchema = {
199
215
  queryParams: z
200
216
  .string()
201
217
  .default("")
202
- .describe("MUST be string of comma separated values like 'id=1,name=John' for URL query parameters"),
218
+ .describe("MUST be string of comma separated values like 'id=1,name=John' for URL query parameters. "
219
+ + "Workspace-configured api.defaultQueryParams (if set) are merged in automatically — "
220
+ + "no need to repeat them here. An explicit value for the same key here overrides the workspace default."),
203
221
  formParams: z
204
222
  .string()
205
223
  .default("")