qatools-cli 1.3.2 → 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 (4) hide show
  1. package/brief.js +9 -1
  2. package/mcp-core.js +1219 -1156
  3. package/package.json +1 -1
  4. package/qatools.js +31 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qatools-cli",
3
- "version": "1.3.2",
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
@@ -1703,7 +1703,7 @@ async function briefText({ projectId, projectName = "", cwd = process.cwd() }) {
1703
1703
  const { renderBrief } = require("./brief");
1704
1704
  const warnings = await staleWarnings().catch(() => []); // cli.self-upgrade: the session sees it first thing
1705
1705
  return renderBrief({ projectName, requirements, agenda: agendaRes?.agenda || null,
1706
- requests: reqsRes?.requests || [], branch, main, branchKeys, warnings, scheduledRuns: agendaRes?.scheduledRuns || null });
1706
+ requests: reqsRes?.requests || [], branch, main, branchKeys, warnings, scheduledRuns: agendaRes?.scheduledRuns || null, approvalPolicy: agendaRes?.approvalPolicy || "" });
1707
1707
  }
1708
1708
 
1709
1709
  program
@@ -2783,8 +2783,11 @@ program
2783
2783
  .option("--title <text>", "Set title")
2784
2784
  .option("--description <text>", "Set description")
2785
2785
  .option("--ac <text>", "Set acceptance criteria")
2786
+ .option("--negative <text>", "Set negative criteria (what must not happen)")
2786
2787
  .option("--points <n>", "Set size in points: 1, 2, 3, 5 or 8 (empty string clears). Not for non-functional requirements.")
2787
- .option("--reason <text>", "REQUIRED when status=rejected: why it is rejected (min 5 chars), kept with the requirement")
2788
+ .option("--reason <text>", "REQUIRED when status=rejected: why it is rejected (min 5 chars), kept with the requirement. With status=approved by an agent itself (where the project allows it): why")
2789
+ .option("--on-behalf-of <email>", "status=approved because this member said so in the conversation (approvals.in-conversation); needs --quote")
2790
+ .option("--quote <text>", "The member's own words approving it, verbatim")
2788
2791
  .option("--project <id>", "Target project ID (overrides default; requires access to that project)")
2789
2792
  .option("-e, --email <email>", "Login email")
2790
2793
  .option("-p, --password <password>", "Login password")
@@ -2813,6 +2816,7 @@ program
2813
2816
  if (options.title) u.title = options.title;
2814
2817
  if (options.description) u.description = options.description;
2815
2818
  if (options.ac) u.acceptanceCriteria = options.ac;
2819
+ if (options.negative) u.negativeCriteria = options.negative;
2816
2820
  if (options.points !== undefined) u.points = options.points === "" ? null : Number(options.points);
2817
2821
  updates[options.id] = u;
2818
2822
  if (options.evidence) evidenceById[options.id] = options.evidence;
@@ -2865,6 +2869,8 @@ program
2865
2869
  payload.attachments = await uploadEvidenceFiles(projectId, options.attach);
2866
2870
  }
2867
2871
  if (reasonById[requirementId]) payload.reason = reasonById[requirementId];
2872
+ if (options.onBehalfOf) payload.onBehalfOf = options.onBehalfOf;
2873
+ if (options.quote) payload.quote = options.quote;
2868
2874
  if (evidenceById[requirementId]) {
2869
2875
  payload.evidence = evidenceById[requirementId];
2870
2876
  const commit = options.commit === false ? null : (typeof options.commit === "string" ? options.commit : currentGitCommit());
@@ -2951,6 +2957,29 @@ program
2951
2957
  process.exit(0);
2952
2958
  });
2953
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
+
2954
2983
  program
2955
2984
  .command("template-upload")
2956
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")