@praneeth_54/agentdoctor 0.1.4-beta → 0.3.0-beta
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/CHANGELOG.md +53 -3
- package/README.md +72 -35
- package/dist/cli/commands/doctor.js +1 -1
- package/dist/cli/commands/explain.js +2 -2
- package/dist/cli/commands/fix.d.ts +7 -5
- package/dist/cli/commands/fix.js +57 -12
- package/dist/cli/commands/scan.js +4 -12
- package/dist/cli/commands/verify.d.ts +13 -0
- package/dist/cli/commands/verify.js +56 -0
- package/dist/cli/program.js +54 -31
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/core/fix/apply.d.ts +10 -0
- package/dist/core/fix/apply.js +27 -0
- package/dist/core/fix/patterns.d.ts +7 -0
- package/dist/core/fix/patterns.js +21 -0
- package/dist/core/fix/plan.d.ts +9 -0
- package/dist/core/fix/plan.js +140 -0
- package/dist/core/fix/render.d.ts +6 -0
- package/dist/core/fix/render.js +68 -0
- package/dist/core/fix/run.d.ts +15 -0
- package/dist/core/fix/run.js +54 -0
- package/dist/core/fix/types.d.ts +34 -0
- package/dist/core/fix/types.js +2 -0
- package/dist/core/fix/writers/cursorignore.d.ts +13 -0
- package/dist/core/fix/writers/cursorignore.js +74 -0
- package/dist/core/rules/context/generated-directory.js +10 -0
- package/dist/core/rules/instructions/missing-path-reference.js +90 -1
- package/dist/core/rules/path-kind.d.ts +14 -0
- package/dist/core/rules/path-kind.js +77 -0
- package/dist/core/rules/security/env-file-exposure.js +14 -14
- package/dist/core/rules/security/private-key-file.js +4 -0
- package/dist/core/scanner/scan.d.ts +1 -2
- package/dist/core/scanner/scan.js +8 -5
- package/dist/core/scoring/compute-scores.d.ts +6 -0
- package/dist/core/scoring/compute-scores.js +90 -0
- package/dist/core/scoring/placeholder.d.ts +3 -3
- package/dist/core/scoring/placeholder.js +3 -3
- package/dist/core/verify/compare.d.ts +29 -0
- package/dist/core/verify/compare.js +56 -0
- package/dist/core/verify/load-baseline.d.ts +15 -0
- package/dist/core/verify/load-baseline.js +71 -0
- package/dist/core/verify/verify.d.ts +26 -0
- package/dist/core/verify/verify.js +40 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +5 -0
- package/dist/reporters/terminal/report.js +7 -1
- package/dist/reporters/verify/json.d.ts +5 -0
- package/dist/reporters/verify/json.js +51 -0
- package/dist/reporters/verify/terminal.d.ts +2 -0
- package/dist/reporters/verify/terminal.js +45 -0
- package/dist/types/index.d.ts +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { PACKAGE_VERSION } from "../../constants.js";
|
|
2
|
+
import { colors, symbolFail, symbolOk, symbolWarn } from "../../utils/colors.js";
|
|
3
|
+
import { sanitizeForOutput } from "../../utils/path.js";
|
|
4
|
+
function renderBucket(title, symbol, color, items, limit) {
|
|
5
|
+
const lines = [];
|
|
6
|
+
lines.push(color(`${symbol} ${title} (${items.length})`));
|
|
7
|
+
if (items.length === 0) {
|
|
8
|
+
lines.push(colors.dim(" (none)"));
|
|
9
|
+
lines.push("");
|
|
10
|
+
return lines;
|
|
11
|
+
}
|
|
12
|
+
const shown = items.slice(0, limit);
|
|
13
|
+
for (const item of shown) {
|
|
14
|
+
const path = item.evidence?.path ? ` — ${sanitizeForOutput(item.evidence.path)}` : "";
|
|
15
|
+
lines.push(` ${sanitizeForOutput(item.ruleId)}${path}`);
|
|
16
|
+
lines.push(colors.dim(` ${sanitizeForOutput(item.title)}`));
|
|
17
|
+
}
|
|
18
|
+
if (items.length > limit) {
|
|
19
|
+
lines.push(colors.dim(` … and ${items.length - limit} more`));
|
|
20
|
+
}
|
|
21
|
+
lines.push("");
|
|
22
|
+
return lines;
|
|
23
|
+
}
|
|
24
|
+
export function renderVerifyTerminalReport(result, verbose = false) {
|
|
25
|
+
const lines = [];
|
|
26
|
+
const limit = verbose ? 50 : 12;
|
|
27
|
+
lines.push("");
|
|
28
|
+
lines.push(colors.bold(`AgentDoctor verify v${PACKAGE_VERSION}`));
|
|
29
|
+
lines.push(colors.dim(`Baseline: ${sanitizeForOutput(result.baselinePath)}`));
|
|
30
|
+
lines.push("");
|
|
31
|
+
lines.push(...renderBucket("Fixed", symbolOk(), colors.green, result.fixed, limit));
|
|
32
|
+
lines.push(...renderBucket("Remaining", symbolWarn(), colors.yellow, result.remaining, limit));
|
|
33
|
+
lines.push(...renderBucket("New", symbolFail(), colors.red, result.new, limit));
|
|
34
|
+
lines.push(colors.bold("Summary"));
|
|
35
|
+
lines.push(` Fixed ${result.summary.fixed} · Remaining ${result.summary.remaining} · New ${result.summary.new} · Unchanged ${result.summary.unchanged}`);
|
|
36
|
+
lines.push(colors.dim(` Before ${result.summary.before} → After ${result.summary.after} findings`));
|
|
37
|
+
if (result.scores) {
|
|
38
|
+
lines.push(colors.dim(` Score ${result.scores.overall}/100`));
|
|
39
|
+
}
|
|
40
|
+
if (verbose) {
|
|
41
|
+
lines.push(colors.dim(` Timing scan=${result.timing.scanMs}ms compare=${result.timing.compareMs}ms total=${result.timing.totalMs}ms`));
|
|
42
|
+
}
|
|
43
|
+
lines.push("");
|
|
44
|
+
return `${lines.join("\n")}\n`;
|
|
45
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -106,11 +106,11 @@ export interface ScanResult {
|
|
|
106
106
|
findings: Finding[];
|
|
107
107
|
summary: FindingsSummary;
|
|
108
108
|
/**
|
|
109
|
-
* Readiness scores when
|
|
110
|
-
*
|
|
109
|
+
* Readiness scores (v1). Always populated when `scoringAvailable` is true.
|
|
110
|
+
* Remains typed as nullable for older consumers / transitional tooling.
|
|
111
111
|
*/
|
|
112
112
|
scores: Scores | null;
|
|
113
|
-
/**
|
|
113
|
+
/** True when the readiness scoring model is active and `scores` is populated. */
|
|
114
114
|
scoringAvailable: boolean;
|
|
115
115
|
/**
|
|
116
116
|
* `limited` when no supported coding agent is detected/configured.
|