@testchimp/cli 0.1.1 → 0.1.3
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/dist/cli/program.js +16 -0
- package/dist/core/schemas.d.ts +15 -0
- package/dist/core/schemas.js +27 -0
- package/dist/core/tools.js +38 -0
- package/package.json +1 -1
package/dist/cli/program.js
CHANGED
|
@@ -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;
|
|
@@ -68,3 +72,14 @@ export declare const getBunnyshellWorkflowJobLogsInput: z.ZodObject<{
|
|
|
68
72
|
bnsEnvironmentId: z.ZodString;
|
|
69
73
|
workflowJobId: z.ZodString;
|
|
70
74
|
}, z.core.$strip>;
|
|
75
|
+
/** ListScreenStatesRequest JSON (proto camelCase). */
|
|
76
|
+
export declare const listScreenStatesInput: z.ZodObject<{
|
|
77
|
+
environment: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
/** UpsertScreenStatesRequest JSON (proto camelCase). */
|
|
80
|
+
export declare const upsertScreenStatesInput: z.ZodObject<{
|
|
81
|
+
screenStates: z.ZodArray<z.ZodObject<{
|
|
82
|
+
screen: z.ZodOptional<z.ZodString>;
|
|
83
|
+
states: z.ZodArray<z.ZodString>;
|
|
84
|
+
}, z.core.$strip>>;
|
|
85
|
+
}, z.core.$strip>;
|
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),
|
|
@@ -64,3 +79,15 @@ export const getBunnyshellWorkflowJobLogsInput = z.object({
|
|
|
64
79
|
bnsEnvironmentId: z.string().min(1),
|
|
65
80
|
workflowJobId: z.string().min(1),
|
|
66
81
|
});
|
|
82
|
+
/** ListScreenStatesRequest JSON (proto camelCase). */
|
|
83
|
+
export const listScreenStatesInput = z.object({
|
|
84
|
+
environment: z.string().optional(),
|
|
85
|
+
});
|
|
86
|
+
const screenStatesEntrySchema = z.object({
|
|
87
|
+
screen: z.string().optional(),
|
|
88
|
+
states: z.array(z.string()),
|
|
89
|
+
});
|
|
90
|
+
/** UpsertScreenStatesRequest JSON (proto camelCase). */
|
|
91
|
+
export const upsertScreenStatesInput = z.object({
|
|
92
|
+
screenStates: z.array(screenStatesEntrySchema).min(1),
|
|
93
|
+
});
|
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. " +
|
|
@@ -252,6 +267,29 @@ export const TOOL_DEFINITIONS = [
|
|
|
252
267
|
return postMcp("/api/mcp/truecoverage_event_metadata_keys", { eventTitle: a.eventTitle });
|
|
253
268
|
},
|
|
254
269
|
},
|
|
270
|
+
{
|
|
271
|
+
kebab: "list-screen-states",
|
|
272
|
+
description: "Fetch the project's screen/state vocabulary (relational atlas) for SmartTests and traces. " +
|
|
273
|
+
"Optional environment field is accepted for forward compatibility; v1 may be project-global.",
|
|
274
|
+
inputSchema: S.listScreenStatesInput,
|
|
275
|
+
execute: async (args, { postMcp }) => {
|
|
276
|
+
const a = args;
|
|
277
|
+
const body = {};
|
|
278
|
+
if (a.environment != null && a.environment.trim() !== "")
|
|
279
|
+
body.environment = a.environment.trim();
|
|
280
|
+
return postMcp("/api/mcp/list_screen_states", body);
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
kebab: "upsert-screen-states",
|
|
285
|
+
description: "Merge screen names and state strings into the project's relational atlas (idempotent upsert). " +
|
|
286
|
+
"Body uses camelCase screenStates: [{ screen, states: string[] }, ...] per UpsertScreenStatesRequest.",
|
|
287
|
+
inputSchema: S.upsertScreenStatesInput,
|
|
288
|
+
execute: async (args, { postMcp }) => {
|
|
289
|
+
const a = args;
|
|
290
|
+
return postMcp("/api/mcp/upsert_screen_states", { screenStates: a.screenStates });
|
|
291
|
+
},
|
|
292
|
+
},
|
|
255
293
|
];
|
|
256
294
|
const TOOL_BY_KEBAB = new Map(TOOL_DEFINITIONS.map((t) => [t.kebab, t]));
|
|
257
295
|
export function getToolDefinition(kebab) {
|