@skyramp/mcp 0.2.8 → 0.2.9
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/index.js +0 -7
- package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.js +3 -1
- package/build/prompts/sut-setup/modes/dockerComposePrompt.js +3 -1
- package/build/prompts/sut-setup/shared.d.ts +20 -0
- package/build/prompts/sut-setup/shared.js +69 -7
- package/build/prompts/test-maintenance/actionsInstructions.js +5 -1
- package/build/prompts/test-maintenance/drift-analysis-prompt.d.ts +15 -2
- package/build/prompts/test-maintenance/drift-analysis-prompt.js +58 -3
- package/build/prompts/test-maintenance/driftAnalysisSections.js +7 -22
- package/build/prompts/test-maintenance/driftAnalysisShared.d.ts +14 -0
- package/build/prompts/test-maintenance/driftAnalysisShared.js +62 -0
- package/build/prompts/test-maintenance/uiDriftAnalysisSections.d.ts +38 -0
- package/build/prompts/test-maintenance/uiDriftAnalysisSections.js +228 -0
- package/build/prompts/test-recommendation/scopeAssessment.js +12 -2
- package/build/prompts/testbot/testbot-prompts.js +3 -2
- package/build/services/TestDiscoveryService.d.ts +12 -9
- package/build/services/TestDiscoveryService.js +125 -51
- package/build/services/TestDiscoveryService.test.js +235 -15
- package/build/services/TestExecutionService.d.ts +1 -1
- package/build/services/TestExecutionService.js +7 -7
- package/build/services/TestExecutionService.test.js +4 -1
- package/build/tools/submitReportTool.d.ts +5 -5
- package/build/tools/submitReportTool.js +11 -4
- package/build/tools/submitReportTool.test.js +2 -0
- package/build/tools/test-management/actionsTool.js +54 -36
- package/build/tools/test-management/analyzeChangesTool.js +11 -17
- package/build/tools/test-management/analyzeTestHealthTool.js +182 -8
- package/build/tools/test-management/analyzeTestHealthTool.test.d.ts +1 -0
- package/build/tools/test-management/analyzeTestHealthTool.test.js +468 -0
- package/build/tools/workspace/initializeWorkspaceTool.js +2 -9
- package/build/tools/workspace/initializeWorkspaceTool.test.js +9 -4
- package/build/types/TestAnalysis.d.ts +3 -0
- package/build/types/TestbotReport.d.ts +1 -1
- package/build/utils/AnalysisStateManager.d.ts +3 -21
- package/build/utils/docker.test.js +1 -1
- package/build/utils/versions.d.ts +3 -3
- package/build/utils/versions.js +1 -1
- package/build/workspace/workspace.d.ts +21 -21
- package/build/workspace/workspace.js +7 -4
- package/build/workspace/workspace.test.js +65 -6
- package/package.json +2 -2
|
@@ -99,22 +99,22 @@ export declare const workspaceConfigSchema: z.ZodObject<{
|
|
|
99
99
|
}>>;
|
|
100
100
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
101
101
|
schemaVersion: z.ZodString;
|
|
102
|
-
mcpVersion: z.ZodString
|
|
102
|
+
mcpVersion: z.ZodOptional<z.ZodString>;
|
|
103
103
|
executorVersion: z.ZodString;
|
|
104
|
-
createdAt: z.ZodString
|
|
105
|
-
updatedAt: z.ZodString
|
|
104
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
105
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
106
106
|
}, "strict", z.ZodTypeAny, {
|
|
107
|
-
createdAt: string;
|
|
108
107
|
schemaVersion: string;
|
|
109
|
-
mcpVersion: string;
|
|
110
108
|
executorVersion: string;
|
|
111
|
-
|
|
109
|
+
createdAt?: string | undefined;
|
|
110
|
+
mcpVersion?: string | undefined;
|
|
111
|
+
updatedAt?: string | undefined;
|
|
112
112
|
}, {
|
|
113
|
-
createdAt: string;
|
|
114
113
|
schemaVersion: string;
|
|
115
|
-
mcpVersion: string;
|
|
116
114
|
executorVersion: string;
|
|
117
|
-
|
|
115
|
+
createdAt?: string | undefined;
|
|
116
|
+
mcpVersion?: string | undefined;
|
|
117
|
+
updatedAt?: string | undefined;
|
|
118
118
|
}>>;
|
|
119
119
|
services: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
120
120
|
serviceName: z.ZodString;
|
|
@@ -203,11 +203,11 @@ export declare const workspaceConfigSchema: z.ZodObject<{
|
|
|
203
203
|
}>, "many">>;
|
|
204
204
|
}, "strict", z.ZodTypeAny, {
|
|
205
205
|
metadata?: {
|
|
206
|
-
createdAt: string;
|
|
207
206
|
schemaVersion: string;
|
|
208
|
-
mcpVersion: string;
|
|
209
207
|
executorVersion: string;
|
|
210
|
-
|
|
208
|
+
createdAt?: string | undefined;
|
|
209
|
+
mcpVersion?: string | undefined;
|
|
210
|
+
updatedAt?: string | undefined;
|
|
211
211
|
} | undefined;
|
|
212
212
|
workspace?: {
|
|
213
213
|
repoName?: string | undefined;
|
|
@@ -236,11 +236,11 @@ export declare const workspaceConfigSchema: z.ZodObject<{
|
|
|
236
236
|
}[] | undefined;
|
|
237
237
|
}, {
|
|
238
238
|
metadata?: {
|
|
239
|
-
createdAt: string;
|
|
240
239
|
schemaVersion: string;
|
|
241
|
-
mcpVersion: string;
|
|
242
240
|
executorVersion: string;
|
|
243
|
-
|
|
241
|
+
createdAt?: string | undefined;
|
|
242
|
+
mcpVersion?: string | undefined;
|
|
243
|
+
updatedAt?: string | undefined;
|
|
244
244
|
} | undefined;
|
|
245
245
|
workspace?: {
|
|
246
246
|
repoName?: string | undefined;
|
|
@@ -277,11 +277,11 @@ export type MetadataSection = NonNullable<WorkspaceConfig["metadata"]>;
|
|
|
277
277
|
/** Validates a workspace configuration object against the Zod schema. */
|
|
278
278
|
export declare function validateWorkspaceConfig(config: unknown): z.SafeParseReturnType<{
|
|
279
279
|
metadata?: {
|
|
280
|
-
createdAt: string;
|
|
281
280
|
schemaVersion: string;
|
|
282
|
-
mcpVersion: string;
|
|
283
281
|
executorVersion: string;
|
|
284
|
-
|
|
282
|
+
createdAt?: string | undefined;
|
|
283
|
+
mcpVersion?: string | undefined;
|
|
284
|
+
updatedAt?: string | undefined;
|
|
285
285
|
} | undefined;
|
|
286
286
|
workspace?: {
|
|
287
287
|
repoName?: string | undefined;
|
|
@@ -310,11 +310,11 @@ export declare function validateWorkspaceConfig(config: unknown): z.SafeParseRet
|
|
|
310
310
|
}[] | undefined;
|
|
311
311
|
}, {
|
|
312
312
|
metadata?: {
|
|
313
|
-
createdAt: string;
|
|
314
313
|
schemaVersion: string;
|
|
315
|
-
mcpVersion: string;
|
|
316
314
|
executorVersion: string;
|
|
317
|
-
|
|
315
|
+
createdAt?: string | undefined;
|
|
316
|
+
mcpVersion?: string | undefined;
|
|
317
|
+
updatedAt?: string | undefined;
|
|
318
318
|
} | undefined;
|
|
319
319
|
workspace?: {
|
|
320
320
|
repoName?: string | undefined;
|
|
@@ -78,10 +78,14 @@ export const workspaceConfigSchema = z
|
|
|
78
78
|
metadata: z
|
|
79
79
|
.object({
|
|
80
80
|
schemaVersion: z.string(),
|
|
81
|
-
mcpVersion
|
|
81
|
+
// mcpVersion is no longer written by skyramp_init_workspace (SKYR-3818), but
|
|
82
|
+
// remains an optional, recognized key: testbot reads it from pre-existing
|
|
83
|
+
// workspaces as a fallback MCP-version pin (testbot.git src/config.ts), and
|
|
84
|
+
// older files still carry it. Optional so configs without it validate.
|
|
85
|
+
mcpVersion: z.string().optional(),
|
|
82
86
|
executorVersion: z.string(),
|
|
83
|
-
createdAt: z.string(),
|
|
84
|
-
updatedAt: z.string(),
|
|
87
|
+
createdAt: z.string().optional(),
|
|
88
|
+
updatedAt: z.string().optional(),
|
|
85
89
|
})
|
|
86
90
|
.strict()
|
|
87
91
|
.optional(),
|
|
@@ -121,7 +125,6 @@ export function createDefaultConfig() {
|
|
|
121
125
|
workspace: {},
|
|
122
126
|
metadata: {
|
|
123
127
|
schemaVersion: "v1",
|
|
124
|
-
mcpVersion: "",
|
|
125
128
|
executorVersion: "",
|
|
126
129
|
createdAt: now,
|
|
127
130
|
updatedAt: now,
|
|
@@ -7,9 +7,11 @@ import { serviceSchema, WorkspaceConfigManager, validateWorkspaceConfig, createD
|
|
|
7
7
|
describe("workspace module (ported from @skyramp/skyramp, SKYR-3794)", () => {
|
|
8
8
|
describe("serviceSchema", () => {
|
|
9
9
|
it("accepts an optional repository and rejects a non-string repository", () => {
|
|
10
|
-
expect(serviceSchema.safeParse({ serviceName: "api", repository: "org/api" })
|
|
10
|
+
expect(serviceSchema.safeParse({ serviceName: "api", repository: "org/api" })
|
|
11
|
+
.success).toBe(true);
|
|
11
12
|
expect(serviceSchema.safeParse({ serviceName: "api" }).success).toBe(true);
|
|
12
|
-
expect(serviceSchema.safeParse({ serviceName: "api", repository: 123 })
|
|
13
|
+
expect(serviceSchema.safeParse({ serviceName: "api", repository: 123 })
|
|
14
|
+
.success).toBe(false);
|
|
13
15
|
});
|
|
14
16
|
it("rejects unknown fields (strict)", () => {
|
|
15
17
|
expect(serviceSchema.safeParse({ serviceName: "api", bogus: true }).success).toBe(false);
|
|
@@ -41,15 +43,72 @@ describe("workspace module (ported from @skyramp/skyramp, SKYR-3794)", () => {
|
|
|
41
43
|
it("keeps a same-named service from a different repo distinct, and upserts in place", async () => {
|
|
42
44
|
const mgr = new WorkspaceConfigManager(repoDir);
|
|
43
45
|
await mgr.initialize();
|
|
44
|
-
await mgr.addService({
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
await mgr.addService({
|
|
47
|
+
serviceName: "svc",
|
|
48
|
+
testDirectory: "tests/primary",
|
|
49
|
+
});
|
|
50
|
+
await mgr.addService({
|
|
51
|
+
serviceName: "svc",
|
|
52
|
+
repository: "letsramp/api-insight",
|
|
53
|
+
testDirectory: "tests/py",
|
|
54
|
+
});
|
|
55
|
+
await mgr.addService({
|
|
56
|
+
serviceName: "svc",
|
|
57
|
+
testDirectory: "tests/primary-v2",
|
|
58
|
+
}); // upsert primary
|
|
47
59
|
const cfg = read();
|
|
48
60
|
expect(cfg.services).toHaveLength(2);
|
|
49
61
|
expect(cfg.services.find((s) => !s.repository).testDirectory).toBe("tests/primary-v2");
|
|
50
|
-
expect(cfg.services.find((s) => s.repository === "letsramp/api-insight")
|
|
62
|
+
expect(cfg.services.find((s) => s.repository === "letsramp/api-insight")
|
|
63
|
+
.testDirectory).toBe("tests/py");
|
|
51
64
|
// repoName auto-detected from the git remote.
|
|
52
65
|
expect(cfg.workspace.repoName).toBe("letsramp/primary");
|
|
53
66
|
});
|
|
54
67
|
});
|
|
68
|
+
describe("mcpVersion: no longer written, still accepted (SKYR-3818)", () => {
|
|
69
|
+
let repoDir;
|
|
70
|
+
beforeEach(() => {
|
|
71
|
+
repoDir = fs.mkdtempSync(path.join(os.tmpdir(), "ws-mcpver-"));
|
|
72
|
+
execFileSync("git", ["init", "-q"], { cwd: repoDir });
|
|
73
|
+
execFileSync("git", ["remote", "add", "origin", "https://github.com/letsramp/primary.git"], { cwd: repoDir });
|
|
74
|
+
});
|
|
75
|
+
afterEach(() => {
|
|
76
|
+
fs.rmSync(repoDir, { recursive: true, force: true });
|
|
77
|
+
});
|
|
78
|
+
// Writes a workspace.yml that carries metadata.mcpVersion, emulating a workspace
|
|
79
|
+
// initialized by an older MCP version (which still stamped the field).
|
|
80
|
+
const writeLegacyConfig = () => {
|
|
81
|
+
const dir = path.join(repoDir, WORKSPACE_DIR);
|
|
82
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
83
|
+
const now = new Date().toISOString();
|
|
84
|
+
const legacy = {
|
|
85
|
+
workspace: { repoName: "letsramp/primary" },
|
|
86
|
+
metadata: {
|
|
87
|
+
schemaVersion: "v1",
|
|
88
|
+
mcpVersion: "0.0.64",
|
|
89
|
+
executorVersion: "1.2.3",
|
|
90
|
+
createdAt: now,
|
|
91
|
+
updatedAt: now,
|
|
92
|
+
},
|
|
93
|
+
services: [],
|
|
94
|
+
};
|
|
95
|
+
fs.writeFileSync(path.join(dir, WORKSPACE_FILENAME), yaml.dump(legacy), "utf8");
|
|
96
|
+
};
|
|
97
|
+
const readRaw = () => yaml.load(fs.readFileSync(path.join(repoDir, WORKSPACE_DIR, WORKSPACE_FILENAME), "utf8"), { schema: yaml.JSON_SCHEMA });
|
|
98
|
+
it("does not write mcpVersion into a freshly initialized workspace", async () => {
|
|
99
|
+
const mgr = new WorkspaceConfigManager(repoDir);
|
|
100
|
+
await mgr.initialize();
|
|
101
|
+
const onDisk = readRaw();
|
|
102
|
+
expect(onDisk.metadata.mcpVersion).toBeUndefined();
|
|
103
|
+
});
|
|
104
|
+
it("preserves mcpVersion from a pre-existing workspace.yml on read (testbot fallback)", async () => {
|
|
105
|
+
writeLegacyConfig();
|
|
106
|
+
const mgr = new WorkspaceConfigManager(repoDir);
|
|
107
|
+
const cfg = await mgr.read();
|
|
108
|
+
// Kept as an optional recognized key — not stripped — so testbot's
|
|
109
|
+
// config.ts MCP-version fallback keeps working for existing workspaces.
|
|
110
|
+
expect(cfg.metadata?.mcpVersion).toBe("0.0.64");
|
|
111
|
+
expect(cfg.metadata?.executorVersion).toBe("1.2.3");
|
|
112
|
+
});
|
|
113
|
+
});
|
|
55
114
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyramp/mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./build/index.js",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@modelcontextprotocol/sdk": "^1.24.3",
|
|
69
69
|
"@playwright/test": "^1.55.0",
|
|
70
|
-
"@skyramp/skyramp": "1.3.
|
|
70
|
+
"@skyramp/skyramp": "1.3.30",
|
|
71
71
|
"dockerode": "^5.0.0",
|
|
72
72
|
"fast-glob": "^3.3.3",
|
|
73
73
|
"js-yaml": "^4.1.1",
|