qatools-cli 1.2.32 → 1.2.34
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 +171 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qatools-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.34",
|
|
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
|
@@ -1872,6 +1872,33 @@ program
|
|
|
1872
1872
|
process.exit(0);
|
|
1873
1873
|
});
|
|
1874
1874
|
|
|
1875
|
+
program
|
|
1876
|
+
.command("context-propose")
|
|
1877
|
+
.description("Propose the App Context from a JSON file (e.g. read from an existing repo). It counts only when a member approves it in the web app: Requirements → App Context")
|
|
1878
|
+
.requiredOption("-f, --file <path>", "JSON with App Context fields (shape: qatools context-template)")
|
|
1879
|
+
.option("--summary <text>", "What the proposal is based on")
|
|
1880
|
+
.option("--project <id>", "Target project ID (overrides default)")
|
|
1881
|
+
.option("-e, --email <email>", "Login email")
|
|
1882
|
+
.option("-p, --password <password>", "Login password")
|
|
1883
|
+
.action(async (options) => {
|
|
1884
|
+
await authenticate(options);
|
|
1885
|
+
const projectId = options.project || getCredentials()?.projectId;
|
|
1886
|
+
if (!projectId) { console.error("No project configured. Run: qatools setup, or pass --project <id>"); process.exit(1); }
|
|
1887
|
+
let context;
|
|
1888
|
+
try { context = JSON.parse(fs.readFileSync(options.file, "utf8")); }
|
|
1889
|
+
catch (e) { console.error(`Could not read ${options.file}: ${e.message}`); process.exit(1); }
|
|
1890
|
+
for (const k of ["id", "projectId", "name", "aiRules", "sections", "skills", "createdAt", "updatedAt"]) delete context[k];
|
|
1891
|
+
try {
|
|
1892
|
+
const { data } = await httpsCallable(functions, "proposeAppContext")({ projectId, context, summary: options.summary || "" });
|
|
1893
|
+
console.log(`Proposed App Context (${data.fields.join(", ")})${data.superseded ? ` — replaces ${data.superseded} earlier pending proposal(s)` : ""}.`);
|
|
1894
|
+
console.log("A project member approves or rejects it in qa-tools: Requirements → App Context.");
|
|
1895
|
+
} catch (e) {
|
|
1896
|
+
console.error("Failed:", e.message);
|
|
1897
|
+
process.exit(1);
|
|
1898
|
+
}
|
|
1899
|
+
process.exit(0);
|
|
1900
|
+
});
|
|
1901
|
+
|
|
1875
1902
|
program
|
|
1876
1903
|
.command("plan-reject")
|
|
1877
1904
|
.description("Reject (withdraw) a pending sprint-plan proposal — nothing gets planned. Approving is done in the web app only.")
|
|
@@ -4478,6 +4505,15 @@ const mcpTools = [
|
|
|
4478
4505
|
}, ["subject", "message"]),
|
|
4479
4506
|
run: async (a) => mcpCall("notifyUser", { projectId: a.projectId, to: "owner", subject: a.subject, message: a.message }),
|
|
4480
4507
|
},
|
|
4508
|
+
{
|
|
4509
|
+
name: "propose_app_context",
|
|
4510
|
+
description: "Propose the project's App Context (purpose, domainObjects, actors, stack, architecture, security, constraints, conventions, environments, integrations), e.g. read from an existing repo. Only what the code shows. It counts only when a member approves it in the web app; a newer proposal replaces a pending older one.",
|
|
4511
|
+
inputSchema: mcpSchema({
|
|
4512
|
+
context: { type: "object", description: "App Context fields, shape as qatools context-template (stack: [{layer, technology, version, notes}], conventions: [{area, rule}], environments: [{name, url, notes}], integrations: [{name, purpose}], domainObjects/actors/constraints: string arrays)" },
|
|
4513
|
+
summary: mcpStr("What the proposal is based on (files read)"),
|
|
4514
|
+
}, ["context"]),
|
|
4515
|
+
run: async (a) => mcpCall("proposeAppContext", { projectId: a.projectId, context: a.context, summary: a.summary || "" }),
|
|
4516
|
+
},
|
|
4481
4517
|
{
|
|
4482
4518
|
name: "reject_plan_proposal",
|
|
4483
4519
|
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.",
|
|
@@ -4657,6 +4693,141 @@ const mcpTools = [
|
|
|
4657
4693
|
inputSchema: mcpSchema({ platform: mcpStr("azure, gcp, aws or firebase (default: from the App Context)", { enum: ["azure", "gcp", "aws", "firebase"] }) }),
|
|
4658
4694
|
run: async (a) => (await mcpCall("getInfraPrompt", { projectId: a.projectId, platform: a.platform || "" })).prompt,
|
|
4659
4695
|
},
|
|
4696
|
+
// ---- cli.mcp-parity: the CLI's project-data commands, through the same backend functions ----
|
|
4697
|
+
{
|
|
4698
|
+
name: "update_project",
|
|
4699
|
+
description: "Change the project's name or description (owner).",
|
|
4700
|
+
inputSchema: mcpSchema({ name: mcpStr("New name"), description: mcpStr("New description") }),
|
|
4701
|
+
run: async (a) => {
|
|
4702
|
+
const updates = mcpPick(a, ["name", "description"]);
|
|
4703
|
+
if (!Object.keys(updates).length) throw new McpToolError("Give name and/or description.");
|
|
4704
|
+
return mcpCall("updateProjectFields", { projectId: a.projectId, updates });
|
|
4705
|
+
},
|
|
4706
|
+
},
|
|
4707
|
+
{
|
|
4708
|
+
name: "add_member",
|
|
4709
|
+
description: "Add a member to the project by email; they get an invitation email. Owner only.",
|
|
4710
|
+
inputSchema: mcpSchema({ email: mcpStr("The member's email") }, ["email"]),
|
|
4711
|
+
run: async (a) => mcpCall("addProjectMember", { projectId: a.projectId, email: a.email }),
|
|
4712
|
+
},
|
|
4713
|
+
{
|
|
4714
|
+
name: "remove_member",
|
|
4715
|
+
description: "Remove a member from the project (the owner cannot be removed). Destructive: confirm with the user in this conversation before calling.",
|
|
4716
|
+
inputSchema: mcpSchema({ email: mcpStr("The member's email") }, ["email"]),
|
|
4717
|
+
run: async (a) => mcpCall("removeProjectMember", { projectId: a.projectId, email: a.email }),
|
|
4718
|
+
},
|
|
4719
|
+
{
|
|
4720
|
+
name: "delete_requirement",
|
|
4721
|
+
description: "Delete a requirement — only for junk (duplicate, created by mistake, wrong project). A requirement that was considered and turned out wrong is set to rejected or superseded with update_requirement instead. Refused while backlog items or tests reference its key unless force. Destructive: confirm with the user first.",
|
|
4722
|
+
inputSchema: mcpSchema({ requirementId: mcpStr("Requirement document id"), force: mcpBool("Delete even though items or tests reference it — re-point them first") }, ["requirementId"]),
|
|
4723
|
+
run: async (a) => mcpCall("deleteRequirement", { projectId: a.projectId, requirementId: a.requirementId, force: !!a.force }),
|
|
4724
|
+
},
|
|
4725
|
+
{
|
|
4726
|
+
name: "delete_epic",
|
|
4727
|
+
description: "Delete an epic by key. Refused while requirements belong to it. Destructive: confirm with the user first.",
|
|
4728
|
+
inputSchema: mcpSchema({ epicKey: mcpStr("Epic key") }, ["epicKey"]),
|
|
4729
|
+
run: async (a) => {
|
|
4730
|
+
const epic = ((await mcpCall("listEpics", { projectId: a.projectId })).epics || []).find(e => e.key === a.epicKey);
|
|
4731
|
+
if (!epic) throw new McpToolError(`Epic '${a.epicKey}' not found.`);
|
|
4732
|
+
return mcpCall("deleteEpic", { projectId: a.projectId, epicId: epic.id });
|
|
4733
|
+
},
|
|
4734
|
+
},
|
|
4735
|
+
{
|
|
4736
|
+
name: "requirement_coverage",
|
|
4737
|
+
description: "Per requirement: its manual test cases and automated test runs, and which ones verify it.",
|
|
4738
|
+
inputSchema: mcpSchema(),
|
|
4739
|
+
run: async (a) => mcpCall("requirementCoverage", { projectId: a.projectId }),
|
|
4740
|
+
},
|
|
4741
|
+
{
|
|
4742
|
+
name: "list_requirement_keys",
|
|
4743
|
+
description: "Every requirement key in use in the project's test protocols and backlog, with where it is used.",
|
|
4744
|
+
inputSchema: mcpSchema(),
|
|
4745
|
+
run: async (a) => mcpCall("listRequirementKeys", { projectId: a.projectId }),
|
|
4746
|
+
},
|
|
4747
|
+
{
|
|
4748
|
+
name: "reject_template",
|
|
4749
|
+
description: "Reject a test protocol (version) with a reason; it can no longer be started as a session.",
|
|
4750
|
+
inputSchema: mcpSchema({ templateId: mcpStr("Test protocol id"), reason: mcpStr("Why — at least a few words") }, ["templateId", "reason"]),
|
|
4751
|
+
run: async (a) => mcpCall("rejectTemplate", { projectId: a.projectId, templateId: a.templateId, reason: a.reason }),
|
|
4752
|
+
},
|
|
4753
|
+
{
|
|
4754
|
+
name: "upload_test_report",
|
|
4755
|
+
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.",
|
|
4756
|
+
inputSchema: mcpSchema({ file: mcpStr("Path to the results file"), format: mcpStr("junit or json (default: from the file extension)", { enum: ["junit", "json"] }) }, ["file"]),
|
|
4757
|
+
run: async (a) => {
|
|
4758
|
+
const filePath = path.resolve(a.file);
|
|
4759
|
+
if (!fs.existsSync(filePath)) throw new McpToolError(`File not found: ${filePath}`);
|
|
4760
|
+
const text = fs.readFileSync(filePath, "utf-8");
|
|
4761
|
+
const format = a.format || (/\.json$/i.test(filePath) ? "json" : "junit");
|
|
4762
|
+
const results = format === "json" ? parseTestJson(JSON.parse(text)) : parseJUnit(text);
|
|
4763
|
+
if (!results.length) throw new McpToolError("No test results found in the file.");
|
|
4764
|
+
return mcpCall("uploadTestRun", { projectId: a.projectId, run: ciRunMeta({}), results });
|
|
4765
|
+
},
|
|
4766
|
+
},
|
|
4767
|
+
{
|
|
4768
|
+
name: "find_duplicates",
|
|
4769
|
+
description: "Find backlog items that look like duplicates of each other (uses the project's Anthropic key on the server).",
|
|
4770
|
+
inputSchema: mcpSchema(),
|
|
4771
|
+
run: async (a) => mcpCall("findDuplicates", { projectId: a.projectId }),
|
|
4772
|
+
},
|
|
4773
|
+
{
|
|
4774
|
+
name: "import_security_scan",
|
|
4775
|
+
description: "Import a SARIF file from a security scanner on this computer; each finding becomes a technical defect (DEF) linked to the project, duplicates skipped.",
|
|
4776
|
+
inputSchema: mcpSchema({ file: mcpStr("Path to the SARIF file"), source: mcpStr("Scanner name, e.g. codeql") }, ["file"]),
|
|
4777
|
+
run: async (a) => {
|
|
4778
|
+
const filePath = path.resolve(a.file);
|
|
4779
|
+
if (!fs.existsSync(filePath)) throw new McpToolError(`File not found: ${filePath}`);
|
|
4780
|
+
return mcpCall("importSecurityScan", { projectId: a.projectId, sarif: JSON.parse(fs.readFileSync(filePath, "utf-8")), source: a.source || "" });
|
|
4781
|
+
},
|
|
4782
|
+
},
|
|
4783
|
+
{
|
|
4784
|
+
name: "set_app_context",
|
|
4785
|
+
description: "Replace the project's App Context. Read it with get_app_context first, change what the user asked for, and send the whole object back — fields left out are lost. Show the change to the user before saving.",
|
|
4786
|
+
inputSchema: mcpSchema({ context: { type: "object", description: "The whole App Context", additionalProperties: true } }, ["context"]),
|
|
4787
|
+
run: async (a) => mcpCall("saveAppContext", { projectId: a.projectId, context: a.context }),
|
|
4788
|
+
},
|
|
4789
|
+
{
|
|
4790
|
+
name: "get_access_model",
|
|
4791
|
+
description: "The project's access model: roles and what each may do.",
|
|
4792
|
+
inputSchema: mcpSchema(),
|
|
4793
|
+
run: async (a) => mcpCall("getAccessModel", { projectId: a.projectId }),
|
|
4794
|
+
},
|
|
4795
|
+
{
|
|
4796
|
+
name: "set_access_model",
|
|
4797
|
+
description: "Replace the project's access model (roles and permissions). Read it with get_access_model first and show the change to the user before saving.",
|
|
4798
|
+
inputSchema: mcpSchema({ model: { type: "object", description: "The whole access model", additionalProperties: true } }, ["model"]),
|
|
4799
|
+
run: async (a) => mcpCall("saveAccessModel", { projectId: a.projectId, model: a.model }),
|
|
4800
|
+
},
|
|
4801
|
+
{
|
|
4802
|
+
name: "decline_feature_request",
|
|
4803
|
+
description: "Decline a request from the app's users with a reason the app shows them. A member's decision: refused for Claude's API key — use the member's own login, or ask the user to decline it.",
|
|
4804
|
+
inputSchema: mcpSchema({ id: mcpStr("The request's id in the app (externalId)"), reason: mcpStr("Why — shown to the app's users") }, ["id", "reason"]),
|
|
4805
|
+
run: async (a) => mcpCall("decideFeatureRequest", { projectId: a.projectId, externalId: a.id, action: "decline", reason: a.reason }),
|
|
4806
|
+
},
|
|
4807
|
+
{
|
|
4808
|
+
name: "list_skill_library",
|
|
4809
|
+
description: "The shared skill library: skills that can be added to a project's App Context.",
|
|
4810
|
+
inputSchema: mcpSchema(),
|
|
4811
|
+
run: async () => mcpCall("listSkillLibrary", {}),
|
|
4812
|
+
},
|
|
4813
|
+
{
|
|
4814
|
+
name: "get_library_skill",
|
|
4815
|
+
description: "Read one skill from the shared skill library.",
|
|
4816
|
+
inputSchema: mcpSchema({ name: mcpStr("Skill name") }, ["name"]),
|
|
4817
|
+
run: async (a) => mcpCall("getLibrarySkill", { name: a.name }),
|
|
4818
|
+
},
|
|
4819
|
+
{
|
|
4820
|
+
name: "save_library_skill",
|
|
4821
|
+
description: "Add or update a skill in the shared skill library (superadmin).",
|
|
4822
|
+
inputSchema: mcpSchema({ name: mcpStr("Skill name (file name without .md)"), title: mcpStr("Title"), description: mcpStr("One line about it"), content: mcpStr("The skill's markdown") }, ["name", "title", "content"]),
|
|
4823
|
+
run: async (a) => mcpCall("saveLibrarySkill", { name: a.name, title: a.title, description: a.description || "", content: a.content }),
|
|
4824
|
+
},
|
|
4825
|
+
{
|
|
4826
|
+
name: "delete_library_skill",
|
|
4827
|
+
description: "Remove a skill from the shared skill library (superadmin). Destructive: confirm with the user first.",
|
|
4828
|
+
inputSchema: mcpSchema({ name: mcpStr("Skill name") }, ["name"]),
|
|
4829
|
+
run: async (a) => mcpCall("deleteLibrarySkill", { name: a.name }),
|
|
4830
|
+
},
|
|
4660
4831
|
{
|
|
4661
4832
|
name: "baseline_prompt",
|
|
4662
4833
|
description: "Procedure for reconstructing requirements for what is already built (requirements.baseline-from-code), with the project's language, its epics and all existing requirements. Use when code exists that qa-tools has no requirements for.",
|