@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
@@ -1,17 +1,24 @@
1
1
  import { z } from "zod";
2
2
  export declare const WORKSPACE_DIR = ".skyramp";
3
3
  export declare const WORKSPACE_FILENAME = "workspace.yml";
4
+ export { SUPPORTED_FRAMEWORKS } from "./frameworks.js";
4
5
  export declare const serviceSchema: z.ZodObject<{
5
6
  serviceName: z.ZodString;
6
7
  repository: z.ZodOptional<z.ZodString>;
7
8
  language: z.ZodOptional<z.ZodEnum<["python", "typescript", "javascript", "java"]>>;
8
- framework: z.ZodOptional<z.ZodEnum<["playwright", "pytest", "robot", "junit"]>>;
9
+ framework: z.ZodOptional<z.ZodEnum<["playwright", "pytest", "robot", "junit", "vitest", "jest", "mocha", "go", "rspec", "jasmine"]>>;
9
10
  testDirectory: z.ZodOptional<z.ZodString>;
10
11
  api: z.ZodOptional<z.ZodObject<{
11
12
  schemaPath: z.ZodOptional<z.ZodString>;
12
13
  authType: z.ZodOptional<z.ZodEnum<["bearer", "basic", "oauth", "apiKey", "cookie", "session", "token", "none"]>>;
13
14
  authHeader: z.ZodOptional<z.ZodString>;
14
15
  authScheme: z.ZodOptional<z.ZodString>;
16
+ /** Query params always attached to every generated request for this
17
+ * service (e.g. RBAC context an authorization layer requires beyond
18
+ * the auth header). Literal values only — no env-var interpolation.
19
+ * Explicit per-request queryParams always win on a key collision
20
+ * (SKYR-4050). */
21
+ defaultQueryParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15
22
  baseUrl: z.ZodOptional<z.ZodString>;
16
23
  /** SUT serves self-signed TLS (e.g. a kind kube-apiserver) — generated
17
24
  * tests should skip certificate verification for this service (SKYR-3961).
@@ -22,6 +29,7 @@ export declare const serviceSchema: z.ZodObject<{
22
29
  authScheme?: string | undefined;
23
30
  schemaPath?: string | undefined;
24
31
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
32
+ defaultQueryParams?: Record<string, string> | undefined;
25
33
  baseUrl?: string | undefined;
26
34
  skipTLSVerify?: boolean | undefined;
27
35
  }, {
@@ -29,32 +37,75 @@ export declare const serviceSchema: z.ZodObject<{
29
37
  authScheme?: string | undefined;
30
38
  schemaPath?: string | undefined;
31
39
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
40
+ defaultQueryParams?: Record<string, string> | undefined;
32
41
  baseUrl?: string | undefined;
33
42
  skipTLSVerify?: boolean | undefined;
34
43
  }>>;
35
44
  runtimeDetails: z.ZodOptional<z.ZodObject<{
36
45
  serverStartCommand: z.ZodOptional<z.ZodString>;
37
- runtime: z.ZodEnum<["local", "docker", "k8s"]>;
46
+ serverStopCommand: z.ZodOptional<z.ZodString>;
47
+ runtime: z.ZodEffects<z.ZodNativeEnum<typeof import("../types/TestTypes.js").RuntimeEnvironment>, import("../types/TestTypes.js").RuntimeEnvironment, unknown>;
38
48
  dockerNetwork: z.ZodOptional<z.ZodString>;
39
49
  k8sNamespace: z.ZodOptional<z.ZodString>;
40
50
  k8sContext: z.ZodOptional<z.ZodString>;
51
+ testSuites: z.ZodOptional<z.ZodArray<z.ZodObject<{
52
+ framework: z.ZodOptional<z.ZodEnum<["playwright", "pytest", "robot", "junit", "vitest", "jest", "mocha", "go", "rspec", "jasmine"]>>;
53
+ testRunCommand: z.ZodString;
54
+ testEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
55
+ pathGlobs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
56
+ canaryStatus: z.ZodOptional<z.ZodEnum<["proven", "unproven"]>>;
57
+ /** Why it could not be proven — required by the prompt when unproven. */
58
+ canaryDetail: z.ZodOptional<z.ZodString>;
59
+ }, "strict", z.ZodTypeAny, {
60
+ testRunCommand: string;
61
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
62
+ testEnv?: Record<string, string> | undefined;
63
+ pathGlobs?: string[] | undefined;
64
+ canaryStatus?: "proven" | "unproven" | undefined;
65
+ canaryDetail?: string | undefined;
66
+ }, {
67
+ testRunCommand: string;
68
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
69
+ testEnv?: Record<string, string> | undefined;
70
+ pathGlobs?: string[] | undefined;
71
+ canaryStatus?: "proven" | "unproven" | undefined;
72
+ canaryDetail?: string | undefined;
73
+ }>, "many">>;
41
74
  }, "strict", z.ZodTypeAny, {
42
- runtime: "local" | "docker" | "k8s";
75
+ runtime: import("../types/TestTypes.js").RuntimeEnvironment;
43
76
  dockerNetwork?: string | undefined;
44
77
  k8sNamespace?: string | undefined;
45
78
  k8sContext?: string | undefined;
46
79
  serverStartCommand?: string | undefined;
80
+ serverStopCommand?: string | undefined;
81
+ testSuites?: {
82
+ testRunCommand: string;
83
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
84
+ testEnv?: Record<string, string> | undefined;
85
+ pathGlobs?: string[] | undefined;
86
+ canaryStatus?: "proven" | "unproven" | undefined;
87
+ canaryDetail?: string | undefined;
88
+ }[] | undefined;
47
89
  }, {
48
- runtime: "local" | "docker" | "k8s";
90
+ runtime?: unknown;
49
91
  dockerNetwork?: string | undefined;
50
92
  k8sNamespace?: string | undefined;
51
93
  k8sContext?: string | undefined;
52
94
  serverStartCommand?: string | undefined;
95
+ serverStopCommand?: string | undefined;
96
+ testSuites?: {
97
+ testRunCommand: string;
98
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
99
+ testEnv?: Record<string, string> | undefined;
100
+ pathGlobs?: string[] | undefined;
101
+ canaryStatus?: "proven" | "unproven" | undefined;
102
+ canaryDetail?: string | undefined;
103
+ }[] | undefined;
53
104
  }>>;
54
105
  }, "strict", z.ZodTypeAny, {
55
106
  serviceName: string;
56
107
  language?: "python" | "typescript" | "javascript" | "java" | undefined;
57
- framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
108
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
58
109
  repository?: string | undefined;
59
110
  testDirectory?: string | undefined;
60
111
  api?: {
@@ -62,20 +113,30 @@ export declare const serviceSchema: z.ZodObject<{
62
113
  authScheme?: string | undefined;
63
114
  schemaPath?: string | undefined;
64
115
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
116
+ defaultQueryParams?: Record<string, string> | undefined;
65
117
  baseUrl?: string | undefined;
66
118
  skipTLSVerify?: boolean | undefined;
67
119
  } | undefined;
68
120
  runtimeDetails?: {
69
- runtime: "local" | "docker" | "k8s";
121
+ runtime: import("../types/TestTypes.js").RuntimeEnvironment;
70
122
  dockerNetwork?: string | undefined;
71
123
  k8sNamespace?: string | undefined;
72
124
  k8sContext?: string | undefined;
73
125
  serverStartCommand?: string | undefined;
126
+ serverStopCommand?: string | undefined;
127
+ testSuites?: {
128
+ testRunCommand: string;
129
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
130
+ testEnv?: Record<string, string> | undefined;
131
+ pathGlobs?: string[] | undefined;
132
+ canaryStatus?: "proven" | "unproven" | undefined;
133
+ canaryDetail?: string | undefined;
134
+ }[] | undefined;
74
135
  } | undefined;
75
136
  }, {
76
137
  serviceName: string;
77
138
  language?: "python" | "typescript" | "javascript" | "java" | undefined;
78
- framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
139
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
79
140
  repository?: string | undefined;
80
141
  testDirectory?: string | undefined;
81
142
  api?: {
@@ -83,15 +144,25 @@ export declare const serviceSchema: z.ZodObject<{
83
144
  authScheme?: string | undefined;
84
145
  schemaPath?: string | undefined;
85
146
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
147
+ defaultQueryParams?: Record<string, string> | undefined;
86
148
  baseUrl?: string | undefined;
87
149
  skipTLSVerify?: boolean | undefined;
88
150
  } | undefined;
89
151
  runtimeDetails?: {
90
- runtime: "local" | "docker" | "k8s";
152
+ runtime?: unknown;
91
153
  dockerNetwork?: string | undefined;
92
154
  k8sNamespace?: string | undefined;
93
155
  k8sContext?: string | undefined;
94
156
  serverStartCommand?: string | undefined;
157
+ serverStopCommand?: string | undefined;
158
+ testSuites?: {
159
+ testRunCommand: string;
160
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
161
+ testEnv?: Record<string, string> | undefined;
162
+ pathGlobs?: string[] | undefined;
163
+ canaryStatus?: "proven" | "unproven" | undefined;
164
+ canaryDetail?: string | undefined;
165
+ }[] | undefined;
95
166
  } | undefined;
96
167
  }>;
97
168
  export declare const workspaceConfigSchema: z.ZodObject<{
@@ -128,13 +199,19 @@ export declare const workspaceConfigSchema: z.ZodObject<{
128
199
  serviceName: z.ZodString;
129
200
  repository: z.ZodOptional<z.ZodString>;
130
201
  language: z.ZodOptional<z.ZodEnum<["python", "typescript", "javascript", "java"]>>;
131
- framework: z.ZodOptional<z.ZodEnum<["playwright", "pytest", "robot", "junit"]>>;
202
+ framework: z.ZodOptional<z.ZodEnum<["playwright", "pytest", "robot", "junit", "vitest", "jest", "mocha", "go", "rspec", "jasmine"]>>;
132
203
  testDirectory: z.ZodOptional<z.ZodString>;
133
204
  api: z.ZodOptional<z.ZodObject<{
134
205
  schemaPath: z.ZodOptional<z.ZodString>;
135
206
  authType: z.ZodOptional<z.ZodEnum<["bearer", "basic", "oauth", "apiKey", "cookie", "session", "token", "none"]>>;
136
207
  authHeader: z.ZodOptional<z.ZodString>;
137
208
  authScheme: z.ZodOptional<z.ZodString>;
209
+ /** Query params always attached to every generated request for this
210
+ * service (e.g. RBAC context an authorization layer requires beyond
211
+ * the auth header). Literal values only — no env-var interpolation.
212
+ * Explicit per-request queryParams always win on a key collision
213
+ * (SKYR-4050). */
214
+ defaultQueryParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
138
215
  baseUrl: z.ZodOptional<z.ZodString>;
139
216
  /** SUT serves self-signed TLS (e.g. a kind kube-apiserver) — generated
140
217
  * tests should skip certificate verification for this service (SKYR-3961).
@@ -145,6 +222,7 @@ export declare const workspaceConfigSchema: z.ZodObject<{
145
222
  authScheme?: string | undefined;
146
223
  schemaPath?: string | undefined;
147
224
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
225
+ defaultQueryParams?: Record<string, string> | undefined;
148
226
  baseUrl?: string | undefined;
149
227
  skipTLSVerify?: boolean | undefined;
150
228
  }, {
@@ -152,32 +230,75 @@ export declare const workspaceConfigSchema: z.ZodObject<{
152
230
  authScheme?: string | undefined;
153
231
  schemaPath?: string | undefined;
154
232
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
233
+ defaultQueryParams?: Record<string, string> | undefined;
155
234
  baseUrl?: string | undefined;
156
235
  skipTLSVerify?: boolean | undefined;
157
236
  }>>;
158
237
  runtimeDetails: z.ZodOptional<z.ZodObject<{
159
238
  serverStartCommand: z.ZodOptional<z.ZodString>;
160
- runtime: z.ZodEnum<["local", "docker", "k8s"]>;
239
+ serverStopCommand: z.ZodOptional<z.ZodString>;
240
+ runtime: z.ZodEffects<z.ZodNativeEnum<typeof import("../types/TestTypes.js").RuntimeEnvironment>, import("../types/TestTypes.js").RuntimeEnvironment, unknown>;
161
241
  dockerNetwork: z.ZodOptional<z.ZodString>;
162
242
  k8sNamespace: z.ZodOptional<z.ZodString>;
163
243
  k8sContext: z.ZodOptional<z.ZodString>;
244
+ testSuites: z.ZodOptional<z.ZodArray<z.ZodObject<{
245
+ framework: z.ZodOptional<z.ZodEnum<["playwright", "pytest", "robot", "junit", "vitest", "jest", "mocha", "go", "rspec", "jasmine"]>>;
246
+ testRunCommand: z.ZodString;
247
+ testEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
248
+ pathGlobs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
249
+ canaryStatus: z.ZodOptional<z.ZodEnum<["proven", "unproven"]>>;
250
+ /** Why it could not be proven — required by the prompt when unproven. */
251
+ canaryDetail: z.ZodOptional<z.ZodString>;
252
+ }, "strict", z.ZodTypeAny, {
253
+ testRunCommand: string;
254
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
255
+ testEnv?: Record<string, string> | undefined;
256
+ pathGlobs?: string[] | undefined;
257
+ canaryStatus?: "proven" | "unproven" | undefined;
258
+ canaryDetail?: string | undefined;
259
+ }, {
260
+ testRunCommand: string;
261
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
262
+ testEnv?: Record<string, string> | undefined;
263
+ pathGlobs?: string[] | undefined;
264
+ canaryStatus?: "proven" | "unproven" | undefined;
265
+ canaryDetail?: string | undefined;
266
+ }>, "many">>;
164
267
  }, "strict", z.ZodTypeAny, {
165
- runtime: "local" | "docker" | "k8s";
268
+ runtime: import("../types/TestTypes.js").RuntimeEnvironment;
166
269
  dockerNetwork?: string | undefined;
167
270
  k8sNamespace?: string | undefined;
168
271
  k8sContext?: string | undefined;
169
272
  serverStartCommand?: string | undefined;
273
+ serverStopCommand?: string | undefined;
274
+ testSuites?: {
275
+ testRunCommand: string;
276
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
277
+ testEnv?: Record<string, string> | undefined;
278
+ pathGlobs?: string[] | undefined;
279
+ canaryStatus?: "proven" | "unproven" | undefined;
280
+ canaryDetail?: string | undefined;
281
+ }[] | undefined;
170
282
  }, {
171
- runtime: "local" | "docker" | "k8s";
283
+ runtime?: unknown;
172
284
  dockerNetwork?: string | undefined;
173
285
  k8sNamespace?: string | undefined;
174
286
  k8sContext?: string | undefined;
175
287
  serverStartCommand?: string | undefined;
288
+ serverStopCommand?: string | undefined;
289
+ testSuites?: {
290
+ testRunCommand: string;
291
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
292
+ testEnv?: Record<string, string> | undefined;
293
+ pathGlobs?: string[] | undefined;
294
+ canaryStatus?: "proven" | "unproven" | undefined;
295
+ canaryDetail?: string | undefined;
296
+ }[] | undefined;
176
297
  }>>;
177
298
  }, "strict", z.ZodTypeAny, {
178
299
  serviceName: string;
179
300
  language?: "python" | "typescript" | "javascript" | "java" | undefined;
180
- framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
301
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
181
302
  repository?: string | undefined;
182
303
  testDirectory?: string | undefined;
183
304
  api?: {
@@ -185,20 +306,30 @@ export declare const workspaceConfigSchema: z.ZodObject<{
185
306
  authScheme?: string | undefined;
186
307
  schemaPath?: string | undefined;
187
308
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
309
+ defaultQueryParams?: Record<string, string> | undefined;
188
310
  baseUrl?: string | undefined;
189
311
  skipTLSVerify?: boolean | undefined;
190
312
  } | undefined;
191
313
  runtimeDetails?: {
192
- runtime: "local" | "docker" | "k8s";
314
+ runtime: import("../types/TestTypes.js").RuntimeEnvironment;
193
315
  dockerNetwork?: string | undefined;
194
316
  k8sNamespace?: string | undefined;
195
317
  k8sContext?: string | undefined;
196
318
  serverStartCommand?: string | undefined;
319
+ serverStopCommand?: string | undefined;
320
+ testSuites?: {
321
+ testRunCommand: string;
322
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
323
+ testEnv?: Record<string, string> | undefined;
324
+ pathGlobs?: string[] | undefined;
325
+ canaryStatus?: "proven" | "unproven" | undefined;
326
+ canaryDetail?: string | undefined;
327
+ }[] | undefined;
197
328
  } | undefined;
198
329
  }, {
199
330
  serviceName: string;
200
331
  language?: "python" | "typescript" | "javascript" | "java" | undefined;
201
- framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
332
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
202
333
  repository?: string | undefined;
203
334
  testDirectory?: string | undefined;
204
335
  api?: {
@@ -206,15 +337,25 @@ export declare const workspaceConfigSchema: z.ZodObject<{
206
337
  authScheme?: string | undefined;
207
338
  schemaPath?: string | undefined;
208
339
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
340
+ defaultQueryParams?: Record<string, string> | undefined;
209
341
  baseUrl?: string | undefined;
210
342
  skipTLSVerify?: boolean | undefined;
211
343
  } | undefined;
212
344
  runtimeDetails?: {
213
- runtime: "local" | "docker" | "k8s";
345
+ runtime?: unknown;
214
346
  dockerNetwork?: string | undefined;
215
347
  k8sNamespace?: string | undefined;
216
348
  k8sContext?: string | undefined;
217
349
  serverStartCommand?: string | undefined;
350
+ serverStopCommand?: string | undefined;
351
+ testSuites?: {
352
+ testRunCommand: string;
353
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
354
+ testEnv?: Record<string, string> | undefined;
355
+ pathGlobs?: string[] | undefined;
356
+ canaryStatus?: "proven" | "unproven" | undefined;
357
+ canaryDetail?: string | undefined;
358
+ }[] | undefined;
218
359
  } | undefined;
219
360
  }>, "many">>;
220
361
  }, "strict", z.ZodTypeAny, {
@@ -232,7 +373,7 @@ export declare const workspaceConfigSchema: z.ZodObject<{
232
373
  services?: {
233
374
  serviceName: string;
234
375
  language?: "python" | "typescript" | "javascript" | "java" | undefined;
235
- framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
376
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
236
377
  repository?: string | undefined;
237
378
  testDirectory?: string | undefined;
238
379
  api?: {
@@ -240,15 +381,25 @@ export declare const workspaceConfigSchema: z.ZodObject<{
240
381
  authScheme?: string | undefined;
241
382
  schemaPath?: string | undefined;
242
383
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
384
+ defaultQueryParams?: Record<string, string> | undefined;
243
385
  baseUrl?: string | undefined;
244
386
  skipTLSVerify?: boolean | undefined;
245
387
  } | undefined;
246
388
  runtimeDetails?: {
247
- runtime: "local" | "docker" | "k8s";
389
+ runtime: import("../types/TestTypes.js").RuntimeEnvironment;
248
390
  dockerNetwork?: string | undefined;
249
391
  k8sNamespace?: string | undefined;
250
392
  k8sContext?: string | undefined;
251
393
  serverStartCommand?: string | undefined;
394
+ serverStopCommand?: string | undefined;
395
+ testSuites?: {
396
+ testRunCommand: string;
397
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
398
+ testEnv?: Record<string, string> | undefined;
399
+ pathGlobs?: string[] | undefined;
400
+ canaryStatus?: "proven" | "unproven" | undefined;
401
+ canaryDetail?: string | undefined;
402
+ }[] | undefined;
252
403
  } | undefined;
253
404
  }[] | undefined;
254
405
  }, {
@@ -266,7 +417,7 @@ export declare const workspaceConfigSchema: z.ZodObject<{
266
417
  services?: {
267
418
  serviceName: string;
268
419
  language?: "python" | "typescript" | "javascript" | "java" | undefined;
269
- framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
420
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
270
421
  repository?: string | undefined;
271
422
  testDirectory?: string | undefined;
272
423
  api?: {
@@ -274,21 +425,32 @@ export declare const workspaceConfigSchema: z.ZodObject<{
274
425
  authScheme?: string | undefined;
275
426
  schemaPath?: string | undefined;
276
427
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
428
+ defaultQueryParams?: Record<string, string> | undefined;
277
429
  baseUrl?: string | undefined;
278
430
  skipTLSVerify?: boolean | undefined;
279
431
  } | undefined;
280
432
  runtimeDetails?: {
281
- runtime: "local" | "docker" | "k8s";
433
+ runtime?: unknown;
282
434
  dockerNetwork?: string | undefined;
283
435
  k8sNamespace?: string | undefined;
284
436
  k8sContext?: string | undefined;
285
437
  serverStartCommand?: string | undefined;
438
+ serverStopCommand?: string | undefined;
439
+ testSuites?: {
440
+ testRunCommand: string;
441
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
442
+ testEnv?: Record<string, string> | undefined;
443
+ pathGlobs?: string[] | undefined;
444
+ canaryStatus?: "proven" | "unproven" | undefined;
445
+ canaryDetail?: string | undefined;
446
+ }[] | undefined;
286
447
  } | undefined;
287
448
  }[] | undefined;
288
449
  }>;
289
450
  export type Service = z.infer<typeof serviceSchema>;
290
451
  export type ServiceApi = NonNullable<Service["api"]>;
291
452
  export type ServiceRuntimeDetails = NonNullable<Service["runtimeDetails"]>;
453
+ export type TestSuite = NonNullable<ServiceRuntimeDetails["testSuites"]>[number];
292
454
  export type WorkspaceConfig = z.infer<typeof workspaceConfigSchema>;
293
455
  export type WorkspaceSection = NonNullable<WorkspaceConfig["workspace"]>;
294
456
  export type MetadataSection = NonNullable<WorkspaceConfig["metadata"]>;
@@ -308,7 +470,7 @@ export declare function validateWorkspaceConfig(config: unknown): z.SafeParseRet
308
470
  services?: {
309
471
  serviceName: string;
310
472
  language?: "python" | "typescript" | "javascript" | "java" | undefined;
311
- framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
473
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
312
474
  repository?: string | undefined;
313
475
  testDirectory?: string | undefined;
314
476
  api?: {
@@ -316,15 +478,25 @@ export declare function validateWorkspaceConfig(config: unknown): z.SafeParseRet
316
478
  authScheme?: string | undefined;
317
479
  schemaPath?: string | undefined;
318
480
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
481
+ defaultQueryParams?: Record<string, string> | undefined;
319
482
  baseUrl?: string | undefined;
320
483
  skipTLSVerify?: boolean | undefined;
321
484
  } | undefined;
322
485
  runtimeDetails?: {
323
- runtime: "local" | "docker" | "k8s";
486
+ runtime?: unknown;
324
487
  dockerNetwork?: string | undefined;
325
488
  k8sNamespace?: string | undefined;
326
489
  k8sContext?: string | undefined;
327
490
  serverStartCommand?: string | undefined;
491
+ serverStopCommand?: string | undefined;
492
+ testSuites?: {
493
+ testRunCommand: string;
494
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
495
+ testEnv?: Record<string, string> | undefined;
496
+ pathGlobs?: string[] | undefined;
497
+ canaryStatus?: "proven" | "unproven" | undefined;
498
+ canaryDetail?: string | undefined;
499
+ }[] | undefined;
328
500
  } | undefined;
329
501
  }[] | undefined;
330
502
  }, {
@@ -342,7 +514,7 @@ export declare function validateWorkspaceConfig(config: unknown): z.SafeParseRet
342
514
  services?: {
343
515
  serviceName: string;
344
516
  language?: "python" | "typescript" | "javascript" | "java" | undefined;
345
- framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
517
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
346
518
  repository?: string | undefined;
347
519
  testDirectory?: string | undefined;
348
520
  api?: {
@@ -350,15 +522,25 @@ export declare function validateWorkspaceConfig(config: unknown): z.SafeParseRet
350
522
  authScheme?: string | undefined;
351
523
  schemaPath?: string | undefined;
352
524
  authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
525
+ defaultQueryParams?: Record<string, string> | undefined;
353
526
  baseUrl?: string | undefined;
354
527
  skipTLSVerify?: boolean | undefined;
355
528
  } | undefined;
356
529
  runtimeDetails?: {
357
- runtime: "local" | "docker" | "k8s";
530
+ runtime: import("../types/TestTypes.js").RuntimeEnvironment;
358
531
  dockerNetwork?: string | undefined;
359
532
  k8sNamespace?: string | undefined;
360
533
  k8sContext?: string | undefined;
361
534
  serverStartCommand?: string | undefined;
535
+ serverStopCommand?: string | undefined;
536
+ testSuites?: {
537
+ testRunCommand: string;
538
+ framework?: "playwright" | "pytest" | "robot" | "junit" | "vitest" | "jest" | "mocha" | "go" | "rspec" | "jasmine" | undefined;
539
+ testEnv?: Record<string, string> | undefined;
540
+ pathGlobs?: string[] | undefined;
541
+ canaryStatus?: "proven" | "unproven" | undefined;
542
+ canaryDetail?: string | undefined;
543
+ }[] | undefined;
362
544
  } | undefined;
363
545
  }[] | undefined;
364
546
  }>;
@@ -14,12 +14,17 @@ import { execFile } from "child_process";
14
14
  import { promisify } from "util";
15
15
  import yaml from "js-yaml";
16
16
  import { z } from "zod";
17
+ import { SUPPORTED_FRAMEWORKS } from "./frameworks.js";
18
+ import { runtimeEnvironmentInputSchema } from "../types/TestTypes.js";
17
19
  const execFileAsync = promisify(execFile);
18
20
  // ---------------------------------------------------------------------------
19
21
  // Constants
20
22
  // ---------------------------------------------------------------------------
21
23
  export const WORKSPACE_DIR = ".skyramp";
22
24
  export const WORKSPACE_FILENAME = "workspace.yml";
25
+ // SUPPORTED_FRAMEWORKS lives in the dependency-free ./frameworks module (imported
26
+ // above for the schema below) and is re-exported here for existing importers.
27
+ export { SUPPORTED_FRAMEWORKS } from "./frameworks.js";
23
28
  // ---------------------------------------------------------------------------
24
29
  // Zod schemas (source of truth — types are inferred from these below)
25
30
  // ---------------------------------------------------------------------------
@@ -31,7 +36,7 @@ export const serviceSchema = z
31
36
  // so the same serviceName can appear once per repo without colliding.
32
37
  repository: z.string().optional(),
33
38
  language: z.enum(["python", "typescript", "javascript", "java"]).optional(),
34
- framework: z.enum(["playwright", "pytest", "robot", "junit"]).optional(),
39
+ framework: z.enum(SUPPORTED_FRAMEWORKS).optional(),
35
40
  testDirectory: z.string().optional(),
36
41
  api: z
37
42
  .object({
@@ -50,6 +55,12 @@ export const serviceSchema = z
50
55
  .optional(),
51
56
  authHeader: z.string().optional(),
52
57
  authScheme: z.string().optional(),
58
+ /** Query params always attached to every generated request for this
59
+ * service (e.g. RBAC context an authorization layer requires beyond
60
+ * the auth header). Literal values only — no env-var interpolation.
61
+ * Explicit per-request queryParams always win on a key collision
62
+ * (SKYR-4050). */
63
+ defaultQueryParams: z.record(z.string()).optional(),
53
64
  baseUrl: z.string().optional(),
54
65
  /** SUT serves self-signed TLS (e.g. a kind kube-apiserver) — generated
55
66
  * tests should skip certificate verification for this service (SKYR-3961).
@@ -60,11 +71,50 @@ export const serviceSchema = z
60
71
  .optional(),
61
72
  runtimeDetails: z
62
73
  .object({
74
+ // existing comms axis — how the runner reaches the app
63
75
  serverStartCommand: z.string().optional(),
64
- runtime: z.enum(["local", "docker", "k8s"]),
76
+ serverStopCommand: z.string().optional(),
77
+ runtime: runtimeEnvironmentInputSchema,
65
78
  dockerNetwork: z.string().optional(),
66
79
  k8sNamespace: z.string().optional(),
67
80
  k8sContext: z.string().optional(),
81
+ // External-suite test contract (SKYR-4002). A service hosts one or more
82
+ // runnable suites — record each under testSuites, even a single suite
83
+ // (there is no flat single-suite form). Written by the SUT adapt_workflow
84
+ // bootstrap (skyramp_testbot_sut), read at run time by
85
+ // skyramp_run_existing_tests. Each suite carries its own framework
86
+ // (falling back to the service's), testRunCommand, testEnv, and pathGlobs
87
+ // — the repo-relative paths that suite owns, used to route a selector to
88
+ // the one suite that can run it. One service can host multiple frameworks.
89
+ testSuites: z
90
+ .array(z
91
+ .object({
92
+ framework: z.enum(SUPPORTED_FRAMEWORKS).optional(),
93
+ testRunCommand: z.string().min(1),
94
+ testEnv: z.record(z.string(), z.string()).optional(),
95
+ pathGlobs: z.array(z.string()).optional(),
96
+ // Did SUT setup actually run one test from this suite?
97
+ //
98
+ // "Is the environment proven" and "should maintenance work on this
99
+ // suite" are independent, and collapsing them costs one way or the
100
+ // other. The prompt used to make recording free, so a suite could
101
+ // read as covered while never having executed. Requiring proof
102
+ // instead would drop exactly the suite a user most wants
103
+ // maintained: a self-provisioning e2e suite whose substrate the
104
+ // setup cannot stand up. Run 30402703836 shows why that trade is
105
+ // bad — with its Playwright environment dead, static analysis
106
+ // still found the stale POM testid and fixed it correctly.
107
+ //
108
+ // So an unproven suite STAYS and is still maintained; this records
109
+ // that its environment was never validated, and canaryDetail says
110
+ // what it needs. Absent means unproven (older artifacts predate
111
+ // this field), which is the safe reading.
112
+ canaryStatus: z.enum(["proven", "unproven"]).optional(),
113
+ /** Why it could not be proven — required by the prompt when unproven. */
114
+ canaryDetail: z.string().optional(),
115
+ })
116
+ .strict())
117
+ .optional(),
68
118
  })
69
119
  .strict()
70
120
  .optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyramp/mcp",
3
- "version": "0.3.2-rc.pom-4",
3
+ "version": "0.3.2",
4
4
  "main": "build/index.js",
5
5
  "exports": {
6
6
  ".": "./build/index.js",
@@ -33,6 +33,7 @@
33
33
  "pretty": "npx prettier --write .",
34
34
  "lint": "eslint src --ext .ts",
35
35
  "lint:fix": "eslint src --ext .ts --fix",
36
+ "typecheck": "tsc --noEmit -p tsconfig.typecheck.json",
36
37
  "test": "node --experimental-vm-modules node_modules/.bin/jest"
37
38
  },
38
39
  "files": [
@@ -67,10 +68,11 @@
67
68
  "dependencies": {
68
69
  "@modelcontextprotocol/sdk": "^1.24.3",
69
70
  "@playwright/test": "^1.55.0",
70
- "@skyramp/skyramp": "1.3.36",
71
+ "@skyramp/skyramp": "1.3.37",
71
72
  "dockerode": "^5.0.0",
72
73
  "fast-glob": "^3.3.3",
73
74
  "js-yaml": "^4.1.1",
75
+ "picomatch": "^4.0.5",
74
76
  "playwright": "file:vendor/skyramp-playwright-1.58.2-skyramp.8.14.3.tgz",
75
77
  "simple-git": "^3.30.0",
76
78
  "typescript": "^5.8.3",
@@ -82,6 +84,7 @@
82
84
  "@types/js-yaml": "^4.0.9",
83
85
  "@types/mocha": "^10.0.10",
84
86
  "@types/node": "^22.15.19",
87
+ "@types/picomatch": "^4.0.3",
85
88
  "@typescript-eslint/eslint-plugin": "^8.0.0",
86
89
  "@typescript-eslint/parser": "^8.0.0",
87
90
  "eslint": "^9.0.0",