@praneeth_54/agentdoctor 1.1.1 → 2.0.1

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 (224) hide show
  1. package/CHANGELOG.md +164 -7
  2. package/README.md +263 -513
  3. package/dist/agents/aider/adapter.d.ts +1 -0
  4. package/dist/agents/aider/adapter.js +1 -0
  5. package/dist/agents/aider/detector.d.ts +14 -0
  6. package/dist/agents/aider/detector.js +120 -0
  7. package/dist/agents/copilot/adapter.d.ts +1 -0
  8. package/dist/agents/copilot/adapter.js +1 -0
  9. package/dist/agents/copilot/detector.d.ts +13 -0
  10. package/dist/agents/copilot/detector.js +113 -0
  11. package/dist/agents/gemini/adapter.d.ts +1 -0
  12. package/dist/agents/gemini/adapter.js +1 -0
  13. package/dist/agents/gemini/detector.d.ts +13 -0
  14. package/dist/agents/gemini/detector.js +151 -0
  15. package/dist/agents/registry.js +13 -1
  16. package/dist/agents/types.d.ts +1 -1
  17. package/dist/agents/windsurf/adapter.d.ts +1 -0
  18. package/dist/agents/windsurf/adapter.js +1 -0
  19. package/dist/agents/windsurf/detector.d.ts +14 -0
  20. package/dist/agents/windsurf/detector.js +119 -0
  21. package/dist/architecture/c4.d.ts +22 -0
  22. package/dist/architecture/c4.js +62 -0
  23. package/dist/architecture/contract.d.ts +64 -0
  24. package/dist/architecture/contract.js +373 -0
  25. package/dist/assurance/change.d.ts +211 -0
  26. package/dist/assurance/change.js +624 -0
  27. package/dist/assurance/proof.d.ts +136 -0
  28. package/dist/assurance/proof.js +338 -0
  29. package/dist/auth/index.d.ts +81 -0
  30. package/dist/auth/index.js +130 -0
  31. package/dist/auth/rbac.d.ts +9 -0
  32. package/dist/auth/rbac.js +26 -0
  33. package/dist/cli/commands/architecture.d.ts +6 -0
  34. package/dist/cli/commands/architecture.js +109 -0
  35. package/dist/cli/commands/assurance.d.ts +67 -0
  36. package/dist/cli/commands/assurance.js +210 -0
  37. package/dist/cli/commands/brain.d.ts +12 -0
  38. package/dist/cli/commands/brain.js +162 -0
  39. package/dist/cli/commands/complete.d.ts +23 -0
  40. package/dist/cli/commands/complete.js +232 -0
  41. package/dist/cli/commands/explain.js +1 -1
  42. package/dist/cli/commands/fix.js +22 -2
  43. package/dist/cli/commands/mcp.d.ts +8 -0
  44. package/dist/cli/commands/mcp.js +14 -0
  45. package/dist/cli/commands/platform.d.ts +17 -0
  46. package/dist/cli/commands/platform.js +195 -0
  47. package/dist/cli/commands/policy-graph-run.d.ts +40 -0
  48. package/dist/cli/commands/policy-graph-run.js +200 -0
  49. package/dist/cli/commands/v2.d.ts +55 -0
  50. package/dist/cli/commands/v2.js +278 -0
  51. package/dist/cli/commands/workspace.d.ts +9 -0
  52. package/dist/cli/commands/workspace.js +82 -0
  53. package/dist/cli/program.js +1328 -3
  54. package/dist/constants.d.ts +3 -2
  55. package/dist/constants.js +5 -1
  56. package/dist/contracts/adapters.d.ts +7 -0
  57. package/dist/contracts/adapters.js +60 -0
  58. package/dist/contracts/index.d.ts +162 -0
  59. package/dist/contracts/index.js +18 -0
  60. package/dist/core/baseline/store.d.ts +48 -0
  61. package/dist/core/baseline/store.js +163 -0
  62. package/dist/core/brain-cli/service.d.ts +26 -0
  63. package/dist/core/brain-cli/service.js +175 -0
  64. package/dist/core/brain-product/init.d.ts +45 -0
  65. package/dist/core/brain-product/init.js +235 -0
  66. package/dist/core/changes/analyze.d.ts +41 -0
  67. package/dist/core/changes/analyze.js +223 -0
  68. package/dist/core/context-health/analyze.d.ts +15 -0
  69. package/dist/core/context-health/analyze.js +234 -0
  70. package/dist/core/fix/apply.d.ts +21 -4
  71. package/dist/core/fix/apply.js +118 -18
  72. package/dist/core/fix/backup.d.ts +30 -0
  73. package/dist/core/fix/backup.js +193 -0
  74. package/dist/core/fix/plan.d.ts +6 -3
  75. package/dist/core/fix/plan.js +113 -9
  76. package/dist/core/fix/render.d.ts +2 -0
  77. package/dist/core/fix/render.js +36 -21
  78. package/dist/core/fix/run.js +5 -1
  79. package/dist/core/fix/safe-target.d.ts +14 -0
  80. package/dist/core/fix/safe-target.js +81 -0
  81. package/dist/core/fix/types.d.ts +12 -1
  82. package/dist/core/fix/types.js +2 -0
  83. package/dist/core/fix/writers/claude-settings.js +3 -1
  84. package/dist/core/fix/writers/codex-config.d.ts +3 -0
  85. package/dist/core/fix/writers/codex-config.js +24 -3
  86. package/dist/core/fix/writers/cursorignore.js +3 -1
  87. package/dist/core/fix/writers/simple-ignore.d.ts +16 -0
  88. package/dist/core/fix/writers/simple-ignore.js +68 -0
  89. package/dist/core/monorepo/detect.d.ts +13 -0
  90. package/dist/core/monorepo/detect.js +121 -0
  91. package/dist/core/rules/build-context.js +22 -3
  92. package/dist/core/rules/context/generated-directory.js +11 -1
  93. package/dist/core/rules/context/large-instruction-file.js +6 -0
  94. package/dist/core/rules/context/large-log-file.js +16 -1
  95. package/dist/core/rules/ignore.d.ts +11 -1
  96. package/dist/core/rules/ignore.js +22 -1
  97. package/dist/core/rules/instructions/empty-instructions.js +7 -0
  98. package/dist/core/rules/security/env-file-exposure.js +23 -2
  99. package/dist/core/rules/security/private-key-file.js +1 -1
  100. package/dist/core/scanner/scan.js +1 -1
  101. package/dist/core/schemas/validate.d.ts +6 -0
  102. package/dist/core/schemas/validate.js +62 -0
  103. package/dist/core/scoring/compute-scores.d.ts +1 -1
  104. package/dist/core/scoring/compute-scores.js +5 -1
  105. package/dist/core/scoring/placeholder.d.ts +1 -1
  106. package/dist/core/scoring/placeholder.js +5 -1
  107. package/dist/core/secrets/scan.d.ts +29 -0
  108. package/dist/core/secrets/scan.js +172 -0
  109. package/dist/coverage/cobertura.d.ts +6 -0
  110. package/dist/coverage/cobertura.js +52 -0
  111. package/dist/coverage/istanbul.d.ts +7 -0
  112. package/dist/coverage/istanbul.js +134 -0
  113. package/dist/coverage/lcov.d.ts +7 -0
  114. package/dist/coverage/lcov.js +59 -0
  115. package/dist/coverage/load.d.ts +9 -0
  116. package/dist/coverage/load.js +39 -0
  117. package/dist/coverage/types.d.ts +23 -0
  118. package/dist/coverage/types.js +5 -0
  119. package/dist/dashboard/server.d.ts +24 -0
  120. package/dist/dashboard/server.js +402 -0
  121. package/dist/enforcement/runner.d.ts +67 -0
  122. package/dist/enforcement/runner.js +460 -0
  123. package/dist/index.d.ts +34 -0
  124. package/dist/index.js +25 -0
  125. package/dist/integrations/github/pr-analyze.d.ts +28 -0
  126. package/dist/integrations/github/pr-analyze.js +98 -0
  127. package/dist/integrations/local-ai/provider.d.ts +45 -0
  128. package/dist/integrations/local-ai/provider.js +104 -0
  129. package/dist/intelligence/git/analyze.d.ts +34 -0
  130. package/dist/intelligence/git/analyze.js +136 -0
  131. package/dist/intelligence/graph/build.d.ts +15 -0
  132. package/dist/intelligence/graph/build.js +259 -0
  133. package/dist/intelligence/graph/incremental.d.ts +68 -0
  134. package/dist/intelligence/graph/incremental.js +234 -0
  135. package/dist/intelligence/resolve/imports.d.ts +36 -0
  136. package/dist/intelligence/resolve/imports.js +245 -0
  137. package/dist/knowledge/store.d.ts +25 -0
  138. package/dist/knowledge/store.js +91 -0
  139. package/dist/languages/go.d.ts +9 -0
  140. package/dist/languages/go.js +45 -0
  141. package/dist/languages/index.d.ts +11 -0
  142. package/dist/languages/index.js +76 -0
  143. package/dist/languages/php.d.ts +7 -0
  144. package/dist/languages/php.js +193 -0
  145. package/dist/languages/python.d.ts +7 -0
  146. package/dist/languages/python.js +150 -0
  147. package/dist/languages/types.d.ts +42 -0
  148. package/dist/languages/types.js +26 -0
  149. package/dist/languages/typescript.d.ts +3 -0
  150. package/dist/languages/typescript.js +95 -0
  151. package/dist/mcp/agentdoctor/server.d.ts +16 -0
  152. package/dist/mcp/agentdoctor/server.js +67 -0
  153. package/dist/mcp/brain/session.js +7 -7
  154. package/dist/mcp/intelligence/handlers.d.ts +16 -0
  155. package/dist/mcp/intelligence/handlers.js +364 -0
  156. package/dist/mcp/intelligence/path-safety.d.ts +9 -0
  157. package/dist/mcp/intelligence/path-safety.js +63 -0
  158. package/dist/mcp/intelligence/registry.d.ts +8 -0
  159. package/dist/mcp/intelligence/registry.js +228 -0
  160. package/dist/ops/health.d.ts +18 -0
  161. package/dist/ops/health.js +51 -0
  162. package/dist/platform/ai-quality/analyze.d.ts +9 -0
  163. package/dist/platform/ai-quality/analyze.js +65 -0
  164. package/dist/platform/architecture/drift.d.ts +17 -0
  165. package/dist/platform/architecture/drift.js +74 -0
  166. package/dist/platform/auth/local.d.ts +15 -0
  167. package/dist/platform/auth/local.js +58 -0
  168. package/dist/platform/context-security/analyze.d.ts +6 -0
  169. package/dist/platform/context-security/analyze.js +97 -0
  170. package/dist/platform/firewall/evaluate.d.ts +57 -0
  171. package/dist/platform/firewall/evaluate.js +359 -0
  172. package/dist/platform/graph/build.d.ts +6 -0
  173. package/dist/platform/graph/build.js +189 -0
  174. package/dist/platform/health/analyze.d.ts +7 -0
  175. package/dist/platform/health/analyze.js +192 -0
  176. package/dist/platform/index.d.ts +27 -0
  177. package/dist/platform/index.js +89 -0
  178. package/dist/platform/knowledge/analyze.d.ts +20 -0
  179. package/dist/platform/knowledge/analyze.js +96 -0
  180. package/dist/platform/provenance/build.d.ts +44 -0
  181. package/dist/platform/provenance/build.js +65 -0
  182. package/dist/platform/readiness/scorecard.d.ts +5 -0
  183. package/dist/platform/readiness/scorecard.js +98 -0
  184. package/dist/platform/refactor/impact.d.ts +20 -0
  185. package/dist/platform/refactor/impact.js +60 -0
  186. package/dist/platform/reports/export.d.ts +12 -0
  187. package/dist/platform/reports/export.js +92 -0
  188. package/dist/platform/security/redact.d.ts +15 -0
  189. package/dist/platform/security/redact.js +87 -0
  190. package/dist/platform/sessions/store.d.ts +32 -0
  191. package/dist/platform/sessions/store.js +97 -0
  192. package/dist/platform/store.d.ts +6 -0
  193. package/dist/platform/store.js +57 -0
  194. package/dist/platform/test-impact/analyze.d.ts +50 -0
  195. package/dist/platform/test-impact/analyze.js +350 -0
  196. package/dist/platform/time-machine/compare.d.ts +17 -0
  197. package/dist/platform/time-machine/compare.js +62 -0
  198. package/dist/platform/tokens/plan.d.ts +28 -0
  199. package/dist/platform/tokens/plan.js +108 -0
  200. package/dist/platform/types.d.ts +120 -0
  201. package/dist/platform/types.js +5 -0
  202. package/dist/plugins/runtime.d.ts +36 -0
  203. package/dist/plugins/runtime.js +101 -0
  204. package/dist/plugins/sdk.d.ts +29 -0
  205. package/dist/plugins/sdk.js +114 -0
  206. package/dist/policy/compose.d.ts +34 -0
  207. package/dist/policy/compose.js +118 -0
  208. package/dist/policy/packs.d.ts +9 -0
  209. package/dist/policy/packs.js +91 -0
  210. package/dist/reporters/terminal/report.js +38 -5
  211. package/dist/security/paths.d.ts +21 -0
  212. package/dist/security/paths.js +105 -0
  213. package/dist/storage/postgres.d.ts +26 -0
  214. package/dist/storage/postgres.js +90 -0
  215. package/dist/storage/provider.d.ts +30 -0
  216. package/dist/storage/provider.js +109 -0
  217. package/dist/storage/sqlite.d.ts +33 -0
  218. package/dist/storage/sqlite.js +77 -0
  219. package/dist/team/auth.d.ts +35 -0
  220. package/dist/team/auth.js +70 -0
  221. package/dist/types/index.d.ts +5 -1
  222. package/dist/workspace/index.d.ts +69 -0
  223. package/dist/workspace/index.js +220 -0
  224. package/package.json +15 -5
@@ -0,0 +1,211 @@
1
+ export declare const EVIDENCE_SCHEMA_VERSION = "1.0.0";
2
+ export type VerificationStatus = "not-run" | "partial" | "evidence-produced" | "failed" | "verified";
3
+ export interface ChangeAssessment {
4
+ changeId: string;
5
+ schemaVersion: string;
6
+ agentDoctorVersion: string;
7
+ repository: {
8
+ root: string;
9
+ remote: string | null;
10
+ branch: string | null;
11
+ };
12
+ baseRevision: string | null;
13
+ targetRevision: string | null;
14
+ changedFiles: Array<{
15
+ path: string;
16
+ kind: string;
17
+ }>;
18
+ changedSymbols: string[];
19
+ /** Graph nodes / paths that call or import into changed symbols/files. */
20
+ callers: string[];
21
+ /** Graph targets called or imported from changed symbols/files. */
22
+ callees: string[];
23
+ /** Files that import changed files (reverse import deps). */
24
+ reverseDependencies: string[];
25
+ /** Workspace packages touched by changed files (from package.json workspaces when present). */
26
+ packageImpact: string[];
27
+ affectedComponents: string[];
28
+ dependencyImpact: {
29
+ status: "observed" | "unknown" | "heuristic";
30
+ relatedPaths: string[];
31
+ edgeCount: number;
32
+ limitations: string[];
33
+ };
34
+ architectureImpact: {
35
+ status: "inferred" | "unknown";
36
+ viewLevels: string[];
37
+ limitations: string[];
38
+ };
39
+ knowledgeReferences: Array<{
40
+ id: string;
41
+ title: string;
42
+ status: string;
43
+ authoritative: boolean;
44
+ }>;
45
+ securityFindings: {
46
+ secretFindingCount: number;
47
+ mode: "heuristic";
48
+ limitations: string[];
49
+ };
50
+ policyResults: Array<{
51
+ policyId: string;
52
+ decision: string;
53
+ reason: string;
54
+ subject: string;
55
+ action: string;
56
+ evidence: string;
57
+ }>;
58
+ testImpact: {
59
+ mode: "heuristic" | "coverage-backed";
60
+ recommendedTests: string[];
61
+ confidence: "low" | "medium" | "high";
62
+ limitations: string[];
63
+ };
64
+ evidence: {
65
+ directory: string | null;
66
+ files: string[];
67
+ };
68
+ verificationStatus: VerificationStatus;
69
+ limitations: string[];
70
+ createdAt: string;
71
+ }
72
+ export interface EvidenceManifest {
73
+ schemaVersion: string;
74
+ agentDoctorVersion: string;
75
+ changeId: string;
76
+ repositoryRoot: string;
77
+ baseRevision: string | null;
78
+ targetRevision: string | null;
79
+ createdAt: string;
80
+ files: Array<{
81
+ name: string;
82
+ sha256: string;
83
+ }>;
84
+ verificationStatus: VerificationStatus;
85
+ }
86
+ /**
87
+ * Derive callers / callees / reverse import deps from the intelligence graph
88
+ * for the given changed files and symbol ids. Honest: empty when graph lacks edges.
89
+ */
90
+ export declare function deriveGraphChangeImpact(graph: {
91
+ nodes: Array<{
92
+ id: string;
93
+ kind: string;
94
+ label: string;
95
+ path?: string;
96
+ }>;
97
+ edges: Array<{
98
+ from: string;
99
+ to: string;
100
+ kind: string;
101
+ }>;
102
+ }, changedFiles: Array<{
103
+ path: string;
104
+ kind: string;
105
+ }>, changedSymbols: string[]): {
106
+ callers: string[];
107
+ callees: string[];
108
+ reverseDependencies: string[];
109
+ };
110
+ /**
111
+ * Map changed files onto package.json workspaces (string globs or packages/*).
112
+ * Returns [] when workspaces are absent — does not invent packages.
113
+ */
114
+ export declare function derivePackageImpact(root: string, changedFiles: Array<{
115
+ path: string;
116
+ }>): Promise<string[]>;
117
+ /**
118
+ * Assemble a ChangeAssessment from existing AgentDoctor signals.
119
+ * Never sets verificationStatus to "verified" — that requires evidence verify.
120
+ */
121
+ export declare function analyzeChange(options: {
122
+ root: string;
123
+ since?: string;
124
+ changeId?: string;
125
+ coveragePath?: string;
126
+ }): Promise<ChangeAssessment>;
127
+ /**
128
+ * Persist evidence bundle. Status becomes evidence-produced (not "verified").
129
+ * "verified" is reserved for evidence verify when artifact hashes match.
130
+ */
131
+ export declare function verifyChange(options: {
132
+ root: string;
133
+ since?: string;
134
+ changeId?: string;
135
+ coveragePath?: string;
136
+ }): Promise<{
137
+ assessment: ChangeAssessment;
138
+ manifest: EvidenceManifest;
139
+ }>;
140
+ /**
141
+ * Human-readable explanation of a ChangeAssessment (does not claim correctness).
142
+ */
143
+ export declare function explainChange(assessment: ChangeAssessment): string;
144
+ /**
145
+ * Summarize base/target file diffs from git for a change.
146
+ */
147
+ export declare function diffChange(options: {
148
+ root: string;
149
+ since?: string;
150
+ changeId?: string;
151
+ }): Promise<{
152
+ changeId: string | null;
153
+ baseRevision: string | null;
154
+ targetRevision: string | null;
155
+ files: Array<{
156
+ path: string;
157
+ kind: string;
158
+ }>;
159
+ summary: {
160
+ added: number;
161
+ modified: number;
162
+ deleted: number;
163
+ renamed: number;
164
+ untracked: number;
165
+ };
166
+ stat: string | null;
167
+ limitations: string[];
168
+ }>;
169
+ /**
170
+ * Verification / evidence status for latest evidence or a specific change id.
171
+ */
172
+ export declare function changeStatus(options: {
173
+ root: string;
174
+ changeId?: string;
175
+ }): Promise<{
176
+ changeId: string | null;
177
+ evidenceDirectory: string | null;
178
+ verificationStatus: VerificationStatus;
179
+ evidencePresent: boolean;
180
+ proofPresent: boolean;
181
+ proofId: string | null;
182
+ integrityNote: string;
183
+ files: string[];
184
+ }>;
185
+ export declare function inspectEvidence(options: {
186
+ root: string;
187
+ changeId: string;
188
+ }): Promise<{
189
+ ok: boolean;
190
+ directory: string;
191
+ manifest: EvidenceManifest | null;
192
+ presentFiles: string[];
193
+ error?: string;
194
+ }>;
195
+ /**
196
+ * Hash-check evidence bundle. Returns "verified" only when all listed files match.
197
+ */
198
+ export declare function verifyEvidence(options: {
199
+ root: string;
200
+ changeId: string;
201
+ }): Promise<{
202
+ ok: boolean;
203
+ verificationStatus: VerificationStatus;
204
+ checked: Array<{
205
+ name: string;
206
+ match: boolean;
207
+ expected?: string;
208
+ actual?: string;
209
+ }>;
210
+ error?: string;
211
+ }>;