eslint-plugin-ai-guard 1.4.0 → 1.4.2
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 +14 -7
- package/THIRD-PARTY-NOTICES.md +871 -0
- package/dist/cli/index.js +12577 -768
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/mcp/server.js +46574 -3910
- package/dist/mcp/server.js.map +1 -1
- package/package.json +105 -103
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
- **CLI** (`ai-guard`) for terminal, changed-file, and CI scanning
|
|
39
39
|
- **GitHub Action** with native SARIF 2.1.0 output for GitHub Code Scanning
|
|
40
40
|
- **Claude Code integration** with a zero-config PostToolUse hook
|
|
41
|
-
- **MCP server** (`ai-guard-mcp`) for local AI-agent workflows
|
|
41
|
+
- **MCP server** (`ai-guard-mcp`) for local AI-agent workflows over STDIO
|
|
42
42
|
|
|
43
43
|
It is engineered to detect reliability bugs, async hazards, security vulnerabilities, and code-scaffolding defects frequently introduced during AI-assisted development (GitHub Copilot, Cursor, Claude Code, Gemini Code Assist, etc.).
|
|
44
44
|
|
|
@@ -272,6 +272,8 @@ npx ai-guard <command> [options]
|
|
|
272
272
|
| `preset` | Interactively select and switch active preset in config | (Interactive prompt with automatic config patch & backup) |
|
|
273
273
|
| `ignore` | Add standard ignore paths (`.next`, `dist`, `build`) to config | (Patches flat config or legacy ignores safely) |
|
|
274
274
|
|
|
275
|
+
**`run` exit codes:** `0` no errors · `1` errors found (or `--max-warnings` exceeded) · `2` scan did not run — the file passed to `--path` matches a built-in ignore pattern (`node_modules/`, `dist/`, `build/`, `generated/`, `vendor/`, …), so nothing was analyzed. Directory scans skip ignored files silently and never exit `2`.
|
|
276
|
+
|
|
275
277
|
### CLI Usage Examples
|
|
276
278
|
|
|
277
279
|
```bash
|
|
@@ -626,7 +628,7 @@ For the complete methodology, raw findings, and benchmark harness, see [**`docs/
|
|
|
626
628
|
AI Guard includes a local MCP server that exposes its deterministic analysis engine to MCP-capable AI clients (Claude Code, Claude Desktop, and other MCP-compatible integrations).
|
|
627
629
|
|
|
628
630
|
```bash
|
|
629
|
-
npx ai-guard-mcp
|
|
631
|
+
npx --yes --package eslint-plugin-ai-guard ai-guard-mcp
|
|
630
632
|
```
|
|
631
633
|
|
|
632
634
|
**Available tools:**
|
|
@@ -635,22 +637,27 @@ npx ai-guard-mcp
|
|
|
635
637
|
| :--- | :--- |
|
|
636
638
|
| `ai_guard_scan_file` | Scan a single JS/TS file with structured findings |
|
|
637
639
|
| `ai_guard_scan_diff` | Scan changed files in git diff (including newly created untracked JS/TS files) |
|
|
638
|
-
| `
|
|
640
|
+
| `ai_guard_scan_project` | Scan a bounded workspace directory (current source; not yet published) |
|
|
641
|
+
| `ai_guard_rules` | List rules and presets, or look up specific rules (`rules: ["no-floating-promise"]`) with remediation and docs link |
|
|
642
|
+
|
|
643
|
+
All tools declare an `outputSchema`; the text content is the same result as compact JSON. Scan tools accept `maxIssues` (default 50, errors first, exact `totalIssues` and `truncated`). The `verify_changes` prompt runs the scan → fix → rescan loop.
|
|
639
644
|
|
|
640
|
-
**Claude Code configuration** (`.
|
|
645
|
+
**Claude Code configuration** (project-root `.mcp.json`):
|
|
641
646
|
|
|
642
647
|
```json
|
|
643
648
|
{
|
|
644
649
|
"mcpServers": {
|
|
645
650
|
"ai-guard": {
|
|
646
|
-
"
|
|
647
|
-
"
|
|
651
|
+
"type": "stdio",
|
|
652
|
+
"command": "node",
|
|
653
|
+
"args": ["/absolute/path/to/ai-guard/dist/mcp/server.js"],
|
|
654
|
+
"env": { "AI_GUARD_WORKSPACE": "/absolute/path/to/project" }
|
|
648
655
|
}
|
|
649
656
|
}
|
|
650
657
|
}
|
|
651
658
|
```
|
|
652
659
|
|
|
653
|
-
|
|
660
|
+
The SDK in-memory and built STDIO integrations are tested, plus a headless Claude Code CLI smoke test (see the MCP guide for scope). Use the built checkout to test unreleased changes. Scan, fix, then rescan; a partial or failed scan is never clean. For setup, result status, limits, and client verification scope, see [**`docs/mcp-server.md`**](./docs/mcp-server.md).
|
|
654
661
|
|
|
655
662
|
---
|
|
656
663
|
|