@testchimp/cli 0.1.2 → 0.1.4
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 +2 -0
- package/dist/cli/program.d.ts +1 -1
- package/dist/cli/program.js +23 -1
- package/dist/core/schemas.d.ts +11 -0
- package/dist/core/schemas.js +12 -0
- package/dist/core/tools.js +23 -0
- package/dist/mcp/server.js +1 -1
- package/package.json +1 -1
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.
|
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.4";
|
|
9
9
|
function parseJsonInput(raw) {
|
|
10
10
|
if (raw == null || raw.trim() === "")
|
|
11
11
|
return {};
|
|
@@ -374,6 +374,28 @@ export function buildCliProgram() {
|
|
|
374
374
|
const out = await runTool("get-truecoverage-event-metadata-keys", merged, { postMcp });
|
|
375
375
|
console.log(out);
|
|
376
376
|
});
|
|
377
|
+
program
|
|
378
|
+
.command("list-screen-states")
|
|
379
|
+
.description(TOOL_DEFINITIONS.find((t) => t.kebab === "list-screen-states").description)
|
|
380
|
+
.addOption(jsonInputOption())
|
|
381
|
+
.option("--environment <s>", "optional environment tag (forward compatibility)")
|
|
382
|
+
.action(async (opts) => {
|
|
383
|
+
const body = {};
|
|
384
|
+
if (opts.environment)
|
|
385
|
+
body.environment = String(opts.environment);
|
|
386
|
+
const merged = mergeBodies(body, opts.jsonInput);
|
|
387
|
+
const out = await runTool("list-screen-states", merged, { postMcp });
|
|
388
|
+
console.log(out);
|
|
389
|
+
});
|
|
390
|
+
program
|
|
391
|
+
.command("upsert-screen-states")
|
|
392
|
+
.description(TOOL_DEFINITIONS.find((t) => t.kebab === "upsert-screen-states").description)
|
|
393
|
+
.addOption(jsonInputOption())
|
|
394
|
+
.action(async (opts) => {
|
|
395
|
+
const merged = mergeBodies({}, opts.jsonInput);
|
|
396
|
+
const out = await runTool("upsert-screen-states", merged, { postMcp });
|
|
397
|
+
console.log(out);
|
|
398
|
+
});
|
|
377
399
|
program.on("--help", () => {
|
|
378
400
|
/* default */
|
|
379
401
|
});
|
package/dist/core/schemas.d.ts
CHANGED
|
@@ -72,3 +72,14 @@ export declare const getBunnyshellWorkflowJobLogsInput: z.ZodObject<{
|
|
|
72
72
|
bnsEnvironmentId: z.ZodString;
|
|
73
73
|
workflowJobId: z.ZodString;
|
|
74
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
|
@@ -79,3 +79,15 @@ export const getBunnyshellWorkflowJobLogsInput = z.object({
|
|
|
79
79
|
bnsEnvironmentId: z.string().min(1),
|
|
80
80
|
workflowJobId: z.string().min(1),
|
|
81
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
|
@@ -267,6 +267,29 @@ export const TOOL_DEFINITIONS = [
|
|
|
267
267
|
return postMcp("/api/mcp/truecoverage_event_metadata_keys", { eventTitle: a.eventTitle });
|
|
268
268
|
},
|
|
269
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
|
+
},
|
|
270
293
|
];
|
|
271
294
|
const TOOL_BY_KEBAB = new Map(TOOL_DEFINITIONS.map((t) => [t.kebab, t]));
|
|
272
295
|
export function getToolDefinition(kebab) {
|
package/dist/mcp/server.js
CHANGED
|
@@ -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.
|
|
5
|
+
const PACKAGE_VERSION = "0.1.4";
|
|
6
6
|
function textResult(json) {
|
|
7
7
|
return {
|
|
8
8
|
content: [{ type: "text", text: json }],
|