@mycodemap/mycodemap 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/CHANGELOG.md +17 -0
- package/LICENSE +21 -0
- package/README.md +559 -0
- package/dist/ai/claude.d.ts +38 -0
- package/dist/ai/claude.d.ts.map +1 -0
- package/dist/ai/claude.js +169 -0
- package/dist/ai/claude.js.map +1 -0
- package/dist/ai/codex.d.ts +38 -0
- package/dist/ai/codex.d.ts.map +1 -0
- package/dist/ai/codex.js +169 -0
- package/dist/ai/codex.js.map +1 -0
- package/dist/ai/factory.d.ts +48 -0
- package/dist/ai/factory.d.ts.map +1 -0
- package/dist/ai/factory.js +95 -0
- package/dist/ai/factory.js.map +1 -0
- package/dist/ai/index.d.ts +12 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +29 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/provider.d.ts +70 -0
- package/dist/ai/provider.d.ts.map +1 -0
- package/dist/ai/provider.js +31 -0
- package/dist/ai/provider.js.map +1 -0
- package/dist/ai/subagent-caller.d.ts +90 -0
- package/dist/ai/subagent-caller.d.ts.map +1 -0
- package/dist/ai/subagent-caller.js +280 -0
- package/dist/ai/subagent-caller.js.map +1 -0
- package/dist/ai/types.d.ts +70 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +5 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/cache/file-hash-cache.d.ts +76 -0
- package/dist/cache/file-hash-cache.d.ts.map +1 -0
- package/dist/cache/file-hash-cache.js +159 -0
- package/dist/cache/file-hash-cache.js.map +1 -0
- package/dist/cache/index.d.ts +151 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +303 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/lru-cache.d.ts +93 -0
- package/dist/cache/lru-cache.d.ts.map +1 -0
- package/dist/cache/lru-cache.js +194 -0
- package/dist/cache/lru-cache.js.map +1 -0
- package/dist/cache/parse-cache.d.ts +68 -0
- package/dist/cache/parse-cache.d.ts.map +1 -0
- package/dist/cache/parse-cache.js +173 -0
- package/dist/cache/parse-cache.js.map +1 -0
- package/dist/cli/commands/analyze.d.ts +96 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +567 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/ci.d.ts +25 -0
- package/dist/cli/commands/ci.d.ts.map +1 -0
- package/dist/cli/commands/ci.js +481 -0
- package/dist/cli/commands/ci.js.map +1 -0
- package/dist/cli/commands/complexity.d.ts +70 -0
- package/dist/cli/commands/complexity.d.ts.map +1 -0
- package/dist/cli/commands/complexity.js +479 -0
- package/dist/cli/commands/complexity.js.map +1 -0
- package/dist/cli/commands/cycles.d.ts +10 -0
- package/dist/cli/commands/cycles.d.ts.map +1 -0
- package/dist/cli/commands/cycles.js +202 -0
- package/dist/cli/commands/cycles.js.map +1 -0
- package/dist/cli/commands/deps.d.ts +61 -0
- package/dist/cli/commands/deps.d.ts.map +1 -0
- package/dist/cli/commands/deps.js +340 -0
- package/dist/cli/commands/deps.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +8 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +61 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/impact.d.ts +55 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +455 -0
- package/dist/cli/commands/impact.js.map +1 -0
- package/dist/cli/commands/init.d.ts +4 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +50 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/query.d.ts +22 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +718 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/watch-foreground.d.ts +9 -0
- package/dist/cli/commands/watch-foreground.d.ts.map +1 -0
- package/dist/cli/commands/watch-foreground.js +67 -0
- package/dist/cli/commands/watch-foreground.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +12 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +114 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/commands/workflow.d.ts +25 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +488 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +115 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/paths.d.ts +90 -0
- package/dist/cli/paths.d.ts.map +1 -0
- package/dist/cli/paths.js +136 -0
- package/dist/cli/paths.js.map +1 -0
- package/dist/cli/runtime-logger.d.ts +13 -0
- package/dist/cli/runtime-logger.d.ts.map +1 -0
- package/dist/cli/runtime-logger.js +213 -0
- package/dist/cli/runtime-logger.js.map +1 -0
- package/dist/core/analyzer.d.ts +3 -0
- package/dist/core/analyzer.d.ts.map +1 -0
- package/dist/core/analyzer.js +359 -0
- package/dist/core/analyzer.js.map +1 -0
- package/dist/core/ast-complexity-analyzer.d.ts +40 -0
- package/dist/core/ast-complexity-analyzer.d.ts.map +1 -0
- package/dist/core/ast-complexity-analyzer.js +279 -0
- package/dist/core/ast-complexity-analyzer.js.map +1 -0
- package/dist/core/global-index.d.ts +69 -0
- package/dist/core/global-index.d.ts.map +1 -0
- package/dist/core/global-index.js +388 -0
- package/dist/core/global-index.js.map +1 -0
- package/dist/generator/ai-overview.d.ts +51 -0
- package/dist/generator/ai-overview.d.ts.map +1 -0
- package/dist/generator/ai-overview.js +160 -0
- package/dist/generator/ai-overview.js.map +1 -0
- package/dist/generator/context.d.ts +5 -0
- package/dist/generator/context.d.ts.map +1 -0
- package/dist/generator/context.js +514 -0
- package/dist/generator/context.js.map +1 -0
- package/dist/generator/file-describer.d.ts +93 -0
- package/dist/generator/file-describer.d.ts.map +1 -0
- package/dist/generator/file-describer.js +375 -0
- package/dist/generator/file-describer.js.map +1 -0
- package/dist/generator/index.d.ts +8 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +259 -0
- package/dist/generator/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.d.ts +75 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.js +242 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.js.map +1 -0
- package/dist/orchestrator/adapters/base-adapter.d.ts +24 -0
- package/dist/orchestrator/adapters/base-adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/base-adapter.js +2 -0
- package/dist/orchestrator/adapters/base-adapter.js.map +1 -0
- package/dist/orchestrator/adapters/codemap-adapter.d.ts +56 -0
- package/dist/orchestrator/adapters/codemap-adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/codemap-adapter.js +163 -0
- package/dist/orchestrator/adapters/codemap-adapter.js.map +1 -0
- package/dist/orchestrator/adapters/index.d.ts +10 -0
- package/dist/orchestrator/adapters/index.d.ts.map +1 -0
- package/dist/orchestrator/adapters/index.js +3 -0
- package/dist/orchestrator/adapters/index.js.map +1 -0
- package/dist/orchestrator/ai-feed-generator.d.ts +210 -0
- package/dist/orchestrator/ai-feed-generator.d.ts.map +1 -0
- package/dist/orchestrator/ai-feed-generator.js +377 -0
- package/dist/orchestrator/ai-feed-generator.js.map +1 -0
- package/dist/orchestrator/commit-validator.d.ts +30 -0
- package/dist/orchestrator/commit-validator.d.ts.map +1 -0
- package/dist/orchestrator/commit-validator.js +87 -0
- package/dist/orchestrator/commit-validator.js.map +1 -0
- package/dist/orchestrator/confidence.d.ts +25 -0
- package/dist/orchestrator/confidence.d.ts.map +1 -0
- package/dist/orchestrator/confidence.js +138 -0
- package/dist/orchestrator/confidence.js.map +1 -0
- package/dist/orchestrator/file-header-scanner.d.ts +48 -0
- package/dist/orchestrator/file-header-scanner.d.ts.map +1 -0
- package/dist/orchestrator/file-header-scanner.js +158 -0
- package/dist/orchestrator/file-header-scanner.js.map +1 -0
- package/dist/orchestrator/git-analyzer.d.ts +192 -0
- package/dist/orchestrator/git-analyzer.d.ts.map +1 -0
- package/dist/orchestrator/git-analyzer.js +539 -0
- package/dist/orchestrator/git-analyzer.js.map +1 -0
- package/dist/orchestrator/index.d.ts +20 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +16 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/intent-router.d.ts +41 -0
- package/dist/orchestrator/intent-router.d.ts.map +1 -0
- package/dist/orchestrator/intent-router.js +98 -0
- package/dist/orchestrator/intent-router.js.map +1 -0
- package/dist/orchestrator/result-fusion.d.ts +114 -0
- package/dist/orchestrator/result-fusion.d.ts.map +1 -0
- package/dist/orchestrator/result-fusion.js +332 -0
- package/dist/orchestrator/result-fusion.js.map +1 -0
- package/dist/orchestrator/test-linker.d.ts +166 -0
- package/dist/orchestrator/test-linker.d.ts.map +1 -0
- package/dist/orchestrator/test-linker.js +570 -0
- package/dist/orchestrator/test-linker.js.map +1 -0
- package/dist/orchestrator/tool-orchestrator.d.ts +108 -0
- package/dist/orchestrator/tool-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/tool-orchestrator.js +247 -0
- package/dist/orchestrator/tool-orchestrator.js.map +1 -0
- package/dist/orchestrator/types.d.ts +162 -0
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/types.js +39 -0
- package/dist/orchestrator/types.js.map +1 -0
- package/dist/orchestrator/workflow/ci-executor.d.ts +157 -0
- package/dist/orchestrator/workflow/ci-executor.d.ts.map +1 -0
- package/dist/orchestrator/workflow/ci-executor.js +423 -0
- package/dist/orchestrator/workflow/ci-executor.js.map +1 -0
- package/dist/orchestrator/workflow/config.d.ts +97 -0
- package/dist/orchestrator/workflow/config.d.ts.map +1 -0
- package/dist/orchestrator/workflow/config.js +115 -0
- package/dist/orchestrator/workflow/config.js.map +1 -0
- package/dist/orchestrator/workflow/git-analyzer.d.ts +173 -0
- package/dist/orchestrator/workflow/git-analyzer.d.ts.map +1 -0
- package/dist/orchestrator/workflow/git-analyzer.js +473 -0
- package/dist/orchestrator/workflow/git-analyzer.js.map +1 -0
- package/dist/orchestrator/workflow/index.d.ts +21 -0
- package/dist/orchestrator/workflow/index.d.ts.map +1 -0
- package/dist/orchestrator/workflow/index.js +21 -0
- package/dist/orchestrator/workflow/index.js.map +1 -0
- package/dist/orchestrator/workflow/phase-checkpoint.d.ts +38 -0
- package/dist/orchestrator/workflow/phase-checkpoint.d.ts.map +1 -0
- package/dist/orchestrator/workflow/phase-checkpoint.js +75 -0
- package/dist/orchestrator/workflow/phase-checkpoint.js.map +1 -0
- package/dist/orchestrator/workflow/phase-inheritance.d.ts +128 -0
- package/dist/orchestrator/workflow/phase-inheritance.d.ts.map +1 -0
- package/dist/orchestrator/workflow/phase-inheritance.js +266 -0
- package/dist/orchestrator/workflow/phase-inheritance.js.map +1 -0
- package/dist/orchestrator/workflow/result-fusion.d.ts +117 -0
- package/dist/orchestrator/workflow/result-fusion.d.ts.map +1 -0
- package/dist/orchestrator/workflow/result-fusion.js +246 -0
- package/dist/orchestrator/workflow/result-fusion.js.map +1 -0
- package/dist/orchestrator/workflow/templates.d.ts +116 -0
- package/dist/orchestrator/workflow/templates.d.ts.map +1 -0
- package/dist/orchestrator/workflow/templates.js +546 -0
- package/dist/orchestrator/workflow/templates.js.map +1 -0
- package/dist/orchestrator/workflow/test-linker.d.ts +152 -0
- package/dist/orchestrator/workflow/test-linker.d.ts.map +1 -0
- package/dist/orchestrator/workflow/test-linker.js +342 -0
- package/dist/orchestrator/workflow/test-linker.js.map +1 -0
- package/dist/orchestrator/workflow/types.d.ts +202 -0
- package/dist/orchestrator/workflow/types.d.ts.map +1 -0
- package/dist/orchestrator/workflow/types.js +4 -0
- package/dist/orchestrator/workflow/types.js.map +1 -0
- package/dist/orchestrator/workflow/visualizer.d.ts +56 -0
- package/dist/orchestrator/workflow/visualizer.d.ts.map +1 -0
- package/dist/orchestrator/workflow/visualizer.js +300 -0
- package/dist/orchestrator/workflow/visualizer.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-context.d.ts +50 -0
- package/dist/orchestrator/workflow/workflow-context.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-context.js +105 -0
- package/dist/orchestrator/workflow/workflow-context.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.d.ts +126 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.js +489 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-persistence.d.ts +38 -0
- package/dist/orchestrator/workflow/workflow-persistence.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-persistence.js +166 -0
- package/dist/orchestrator/workflow/workflow-persistence.js.map +1 -0
- package/dist/parser/implementations/fast-parser.d.ts +65 -0
- package/dist/parser/implementations/fast-parser.d.ts.map +1 -0
- package/dist/parser/implementations/fast-parser.js +299 -0
- package/dist/parser/implementations/fast-parser.js.map +1 -0
- package/dist/parser/implementations/smart-parser.d.ts +220 -0
- package/dist/parser/implementations/smart-parser.d.ts.map +1 -0
- package/dist/parser/implementations/smart-parser.js +1536 -0
- package/dist/parser/implementations/smart-parser.js.map +1 -0
- package/dist/parser/implementations/tree-sitter-parser.d.ts +57 -0
- package/dist/parser/implementations/tree-sitter-parser.d.ts.map +1 -0
- package/dist/parser/implementations/tree-sitter-parser.js +375 -0
- package/dist/parser/implementations/tree-sitter-parser.js.map +1 -0
- package/dist/parser/index.d.ts +19 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +449 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/interfaces/IParser.d.ts +218 -0
- package/dist/parser/interfaces/IParser.d.ts.map +1 -0
- package/dist/parser/interfaces/IParser.js +22 -0
- package/dist/parser/interfaces/IParser.js.map +1 -0
- package/dist/plugins/built-in/call-graph.d.ts +38 -0
- package/dist/plugins/built-in/call-graph.d.ts.map +1 -0
- package/dist/plugins/built-in/call-graph.js +135 -0
- package/dist/plugins/built-in/call-graph.js.map +1 -0
- package/dist/plugins/built-in/complexity-analyzer.d.ts +45 -0
- package/dist/plugins/built-in/complexity-analyzer.d.ts.map +1 -0
- package/dist/plugins/built-in/complexity-analyzer.js +155 -0
- package/dist/plugins/built-in/complexity-analyzer.js.map +1 -0
- package/dist/plugins/index.d.ts +34 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +103 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/plugin-loader.d.ts +22 -0
- package/dist/plugins/plugin-loader.d.ts.map +1 -0
- package/dist/plugins/plugin-loader.js +200 -0
- package/dist/plugins/plugin-loader.js.map +1 -0
- package/dist/plugins/plugin-registry.d.ts +20 -0
- package/dist/plugins/plugin-registry.d.ts.map +1 -0
- package/dist/plugins/plugin-registry.js +143 -0
- package/dist/plugins/plugin-registry.js.map +1 -0
- package/dist/plugins/types.d.ts +72 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +5 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/types/index.d.ts +373 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/watcher/daemon.d.ts +64 -0
- package/dist/watcher/daemon.d.ts.map +1 -0
- package/dist/watcher/daemon.js +189 -0
- package/dist/watcher/daemon.js.map +1 -0
- package/dist/watcher/file-watcher.d.ts +70 -0
- package/dist/watcher/file-watcher.d.ts.map +1 -0
- package/dist/watcher/file-watcher.js +127 -0
- package/dist/watcher/file-watcher.js.map +1 -0
- package/dist/watcher/index.d.ts +5 -0
- package/dist/watcher/index.d.ts.map +1 -0
- package/dist/watcher/index.js +6 -0
- package/dist/watcher/index.js.map +1 -0
- package/dist/watcher/watch-worker.d.ts +2 -0
- package/dist/watcher/watch-worker.d.ts.map +1 -0
- package/dist/watcher/watch-worker.js +57 -0
- package/dist/watcher/watch-worker.js.map +1 -0
- package/dist/worker/index.d.ts +76 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +155 -0
- package/dist/worker/index.js.map +1 -0
- package/dist/worker/parse-worker.d.ts +2 -0
- package/dist/worker/parse-worker.d.ts.map +1 -0
- package/dist/worker/parse-worker.js +202 -0
- package/dist/worker/parse-worker.js.map +1 -0
- package/mycodemap.config.schema.json +42 -0
- package/package.json +69 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { HeatScore } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 风险等级类型
|
|
4
|
+
*/
|
|
5
|
+
export type RiskLevel = 'high' | 'medium' | 'low';
|
|
6
|
+
/**
|
|
7
|
+
* 提交标签类型
|
|
8
|
+
*/
|
|
9
|
+
export type CommitTagType = 'BUGFIX' | 'FEATURE' | 'REFACTOR' | 'CONFIG' | 'DOCS' | 'DELETE' | 'UNKNOWN';
|
|
10
|
+
/**
|
|
11
|
+
* 提交信息接口
|
|
12
|
+
*/
|
|
13
|
+
export interface CommitInfo {
|
|
14
|
+
/** 提交哈希 */
|
|
15
|
+
hash: string;
|
|
16
|
+
/** 提交信息 */
|
|
17
|
+
message: string;
|
|
18
|
+
/** 提交日期 */
|
|
19
|
+
date: Date;
|
|
20
|
+
/** 提交作者 */
|
|
21
|
+
author: string;
|
|
22
|
+
/** 修改的文件列表 */
|
|
23
|
+
files: string[];
|
|
24
|
+
/** 解析的 TAG */
|
|
25
|
+
tag?: CommitTag;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 提交标签接口
|
|
29
|
+
*/
|
|
30
|
+
export interface CommitTag {
|
|
31
|
+
/** 标签类型 */
|
|
32
|
+
type: CommitTagType;
|
|
33
|
+
/** 模块/作用域 */
|
|
34
|
+
scope: string;
|
|
35
|
+
/** 提交描述 */
|
|
36
|
+
subject: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 风险评分结果接口
|
|
40
|
+
*/
|
|
41
|
+
export interface RiskScore {
|
|
42
|
+
/** 风险等级 */
|
|
43
|
+
level: RiskLevel;
|
|
44
|
+
/** 综合分数 (0-1) */
|
|
45
|
+
score: number;
|
|
46
|
+
/** 依赖复杂度评分 */
|
|
47
|
+
gravity: number;
|
|
48
|
+
/** 热度评分 */
|
|
49
|
+
heat: HeatScore;
|
|
50
|
+
/** 影响面评分 */
|
|
51
|
+
impact: number;
|
|
52
|
+
/** 风险因素说明 */
|
|
53
|
+
riskFactors: string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* AI 饲料接口
|
|
57
|
+
*/
|
|
58
|
+
export interface AIFeed {
|
|
59
|
+
/** 文件路径 */
|
|
60
|
+
file: string;
|
|
61
|
+
/** 依赖复杂度 (出度+入度) */
|
|
62
|
+
gravity: number;
|
|
63
|
+
/** 热度评分 */
|
|
64
|
+
heat: HeatScore;
|
|
65
|
+
/** 元数据 */
|
|
66
|
+
meta: {
|
|
67
|
+
since?: string;
|
|
68
|
+
owner?: string;
|
|
69
|
+
stable?: boolean;
|
|
70
|
+
why?: string;
|
|
71
|
+
};
|
|
72
|
+
/** 依赖的文件 */
|
|
73
|
+
deps: string[];
|
|
74
|
+
/** 被哪些文件依赖 */
|
|
75
|
+
dependents: string[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 标签风险权重映射
|
|
79
|
+
* 基于 REFACTOR_REQUIREMENTS.md 第 8.6 节
|
|
80
|
+
*/
|
|
81
|
+
export declare const TAG_WEIGHTS: Record<string, number>;
|
|
82
|
+
/**
|
|
83
|
+
* 提交标签正则表达式
|
|
84
|
+
* 匹配格式: [TAG] scope: message
|
|
85
|
+
*/
|
|
86
|
+
export declare const COMMIT_TAG_REGEX: RegExp;
|
|
87
|
+
/**
|
|
88
|
+
* GitAnalyzer 类
|
|
89
|
+
* 提供 Git 历史分析和风险评分功能
|
|
90
|
+
*/
|
|
91
|
+
export declare class GitAnalyzer {
|
|
92
|
+
/**
|
|
93
|
+
* 检查指定路径是否为 Git 仓库
|
|
94
|
+
*/
|
|
95
|
+
isGitRepository(projectRoot: string): Promise<boolean>;
|
|
96
|
+
/**
|
|
97
|
+
* 分析单个文件的 Git 热度
|
|
98
|
+
* @param filePath - 文件路径(相对于 projectRoot)
|
|
99
|
+
* @param projectRoot - 项目根目录
|
|
100
|
+
* @returns HeatScore 热度评分
|
|
101
|
+
*/
|
|
102
|
+
analyzeFileHeat(filePath: string, projectRoot: string): Promise<HeatScore>;
|
|
103
|
+
/**
|
|
104
|
+
* 分析目录下所有文件的 Git 热度
|
|
105
|
+
* @param dirPath - 目录路径(相对于 projectRoot)
|
|
106
|
+
* @param projectRoot - 项目根目录
|
|
107
|
+
* @returns Map<文件路径, HeatScore>
|
|
108
|
+
*/
|
|
109
|
+
analyzeDirectoryHeat(dirPath: string, projectRoot: string): Promise<Map<string, HeatScore>>;
|
|
110
|
+
/**
|
|
111
|
+
* 计算风险评分(简单版本 - 任务要求)
|
|
112
|
+
* 基于 REFACTOR_REQUIREMENTS.md 第 8.6 节的公式
|
|
113
|
+
*
|
|
114
|
+
* @param gravity - 依赖复杂度(出度+入度)
|
|
115
|
+
* @param heat - 热度评分
|
|
116
|
+
* @param impact - 影响面(被依赖文件数)
|
|
117
|
+
* @param stable - 是否稳定
|
|
118
|
+
* @returns RiskLevel 风险等级
|
|
119
|
+
*/
|
|
120
|
+
calculateRiskLevel(gravity: number, heat: HeatScore, impact: number, stable: boolean): RiskLevel;
|
|
121
|
+
/**
|
|
122
|
+
* 计算风险评分(完整版本 - 设计文档版本)
|
|
123
|
+
* @param targetFiles - 目标文件列表
|
|
124
|
+
* @param commits - 提交信息列表
|
|
125
|
+
* @param feedData - AI 饲料数据
|
|
126
|
+
* @returns RiskScore 风险评分结果
|
|
127
|
+
*/
|
|
128
|
+
calculateRiskScore(targetFiles: string[], commits: CommitInfo[], feedData: AIFeed[]): RiskScore;
|
|
129
|
+
/**
|
|
130
|
+
* 查找相关提交
|
|
131
|
+
* 支持关键词搜索和文件搜索两种模式
|
|
132
|
+
*
|
|
133
|
+
* @param keywords - 关键词列表
|
|
134
|
+
* @param files - 文件路径列表
|
|
135
|
+
* @param options - 选项(最大提交数、项目根目录)
|
|
136
|
+
* @returns CommitInfo[] 提交信息列表
|
|
137
|
+
*/
|
|
138
|
+
findRelatedCommits(keywords: string[], files: string[], options: {
|
|
139
|
+
maxCommits: number;
|
|
140
|
+
projectRoot: string;
|
|
141
|
+
}): Promise<CommitInfo[]>;
|
|
142
|
+
/**
|
|
143
|
+
* 解析提交信息中的 TAG
|
|
144
|
+
* @param message - 提交信息
|
|
145
|
+
* @returns CommitTag | undefined
|
|
146
|
+
*/
|
|
147
|
+
parseCommitTag(message: string): CommitTag | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* 验证提交信息格式
|
|
150
|
+
* @param message - 提交信息
|
|
151
|
+
* @returns 是否有效
|
|
152
|
+
*/
|
|
153
|
+
validateCommitMessage(message: string): {
|
|
154
|
+
valid: boolean;
|
|
155
|
+
error?: string;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* 创建空热度评分
|
|
159
|
+
*/
|
|
160
|
+
private createEmptyHeatScore;
|
|
161
|
+
/**
|
|
162
|
+
* 格式化日期为 ISO 日期字符串
|
|
163
|
+
*/
|
|
164
|
+
private formatDate;
|
|
165
|
+
/**
|
|
166
|
+
* 获取文件的提交历史
|
|
167
|
+
*/
|
|
168
|
+
private getFileCommits;
|
|
169
|
+
/**
|
|
170
|
+
* 获取目录下最近有修改的文件列表
|
|
171
|
+
*/
|
|
172
|
+
private getModifiedFilesInDirectory;
|
|
173
|
+
/**
|
|
174
|
+
* 基于关键词搜索提交
|
|
175
|
+
*/
|
|
176
|
+
private searchByKeywords;
|
|
177
|
+
/**
|
|
178
|
+
* 基于文件搜索提交
|
|
179
|
+
*/
|
|
180
|
+
private searchByFiles;
|
|
181
|
+
/**
|
|
182
|
+
* 解析 Git 日志(无文件列表)
|
|
183
|
+
*/
|
|
184
|
+
private parseGitLog;
|
|
185
|
+
/**
|
|
186
|
+
* 解析 Git 日志(含文件列表)
|
|
187
|
+
* 格式: hash|message|date|author\n\nfile1\nfile2\n\nhash|...
|
|
188
|
+
*/
|
|
189
|
+
private parseGitLogWithFiles;
|
|
190
|
+
}
|
|
191
|
+
export type { HeatScore };
|
|
192
|
+
//# sourceMappingURL=git-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-analyzer.d.ts","sourceRoot":"","sources":["../../src/orchestrator/git-analyzer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKpC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzG;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,WAAW;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW;IACX,IAAI,EAAE,IAAI,CAAC;IACX,WAAW;IACX,MAAM,EAAE,MAAM,CAAC;IACf,cAAc;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,cAAc;IACd,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,WAAW;IACX,IAAI,EAAE,aAAa,C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