@testchimp/cli 0.1.3 → 0.1.5

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/README.md CHANGED
@@ -40,6 +40,8 @@ export TESTCHIMP_API_KEY=... # required (often read from project MCP env; neve
40
40
  testchimp --help
41
41
  testchimp get-requirement-coverage --branch-name main --help
42
42
  testchimp create-user-story --platform-file-path plans/stories/foo.md --title "Checkout"
43
+ testchimp list-screen-states --json-input '{}'
44
+ testchimp upsert-screen-states --json-input '{"screenStates":[{"screen":"Checkout","states":["empty","filled"]}]}'
43
45
  ```
44
46
 
45
47
  - **stdout:** API response JSON.
@@ -1,3 +1,3 @@
1
1
  import { Command } from "commander";
2
- export declare const PACKAGE_VERSION = "0.1.1";
2
+ export declare const PACKAGE_VERSION = "0.1.4";
3
3
  export declare function buildCliProgram(): Command;
@@ -5,7 +5,7 @@ import { DEFAULT_BACKEND, postMcp } from "../core/client.js";
5
5
  import { deepMerge } from "../core/merge.js";
6
6
  import { runTool } from "../core/tools.js";
7
7
  import { TOOL_DEFINITIONS } from "../core/tools.js";
8
- export const PACKAGE_VERSION = "0.1.1";
8
+ export const PACKAGE_VERSION = "0.1.4";
9
9
  function parseJsonInput(raw) {
10
10
  if (raw == null || raw.trim() === "")
11
11
  return {};
@@ -157,6 +157,30 @@ export function buildCliProgram() {
157
157
  const out = await runTool("update-user-story", merged, { postMcp });
158
158
  console.log(out);
159
159
  });
160
+ program
161
+ .command("mark-plan-items-implementation-done")
162
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "mark-plan-items-implementation-done").description)
163
+ .addOption(jsonInputOption())
164
+ .option("--scenario-ordinal-ids <csv>", "comma-separated TS-<n> numeric ids")
165
+ .option("--user-story-ordinal-ids <csv>", "comma-separated US-<n> numeric ids")
166
+ .action(async (opts) => {
167
+ const body = {};
168
+ if (opts.scenarioOrdinalIds) {
169
+ body.scenarioOrdinalIds = String(opts.scenarioOrdinalIds)
170
+ .split(",")
171
+ .map((s) => Number(s.trim()))
172
+ .filter((n) => Number.isFinite(n) && n > 0);
173
+ }
174
+ if (opts.userStoryOrdinalIds) {
175
+ body.userStoryOrdinalIds = String(opts.userStoryOrdinalIds)
176
+ .split(",")
177
+ .map((s) => Number(s.trim()))
178
+ .filter((n) => Number.isFinite(n) && n > 0);
179
+ }
180
+ const merged = mergeBodies(body, opts.jsonInput);
181
+ const out = await runTool("mark-plan-items-implementation-done", merged, { postMcp });
182
+ console.log(out);
183
+ });
160
184
  program
161
185
  .command("update-test-scenario")
162
186
  .description(TOOL_DEFINITIONS.find((t) => t.kebab === "update-test-scenario").description)
@@ -374,6 +398,28 @@ export function buildCliProgram() {
374
398
  const out = await runTool("get-truecoverage-event-metadata-keys", merged, { postMcp });
375
399
  console.log(out);
376
400
  });
401
+ program
402
+ .command("list-screen-states")
403
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "list-screen-states").description)
404
+ .addOption(jsonInputOption())
405
+ .option("--environment <s>", "optional environment tag (forward compatibility)")
406
+ .action(async (opts) => {
407
+ const body = {};
408
+ if (opts.environment)
409
+ body.environment = String(opts.environment);
410
+ const merged = mergeBodies(body, opts.jsonInput);
411
+ const out = await runTool("list-screen-states", merged, { postMcp });
412
+ console.log(out);
413
+ });
414
+ program
415
+ .command("upsert-screen-states")
416
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "upsert-screen-states").description)
417
+ .addOption(jsonInputOption())
418
+ .action(async (opts) => {
419
+ const merged = mergeBodies({}, opts.jsonInput);
420
+ const out = await runTool("upsert-screen-states", merged, { postMcp });
421
+ console.log(out);
422
+ });
377
423
  program.on("--help", () => {
378
424
  /* default */
379
425
  });
@@ -39,6 +39,10 @@ export declare const createTestScenarioInput: z.ZodObject<{
39
39
  export declare const updatePlanMarkdownInput: z.ZodObject<{
40
40
  content: z.ZodString;
41
41
  }, z.core.$strip>;
42
+ export declare const markPlanItemsImplementationDoneInput: z.ZodObject<{
43
+ scenarioOrdinalIds: z.ZodOptional<z.ZodArray<z.ZodCoercedNumber<unknown>>>;
44
+ userStoryOrdinalIds: z.ZodOptional<z.ZodArray<z.ZodCoercedNumber<unknown>>>;
45
+ }, z.core.$strip>;
42
46
  export declare const emptyInput: z.ZodObject<{}, z.core.$strip>;
43
47
  export declare const getBranchSpecificEndpointConfigInput: z.ZodObject<{
44
48
  branchName: z.ZodOptional<z.ZodString>;
@@ -46,6 +46,10 @@ export const createTestScenarioInput = z.object({
46
46
  export const updatePlanMarkdownInput = z.object({
47
47
  content: z.string().min(1),
48
48
  });
49
+ export const markPlanItemsImplementationDoneInput = z.object({
50
+ scenarioOrdinalIds: z.array(z.coerce.number().int().positive()).optional(),
51
+ userStoryOrdinalIds: z.array(z.coerce.number().int().positive()).optional(),
52
+ });
49
53
  export const emptyInput = z.object({});
50
54
  export const getBranchSpecificEndpointConfigInput = z.object({
51
55
  branchName: z.string().optional(),
@@ -34,7 +34,9 @@ export const TOOL_DEFINITIONS = [
34
34
  {
35
35
  kebab: "get-requirement-coverage",
36
36
  description: "Fetch requirement (scenario) coverage under an optional platform-rooted folder scope (tests/... or plans/...). " +
37
- "Use branchName (Git branch) and scope.filePaths (paths under platform tests root) rather than internal ids.",
37
+ "Use scope.filePaths or scope.folderPath (platform tests/plans roots). Omit branchName for cross-branch coverage " +
38
+ "(aggregates branch copies; execution jobs deduped by stable hash of tests-root-relative path + test name). " +
39
+ "Pass branchName only when results must be limited to one Git branch.",
38
40
  inputSchema: S.listCoverageInput,
39
41
  execute: async (args, { postMcp }) => {
40
42
  const json = await postMcp("/api/mcp/list_requirement_coverage", listCoverageBody(args));
@@ -97,7 +99,8 @@ export const TOOL_DEFINITIONS = [
97
99
  {
98
100
  kebab: "update-user-story",
99
101
  description: "Sync a user story markdown file to the platform after local edits. " +
100
- "Parses frontmatter (id: US-..., title, priority, status) and updates the linked support file and entity.",
102
+ "Parses frontmatter (id: US-..., title, priority) and updates the linked support file and entity. " +
103
+ "Implementation status is not stored in markdown; use mark-plan-items-implementation-done.",
101
104
  inputSchema: S.updatePlanMarkdownInput,
102
105
  execute: async (args, { postMcp }) => {
103
106
  const a = args;
@@ -107,13 +110,29 @@ export const TOOL_DEFINITIONS = [
107
110
  {
108
111
  kebab: "update-test-scenario",
109
112
  description: "Sync a test scenario markdown file to the platform after local edits. " +
110
- "Parses frontmatter (id: TS-..., story: US-..., title, priority, status) and updates linking if story changes.",
113
+ "Parses frontmatter (id: TS-..., story: US-..., title, priority) and updates linking if story changes. " +
114
+ "Implementation status is not stored in markdown; use mark-plan-items-implementation-done.",
111
115
  inputSchema: S.updatePlanMarkdownInput,
112
116
  execute: async (args, { postMcp }) => {
113
117
  const a = args;
114
118
  return postMcp("/api/mcp/update_test_scenario", { content: a.content });
115
119
  },
116
120
  },
121
+ {
122
+ kebab: "mark-plan-items-implementation-done",
123
+ description: "Mark user stories and/or test scenarios implementation-complete in platform lifecycle (DB only; does not rewrite plan markdown). " +
124
+ "Use scenarioOrdinalIds / userStoryOrdinalIds (numeric parts of TS-<n> / US-<n>).",
125
+ inputSchema: S.markPlanItemsImplementationDoneInput,
126
+ execute: async (args, { postMcp }) => {
127
+ const a = args;
128
+ const body = {};
129
+ if (a.scenarioOrdinalIds?.length)
130
+ body.scenarioOrdinalIds = a.scenarioOrdinalIds;
131
+ if (a.userStoryOrdinalIds?.length)
132
+ body.userStoryOrdinalIds = a.userStoryOrdinalIds;
133
+ return postMcp("/api/mcp/mark_plan_items_implementation_done", body);
134
+ },
135
+ },
117
136
  {
118
137
  kebab: "get-eaas-config",
119
138
  description: "Return the project's BunnyShell (Environment-as-a-Service) settings. Secrets are never returned.",
@@ -2,7 +2,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
3
  import { postMcp } from "../core/client.js";
4
4
  import { TOOL_DEFINITIONS, runTool } from "../core/tools.js";
5
- const PACKAGE_VERSION = "0.1.0";
5
+ const PACKAGE_VERSION = "0.1.4";
6
6
  function textResult(json) {
7
7
  return {
8
8
  content: [{ type: "text", text: json }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testchimp/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
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",