argusqa-os 9.2.6 → 9.2.8

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/mcp-server.js +56 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "argusqa-os",
3
- "version": "9.2.6",
3
+ "version": "9.2.8",
4
4
  "mcpName": "io.github.ironclawdevs27/argus",
5
5
  "description": "Argus — AI-powered automated dev-testing platform using Chrome DevTools MCP and Claude Code",
6
6
  "keywords": [
package/src/mcp-server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Argus MCP Server (v9.2.6)
3
+ * Argus MCP Server (v9.2.8)
4
4
  *
5
5
  * Exposes Argus as an MCP server so Claude (or any MCP client) can call
6
6
  * argus_audit, argus_audit_full, argus_compare, and argus_last_report
@@ -28,6 +28,9 @@ import path from 'path';
28
28
  import { createMcpClient } from './utils/mcp-client.js';
29
29
  import { crawlRouteCheap, runCrawl } from './orchestration/crawl-and-report.js';
30
30
  import { runComparison } from './orchestration/env-comparison.js';
31
+ import { WatchSession } from './orchestration/watch-mode.js';
32
+ import { CdpBrowserAdapter } from './adapters/browser.js';
33
+ import { generateHtmlReport } from './utils/html-reporter.js';
31
34
 
32
35
  const REPORTS_DIR = path.resolve(process.cwd(), 'reports');
33
36
 
@@ -36,36 +39,51 @@ const REPORTS_DIR = path.resolve(process.cwd(), 'reports');
36
39
  const TOOLS = [
37
40
  {
38
41
  name: 'argus_audit',
39
- description: 'Run a fast QA audit on a URL. Detects JavaScript errors, unhandled promise rejections, network failures (4xx/5xx), API frequency loops, CSS cascade issues, SEO problems, security vulnerabilities, content quality issues, and accessibility violations. Returns findings as JSON grouped by severity (critical/warning/info).',
42
+ description: 'Fast QA audit on a URL via Chrome DevTools Protocol. Runs 8 analyzers in one pass: JS errors, unhandled rejections, network failures (4xx/5xx), API frequency loops, CSS cascade issues, SEO violations, security header checks, and accessibility. Returns { findings: [{severity, type, message, url}], summary: {critical, warning, info} }. Use for CI smoke tests and pre-deploy gates. For Lighthouse scoring and memory leak detection, use argus_audit_full. Requires Chrome running with --remote-debugging-port=9222.',
40
43
  inputSchema: {
41
44
  type: 'object',
42
45
  properties: {
43
- url: { type: 'string', description: 'Full URL to audit (e.g. http://localhost:3000/checkout)' },
44
- critical: { type: 'boolean', description: 'Treat this route as critical console errors become critical severity', default: false },
46
+ url: { type: 'string', description: 'Full URL to audit, including protocol and path (e.g. http://localhost:3000/checkout). Must be reachable by the running Chrome instance.' },
47
+ critical: { type: 'boolean', description: 'When true, console.error calls are escalated to critical severity. Set true for business-critical routes (login, checkout, dashboard) where any error is a blocker.', default: false },
45
48
  },
46
49
  required: ['url'],
47
50
  },
48
51
  },
49
52
  {
50
53
  name: 'argus_audit_full',
51
- description: 'Run a deep QA pass on a URL using all analyzers — Lighthouse performance/accessibility scoring, responsive layout checks across mobile/tablet/desktop viewports, memory leak detection via heap snapshot, hover-state bug detection, and accessibility tree snapshot. Returns a full JSON report with findings grouped by severity.',
54
+ description: 'Deep QA audit extends argus_audit with Lighthouse performance/accessibility scoring, responsive layout checks across 4 viewports (320/768/1280/1920px), memory leak detection via heap snapshot, hover-state regression detection, and accessibility tree snapshot. Returns full JSON report with findings by severity, Lighthouse scores, and layout overflow details. Use when argus_audit passes clean but visual or performance regressions are suspected. Requires Chrome running with --remote-debugging-port=9222.',
52
55
  inputSchema: {
53
56
  type: 'object',
54
57
  properties: {
55
- url: { type: 'string', description: 'Full URL to audit (e.g. https://example.com/dashboard)' },
56
- critical: { type: 'boolean', description: 'Mark this route as critical — console errors are escalated to critical severity', default: false },
58
+ url: { type: 'string', description: 'Full URL to audit, including protocol and path (e.g. https://example.com/dashboard). Must be reachable by the running Chrome instance.' },
59
+ critical: { type: 'boolean', description: 'When true, console.error calls are escalated to critical severity. Set true for business-critical routes (login, checkout, dashboard) where any error is a blocker.', default: false },
57
60
  },
58
61
  required: ['url'],
59
62
  },
60
63
  },
61
64
  {
62
65
  name: 'argus_compare',
63
- description: 'Snapshot and diff two environments (dev vs staging) side-by-side. Navigates both URLs, captures screenshots, runs the full analyzer suite on each, then diffs the findings to surface regressions — things that appear in staging but not dev, or changed severity. Configure the two target URLs via TARGET_DEV_URL and TARGET_STAGING_URL environment variables before starting the server.',
66
+ description: 'Diffs dev vs staging environments side-by-side. Navigates both URLs, captures screenshots, and runs the full analyzer suite on each, then surfaces regressions — findings present in staging but not dev, or with changed severity. Returns { regressions: [{type, devSeverity, stagingSeverity}], screenshots, summary }. Run before promoting a build to staging to catch environment-specific bugs. Set TARGET_DEV_URL and TARGET_STAGING_URL env vars before starting the server; omit TARGET_STAGING_URL to run CSS-analysis-only mode.',
64
67
  inputSchema: { type: 'object', properties: {} },
65
68
  },
66
69
  {
67
70
  name: 'argus_last_report',
68
- description: 'Return the most recent Argus JSON report from the reports/ directory.',
71
+ description: 'Returns the most recent Argus JSON report from the reports/ directory. Report includes a findings array and severity summary (critical/warning/info counts). Returns { "error": "No reports found in reports/" } when no audits have been run yet. Use to retrieve prior results without re-running a scan, or to pipe findings into another analysis tool.',
72
+ inputSchema: { type: 'object', properties: {} },
73
+ },
74
+ {
75
+ name: 'argus_watch_snapshot',
76
+ description: 'Snapshots the currently open Chrome tab without navigating — captures console errors, network failures (4xx/5xx), CORS blocks, and auth failures in one poll. Returns { findings: [{severity, type, message, url}], newConsole, newNetwork }. Use during active development to inspect what is happening on the current page without running a full audit. Requires Chrome on --remote-debugging-port=9222 with a page already open.',
77
+ inputSchema: {
78
+ type: 'object',
79
+ properties: {
80
+ url: { type: 'string', description: 'Optional base URL to attribute findings to (default: TARGET_DEV_URL env var). Does not navigate — reads the currently open Chrome tab.' },
81
+ },
82
+ },
83
+ },
84
+ {
85
+ name: 'argus_report_html',
86
+ description: 'Generates a self-contained reports/report.html from the most recent Argus JSON report. Inlines all screenshots and findings into a portable single-file HTML dashboard shareable with designers, PMs, or reviewable offline. Returns { path: "reports/report.html" }. Run after argus_audit or argus_audit_full. Returns an error if no JSON reports exist in the reports/ directory.',
69
87
  inputSchema: { type: 'object', properties: {} },
70
88
  },
71
89
  ];
@@ -111,6 +129,31 @@ async function handleCompare() {
111
129
  });
112
130
  }
113
131
 
132
+ async function handleWatchSnapshot({ url } = {}) {
133
+ return withMcp(async (mcp) => {
134
+ const browser = new CdpBrowserAdapter(mcp);
135
+ const baseUrl = url ?? process.env.TARGET_DEV_URL ?? 'http://localhost:3000';
136
+ const session = new WatchSession(browser, baseUrl);
137
+ const result = await session.poll();
138
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
139
+ });
140
+ }
141
+
142
+ async function handleReportHtml() {
143
+ if (!fs.existsSync(REPORTS_DIR)) {
144
+ return { content: [{ type: 'text', text: JSON.stringify({ error: 'No reports directory. Run argus_audit first.' }) }] };
145
+ }
146
+ const files = fs.readdirSync(REPORTS_DIR)
147
+ .filter(f => f.startsWith('error-report-') && f.endsWith('.json'))
148
+ .map(f => ({ f, mt: fs.statSync(path.join(REPORTS_DIR, f)).mtimeMs }))
149
+ .sort((a, b) => b.mt - a.mt);
150
+ if (files.length === 0) {
151
+ return { content: [{ type: 'text', text: JSON.stringify({ error: 'No reports found. Run argus_audit first.' }) }] };
152
+ }
153
+ const outPath = await generateHtmlReport(path.join(REPORTS_DIR, files[0].f));
154
+ return { content: [{ type: 'text', text: JSON.stringify({ path: outPath }) }] };
155
+ }
156
+
114
157
  async function handleLastReport() {
115
158
  if (!fs.existsSync(REPORTS_DIR)) {
116
159
  return { content: [{ type: 'text', text: '{"error":"No reports found in reports/"}' }] };
@@ -129,7 +172,7 @@ async function handleLastReport() {
129
172
  // ── Server bootstrap ──────────────────────────────────────────────────────────
130
173
 
131
174
  const server = new Server(
132
- { name: 'argus', version: '9.2.6' },
175
+ { name: 'argus', version: '9.2.8' },
133
176
  { capabilities: { tools: {} } },
134
177
  );
135
178
 
@@ -141,7 +184,9 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
141
184
  case 'argus_audit': return await handleAudit(req.params.arguments ?? {});
142
185
  case 'argus_audit_full': return await handleAuditFull(req.params.arguments ?? {});
143
186
  case 'argus_compare': return await handleCompare();
144
- case 'argus_last_report': return await handleLastReport();
187
+ case 'argus_last_report': return await handleLastReport();
188
+ case 'argus_watch_snapshot': return await handleWatchSnapshot(req.params.arguments ?? {});
189
+ case 'argus_report_html': return await handleReportHtml();
145
190
  default: throw new Error(`Unknown tool: ${req.params.name}`);
146
191
  }
147
192
  } catch (err) {