qatools-cli 1.2.2 → 1.2.3
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/package.json +1 -1
- package/qatools.js +65 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qatools-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
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
|
@@ -587,6 +587,59 @@ program
|
|
|
587
587
|
process.exit(0);
|
|
588
588
|
});
|
|
589
589
|
|
|
590
|
+
program
|
|
591
|
+
.command("plan-proposals")
|
|
592
|
+
.description("List sprint-plan proposals (pending ones are approved in the web app: Sprints → Plan proposals)")
|
|
593
|
+
.option("--status <status>", "Filter: pending, approved, rejected")
|
|
594
|
+
.option("--project <id>", "Target project ID (overrides default)")
|
|
595
|
+
.option("--json", "Output as JSON")
|
|
596
|
+
.option("-e, --email <email>", "Login email")
|
|
597
|
+
.option("-p, --password <password>", "Login password")
|
|
598
|
+
.action(async (options) => {
|
|
599
|
+
await authenticate(options);
|
|
600
|
+
const creds = getCredentials();
|
|
601
|
+
const projectId = options.project || creds?.projectId;
|
|
602
|
+
if (!projectId) { console.error("No project configured. Run: qatools setup, or pass --project <id>"); process.exit(1); }
|
|
603
|
+
try {
|
|
604
|
+
const result = await httpsCallable(functions, "listPlanProposals")({ projectId, status: options.status || null });
|
|
605
|
+
const proposals = result.data.proposals;
|
|
606
|
+
if (options.json) { console.log(JSON.stringify(proposals, null, 2)); process.exit(0); }
|
|
607
|
+
if (proposals.length === 0) console.log("No plan proposals.");
|
|
608
|
+
for (const p of proposals) {
|
|
609
|
+
const decided = p.status !== "pending" && p.decidedBy ? ` by ${p.decidedBy}` : "";
|
|
610
|
+
console.log(` ${p.id} [${p.status}]${decided} ${p.goal || "(no goal)"}`);
|
|
611
|
+
console.log(` ${p.items.length} requirement(s)${p.newSprints?.length ? `, ${p.newSprints.length} new sprint(s)` : ""} — created by ${p.createdBy}`);
|
|
612
|
+
}
|
|
613
|
+
} catch (e) {
|
|
614
|
+
console.error("Failed:", e.message);
|
|
615
|
+
process.exit(1);
|
|
616
|
+
}
|
|
617
|
+
process.exit(0);
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
program
|
|
621
|
+
.command("plan-reject")
|
|
622
|
+
.description("Reject (withdraw) a pending sprint-plan proposal — nothing gets planned. Approving is done in the web app only.")
|
|
623
|
+
.requiredOption("-i, --id <proposalId>", "Proposal ID (see qatools plan-proposals)")
|
|
624
|
+
.option("--comment <text>", "Why it is rejected")
|
|
625
|
+
.option("--project <id>", "Target project ID (overrides default)")
|
|
626
|
+
.option("-e, --email <email>", "Login email")
|
|
627
|
+
.option("-p, --password <password>", "Login password")
|
|
628
|
+
.action(async (options) => {
|
|
629
|
+
await authenticate(options);
|
|
630
|
+
const creds = getCredentials();
|
|
631
|
+
const projectId = options.project || creds?.projectId;
|
|
632
|
+
if (!projectId) { console.error("No project configured. Run: qatools setup, or pass --project <id>"); process.exit(1); }
|
|
633
|
+
try {
|
|
634
|
+
await httpsCallable(functions, "decidePlanProposal")({ projectId, proposalId: options.id, decision: "reject", comment: options.comment || "" });
|
|
635
|
+
console.log(`Rejected proposal ${options.id}. Nothing was planned.`);
|
|
636
|
+
} catch (e) {
|
|
637
|
+
console.error("Failed:", e.message);
|
|
638
|
+
process.exit(1);
|
|
639
|
+
}
|
|
640
|
+
process.exit(0);
|
|
641
|
+
});
|
|
642
|
+
|
|
590
643
|
program
|
|
591
644
|
.command("backlog-create")
|
|
592
645
|
.description("Create a new backlog item")
|
|
@@ -3462,6 +3515,18 @@ const mcpTools = [
|
|
|
3462
3515
|
inputSchema: mcpSchema({ status: mcpStr("Filter by status", { enum: ["pending", "approved", "rejected"] }) }),
|
|
3463
3516
|
run: async (a) => (await mcpCall("listPlanProposals", { projectId: a.projectId, status: a.status || null })).proposals,
|
|
3464
3517
|
},
|
|
3518
|
+
{
|
|
3519
|
+
name: "reject_plan_proposal",
|
|
3520
|
+
description: "Reject (withdraw) a pending sprint-plan proposal, e.g. one you created that is superseded. Nothing gets planned. There is no approve tool: approval is a human decision in the qa-tools web app.",
|
|
3521
|
+
inputSchema: mcpSchema({
|
|
3522
|
+
proposalId: mcpStr("Proposal ID (from list_plan_proposals)"),
|
|
3523
|
+
comment: mcpStr("Why it is rejected"),
|
|
3524
|
+
}, ["proposalId"]),
|
|
3525
|
+
run: async (a) => {
|
|
3526
|
+
await mcpCall("decidePlanProposal", { projectId: a.projectId, proposalId: a.proposalId, decision: "reject", comment: a.comment || "" });
|
|
3527
|
+
return { rejected: a.proposalId, planned: 0 };
|
|
3528
|
+
},
|
|
3529
|
+
},
|
|
3465
3530
|
{
|
|
3466
3531
|
name: "get_sprint_items",
|
|
3467
3532
|
description: "Everything planned in a sprint: its requirements (the planning unit) and the backlog signals linked to it.",
|