@skyramp/mcp 0.2.6 → 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.
- 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 +1 -2
- 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/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/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-recommendation/analysisOutputPrompt.d.ts +84 -0
- 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 +7 -16
- 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 +6 -99
- package/build/prompts/testbot/testbot-prompts.d.ts +11 -0
- package/build/prompts/testbot/testbot-prompts.js +198 -34
- package/build/prompts/testbot/testbot-prompts.test.d.ts +1 -0
- package/build/prompts/testbot/testbot-prompts.test.js +15 -73
- package/build/resources/analysisResources.d.ts +17 -0
- package/build/resources/progressResource.d.ts +2 -0
- package/build/resources/testbotResource.d.ts +2 -0
- 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.test.d.ts +1 -0
- package/build/services/TestDiscoveryService.test.js +4 -3
- package/build/services/TestExecutionService.d.ts +46 -0
- package/build/services/TestExecutionService.test.d.ts +1 -0
- package/build/services/TestExecutionService.test.js +33 -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/fixErrorTool.d.ts +2 -0
- package/build/tools/generate-tests/generateBatchScenarioRestTool.d.ts +45 -0
- 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 +384 -0
- package/build/tools/submitReportTool.js +144 -2
- package/build/tools/submitReportTool.test.d.ts +1 -0
- package/build/tools/submitReportTool.test.js +215 -5
- package/build/tools/test-management/actionsTool.d.ts +10 -0
- package/build/tools/test-management/analyzeChangesTool.d.ts +27 -0
- package/build/tools/test-management/analyzeChangesTool.js +44 -7
- package/build/tools/test-management/analyzeChangesTool.test.d.ts +1 -0
- package/build/tools/test-management/analyzeChangesTool.test.js +76 -39
- package/build/tools/test-management/analyzeTestHealthTool.d.ts +2 -0
- 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.test.d.ts +1 -0
- package/build/tools/workspace/initializeWorkspaceTool.test.js +134 -0
- package/build/types/OneClickCommands.d.ts +68 -0
- package/build/types/RepositoryAnalysis.d.ts +3004 -0
- package/build/types/TestAnalysis.d.ts +96 -0
- package/build/types/TestExecution.d.ts +53 -0
- package/build/types/TestRecommendation.d.ts +12 -0
- package/build/types/TestTypes.d.ts +234 -0
- package/build/utils/AnalysisStateManager.d.ts +182 -0
- package/build/utils/AnalysisStateManager.test.d.ts +1 -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 +63 -0
- package/build/utils/routeParsers.test.d.ts +1 -0
- package/build/utils/scenarioDrafting.d.ts +71 -0
- 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 +39 -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.test.d.ts +1 -0
- package/package.json +8 -3
- package/build/tools/test-management/uiAnalyzeChangesTool.js +0 -155
- package/build/tools/test-management/uiAnalyzeChangesTool.test.js +0 -147
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
jest.mock("@skyramp/skyramp", () => ({
|
|
2
|
-
WorkspaceConfigManager: { create: jest.fn() },
|
|
3
|
-
}));
|
|
4
|
-
import { runUiAnalyzeChanges } from "./uiAnalyzeChangesTool.js";
|
|
5
|
-
import * as workspaceAuth from "../../utils/workspaceAuth.js";
|
|
6
|
-
import * as fs from "fs";
|
|
7
|
-
import * as os from "os";
|
|
8
|
-
import * as path from "path";
|
|
9
|
-
function makeRepoWithDiff(changedFiles) {
|
|
10
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "skyramp-uiac-test-"));
|
|
11
|
-
// Write .skyramp_git_diff with the requested file changes — match the
|
|
12
|
-
// format the runtime uses (raw `diff --git a/X b/X` block).
|
|
13
|
-
const diff = changedFiles
|
|
14
|
-
.map((f) => `diff --git a/${f} b/${f}\n+++ b/${f}\n@@ -0,0 +1,1 @@\n+x`)
|
|
15
|
-
.join("\n");
|
|
16
|
-
fs.writeFileSync(path.join(dir, ".skyramp_git_diff"), diff);
|
|
17
|
-
return dir;
|
|
18
|
-
}
|
|
19
|
-
describe("runUiAnalyzeChanges", () => {
|
|
20
|
-
let readSpy;
|
|
21
|
-
beforeEach(() => {
|
|
22
|
-
readSpy = jest.spyOn(workspaceAuth, "readWorkspaceConfigRaw");
|
|
23
|
-
});
|
|
24
|
-
afterEach(() => {
|
|
25
|
-
readSpy.mockRestore();
|
|
26
|
-
});
|
|
27
|
-
it("returns empty changedFrontendFiles for backend-only diffs", async () => {
|
|
28
|
-
readSpy.mockResolvedValue({ services: [] });
|
|
29
|
-
const repo = makeRepoWithDiff(["api/handlers/users.ts"]);
|
|
30
|
-
const result = await runUiAnalyzeChanges({ repositoryPath: repo });
|
|
31
|
-
expect(result.uiContext.changedFrontendFiles).toEqual([]);
|
|
32
|
-
expect(result.uiContext.candidateUiPages).toEqual([]);
|
|
33
|
-
expect(result.instructions).toMatch(/no UI changes/i);
|
|
34
|
-
fs.rmSync(repo, { recursive: true, force: true });
|
|
35
|
-
});
|
|
36
|
-
it("returns candidateUiPages and capture instructions for frontend diffs", async () => {
|
|
37
|
-
readSpy.mockResolvedValue({
|
|
38
|
-
services: [{ serviceName: "frontend", api: { baseUrl: "http://localhost:3000" } }],
|
|
39
|
-
});
|
|
40
|
-
const repo = makeRepoWithDiff(["frontend/src/components/Cart.tsx"]);
|
|
41
|
-
const result = await runUiAnalyzeChanges({ repositoryPath: repo });
|
|
42
|
-
expect(result.uiContext.changedFrontendFiles.length).toBeGreaterThan(0);
|
|
43
|
-
expect(result.uiContext.candidateUiPages.length).toBeGreaterThan(0);
|
|
44
|
-
expect(result.instructions).toMatch(/browser_navigate/);
|
|
45
|
-
expect(result.instructions).toMatch(/browser_blueprint/);
|
|
46
|
-
expect(result.instructions).toMatch(/skyramp_analyze_changes/);
|
|
47
|
-
// Captures stay in agent's tool-result history; we no longer thread them
|
|
48
|
-
// back through analyze_changes as a param.
|
|
49
|
-
expect(result.instructions).not.toMatch(/capturedBlueprints/);
|
|
50
|
-
fs.rmSync(repo, { recursive: true, force: true });
|
|
51
|
-
});
|
|
52
|
-
it("includes inline-credentials login step in non-testbot mode", async () => {
|
|
53
|
-
// SKYRAMP_FEATURE_TESTBOT is not set here, so the tool emits the
|
|
54
|
-
// credentials inline rather than referencing the testbot's
|
|
55
|
-
// <ui-credentials> context tag (which doesn't exist outside testbot).
|
|
56
|
-
delete process.env.SKYRAMP_FEATURE_TESTBOT;
|
|
57
|
-
readSpy.mockResolvedValue({
|
|
58
|
-
services: [{ serviceName: "frontend", api: { baseUrl: "http://localhost:3000" } }],
|
|
59
|
-
});
|
|
60
|
-
const repo = makeRepoWithDiff(["frontend/src/components/Cart.tsx"]);
|
|
61
|
-
const result = await runUiAnalyzeChanges({
|
|
62
|
-
repositoryPath: repo,
|
|
63
|
-
uiCredentials: "admin@example.com:admin",
|
|
64
|
-
});
|
|
65
|
-
expect(result.instructions).toMatch(/log in/i);
|
|
66
|
-
expect(result.instructions).toContain("admin@example.com:admin");
|
|
67
|
-
fs.rmSync(repo, { recursive: true, force: true });
|
|
68
|
-
});
|
|
69
|
-
it("references the <ui-credentials> testbot context tag in testbot mode", async () => {
|
|
70
|
-
process.env.SKYRAMP_FEATURE_TESTBOT = "1";
|
|
71
|
-
try {
|
|
72
|
-
readSpy.mockResolvedValue({
|
|
73
|
-
services: [{ serviceName: "frontend", api: { baseUrl: "http://localhost:3000" } }],
|
|
74
|
-
});
|
|
75
|
-
const repo = makeRepoWithDiff(["frontend/src/components/Cart.tsx"]);
|
|
76
|
-
const result = await runUiAnalyzeChanges({
|
|
77
|
-
repositoryPath: repo,
|
|
78
|
-
uiCredentials: "admin@example.com:admin",
|
|
79
|
-
});
|
|
80
|
-
expect(result.instructions).toMatch(/log in/i);
|
|
81
|
-
expect(result.instructions).toContain("ui-credentials");
|
|
82
|
-
// Inline credentials should NOT leak in testbot mode (the
|
|
83
|
-
// <ui-credentials> tag is the secure carrier in that flow).
|
|
84
|
-
expect(result.instructions).not.toContain("admin@example.com:admin");
|
|
85
|
-
fs.rmSync(repo, { recursive: true, force: true });
|
|
86
|
-
}
|
|
87
|
-
finally {
|
|
88
|
-
delete process.env.SKYRAMP_FEATURE_TESTBOT;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
it("instructs the agent to proceed to analyze_changes (source-grounded) when frontend baseUrl unresolvable", async () => {
|
|
92
|
-
readSpy.mockResolvedValue(null); // no workspace yml
|
|
93
|
-
const repo = makeRepoWithDiff(["frontend/src/components/Cart.tsx"]);
|
|
94
|
-
const result = await runUiAnalyzeChanges({ repositoryPath: repo });
|
|
95
|
-
expect(result.uiContext.changedFrontendFiles.length).toBeGreaterThan(0);
|
|
96
|
-
expect(result.uiContext.candidateUiPages).toEqual([]);
|
|
97
|
-
expect(result.instructions).toMatch(/source-grounded/i);
|
|
98
|
-
fs.rmSync(repo, { recursive: true, force: true });
|
|
99
|
-
});
|
|
100
|
-
// Flutter support — the headline case the Confluence plan validates.
|
|
101
|
-
// Without the .dart classifier change, a Flutter PR returns
|
|
102
|
-
// changedFrontendFiles: [] → "No UI changes detected" → agent skips
|
|
103
|
-
// browser_navigate entirely. With the change + a Flutter pubspec, the
|
|
104
|
-
// diff registers as frontend and the agent gets told to navigate.
|
|
105
|
-
it("recognises .dart files as frontend in a Flutter project (with pubspec.yaml)", async () => {
|
|
106
|
-
readSpy.mockResolvedValue({
|
|
107
|
-
services: [
|
|
108
|
-
{
|
|
109
|
-
serviceName: "birdle-frontend",
|
|
110
|
-
language: "typescript",
|
|
111
|
-
framework: "playwright",
|
|
112
|
-
api: { baseUrl: "http://localhost:8080" },
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
});
|
|
116
|
-
const repo = makeRepoWithDiff(["lib/main.dart"]);
|
|
117
|
-
// Write a Flutter pubspec.yaml at the repo root so hasFlutterSdkDep returns true
|
|
118
|
-
fs.writeFileSync(path.join(repo, "pubspec.yaml"), `name: birdle\ndependencies:\n flutter:\n sdk: flutter\n`);
|
|
119
|
-
const result = await runUiAnalyzeChanges({ repositoryPath: repo });
|
|
120
|
-
expect(result.uiContext.changedFrontendFiles).toContain("lib/main.dart");
|
|
121
|
-
expect(result.uiContext.candidateUiPages.length).toBeGreaterThan(0);
|
|
122
|
-
expect(result.instructions).toMatch(/browser_navigate/);
|
|
123
|
-
fs.rmSync(repo, { recursive: true, force: true });
|
|
124
|
-
});
|
|
125
|
-
it("does NOT recognise .dart files as frontend without a Flutter pubspec.yaml", async () => {
|
|
126
|
-
// Pure Dart project (server/CLI) — pubspec.yaml absent or missing the SDK dep.
|
|
127
|
-
// .dart files should NOT enter the UI pipeline.
|
|
128
|
-
readSpy.mockResolvedValue({ services: [] });
|
|
129
|
-
const repo = makeRepoWithDiff(["bin/server.dart"]);
|
|
130
|
-
// No pubspec.yaml written at all
|
|
131
|
-
const result = await runUiAnalyzeChanges({ repositoryPath: repo });
|
|
132
|
-
expect(result.uiContext.changedFrontendFiles).toEqual([]);
|
|
133
|
-
expect(result.uiContext.candidateUiPages).toEqual([]);
|
|
134
|
-
expect(result.instructions).toMatch(/no UI changes/i);
|
|
135
|
-
fs.rmSync(repo, { recursive: true, force: true });
|
|
136
|
-
});
|
|
137
|
-
it("does NOT recognise .dart files as frontend in a pure Dart project (pubspec without flutter SDK dep)", async () => {
|
|
138
|
-
// pubspec.yaml exists but declares a Dart server (e.g. shelf) — no flutter SDK
|
|
139
|
-
readSpy.mockResolvedValue({ services: [] });
|
|
140
|
-
const repo = makeRepoWithDiff(["bin/server.dart"]);
|
|
141
|
-
fs.writeFileSync(path.join(repo, "pubspec.yaml"), `name: my_dart_server\ndependencies:\n shelf: ^1.4.0\n`);
|
|
142
|
-
const result = await runUiAnalyzeChanges({ repositoryPath: repo });
|
|
143
|
-
expect(result.uiContext.changedFrontendFiles).toEqual([]);
|
|
144
|
-
expect(result.uiContext.candidateUiPages).toEqual([]);
|
|
145
|
-
fs.rmSync(repo, { recursive: true, force: true });
|
|
146
|
-
});
|
|
147
|
-
});
|