qatools-cli 1.2.41 → 1.2.42
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/brief.js +3 -1
- package/mcp-core.js +1 -1
- package/package.json +1 -1
- package/qatools.js +15 -3
package/brief.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// context.session-brief: the short brief a Claude session starts with. Pure: data in, text out (at most 30 lines).
|
|
2
2
|
const MAX_LINES = 30;
|
|
3
3
|
|
|
4
|
-
function renderBrief({ projectName = "", requirements = [], agenda = null, requests = [], branch = "", branchKeys = [], main = "" }) {
|
|
4
|
+
function renderBrief({ projectName = "", requirements = [], agenda = null, requests = [], branch = "", branchKeys = [], main = "", warnings = [] }) {
|
|
5
5
|
const lines = [`qa-tools brief${projectName ? ` — ${projectName}` : ""} (read this before you start)`];
|
|
6
|
+
// cli.self-upgrade: out of date first — upgrade yourself (qa-purpose skill: Keeping qa-tools current)
|
|
7
|
+
for (const w of warnings.slice(0, 2)) lines.push(`⚠ ${w} Upgrade yourself, then tell the person in one line.`);
|
|
6
8
|
const verified = (r) => r.status === "implemented" || r.status === "tested";
|
|
7
9
|
const who = (e) => /^claude@[^@]+\.qatools$/i.test(String(e || "")) ? "Claude" : (e || "nobody");
|
|
8
10
|
|
package/mcp-core.js
CHANGED
|
@@ -1080,7 +1080,7 @@ async function mcpHandle(msg, defaultProjectId) {
|
|
|
1080
1080
|
protocolVersion: MCP_PROTOCOL_VERSIONS.includes(requested) ? requested : MCP_PROTOCOL_VERSIONS[0],
|
|
1081
1081
|
capabilities: { tools: { listChanged: false }, prompts: { listChanged: false } },
|
|
1082
1082
|
serverInfo: { name: "qatools", version: env.version || "" },
|
|
1083
|
-
instructions: instructions + (warnings().length ? "\n- OUT OF DATE
|
|
1083
|
+
instructions: instructions + (warnings().length ? "\n- OUT OF DATE: " + warnings().join(" ") + " Upgrade yourself (npm install -g qatools-cli@latest, then qatools init in the repo, commit the .claude changes) and tell the user in one line — unless this is an unattended run, which never upgrades mid-run." : ""),
|
|
1084
1084
|
};
|
|
1085
1085
|
}
|
|
1086
1086
|
if (method === "ping") return {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qatools-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.42",
|
|
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
|
@@ -70,6 +70,17 @@ When \`qatools\` says "No credentials" or that the repo needs Claude's own login
|
|
|
70
70
|
|
|
71
71
|
Never ask for the key in the chat, never print or \`cat\` the file, never put it in the repo. Use it only as an environment variable (\`$env:QATOOLS_API_KEY = (Get-Content <file> -Raw).Trim()\`), or log a project-own home folder in with it for the MCP server (\`$env:HOME = <folder>; qatools login --api-key (Get-Content <file> -Raw).Trim()\`) and point the repo's MCP config at that folder. Then \`qatools brief\` must show the project and Claude.
|
|
72
72
|
|
|
73
|
+
## Keeping qa-tools current
|
|
74
|
+
|
|
75
|
+
When the brief, a \`qatools\` command or the MCP server says qatools-cli or this repo's qa-tools skills are out of date, upgrade yourself — the person should not have to tell you:
|
|
76
|
+
|
|
77
|
+
1. \`npm install -g qatools-cli@latest\`
|
|
78
|
+
2. \`qatools init\` in the repo (updates .claude/skills and the hooks; with the repo's own Claude login it changes nothing else).
|
|
79
|
+
3. Commit only the updated .claude files (chore: qa-tools skills <version>), following the repo's branch rules.
|
|
80
|
+
4. Tell the person in one line: "Upgraded qatools-cli to <version>."
|
|
81
|
+
|
|
82
|
+
Never upgrade in an unattended run (nobody at the keyboard, e.g. a scheduled loop run): it must not change versions mid-run. Mention it in the run's summary instead.
|
|
83
|
+
|
|
73
84
|
That standard rules out:
|
|
74
85
|
- Guessing when verification is possible
|
|
75
86
|
- "Looks right" without numbers
|
|
@@ -627,7 +638,7 @@ async function latestPublishedVersion() {
|
|
|
627
638
|
const file = path.join(process.env.HOME || process.env.USERPROFILE || ".", UPDATE_CHECK_FILE);
|
|
628
639
|
try {
|
|
629
640
|
const c = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
630
|
-
if (c.latest && Date.now() - c.checkedAt <
|
|
641
|
+
if (c.latest && Date.now() - c.checkedAt < 3600 * 1000) return c.latest; // cli.self-upgrade: a new version is noticed within the hour
|
|
631
642
|
} catch {}
|
|
632
643
|
try {
|
|
633
644
|
const ctrl = new AbortController();
|
|
@@ -1568,8 +1579,9 @@ program
|
|
|
1568
1579
|
}
|
|
1569
1580
|
} catch {}
|
|
1570
1581
|
const { renderBrief } = require("./brief");
|
|
1582
|
+
const warnings = await staleWarnings().catch(() => []); // cli.self-upgrade: the session sees it first thing
|
|
1571
1583
|
console.log(renderBrief({ projectName: creds?.projectName || "", requirements, agenda: agendaRes?.agenda || null,
|
|
1572
|
-
requests: reqsRes?.requests || [], branch, main, branchKeys }));
|
|
1584
|
+
requests: reqsRes?.requests || [], branch, main, branchKeys, warnings }));
|
|
1573
1585
|
process.exit(0);
|
|
1574
1586
|
} catch (e) {
|
|
1575
1587
|
quietExit("Failed: " + e.message);
|
|
@@ -4536,7 +4548,7 @@ program
|
|
|
4536
4548
|
});
|
|
4537
4549
|
|
|
4538
4550
|
program.hook("preAction", async (_root, cmd) => {
|
|
4539
|
-
if (cmd.name() === "mcp") return; // the MCP server reports through instructions and get_agenda
|
|
4551
|
+
if (cmd.name() === "mcp" || cmd.name() === "brief") return; // the MCP server reports through instructions and get_agenda, the brief in its own text
|
|
4540
4552
|
for (const w of await staleWarnings({ skipSkills: cmd.name() === "init" })) console.error(`⚠ ${w}`);
|
|
4541
4553
|
});
|
|
4542
4554
|
|