@skyramp/mcp 0.2.5 → 0.2.7

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 (186) 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 +1 -2
  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 +14 -3
  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/test-maintenance/actionsInstructions.d.ts +35 -0
  26. package/build/prompts/test-maintenance/drift-analysis-prompt.d.ts +4 -0
  27. package/build/prompts/test-maintenance/driftAnalysisSections.d.ts +13 -0
  28. package/build/prompts/test-recommendation/analysisOutputPrompt.d.ts +84 -0
  29. package/build/prompts/test-recommendation/analysisOutputPrompt.test.d.ts +1 -0
  30. package/build/prompts/test-recommendation/analysisOutputPrompt.test.js +1 -0
  31. package/build/prompts/test-recommendation/diffExecutionPlan.d.ts +17 -0
  32. package/build/prompts/test-recommendation/diffExecutionPlan.js +7 -16
  33. package/build/prompts/test-recommendation/fullRepoCatalog.d.ts +7 -0
  34. package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.d.ts +1 -0
  35. package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.js +1 -0
  36. package/build/prompts/test-recommendation/promptPlan.d.ts +203 -0
  37. package/build/prompts/test-recommendation/promptPlan.test.d.ts +1 -0
  38. package/build/prompts/test-recommendation/recommendationSections.d.ts +35 -0
  39. package/build/prompts/test-recommendation/recommendationShared.d.ts +31 -0
  40. package/build/prompts/test-recommendation/registerRecommendTestsPrompt.d.ts +7 -0
  41. package/build/prompts/test-recommendation/scopeAssessment.d.ts +55 -0
  42. package/build/prompts/test-recommendation/scopeAssessment.js +2 -2
  43. package/build/prompts/test-recommendation/scopeAssessment.test.d.ts +1 -0
  44. package/build/prompts/test-recommendation/scopeAssessment.test.js +1 -0
  45. package/build/prompts/test-recommendation/test-recommendation-prompt.d.ts +6 -0
  46. package/build/prompts/test-recommendation/test-recommendation-prompt.js +4 -4
  47. package/build/prompts/test-recommendation/test-recommendation-prompt.test.d.ts +1 -0
  48. package/build/prompts/test-recommendation/test-recommendation-prompt.test.js +6 -99
  49. package/build/prompts/testbot/testbot-prompts.d.ts +11 -0
  50. package/build/prompts/testbot/testbot-prompts.js +198 -34
  51. package/build/prompts/testbot/testbot-prompts.test.d.ts +1 -0
  52. package/build/prompts/testbot/testbot-prompts.test.js +15 -73
  53. package/build/resources/analysisResources.d.ts +17 -0
  54. package/build/resources/progressResource.d.ts +2 -0
  55. package/build/resources/testbotResource.d.ts +2 -0
  56. package/build/services/AnalyticsService.d.ts +13 -0
  57. package/build/services/AnalyticsService.test.d.ts +1 -0
  58. package/build/services/AnalyticsService.test.js +86 -0
  59. package/build/services/ModularizationService.d.ts +11 -0
  60. package/build/services/ScenarioGenerationService.d.ts +37 -0
  61. package/build/services/ScenarioGenerationService.integration.test.d.ts +1 -0
  62. package/build/services/ScenarioGenerationService.integration.test.js +4 -0
  63. package/build/services/ScenarioGenerationService.test.d.ts +1 -0
  64. package/build/services/TestDiscoveryService.d.ts +128 -0
  65. package/build/services/TestDiscoveryService.test.d.ts +1 -0
  66. package/build/services/TestDiscoveryService.test.js +4 -3
  67. package/build/services/TestExecutionService.d.ts +46 -0
  68. package/build/services/TestExecutionService.test.d.ts +1 -0
  69. package/build/services/TestExecutionService.test.js +33 -25
  70. package/build/services/TestGenerationService.d.ts +56 -0
  71. package/build/services/TestGenerationService.test.d.ts +1 -0
  72. package/build/services/TestGenerationService.test.js +10 -8
  73. package/build/services/containerEnv.d.ts +14 -0
  74. package/build/tool-phase-coverage.test.d.ts +1 -0
  75. package/build/tool-phase-coverage.test.js +2 -0
  76. package/build/tool-phases.d.ts +38 -0
  77. package/build/tools/auth/loginTool.d.ts +2 -0
  78. package/build/tools/auth/logoutTool.d.ts +2 -0
  79. package/build/tools/code-refactor/codeReuseTool.d.ts +2 -0
  80. package/build/tools/code-refactor/enhanceAssertionsTool.d.ts +2 -0
  81. package/build/tools/code-refactor/modularizationTool.d.ts +2 -0
  82. package/build/tools/executeSkyrampTestTool.d.ts +2 -0
  83. package/build/tools/fixErrorTool.d.ts +2 -0
  84. package/build/tools/generate-tests/generateBatchScenarioRestTool.d.ts +45 -0
  85. package/build/tools/generate-tests/generateBatchScenarioRestTool.test.d.ts +1 -0
  86. package/build/tools/generate-tests/generateBatchScenarioRestTool.test.js +11 -9
  87. package/build/tools/generate-tests/generateContractRestTool.d.ts +31 -0
  88. package/build/tools/generate-tests/generateE2ERestTool.d.ts +13 -0
  89. package/build/tools/generate-tests/generateFuzzRestTool.d.ts +10 -0
  90. package/build/tools/generate-tests/generateIntegrationRestTool.d.ts +16 -0
  91. package/build/tools/generate-tests/generateLoadRestTool.d.ts +18 -0
  92. package/build/tools/generate-tests/generateLoadRestTool.test.d.ts +1 -0
  93. package/build/tools/generate-tests/generateMockRestTool.d.ts +64 -0
  94. package/build/tools/generate-tests/generateSmokeRestTool.d.ts +8 -0
  95. package/build/tools/generate-tests/generateUIRestTool.d.ts +14 -0
  96. package/build/tools/generate-tests/generateUIRestTool.js +1 -1
  97. package/build/tools/generate-tests/loadTestSchema.d.ts +39 -0
  98. package/build/tools/one-click/oneClickTool.d.ts +11 -0
  99. package/build/tools/submitReportTool.d.ts +384 -0
  100. package/build/tools/submitReportTool.js +144 -2
  101. package/build/tools/submitReportTool.test.d.ts +1 -0
  102. package/build/tools/submitReportTool.test.js +215 -5
  103. package/build/tools/test-management/actionsTool.d.ts +10 -0
  104. package/build/tools/test-management/analyzeChangesTool.d.ts +27 -0
  105. package/build/tools/test-management/analyzeChangesTool.js +44 -7
  106. package/build/tools/test-management/analyzeChangesTool.test.d.ts +1 -0
  107. package/build/tools/test-management/analyzeChangesTool.test.js +76 -39
  108. package/build/tools/test-management/analyzeTestHealthTool.d.ts +2 -0
  109. package/build/tools/test-management/index.d.ts +3 -0
  110. package/build/tools/test-management/index.js +0 -1
  111. package/build/tools/trace/resolveSaveStoragePath.d.ts +7 -0
  112. package/build/tools/trace/resolveSaveStoragePath.test.d.ts +1 -0
  113. package/build/tools/trace/resolveSessionPaths.d.ts +40 -0
  114. package/build/tools/trace/resolveSessionPaths.test.d.ts +1 -0
  115. package/build/tools/trace/sessionState.d.ts +2 -0
  116. package/build/tools/trace/sessionState.test.d.ts +1 -0
  117. package/build/tools/trace/startTraceCollectionTool.d.ts +2 -0
  118. package/build/tools/trace/stopTraceCollectionTool.d.ts +2 -0
  119. package/build/tools/workspace/initScanWorkspaceTool.d.ts +4 -0
  120. package/build/tools/workspace/initializeWorkspaceTool.d.ts +2 -0
  121. package/build/tools/workspace/initializeWorkspaceTool.test.d.ts +1 -0
  122. package/build/tools/workspace/initializeWorkspaceTool.test.js +134 -0
  123. package/build/types/OneClickCommands.d.ts +68 -0
  124. package/build/types/RepositoryAnalysis.d.ts +3004 -0
  125. package/build/types/TestAnalysis.d.ts +96 -0
  126. package/build/types/TestExecution.d.ts +53 -0
  127. package/build/types/TestRecommendation.d.ts +12 -0
  128. package/build/types/TestTypes.d.ts +234 -0
  129. package/build/utils/AnalysisStateManager.d.ts +182 -0
  130. package/build/utils/AnalysisStateManager.test.d.ts +1 -0
  131. package/build/utils/analyze-openapi.d.ts +1 -0
  132. package/build/utils/branchDiff.d.ts +18 -0
  133. package/build/utils/dartRouteExtractor.d.ts +45 -0
  134. package/build/utils/dartRouteExtractor.test.d.ts +1 -0
  135. package/build/utils/docker.d.ts +19 -0
  136. package/build/utils/docker.test.d.ts +1 -0
  137. package/build/utils/docker.test.js +10 -9
  138. package/build/utils/featureFlags.d.ts +37 -0
  139. package/build/utils/featureFlags.test.d.ts +1 -0
  140. package/build/utils/gitStaging.d.ts +24 -0
  141. package/build/utils/gitStaging.test.d.ts +1 -0
  142. package/build/utils/gitStaging.test.js +13 -7
  143. package/build/utils/httpDefaults.d.ts +10 -0
  144. package/build/utils/httpDefaults.test.d.ts +1 -0
  145. package/build/utils/initAgent.d.ts +36 -0
  146. package/build/utils/language-helper.d.ts +6 -0
  147. package/build/utils/logger.d.ts +11 -0
  148. package/build/utils/normalizeParams.d.ts +14 -0
  149. package/build/utils/normalizeSkyrampImports.d.ts +13 -0
  150. package/build/utils/pr-comment-parser.d.ts +31 -0
  151. package/build/utils/pr-comment-parser.test.d.ts +1 -0
  152. package/build/utils/pr-comment-parser.test.js +6 -5
  153. package/build/utils/projectMetadata.d.ts +15 -0
  154. package/build/utils/projectMetadata.test.d.ts +1 -0
  155. package/build/utils/proxy-terminal.d.ts +2 -0
  156. package/build/utils/repoScanner.d.ts +27 -0
  157. package/build/utils/repoScanner.test.d.ts +1 -0
  158. package/build/utils/routeParsers.d.ts +63 -0
  159. package/build/utils/routeParsers.test.d.ts +1 -0
  160. package/build/utils/scenarioDrafting.d.ts +71 -0
  161. package/build/utils/scenarioDrafting.test.d.ts +1 -0
  162. package/build/utils/skyrampMdContent.d.ts +5 -0
  163. package/build/utils/sourceRouteExtractor.d.ts +48 -0
  164. package/build/utils/sourceRouteExtractor.test.d.ts +1 -0
  165. package/build/utils/telemetry.d.ts +32 -0
  166. package/build/utils/telemetry.test.d.ts +1 -0
  167. package/build/utils/trace-parser.d.ts +32 -0
  168. package/build/utils/trace-parser.test.d.ts +6 -0
  169. package/build/utils/uiPageEnumerator.d.ts +146 -0
  170. package/build/utils/uiPageEnumerator.js +58 -14
  171. package/build/utils/uiPageEnumerator.test.d.ts +1 -0
  172. package/build/utils/uiPageEnumerator.test.js +223 -43
  173. package/build/utils/utils.d.ts +39 -0
  174. package/build/utils/utils.test.d.ts +1 -0
  175. package/build/utils/versions.d.ts +3 -0
  176. package/build/utils/versions.js +1 -1
  177. package/build/utils/workspaceAuth.d.ts +127 -0
  178. package/build/utils/workspaceAuth.test.d.ts +1 -0
  179. package/build/utils/workspaceAuth.test.js +25 -25
  180. package/build/workspace/index.d.ts +1 -0
  181. package/build/workspace/workspace.d.ts +390 -0
  182. package/build/workspace/workspace.test.d.ts +1 -0
  183. package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +14 -2
  184. package/package.json +8 -3
  185. package/build/tools/test-management/uiAnalyzeChangesTool.js +0 -155
  186. package/build/tools/test-management/uiAnalyzeChangesTool.test.js +0 -147
@@ -0,0 +1,390 @@
1
+ import { z } from "zod";
2
+ export declare const WORKSPACE_DIR = ".skyramp";
3
+ export declare const WORKSPACE_FILENAME = "workspace.yml";
4
+ export declare const serviceSchema: z.ZodObject<{
5
+ serviceName: z.ZodString;
6
+ repo: z.ZodOptional<z.ZodString>;
7
+ language: z.ZodOptional<z.ZodEnum<["python", "typescript", "javascript", "java"]>>;
8
+ framework: z.ZodOptional<z.ZodEnum<["playwright", "pytest", "robot", "junit"]>>;
9
+ testDirectory: z.ZodOptional<z.ZodString>;
10
+ api: z.ZodOptional<z.ZodObject<{
11
+ schemaPath: z.ZodOptional<z.ZodString>;
12
+ authType: z.ZodOptional<z.ZodEnum<["bearer", "basic", "oauth", "apiKey", "cookie", "session", "token", "none"]>>;
13
+ authHeader: z.ZodOptional<z.ZodString>;
14
+ authScheme: z.ZodOptional<z.ZodString>;
15
+ baseUrl: z.ZodOptional<z.ZodString>;
16
+ }, "strict", z.ZodTypeAny, {
17
+ authHeader?: string | undefined;
18
+ authScheme?: string | undefined;
19
+ schemaPath?: string | undefined;
20
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
21
+ baseUrl?: string | undefined;
22
+ }, {
23
+ authHeader?: string | undefined;
24
+ authScheme?: string | undefined;
25
+ schemaPath?: string | undefined;
26
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
27
+ baseUrl?: string | undefined;
28
+ }>>;
29
+ runtimeDetails: z.ZodOptional<z.ZodObject<{
30
+ serverStartCommand: z.ZodOptional<z.ZodString>;
31
+ runtime: z.ZodEnum<["local", "docker", "k8s"]>;
32
+ dockerNetwork: z.ZodOptional<z.ZodString>;
33
+ k8sNamespace: z.ZodOptional<z.ZodString>;
34
+ k8sContext: z.ZodOptional<z.ZodString>;
35
+ }, "strict", z.ZodTypeAny, {
36
+ runtime: "local" | "docker" | "k8s";
37
+ dockerNetwork?: string | undefined;
38
+ k8sNamespace?: string | undefined;
39
+ k8sContext?: string | undefined;
40
+ serverStartCommand?: string | undefined;
41
+ }, {
42
+ runtime: "local" | "docker" | "k8s";
43
+ dockerNetwork?: string | undefined;
44
+ k8sNamespace?: string | undefined;
45
+ k8sContext?: string | undefined;
46
+ serverStartCommand?: string | undefined;
47
+ }>>;
48
+ }, "strict", z.ZodTypeAny, {
49
+ serviceName: string;
50
+ language?: "python" | "typescript" | "javascript" | "java" | undefined;
51
+ framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
52
+ repo?: string | undefined;
53
+ testDirectory?: string | undefined;
54
+ api?: {
55
+ authHeader?: string | undefined;
56
+ authScheme?: string | undefined;
57
+ schemaPath?: string | undefined;
58
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
59
+ baseUrl?: string | undefined;
60
+ } | undefined;
61
+ runtimeDetails?: {
62
+ runtime: "local" | "docker" | "k8s";
63
+ dockerNetwork?: string | undefined;
64
+ k8sNamespace?: string | undefined;
65
+ k8sContext?: string | undefined;
66
+ serverStartCommand?: string | undefined;
67
+ } | undefined;
68
+ }, {
69
+ serviceName: string;
70
+ language?: "python" | "typescript" | "javascript" | "java" | undefined;
71
+ framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
72
+ repo?: string | undefined;
73
+ testDirectory?: string | undefined;
74
+ api?: {
75
+ authHeader?: string | undefined;
76
+ authScheme?: string | undefined;
77
+ schemaPath?: string | undefined;
78
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
79
+ baseUrl?: string | undefined;
80
+ } | undefined;
81
+ runtimeDetails?: {
82
+ runtime: "local" | "docker" | "k8s";
83
+ dockerNetwork?: string | undefined;
84
+ k8sNamespace?: string | undefined;
85
+ k8sContext?: string | undefined;
86
+ serverStartCommand?: string | undefined;
87
+ } | undefined;
88
+ }>;
89
+ export declare const workspaceConfigSchema: z.ZodObject<{
90
+ workspace: z.ZodOptional<z.ZodObject<{
91
+ repoName: z.ZodOptional<z.ZodString>;
92
+ repoUrl: z.ZodOptional<z.ZodString>;
93
+ }, "strict", z.ZodTypeAny, {
94
+ repoName?: string | undefined;
95
+ repoUrl?: string | undefined;
96
+ }, {
97
+ repoName?: string | undefined;
98
+ repoUrl?: string | undefined;
99
+ }>>;
100
+ metadata: z.ZodOptional<z.ZodObject<{
101
+ schemaVersion: z.ZodString;
102
+ mcpVersion: z.ZodString;
103
+ executorVersion: z.ZodString;
104
+ createdAt: z.ZodString;
105
+ updatedAt: z.ZodString;
106
+ }, "strict", z.ZodTypeAny, {
107
+ createdAt: string;
108
+ schemaVersion: string;
109
+ mcpVersion: string;
110
+ executorVersion: string;
111
+ updatedAt: string;
112
+ }, {
113
+ createdAt: string;
114
+ schemaVersion: string;
115
+ mcpVersion: string;
116
+ executorVersion: string;
117
+ updatedAt: string;
118
+ }>>;
119
+ services: z.ZodOptional<z.ZodArray<z.ZodObject<{
120
+ serviceName: z.ZodString;
121
+ repo: z.ZodOptional<z.ZodString>;
122
+ language: z.ZodOptional<z.ZodEnum<["python", "typescript", "javascript", "java"]>>;
123
+ framework: z.ZodOptional<z.ZodEnum<["playwright", "pytest", "robot", "junit"]>>;
124
+ testDirectory: z.ZodOptional<z.ZodString>;
125
+ api: z.ZodOptional<z.ZodObject<{
126
+ schemaPath: z.ZodOptional<z.ZodString>;
127
+ authType: z.ZodOptional<z.ZodEnum<["bearer", "basic", "oauth", "apiKey", "cookie", "session", "token", "none"]>>;
128
+ authHeader: z.ZodOptional<z.ZodString>;
129
+ authScheme: z.ZodOptional<z.ZodString>;
130
+ baseUrl: z.ZodOptional<z.ZodString>;
131
+ }, "strict", z.ZodTypeAny, {
132
+ authHeader?: string | undefined;
133
+ authScheme?: string | undefined;
134
+ schemaPath?: string | undefined;
135
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
136
+ baseUrl?: string | undefined;
137
+ }, {
138
+ authHeader?: string | undefined;
139
+ authScheme?: string | undefined;
140
+ schemaPath?: string | undefined;
141
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
142
+ baseUrl?: string | undefined;
143
+ }>>;
144
+ runtimeDetails: z.ZodOptional<z.ZodObject<{
145
+ serverStartCommand: z.ZodOptional<z.ZodString>;
146
+ runtime: z.ZodEnum<["local", "docker", "k8s"]>;
147
+ dockerNetwork: z.ZodOptional<z.ZodString>;
148
+ k8sNamespace: z.ZodOptional<z.ZodString>;
149
+ k8sContext: z.ZodOptional<z.ZodString>;
150
+ }, "strict", z.ZodTypeAny, {
151
+ runtime: "local" | "docker" | "k8s";
152
+ dockerNetwork?: string | undefined;
153
+ k8sNamespace?: string | undefined;
154
+ k8sContext?: string | undefined;
155
+ serverStartCommand?: string | undefined;
156
+ }, {
157
+ runtime: "local" | "docker" | "k8s";
158
+ dockerNetwork?: string | undefined;
159
+ k8sNamespace?: string | undefined;
160
+ k8sContext?: string | undefined;
161
+ serverStartCommand?: string | undefined;
162
+ }>>;
163
+ }, "strict", z.ZodTypeAny, {
164
+ serviceName: string;
165
+ language?: "python" | "typescript" | "javascript" | "java" | undefined;
166
+ framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
167
+ repo?: string | undefined;
168
+ testDirectory?: string | undefined;
169
+ api?: {
170
+ authHeader?: string | undefined;
171
+ authScheme?: string | undefined;
172
+ schemaPath?: string | undefined;
173
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
174
+ baseUrl?: string | undefined;
175
+ } | undefined;
176
+ runtimeDetails?: {
177
+ runtime: "local" | "docker" | "k8s";
178
+ dockerNetwork?: string | undefined;
179
+ k8sNamespace?: string | undefined;
180
+ k8sContext?: string | undefined;
181
+ serverStartCommand?: string | undefined;
182
+ } | undefined;
183
+ }, {
184
+ serviceName: string;
185
+ language?: "python" | "typescript" | "javascript" | "java" | undefined;
186
+ framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
187
+ repo?: string | undefined;
188
+ testDirectory?: string | undefined;
189
+ api?: {
190
+ authHeader?: string | undefined;
191
+ authScheme?: string | undefined;
192
+ schemaPath?: string | undefined;
193
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
194
+ baseUrl?: string | undefined;
195
+ } | undefined;
196
+ runtimeDetails?: {
197
+ runtime: "local" | "docker" | "k8s";
198
+ dockerNetwork?: string | undefined;
199
+ k8sNamespace?: string | undefined;
200
+ k8sContext?: string | undefined;
201
+ serverStartCommand?: string | undefined;
202
+ } | undefined;
203
+ }>, "many">>;
204
+ }, "strict", z.ZodTypeAny, {
205
+ metadata?: {
206
+ createdAt: string;
207
+ schemaVersion: string;
208
+ mcpVersion: string;
209
+ executorVersion: string;
210
+ updatedAt: string;
211
+ } | undefined;
212
+ workspace?: {
213
+ repoName?: string | undefined;
214
+ repoUrl?: string | undefined;
215
+ } | undefined;
216
+ services?: {
217
+ serviceName: string;
218
+ language?: "python" | "typescript" | "javascript" | "java" | undefined;
219
+ framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
220
+ repo?: string | undefined;
221
+ testDirectory?: string | undefined;
222
+ api?: {
223
+ authHeader?: string | undefined;
224
+ authScheme?: string | undefined;
225
+ schemaPath?: string | undefined;
226
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
227
+ baseUrl?: string | undefined;
228
+ } | undefined;
229
+ runtimeDetails?: {
230
+ runtime: "local" | "docker" | "k8s";
231
+ dockerNetwork?: string | undefined;
232
+ k8sNamespace?: string | undefined;
233
+ k8sContext?: string | undefined;
234
+ serverStartCommand?: string | undefined;
235
+ } | undefined;
236
+ }[] | undefined;
237
+ }, {
238
+ metadata?: {
239
+ createdAt: string;
240
+ schemaVersion: string;
241
+ mcpVersion: string;
242
+ executorVersion: string;
243
+ updatedAt: string;
244
+ } | undefined;
245
+ workspace?: {
246
+ repoName?: string | undefined;
247
+ repoUrl?: string | undefined;
248
+ } | undefined;
249
+ services?: {
250
+ serviceName: string;
251
+ language?: "python" | "typescript" | "javascript" | "java" | undefined;
252
+ framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
253
+ repo?: string | undefined;
254
+ testDirectory?: string | undefined;
255
+ api?: {
256
+ authHeader?: string | undefined;
257
+ authScheme?: string | undefined;
258
+ schemaPath?: string | undefined;
259
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
260
+ baseUrl?: string | undefined;
261
+ } | undefined;
262
+ runtimeDetails?: {
263
+ runtime: "local" | "docker" | "k8s";
264
+ dockerNetwork?: string | undefined;
265
+ k8sNamespace?: string | undefined;
266
+ k8sContext?: string | undefined;
267
+ serverStartCommand?: string | undefined;
268
+ } | undefined;
269
+ }[] | undefined;
270
+ }>;
271
+ export type Service = z.infer<typeof serviceSchema>;
272
+ export type ServiceApi = NonNullable<Service["api"]>;
273
+ export type ServiceRuntimeDetails = NonNullable<Service["runtimeDetails"]>;
274
+ export type WorkspaceConfig = z.infer<typeof workspaceConfigSchema>;
275
+ export type WorkspaceSection = NonNullable<WorkspaceConfig["workspace"]>;
276
+ export type MetadataSection = NonNullable<WorkspaceConfig["metadata"]>;
277
+ /** Validates a workspace configuration object against the Zod schema. */
278
+ export declare function validateWorkspaceConfig(config: unknown): z.SafeParseReturnType<{
279
+ metadata?: {
280
+ createdAt: string;
281
+ schemaVersion: string;
282
+ mcpVersion: string;
283
+ executorVersion: string;
284
+ updatedAt: string;
285
+ } | undefined;
286
+ workspace?: {
287
+ repoName?: string | undefined;
288
+ repoUrl?: string | undefined;
289
+ } | undefined;
290
+ services?: {
291
+ serviceName: string;
292
+ language?: "python" | "typescript" | "javascript" | "java" | undefined;
293
+ framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
294
+ repo?: string | undefined;
295
+ testDirectory?: string | undefined;
296
+ api?: {
297
+ authHeader?: string | undefined;
298
+ authScheme?: string | undefined;
299
+ schemaPath?: string | undefined;
300
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
301
+ baseUrl?: string | undefined;
302
+ } | undefined;
303
+ runtimeDetails?: {
304
+ runtime: "local" | "docker" | "k8s";
305
+ dockerNetwork?: string | undefined;
306
+ k8sNamespace?: string | undefined;
307
+ k8sContext?: string | undefined;
308
+ serverStartCommand?: string | undefined;
309
+ } | undefined;
310
+ }[] | undefined;
311
+ }, {
312
+ metadata?: {
313
+ createdAt: string;
314
+ schemaVersion: string;
315
+ mcpVersion: string;
316
+ executorVersion: string;
317
+ updatedAt: string;
318
+ } | undefined;
319
+ workspace?: {
320
+ repoName?: string | undefined;
321
+ repoUrl?: string | undefined;
322
+ } | undefined;
323
+ services?: {
324
+ serviceName: string;
325
+ language?: "python" | "typescript" | "javascript" | "java" | undefined;
326
+ framework?: "playwright" | "pytest" | "robot" | "junit" | undefined;
327
+ repo?: string | undefined;
328
+ testDirectory?: string | undefined;
329
+ api?: {
330
+ authHeader?: string | undefined;
331
+ authScheme?: string | undefined;
332
+ schemaPath?: string | undefined;
333
+ authType?: "none" | "token" | "bearer" | "basic" | "oauth" | "apiKey" | "cookie" | "session" | undefined;
334
+ baseUrl?: string | undefined;
335
+ } | undefined;
336
+ runtimeDetails?: {
337
+ runtime: "local" | "docker" | "k8s";
338
+ dockerNetwork?: string | undefined;
339
+ k8sNamespace?: string | undefined;
340
+ k8sContext?: string | undefined;
341
+ serverStartCommand?: string | undefined;
342
+ } | undefined;
343
+ }[] | undefined;
344
+ }>;
345
+ /** Creates a default workspace config with empty sections and timestamps. */
346
+ export declare function createDefaultConfig(): WorkspaceConfig;
347
+ /**
348
+ * High-level manager for .skyramp/workspace.yml.
349
+ *
350
+ * Provides three focused mutation methods:
351
+ * 1. initialize() — create workspace file with repo info
352
+ * 2. updateMetadata() — update metadata section
353
+ * 3. addService() — upsert a single service entry
354
+ */
355
+ export declare class WorkspaceConfigManager {
356
+ private workspacePath;
357
+ private skyrampDir;
358
+ private configPath;
359
+ constructor(workspacePath: string);
360
+ /** Check if workspace config file exists */
361
+ exists(): Promise<boolean>;
362
+ /** Get the absolute path to the config file */
363
+ getConfigPath(): string;
364
+ /** Get the workspace root path */
365
+ getWorkspacePath(): string;
366
+ /** Read and parse workspace config from disk. */
367
+ read(): Promise<WorkspaceConfig>;
368
+ /**
369
+ * Initialize workspace — creates .skyramp/workspace.yml with repo info.
370
+ * Auto-detects repoName and repoUrl from git when not provided.
371
+ * Produces an empty services array and default metadata timestamps.
372
+ */
373
+ initialize(workspaceInfo?: WorkspaceSection): Promise<WorkspaceConfig>;
374
+ /**
375
+ * Update the metadata section of an existing workspace config.
376
+ * Only the provided fields are merged; metadata.updatedAt is refreshed
377
+ * automatically.
378
+ */
379
+ updateMetadata(metadata: Partial<MetadataSection>): Promise<WorkspaceConfig>;
380
+ /**
381
+ * Add a single service entry to the services array.
382
+ * If a service with the same identity already exists it is replaced
383
+ * (upsert semantics), otherwise the new entry is appended. Service identity
384
+ * is the composite (repo, serviceName) — a service's `repo` (absent → primary)
385
+ * is part of its key, so the same serviceName can coexist across repos in a
386
+ * unified multi-repo workspace.
387
+ * metadata.updatedAt is refreshed automatically.
388
+ */
389
+ addService(service: Service): Promise<WorkspaceConfig>;
390
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1235,6 +1235,14 @@ Cell row ${params.row}, column ${params.column} has "${actual}", expected "${par
1235
1235
  locator: { kind: "text", body: text, options: { exact: false } }
1236
1236
  };
1237
1237
  }
1238
+ const colonTextMatch = refLine.match(/\[ref=\w+\](?:\s*\[[^\]]*\])*\s*:\s*(.+?)\s*$/);
1239
+ if (colonTextMatch && colonTextMatch[1].trim()) {
1240
+ const text = colonTextMatch[1].trim();
1241
+ return {
1242
+ selector: `internal:text="${text}"i`,
1243
+ locator: { kind: "text", body: text, options: { exact: false } }
1244
+ };
1245
+ }
1238
1246
  return null;
1239
1247
  }
1240
1248
  /**
@@ -1671,8 +1679,12 @@ Cell row ${params.row}, column ${params.column} has "${actual}", expected "${par
1671
1679
  }
1672
1680
  }
1673
1681
  if (!isFlutter) return;
1674
- const placeholder = page.locator("flt-semantics-placeholder").first();
1675
- const clicked = await placeholder.click({ force: true }).then(() => true).catch(() => false);
1682
+ const clicked = await page.evaluate(() => {
1683
+ const el = document.querySelector("flt-semantics-placeholder");
1684
+ if (!el) return false;
1685
+ el.dispatchEvent(new MouseEvent("click", { isTrusted: true, bubbles: true, cancelable: true }));
1686
+ return true;
1687
+ }).catch(() => false);
1676
1688
  if (!clicked) {
1677
1689
  traceDebug("Flutter detected but placeholder click failed");
1678
1690
  return;
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@skyramp/mcp",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "main": "build/index.js",
5
5
  "exports": {
6
6
  ".": "./build/index.js",
7
7
  "./tool-phases": "./build/tool-phases.js",
8
8
  "./personas": "./build/prompts/personas.js",
9
+ "./workspace": {
10
+ "types": "./build/workspace/index.d.ts",
11
+ "default": "./build/workspace/index.js"
12
+ },
9
13
  "./build/*": "./build/*"
10
14
  },
11
15
  "type": "module",
@@ -22,10 +26,11 @@
22
26
  "pretty": "npx prettier --write .",
23
27
  "lint": "eslint src --ext .ts",
24
28
  "lint:fix": "eslint src --ext .ts --fix",
25
- "test": "npx jest"
29
+ "test": "node --experimental-vm-modules node_modules/.bin/jest"
26
30
  },
27
31
  "files": [
28
32
  "build/**/*.js",
33
+ "build/**/*.d.ts",
29
34
  "README.md"
30
35
  ],
31
36
  "bundleDependencies": [
@@ -55,7 +60,7 @@
55
60
  "dependencies": {
56
61
  "@modelcontextprotocol/sdk": "^1.24.3",
57
62
  "@playwright/test": "^1.55.0",
58
- "@skyramp/skyramp": "1.3.27",
63
+ "@skyramp/skyramp": "1.3.28",
59
64
  "dockerode": "^5.0.0",
60
65
  "fast-glob": "^3.3.3",
61
66
  "js-yaml": "^4.1.1",
@@ -1,155 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import { z } from "zod";
4
- import { logger } from "../../utils/logger.js";
5
- import { enumerateCandidateUiPages } from "../../utils/uiPageEnumerator.js";
6
- import { hasFlutterSdkDep, isFrontendFile, isTestFile } from "../../prompts/test-recommendation/scopeAssessment.js";
7
- import { parseChangedFilesFromDiff } from "../../utils/branchDiff.js";
8
- import { toolText } from "../../utils/utils.js";
9
- import { isTestbotEnabled } from "../../utils/featureFlags.js";
10
- /**
11
- * skyramp_ui_analyze_changes — runs before skyramp_analyze_changes when the
12
- * caller (typically the testbot agent) wants blueprint-grounded recommendations.
13
- *
14
- * Computes candidateUiPages[] using the same source-grounded logic that
15
- * analyze_changes uses internally (shared enumerator), then emits explicit
16
- * instructions for the agent: navigate to each candidate URL, capture a
17
- * browser_blueprint, then call skyramp_analyze_changes with the captures
18
- * available as element vocabulary when the agent writes UI rec reasoning.
19
- *
20
- * Graceful degradation: backend-only PRs produce a "no UI work" instruction;
21
- * unresolvable frontend baseUrl produces "skip captures, call analyze_changes
22
- * with empty array." analyze_changes still works in either case — same
23
- * source-grounded output as before slice 4.
24
- */
25
- export async function runUiAnalyzeChanges(params) {
26
- const repoPath = params.repositoryPath;
27
- // Read changedFiles from the canonical PR diff file. The testbot runtime
28
- // writes this before the prompt runs.
29
- const diffPath = path.join(repoPath, ".skyramp_git_diff");
30
- let changedFiles = [];
31
- let diffFileMissing = false;
32
- try {
33
- const raw = fs.readFileSync(diffPath, "utf-8");
34
- changedFiles = parseChangedFilesFromDiff(raw);
35
- }
36
- catch {
37
- // No diff file — for testbot this would be a runtime bug (it always
38
- // writes one); for non-testbot callers it means "diff unavailable",
39
- // which is NOT the same as "no UI changes". Surface that distinction.
40
- diffFileMissing = true;
41
- }
42
- if (diffFileMissing) {
43
- const uiContext = {
44
- changedFrontendFiles: [],
45
- candidateUiPages: [],
46
- };
47
- return {
48
- uiContext,
49
- instructions: DIFF_FILE_MISSING_INSTRUCTIONS,
50
- };
51
- }
52
- // Compute hasFlutterSdkDep once at the tool boundary; pass into isFrontendFile
53
- // so .dart files are recognised as frontend in Flutter repos. See Confluence
54
- // "Flutter support in Testbot" — this is one of two budget-driving call sites
55
- // that must thread the flag (the other is analyzeChangesTool). Without it,
56
- // a Flutter PR shows zero frontend files and never enters the UI pipeline.
57
- const flutterSdk = hasFlutterSdkDep(repoPath);
58
- const frontendFiles = changedFiles.filter((f) => isFrontendFile(f, { hasFlutterSdkDep: flutterSdk }) && !isTestFile(f));
59
- if (frontendFiles.length === 0) {
60
- const uiContext = {
61
- changedFrontendFiles: [],
62
- candidateUiPages: [],
63
- };
64
- return {
65
- uiContext,
66
- instructions: NO_UI_INSTRUCTIONS,
67
- };
68
- }
69
- const candidateUiPages = await enumerateCandidateUiPages(repoPath, frontendFiles);
70
- const uiContext = {
71
- changedFrontendFiles: frontendFiles,
72
- candidateUiPages,
73
- };
74
- const instructions = candidateUiPages.length === 0
75
- ? NO_RESOLVABLE_URLS_INSTRUCTIONS
76
- : buildCaptureInstructions(candidateUiPages, params.uiCredentials);
77
- logger.info("ui_analyze_changes computed candidate UI pages", {
78
- repositoryPath: repoPath,
79
- frontendFileCount: frontendFiles.length,
80
- candidateUiPageCount: candidateUiPages.length,
81
- hasUiCredentials: !!params.uiCredentials,
82
- });
83
- return { uiContext, instructions };
84
- }
85
- const NO_UI_INSTRUCTIONS = `No UI changes detected in this PR. Proceed directly to \`skyramp_analyze_changes\`.`;
86
- const NO_RESOLVABLE_URLS_INSTRUCTIONS = `Frontend changes detected but no candidate URLs could be resolved (workspace baseUrl missing or no router files matched). Proceed to \`skyramp_analyze_changes\`; UI recommendations will be source-grounded only.`;
87
- const DIFF_FILE_MISSING_INSTRUCTIONS = `\`.skyramp_git_diff\` not found in the repository. This file is normally written by the testbot runtime before the prompt runs; without it, this tool cannot determine which files changed. **Do not skip blueprint capture on the assumption there are no UI changes** — that conclusion is not supported by the available data. If you have access to the changed-files list elsewhere (e.g. a \`gh pr diff\` command, an environment variable), determine UI candidates yourself and capture their blueprints before proceeding. Otherwise proceed to \`skyramp_analyze_changes\` and add an \`issuesFound\` info entry: "ui_analyze_changes could not read .skyramp_git_diff; recommendations are source-grounded only".`;
88
- function buildCaptureInstructions(pages, uiCredentials) {
89
- // The `<ui-credentials>` tag is only emitted by the testbot orchestration
90
- // prompt. When this tool is called from an IDE (Cursor, etc.) outside
91
- // testbot, the agent has no such tag — embed the credentials inline
92
- // instead. uiCredentials is "email:password" formatted by the caller.
93
- const loginStep = uiCredentials
94
- ? (isTestbotEnabled()
95
- ? `\n0. **Log in first.** \`browser_navigate\` to the app's login URL, then use \`<ui-credentials>\` from the testbot prompt to authenticate (you have those credentials in context). Without authentication, the candidate URLs below may redirect to login and the captured blueprints will be of the login page, not the feature.\n`
96
- : `\n0. **Log in first.** \`browser_navigate\` to the app's login URL, then authenticate with the credentials \`${uiCredentials}\` (formatted as \`email:password\`). Without authentication, the candidate URLs below may redirect to login and the captured blueprints will be of the login page, not the feature.\n`)
97
- : "";
98
- const pagesYaml = pages
99
- .map((p, i) => ` ${i + 1}. ${p.url} (sourcedFrom: ${p.sourcedFrom.join(", ") || "(none)"}, strategy: ${p.strategy})`)
100
- .join("\n");
101
- return `Frontend changes detected. **Before calling \`skyramp_analyze_changes\`, capture blueprints on the candidate UI pages below.** Those captures stay in your tool-result history and serve as element vocabulary when you write UI test recommendations — \`skyramp_analyze_changes\` returns the authoring rules; you bring the observed elements.
102
- ${loginStep}
103
- **Candidate URLs:**
104
- ${pagesYaml}
105
-
106
- **For each candidate URL:**
107
- - \`browser_navigate\` to the URL
108
- - \`browser_blueprint\` to capture the page
109
-
110
- You don't need to thread the blueprints back into a tool call — they're in your context once captured. **Then call \`skyramp_analyze_changes\`** to get the recommendation catalog and the UI authoring rules.
111
-
112
- If a candidate URL 404s or redirects unexpectedly, navigate from the workspace baseUrl and explore (admin apps mount routes under base prefixes the source extraction can't see). If the page rendered but lacks the changed feature (gated UI: modal, dropdown, accordion), do NOT iterate further during this step — UI recs will fall back to source-grounded prose for those, and the agent's later trace recording (Task 2) will navigate into the gate via capture-act-capture.
113
-
114
- If \`browser_blueprint\` fails on every candidate URL (app unreachable, all 404s), proceed to \`skyramp_analyze_changes\` and log an \`issuesFound\` info entry. Recommendations will be source-grounded; non-UI work is unaffected.`;
115
- }
116
- export const uiAnalyzeChangesInputSchema = {
117
- repositoryPath: z
118
- .string()
119
- .describe("Absolute path to the repository root"),
120
- uiCredentials: z
121
- .string()
122
- .optional()
123
- .describe("Optional ui-credentials for authed apps. When present, the returned " +
124
- "instructions include a login step before blueprint capture."),
125
- };
126
- export function registerUiAnalyzeChangesTool(server) {
127
- server.registerTool("skyramp_ui_analyze_changes", {
128
- description: [
129
- "Run BEFORE skyramp_analyze_changes when the PR may contain frontend changes.",
130
- "Enumerates candidate UI pages from the diff and instructs the agent to",
131
- "capture browser_blueprints on each before calling analyze_changes. The",
132
- "captures stay in the agent's tool-result history and serve as the",
133
- "element vocabulary for UI rec reasoning.",
134
- "",
135
- "On backend-only PRs, returns a 'no UI work' instruction — caller can",
136
- "proceed directly to skyramp_analyze_changes.",
137
- ].join("\n"),
138
- inputSchema: uiAnalyzeChangesInputSchema,
139
- annotations: {
140
- readOnlyHint: true, // reads .skyramp_git_diff + workspace.yml; no writes
141
- idempotentHint: true, // pure function of repo state + uiCredentials
142
- openWorldHint: false, // no external service calls
143
- },
144
- }, async (params) => {
145
- const result = await runUiAnalyzeChanges(params);
146
- const summary = JSON.stringify({ uiContext: result.uiContext }, null, 2);
147
- return toolText(`<summary>
148
- ${summary}
149
- </summary>
150
-
151
- <instructions>
152
- ${result.instructions}
153
- </instructions>`);
154
- });
155
- }