@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.
- package/LICENSE +663 -0
- package/README.md +15 -0
- package/dist/__tests__/context-manager.test.d.ts +6 -0
- package/dist/__tests__/context-manager.test.d.ts.map +1 -0
- package/dist/__tests__/context-manager.test.js +220 -0
- package/dist/__tests__/context-manager.test.js.map +1 -0
- package/dist/__tests__/governor.test.d.ts +6 -0
- package/dist/__tests__/governor.test.d.ts.map +1 -0
- package/dist/__tests__/governor.test.js +210 -0
- package/dist/__tests__/governor.test.js.map +1 -0
- package/dist/__tests__/model-router.test.d.ts +6 -0
- package/dist/__tests__/model-router.test.d.ts.map +1 -0
- package/dist/__tests__/model-router.test.js +329 -0
- package/dist/__tests__/model-router.test.js.map +1 -0
- package/dist/agent-logger.d.ts +384 -0
- package/dist/agent-logger.d.ts.map +1 -0
- package/dist/agent-logger.js +820 -0
- package/dist/agent-logger.js.map +1 -0
- package/dist/agent-loop.d.ts +163 -0
- package/dist/agent-loop.d.ts.map +1 -0
- package/dist/agent-loop.js +609 -0
- package/dist/agent-loop.js.map +1 -0
- package/dist/agent-modes.d.ts +85 -0
- package/dist/agent-modes.d.ts.map +1 -0
- package/dist/agent-modes.js +418 -0
- package/dist/agent-modes.js.map +1 -0
- package/dist/approval.d.ts +137 -0
- package/dist/approval.d.ts.map +1 -0
- package/dist/approval.js +299 -0
- package/dist/approval.js.map +1 -0
- package/dist/async-completion-queue.d.ts +56 -0
- package/dist/async-completion-queue.d.ts.map +1 -0
- package/dist/async-completion-queue.js +77 -0
- package/dist/async-completion-queue.js.map +1 -0
- package/dist/auto-fix.d.ts +174 -0
- package/dist/auto-fix.d.ts.map +1 -0
- package/dist/auto-fix.js +319 -0
- package/dist/auto-fix.js.map +1 -0
- package/dist/codebase-context.d.ts +396 -0
- package/dist/codebase-context.d.ts.map +1 -0
- package/dist/codebase-context.js +1260 -0
- package/dist/codebase-context.js.map +1 -0
- package/dist/conflict-resolver.d.ts +191 -0
- package/dist/conflict-resolver.d.ts.map +1 -0
- package/dist/conflict-resolver.js +524 -0
- package/dist/conflict-resolver.js.map +1 -0
- package/dist/constants.d.ts +52 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +141 -0
- package/dist/constants.js.map +1 -0
- package/dist/context-budget.d.ts +435 -0
- package/dist/context-budget.d.ts.map +1 -0
- package/dist/context-budget.js +903 -0
- package/dist/context-budget.js.map +1 -0
- package/dist/context-compressor.d.ts +143 -0
- package/dist/context-compressor.d.ts.map +1 -0
- package/dist/context-compressor.js +511 -0
- package/dist/context-compressor.js.map +1 -0
- package/dist/context-manager.d.ts +112 -0
- package/dist/context-manager.d.ts.map +1 -0
- package/dist/context-manager.js +247 -0
- package/dist/context-manager.js.map +1 -0
- package/dist/continuous-reflection.d.ts +267 -0
- package/dist/continuous-reflection.d.ts.map +1 -0
- package/dist/continuous-reflection.js +338 -0
- package/dist/continuous-reflection.js.map +1 -0
- package/dist/cross-file-refactor.d.ts +352 -0
- package/dist/cross-file-refactor.d.ts.map +1 -0
- package/dist/cross-file-refactor.js +1544 -0
- package/dist/cross-file-refactor.js.map +1 -0
- package/dist/dag-orchestrator.d.ts +138 -0
- package/dist/dag-orchestrator.d.ts.map +1 -0
- package/dist/dag-orchestrator.js +379 -0
- package/dist/dag-orchestrator.js.map +1 -0
- package/dist/debate-orchestrator.d.ts +301 -0
- package/dist/debate-orchestrator.d.ts.map +1 -0
- package/dist/debate-orchestrator.js +719 -0
- package/dist/debate-orchestrator.js.map +1 -0
- package/dist/dependency-analyzer.d.ts +113 -0
- package/dist/dependency-analyzer.d.ts.map +1 -0
- package/dist/dependency-analyzer.js +444 -0
- package/dist/dependency-analyzer.js.map +1 -0
- package/dist/design-loop.d.ts +59 -0
- package/dist/design-loop.d.ts.map +1 -0
- package/dist/design-loop.js +344 -0
- package/dist/design-loop.js.map +1 -0
- package/dist/doc-intelligence.d.ts +383 -0
- package/dist/doc-intelligence.d.ts.map +1 -0
- package/dist/doc-intelligence.js +1307 -0
- package/dist/doc-intelligence.js.map +1 -0
- package/dist/dynamic-role-generator.d.ts +76 -0
- package/dist/dynamic-role-generator.d.ts.map +1 -0
- package/dist/dynamic-role-generator.js +194 -0
- package/dist/dynamic-role-generator.js.map +1 -0
- package/dist/errors.d.ts +69 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +102 -0
- package/dist/errors.js.map +1 -0
- package/dist/event-bus.d.ts +159 -0
- package/dist/event-bus.d.ts.map +1 -0
- package/dist/event-bus.js +305 -0
- package/dist/event-bus.js.map +1 -0
- package/dist/execution-engine.d.ts +425 -0
- package/dist/execution-engine.d.ts.map +1 -0
- package/dist/execution-engine.js +1555 -0
- package/dist/execution-engine.js.map +1 -0
- package/dist/git-intelligence.d.ts +306 -0
- package/dist/git-intelligence.d.ts.map +1 -0
- package/dist/git-intelligence.js +1099 -0
- package/dist/git-intelligence.js.map +1 -0
- package/dist/governor.d.ts +77 -0
- package/dist/governor.d.ts.map +1 -0
- package/dist/governor.js +161 -0
- package/dist/governor.js.map +1 -0
- package/dist/hierarchical-planner.d.ts +313 -0
- package/dist/hierarchical-planner.d.ts.map +1 -0
- package/dist/hierarchical-planner.js +981 -0
- package/dist/hierarchical-planner.js.map +1 -0
- package/dist/index.d.ts +121 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +123 -0
- package/dist/index.js.map +1 -0
- package/dist/intent-inference.d.ts +103 -0
- package/dist/intent-inference.d.ts.map +1 -0
- package/dist/intent-inference.js +605 -0
- package/dist/intent-inference.js.map +1 -0
- package/dist/interrupt-manager.d.ts +143 -0
- package/dist/interrupt-manager.d.ts.map +1 -0
- package/dist/interrupt-manager.js +196 -0
- package/dist/interrupt-manager.js.map +1 -0
- package/dist/kernel.d.ts +564 -0
- package/dist/kernel.d.ts.map +1 -0
- package/dist/kernel.js +1419 -0
- package/dist/kernel.js.map +1 -0
- package/dist/language-support.d.ts +232 -0
- package/dist/language-support.d.ts.map +1 -0
- package/dist/language-support.js +1134 -0
- package/dist/language-support.js.map +1 -0
- package/dist/llm-client.d.ts +82 -0
- package/dist/llm-client.d.ts.map +1 -0
- package/dist/llm-client.js +475 -0
- package/dist/llm-client.js.map +1 -0
- package/dist/mcp-client.d.ts +232 -0
- package/dist/mcp-client.d.ts.map +1 -0
- package/dist/mcp-client.js +718 -0
- package/dist/mcp-client.js.map +1 -0
- package/dist/memory-manager.d.ts +200 -0
- package/dist/memory-manager.d.ts.map +1 -0
- package/dist/memory-manager.js +568 -0
- package/dist/memory-manager.js.map +1 -0
- package/dist/memory.d.ts +87 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +341 -0
- package/dist/memory.js.map +1 -0
- package/dist/model-router.d.ts +245 -0
- package/dist/model-router.d.ts.map +1 -0
- package/dist/model-router.js +632 -0
- package/dist/model-router.js.map +1 -0
- package/dist/parallel-executor.d.ts +125 -0
- package/dist/parallel-executor.d.ts.map +1 -0
- package/dist/parallel-executor.js +201 -0
- package/dist/parallel-executor.js.map +1 -0
- package/dist/perf-optimizer.d.ts +212 -0
- package/dist/perf-optimizer.d.ts.map +1 -0
- package/dist/perf-optimizer.js +721 -0
- package/dist/perf-optimizer.js.map +1 -0
- package/dist/persona.d.ts +305 -0
- package/dist/persona.d.ts.map +1 -0
- package/dist/persona.js +887 -0
- package/dist/persona.js.map +1 -0
- package/dist/planner.d.ts +70 -0
- package/dist/planner.d.ts.map +1 -0
- package/dist/planner.js +264 -0
- package/dist/planner.js.map +1 -0
- package/dist/qa-pipeline.d.ts +365 -0
- package/dist/qa-pipeline.d.ts.map +1 -0
- package/dist/qa-pipeline.js +1352 -0
- package/dist/qa-pipeline.js.map +1 -0
- package/dist/reasoning-adapter.d.ts +116 -0
- package/dist/reasoning-adapter.d.ts.map +1 -0
- package/dist/reasoning-adapter.js +187 -0
- package/dist/reasoning-adapter.js.map +1 -0
- package/dist/role-registry.d.ts +55 -0
- package/dist/role-registry.d.ts.map +1 -0
- package/dist/role-registry.js +192 -0
- package/dist/role-registry.js.map +1 -0
- package/dist/sandbox-tiers.d.ts +327 -0
- package/dist/sandbox-tiers.d.ts.map +1 -0
- package/dist/sandbox-tiers.js +928 -0
- package/dist/sandbox-tiers.js.map +1 -0
- package/dist/security-scanner.d.ts +222 -0
- package/dist/security-scanner.d.ts.map +1 -0
- package/dist/security-scanner.js +1129 -0
- package/dist/security-scanner.js.map +1 -0
- package/dist/security.d.ts +93 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/security.js +393 -0
- package/dist/security.js.map +1 -0
- package/dist/self-reflection.d.ts +397 -0
- package/dist/self-reflection.d.ts.map +1 -0
- package/dist/self-reflection.js +908 -0
- package/dist/self-reflection.js.map +1 -0
- package/dist/session-persistence.d.ts +191 -0
- package/dist/session-persistence.d.ts.map +1 -0
- package/dist/session-persistence.js +395 -0
- package/dist/session-persistence.js.map +1 -0
- package/dist/speculative-executor.d.ts +210 -0
- package/dist/speculative-executor.d.ts.map +1 -0
- package/dist/speculative-executor.js +618 -0
- package/dist/speculative-executor.js.map +1 -0
- package/dist/state-machine.d.ts +289 -0
- package/dist/state-machine.d.ts.map +1 -0
- package/dist/state-machine.js +695 -0
- package/dist/state-machine.js.map +1 -0
- package/dist/sub-agent.d.ts +177 -0
- package/dist/sub-agent.d.ts.map +1 -0
- package/dist/sub-agent.js +303 -0
- package/dist/sub-agent.js.map +1 -0
- package/dist/system-prompt.d.ts +26 -0
- package/dist/system-prompt.d.ts.map +1 -0
- package/dist/system-prompt.js +84 -0
- package/dist/system-prompt.js.map +1 -0
- package/dist/test-intelligence.d.ts +439 -0
- package/dist/test-intelligence.d.ts.map +1 -0
- package/dist/test-intelligence.js +1165 -0
- package/dist/test-intelligence.js.map +1 -0
- package/dist/types.d.ts +632 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/vector-index.d.ts +314 -0
- package/dist/vector-index.d.ts.map +1 -0
- package/dist/vector-index.js +618 -0
- package/dist/vector-index.js.map +1 -0
- 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-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