@testchimp/cli 0.1.23 → 0.1.25

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.
@@ -169,6 +169,7 @@ export function buildCliProgram() {
169
169
  .option("--environment <s>")
170
170
  .option("--branch-name <s>")
171
171
  .option("--scenario-id <id>")
172
+ .option("--test-id <id>")
172
173
  .option("--platform <web|ios|android>")
173
174
  .option("--file-paths <csv>")
174
175
  .option("--folder-path <path>")
@@ -182,6 +183,8 @@ export function buildCliProgram() {
182
183
  body.branchName = opts.branchName;
183
184
  if (opts.scenarioId)
184
185
  body.scenarioId = opts.scenarioId;
186
+ if (opts.testId)
187
+ body.testId = opts.testId;
185
188
  if (opts.platform)
186
189
  body.platform = opts.platform;
187
190
  const scope = {};
@@ -1064,6 +1067,28 @@ export function buildCliProgram() {
1064
1067
  }
1065
1068
  console.log(await runTool("upsert-policy", merged, { postMcp }));
1066
1069
  });
1070
+ program
1071
+ .command("upsert-plans-support-file")
1072
+ .description(TOOL_DEFINITIONS.find((t) => t.kebab === "upsert-plans-support-file").description)
1073
+ .addOption(jsonInputOption())
1074
+ .option("--file-path <path>", "path relative to mapped plans root (e.g. knowledge/workflow_plans/run-qa/<ulid>.plan.md)")
1075
+ .option("--content <markdown>", "full file content")
1076
+ .option("--content-file <path>", "read content from local file")
1077
+ .action(async (opts) => {
1078
+ let content = opts.content;
1079
+ if (opts.contentFile)
1080
+ content = await readFile(String(opts.contentFile), "utf8");
1081
+ const body = {};
1082
+ if (opts.filePath)
1083
+ body.filePath = String(opts.filePath);
1084
+ if (content !== undefined)
1085
+ body.content = content;
1086
+ const merged = mergeBodies(body, opts.jsonInput);
1087
+ if (!merged.filePath || merged.content === undefined || merged.content === null) {
1088
+ throw new Error("Provide --file-path and --content or --content-file (or full body via --json-input)");
1089
+ }
1090
+ console.log(await runTool("upsert-plans-support-file", merged, { postMcp }));
1091
+ });
1067
1092
  program.on("--help", () => {
1068
1093
  /* default */
1069
1094
  });
@@ -38,6 +38,7 @@ export declare const listExecutionInput: z.ZodObject<{
38
38
  }, z.core.$strip>>;
39
39
  branchName: z.ZodOptional<z.ZodString>;
40
40
  scenarioId: z.ZodOptional<z.ZodString>;
41
+ testId: z.ZodOptional<z.ZodString>;
41
42
  platform: z.ZodOptional<z.ZodEnum<{
42
43
  web: "web";
43
44
  ios: "ios";
@@ -1350,4 +1351,8 @@ export declare const upsertPolicyInput: z.ZodObject<{
1350
1351
  policyFileName: z.ZodString;
1351
1352
  content: z.ZodString;
1352
1353
  }, z.core.$strip>;
1354
+ export declare const upsertPlansSupportFileInput: z.ZodObject<{
1355
+ filePath: z.ZodString;
1356
+ content: z.ZodString;
1357
+ }, z.core.$strip>;
1353
1358
  export declare const listWorkflowCatalogInput: z.ZodObject<{}, z.core.$strip>;
@@ -33,6 +33,7 @@ export const listExecutionInput = z.object({
33
33
  scope: scopeSchema,
34
34
  branchName: z.string().optional(),
35
35
  scenarioId: z.string().optional(),
36
+ testId: z.string().optional(),
36
37
  platform: executionPlatformSchema.optional(),
37
38
  dimensionFilters: z.array(executionJobDimensionFilterSchema).optional(),
38
39
  limit: z.number().int().positive().max(500).optional(),
@@ -682,4 +683,9 @@ export const upsertPolicyInput = z.object({
682
683
  policyFileName: z.string().min(1),
683
684
  content: z.string().min(1),
684
685
  });
686
+ export const upsertPlansSupportFileInput = z.object({
687
+ /** Path relative to mapped plans root (e.g. knowledge/workflow_plans/run-qa/<ulid>.plan.md). */
688
+ filePath: z.string().min(1),
689
+ content: z.string().min(1),
690
+ });
685
691
  export const listWorkflowCatalogInput = z.object({});
@@ -69,6 +69,8 @@ function listExecutionBody(args) {
69
69
  body.branchName = args.branchName.trim();
70
70
  if (args.scenarioId != null && args.scenarioId.trim() !== "")
71
71
  body.scenarioId = args.scenarioId.trim();
72
+ if (args.testId != null && args.testId.trim() !== "")
73
+ body.testId = args.testId.trim();
72
74
  const dimensionFilters = [...(args.dimensionFilters ?? [])];
73
75
  if (args.platform != null) {
74
76
  const hasPlatformFilter = dimensionFilters.some((f) => f.dimension === "PLATFORM_EXECUTION_JOB_FILTER_DIMENSION");
@@ -139,7 +141,8 @@ export const TOOL_DEFINITIONS = [
139
141
  },
140
142
  {
141
143
  kebab: "get-execution-history",
142
- description: "Fetch SmartTest execution history for an optional platform-rooted folder scope, or for a scenario when scenarioId is set. " +
144
+ description: "Fetch SmartTest execution history for a testId (top 5 recent runs), an optional platform-rooted folder/file scope, or a scenario when scenarioId is set. " +
145
+ "Prefer testId when you have it from fetch-execution-report. Typically omit environment to avoid env scoping. " +
143
146
  "Use branchName and scope.filePaths as for coverage. Optional platform (web|ios|android) and dimensionFilters narrow results.",
144
147
  inputSchema: S.listExecutionInput,
145
148
  execute: async (args, { postMcp }) => {
@@ -975,6 +978,21 @@ export const TOOL_DEFINITIONS = [
975
978
  });
976
979
  },
977
980
  },
981
+ {
982
+ kebab: "upsert-plans-support-file",
983
+ description: "Create or update any file under the mapped plans root on the platform by relative path (no git commit/push required). " +
984
+ "Primary use: upload workflow execution plans at knowledge/workflow_plans/<workflow-id>/<workflow_execution_id>.plan.md after the Plan phase. " +
985
+ "filePath is relative to the plans mapped root (leading plans/ is stripped). Under workflow_plans/, filenames are coerced to *.plan.md and stored as WORKFLOW_EXECUTION_PLAN. " +
986
+ "Response includes supportFileId, filePath (canonical), filetype, created. Blocking step before Execute for cloud agents.",
987
+ inputSchema: S.upsertPlansSupportFileInput,
988
+ execute: async (args, { postMcp }) => {
989
+ const a = args;
990
+ return postMcp("/api/mcp/upsert_plans_support_file", {
991
+ filePath: a.filePath,
992
+ content: a.content,
993
+ });
994
+ },
995
+ },
978
996
  {
979
997
  kebab: "list-workflow-catalog",
980
998
  description: "List supported TestChimp workflows with Active / Disabled / Missing Config status for the project.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testchimp/cli",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "TestChimp CLI and MCP server \u2014 coverage, plans, EaaS, TrueCoverage (calls /api/mcp/*)",
5
5
  "type": "module",
6
6
  "main": "dist/bin/testchimp.js",