@testchimp/cli 0.1.8 → 0.1.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.
@@ -197,6 +197,54 @@ export function buildCliProgram() {
197
197
  const out = await runTool("update-user-story", merged, { postMcp });
198
198
  console.log(out);
199
199
  });
200
+ program
201
+ .command("get-user-stories")
202
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "get-user-stories").description)
203
+ .addOption(jsonInputOption())
204
+ .option("--user-story-ordinal-ids <csv>", "comma-separated US-<n> numeric ids")
205
+ .action(async (opts) => {
206
+ const body = {};
207
+ if (opts.userStoryOrdinalIds) {
208
+ body.userStoryOrdinalIds = String(opts.userStoryOrdinalIds)
209
+ .split(",")
210
+ .map((s) => Number(s.trim()))
211
+ .filter((n) => Number.isFinite(n) && n > 0);
212
+ }
213
+ const merged = mergeBodies(body, opts.jsonInput);
214
+ const out = await runTool("get-user-stories", merged, { postMcp });
215
+ console.log(out);
216
+ });
217
+ program
218
+ .command("get-test-scenarios")
219
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "get-test-scenarios").description)
220
+ .addOption(jsonInputOption())
221
+ .option("--scenario-ordinal-ids <csv>", "comma-separated TS-<n> numeric ids")
222
+ .action(async (opts) => {
223
+ const body = {};
224
+ if (opts.scenarioOrdinalIds) {
225
+ body.scenarioOrdinalIds = String(opts.scenarioOrdinalIds)
226
+ .split(",")
227
+ .map((s) => Number(s.trim()))
228
+ .filter((n) => Number.isFinite(n) && n > 0);
229
+ }
230
+ const merged = mergeBodies(body, opts.jsonInput);
231
+ const out = await runTool("get-test-scenarios", merged, { postMcp });
232
+ console.log(out);
233
+ });
234
+ program
235
+ .command("get-manual-session-details")
236
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "get-manual-session-details").description)
237
+ .addOption(jsonInputOption())
238
+ .option("--manual-session-id <id>", "manual test session id (same as job id in the viewer URL)")
239
+ .action(async (opts) => {
240
+ const body = {};
241
+ if (opts.manualSessionId) {
242
+ body.manualSessionId = String(opts.manualSessionId).trim();
243
+ }
244
+ const merged = mergeBodies(body, opts.jsonInput);
245
+ const out = await runTool("get-manual-session-details", merged, { postMcp });
246
+ console.log(out);
247
+ });
200
248
  program
201
249
  .command("mark-plan-items-implementation-done")
202
250
  .description(TOOL_DEFINITIONS.find((t) => t.kebab === "mark-plan-items-implementation-done").description)
@@ -70,6 +70,15 @@ export declare const markPlanItemsImplementationDoneInput: z.ZodObject<{
70
70
  scenarioOrdinalIds: z.ZodOptional<z.ZodArray<z.ZodCoercedNumber<unknown>>>;
71
71
  userStoryOrdinalIds: z.ZodOptional<z.ZodArray<z.ZodCoercedNumber<unknown>>>;
72
72
  }, z.core.$strip>;
73
+ export declare const getUserStoriesInput: z.ZodObject<{
74
+ userStoryOrdinalIds: z.ZodArray<z.ZodCoercedNumber<unknown>>;
75
+ }, z.core.$strip>;
76
+ export declare const getTestScenariosInput: z.ZodObject<{
77
+ scenarioOrdinalIds: z.ZodArray<z.ZodCoercedNumber<unknown>>;
78
+ }, z.core.$strip>;
79
+ export declare const getManualSessionDetailsInput: z.ZodObject<{
80
+ manualSessionId: z.ZodString;
81
+ }, z.core.$strip>;
73
82
  export declare const emptyInput: z.ZodObject<{}, z.core.$strip>;
74
83
  export declare const getBranchSpecificEndpointConfigInput: z.ZodObject<{
75
84
  branchName: z.ZodOptional<z.ZodString>;
@@ -69,6 +69,17 @@ export const markPlanItemsImplementationDoneInput = z.object({
69
69
  scenarioOrdinalIds: z.array(z.coerce.number().int().positive()).optional(),
70
70
  userStoryOrdinalIds: z.array(z.coerce.number().int().positive()).optional(),
71
71
  });
72
+ export const getUserStoriesInput = z
73
+ .object({
74
+ userStoryOrdinalIds: z.array(z.coerce.number().int().positive()).min(1),
75
+ });
76
+ export const getTestScenariosInput = z
77
+ .object({
78
+ scenarioOrdinalIds: z.array(z.coerce.number().int().positive()).min(1),
79
+ });
80
+ export const getManualSessionDetailsInput = z.object({
81
+ manualSessionId: z.string().min(1),
82
+ });
72
83
  export const emptyInput = z.object({});
73
84
  export const getBranchSpecificEndpointConfigInput = z.object({
74
85
  branchName: z.string().optional(),
@@ -159,6 +159,45 @@ export const TOOL_DEFINITIONS = [
159
159
  return postMcp("/api/mcp/update_test_scenario", { content: a.content });
160
160
  },
161
161
  },
162
+ {
163
+ kebab: "get-user-stories",
164
+ description: "Fetch user stories from the TestChimp platform by ordinal id (numeric part of US-<n>). " +
165
+ "Returns full plan markdown content, title, and platform file path for each found story. " +
166
+ "Use when plan files are not yet synced to the repo.",
167
+ inputSchema: S.getUserStoriesInput,
168
+ execute: async (args, { postMcp }) => {
169
+ const a = args;
170
+ return postMcp("/api/mcp/get_user_stories", {
171
+ userStoryOrdinalIds: a.userStoryOrdinalIds,
172
+ });
173
+ },
174
+ },
175
+ {
176
+ kebab: "get-test-scenarios",
177
+ description: "Fetch test scenarios from the TestChimp platform by ordinal id (numeric part of TS-<n>). " +
178
+ "Returns full plan markdown content, title, platform file path, and linked user story ordinal ids. " +
179
+ "Use when plan files are not yet synced to the repo.",
180
+ inputSchema: S.getTestScenariosInput,
181
+ execute: async (args, { postMcp }) => {
182
+ const a = args;
183
+ return postMcp("/api/mcp/get_test_scenarios", {
184
+ scenarioOrdinalIds: a.scenarioOrdinalIds,
185
+ });
186
+ },
187
+ },
188
+ {
189
+ kebab: "get-manual-session-details",
190
+ description: "Fetch a manual test session by id. Returns project id, title, environment, steps " +
191
+ "(playwright commands, signed screenshot URLs, notes), and linked scenario ordinal ids. " +
192
+ "Use when authoring a SmartTest from a recorded manual session.",
193
+ inputSchema: S.getManualSessionDetailsInput,
194
+ execute: async (args, { postMcp }) => {
195
+ const a = args;
196
+ return postMcp("/api/mcp/get_manual_session_details", {
197
+ manualSessionId: a.manualSessionId,
198
+ });
199
+ },
200
+ },
162
201
  {
163
202
  kebab: "mark-plan-items-implementation-done",
164
203
  description: "Mark user stories and/or test scenarios implementation-complete in platform lifecycle (DB only; does not rewrite plan markdown). " +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testchimp/cli",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "TestChimp CLI and MCP server — coverage, plans, EaaS, TrueCoverage (calls /api/mcp/*)",
5
5
  "type": "module",
6
6
  "main": "dist/bin/testchimp.js",