@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.
Files changed (99) hide show
  1. package/build/commands/commandLibrary.d.ts +1 -0
  2. package/build/commands/commandLibrary.js +20 -14
  3. package/build/commands/commandLibrary.test.d.ts +1 -0
  4. package/build/commands/commandLibrary.test.js +59 -0
  5. package/build/commands/localDevTestChangesCommand.d.ts +15 -0
  6. package/build/commands/localDevTestChangesCommand.js +188 -0
  7. package/build/index.js +77 -13
  8. package/build/prompts/enhance-assertions/sharedAssertionRules.d.ts +1 -0
  9. package/build/prompts/enhance-assertions/sharedAssertionRules.js +17 -0
  10. package/build/prompts/initialize-workspace/initializeWorkspacePrompt.js +9 -8
  11. package/build/prompts/local-dev/local-dev-plan.d.ts +25 -0
  12. package/build/prompts/local-dev/local-dev-plan.js +419 -0
  13. package/build/prompts/local-dev/local-dev-prompts.d.ts +4 -0
  14. package/build/prompts/local-dev/local-dev-prompts.js +157 -0
  15. package/build/prompts/prompt-utils.d.ts +8 -0
  16. package/build/prompts/prompt-utils.js +33 -0
  17. package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.js +3 -1
  18. package/build/prompts/sut-setup/modes/dockerComposePrompt.js +3 -1
  19. package/build/prompts/sut-setup/shared.d.ts +20 -0
  20. package/build/prompts/sut-setup/shared.js +69 -7
  21. package/build/prompts/test-recommendation/analysisOutputPrompt.js +21 -29
  22. package/build/prompts/test-recommendation/analysisOutputPrompt.test.js +0 -28
  23. package/build/prompts/test-recommendation/test-recommendation-prompt.js +41 -4
  24. package/build/prompts/test-recommendation/test-recommendation-prompt.test.js +16 -1
  25. package/build/prompts/testbot/testbot-prompts.d.ts +0 -5
  26. package/build/prompts/testbot/testbot-prompts.js +4 -34
  27. package/build/resources/testbotResource.js +2 -1
  28. package/build/services/AnalyticsService.d.ts +1 -1
  29. package/build/services/TestExecutionService.d.ts +2 -1
  30. package/build/services/TestExecutionService.js +15 -10
  31. package/build/services/TestExecutionService.test.js +75 -1
  32. package/build/services/TestGenerationService.d.ts +2 -2
  33. package/build/tool-phases.js +4 -0
  34. package/build/tools/code-refactor/enhanceAssertionsTool.js +47 -18
  35. package/build/tools/enrichTestWithMocksTool.d.ts +28 -0
  36. package/build/tools/enrichTestWithMocksTool.js +726 -0
  37. package/build/tools/enrichTestWithMocksTool.test.d.ts +1 -0
  38. package/build/tools/enrichTestWithMocksTool.test.js +266 -0
  39. package/build/tools/executeSkyrampTestTool.d.ts +4 -0
  40. package/build/tools/executeSkyrampTestTool.js +48 -24
  41. package/build/tools/executeSkyrampTestTool.test.d.ts +1 -0
  42. package/build/tools/executeSkyrampTestTool.test.js +16 -0
  43. package/build/tools/generate-tests/batchMockGenerationTool.d.ts +85 -0
  44. package/build/tools/generate-tests/batchMockGenerationTool.js +432 -0
  45. package/build/tools/generate-tests/generateContractRestTool.js +2 -2
  46. package/build/tools/generate-tests/generateMockRestTool.d.ts +129 -6
  47. package/build/tools/generate-tests/generateMockRestTool.js +234 -22
  48. package/build/tools/generate-tests/loadTestSchema.d.ts +1 -1
  49. package/build/tools/generateEnrichedIntegrationTestTool.d.ts +24 -0
  50. package/build/tools/generateEnrichedIntegrationTestTool.js +225 -0
  51. package/build/tools/generateEnrichedIntegrationTestTool.test.d.ts +1 -0
  52. package/build/tools/generateEnrichedIntegrationTestTool.test.js +44 -0
  53. package/build/tools/localDevWorkflowFixes.test.d.ts +1 -0
  54. package/build/tools/localDevWorkflowFixes.test.js +255 -0
  55. package/build/tools/one-click/oneClickTool.d.ts +10 -0
  56. package/build/tools/one-click/oneClickTool.js +177 -21
  57. package/build/tools/one-click/oneClickTool.test.d.ts +1 -0
  58. package/build/tools/one-click/oneClickTool.test.js +172 -0
  59. package/build/tools/preflightMockCheckTool.d.ts +2 -0
  60. package/build/tools/preflightMockCheckTool.js +96 -0
  61. package/build/tools/submitReportTool.d.ts +14 -14
  62. package/build/tools/test-management/analyzeChangesTool.d.ts +2 -1
  63. package/build/tools/test-management/analyzeChangesTool.js +59 -38
  64. package/build/tools/trace/startTraceCollectionTool.js +3 -3
  65. package/build/tools/workspace/initializeWorkspaceTool.js +2 -9
  66. package/build/tools/workspace/initializeWorkspaceTool.test.js +9 -4
  67. package/build/types/OneClickCommands.d.ts +1 -1
  68. package/build/types/RepositoryAnalysis.d.ts +117 -0
  69. package/build/types/RepositoryAnalysis.js +16 -2
  70. package/build/types/TestExecution.d.ts +1 -0
  71. package/build/types/TestTypes.d.ts +20 -8
  72. package/build/types/TestTypes.js +19 -5
  73. package/build/utils/analyze-openapi.js +18 -1
  74. package/build/utils/analyze-openapi.test.d.ts +1 -0
  75. package/build/utils/analyze-openapi.test.js +19 -0
  76. package/build/utils/branchDiff.d.ts +17 -1
  77. package/build/utils/branchDiff.js +96 -14
  78. package/build/utils/branchDiff.test.d.ts +1 -0
  79. package/build/utils/branchDiff.test.js +109 -0
  80. package/build/utils/docker.test.js +1 -1
  81. package/build/utils/featureFlags.d.ts +20 -1
  82. package/build/utils/featureFlags.js +26 -2
  83. package/build/utils/featureFlags.test.js +57 -2
  84. package/build/utils/grpcMockValidation.d.ts +1 -0
  85. package/build/utils/grpcMockValidation.js +49 -0
  86. package/build/utils/grpcMockValidation.test.d.ts +1 -0
  87. package/build/utils/grpcMockValidation.test.js +41 -0
  88. package/build/utils/httpMethodValidation.d.ts +4 -0
  89. package/build/utils/httpMethodValidation.js +13 -0
  90. package/build/utils/mockCompatibility.d.ts +49 -0
  91. package/build/utils/mockCompatibility.js +82 -0
  92. package/build/utils/mockCompatibility.test.d.ts +1 -0
  93. package/build/utils/mockCompatibility.test.js +79 -0
  94. package/build/utils/versions.d.ts +3 -3
  95. package/build/utils/versions.js +1 -1
  96. package/build/workspace/workspace.d.ts +49 -35
  97. package/build/workspace/workspace.js +10 -5
  98. package/build/workspace/workspace.test.js +65 -6
  99. 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
- runtime: z.ZodEnum<["local", "docker", "k8s"]>;
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: "local" | "docker" | "k8s";
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: "local" | "docker" | "k8s";
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: "local" | "docker" | "k8s";
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: "local" | "docker" | "k8s";
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
- updatedAt: string;
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
- updatedAt: string;
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
- runtime: z.ZodEnum<["local", "docker", "k8s"]>;
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: "local" | "docker" | "k8s";
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: "local" | "docker" | "k8s";
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: "local" | "docker" | "k8s";
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: "local" | "docker" | "k8s";
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
- updatedAt: string;
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: "local" | "docker" | "k8s";
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
- updatedAt: string;
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: "local" | "docker" | "k8s";
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
- updatedAt: string;
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: "local" | "docker" | "k8s";
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
- updatedAt: string;
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: "local" | "docker" | "k8s";
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
- runtime: z.enum(["local", "docker", "k8s"]),
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: z.string(),
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" }).success).toBe(true);
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 }).success).toBe(false);
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({ serviceName: "svc", testDirectory: "tests/primary" });
45
- await mgr.addService({ serviceName: "svc", repository: "letsramp/api-insight", testDirectory: "tests/py" });
46
- await mgr.addService({ serviceName: "svc", testDirectory: "tests/primary-v2" }); // upsert primary
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").testDirectory).toBe("tests/py");
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.8",
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.29",
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",