@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.
Files changed (53) hide show
  1. package/CHANGELOG.md +53 -3
  2. package/README.md +72 -35
  3. package/dist/cli/commands/doctor.js +1 -1
  4. package/dist/cli/commands/explain.js +2 -2
  5. package/dist/cli/commands/fix.d.ts +7 -5
  6. package/dist/cli/commands/fix.js +57 -12
  7. package/dist/cli/commands/scan.js +4 -12
  8. package/dist/cli/commands/verify.d.ts +13 -0
  9. package/dist/cli/commands/verify.js +56 -0
  10. package/dist/cli/program.js +54 -31
  11. package/dist/constants.d.ts +1 -1
  12. package/dist/constants.js +1 -1
  13. package/dist/core/fix/apply.d.ts +10 -0
  14. package/dist/core/fix/apply.js +27 -0
  15. package/dist/core/fix/patterns.d.ts +7 -0
  16. package/dist/core/fix/patterns.js +21 -0
  17. package/dist/core/fix/plan.d.ts +9 -0
  18. package/dist/core/fix/plan.js +140 -0
  19. package/dist/core/fix/render.d.ts +6 -0
  20. package/dist/core/fix/render.js +68 -0
  21. package/dist/core/fix/run.d.ts +15 -0
  22. package/dist/core/fix/run.js +54 -0
  23. package/dist/core/fix/types.d.ts +34 -0
  24. package/dist/core/fix/types.js +2 -0
  25. package/dist/core/fix/writers/cursorignore.d.ts +13 -0
  26. package/dist/core/fix/writers/cursorignore.js +74 -0
  27. package/dist/core/rules/context/generated-directory.js +10 -0
  28. package/dist/core/rules/instructions/missing-path-reference.js +90 -1
  29. package/dist/core/rules/path-kind.d.ts +14 -0
  30. package/dist/core/rules/path-kind.js +77 -0
  31. package/dist/core/rules/security/env-file-exposure.js +14 -14
  32. package/dist/core/rules/security/private-key-file.js +4 -0
  33. package/dist/core/scanner/scan.d.ts +1 -2
  34. package/dist/core/scanner/scan.js +8 -5
  35. package/dist/core/scoring/compute-scores.d.ts +6 -0
  36. package/dist/core/scoring/compute-scores.js +90 -0
  37. package/dist/core/scoring/placeholder.d.ts +3 -3
  38. package/dist/core/scoring/placeholder.js +3 -3
  39. package/dist/core/verify/compare.d.ts +29 -0
  40. package/dist/core/verify/compare.js +56 -0
  41. package/dist/core/verify/load-baseline.d.ts +15 -0
  42. package/dist/core/verify/load-baseline.js +71 -0
  43. package/dist/core/verify/verify.d.ts +26 -0
  44. package/dist/core/verify/verify.js +40 -0
  45. package/dist/index.d.ts +8 -0
  46. package/dist/index.js +5 -0
  47. package/dist/reporters/terminal/report.js +7 -1
  48. package/dist/reporters/verify/json.d.ts +5 -0
  49. package/dist/reporters/verify/json.js +51 -0
  50. package/dist/reporters/verify/terminal.d.ts +2 -0
  51. package/dist/reporters/verify/terminal.js +45 -0
  52. package/dist/types/index.d.ts +3 -3
  53. 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
+ }
@@ -106,11 +106,11 @@ export interface ScanResult {
106
106
  findings: Finding[];
107
107
  summary: FindingsSummary;
108
108
  /**
109
- * Readiness scores when scoring is available.
110
- * Null while scoring is unavailable — do not treat as readiness.
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
- /** False until the readiness scoring model ships. */
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praneeth_54/agentdoctor",
3
- "version": "0.1.4-beta",
3
+ "version": "0.3.0-beta",
4
4
  "description": "Audit AI coding agent configuration in a repository — local, deterministic, no API key.",
5
5
  "type": "module",
6
6
  "bin": {