triage-ai 1.0.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.
Files changed (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +209 -0
  3. package/dist/cli.d.ts +9 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +633 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/mcp-server.d.ts +24 -0
  8. package/dist/mcp-server.d.ts.map +1 -0
  9. package/dist/mcp-server.js +411 -0
  10. package/dist/mcp-server.js.map +1 -0
  11. package/dist/memory.d.ts +40 -0
  12. package/dist/memory.d.ts.map +1 -0
  13. package/dist/memory.js +241 -0
  14. package/dist/memory.js.map +1 -0
  15. package/dist/merge.d.ts +32 -0
  16. package/dist/merge.d.ts.map +1 -0
  17. package/dist/merge.js +251 -0
  18. package/dist/merge.js.map +1 -0
  19. package/dist/models/base.d.ts +72 -0
  20. package/dist/models/base.d.ts.map +1 -0
  21. package/dist/models/base.js +342 -0
  22. package/dist/models/base.js.map +1 -0
  23. package/dist/models/claude.d.ts +23 -0
  24. package/dist/models/claude.d.ts.map +1 -0
  25. package/dist/models/claude.js +30 -0
  26. package/dist/models/claude.js.map +1 -0
  27. package/dist/models/codex.d.ts +25 -0
  28. package/dist/models/codex.d.ts.map +1 -0
  29. package/dist/models/codex.js +34 -0
  30. package/dist/models/codex.js.map +1 -0
  31. package/dist/models/gemini.d.ts +23 -0
  32. package/dist/models/gemini.d.ts.map +1 -0
  33. package/dist/models/gemini.js +32 -0
  34. package/dist/models/gemini.js.map +1 -0
  35. package/dist/patch.d.ts +40 -0
  36. package/dist/patch.d.ts.map +1 -0
  37. package/dist/patch.js +183 -0
  38. package/dist/patch.js.map +1 -0
  39. package/dist/progress.d.ts +71 -0
  40. package/dist/progress.d.ts.map +1 -0
  41. package/dist/progress.js +268 -0
  42. package/dist/progress.js.map +1 -0
  43. package/dist/report.d.ts +19 -0
  44. package/dist/report.d.ts.map +1 -0
  45. package/dist/report.js +245 -0
  46. package/dist/report.js.map +1 -0
  47. package/dist/scanner.d.ts +64 -0
  48. package/dist/scanner.d.ts.map +1 -0
  49. package/dist/scanner.js +645 -0
  50. package/dist/scanner.js.map +1 -0
  51. package/dist/setup.d.ts +52 -0
  52. package/dist/setup.d.ts.map +1 -0
  53. package/dist/setup.js +252 -0
  54. package/dist/setup.js.map +1 -0
  55. package/dist/types.d.ts +153 -0
  56. package/dist/types.d.ts.map +1 -0
  57. package/dist/types.js +203 -0
  58. package/dist/types.js.map +1 -0
  59. package/examples/claude-code-skill.md +22 -0
  60. package/examples/mcp-config.json +9 -0
  61. package/package.json +77 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 wyman101
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,209 @@
1
+ # triage-ai
2
+
3
+ **Run Claude, Gemini and Codex in parallel to review your code. Get one merged report with consensus scoring.**
4
+
5
+ ![Node.js 18+](https://img.shields.io/badge/node-18+-green.svg) ![npm](https://img.shields.io/badge/npm-triage--ai-red.svg) ![MIT License](https://img.shields.io/badge/license-MIT-green.svg) ![Claude | Gemini | Codex](https://img.shields.io/badge/models-Claude%20%7C%20Gemini%20%7C%20Codex-purple.svg) ![MCP Compatible](https://img.shields.io/badge/MCP-compatible-orange.svg)
6
+
7
+ ---
8
+
9
+ ```bash
10
+ npm install -g triage-ai && triage-ai "find security vulnerabilities"
11
+ ```
12
+
13
+ Three AI models analyze your code independently, then triage merges their findings into a single prioritized report. When 2+ models flag the same issue, it's marked as **consensus** — high confidence, low false positive rate. You only need one CLI installed (`claude`, `gemini`, or `codex`), but three catch what one misses.
14
+
15
+ ## Features
16
+
17
+ - **3 models, 1 report** — Claude, Gemini and Codex run concurrently. Consensus findings (2+ models agree) rise to the top.
18
+ - **Conflict detection** — When models disagree on severity, triage flags it so you can decide.
19
+ - **Smart context** — Auto-discovers files from your prompt, git diff, keywords and entrypoints. No file lists.
20
+ - **Secret redaction** — API keys, passwords, private keys stripped before any model sees your code.
21
+ - **Auth detection** — If a CLI isn't logged in or has hit rate limits, you get a clear error with instructions.
22
+ - **Auto-patching** — Models propose unified diffs, applied safely on a new git branch. Preview with `--dry-run`.
23
+ - **AI memory** — `--remember` saves findings to CLAUDE.md, GEMINI.md and AGENTS.md so every AI tool in your project knows what triage found. `--forget` clears them.
24
+ - **MCP server** — Works with Claude Desktop, Claude Code, Cursor, Windsurf, Cline, VS Code, Zed.
25
+ - **Severity classification** — S0 (blocker) through S3 (style). Markdown or JSON output.
26
+
27
+ ## Install
28
+
29
+ ```bash
30
+ npm install -g triage-ai
31
+ triage-ai setup # detects installed CLIs, shows paths
32
+ ```
33
+
34
+ You need [Node.js](https://nodejs.org/) 18+ and at least one AI CLI:
35
+
36
+ | Model | Install |
37
+ |-------|---------|
38
+ | **Claude** | `npm install -g @anthropic-ai/claude-code` |
39
+ | **Gemini** | `npm install -g @google/gemini-cli` |
40
+ | **Codex** | `npm install -g @openai/codex` |
41
+
42
+ ## Quick Start
43
+
44
+ ```bash
45
+ cd your-project
46
+
47
+ # Full 3-model review
48
+ triage-ai "find bugs and security issues"
49
+
50
+ # Single model (faster)
51
+ triage-ai --models claude "quick security scan"
52
+
53
+ # Review only uncommitted changes
54
+ triage-ai --diff-only "check my changes for bugs"
55
+
56
+ # Save report to file
57
+ triage-ai --out report.md "full security audit"
58
+
59
+ # Auto-fix with patches
60
+ triage-ai --dry-run "fix the XSS vulnerability" # preview
61
+ triage-ai --apply "fix the SQL injection" # apply on new branch
62
+
63
+ # Save findings to AI memory files
64
+ triage-ai --remember "pre-launch security audit"
65
+ ```
66
+
67
+ **Validate AI-generated code** — the highest-value use case. After an AI proposes changes, get a second and third opinion before implementing:
68
+
69
+ ```bash
70
+ triage-ai --diff-only "an AI generated these changes — review for correctness and security"
71
+ triage-ai --remember "review plan.md for risks before I implement"
72
+ ```
73
+
74
+ ## Example Output
75
+
76
+ ```
77
+ ┌ triage-ai v1.0.2
78
+
79
+ ├ Intake
80
+ │ ✓ Scanned repository 42 files, 3 modified
81
+ │ ✓ Redacted secrets 7 patterns masked
82
+ │ ✓ Built context package 186 KB across 28 files
83
+
84
+ ├ Triage Team
85
+ │ ✓ Claude found at /usr/local/bin/claude
86
+ │ ✓ Gemini found at /usr/local/bin/gemini
87
+ │ ✗ Codex not installed (skipping)
88
+
89
+ ├ Assessment
90
+ │ ✓ Claude 16 findings (47.3s)
91
+ │ ✓ Gemini 14 findings (38.2s)
92
+
93
+ ├ Diagnosis
94
+ │ ✓ Clustered findings 22 unique issues from 2 models
95
+ │ ✓ Consensus detected 4 issues confirmed by 2+ models
96
+
97
+ ├ Report
98
+ │ ✓ Generated report 3 blockers, 5 high, 8 medium, 6 low
99
+
100
+ └ Done in 52.3s — 22 findings, 4 consensus
101
+ ```
102
+
103
+ The merged report:
104
+
105
+ ```markdown
106
+ ## Blockers (S0)
107
+
108
+ ### 1. SQL Injection in User Lookup [CONSENSUS]
109
+ - **Location:** `auth/login.py:47-52`
110
+ - **Models:** claude, gemini
111
+
112
+ ## Consensus Findings
113
+ - [S0] **SQL Injection in User Lookup** — *claude, gemini*
114
+ - [S1] **Weak Password Hashing** — *gemini, codex*
115
+ - [S1] **Missing Rate Limiting** — *claude, gemini*
116
+ ```
117
+
118
+ ## CLI Reference
119
+
120
+ ```
121
+ triage-ai [PROMPT] [OPTIONS]
122
+ triage-ai setup # detect CLIs, show paths
123
+ ```
124
+
125
+ | Option | Default | Description |
126
+ |--------|---------|-------------|
127
+ | `--models` | `claude,gemini,codex` | Which models to use (comma-separated) |
128
+ | `--diff-only` | off | Only analyze git diff |
129
+ | `--max-files` | 30 | Max files to include in context |
130
+ | `--format` | `md` | Output format: `md` or `json` |
131
+ | `--out` | stdout | Write report to file |
132
+ | `--apply` | off | Apply patches (creates git branch first) |
133
+ | `--dry-run` | off | Preview patches without applying |
134
+ | `--timeout` | 300 | Per-model timeout in seconds |
135
+ | `--remember` | off | Save findings to CLAUDE.md, GEMINI.md, AGENTS.md |
136
+ | `--forget` | — | Remove triage findings from memory files |
137
+ | `--verbose` | off | Detailed progress output |
138
+ | `--mcp` | — | Start as MCP server |
139
+
140
+ ## Severity Levels
141
+
142
+ | Level | Name | Examples |
143
+ |-------|------|---------|
144
+ | **S0** | Blocker | SQL injection, RCE, auth bypass, data loss |
145
+ | **S1** | High | Logic bugs, race conditions, XSS |
146
+ | **S2** | Medium | N+1 queries, missing validation |
147
+ | **S3** | Low | Naming conventions, dead code |
148
+
149
+ ## MCP Server
150
+
151
+ Add to your editor's MCP configuration:
152
+
153
+ ```json
154
+ {
155
+ "mcpServers": {
156
+ "triage": {
157
+ "command": "triage-ai",
158
+ "args": ["--mcp"]
159
+ }
160
+ }
161
+ }
162
+ ```
163
+
164
+ Works with Claude Desktop, Claude Code, Cursor, Windsurf, Cline, VS Code (Copilot), Zed, and Continue. See [`examples/mcp-config.json`](examples/mcp-config.json).
165
+
166
+ ### Claude Code Slash Command
167
+
168
+ ```bash
169
+ cp examples/claude-code-skill.md ~/.claude/commands/triage.md
170
+ ```
171
+
172
+ Then use `/triage "find security issues"` in Claude Code.
173
+
174
+ ## Safety
175
+
176
+ - **Secrets redacted** before any model sees code (API keys, passwords, private keys, AWS credentials)
177
+ - **Files excluded** automatically (`.env`, binaries, `node_modules`, `.git`)
178
+ - **Patch safety** — new git branch created first, dry-run tested, max 5 files per session
179
+ - **Auth errors** surfaced clearly — never silently fails
180
+
181
+ ## AI Memory (`--remember`)
182
+
183
+ Writes findings to CLAUDE.md, GEMINI.md and AGENTS.md using `<!-- triage:start -->` / `<!-- triage:end -->` markers. Re-running replaces the section (doesn't accumulate). `--forget` removes it cleanly. Your existing file content is preserved.
184
+
185
+ ## Configuration
186
+
187
+ ```bash
188
+ export TRIAGE_CLAUDE_CMD="claude" # override CLI command
189
+ export TRIAGE_GEMINI_CMD="gemini"
190
+ export TRIAGE_CODEX_CMD="codex"
191
+ export TRIAGE_GEMINI_MODEL="gemini-2.5-pro" # override model
192
+ ```
193
+
194
+ ## Development
195
+
196
+ ```bash
197
+ git clone https://github.com/wyman101/triage-ai.git
198
+ cd triage-ai
199
+ npm install
200
+ npm run build
201
+ ```
202
+
203
+ ## Contributing
204
+
205
+ Open an issue or PR at [github.com/wyman101/triage-ai](https://github.com/wyman101/triage-ai).
206
+
207
+ ## License
208
+
209
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * triage-ai CLI entry point.
4
+ *
5
+ * Parses arguments, runs the full triage pipeline and renders progress
6
+ * via TriageProgress. Supports both interactive (TTY) and CI/piped modes.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;GAKG"}