@testchimp/cli 0.1.27 → 0.1.28

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.
@@ -1134,6 +1134,68 @@ export function buildCliProgram() {
1134
1134
  }
1135
1135
  console.log(await runTool("upsert-plans-support-file", merged, { postMcp }));
1136
1136
  });
1137
+ program
1138
+ .command("list-api-operation-services")
1139
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "list-api-operation-services").description)
1140
+ .addOption(jsonInputOption())
1141
+ .action(async (opts) => {
1142
+ const merged = mergeBodies({}, opts.jsonInput);
1143
+ console.log(await runTool("list-api-operation-services", merged, { postMcp }));
1144
+ });
1145
+ program
1146
+ .command("list-api-operations")
1147
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "list-api-operations").description)
1148
+ .addOption(jsonInputOption())
1149
+ .option("--root-file-path <path>", "Repo-relative OpenAPI root path (preferred service resource id)")
1150
+ .option("--service-key <key>", "Internal service key alias")
1151
+ .option("--include-manual", "Include MANUAL test_mode coverage in previews")
1152
+ .option("--include-removed", "Include soft-deleted (REMOVED) operations")
1153
+ .action(async (opts) => {
1154
+ const body = {};
1155
+ if (opts.rootFilePath)
1156
+ body.rootFilePath = String(opts.rootFilePath);
1157
+ if (opts.serviceKey)
1158
+ body.serviceKey = String(opts.serviceKey);
1159
+ if (opts.includeManual)
1160
+ body.includeManual = true;
1161
+ if (opts.includeRemoved)
1162
+ body.includeRemoved = true;
1163
+ const merged = mergeBodies(body, opts.jsonInput);
1164
+ console.log(await runTool("list-api-operations", merged, { postMcp }));
1165
+ });
1166
+ program
1167
+ .command("get-api-operation-detail")
1168
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "get-api-operation-detail").description)
1169
+ .addOption(jsonInputOption())
1170
+ .option("--id <ulid>", "TestChimp operation id (ULID PK) — preferred")
1171
+ .option("--root-file-path <path>", "Repo-relative OpenAPI root path")
1172
+ .option("--service-key <key>", "Internal service key")
1173
+ .option("--oas-operation-id <id>", "OpenAPI operationId")
1174
+ .option("--http-method <method>", "HTTP method (with --path-template)")
1175
+ .option("--path-template <path>", "OpenAPI path template (with --http-method)")
1176
+ .option("--include-manual", "Include MANUAL test_mode coverage")
1177
+ .option("--include-removed", "Include soft-deleted schema fields / response codes")
1178
+ .action(async (opts) => {
1179
+ const body = {};
1180
+ if (opts.id)
1181
+ body.id = String(opts.id);
1182
+ if (opts.rootFilePath)
1183
+ body.rootFilePath = String(opts.rootFilePath);
1184
+ if (opts.serviceKey)
1185
+ body.serviceKey = String(opts.serviceKey);
1186
+ if (opts.oasOperationId)
1187
+ body.oasOperationId = String(opts.oasOperationId);
1188
+ if (opts.httpMethod)
1189
+ body.httpMethod = String(opts.httpMethod);
1190
+ if (opts.pathTemplate)
1191
+ body.pathTemplate = String(opts.pathTemplate);
1192
+ if (opts.includeManual)
1193
+ body.includeManual = true;
1194
+ if (opts.includeRemoved)
1195
+ body.includeRemoved = true;
1196
+ const merged = mergeBodies(body, opts.jsonInput);
1197
+ console.log(await runTool("get-api-operation-detail", merged, { postMcp }));
1198
+ });
1137
1199
  program.on("--help", () => {
1138
1200
  /* default */
1139
1201
  });
@@ -1415,3 +1415,21 @@ export declare const upsertPlansSupportFileInput: z.ZodObject<{
1415
1415
  content: z.ZodString;
1416
1416
  }, z.core.$strip>;
1417
1417
  export declare const listWorkflowCatalogInput: z.ZodObject<{}, z.core.$strip>;
1418
+ /** API operation coverage (OpenAPI ops + denorm coverage) — CLI ≥ 0.1.28 */
1419
+ export declare const listApiOperationServicesInput: z.ZodObject<{}, z.core.$strip>;
1420
+ export declare const listApiOperationsInput: z.ZodObject<{
1421
+ rootFilePath: z.ZodOptional<z.ZodString>;
1422
+ serviceKey: z.ZodOptional<z.ZodString>;
1423
+ includeManual: z.ZodOptional<z.ZodBoolean>;
1424
+ includeRemoved: z.ZodOptional<z.ZodBoolean>;
1425
+ }, z.core.$strip>;
1426
+ export declare const getApiOperationDetailInput: z.ZodObject<{
1427
+ id: z.ZodOptional<z.ZodString>;
1428
+ rootFilePath: z.ZodOptional<z.ZodString>;
1429
+ serviceKey: z.ZodOptional<z.ZodString>;
1430
+ oasOperationId: z.ZodOptional<z.ZodString>;
1431
+ httpMethod: z.ZodOptional<z.ZodString>;
1432
+ pathTemplate: z.ZodOptional<z.ZodString>;
1433
+ includeManual: z.ZodOptional<z.ZodBoolean>;
1434
+ includeRemoved: z.ZodOptional<z.ZodBoolean>;
1435
+ }, z.core.$strip>;
@@ -770,3 +770,47 @@ export const upsertPlansSupportFileInput = z.object({
770
770
  content: z.string().min(1),
771
771
  });
772
772
  export const listWorkflowCatalogInput = z.object({});
773
+ /** API operation coverage (OpenAPI ops + denorm coverage) — CLI ≥ 0.1.28 */
774
+ export const listApiOperationServicesInput = z.object({});
775
+ export const listApiOperationsInput = z.object({
776
+ /** Preferred: repo-relative OpenAPI root path. */
777
+ rootFilePath: z.string().optional(),
778
+ /** Alias for rootFilePath resolution; internal service key. */
779
+ serviceKey: z.string().optional(),
780
+ includeManual: z.boolean().optional(),
781
+ includeRemoved: z.boolean().optional(),
782
+ });
783
+ export const getApiOperationDetailInput = z
784
+ .object({
785
+ /** TestChimp operation id (ULID PK). Preferred. */
786
+ id: z.string().optional(),
787
+ rootFilePath: z.string().optional(),
788
+ serviceKey: z.string().optional(),
789
+ oasOperationId: z.string().optional(),
790
+ httpMethod: z.string().optional(),
791
+ pathTemplate: z.string().optional(),
792
+ includeManual: z.boolean().optional(),
793
+ includeRemoved: z.boolean().optional(),
794
+ })
795
+ .superRefine((v, ctx) => {
796
+ const id = v.id?.trim();
797
+ const root = v.rootFilePath?.trim();
798
+ const service = v.serviceKey?.trim();
799
+ const oas = v.oasOperationId?.trim();
800
+ const method = v.httpMethod?.trim();
801
+ const path = v.pathTemplate?.trim();
802
+ const hasService = !!(root || service);
803
+ if (id)
804
+ return;
805
+ if (oas && hasService)
806
+ return;
807
+ if (method && path && hasService)
808
+ return;
809
+ if (oas && !hasService)
810
+ return; // server allows project-wide oas fallback
811
+ ctx.addIssue({
812
+ code: "custom",
813
+ message: "Provide --id (TestChimp operation ULID), or --root-file-path/--service-key with --oas-operation-id, " +
814
+ "or --root-file-path/--service-key with --http-method and --path-template",
815
+ });
816
+ });
@@ -1075,6 +1075,60 @@ export const TOOL_DEFINITIONS = [
1075
1075
  inputSchema: S.listWorkflowCatalogInput,
1076
1076
  execute: async (_args, { postMcp }) => postMcp("/api/mcp/list_workflow_catalog", {}),
1077
1077
  },
1078
+ {
1079
+ kebab: "list-api-operation-services",
1080
+ description: "List API operation service resources for the project (configured OpenAPI root file paths + operation counts). " +
1081
+ "Use rootFilePath as the service resource id for list-api-operations / get-api-operation-detail.",
1082
+ inputSchema: S.listApiOperationServicesInput,
1083
+ execute: async (_args, { postMcp }) => postMcp("/api/mcp/list_api_operation_services", {}),
1084
+ },
1085
+ {
1086
+ kebab: "list-api-operations",
1087
+ description: "List API operations for a service resource with covering-test previews and coverageSummary scores " +
1088
+ "(same payload as the Operations list UI). Prefer --root-file-path (repo-relative OpenAPI root).",
1089
+ inputSchema: S.listApiOperationsInput,
1090
+ execute: async (args, { postMcp }) => {
1091
+ const a = args;
1092
+ const body = {};
1093
+ if (a.rootFilePath != null && a.rootFilePath.trim() !== "")
1094
+ body.rootFilePath = a.rootFilePath.trim();
1095
+ if (a.serviceKey != null && a.serviceKey.trim() !== "")
1096
+ body.serviceKey = a.serviceKey.trim();
1097
+ if (a.includeManual != null)
1098
+ body.includeManual = a.includeManual;
1099
+ if (a.includeRemoved != null)
1100
+ body.includeRemoved = a.includeRemoved;
1101
+ return postMcp("/api/mcp/list_api_operations", body);
1102
+ },
1103
+ },
1104
+ {
1105
+ kebab: "get-api-operation-detail",
1106
+ description: "Fetch detailed API operation coverage (request/query/response fields, response codes, covering tests) — " +
1107
+ "same payload as the Operation detail UI. Prefer TestChimp operation id (--id ULID); " +
1108
+ "or rootFilePath + oasOperationId; or rootFilePath + httpMethod + pathTemplate.",
1109
+ inputSchema: S.getApiOperationDetailInput,
1110
+ execute: async (args, { postMcp }) => {
1111
+ const a = args;
1112
+ const body = {};
1113
+ if (a.id != null && a.id.trim() !== "")
1114
+ body.id = a.id.trim();
1115
+ if (a.rootFilePath != null && a.rootFilePath.trim() !== "")
1116
+ body.rootFilePath = a.rootFilePath.trim();
1117
+ if (a.serviceKey != null && a.serviceKey.trim() !== "")
1118
+ body.serviceKey = a.serviceKey.trim();
1119
+ if (a.oasOperationId != null && a.oasOperationId.trim() !== "")
1120
+ body.oasOperationId = a.oasOperationId.trim();
1121
+ if (a.httpMethod != null && a.httpMethod.trim() !== "")
1122
+ body.httpMethod = a.httpMethod.trim();
1123
+ if (a.pathTemplate != null && a.pathTemplate.trim() !== "")
1124
+ body.pathTemplate = a.pathTemplate.trim();
1125
+ if (a.includeManual != null)
1126
+ body.includeManual = a.includeManual;
1127
+ if (a.includeRemoved != null)
1128
+ body.includeRemoved = a.includeRemoved;
1129
+ return postMcp("/api/mcp/get_api_operation_detail", body);
1130
+ },
1131
+ },
1078
1132
  ];
1079
1133
  const TOOL_BY_KEBAB = new Map(TOOL_DEFINITIONS.map((t) => [t.kebab, t]));
1080
1134
  export function getToolDefinition(kebab) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@testchimp/cli",
3
- "version": "0.1.27",
4
- "description": "TestChimp CLI and MCP server \u2014 coverage, plans, EaaS, TrueCoverage (calls /api/mcp/*)",
3
+ "version": "0.1.28",
4
+ "description": "TestChimp CLI and MCP server \u2014 coverage, plans, EaaS, TrueCoverage, API operations (calls /api/mcp/*)",
5
5
  "type": "module",
6
6
  "main": "dist/bin/testchimp.js",
7
7
  "types": "dist/bin/testchimp.d.ts",