@skyramp/mcp 0.2.8 → 0.2.150-rc.ldw
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 +1 -0
- package/build/commands/commandLibrary.js +20 -14
- package/build/commands/commandLibrary.test.d.ts +1 -0
- package/build/commands/commandLibrary.test.js +59 -0
- package/build/commands/localDevTestChangesCommand.d.ts +15 -0
- package/build/commands/localDevTestChangesCommand.js +188 -0
- package/build/index.js +77 -13
- package/build/prompts/enhance-assertions/sharedAssertionRules.d.ts +1 -0
- package/build/prompts/enhance-assertions/sharedAssertionRules.js +17 -0
- package/build/prompts/initialize-workspace/initializeWorkspacePrompt.js +9 -8
- package/build/prompts/local-dev/local-dev-plan.d.ts +25 -0
- package/build/prompts/local-dev/local-dev-plan.js +419 -0
- package/build/prompts/local-dev/local-dev-prompts.d.ts +4 -0
- package/build/prompts/local-dev/local-dev-prompts.js +157 -0
- package/build/prompts/prompt-utils.d.ts +8 -0
- package/build/prompts/prompt-utils.js +33 -0
- 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-recommendation/analysisOutputPrompt.js +21 -29
- package/build/prompts/test-recommendation/analysisOutputPrompt.test.js +0 -28
- package/build/prompts/test-recommendation/test-recommendation-prompt.js +41 -4
- package/build/prompts/test-recommendation/test-recommendation-prompt.test.js +16 -1
- package/build/prompts/testbot/testbot-prompts.d.ts +0 -5
- package/build/prompts/testbot/testbot-prompts.js +4 -34
- package/build/resources/testbotResource.js +2 -1
- package/build/services/AnalyticsService.d.ts +1 -1
- package/build/services/TestExecutionService.d.ts +2 -1
- package/build/services/TestExecutionService.js +15 -10
- package/build/services/TestExecutionService.test.js +75 -1
- package/build/services/TestGenerationService.d.ts +2 -2
- package/build/tool-phases.js +4 -0
- package/build/tools/code-refactor/enhanceAssertionsTool.js +47 -18
- package/build/tools/enrichTestWithMocksTool.d.ts +28 -0
- package/build/tools/enrichTestWithMocksTool.js +726 -0
- package/build/tools/enrichTestWithMocksTool.test.d.ts +1 -0
- package/build/tools/enrichTestWithMocksTool.test.js +266 -0
- package/build/tools/executeSkyrampTestTool.d.ts +4 -0
- package/build/tools/executeSkyrampTestTool.js +48 -24
- package/build/tools/executeSkyrampTestTool.test.d.ts +1 -0
- package/build/tools/executeSkyrampTestTool.test.js +16 -0
- package/build/tools/generate-tests/batchMockGenerationTool.d.ts +85 -0
- package/build/tools/generate-tests/batchMockGenerationTool.js +432 -0
- package/build/tools/generate-tests/generateContractRestTool.js +2 -2
- package/build/tools/generate-tests/generateMockRestTool.d.ts +129 -6
- package/build/tools/generate-tests/generateMockRestTool.js +234 -22
- package/build/tools/generate-tests/loadTestSchema.d.ts +1 -1
- package/build/tools/generateEnrichedIntegrationTestTool.d.ts +24 -0
- package/build/tools/generateEnrichedIntegrationTestTool.js +225 -0
- package/build/tools/generateEnrichedIntegrationTestTool.test.d.ts +1 -0
- package/build/tools/generateEnrichedIntegrationTestTool.test.js +44 -0
- package/build/tools/localDevWorkflowFixes.test.d.ts +1 -0
- package/build/tools/localDevWorkflowFixes.test.js +255 -0
- package/build/tools/one-click/oneClickTool.d.ts +10 -0
- package/build/tools/one-click/oneClickTool.js +177 -21
- package/build/tools/one-click/oneClickTool.test.d.ts +1 -0
- package/build/tools/one-click/oneClickTool.test.js +172 -0
- package/build/tools/preflightMockCheckTool.d.ts +2 -0
- package/build/tools/preflightMockCheckTool.js +96 -0
- package/build/tools/submitReportTool.d.ts +14 -14
- package/build/tools/test-management/analyzeChangesTool.d.ts +2 -1
- package/build/tools/test-management/analyzeChangesTool.js +59 -38
- package/build/tools/trace/startTraceCollectionTool.js +3 -3
- package/build/tools/workspace/initializeWorkspaceTool.js +2 -9
- package/build/tools/workspace/initializeWorkspaceTool.test.js +9 -4
- package/build/types/OneClickCommands.d.ts +1 -1
- package/build/types/RepositoryAnalysis.d.ts +117 -0
- package/build/types/RepositoryAnalysis.js +16 -2
- package/build/types/TestExecution.d.ts +1 -0
- package/build/types/TestTypes.d.ts +20 -8
- package/build/types/TestTypes.js +19 -5
- package/build/utils/analyze-openapi.js +18 -1
- package/build/utils/analyze-openapi.test.d.ts +1 -0
- package/build/utils/analyze-openapi.test.js +19 -0
- package/build/utils/branchDiff.d.ts +17 -1
- package/build/utils/branchDiff.js +96 -14
- package/build/utils/branchDiff.test.d.ts +1 -0
- package/build/utils/branchDiff.test.js +109 -0
- package/build/utils/docker.test.js +1 -1
- package/build/utils/featureFlags.d.ts +20 -1
- package/build/utils/featureFlags.js +26 -2
- package/build/utils/featureFlags.test.js +57 -2
- package/build/utils/grpcMockValidation.d.ts +1 -0
- package/build/utils/grpcMockValidation.js +49 -0
- package/build/utils/grpcMockValidation.test.d.ts +1 -0
- package/build/utils/grpcMockValidation.test.js +41 -0
- package/build/utils/httpMethodValidation.d.ts +4 -0
- package/build/utils/httpMethodValidation.js +13 -0
- package/build/utils/mockCompatibility.d.ts +49 -0
- package/build/utils/mockCompatibility.js +82 -0
- package/build/utils/mockCompatibility.test.d.ts +1 -0
- package/build/utils/mockCompatibility.test.js +79 -0
- package/build/utils/versions.d.ts +3 -3
- package/build/utils/versions.js +1 -1
- package/build/workspace/workspace.d.ts +49 -35
- package/build/workspace/workspace.js +10 -5
- package/build/workspace/workspace.test.js +65 -6
- package/package.json +2 -2
|
@@ -28,22 +28,25 @@ export declare const serviceSchema: z.ZodObject<{
|
|
|
28
28
|
}>>;
|
|
29
29
|
runtimeDetails: z.ZodOptional<z.ZodObject<{
|
|
30
30
|
serverStartCommand: z.ZodOptional<z.ZodString>;
|
|
31
|
-
|
|
31
|
+
serverStopCommand: z.ZodOptional<z.ZodString>;
|
|
32
|
+
runtime: z.ZodEffects<z.ZodNativeEnum<typeof import("../types/TestTypes.js").RuntimeEnvironment>, import("../types/TestTypes.js").RuntimeEnvironment, unknown>;
|
|
32
33
|
dockerNetwork: z.ZodOptional<z.ZodString>;
|
|
33
34
|
k8sNamespace: z.ZodOptional<z.ZodString>;
|
|
34
35
|
k8sContext: z.ZodOptional<z.ZodString>;
|
|
35
36
|
}, "strict", z.ZodTypeAny, {
|
|
36
|
-
runtime: "
|
|
37
|
+
runtime: import("../types/TestTypes.js").RuntimeEnvironment;
|
|
37
38
|
dockerNetwork?: string | undefined;
|
|
38
39
|
k8sNamespace?: string | undefined;
|
|
39
40
|
k8sContext?: string | undefined;
|
|
40
41
|
serverStartCommand?: string | undefined;
|
|
42
|
+
serverStopCommand?: string | undefined;
|
|
41
43
|
}, {
|
|
42
|
-
runtime
|
|
44
|
+
runtime?: unknown;
|
|
43
45
|
dockerNetwork?: string | undefined;
|
|
44
46
|
k8sNamespace?: string | undefined;
|
|
45
47
|
k8sContext?: string | undefined;
|
|
46
48
|
serverStartCommand?: string | undefined;
|
|
49
|
+
serverStopCommand?: string | undefined;
|
|
47
50
|
}>>;
|
|
48
51
|
}, "strict", z.ZodTypeAny, {
|
|
49
52
|
serviceName: string;
|
|
@@ -59,11 +62,12 @@ export declare const serviceSchema: z.ZodObject<{
|
|
|
59
62
|
baseUrl?: string | undefined;
|
|
60
63
|
} | undefined;
|
|
61
64
|
runtimeDetails?: {
|
|
62
|
-
runtime: "
|
|
65
|
+
runtime: import("../types/TestTypes.js").RuntimeEnvironment;
|
|
63
66
|
dockerNetwork?: string | undefined;
|
|
64
67
|
k8sNamespace?: string | undefined;
|
|
65
68
|
k8sContext?: string | undefined;
|
|
66
69
|
serverStartCommand?: string | undefined;
|
|
70
|
+
serverStopCommand?: string | undefined;
|
|
67
71
|
} | undefined;
|
|
68
72
|
}, {
|
|
69
73
|
serviceName: string;
|
|
@@ -79,11 +83,12 @@ export declare const serviceSchema: z.ZodObject<{
|
|
|
79
83
|
baseUrl?: string | undefined;
|
|
80
84
|
} | undefined;
|
|
81
85
|
runtimeDetails?: {
|
|
82
|
-
runtime
|
|
86
|
+
runtime?: unknown;
|
|
83
87
|
dockerNetwork?: string | undefined;
|
|
84
88
|
k8sNamespace?: string | undefined;
|
|
85
89
|
k8sContext?: string | undefined;
|
|
86
90
|
serverStartCommand?: string | undefined;
|
|
91
|
+
serverStopCommand?: string | undefined;
|
|
87
92
|
} | undefined;
|
|
88
93
|
}>;
|
|
89
94
|
export declare const workspaceConfigSchema: z.ZodObject<{
|
|
@@ -99,22 +104,22 @@ export declare const workspaceConfigSchema: z.ZodObject<{
|
|
|
99
104
|
}>>;
|
|
100
105
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
101
106
|
schemaVersion: z.ZodString;
|
|
102
|
-
mcpVersion: z.ZodString
|
|
107
|
+
mcpVersion: z.ZodOptional<z.ZodString>;
|
|
103
108
|
executorVersion: z.ZodString;
|
|
104
|
-
createdAt: z.ZodString
|
|
105
|
-
updatedAt: z.ZodString
|
|
109
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
110
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
106
111
|
}, "strict", z.ZodTypeAny, {
|
|
107
|
-
createdAt: string;
|
|
108
112
|
schemaVersion: string;
|
|
109
|
-
mcpVersion: string;
|
|
110
113
|
executorVersion: string;
|
|
111
|
-
|
|
114
|
+
createdAt?: string | undefined;
|
|
115
|
+
mcpVersion?: string | undefined;
|
|
116
|
+
updatedAt?: string | undefined;
|
|
112
117
|
}, {
|
|
113
|
-
createdAt: string;
|
|
114
118
|
schemaVersion: string;
|
|
115
|
-
mcpVersion: string;
|
|
116
119
|
executorVersion: string;
|
|
117
|
-
|
|
120
|
+
createdAt?: string | undefined;
|
|
121
|
+
mcpVersion?: string | undefined;
|
|
122
|
+
updatedAt?: string | undefined;
|
|
118
123
|
}>>;
|
|
119
124
|
services: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
120
125
|
serviceName: z.ZodString;
|
|
@@ -143,22 +148,25 @@ export declare const workspaceConfigSchema: z.ZodObject<{
|
|
|
143
148
|
}>>;
|
|
144
149
|
runtimeDetails: z.ZodOptional<z.ZodObject<{
|
|
145
150
|
serverStartCommand: z.ZodOptional<z.ZodString>;
|
|
146
|
-
|
|
151
|
+
serverStopCommand: z.ZodOptional<z.ZodString>;
|
|
152
|
+
runtime: z.ZodEffects<z.ZodNativeEnum<typeof import("../types/TestTypes.js").RuntimeEnvironment>, import("../types/TestTypes.js").RuntimeEnvironment, unknown>;
|
|
147
153
|
dockerNetwork: z.ZodOptional<z.ZodString>;
|
|
148
154
|
k8sNamespace: z.ZodOptional<z.ZodString>;
|
|
149
155
|
k8sContext: z.ZodOptional<z.ZodString>;
|
|
150
156
|
}, "strict", z.ZodTypeAny, {
|
|
151
|
-
runtime: "
|
|
157
|
+
runtime: import("../types/TestTypes.js").RuntimeEnvironment;
|
|
152
158
|
dockerNetwork?: string | undefined;
|
|
153
159
|
k8sNamespace?: string | undefined;
|
|
154
160
|
k8sContext?: string | undefined;
|
|
155
161
|
serverStartCommand?: string | undefined;
|
|
162
|
+
serverStopCommand?: string | undefined;
|
|
156
163
|
}, {
|
|
157
|
-
runtime
|
|
164
|
+
runtime?: unknown;
|
|
158
165
|
dockerNetwork?: string | undefined;
|
|
159
166
|
k8sNamespace?: string | undefined;
|
|
160
167
|
k8sContext?: string | undefined;
|
|
161
168
|
serverStartCommand?: string | undefined;
|
|
169
|
+
serverStopCommand?: string | undefined;
|
|
162
170
|
}>>;
|
|
163
171
|
}, "strict", z.ZodTypeAny, {
|
|
164
172
|
serviceName: string;
|
|
@@ -174,11 +182,12 @@ export declare const workspaceConfigSchema: z.ZodObject<{
|
|
|
174
182
|
baseUrl?: string | undefined;
|
|
175
183
|
} | undefined;
|
|
176
184
|
runtimeDetails?: {
|
|
177
|
-
runtime: "
|
|
185
|
+
runtime: import("../types/TestTypes.js").RuntimeEnvironment;
|
|
178
186
|
dockerNetwork?: string | undefined;
|
|
179
187
|
k8sNamespace?: string | undefined;
|
|
180
188
|
k8sContext?: string | undefined;
|
|
181
189
|
serverStartCommand?: string | undefined;
|
|
190
|
+
serverStopCommand?: string | undefined;
|
|
182
191
|
} | undefined;
|
|
183
192
|
}, {
|
|
184
193
|
serviceName: string;
|
|
@@ -194,20 +203,21 @@ export declare const workspaceConfigSchema: z.ZodObject<{
|
|
|
194
203
|
baseUrl?: string | undefined;
|
|
195
204
|
} | undefined;
|
|
196
205
|
runtimeDetails?: {
|
|
197
|
-
runtime
|
|
206
|
+
runtime?: unknown;
|
|
198
207
|
dockerNetwork?: string | undefined;
|
|
199
208
|
k8sNamespace?: string | undefined;
|
|
200
209
|
k8sContext?: string | undefined;
|
|
201
210
|
serverStartCommand?: string | undefined;
|
|
211
|
+
serverStopCommand?: string | undefined;
|
|
202
212
|
} | undefined;
|
|
203
213
|
}>, "many">>;
|
|
204
214
|
}, "strict", z.ZodTypeAny, {
|
|
205
215
|
metadata?: {
|
|
206
|
-
createdAt: string;
|
|
207
216
|
schemaVersion: string;
|
|
208
|
-
mcpVersion: string;
|
|
209
217
|
executorVersion: string;
|
|
210
|
-
|
|
218
|
+
createdAt?: string | undefined;
|
|
219
|
+
mcpVersion?: string | undefined;
|
|
220
|
+
updatedAt?: string | undefined;
|
|
211
221
|
} | undefined;
|
|
212
222
|
workspace?: {
|
|
213
223
|
repoName?: string | undefined;
|
|
@@ -227,20 +237,21 @@ export declare const workspaceConfigSchema: z.ZodObject<{
|
|
|
227
237
|
baseUrl?: string | undefined;
|
|
228
238
|
} | undefined;
|
|
229
239
|
runtimeDetails?: {
|
|
230
|
-
runtime: "
|
|
240
|
+
runtime: import("../types/TestTypes.js").RuntimeEnvironment;
|
|
231
241
|
dockerNetwork?: string | undefined;
|
|
232
242
|
k8sNamespace?: string | undefined;
|
|
233
243
|
k8sContext?: string | undefined;
|
|
234
244
|
serverStartCommand?: string | undefined;
|
|
245
|
+
serverStopCommand?: string | undefined;
|
|
235
246
|
} | undefined;
|
|
236
247
|
}[] | undefined;
|
|
237
248
|
}, {
|
|
238
249
|
metadata?: {
|
|
239
|
-
createdAt: string;
|
|
240
250
|
schemaVersion: string;
|
|
241
|
-
mcpVersion: string;
|
|
242
251
|
executorVersion: string;
|
|
243
|
-
|
|
252
|
+
createdAt?: string | undefined;
|
|
253
|
+
mcpVersion?: string | undefined;
|
|
254
|
+
updatedAt?: string | undefined;
|
|
244
255
|
} | undefined;
|
|
245
256
|
workspace?: {
|
|
246
257
|
repoName?: string | undefined;
|
|
@@ -260,11 +271,12 @@ export declare const workspaceConfigSchema: z.ZodObject<{
|
|
|
260
271
|
baseUrl?: string | undefined;
|
|
261
272
|
} | undefined;
|
|
262
273
|
runtimeDetails?: {
|
|
263
|
-
runtime
|
|
274
|
+
runtime?: unknown;
|
|
264
275
|
dockerNetwork?: string | undefined;
|
|
265
276
|
k8sNamespace?: string | undefined;
|
|
266
277
|
k8sContext?: string | undefined;
|
|
267
278
|
serverStartCommand?: string | undefined;
|
|
279
|
+
serverStopCommand?: string | undefined;
|
|
268
280
|
} | undefined;
|
|
269
281
|
}[] | undefined;
|
|
270
282
|
}>;
|
|
@@ -277,11 +289,11 @@ export type MetadataSection = NonNullable<WorkspaceConfig["metadata"]>;
|
|
|
277
289
|
/** Validates a workspace configuration object against the Zod schema. */
|
|
278
290
|
export declare function validateWorkspaceConfig(config: unknown): z.SafeParseReturnType<{
|
|
279
291
|
metadata?: {
|
|
280
|
-
createdAt: string;
|
|
281
292
|
schemaVersion: string;
|
|
282
|
-
mcpVersion: string;
|
|
283
293
|
executorVersion: string;
|
|
284
|
-
|
|
294
|
+
createdAt?: string | undefined;
|
|
295
|
+
mcpVersion?: string | undefined;
|
|
296
|
+
updatedAt?: string | undefined;
|
|
285
297
|
} | undefined;
|
|
286
298
|
workspace?: {
|
|
287
299
|
repoName?: string | undefined;
|
|
@@ -301,20 +313,21 @@ export declare function validateWorkspaceConfig(config: unknown): z.SafeParseRet
|
|
|
301
313
|
baseUrl?: string | undefined;
|
|
302
314
|
} | undefined;
|
|
303
315
|
runtimeDetails?: {
|
|
304
|
-
runtime
|
|
316
|
+
runtime?: unknown;
|
|
305
317
|
dockerNetwork?: string | undefined;
|
|
306
318
|
k8sNamespace?: string | undefined;
|
|
307
319
|
k8sContext?: string | undefined;
|
|
308
320
|
serverStartCommand?: string | undefined;
|
|
321
|
+
serverStopCommand?: string | undefined;
|
|
309
322
|
} | undefined;
|
|
310
323
|
}[] | undefined;
|
|
311
324
|
}, {
|
|
312
325
|
metadata?: {
|
|
313
|
-
createdAt: string;
|
|
314
326
|
schemaVersion: string;
|
|
315
|
-
mcpVersion: string;
|
|
316
327
|
executorVersion: string;
|
|
317
|
-
|
|
328
|
+
createdAt?: string | undefined;
|
|
329
|
+
mcpVersion?: string | undefined;
|
|
330
|
+
updatedAt?: string | undefined;
|
|
318
331
|
} | undefined;
|
|
319
332
|
workspace?: {
|
|
320
333
|
repoName?: string | undefined;
|
|
@@ -334,11 +347,12 @@ export declare function validateWorkspaceConfig(config: unknown): z.SafeParseRet
|
|
|
334
347
|
baseUrl?: string | undefined;
|
|
335
348
|
} | undefined;
|
|
336
349
|
runtimeDetails?: {
|
|
337
|
-
runtime: "
|
|
350
|
+
runtime: import("../types/TestTypes.js").RuntimeEnvironment;
|
|
338
351
|
dockerNetwork?: string | undefined;
|
|
339
352
|
k8sNamespace?: string | undefined;
|
|
340
353
|
k8sContext?: string | undefined;
|
|
341
354
|
serverStartCommand?: string | undefined;
|
|
355
|
+
serverStopCommand?: string | undefined;
|
|
342
356
|
} | undefined;
|
|
343
357
|
}[] | undefined;
|
|
344
358
|
}>;
|
|
@@ -14,6 +14,7 @@ import { execFile } from "child_process";
|
|
|
14
14
|
import { promisify } from "util";
|
|
15
15
|
import yaml from "js-yaml";
|
|
16
16
|
import { z } from "zod";
|
|
17
|
+
import { runtimeEnvironmentInputSchema } from "../types/TestTypes.js";
|
|
17
18
|
const execFileAsync = promisify(execFile);
|
|
18
19
|
// ---------------------------------------------------------------------------
|
|
19
20
|
// Constants
|
|
@@ -57,7 +58,8 @@ export const serviceSchema = z
|
|
|
57
58
|
runtimeDetails: z
|
|
58
59
|
.object({
|
|
59
60
|
serverStartCommand: z.string().optional(),
|
|
60
|
-
|
|
61
|
+
serverStopCommand: z.string().optional(),
|
|
62
|
+
runtime: runtimeEnvironmentInputSchema,
|
|
61
63
|
dockerNetwork: z.string().optional(),
|
|
62
64
|
k8sNamespace: z.string().optional(),
|
|
63
65
|
k8sContext: z.string().optional(),
|
|
@@ -78,10 +80,14 @@ export const workspaceConfigSchema = z
|
|
|
78
80
|
metadata: z
|
|
79
81
|
.object({
|
|
80
82
|
schemaVersion: z.string(),
|
|
81
|
-
mcpVersion
|
|
83
|
+
// mcpVersion is no longer written by skyramp_init_workspace (SKYR-3818), but
|
|
84
|
+
// remains an optional, recognized key: testbot reads it from pre-existing
|
|
85
|
+
// workspaces as a fallback MCP-version pin (testbot.git src/config.ts), and
|
|
86
|
+
// older files still carry it. Optional so configs without it validate.
|
|
87
|
+
mcpVersion: z.string().optional(),
|
|
82
88
|
executorVersion: z.string(),
|
|
83
|
-
createdAt: z.string(),
|
|
84
|
-
updatedAt: z.string(),
|
|
89
|
+
createdAt: z.string().optional(),
|
|
90
|
+
updatedAt: z.string().optional(),
|
|
85
91
|
})
|
|
86
92
|
.strict()
|
|
87
93
|
.optional(),
|
|
@@ -121,7 +127,6 @@ export function createDefaultConfig() {
|
|
|
121
127
|
workspace: {},
|
|
122
128
|
metadata: {
|
|
123
129
|
schemaVersion: "v1",
|
|
124
|
-
mcpVersion: "",
|
|
125
130
|
executorVersion: "",
|
|
126
131
|
createdAt: now,
|
|
127
132
|
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.150-rc.ldw",
|
|
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",
|