@agents-forge/aiqa 1.0.0
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/CLAUDE.md +112 -0
- package/README.md +281 -0
- package/dist/agent.d.ts +41 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +485 -0
- package/dist/agent.js.map +1 -0
- package/dist/cli.d.ts +13 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +195 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +59 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +53 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/session.d.ts +50 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +99 -0
- package/dist/session.js.map +1 -0
- package/dist/subagents/analyst.d.ts +3 -0
- package/dist/subagents/analyst.d.ts.map +1 -0
- package/dist/subagents/analyst.js +96 -0
- package/dist/subagents/analyst.js.map +1 -0
- package/dist/subagents/qa-engineer.d.ts +4 -0
- package/dist/subagents/qa-engineer.d.ts.map +1 -0
- package/dist/subagents/qa-engineer.js +139 -0
- package/dist/subagents/qa-engineer.js.map +1 -0
- package/dist/subagents/qa-planner.d.ts +3 -0
- package/dist/subagents/qa-planner.d.ts.map +1 -0
- package/dist/subagents/qa-planner.js +69 -0
- package/dist/subagents/qa-planner.js.map +1 -0
- package/dist/subagents/qa-reporter.d.ts +4 -0
- package/dist/subagents/qa-reporter.d.ts.map +1 -0
- package/dist/subagents/qa-reporter.js +94 -0
- package/dist/subagents/qa-reporter.js.map +1 -0
- package/dist/subagents/qa-reviewer.d.ts +3 -0
- package/dist/subagents/qa-reviewer.d.ts.map +1 -0
- package/dist/subagents/qa-reviewer.js +97 -0
- package/dist/subagents/qa-reviewer.js.map +1 -0
- package/package.json +65 -0
package/dist/agent.js
ADDED
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
import * as readline from "node:readline/promises";
|
|
5
|
+
import { execSync } from "child_process";
|
|
6
|
+
import { SessionManager } from "./session.js";
|
|
7
|
+
import { resolvePaths } from "./config.js";
|
|
8
|
+
import { buildAnalystPrompt } from "./subagents/analyst.js";
|
|
9
|
+
import { buildQAPlannerPrompt } from "./subagents/qa-planner.js";
|
|
10
|
+
import { buildQAEngineerPrompt } from "./subagents/qa-engineer.js";
|
|
11
|
+
import { buildQAReviewerPrompt } from "./subagents/qa-reviewer.js";
|
|
12
|
+
import { buildQAReporterPrompt } from "./subagents/qa-reporter.js";
|
|
13
|
+
// ─── Provider detection ───────────────────────────────────────────────────────
|
|
14
|
+
export function detectProvider() {
|
|
15
|
+
if (process.env.ANTHROPIC_API_KEY || process.env.ANTHROPIC_AUTH_TOKEN)
|
|
16
|
+
return "anthropic";
|
|
17
|
+
try {
|
|
18
|
+
execSync("claude --version", { stdio: "ignore" });
|
|
19
|
+
return "anthropic";
|
|
20
|
+
}
|
|
21
|
+
catch { }
|
|
22
|
+
try {
|
|
23
|
+
const token = execSync("gh auth token", { stdio: ["ignore", "pipe", "ignore"] }).toString().trim();
|
|
24
|
+
if (token)
|
|
25
|
+
return "copilot";
|
|
26
|
+
}
|
|
27
|
+
catch { }
|
|
28
|
+
return "anthropic";
|
|
29
|
+
}
|
|
30
|
+
// ─── Playwright CLI check ─────────────────────────────────────────────────────
|
|
31
|
+
function checkPlaywrightCLI() {
|
|
32
|
+
try {
|
|
33
|
+
execSync("playwright-cli --version", { stdio: "ignore" });
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function ensurePlaywrightSkills(cwd) {
|
|
41
|
+
const skillsPath = path.join(cwd, ".playwright-cli");
|
|
42
|
+
if (!fs.existsSync(skillsPath)) {
|
|
43
|
+
try {
|
|
44
|
+
console.log("📚 Installing playwright-cli skills...");
|
|
45
|
+
execSync("playwright-cli install --skills", { cwd, stdio: "inherit" });
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
console.log("⚠️ Could not install playwright-cli skills — continuing");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// ─── Step / snapshot bookkeeping ──────────────────────────────────────────────
|
|
53
|
+
const PIPELINE_STEPS = [
|
|
54
|
+
"analyst",
|
|
55
|
+
"qa-planner",
|
|
56
|
+
"qa-engineer",
|
|
57
|
+
"qa-reviewer",
|
|
58
|
+
"qa-reporter",
|
|
59
|
+
];
|
|
60
|
+
/**
|
|
61
|
+
* A step is "done" iff its output artifact actually exists on disk.
|
|
62
|
+
* This is far more reliable than matching streamed model text.
|
|
63
|
+
*/
|
|
64
|
+
function stepOutputExists(step, session) {
|
|
65
|
+
const o = session.outputs;
|
|
66
|
+
switch (step) {
|
|
67
|
+
case "analyst":
|
|
68
|
+
return fs.existsSync(o.requirements);
|
|
69
|
+
case "qa-planner":
|
|
70
|
+
return fs.existsSync(o.testPlan);
|
|
71
|
+
case "qa-engineer":
|
|
72
|
+
return fs.existsSync(o.specsDir) &&
|
|
73
|
+
fs.readdirSync(o.specsDir).some((f) => f.endsWith(".spec.ts"));
|
|
74
|
+
case "qa-reviewer":
|
|
75
|
+
return fs.existsSync(o.reviewReport);
|
|
76
|
+
case "qa-reporter":
|
|
77
|
+
return fs.existsSync(o.summaryReport);
|
|
78
|
+
default:
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** Scan the snapshots dir and register every .yml into the session. */
|
|
83
|
+
function registerSnapshotsFromDisk(sessionMgr) {
|
|
84
|
+
const dir = sessionMgr.get().outputs.snapshotsDir;
|
|
85
|
+
if (!fs.existsSync(dir))
|
|
86
|
+
return;
|
|
87
|
+
for (const file of fs.readdirSync(dir)) {
|
|
88
|
+
if (file.endsWith(".yml")) {
|
|
89
|
+
const page = path.basename(file, ".yml");
|
|
90
|
+
sessionMgr.addSnapshot(page, "", path.join(dir, file));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// ─── playwright.config.ts overwrite guard ─────────────────────────────────────
|
|
95
|
+
const GUARDED_FILE = "playwright.config.ts";
|
|
96
|
+
/** Prompt y/N on the terminal. Non-interactive (no TTY) returns false. */
|
|
97
|
+
async function confirm(question) {
|
|
98
|
+
if (!process.stdin.isTTY)
|
|
99
|
+
return false;
|
|
100
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
101
|
+
try {
|
|
102
|
+
const ans = (await rl.question(question)).trim().toLowerCase();
|
|
103
|
+
return ans === "y" || ans === "yes";
|
|
104
|
+
}
|
|
105
|
+
finally {
|
|
106
|
+
rl.close();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Decide upfront whether an existing playwright.config.ts must be protected.
|
|
111
|
+
* We can't intercept the agent's write mid-stream (canUseTool only works in the
|
|
112
|
+
* SDK's streaming-input mode, not with a string prompt), so instead we ask once,
|
|
113
|
+
* before the run, and tell the agent not to touch the file.
|
|
114
|
+
*
|
|
115
|
+
* Returns true when the existing config must be left untouched.
|
|
116
|
+
*/
|
|
117
|
+
async function decideConfigProtection(workingDir, force) {
|
|
118
|
+
const configPath = path.join(workingDir, GUARDED_FILE);
|
|
119
|
+
if (!fs.existsSync(configPath))
|
|
120
|
+
return false; // nothing to protect
|
|
121
|
+
if (force) {
|
|
122
|
+
console.log(`⚠️ Existing ${GUARDED_FILE} may be overwritten (--force).`);
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
console.log(`\n⚠️ An existing ${GUARDED_FILE} was found in this project:`);
|
|
126
|
+
console.log(` ${configPath}`);
|
|
127
|
+
const overwrite = await confirm(` Allow AIQA to overwrite it during this run? [y/N] `);
|
|
128
|
+
if (overwrite) {
|
|
129
|
+
console.log(` → It may be regenerated.\n`);
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
console.log(` → Keeping your existing ${GUARDED_FILE}; AIQA will use it as-is.\n`);
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
/** Concise one-line progress label for a tool call, shown live during the run. */
|
|
136
|
+
function formatToolProgress(name, input, workingDir) {
|
|
137
|
+
const rel = (p) => {
|
|
138
|
+
const s = String(p ?? "");
|
|
139
|
+
try {
|
|
140
|
+
return path.relative(workingDir, s) || s;
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return s;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
switch (name) {
|
|
147
|
+
case "Bash": {
|
|
148
|
+
const cmd = String(input?.command ?? "").replace(/\s+/g, " ").trim();
|
|
149
|
+
return ` ⏳ ${cmd.length > 100 ? cmd.slice(0, 100) + "…" : cmd}`;
|
|
150
|
+
}
|
|
151
|
+
case "Write": return ` 📝 writing ${rel(input?.file_path)}`;
|
|
152
|
+
case "Edit":
|
|
153
|
+
case "MultiEdit": return ` ✏️ editing ${rel(input?.file_path)}`;
|
|
154
|
+
case "Read": return ` 📖 reading ${rel(input?.file_path)}`;
|
|
155
|
+
case "Glob": return ` 🔍 glob ${String(input?.pattern ?? "")}`;
|
|
156
|
+
case "Grep": return ` 🔍 grep ${String(input?.pattern ?? "")}`;
|
|
157
|
+
case "WebFetch": return ` 🌐 ${String(input?.url ?? "")}`;
|
|
158
|
+
case "WebSearch": return ` 🔎 ${String(input?.query ?? "")}`;
|
|
159
|
+
default: return ` 🔧 ${name}`;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// ─── Open generated docs in VS Code (--open) ─────────────────────────────────
|
|
163
|
+
const MD_PREVIEW_EDITOR = "vscode.markdown.preview.editor";
|
|
164
|
+
function isVSCode() {
|
|
165
|
+
return (process.env.TERM_PROGRAM === "vscode" ||
|
|
166
|
+
!!process.env.VSCODE_PID ||
|
|
167
|
+
!!process.env.VSCODE_GIT_IPC_HANDLE);
|
|
168
|
+
}
|
|
169
|
+
function codeCliAvailable() {
|
|
170
|
+
try {
|
|
171
|
+
execSync("code --version", { stdio: "ignore" });
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Add a `*.md → Markdown preview` editor association to the project's
|
|
180
|
+
* .vscode/settings.json so `code <file>.md` opens rendered. Never clobbers a
|
|
181
|
+
* settings.json it can't safely parse (e.g. one containing comments).
|
|
182
|
+
*/
|
|
183
|
+
function ensureMarkdownPreviewAssociation(workingDir) {
|
|
184
|
+
const vscodeDir = path.join(workingDir, ".vscode");
|
|
185
|
+
const settingsPath = path.join(vscodeDir, "settings.json");
|
|
186
|
+
if (fs.existsSync(settingsPath)) {
|
|
187
|
+
const raw = fs.readFileSync(settingsPath, "utf-8");
|
|
188
|
+
let parsed;
|
|
189
|
+
try {
|
|
190
|
+
parsed = JSON.parse(raw);
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
if (!raw.includes(MD_PREVIEW_EDITOR)) {
|
|
194
|
+
console.log(`⚠️ --open: couldn't safely edit ${path.relative(workingDir, settingsPath)} (has comments). Add this manually:`);
|
|
195
|
+
console.log(` "workbench.editorAssociations": { "*.md": "${MD_PREVIEW_EDITOR}" }`);
|
|
196
|
+
return "manual";
|
|
197
|
+
}
|
|
198
|
+
return "exists";
|
|
199
|
+
}
|
|
200
|
+
const assoc = (parsed["workbench.editorAssociations"] ??= {});
|
|
201
|
+
if (assoc["*.md"] === MD_PREVIEW_EDITOR)
|
|
202
|
+
return "exists";
|
|
203
|
+
assoc["*.md"] = MD_PREVIEW_EDITOR;
|
|
204
|
+
fs.writeFileSync(settingsPath, JSON.stringify(parsed, null, 2), "utf-8");
|
|
205
|
+
return "updated";
|
|
206
|
+
}
|
|
207
|
+
fs.mkdirSync(vscodeDir, { recursive: true });
|
|
208
|
+
fs.writeFileSync(settingsPath, JSON.stringify({ "workbench.editorAssociations": { "*.md": MD_PREVIEW_EDITOR } }, null, 2), "utf-8");
|
|
209
|
+
return "created";
|
|
210
|
+
}
|
|
211
|
+
/** Open the generated markdown deliverables in VS Code's Markdown preview. */
|
|
212
|
+
function openGeneratedDocs(workingDir, files) {
|
|
213
|
+
if (!isVSCode()) {
|
|
214
|
+
console.log("ℹ️ --open: not running inside VS Code — skipping.");
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
if (!codeCliAvailable()) {
|
|
218
|
+
console.log("ℹ️ --open: the `code` CLI isn't on PATH — skipping. (In VS Code: run 'Shell Command: Install code command in PATH'.)");
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const state = ensureMarkdownPreviewAssociation(workingDir);
|
|
222
|
+
if (state === "created" || state === "updated") {
|
|
223
|
+
console.log(`📝 --open: set '*.md → Markdown preview' in ${path.join(".vscode", "settings.json")}.`);
|
|
224
|
+
}
|
|
225
|
+
const existing = files.filter((f) => fs.existsSync(f));
|
|
226
|
+
for (const f of existing) {
|
|
227
|
+
try {
|
|
228
|
+
execSync(`code "${f}"`, { stdio: "ignore" });
|
|
229
|
+
}
|
|
230
|
+
catch { }
|
|
231
|
+
}
|
|
232
|
+
if (existing.length)
|
|
233
|
+
console.log(`📖 --open: opened ${existing.length} doc(s) in VS Code Markdown preview.`);
|
|
234
|
+
}
|
|
235
|
+
// ─── System prompt ────────────────────────────────────────────────────────────
|
|
236
|
+
function buildSystemPrompt(sessionMgr, skip, playwrightCliAvailable, grep, protectConfig = false, existingRequirements, paths = resolvePaths()) {
|
|
237
|
+
const session = sessionMgr.get();
|
|
238
|
+
return `You are AIQA — AI Assisted Quality Super Agent, acting as a Team Lead of Business Analyst & QA specialists.
|
|
239
|
+
You run the full QA pipeline for "${session.target}" in a single session.
|
|
240
|
+
All context flows in memory between steps — no need to re-read files between steps unless needed.
|
|
241
|
+
|
|
242
|
+
## Session
|
|
243
|
+
- Run ID: ${session.runId}
|
|
244
|
+
- Target: ${session.target}
|
|
245
|
+
- Base URL: ${session.baseUrl}
|
|
246
|
+
- Session file: ${session.outputs.sessionFile}
|
|
247
|
+
- Snapshots dir: ${session.outputs.snapshotsDir}
|
|
248
|
+
|
|
249
|
+
## playwright-cli status: ${playwrightCliAvailable ? "✅ Available" : "⚠️ Not available — install with: npm install -g @playwright/cli@latest"}
|
|
250
|
+
${protectConfig ? `
|
|
251
|
+
## ⚠️ EXISTING playwright.config.ts — DO NOT MODIFY
|
|
252
|
+
The user has an existing playwright.config.ts and chose to keep it. You MUST NOT create,
|
|
253
|
+
write, overwrite, edit, or delete playwright.config.ts. Use the existing file as-is when
|
|
254
|
+
running tests. All OTHER output files should be written as normal.
|
|
255
|
+
` : ""}
|
|
256
|
+
## Pipeline Steps
|
|
257
|
+
Run these steps IN ORDER. Skip any step listed in: [${skip.join(", ") || "none"}]
|
|
258
|
+
|
|
259
|
+
${!skip.includes("analyst") ? `
|
|
260
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
261
|
+
STEP 1 — ANALYST
|
|
262
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
263
|
+
${buildAnalystPrompt(session, existingRequirements)}
|
|
264
|
+
` : "STEP 1 — ANALYST: SKIPPED"}
|
|
265
|
+
|
|
266
|
+
${!skip.includes("qa-planner") ? `
|
|
267
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
268
|
+
STEP 2 — QA PLANNER
|
|
269
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
270
|
+
${buildQAPlannerPrompt(session)}
|
|
271
|
+
` : "STEP 2 — QA PLANNER: SKIPPED"}
|
|
272
|
+
|
|
273
|
+
${!skip.includes("qa-engineer") ? `
|
|
274
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
275
|
+
STEP 3 — QA ENGINEER
|
|
276
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
277
|
+
${buildQAEngineerPrompt(session, paths)}
|
|
278
|
+
` : "STEP 3 — QA ENGINEER: SKIPPED"}
|
|
279
|
+
|
|
280
|
+
${!skip.includes("qa-reviewer") ? `
|
|
281
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
282
|
+
STEP 4 — QA REVIEWER
|
|
283
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
284
|
+
${buildQAReviewerPrompt(session)}
|
|
285
|
+
` : "STEP 4 — QA REVIEWER: SKIPPED"}
|
|
286
|
+
|
|
287
|
+
${!skip.includes("qa-reporter") ? `
|
|
288
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
289
|
+
STEP 5 — QA REPORTER
|
|
290
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
291
|
+
${buildQAReporterPrompt(session, grep, paths)}
|
|
292
|
+
` : "STEP 5 — QA REPORTER: SKIPPED"}
|
|
293
|
+
|
|
294
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
295
|
+
GLOBAL RULES
|
|
296
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
297
|
+
|
|
298
|
+
1. Always announce which step you are starting with a clear header
|
|
299
|
+
2. After completing each step — confirm the output file was written with its size
|
|
300
|
+
3. Use snapshots from the analyst step in ALL subsequent steps
|
|
301
|
+
4. If you hit a problem mid-pipeline — use AskFollowup to ask the user, then continue
|
|
302
|
+
5. Never stop the pipeline unless a critical error makes continuation impossible
|
|
303
|
+
6. After ALL steps complete — print a final summary of all files created`;
|
|
304
|
+
}
|
|
305
|
+
// ─── Main exported function ───────────────────────────────────────────────────
|
|
306
|
+
export async function runAIQA(input) {
|
|
307
|
+
const workingDir = input.cwd ?? process.cwd();
|
|
308
|
+
const skip = [...(input.skip ?? [])];
|
|
309
|
+
const start = Date.now();
|
|
310
|
+
const paths = resolvePaths(input.paths);
|
|
311
|
+
// Init session
|
|
312
|
+
const sessionMgr = new SessionManager(workingDir, input.target, input.resume ?? false, paths);
|
|
313
|
+
const session = sessionMgr.get();
|
|
314
|
+
// Pick up any snapshots already on disk so downstream prompts can list them
|
|
315
|
+
// (and so a resumed run sees what the analyst captured previously).
|
|
316
|
+
registerSnapshotsFromDisk(sessionMgr);
|
|
317
|
+
// On --resume, skip steps whose output artifact already exists on disk.
|
|
318
|
+
if (input.resume) {
|
|
319
|
+
for (const step of PIPELINE_STEPS) {
|
|
320
|
+
if (stepOutputExists(step, session)) {
|
|
321
|
+
sessionMgr.setStatus(step, "completed");
|
|
322
|
+
if (!skip.includes(step))
|
|
323
|
+
skip.push(step);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
console.log(`\n🎯 Target: ${input.target}`);
|
|
328
|
+
console.log(`📁 Output dir: ${workingDir}`);
|
|
329
|
+
console.log(`🔖 Run ID: ${session.runId}`);
|
|
330
|
+
if (skip.length > 0)
|
|
331
|
+
console.log(`⏭️ Skipping: ${skip.join(", ")}`);
|
|
332
|
+
if (input.grep)
|
|
333
|
+
console.log(`🏷️ Test filter: ${input.grep}`);
|
|
334
|
+
// Check playwright-cli
|
|
335
|
+
const playwrightCliAvailable = checkPlaywrightCLI();
|
|
336
|
+
if (playwrightCliAvailable) {
|
|
337
|
+
console.log("✅ playwright-cli available");
|
|
338
|
+
ensurePlaywrightSkills(workingDir);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
console.log("⚠️ playwright-cli not found — install: npm install -g @playwright/cli@latest");
|
|
342
|
+
}
|
|
343
|
+
// Don't silently clobber an existing playwright.config.ts in the user's project.
|
|
344
|
+
const protectConfig = await decideConfigProtection(workingDir, input.force ?? false);
|
|
345
|
+
// If the provided requirements doc IS the file the analyst will generate
|
|
346
|
+
// (e.g. the user named their doc requirements.md), preserve a copy under a
|
|
347
|
+
// reserved name so the merged output doesn't overwrite the original.
|
|
348
|
+
let existingReq = input.existingRequirements;
|
|
349
|
+
if (existingReq && fs.existsSync(existingReq) &&
|
|
350
|
+
path.resolve(existingReq) === path.resolve(session.outputs.requirements)) {
|
|
351
|
+
const preserved = path.join(path.dirname(existingReq), "existing-requirements.md");
|
|
352
|
+
fs.copyFileSync(existingReq, preserved);
|
|
353
|
+
existingReq = preserved;
|
|
354
|
+
console.log(`ℹ️ Your requirements.md was preserved as existing-requirements.md — the merged output will be written to requirements.md.`);
|
|
355
|
+
}
|
|
356
|
+
console.log("\n━".repeat(60));
|
|
357
|
+
const systemPrompt = buildSystemPrompt(sessionMgr, skip, playwrightCliAvailable, input.grep, protectConfig, existingReq, paths);
|
|
358
|
+
const prompt = `Run the full AIQA pipeline for: "${input.target}"
|
|
359
|
+
|
|
360
|
+
Steps to run: ${["analyst", "qa-planner", "qa-engineer", "qa-reviewer", "qa-reporter"]
|
|
361
|
+
.filter((s) => !skip.includes(s))
|
|
362
|
+
.join(" → ")}
|
|
363
|
+
|
|
364
|
+
Work through each step in order. Use playwright-cli for browser exploration and test generation.
|
|
365
|
+
Pass insights and snapshots from each step into the next — context flows in memory.
|
|
366
|
+
Write all output files to their specified paths.`;
|
|
367
|
+
try {
|
|
368
|
+
for await (const message of query({
|
|
369
|
+
prompt,
|
|
370
|
+
options: {
|
|
371
|
+
systemPrompt,
|
|
372
|
+
allowedTools: [
|
|
373
|
+
"Read",
|
|
374
|
+
"Write",
|
|
375
|
+
"Edit",
|
|
376
|
+
"Glob",
|
|
377
|
+
"Bash",
|
|
378
|
+
"WebSearch",
|
|
379
|
+
"WebFetch",
|
|
380
|
+
],
|
|
381
|
+
// Unattended pipeline — pre-approve all tools (the analyst & reporter steps
|
|
382
|
+
// need Bash for playwright-cli / npx playwright). The playwright.config.ts
|
|
383
|
+
// overwrite guard is handled upfront in decideConfigProtection(), because
|
|
384
|
+
// canUseTool only fires in the SDK's streaming-input mode, not with a string
|
|
385
|
+
// prompt — relying on it left Write/Edit auto-denied.
|
|
386
|
+
permissionMode: "bypassPermissions",
|
|
387
|
+
allowDangerouslySkipPermissions: true,
|
|
388
|
+
cwd: workingDir,
|
|
389
|
+
...(input.model ? { model: input.model } : {}),
|
|
390
|
+
},
|
|
391
|
+
})) {
|
|
392
|
+
const msg = message;
|
|
393
|
+
if (msg.type === "assistant" && msg.message?.content) {
|
|
394
|
+
for (const block of msg.message.content) {
|
|
395
|
+
if ("text" in block && block.text) {
|
|
396
|
+
// Stream the model's narration straight through. Step status is
|
|
397
|
+
// derived from real output files on disk after the run, not from
|
|
398
|
+
// pattern-matching this text (which was unreliable).
|
|
399
|
+
process.stdout.write(block.text);
|
|
400
|
+
}
|
|
401
|
+
else if ("name" in block) {
|
|
402
|
+
// Live progress so the terminal isn't silent during long steps
|
|
403
|
+
// (e.g. the analyst running many playwright-cli commands).
|
|
404
|
+
console.log(formatToolProgress(block.name, block.input, workingDir));
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
else if (msg.type === "result") {
|
|
409
|
+
console.log(`\n${"━".repeat(60)}`);
|
|
410
|
+
console.log(`✅ Pipeline finished: ${msg.subtype}`);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
catch (err) {
|
|
415
|
+
if (err?.message?.includes("API key") || err?.message?.includes("auth")) {
|
|
416
|
+
throw new Error("Authentication failed.\n\n" +
|
|
417
|
+
" Option 1 — Anthropic API key: set ANTHROPIC_API_KEY in .env\n" +
|
|
418
|
+
" Option 2 — Claude subscription: claude login\n" +
|
|
419
|
+
" Option 3 — GitHub Copilot: gh auth login");
|
|
420
|
+
}
|
|
421
|
+
throw err;
|
|
422
|
+
}
|
|
423
|
+
// Collect outputs
|
|
424
|
+
const outputs = {};
|
|
425
|
+
const checkFiles = [
|
|
426
|
+
["requirements", session.outputs.requirements],
|
|
427
|
+
["testPlan", session.outputs.testPlan],
|
|
428
|
+
["testCases", session.outputs.testCasesDir],
|
|
429
|
+
["specs", session.outputs.specsDir],
|
|
430
|
+
["reviewReport", session.outputs.reviewReport],
|
|
431
|
+
["summaryReport", session.outputs.summaryReport],
|
|
432
|
+
["playwrightConfig", session.outputs.playwrightConfig],
|
|
433
|
+
["htmlReport", session.outputs.htmlReport],
|
|
434
|
+
];
|
|
435
|
+
console.log("\n📁 Output files:");
|
|
436
|
+
for (const [key, filePath] of checkFiles) {
|
|
437
|
+
if (fs.existsSync(filePath)) {
|
|
438
|
+
outputs[key] = filePath;
|
|
439
|
+
console.log(` ✅ ${path.relative(workingDir, filePath)}`);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
// Register any snapshots the analyst captured this run, then print the count
|
|
443
|
+
registerSnapshotsFromDisk(sessionMgr);
|
|
444
|
+
const snapshotsDir = session.outputs.snapshotsDir;
|
|
445
|
+
if (fs.existsSync(snapshotsDir)) {
|
|
446
|
+
const snapshots = fs.readdirSync(snapshotsDir).filter((f) => f.endsWith(".yml"));
|
|
447
|
+
console.log(` 📸 ${snapshots.length} snapshots in .aiqa/snapshots/`);
|
|
448
|
+
}
|
|
449
|
+
// Derive final step status from real output artifacts on disk:
|
|
450
|
+
// skipped steps stay skipped, others pass iff their output file exists.
|
|
451
|
+
for (const step of PIPELINE_STEPS) {
|
|
452
|
+
if (skip.includes(step)) {
|
|
453
|
+
sessionMgr.setStatus(step, "skipped");
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
456
|
+
sessionMgr.setStatus(step, stepOutputExists(step, session) ? "completed" : "failed");
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
sessionMgr.printStatus();
|
|
460
|
+
// --open: open the key deliverables in VS Code's Markdown preview, and print
|
|
461
|
+
// the steps for viewing the Playwright HTML report in the integrated browser
|
|
462
|
+
// (Simple Browser can't be launched from a CLI, and the report needs a server).
|
|
463
|
+
if (input.open) {
|
|
464
|
+
openGeneratedDocs(workingDir, [
|
|
465
|
+
session.outputs.requirements,
|
|
466
|
+
session.outputs.testPlan,
|
|
467
|
+
session.outputs.summaryReport,
|
|
468
|
+
]);
|
|
469
|
+
if (isVSCode() && fs.existsSync(session.outputs.htmlReport)) {
|
|
470
|
+
const reportDir = path.relative(workingDir, path.dirname(session.outputs.htmlReport)) ||
|
|
471
|
+
path.dirname(session.outputs.htmlReport);
|
|
472
|
+
console.log(`\n🌐 View the Playwright report in VS Code's integrated browser:`);
|
|
473
|
+
console.log(` 1) npx playwright show-report "${reportDir}" (prints a http://localhost URL)`);
|
|
474
|
+
console.log(` 2) Command Palette → “Simple Browser: Show” → paste that URL`);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
const passed = Object.values(session.pipeline).every((s) => s === "completed" || s === "skipped");
|
|
478
|
+
return {
|
|
479
|
+
sessionFile: session.outputs.sessionFile,
|
|
480
|
+
outputs,
|
|
481
|
+
passed,
|
|
482
|
+
totalDuration: Date.now() - start,
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAmB,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK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,UAAU,CAAC,CAAC;gBACnF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAC3C,OAAO,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC;YAChF,OAAO,CAAC,GAAG,CAAC,qCAAqC,SAAS,qCAAqC,CAAC,CAAC;YACjG,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;QACjF,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAClD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,SAAS,CAC5C,CAAC;IAEF,OAAO;QACL,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW;QACxC,OAAO;QACP,MAAM;QACN,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;KAClC,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @agents-forge/aiqa
|
|
4
|
+
* AI Assisted Quality Engineering — single unified agent
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* npx @agents-forge/aiqa (interactive: prompts for URL + existing requirements)
|
|
8
|
+
* npx @agents-forge/aiqa https://my-app.com
|
|
9
|
+
* npx @agents-forge/aiqa https://my-app.com --grep @smoke
|
|
10
|
+
* npx @agents-forge/aiqa https://my-app.com --resume
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;GASG"}
|