argusqa-os 9.2.8 → 9.3.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/README.md +220 -73
- package/package.json +1 -1
- package/src/mcp-server.js +44 -20
- package/src/orchestration/watch-mode.js +2 -2
package/README.md
CHANGED
|
@@ -52,14 +52,16 @@ Then ask Claude (or any MCP client):
|
|
|
52
52
|
Run argus_audit on http://localhost:3000
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
**
|
|
55
|
+
**Six tools are exposed:**
|
|
56
56
|
|
|
57
57
|
| Tool | What it does |
|
|
58
58
|
| --- | --- |
|
|
59
59
|
| `argus_audit` | Fast QA pass — JS errors, network failures, accessibility, SEO, security, CSS, content |
|
|
60
|
-
| `argus_audit_full` | Deep QA pass — adds Lighthouse scoring, responsive layout checks across 4 viewports, memory leak detection
|
|
60
|
+
| `argus_audit_full` | Deep QA pass — adds Lighthouse scoring, responsive layout checks across 4 viewports, memory leak detection, hover-state bug detection, and accessibility tree snapshot |
|
|
61
61
|
| `argus_compare` | Diff dev vs staging side-by-side — screenshots, findings delta, environment regressions |
|
|
62
|
-
| `argus_last_report` | Return the last saved
|
|
62
|
+
| `argus_last_report` | Return the last saved JSON report without re-running a scan |
|
|
63
|
+
| `argus_watch_snapshot` | Snapshot the currently open Chrome tab without navigating — raw console + network capture |
|
|
64
|
+
| `argus_get_context` | Capture everything broken on the open tab, formatted as a diagnostic context for Claude to diagnose and suggest fixes |
|
|
63
65
|
|
|
64
66
|
> **Requires**: Node.js ≥ 20.19, Chrome (desktop or headless), and the `chrome-devtools-mcp` server registered alongside Argus (shown above).
|
|
65
67
|
|
|
@@ -339,13 +341,13 @@ Argus watches your running application and automatically surfaces issues that te
|
|
|
339
341
|
| **GitHub PR Integration** | Posts a structured Markdown findings table as a PR comment (updates in-place — one comment per PR, no spam); sets an `argus-qa` commit status check (`failure` when new criticals exist, `success` otherwise) — blocks merge via branch protection when regressions are introduced. Requires `GITHUB_TOKEN` + `GITHUB_REPOSITORY` env vars |
|
|
340
342
|
| **Auto Route Discovery** | Augments manual `routes[]` with paths from three sources: fetches `/sitemap.xml` (follows one sitemap-index level, 10s timeout), scans Next.js `pages/` (Next 12) and `app/` (Next 13+) directories stripping route groups `(auth)`, and greps JS/TS source for React Router `<Route path>` declarations. Dynamic `[param]` segments are skipped — no concrete URL to crawl. Manual route config (`critical`, `waitFor`) always takes precedence. |
|
|
341
343
|
| **`argus init` Setup Wizard** | `npm run init` (or `npx argus init`) guides first-time setup: collects target URLs, detects the app framework (Next.js / React Router / unknown) from the source directory's `package.json`, runs C3 route discovery against the dev URL, prompts for optional Slack tokens and GitHub credentials, then writes a populated `.env` and a pre-filled `src/config/targets.js` — zero manual config editing required. |
|
|
342
|
-
| **Watch Mode** | `npm run watch` attaches to whatever Chrome tab is open and polls `list_console_messages` + `list_network_requests` every
|
|
344
|
+
| **Watch Mode** | `npm run watch` attaches to whatever Chrome tab is open and polls `list_console_messages` + `list_network_requests` every 1 s (configurable via `ARGUS_WATCH_INTERVAL_MS`). Reports new console errors, network failures (4xx/5xx), CORS blocks, and auth failures in real time — without navigating. On `Ctrl+C`, generates a final `reports/report.html`. No route config needed. |
|
|
343
345
|
| **Full Lighthouse Suite** | All 4 Lighthouse categories (performance, SEO, best-practices, accessibility) with per-audit items |
|
|
344
346
|
| **Performance Budgets** | Enforces LCP < 2500ms, CLS < 0.1, FID < 100ms, TTFB < 800ms per route |
|
|
345
347
|
| **Slack Notifications** | Rich Block Kit reports with inline screenshots routed to `#bugs-critical`, `#bugs-warnings`, `#bugs-digest` |
|
|
346
348
|
| **Slash Command** | `/argus-retest <url>` triggers an on-demand test from any Slack channel |
|
|
347
349
|
| **CI Integration** | GitHub Actions workflow runs daily at 6 AM UTC and on every push to `main` |
|
|
348
|
-
| **MCP Server (AI-callable Argus)** | Register Argus as an MCP server via `.mcp.json`; Claude (or any MCP client) can call `argus_audit`, `argus_audit_full`, `argus_compare`, `argus_last_report` directly from a conversation — no CLI, no terminal required. Published to npm as **[argusqa-os](https://www.npmjs.com/package/argusqa-os)** — add via `{ "command": "npx", "args": ["-y", "argusqa-os"] }` in `.mcp.json` |
|
|
350
|
+
| **MCP Server (AI-callable Argus)** | Register Argus as an MCP server via `.mcp.json`; Claude (or any MCP client) can call `argus_audit`, `argus_audit_full`, `argus_compare`, `argus_last_report`, `argus_watch_snapshot`, and `argus_get_context` directly from a conversation — no CLI, no terminal required. Published to npm as **[argusqa-os](https://www.npmjs.com/package/argusqa-os)** — add via `{ "command": "npx", "args": ["-y", "argusqa-os"] }` in `.mcp.json` |
|
|
349
351
|
|
|
350
352
|
Works with **React + SCSS**, CSS Modules, CSS-in-JS (styled-components / emotion), and plain HTML/CSS apps.
|
|
351
353
|
|
|
@@ -382,26 +384,126 @@ In interactive mode (running from Claude Code), MCP tools are called natively. I
|
|
|
382
384
|
|
|
383
385
|
## One-Time Setup
|
|
384
386
|
|
|
385
|
-
###
|
|
387
|
+
### Option A — MCP Server (Claude Code / any MCP client)
|
|
388
|
+
|
|
389
|
+
No local install required. `npx` auto-downloads `argusqa-os` on first use.
|
|
390
|
+
|
|
391
|
+
#### 1. Register both MCP servers
|
|
392
|
+
|
|
393
|
+
Add to `.mcp.json` in your project root:
|
|
394
|
+
|
|
395
|
+
```json
|
|
396
|
+
{
|
|
397
|
+
"mcpServers": {
|
|
398
|
+
"chrome-devtools": {
|
|
399
|
+
"command": "npx",
|
|
400
|
+
"args": ["-y", "chrome-devtools-mcp@latest"]
|
|
401
|
+
},
|
|
402
|
+
"argus": {
|
|
403
|
+
"command": "npx",
|
|
404
|
+
"args": ["-y", "argusqa-os"]
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
Or via Claude Code CLI:
|
|
386
411
|
|
|
387
412
|
```bash
|
|
388
|
-
|
|
389
|
-
|
|
413
|
+
claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest
|
|
414
|
+
claude mcp add argus -- npx -y argusqa-os
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
#### 2. Environment variables
|
|
418
|
+
|
|
419
|
+
Create a `.env` file in your project root:
|
|
420
|
+
|
|
421
|
+
```env
|
|
422
|
+
TARGET_DEV_URL=http://localhost:3000
|
|
423
|
+
TARGET_STAGING_URL=https://staging.yourapp.com # optional — enables argus_compare
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
#### 3. Start Chrome with remote debugging
|
|
427
|
+
|
|
428
|
+
```bash
|
|
429
|
+
# macOS
|
|
430
|
+
open -a "Google Chrome" --args --remote-debugging-port=9222 --headless=new
|
|
431
|
+
|
|
432
|
+
# Windows
|
|
433
|
+
"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --headless=new --no-sandbox --disable-gpu
|
|
434
|
+
|
|
435
|
+
# Linux
|
|
436
|
+
google-chrome --remote-debugging-port=9222 --headless=new --no-sandbox
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
#### 4. Slack notifications (optional)
|
|
440
|
+
|
|
441
|
+
> Skip to use local `report.html` mode — Argus generates a self-contained HTML report when Slack is not configured.
|
|
442
|
+
|
|
443
|
+
1. [api.slack.com/apps](https://api.slack.com/apps) → **Create New App** → name it **BugBot**
|
|
444
|
+
2. **OAuth & Permissions** → Bot Token Scopes: `chat:write`, `files:write`, `files:read`
|
|
445
|
+
3. Install to workspace → copy **Bot User OAuth Token** (`xoxb-...`) to `.env` as `SLACK_BOT_TOKEN`
|
|
446
|
+
4. Create `#bugs-critical`, `#bugs-warnings`, `#bugs-digest` and `/invite @BugBot` in each
|
|
447
|
+
|
|
448
|
+
```env
|
|
449
|
+
SLACK_BOT_TOKEN=xoxb-...
|
|
450
|
+
SLACK_CHANNEL_CRITICAL=C0000000000
|
|
451
|
+
SLACK_CHANNEL_WARNINGS=C0000000001
|
|
452
|
+
SLACK_CHANNEL_DIGEST=C0000000002
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
### Option B — npm Package (dev dependency / CI/CD)
|
|
458
|
+
|
|
459
|
+
#### 1. Install
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
npm install --save-dev argusqa-os
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
#### 2. Environment variables
|
|
466
|
+
|
|
467
|
+
Run the interactive wizard to auto-generate `.env` and `src/config/targets.js`:
|
|
468
|
+
|
|
469
|
+
```bash
|
|
470
|
+
npx argus
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
The wizard detects your framework (Next.js / React Router), discovers routes from `sitemap.xml` and your file structure, and optionally collects Slack and GitHub credentials.
|
|
474
|
+
|
|
475
|
+
**Alternative — manual setup:** Create a `.env` with `TARGET_DEV_URL` and optionally `TARGET_STAGING_URL`.
|
|
476
|
+
|
|
477
|
+
#### 3. Start Chrome with remote debugging
|
|
478
|
+
|
|
479
|
+
Same as Option A — see above.
|
|
480
|
+
|
|
481
|
+
#### 4. Slack notifications (optional)
|
|
482
|
+
|
|
483
|
+
Same as Option A — see above.
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
### Option C — Clone the Repository (full source / contributors)
|
|
488
|
+
|
|
489
|
+
#### 1. Clone and install
|
|
490
|
+
|
|
491
|
+
```bash
|
|
492
|
+
git clone https://github.com/ironclawdevs27/Argus.git
|
|
493
|
+
cd Argus
|
|
390
494
|
npm install
|
|
391
495
|
npm run setup # creates reports/ directory
|
|
392
496
|
```
|
|
393
497
|
|
|
394
|
-
|
|
498
|
+
#### 2. Environment variables
|
|
395
499
|
|
|
396
|
-
**Recommended
|
|
500
|
+
**Recommended — use the interactive setup wizard:**
|
|
397
501
|
|
|
398
502
|
```bash
|
|
399
503
|
npm run init
|
|
400
504
|
```
|
|
401
505
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
**Alternative: manual setup**
|
|
506
|
+
**Alternative — manual setup:**
|
|
405
507
|
|
|
406
508
|
```bash
|
|
407
509
|
cp .env.example .env
|
|
@@ -410,26 +512,22 @@ cp .env.example .env
|
|
|
410
512
|
Open `.env` and fill in:
|
|
411
513
|
|
|
412
514
|
```env
|
|
413
|
-
# Your app URLs (required)
|
|
414
515
|
TARGET_DEV_URL=http://localhost:3000
|
|
415
516
|
TARGET_STAGING_URL=https://staging.yourapp.com # leave blank → CSS-only analysis mode
|
|
416
517
|
|
|
417
|
-
# Slack — OPTIONAL. Omit to get a local report.html instead
|
|
418
|
-
# Get from: api.slack.com/apps → BugBot → OAuth & Permissions
|
|
518
|
+
# Slack — OPTIONAL. Omit to get a local report.html instead.
|
|
419
519
|
# SLACK_BOT_TOKEN=xoxb-...
|
|
420
520
|
# SLACK_SIGNING_SECRET=...
|
|
421
|
-
|
|
422
|
-
# Channel IDs — only needed when SLACK_BOT_TOKEN is set
|
|
423
521
|
# SLACK_CHANNEL_CRITICAL=C0000000000
|
|
424
522
|
# SLACK_CHANNEL_WARNINGS=C0000000001
|
|
425
523
|
# SLACK_CHANNEL_DIGEST=C0000000002
|
|
426
524
|
```
|
|
427
525
|
|
|
428
|
-
|
|
526
|
+
#### 3. Configure routes
|
|
429
527
|
|
|
430
|
-
If you
|
|
528
|
+
If you ran `npm run init` — skip this step.
|
|
431
529
|
|
|
432
|
-
Otherwise, edit [src/config/targets.js](src/config/targets.js)
|
|
530
|
+
Otherwise, edit [src/config/targets.js](src/config/targets.js):
|
|
433
531
|
|
|
434
532
|
```js
|
|
435
533
|
export const routes = [
|
|
@@ -440,111 +538,160 @@ export const routes = [
|
|
|
440
538
|
];
|
|
441
539
|
```
|
|
442
540
|
|
|
443
|
-
- `critical: true` —
|
|
541
|
+
- `critical: true` — errors on this route go to `#bugs-critical`
|
|
444
542
|
- `waitFor` — CSS selector Argus waits for before capturing (signals the page is ready)
|
|
445
543
|
|
|
446
|
-
|
|
544
|
+
#### 4. Connect Chrome DevTools MCP to Claude Code
|
|
447
545
|
|
|
448
546
|
```bash
|
|
449
547
|
claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
|
|
450
548
|
```
|
|
451
549
|
|
|
452
|
-
Verify
|
|
453
|
-
> "List all open Chrome pages"
|
|
550
|
+
Verify — ask Claude: *"List all open Chrome pages"* — you should see your tabs.
|
|
454
551
|
|
|
455
|
-
|
|
552
|
+
#### 5. Start Chrome with remote debugging
|
|
456
553
|
|
|
457
|
-
|
|
554
|
+
Same as Option A — see above.
|
|
458
555
|
|
|
459
|
-
|
|
556
|
+
#### 6. Slack notifications (optional)
|
|
460
557
|
|
|
461
|
-
|
|
462
|
-
2. **OAuth & Permissions** → Bot Token Scopes: add `chat:write`, `files:write`, `files:read`
|
|
463
|
-
3. Click **Install to Workspace** → Authorize
|
|
464
|
-
4. Copy the **Bot User OAuth Token** (`xoxb-...`) into `.env` as `SLACK_BOT_TOKEN`
|
|
465
|
-
5. **Basic Information** → copy **Signing Secret** into `.env` as `SLACK_SIGNING_SECRET`
|
|
466
|
-
6. Create channels: `#bugs-critical`, `#bugs-warnings`, `#bugs-digest`
|
|
467
|
-
7. In each channel: `/invite @BugBot`
|
|
558
|
+
Same as Option A — see above.
|
|
468
559
|
|
|
469
560
|
---
|
|
470
561
|
|
|
471
562
|
## Running Argus
|
|
472
563
|
|
|
473
|
-
### Option A
|
|
564
|
+
### Option A — Via MCP (Claude Code / any MCP client)
|
|
565
|
+
|
|
566
|
+
Ask Claude directly — no terminal needed.
|
|
567
|
+
|
|
568
|
+
**Available tools:**
|
|
569
|
+
|
|
570
|
+
| Tool | What it does |
|
|
571
|
+
| --- | --- |
|
|
572
|
+
| `argus_audit` | Fast QA pass — JS errors, network failures, accessibility, SEO, security, CSS, content |
|
|
573
|
+
| `argus_audit_full` | Deep QA pass — adds Lighthouse, responsive layout checks across 4 viewports, memory leak detection, hover-state bug detection, and accessibility tree snapshot |
|
|
574
|
+
| `argus_compare` | Diff dev vs staging — screenshots, findings delta, environment regressions |
|
|
575
|
+
| `argus_last_report` | Return the last saved JSON report without re-running a scan |
|
|
576
|
+
| `argus_watch_snapshot` | Snapshot the currently open Chrome tab without navigating — raw console + network capture |
|
|
577
|
+
| `argus_get_context` | Capture everything broken on the open tab, formatted as a diagnostic context for Claude to diagnose and suggest fixes |
|
|
578
|
+
|
|
579
|
+
**`argus_audit`** — fast audit of any URL:
|
|
474
580
|
|
|
475
|
-
|
|
581
|
+
```text
|
|
582
|
+
Run argus_audit on http://localhost:3000/checkout
|
|
583
|
+
Run argus_audit on http://localhost:3000/login with critical: true
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
**`argus_audit_full`** — deep audit with Lighthouse + memory + responsive checks:
|
|
476
587
|
|
|
477
588
|
```text
|
|
478
|
-
Run
|
|
589
|
+
Run argus_audit_full on http://localhost:3000/dashboard
|
|
479
590
|
```
|
|
480
591
|
|
|
481
|
-
|
|
592
|
+
**`argus_compare`** — dev vs staging diff (reads `TARGET_DEV_URL` and `TARGET_STAGING_URL` from `.env`):
|
|
482
593
|
|
|
483
594
|
```text
|
|
484
|
-
Run
|
|
595
|
+
Run argus_compare
|
|
485
596
|
```
|
|
486
597
|
|
|
487
|
-
|
|
598
|
+
**`argus_last_report`** — retrieve last audit without re-running Chrome:
|
|
488
599
|
|
|
489
|
-
|
|
600
|
+
```text
|
|
601
|
+
Run argus_last_report
|
|
602
|
+
```
|
|
490
603
|
|
|
491
|
-
|
|
492
|
-
# Error detection crawl
|
|
493
|
-
npm run crawl
|
|
604
|
+
**`argus_watch_snapshot`** — snapshot the currently open tab without navigating. Useful when the page is in an authenticated or post-interaction state that navigation would reset:
|
|
494
605
|
|
|
495
|
-
|
|
496
|
-
|
|
606
|
+
```text
|
|
607
|
+
Run argus_watch_snapshot
|
|
608
|
+
Run argus_watch_snapshot with url: http://localhost:3000
|
|
609
|
+
```
|
|
497
610
|
|
|
498
|
-
|
|
499
|
-
npm run compare
|
|
611
|
+
**`argus_get_context`** — when your app is stuck or throwing errors, run this to capture everything that's broken and feed it to Claude for diagnosis:
|
|
500
612
|
|
|
501
|
-
|
|
502
|
-
|
|
613
|
+
```text
|
|
614
|
+
Run argus_get_context
|
|
503
615
|
```
|
|
504
616
|
|
|
505
|
-
|
|
617
|
+
Then follow with: *"Here's the context — what's causing these errors and how do I fix them?"*
|
|
506
618
|
|
|
507
|
-
|
|
619
|
+
---
|
|
508
620
|
|
|
509
|
-
|
|
621
|
+
### Option B & C — Via CLI / npm scripts
|
|
510
622
|
|
|
511
|
-
**
|
|
623
|
+
**Available commands:**
|
|
512
624
|
|
|
513
|
-
|
|
|
514
|
-
| --- | --- |
|
|
515
|
-
|
|
|
516
|
-
|
|
|
625
|
+
| Command | What it does |
|
|
626
|
+
| --- | --- |
|
|
627
|
+
| `npm run crawl` | Multi-page batch audit of all routes in `targets.js` |
|
|
628
|
+
| `npm run compare` | Dev vs staging diff (or CSS analysis if no `TARGET_STAGING_URL`) |
|
|
629
|
+
| `npm run watch` | Passive monitor — polls the open Chrome tab every 1s, no navigation |
|
|
630
|
+
| `npm run report:html` | Generate `reports/report.html` from the latest JSON audit |
|
|
631
|
+
| `npm run server` | Start the Slack slash command + interaction server (port 3001) |
|
|
632
|
+
| `npm run init` | Interactive setup wizard — generates `.env` + `targets.js` |
|
|
633
|
+
| `npm run test:unit` | Run 61 unit tests (no Chrome required) |
|
|
634
|
+
| `npm run test:harness` | Run 82-block correctness harness (requires Chrome) |
|
|
635
|
+
|
|
636
|
+
**`npm run crawl`** — full audit of all configured routes:
|
|
637
|
+
|
|
638
|
+
```bash
|
|
639
|
+
npm run crawl
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
Reports are saved to `reports/` as JSON files. Run `npm run report:html` after any crawl for a portable `reports/report.html` with all screenshots inlined — useful for sharing with designers or reviewing offline.
|
|
643
|
+
|
|
644
|
+
**`npm run compare`** — dev vs staging diff:
|
|
645
|
+
|
|
646
|
+
```bash
|
|
647
|
+
npm run compare
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
When `TARGET_STAGING_URL` is not set, automatically switches to **CSS analysis mode** — cascade overrides, component style leaks, unused rules, and React inline style conflicts on the dev environment only.
|
|
517
651
|
|
|
518
|
-
|
|
652
|
+
**`npm run watch`** — passive monitoring (polls every 1s, no navigation):
|
|
519
653
|
|
|
520
|
-
|
|
654
|
+
Attaches to whatever Chrome tab is open and reports new issues in real time without navigating anywhere. Use this while developing.
|
|
655
|
+
|
|
656
|
+
```text
|
|
657
|
+
Requires 2 terminals:
|
|
658
|
+
Terminal 1 — your app (npm start / npm run dev)
|
|
659
|
+
Terminal 2 — npm run watch
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
Steps:
|
|
663
|
+
1. Open Chrome and navigate to your app
|
|
521
664
|
2. Terminal 1: start your application
|
|
522
665
|
3. Terminal 2: `npm run watch` — Argus begins polling
|
|
523
|
-
4. Develop normally —
|
|
524
|
-
5. `Ctrl+C`
|
|
525
|
-
|
|
526
|
-
**To target a specific URL:**
|
|
666
|
+
4. Develop normally — console errors, network failures (4xx/5xx), CORS blocks, and auth failures print in real time
|
|
667
|
+
5. `Ctrl+C` — stops the monitor and writes `reports/report.html`
|
|
527
668
|
|
|
528
669
|
```bash
|
|
670
|
+
# Attribute findings to a specific URL:
|
|
529
671
|
npm run watch http://localhost:4000
|
|
530
672
|
```
|
|
531
673
|
|
|
532
|
-
**Environment variables:**
|
|
533
|
-
|
|
534
674
|
| Variable | Default | Description |
|
|
535
675
|
| --- | --- | --- |
|
|
536
|
-
| `ARGUS_WATCH_INTERVAL_MS` | `
|
|
537
|
-
| `TARGET_DEV_URL` | `http://localhost:3000` | URL attributed to findings when none passed
|
|
676
|
+
| `ARGUS_WATCH_INTERVAL_MS` | `1000` | Poll interval in milliseconds |
|
|
677
|
+
| `TARGET_DEV_URL` | `http://localhost:3000` | URL attributed to findings when none passed |
|
|
678
|
+
|
|
679
|
+
**`npm run report:html`** — generate HTML dashboard from last audit:
|
|
538
680
|
|
|
539
|
-
|
|
681
|
+
```bash
|
|
682
|
+
npm run report:html
|
|
683
|
+
# → reports/report.html (all findings + inline screenshots, portable, no server needed)
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
---
|
|
540
687
|
|
|
541
|
-
### Option D
|
|
688
|
+
### Option D — From Slack (on-demand)
|
|
542
689
|
|
|
543
690
|
```text
|
|
544
691
|
/argus-retest https://staging.yourapp.com/checkout
|
|
545
692
|
```
|
|
546
693
|
|
|
547
|
-
BugBot responds immediately, runs the test, and posts results back
|
|
694
|
+
BugBot responds immediately, runs the test, and posts results back. Detailed bug reports go to `#bugs-critical`. See [Slack Slash Command Setup](#slack-slash-command-setup) for configuration.
|
|
548
695
|
|
|
549
696
|
---
|
|
550
697
|
|
|
@@ -874,7 +1021,7 @@ These constraints are documented with workarounds in [SKILL.md §10](SKILL.md).
|
|
|
874
1021
|
| `ARGUS_RETRY_ATTEMPTS` | No | Max retry attempts for `navigate`/`fill` MCP calls (default: `3`) |
|
|
875
1022
|
| `OTEL_EXPORTER_OTLP_ENDPOINT` | No | OTLP collector endpoint — enables span/metric export to Jaeger, Grafana Tempo, Datadog, etc. |
|
|
876
1023
|
| `ARGUS_OTEL_CONSOLE` | No | Set to `1` to print OTel spans to stdout without an OTLP endpoint (dev tracing) |
|
|
877
|
-
| `ARGUS_WATCH_INTERVAL_MS` | No | Watch mode poll interval in milliseconds (default: `
|
|
1024
|
+
| `ARGUS_WATCH_INTERVAL_MS` | No | Watch mode poll interval in milliseconds (default: `1000`) |
|
|
878
1025
|
| `ARGUS_SOURCE_DIR` | No | Path to your app's source directory — enables codebase cross-reference (env var detection, feature flag leakage, dead routes) |
|
|
879
1026
|
| `ARGUS_ENV_FILE` | No | Path to your app's `.env` file — C1 cross-references env vars used in source code against this file to detect missing declarations |
|
|
880
1027
|
| `GITHUB_TOKEN` | No | GitHub personal access token — required for PR comment + commit status integration |
|
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.
|
|
199
|
+
{ name: 'argus', version: '9.3.0' },
|
|
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) {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* individual poll() calls without running the interval loop.
|
|
14
14
|
*
|
|
15
15
|
* Environment variables:
|
|
16
|
-
* ARGUS_WATCH_INTERVAL_MS — poll interval in ms (default:
|
|
16
|
+
* ARGUS_WATCH_INTERVAL_MS — poll interval in ms (default: 1000)
|
|
17
17
|
* TARGET_DEV_URL — base URL to monitor (default: http://localhost:3000)
|
|
18
18
|
*/
|
|
19
19
|
|
|
@@ -217,7 +217,7 @@ export class WatchSession {
|
|
|
217
217
|
*/
|
|
218
218
|
export async function runWatchMode(baseUrl) {
|
|
219
219
|
const target = baseUrl ?? process.env.TARGET_DEV_URL ?? 'http://localhost:3000';
|
|
220
|
-
const pollIntervalMs = parseInt(process.env.ARGUS_WATCH_INTERVAL_MS ?? '
|
|
220
|
+
const pollIntervalMs = parseInt(process.env.ARGUS_WATCH_INTERVAL_MS ?? '1000', 10);
|
|
221
221
|
|
|
222
222
|
const mcp = await createMcpClient();
|
|
223
223
|
const browser = new CdpBrowserAdapter(mcp);
|