argusqa-os 9.2.8 → 9.2.9
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/src/mcp-server.js +44 -20
package/package.json
CHANGED
package/src/mcp-server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Argus MCP Server (v9.2.
|
|
3
|
+
* Argus MCP Server (v9.2.9)
|
|
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
|
|
@@ -30,7 +30,6 @@ import { crawlRouteCheap, runCrawl } from './orchestration/crawl-and-re
|
|
|
30
30
|
import { runComparison } from './orchestration/env-comparison.js';
|
|
31
31
|
import { WatchSession } from './orchestration/watch-mode.js';
|
|
32
32
|
import { CdpBrowserAdapter } from './adapters/browser.js';
|
|
33
|
-
import { generateHtmlReport } from './utils/html-reporter.js';
|
|
34
33
|
|
|
35
34
|
const REPORTS_DIR = path.resolve(process.cwd(), 'reports');
|
|
36
35
|
|
|
@@ -82,9 +81,14 @@ const TOOLS = [
|
|
|
82
81
|
},
|
|
83
82
|
},
|
|
84
83
|
{
|
|
85
|
-
name: '
|
|
86
|
-
description: '
|
|
87
|
-
inputSchema: {
|
|
84
|
+
name: 'argus_get_context',
|
|
85
|
+
description: 'Captures everything currently broken on the open Chrome tab and formats it as a diagnostic context for Claude to read and suggest fixes. Does NOT navigate — reads the live tab state after user interactions, in authenticated sessions, or mid-flow. Returns { summary, url, timestamp, critical_issues, warnings, js_errors, network_failures, console_errors, recent_requests } where summary is a plain-English description of what is broken. Use when the app is stuck, throwing errors, or behaving unexpectedly — run this, then paste the output to Claude and ask for fixes. Requires Chrome on --remote-debugging-port=9222.',
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: 'object',
|
|
88
|
+
properties: {
|
|
89
|
+
url: { type: 'string', description: 'Optional base URL to attribute findings to (default: TARGET_DEV_URL env var). Does not navigate — inspects the currently open Chrome tab.' },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
88
92
|
},
|
|
89
93
|
];
|
|
90
94
|
|
|
@@ -139,19 +143,39 @@ async function handleWatchSnapshot({ url } = {}) {
|
|
|
139
143
|
});
|
|
140
144
|
}
|
|
141
145
|
|
|
142
|
-
async function
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
146
|
+
async function handleGetContext({ url } = {}) {
|
|
147
|
+
return withMcp(async (mcp) => {
|
|
148
|
+
const browser = new CdpBrowserAdapter(mcp);
|
|
149
|
+
const baseUrl = url ?? process.env.TARGET_DEV_URL ?? 'http://localhost:3000';
|
|
150
|
+
const session = new WatchSession(browser, baseUrl);
|
|
151
|
+
const { findings, newConsole, newNetwork } = await session.poll();
|
|
152
|
+
|
|
153
|
+
const critical = findings.filter(f => f.severity === 'critical');
|
|
154
|
+
const warnings = findings.filter(f => f.severity === 'warning');
|
|
155
|
+
|
|
156
|
+
let summary;
|
|
157
|
+
if (critical.length === 0 && warnings.length === 0) {
|
|
158
|
+
summary = `No issues detected on ${baseUrl} — console and network are clean.`;
|
|
159
|
+
} else if (critical.length > 0) {
|
|
160
|
+
summary = `${critical.length} critical issue${critical.length > 1 ? 's' : ''} + ${warnings.length} warning${warnings.length !== 1 ? 's' : ''} detected on ${baseUrl}. Focus on critical issues first.`;
|
|
161
|
+
} else {
|
|
162
|
+
summary = `${warnings.length} warning${warnings.length !== 1 ? 's' : ''} detected on ${baseUrl}. No critical errors.`;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const context = {
|
|
166
|
+
summary,
|
|
167
|
+
url: baseUrl,
|
|
168
|
+
timestamp: new Date().toISOString(),
|
|
169
|
+
critical_issues: critical,
|
|
170
|
+
warnings,
|
|
171
|
+
js_errors: findings.filter(f => f.type === 'js-error' || f.type === 'unhandled-rejection'),
|
|
172
|
+
network_failures: findings.filter(f => f.type === 'network-error' || f.type === 'cors-error' || f.type === 'auth-error'),
|
|
173
|
+
console_errors: newConsole.filter(m => m.level === 'error' || m.level === 'warning'),
|
|
174
|
+
recent_requests: newNetwork.slice(-20),
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
return { content: [{ type: 'text', text: JSON.stringify(context, null, 2) }] };
|
|
178
|
+
});
|
|
155
179
|
}
|
|
156
180
|
|
|
157
181
|
async function handleLastReport() {
|
|
@@ -172,7 +196,7 @@ async function handleLastReport() {
|
|
|
172
196
|
// ── Server bootstrap ──────────────────────────────────────────────────────────
|
|
173
197
|
|
|
174
198
|
const server = new Server(
|
|
175
|
-
{ name: 'argus', version: '9.2.
|
|
199
|
+
{ name: 'argus', version: '9.2.9' },
|
|
176
200
|
{ capabilities: { tools: {} } },
|
|
177
201
|
);
|
|
178
202
|
|
|
@@ -186,7 +210,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
186
210
|
case 'argus_compare': return await handleCompare();
|
|
187
211
|
case 'argus_last_report': return await handleLastReport();
|
|
188
212
|
case 'argus_watch_snapshot': return await handleWatchSnapshot(req.params.arguments ?? {});
|
|
189
|
-
case '
|
|
213
|
+
case 'argus_get_context': return await handleGetContext(req.params.arguments ?? {});
|
|
190
214
|
default: throw new Error(`Unknown tool: ${req.params.name}`);
|
|
191
215
|
}
|
|
192
216
|
} catch (err) {
|