qatools-cli 1.3.3 → 1.3.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.
Files changed (3) hide show
  1. package/mcp-core.js +11 -0
  2. package/package.json +1 -1
  3. package/qatools.js +23 -0
package/mcp-core.js CHANGED
@@ -831,6 +831,17 @@ const mcpTools = [
831
831
  inputSchema: mcpSchema({ templateId: mcpStr("Test protocol id"), reason: mcpStr("Why — at least a few words") }, ["templateId", "reason"]),
832
832
  run: async (a) => mcpCall("rejectTemplate", { projectId: a.projectId, templateId: a.templateId, reason: a.reason }),
833
833
  },
834
+ {
835
+ // approvals.test-protocols
836
+ name: "approve_test_protocol",
837
+ description: "Approve a test protocol waiting for review, because the project owner told you so in this conversation (onBehalfOf + quote). Only where the project's 'Who approves' setting allows it; where it lets agents approve by themselves, give reason instead of a person. A protocol without test cases, or one already rejected or superseded, is refused.",
838
+ inputSchema: mcpSchema({
839
+ templateId: mcpStr("Test protocol id (from list_templates)"),
840
+ ...APPROVAL_PARAMS,
841
+ reason: mcpStr("Only when an agent approves by itself, where the project allows it: why"),
842
+ }, ["templateId"]),
843
+ run: async (a) => mcpCall("approveTemplate", { projectId: a.projectId, templateId: a.templateId, ...(a.reason ? { reason: a.reason } : {}), ...pickApproval(a) }),
844
+ },
834
845
  {
835
846
  name: "upload_test_report",
836
847
  description: "Upload test results from a JUnit XML or JSON file on this computer as evidence on requirements (tests tagged with a requirementKey or [req:<key>]). Commit and branch come from git or CI.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qatools-cli",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "CLI for QA Tools — requirements, epics, sprints, sessions, App Context sync, project agenda. The companion to qa-tools.com.",
5
5
  "scripts": {
6
6
  "release": "npm version patch --no-git-tag-version && npm publish",
package/qatools.js CHANGED
@@ -2957,6 +2957,29 @@ program
2957
2957
  process.exit(0);
2958
2958
  });
2959
2959
 
2960
+ // approvals.test-protocols
2961
+ program
2962
+ .command("template-approve")
2963
+ .description("Approve a test protocol waiting for review — for the project owner who said so (--on-behalf-of + --quote), or as the agent itself where the project allows it (--reason)")
2964
+ .requiredOption("-i, --id <id>", "Test protocol ID")
2965
+ .option("--on-behalf-of <email>", "The project owner who approved it in the conversation")
2966
+ .option("--quote <text>", "Their own words approving it, verbatim")
2967
+ .option("--reason <text>", "Only when the agent approves by itself, where the project allows it: why")
2968
+ .option("--project <id>", "Target project ID (overrides default)")
2969
+ .option("-e, --email <email>", "Login email")
2970
+ .option("-p, --password <password>", "Login password")
2971
+ .action(async (options) => {
2972
+ await authenticate(options);
2973
+ const projectId = options.project || getCredentials()?.projectId;
2974
+ if (!projectId) { console.error("No project configured. Run: qatools setup, or pass --project <id>"); process.exit(1); }
2975
+ try {
2976
+ const res = await httpsCallable(functions, "approveTemplate")({ projectId, templateId: options.id,
2977
+ ...(options.onBehalfOf ? { onBehalfOf: options.onBehalfOf } : {}), ...(options.quote ? { quote: options.quote } : {}), ...(options.reason ? { reason: options.reason } : {}) });
2978
+ console.log(`✓ Test protocol ${options.id} approved by ${res.data.approvedBy}.`);
2979
+ } catch (e) { console.error("Failed:", e.message); process.exit(1); }
2980
+ process.exit(0);
2981
+ });
2982
+
2960
2983
  program
2961
2984
  .command("template-upload")
2962
2985
  .description("Upload a test protocol JSON. The same name as an existing protocol makes the next version (v1, v2 …); older unreviewed versions are superseded")