@testchimp/cli 0.1.0 → 0.1.2
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 +0 -2
- package/dist/cli/program.d.ts +1 -1
- package/dist/cli/program.js +17 -1
- package/dist/core/schemas.d.ts +4 -0
- package/dist/core/schemas.js +15 -0
- package/dist/core/tools.js +15 -0
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -33,8 +33,6 @@ Example `mcpServers.testchimp`:
|
|
|
33
33
|
|
|
34
34
|
The config **file path** depends on the host (e.g. Cursor often uses `<repo>/.cursor/mcp.json`). Tool names use **kebab-case** (e.g. `get-requirement-coverage`, `create-user-story`).
|
|
35
35
|
|
|
36
|
-
Legacy binary: **`testchimp-mcp`** runs the same MCP server as `testchimp mcp`.
|
|
37
|
-
|
|
38
36
|
## CLI
|
|
39
37
|
|
|
40
38
|
```bash
|
package/dist/cli/program.d.ts
CHANGED
package/dist/cli/program.js
CHANGED
|
@@ -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.
|
|
8
|
+
export const PACKAGE_VERSION = "0.1.1";
|
|
9
9
|
function parseJsonInput(raw) {
|
|
10
10
|
if (raw == null || raw.trim() === "")
|
|
11
11
|
return {};
|
|
@@ -95,6 +95,22 @@ export function buildCliProgram() {
|
|
|
95
95
|
const out = await runTool("get-execution-history", merged, { postMcp });
|
|
96
96
|
console.log(out);
|
|
97
97
|
});
|
|
98
|
+
program
|
|
99
|
+
.command("fetch-execution-report")
|
|
100
|
+
.description(TOOL_DEFINITIONS.find((t) => t.kebab === "fetch-execution-report").description)
|
|
101
|
+
.addOption(jsonInputOption())
|
|
102
|
+
.option("--batch-invocation-id <id>")
|
|
103
|
+
.option("--job-id <id>")
|
|
104
|
+
.action(async (opts) => {
|
|
105
|
+
const body = {};
|
|
106
|
+
if (opts.batchInvocationId)
|
|
107
|
+
body.batchInvocationId = String(opts.batchInvocationId);
|
|
108
|
+
if (opts.jobId)
|
|
109
|
+
body.jobId = String(opts.jobId);
|
|
110
|
+
const merged = mergeBodies(body, opts.jsonInput);
|
|
111
|
+
const out = await runTool("fetch-execution-report", merged, { postMcp });
|
|
112
|
+
console.log(out);
|
|
113
|
+
});
|
|
98
114
|
program
|
|
99
115
|
.command("create-user-story")
|
|
100
116
|
.description(TOOL_DEFINITIONS.find((t) => t.kebab === "create-user-story").description)
|
package/dist/core/schemas.d.ts
CHANGED
|
@@ -23,6 +23,10 @@ export declare const listExecutionInput: z.ZodObject<{
|
|
|
23
23
|
}, z.core.$strip>>;
|
|
24
24
|
branchName: z.ZodOptional<z.ZodString>;
|
|
25
25
|
}, z.core.$strip>;
|
|
26
|
+
export declare const fetchExecutionReportInput: z.ZodObject<{
|
|
27
|
+
batchInvocationId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
jobId: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>;
|
|
26
30
|
export declare const createUserStoryInput: z.ZodObject<{
|
|
27
31
|
platformFilePath: z.ZodString;
|
|
28
32
|
title: z.ZodString;
|
package/dist/core/schemas.js
CHANGED
|
@@ -19,6 +19,21 @@ export const listExecutionInput = z.object({
|
|
|
19
19
|
scope: scopeSchema,
|
|
20
20
|
branchName: z.string().optional(),
|
|
21
21
|
});
|
|
22
|
+
export const fetchExecutionReportInput = z
|
|
23
|
+
.object({
|
|
24
|
+
batchInvocationId: z.string().optional(),
|
|
25
|
+
jobId: z.string().optional(),
|
|
26
|
+
})
|
|
27
|
+
.superRefine((v, ctx) => {
|
|
28
|
+
const batch = (v.batchInvocationId ?? "").trim();
|
|
29
|
+
const job = (v.jobId ?? "").trim();
|
|
30
|
+
if ((batch === "" && job === "") || (batch !== "" && job !== "")) {
|
|
31
|
+
ctx.addIssue({
|
|
32
|
+
code: z.ZodIssueCode.custom,
|
|
33
|
+
message: "Provide exactly one of batchInvocationId or jobId",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
22
37
|
export const createUserStoryInput = z.object({
|
|
23
38
|
platformFilePath: z.string().min(1),
|
|
24
39
|
title: z.string().min(1),
|
package/dist/core/tools.js
CHANGED
|
@@ -51,6 +51,21 @@ export const TOOL_DEFINITIONS = [
|
|
|
51
51
|
return json;
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
|
+
{
|
|
55
|
+
kebab: "fetch-execution-report",
|
|
56
|
+
description: "Fetch a detailed execution report for failing SmartTests, given a batchInvocationId (batch run) or jobId (single run). " +
|
|
57
|
+
"Returns only failing tests and includes error details and a trace viewer URL when available.",
|
|
58
|
+
inputSchema: S.fetchExecutionReportInput,
|
|
59
|
+
execute: async (args, { postMcp }) => {
|
|
60
|
+
const a = args;
|
|
61
|
+
const body = {};
|
|
62
|
+
if (a.batchInvocationId != null && a.batchInvocationId.trim() !== "")
|
|
63
|
+
body.batchInvocationId = a.batchInvocationId.trim();
|
|
64
|
+
if (a.jobId != null && a.jobId.trim() !== "")
|
|
65
|
+
body.jobId = a.jobId.trim();
|
|
66
|
+
return postMcp("/api/mcp/fetch_execution_report", body);
|
|
67
|
+
},
|
|
68
|
+
},
|
|
54
69
|
{
|
|
55
70
|
kebab: "create-user-story",
|
|
56
71
|
description: "Create a user story on the TestChimp project and its plan file stub. " +
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testchimp/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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",
|
|
7
7
|
"types": "dist/bin/testchimp.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"testchimp": "dist/bin/testchimp.js"
|
|
10
|
-
"testchimp-mcp": "dist/bin/legacy-mcp.js"
|
|
9
|
+
"testchimp": "dist/bin/testchimp.js"
|
|
11
10
|
},
|
|
12
11
|
"files": [
|
|
13
12
|
"dist/"
|