@testchimp/cli 0.1.25 → 0.1.26

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.
@@ -284,15 +284,33 @@ export function buildCliProgram() {
284
284
  .description(TOOL_DEFINITIONS.find((t) => t.kebab === "get-test-scenarios").description)
285
285
  .addOption(jsonInputOption())
286
286
  .option("--scenario-ordinal-ids <csv>", "comma-separated TS-<n> numeric ids")
287
+ .option("--external-ids <csv>", "comma-separated external TMS ids (e.g. C12345,PROJ-101); server matches exact then numerical part")
287
288
  .action(async (opts) => {
288
289
  const body = {};
289
290
  if (opts.scenarioOrdinalIds) {
290
- body.scenarioOrdinalIds = String(opts.scenarioOrdinalIds)
291
+ const ids = String(opts.scenarioOrdinalIds)
291
292
  .split(",")
292
293
  .map((s) => Number(s.trim()))
293
294
  .filter((n) => Number.isFinite(n) && n > 0);
295
+ if (ids.length > 0)
296
+ body.scenarioOrdinalIds = ids;
297
+ }
298
+ if (opts.externalIds) {
299
+ const ids = String(opts.externalIds)
300
+ .split(",")
301
+ .map((s) => s.trim())
302
+ .filter((s) => s.length > 0);
303
+ if (ids.length > 0)
304
+ body.externalIds = ids;
294
305
  }
295
306
  const merged = mergeBodies(body, opts.jsonInput);
307
+ // Drop empty arrays so refine / merge with json-input does not fail misleadingly.
308
+ if (Array.isArray(merged.scenarioOrdinalIds) && merged.scenarioOrdinalIds.length === 0) {
309
+ delete merged.scenarioOrdinalIds;
310
+ }
311
+ if (Array.isArray(merged.externalIds) && merged.externalIds.length === 0) {
312
+ delete merged.externalIds;
313
+ }
296
314
  const out = await runTool("get-test-scenarios", merged, { postMcp });
297
315
  console.log(out);
298
316
  });
@@ -226,7 +226,8 @@ export declare const getUserStoriesInput: z.ZodObject<{
226
226
  userStoryOrdinalIds: z.ZodArray<z.ZodCoercedNumber<unknown>>;
227
227
  }, z.core.$strip>;
228
228
  export declare const getTestScenariosInput: z.ZodObject<{
229
- scenarioOrdinalIds: z.ZodArray<z.ZodCoercedNumber<unknown>>;
229
+ scenarioOrdinalIds: z.ZodOptional<z.ZodArray<z.ZodCoercedNumber<unknown>>>;
230
+ externalIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
230
231
  }, z.core.$strip>;
231
232
  export declare const getManualSessionDetailsInput: z.ZodObject<{
232
233
  manualSessionId: z.ZodString;
@@ -111,8 +111,12 @@ export const getUserStoriesInput = z
111
111
  });
112
112
  export const getTestScenariosInput = z
113
113
  .object({
114
- scenarioOrdinalIds: z.array(z.coerce.number().int().positive()).min(1),
115
- });
114
+ scenarioOrdinalIds: z.array(z.coerce.number().int().positive()).min(1).optional(),
115
+ /** Full TMS external ids (e.g. C12345, PROJ-101). Server matches exact then numerical part. */
116
+ externalIds: z.array(z.string().min(1)).min(1).optional(),
117
+ })
118
+ .refine((v) => (v.scenarioOrdinalIds != null && v.scenarioOrdinalIds.length > 0) ||
119
+ (v.externalIds != null && v.externalIds.length > 0), { message: "Provide scenarioOrdinalIds and/or externalIds (non-empty)" });
116
120
  export const getManualSessionDetailsInput = z.object({
117
121
  manualSessionId: z.string().min(1),
118
122
  });
@@ -258,15 +258,20 @@ export const TOOL_DEFINITIONS = [
258
258
  },
259
259
  {
260
260
  kebab: "get-test-scenarios",
261
- description: "Fetch test scenarios from the TestChimp platform by ordinal id (numeric part of TS-<n>). " +
262
- "Returns full plan markdown content, title, platform file path, and linked user story ordinal ids. " +
263
- "Use when plan files are not yet synced to the repo.",
261
+ description: "Fetch test scenarios from the TestChimp platform by ordinal id (numeric part of TS-<n>) " +
262
+ "and/or external TMS ids (e.g. C12345, PROJ-101 server strips prefixes and matches numerical part). " +
263
+ "Returns full plan markdown content, title, platform file path, linked user story ordinal ids, " +
264
+ "and external_source / external_system_id when present. " +
265
+ "Use when plan files are not yet synced to the repo, or when linking imported tests to scenarios by TMS id.",
264
266
  inputSchema: S.getTestScenariosInput,
265
267
  execute: async (args, { postMcp }) => {
266
268
  const a = args;
267
- return postMcp("/api/mcp/get_test_scenarios", {
268
- scenarioOrdinalIds: a.scenarioOrdinalIds,
269
- });
269
+ const body = {};
270
+ if (a.scenarioOrdinalIds?.length)
271
+ body.scenarioOrdinalIds = a.scenarioOrdinalIds;
272
+ if (a.externalIds?.length)
273
+ body.externalIds = a.externalIds;
274
+ return postMcp("/api/mcp/get_test_scenarios", body);
270
275
  },
271
276
  },
272
277
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testchimp/cli",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "TestChimp CLI and MCP server \u2014 coverage, plans, EaaS, TrueCoverage (calls /api/mcp/*)",
5
5
  "type": "module",
6
6
  "main": "dist/bin/testchimp.js",