@yuaone/core 0.1.0

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 (235) hide show
  1. package/LICENSE +663 -0
  2. package/README.md +15 -0
  3. package/dist/__tests__/context-manager.test.d.ts +6 -0
  4. package/dist/__tests__/context-manager.test.d.ts.map +1 -0
  5. package/dist/__tests__/context-manager.test.js +220 -0
  6. package/dist/__tests__/context-manager.test.js.map +1 -0
  7. package/dist/__tests__/governor.test.d.ts +6 -0
  8. package/dist/__tests__/governor.test.d.ts.map +1 -0
  9. package/dist/__tests__/governor.test.js +210 -0
  10. package/dist/__tests__/governor.test.js.map +1 -0
  11. package/dist/__tests__/model-router.test.d.ts +6 -0
  12. package/dist/__tests__/model-router.test.d.ts.map +1 -0
  13. package/dist/__tests__/model-router.test.js +329 -0
  14. package/dist/__tests__/model-router.test.js.map +1 -0
  15. package/dist/agent-logger.d.ts +384 -0
  16. package/dist/agent-logger.d.ts.map +1 -0
  17. package/dist/agent-logger.js +820 -0
  18. package/dist/agent-logger.js.map +1 -0
  19. package/dist/agent-loop.d.ts +163 -0
  20. package/dist/agent-loop.d.ts.map +1 -0
  21. package/dist/agent-loop.js +609 -0
  22. package/dist/agent-loop.js.map +1 -0
  23. package/dist/agent-modes.d.ts +85 -0
  24. package/dist/agent-modes.d.ts.map +1 -0
  25. package/dist/agent-modes.js +418 -0
  26. package/dist/agent-modes.js.map +1 -0
  27. package/dist/approval.d.ts +137 -0
  28. package/dist/approval.d.ts.map +1 -0
  29. package/dist/approval.js +299 -0
  30. package/dist/approval.js.map +1 -0
  31. package/dist/async-completion-queue.d.ts +56 -0
  32. package/dist/async-completion-queue.d.ts.map +1 -0
  33. package/dist/async-completion-queue.js +77 -0
  34. package/dist/async-completion-queue.js.map +1 -0
  35. package/dist/auto-fix.d.ts +174 -0
  36. package/dist/auto-fix.d.ts.map +1 -0
  37. package/dist/auto-fix.js +319 -0
  38. package/dist/auto-fix.js.map +1 -0
  39. package/dist/codebase-context.d.ts +396 -0
  40. package/dist/codebase-context.d.ts.map +1 -0
  41. package/dist/codebase-context.js +1260 -0
  42. package/dist/codebase-context.js.map +1 -0
  43. package/dist/conflict-resolver.d.ts +191 -0
  44. package/dist/conflict-resolver.d.ts.map +1 -0
  45. package/dist/conflict-resolver.js +524 -0
  46. package/dist/conflict-resolver.js.map +1 -0
  47. package/dist/constants.d.ts +52 -0
  48. package/dist/constants.d.ts.map +1 -0
  49. package/dist/constants.js +141 -0
  50. package/dist/constants.js.map +1 -0
  51. package/dist/context-budget.d.ts +435 -0
  52. package/dist/context-budget.d.ts.map +1 -0
  53. package/dist/context-budget.js +903 -0
  54. package/dist/context-budget.js.map +1 -0
  55. package/dist/context-compressor.d.ts +143 -0
  56. package/dist/context-compressor.d.ts.map +1 -0
  57. package/dist/context-compressor.js +511 -0
  58. package/dist/context-compressor.js.map +1 -0
  59. package/dist/context-manager.d.ts +112 -0
  60. package/dist/context-manager.d.ts.map +1 -0
  61. package/dist/context-manager.js +247 -0
  62. package/dist/context-manager.js.map +1 -0
  63. package/dist/continuous-reflection.d.ts +267 -0
  64. package/dist/continuous-reflection.d.ts.map +1 -0
  65. package/dist/continuous-reflection.js +338 -0
  66. package/dist/continuous-reflection.js.map +1 -0
  67. package/dist/cross-file-refactor.d.ts +352 -0
  68. package/dist/cross-file-refactor.d.ts.map +1 -0
  69. package/dist/cross-file-refactor.js +1544 -0
  70. package/dist/cross-file-refactor.js.map +1 -0
  71. package/dist/dag-orchestrator.d.ts +138 -0
  72. package/dist/dag-orchestrator.d.ts.map +1 -0
  73. package/dist/dag-orchestrator.js +379 -0
  74. package/dist/dag-orchestrator.js.map +1 -0
  75. package/dist/debate-orchestrator.d.ts +301 -0
  76. package/dist/debate-orchestrator.d.ts.map +1 -0
  77. package/dist/debate-orchestrator.js +719 -0
  78. package/dist/debate-orchestrator.js.map +1 -0
  79. package/dist/dependency-analyzer.d.ts +113 -0
  80. package/dist/dependency-analyzer.d.ts.map +1 -0
  81. package/dist/dependency-analyzer.js +444 -0
  82. package/dist/dependency-analyzer.js.map +1 -0
  83. package/dist/design-loop.d.ts +59 -0
  84. package/dist/design-loop.d.ts.map +1 -0
  85. package/dist/design-loop.js +344 -0
  86. package/dist/design-loop.js.map +1 -0
  87. package/dist/doc-intelligence.d.ts +383 -0
  88. package/dist/doc-intelligence.d.ts.map +1 -0
  89. package/dist/doc-intelligence.js +1307 -0
  90. package/dist/doc-intelligence.js.map +1 -0
  91. package/dist/dynamic-role-generator.d.ts +76 -0
  92. package/dist/dynamic-role-generator.d.ts.map +1 -0
  93. package/dist/dynamic-role-generator.js +194 -0
  94. package/dist/dynamic-role-generator.js.map +1 -0
  95. package/dist/errors.d.ts +69 -0
  96. package/dist/errors.d.ts.map +1 -0
  97. package/dist/errors.js +102 -0
  98. package/dist/errors.js.map +1 -0
  99. package/dist/event-bus.d.ts +159 -0
  100. package/dist/event-bus.d.ts.map +1 -0
  101. package/dist/event-bus.js +305 -0
  102. package/dist/event-bus.js.map +1 -0
  103. package/dist/execution-engine.d.ts +425 -0
  104. package/dist/execution-engine.d.ts.map +1 -0
  105. package/dist/execution-engine.js +1555 -0
  106. package/dist/execution-engine.js.map +1 -0
  107. package/dist/git-intelligence.d.ts +306 -0
  108. package/dist/git-intelligence.d.ts.map +1 -0
  109. package/dist/git-intelligence.js +1099 -0
  110. package/dist/git-intelligence.js.map +1 -0
  111. package/dist/governor.d.ts +77 -0
  112. package/dist/governor.d.ts.map +1 -0
  113. package/dist/governor.js +161 -0
  114. package/dist/governor.js.map +1 -0
  115. package/dist/hierarchical-planner.d.ts +313 -0
  116. package/dist/hierarchical-planner.d.ts.map +1 -0
  117. package/dist/hierarchical-planner.js +981 -0
  118. package/dist/hierarchical-planner.js.map +1 -0
  119. package/dist/index.d.ts +121 -0
  120. package/dist/index.d.ts.map +1 -0
  121. package/dist/index.js +123 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/intent-inference.d.ts +103 -0
  124. package/dist/intent-inference.d.ts.map +1 -0
  125. package/dist/intent-inference.js +605 -0
  126. package/dist/intent-inference.js.map +1 -0
  127. package/dist/interrupt-manager.d.ts +143 -0
  128. package/dist/interrupt-manager.d.ts.map +1 -0
  129. package/dist/interrupt-manager.js +196 -0
  130. package/dist/interrupt-manager.js.map +1 -0
  131. package/dist/kernel.d.ts +564 -0
  132. package/dist/kernel.d.ts.map +1 -0
  133. package/dist/kernel.js +1419 -0
  134. package/dist/kernel.js.map +1 -0
  135. package/dist/language-support.d.ts +232 -0
  136. package/dist/language-support.d.ts.map +1 -0
  137. package/dist/language-support.js +1134 -0
  138. package/dist/language-support.js.map +1 -0
  139. package/dist/llm-client.d.ts +82 -0
  140. package/dist/llm-client.d.ts.map +1 -0
  141. package/dist/llm-client.js +475 -0
  142. package/dist/llm-client.js.map +1 -0
  143. package/dist/mcp-client.d.ts +232 -0
  144. package/dist/mcp-client.d.ts.map +1 -0
  145. package/dist/mcp-client.js +718 -0
  146. package/dist/mcp-client.js.map +1 -0
  147. package/dist/memory-manager.d.ts +200 -0
  148. package/dist/memory-manager.d.ts.map +1 -0
  149. package/dist/memory-manager.js +568 -0
  150. package/dist/memory-manager.js.map +1 -0
  151. package/dist/memory.d.ts +87 -0
  152. package/dist/memory.d.ts.map +1 -0
  153. package/dist/memory.js +341 -0
  154. package/dist/memory.js.map +1 -0
  155. package/dist/model-router.d.ts +245 -0
  156. package/dist/model-router.d.ts.map +1 -0
  157. package/dist/model-router.js +632 -0
  158. package/dist/model-router.js.map +1 -0
  159. package/dist/parallel-executor.d.ts +125 -0
  160. package/dist/parallel-executor.d.ts.map +1 -0
  161. package/dist/parallel-executor.js +201 -0
  162. package/dist/parallel-executor.js.map +1 -0
  163. package/dist/perf-optimizer.d.ts +212 -0
  164. package/dist/perf-optimizer.d.ts.map +1 -0
  165. package/dist/perf-optimizer.js +721 -0
  166. package/dist/perf-optimizer.js.map +1 -0
  167. package/dist/persona.d.ts +305 -0
  168. package/dist/persona.d.ts.map +1 -0
  169. package/dist/persona.js +887 -0
  170. package/dist/persona.js.map +1 -0
  171. package/dist/planner.d.ts +70 -0
  172. package/dist/planner.d.ts.map +1 -0
  173. package/dist/planner.js +264 -0
  174. package/dist/planner.js.map +1 -0
  175. package/dist/qa-pipeline.d.ts +365 -0
  176. package/dist/qa-pipeline.d.ts.map +1 -0
  177. package/dist/qa-pipeline.js +1352 -0
  178. package/dist/qa-pipeline.js.map +1 -0
  179. package/dist/reasoning-adapter.d.ts +116 -0
  180. package/dist/reasoning-adapter.d.ts.map +1 -0
  181. package/dist/reasoning-adapter.js +187 -0
  182. package/dist/reasoning-adapter.js.map +1 -0
  183. package/dist/role-registry.d.ts +55 -0
  184. package/dist/role-registry.d.ts.map +1 -0
  185. package/dist/role-registry.js +192 -0
  186. package/dist/role-registry.js.map +1 -0
  187. package/dist/sandbox-tiers.d.ts +327 -0
  188. package/dist/sandbox-tiers.d.ts.map +1 -0
  189. package/dist/sandbox-tiers.js +928 -0
  190. package/dist/sandbox-tiers.js.map +1 -0
  191. package/dist/security-scanner.d.ts +222 -0
  192. package/dist/security-scanner.d.ts.map +1 -0
  193. package/dist/security-scanner.js +1129 -0
  194. package/dist/security-scanner.js.map +1 -0
  195. package/dist/security.d.ts +93 -0
  196. package/dist/security.d.ts.map +1 -0
  197. package/dist/security.js +393 -0
  198. package/dist/security.js.map +1 -0
  199. package/dist/self-reflection.d.ts +397 -0
  200. package/dist/self-reflection.d.ts.map +1 -0
  201. package/dist/self-reflection.js +908 -0
  202. package/dist/self-reflection.js.map +1 -0
  203. package/dist/session-persistence.d.ts +191 -0
  204. package/dist/session-persistence.d.ts.map +1 -0
  205. package/dist/session-persistence.js +395 -0
  206. package/dist/session-persistence.js.map +1 -0
  207. package/dist/speculative-executor.d.ts +210 -0
  208. package/dist/speculative-executor.d.ts.map +1 -0
  209. package/dist/speculative-executor.js +618 -0
  210. package/dist/speculative-executor.js.map +1 -0
  211. package/dist/state-machine.d.ts +289 -0
  212. package/dist/state-machine.d.ts.map +1 -0
  213. package/dist/state-machine.js +695 -0
  214. package/dist/state-machine.js.map +1 -0
  215. package/dist/sub-agent.d.ts +177 -0
  216. package/dist/sub-agent.d.ts.map +1 -0
  217. package/dist/sub-agent.js +303 -0
  218. package/dist/sub-agent.js.map +1 -0
  219. package/dist/system-prompt.d.ts +26 -0
  220. package/dist/system-prompt.d.ts.map +1 -0
  221. package/dist/system-prompt.js +84 -0
  222. package/dist/system-prompt.js.map +1 -0
  223. package/dist/test-intelligence.d.ts +439 -0
  224. package/dist/test-intelligence.d.ts.map +1 -0
  225. package/dist/test-intelligence.js +1165 -0
  226. package/dist/test-intelligence.js.map +1 -0
  227. package/dist/types.d.ts +632 -0
  228. package/dist/types.d.ts.map +1 -0
  229. package/dist/types.js +6 -0
  230. package/dist/types.js.map +1 -0
  231. package/dist/vector-index.d.ts +314 -0
  232. package/dist/vector-index.d.ts.map +1 -0
  233. package/dist/vector-index.js +618 -0
  234. package/dist/vector-index.js.map +1 -0
  235. package/package.json +41 -0
@@ -0,0 +1,383 @@
1
+ /**
2
+ * @module doc-intelligence
3
+ * @description Documentation Intelligence — analyzes code to generate, validate,
4
+ * and maintain documentation automatically.
5
+ *
6
+ * Features:
7
+ * 1. **JSDoc/TSDoc Generation** — parse function signatures, generate doc templates
8
+ * 2. **README Generation** — analyze project structure, generate sections
9
+ * 3. **Changelog Generation** — parse conventional commits, group by type
10
+ * 4. **API Documentation** — extract exports, generate API reference
11
+ * 5. **Documentation Quality Analysis** — coverage, freshness, completeness, grading
12
+ *
13
+ * Uses regex-based parsing (no AST libraries). Designed for the YUAN coding agent
14
+ * to automatically maintain documentation alongside code changes.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const di = new DocIntelligence({
19
+ * projectPath: "/path/to/project",
20
+ * srcDirs: ["src"],
21
+ * templateStyle: "jsdoc",
22
+ * });
23
+ *
24
+ * // Analyze doc coverage
25
+ * const files = new Map<string, string>();
26
+ * files.set("src/index.ts", sourceCode);
27
+ * const coverage = di.analyzeCoverage(files);
28
+ * console.log(`Coverage: ${coverage.coveragePercent}% (Grade: ${coverage.grade})`);
29
+ *
30
+ * // Generate JSDoc for a function
31
+ * const jsdoc = di.generateJSDoc("function add(a: number, b: number): number { return a + b; }");
32
+ *
33
+ * // Generate changelog from commits
34
+ * const changelog = di.generateChangelog(commits);
35
+ * ```
36
+ */
37
+ /** Documentation coverage analysis result. */
38
+ export interface DocCoverage {
39
+ /** Total number of exported symbols */
40
+ totalExports: number;
41
+ /** Number of exports with JSDoc/TSDoc */
42
+ documentedExports: number;
43
+ /** Coverage percentage (0–100) */
44
+ coveragePercent: number;
45
+ /** Symbols missing documentation */
46
+ missing: DocMissing[];
47
+ /** Symbols with stale documentation */
48
+ stale: DocStale[];
49
+ /** Overall documentation grade */
50
+ grade: "A" | "B" | "C" | "D" | "F";
51
+ }
52
+ /** A symbol missing documentation. */
53
+ export interface DocMissing {
54
+ /** Symbol name */
55
+ symbolName: string;
56
+ /** Symbol type (function, class, interface, etc.) */
57
+ symbolType: string;
58
+ /** File path where the symbol is defined */
59
+ filePath: string;
60
+ /** Line number (1-based) */
61
+ line: number;
62
+ }
63
+ /** A symbol with stale (outdated) documentation. */
64
+ export interface DocStale {
65
+ /** Symbol name */
66
+ symbolName: string;
67
+ /** File path */
68
+ filePath: string;
69
+ /** Line number of the JSDoc comment */
70
+ docLine: number;
71
+ /** Description of what changed in the code */
72
+ lastCodeChange: string;
73
+ }
74
+ /** A generated documentation artifact. */
75
+ export interface GeneratedDoc {
76
+ /** Type of documentation */
77
+ type: "jsdoc" | "readme" | "changelog" | "api-reference";
78
+ /** Generated content */
79
+ content: string;
80
+ /** Target file path */
81
+ targetFile: string;
82
+ /** Whether this is a new file (true) or update to existing (false) */
83
+ isNew: boolean;
84
+ }
85
+ /** A structured changelog entry. */
86
+ export interface ChangelogEntry {
87
+ /** Version string (e.g., "1.2.0") */
88
+ version: string;
89
+ /** Date string (ISO format, e.g., "2026-03-09") */
90
+ date: string;
91
+ /** Grouped changes by type */
92
+ sections: {
93
+ breaking: string[];
94
+ features: string[];
95
+ fixes: string[];
96
+ refactors: string[];
97
+ docs: string[];
98
+ other: string[];
99
+ };
100
+ /** Recommended semver bump */
101
+ semverBump: "major" | "minor" | "patch";
102
+ }
103
+ /** Configuration for DocIntelligence. */
104
+ export interface DocIntelligenceConfig {
105
+ /** Project root path */
106
+ projectPath: string;
107
+ /** Source directories to scan (default: ["src"]) */
108
+ srcDirs?: string[];
109
+ /** Include private/non-exported symbols (default: false) */
110
+ includePrivate?: boolean;
111
+ /** Documentation template style (default: "jsdoc") */
112
+ templateStyle?: "jsdoc" | "tsdoc";
113
+ /** Changelog format (default: "keepachangelog") */
114
+ changelogFormat?: "keepachangelog" | "conventional";
115
+ }
116
+ /** Project information for README generation. */
117
+ export interface ProjectInfo {
118
+ /** Package name */
119
+ name: string;
120
+ /** Package description */
121
+ description: string;
122
+ /** Parsed package.json contents */
123
+ packageJson: Record<string, unknown>;
124
+ /** List of source file paths */
125
+ srcFiles: string[];
126
+ /** Whether the project has test files */
127
+ hasTests: boolean;
128
+ /** Whether the project has a CLI entry point */
129
+ hasCLI: boolean;
130
+ }
131
+ /** Information about an exported symbol. */
132
+ export interface ExportInfo {
133
+ /** Symbol name */
134
+ name: string;
135
+ /** Symbol type */
136
+ type: "function" | "class" | "interface" | "type" | "enum" | "const";
137
+ /** File path */
138
+ filePath: string;
139
+ /** Line number (1-based) */
140
+ line: number;
141
+ /** Full signature */
142
+ signature: string;
143
+ /** Whether the symbol has JSDoc */
144
+ hasDoc: boolean;
145
+ /** Existing JSDoc content, if any */
146
+ docContent?: string;
147
+ }
148
+ /** Parsed git commit information. */
149
+ export interface CommitInfo {
150
+ /** Commit hash */
151
+ hash: string;
152
+ /** Commit message */
153
+ message: string;
154
+ /** Author name */
155
+ author: string;
156
+ /** Date string */
157
+ date: string;
158
+ /** Changed file paths */
159
+ files: string[];
160
+ }
161
+ /** Parsed conventional commit message. */
162
+ export interface ParsedCommit {
163
+ /** Commit type (feat, fix, etc.) */
164
+ type: string;
165
+ /** Scope (optional) */
166
+ scope?: string;
167
+ /** Commit description */
168
+ description: string;
169
+ /** Whether this is a breaking change */
170
+ breaking: boolean;
171
+ /** Commit body (optional) */
172
+ body?: string;
173
+ }
174
+ /**
175
+ * DocIntelligence — analyzes code to generate, validate, and maintain
176
+ * documentation automatically.
177
+ *
178
+ * Provides:
179
+ * - Coverage analysis (% of exports with docs, grading A–F)
180
+ * - JSDoc/TSDoc generation from function signatures
181
+ * - README generation from project structure
182
+ * - Changelog generation from conventional commits
183
+ * - API reference generation from exported symbols
184
+ * - Staleness detection (code changed but docs did not)
185
+ */
186
+ export declare class DocIntelligence {
187
+ private readonly config;
188
+ /**
189
+ * Create a new DocIntelligence instance.
190
+ *
191
+ * @param config - Configuration options
192
+ */
193
+ constructor(config: DocIntelligenceConfig);
194
+ /**
195
+ * Analyze documentation coverage across all provided files.
196
+ *
197
+ * Scans each file for exported symbols and checks whether they have
198
+ * JSDoc comments. Returns coverage stats and a grade (A–F).
199
+ *
200
+ * @param files - Map of file path to file content
201
+ * @returns Documentation coverage analysis
202
+ */
203
+ analyzeCoverage(files: Map<string, string>): DocCoverage;
204
+ /**
205
+ * Find undocumented exported symbols in a single file.
206
+ *
207
+ * @param content - File content
208
+ * @param filePath - File path (for reporting)
209
+ * @returns List of missing documentation entries
210
+ */
211
+ findUndocumented(content: string, filePath: string): DocMissing[];
212
+ /**
213
+ * Detect stale documentation in a file.
214
+ *
215
+ * Checks for common staleness indicators:
216
+ * - @param tags that don't match actual parameters
217
+ * - @returns tag present but function returns void
218
+ * - @deprecated tag on active code
219
+ * - JSDoc description mentions types/names that no longer exist
220
+ *
221
+ * @param content - File content
222
+ * @param filePath - File path (for reporting)
223
+ * @param gitLog - Optional git log output for change detection
224
+ * @returns List of stale documentation entries
225
+ */
226
+ detectStaleDoc(content: string, filePath: string, gitLog?: string): DocStale[];
227
+ /**
228
+ * Generate a JSDoc comment for a function/method code snippet.
229
+ *
230
+ * Parses the function signature and produces a template with
231
+ * @param, @returns, @throws, and @example tags.
232
+ *
233
+ * @param functionCode - The function source code
234
+ * @param context - Optional surrounding context for better descriptions
235
+ * @returns Generated JSDoc string
236
+ */
237
+ generateJSDoc(functionCode: string, context?: string): string;
238
+ /**
239
+ * Generate a README document from project information.
240
+ *
241
+ * Creates sections: Overview, Installation, Usage, API Reference,
242
+ * Configuration, and License.
243
+ *
244
+ * @param projectInfo - Project metadata and structure
245
+ * @returns Generated README document
246
+ */
247
+ generateReadme(projectInfo: ProjectInfo): GeneratedDoc;
248
+ /**
249
+ * Generate a changelog entry from a list of commits.
250
+ *
251
+ * Parses conventional commit messages and groups them by type.
252
+ * Determines the recommended semver bump based on commit types.
253
+ *
254
+ * @param commits - List of commit information
255
+ * @returns Structured changelog entry
256
+ */
257
+ generateChangelog(commits: CommitInfo[]): ChangelogEntry;
258
+ /**
259
+ * Generate an API reference document from exported symbols.
260
+ *
261
+ * Creates a markdown document with sections for each export type
262
+ * (functions, classes, interfaces, types, enums, constants).
263
+ *
264
+ * @param exports - List of exported symbol information
265
+ * @returns Generated API reference document
266
+ */
267
+ generateAPIReference(exports: ExportInfo[]): GeneratedDoc;
268
+ /**
269
+ * Parse all exported symbols from a file's content.
270
+ *
271
+ * Uses regex patterns to detect functions, classes, interfaces,
272
+ * type aliases, enums, and const exports. Checks whether each
273
+ * symbol has a preceding JSDoc comment.
274
+ *
275
+ * @param content - File content
276
+ * @param filePath - File path (for reporting)
277
+ * @returns List of exported symbols
278
+ */
279
+ parseExports(content: string, filePath: string): ExportInfo[];
280
+ /**
281
+ * Parse a conventional commit message.
282
+ *
283
+ * Supports the format: `type(scope)!: description`
284
+ * where scope and `!` (breaking) are optional.
285
+ *
286
+ * @param message - Commit message (first line)
287
+ * @returns Parsed commit or null if not conventional format
288
+ */
289
+ parseConventionalCommit(message: string): ParsedCommit | null;
290
+ /**
291
+ * Grade documentation quality based on coverage metrics.
292
+ *
293
+ * Grading scale:
294
+ * - A: >= 90% coverage
295
+ * - B: >= 75% coverage
296
+ * - C: >= 60% coverage
297
+ * - D: >= 40% coverage
298
+ * - F: < 40% coverage
299
+ *
300
+ * Stale docs reduce the grade by one level per 10 stale entries.
301
+ *
302
+ * @param coverage - Documentation coverage data
303
+ * @returns Documentation grade
304
+ */
305
+ gradeDocumentation(coverage: DocCoverage): DocCoverage["grade"];
306
+ /**
307
+ * Execute a regex against content and invoke callback for each match.
308
+ * If includePrivate is false, only matches that start with `export` are included.
309
+ */
310
+ private extractWithRegex;
311
+ /**
312
+ * Parse a function/method signature from code.
313
+ */
314
+ private parseFunctionSignature;
315
+ /**
316
+ * Parse function parameters from a parameter string.
317
+ */
318
+ private parseParams;
319
+ /**
320
+ * Split parameter string respecting nested brackets/generics.
321
+ */
322
+ private splitParams;
323
+ /**
324
+ * Find a top-level character (not nested in brackets).
325
+ */
326
+ private findTopLevelChar;
327
+ /**
328
+ * Find all JSDoc blocks in content, returning their position and parsed tags.
329
+ */
330
+ private findAllJSDocBlocks;
331
+ /**
332
+ * Analyze a JSDoc comment block.
333
+ */
334
+ private analyzeJSDoc;
335
+ /**
336
+ * Infer a description from function name and context.
337
+ */
338
+ private inferDescription;
339
+ /**
340
+ * Convert camelCase/PascalCase to space-separated words.
341
+ */
342
+ private camelToWords;
343
+ /**
344
+ * Parse generic type parameters.
345
+ */
346
+ private parseGenericParams;
347
+ /**
348
+ * Check if function code might throw errors.
349
+ */
350
+ private mightThrow;
351
+ /**
352
+ * Generate an example function call.
353
+ */
354
+ private generateExampleCall;
355
+ /**
356
+ * Generate an example value for a parameter.
357
+ */
358
+ private generateExampleValue;
359
+ /**
360
+ * Generate a generic JSDoc for non-function symbols.
361
+ */
362
+ private generateGenericDoc;
363
+ /**
364
+ * Parse parameter names from a parameter string (simple extraction).
365
+ */
366
+ private parseParamNames;
367
+ /**
368
+ * Extract symbol name from a line of code.
369
+ */
370
+ private extractSymbolName;
371
+ /**
372
+ * Detect staleness using git log information.
373
+ */
374
+ private detectGitBasedStaleness;
375
+ /**
376
+ * Format a changelog entry as markdown text.
377
+ *
378
+ * @param entry - Changelog entry to format
379
+ * @returns Formatted markdown string
380
+ */
381
+ formatChangelog(entry: ChangelogEntry): string;
382
+ }
383
+ //# sourceMappingURL=doc-intelligence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doc-intelligence.d.ts","sourceRoot":"","sources":["../src/doc-intelligence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAMH,8CAA8C;AAC9C,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kCAAkC;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,uCAAuC;IACvC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,kCAAkC;IAClC,KAAK,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CACpC;AAED,sCAAsC;AACtC,MAAM,WAAW,UAAU;IACzB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,oDAAoD;AACpD,MAAM,WAAW,QAAQ;IACvB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,0CAA0C;AAC1C,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,IAAI,EA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