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