@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,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 新旧路径常量
|
|
3
|
+
*/
|
|
4
|
+
export declare const DEFAULT_OUTPUT_DIR_NEW = ".mycodemap";
|
|
5
|
+
export declare const DEFAULT_OUTPUT_DIR_OLD = ".codemap";
|
|
6
|
+
export declare const CONFIG_FILE_NEW = "mycodemap.config.json";
|
|
7
|
+
export declare const CONFIG_FILE_OLD = "codemap.config.json";
|
|
8
|
+
export declare const DATA_FILE = "codemap.json";
|
|
9
|
+
/**
|
|
10
|
+
* 路径解析结果
|
|
11
|
+
*/
|
|
12
|
+
export interface ResolvePathsResult {
|
|
13
|
+
/** 实际使用的输出目录 */
|
|
14
|
+
outputDir: string;
|
|
15
|
+
/** 是否使用了旧路径(用于显示迁移提示) */
|
|
16
|
+
isLegacy: boolean;
|
|
17
|
+
/** 配置文件完整路径 */
|
|
18
|
+
configPath: string;
|
|
19
|
+
/** 数据文件完整路径 */
|
|
20
|
+
dataPath: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 解析输出目录
|
|
24
|
+
* - 优先使用新路径 .mycodemap
|
|
25
|
+
* - 不存在则回退旧路径 .codemap
|
|
26
|
+
* - 如果显式指定了 output 则使用指定的路径
|
|
27
|
+
*
|
|
28
|
+
* @param customOutput - 用户显式指定的输出目录
|
|
29
|
+
* @param rootDir - 项目根目录(默认为 cwd)
|
|
30
|
+
* @returns 解析结果(默认返回绝对路径)
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveOutputDir(customOutput?: string, rootDir?: string): ResolvePathsResult;
|
|
33
|
+
/**
|
|
34
|
+
* 解析配置文件路径(读取时使用)
|
|
35
|
+
* - 优先检查新配置 mycodemap.config.json
|
|
36
|
+
* - 不存在则回退旧配置 codemap.config.json
|
|
37
|
+
*
|
|
38
|
+
* @param rootDir - 项目根目录(默认为 cwd)
|
|
39
|
+
* @returns 配置文件路径和是否使用旧配置
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveConfigPath(rootDir?: string): {
|
|
42
|
+
path: string;
|
|
43
|
+
isLegacy: boolean;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* 解析数据文件路径
|
|
47
|
+
* P0 保持 codemap.json 不变
|
|
48
|
+
*
|
|
49
|
+
* @param rootDir - 项目根目录
|
|
50
|
+
* @param outputDir - 输出目录(可选,默认使用 resolveOutputDir)
|
|
51
|
+
* @returns 数据文件路径
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveDataPath(rootDir?: string, outputDir?: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* 获取日志目录路径
|
|
56
|
+
*
|
|
57
|
+
* @param rootDir - 项目根目录
|
|
58
|
+
* @returns 日志目录路径
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolveLogDir(rootDir?: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* 获取 workflow 目录路径
|
|
63
|
+
*
|
|
64
|
+
* @param rootDir - 项目根目录
|
|
65
|
+
* @param outputDir - 输出目录(可选)
|
|
66
|
+
* @returns workflow 目录路径
|
|
67
|
+
*/
|
|
68
|
+
export declare function resolveWorkflowDir(rootDir?: string, outputDir?: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* 获取 workflow 特定文件路径
|
|
71
|
+
*
|
|
72
|
+
* @param name - 文件名(不含路径)
|
|
73
|
+
* @param rootDir - 项目根目录
|
|
74
|
+
* @param outputDir - 输出目录(可选)
|
|
75
|
+
* @returns 文件完整路径
|
|
76
|
+
*/
|
|
77
|
+
export declare function resolveWorkflowFile(name: string, rootDir?: string, outputDir?: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* 获取模板目录路径
|
|
80
|
+
*
|
|
81
|
+
* @param rootDir - 项目根目录
|
|
82
|
+
* @param outputDir - 输出目录(可选)
|
|
83
|
+
* @returns 模板目录路径
|
|
84
|
+
*/
|
|
85
|
+
export declare function resolveTemplatesDir(rootDir?: string, outputDir?: string): string;
|
|
86
|
+
/**
|
|
87
|
+
* 输出迁移提示(当检测到使用旧路径时)
|
|
88
|
+
*/
|
|
89
|
+
export declare function printMigrationWarning(): void;
|
|
90
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/cli/paths.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,sBAAsB,aAAa,CAAC;AACjD,eAAO,MAAM,eAAe,0BAA0B,CAAC;AACvD,eAAO,MAAM,eAAe,wBAAwB,CAAC;AACrD,eAAO,MAAM,SAAS,iBAAiB,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,MAAc,GAAG,kBAAkB,CAyBnG;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,MAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAa9F;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,MAAc,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAGnF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,MAAc,GAAG,MAAM,CAG7D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,MAAc,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAGtF;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAc,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAErG;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,MAAc,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAGvF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAQ5C"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// [META] since:2026-03-04 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] 提供统一的路径解析工具,处理新旧目录/配置文件名的兼容逻辑
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { join, isAbsolute } from 'node:path';
|
|
5
|
+
import { cwd } from 'node:process';
|
|
6
|
+
/**
|
|
7
|
+
* 新旧路径常量
|
|
8
|
+
*/
|
|
9
|
+
export const DEFAULT_OUTPUT_DIR_NEW = '.mycodemap';
|
|
10
|
+
export const DEFAULT_OUTPUT_DIR_OLD = '.codemap';
|
|
11
|
+
export const CONFIG_FILE_NEW = 'mycodemap.config.json';
|
|
12
|
+
export const CONFIG_FILE_OLD = 'codemap.config.json';
|
|
13
|
+
export const DATA_FILE = 'codemap.json'; // P0 保持不变
|
|
14
|
+
/**
|
|
15
|
+
* 解析输出目录
|
|
16
|
+
* - 优先使用新路径 .mycodemap
|
|
17
|
+
* - 不存在则回退旧路径 .codemap
|
|
18
|
+
* - 如果显式指定了 output 则使用指定的路径
|
|
19
|
+
*
|
|
20
|
+
* @param customOutput - 用户显式指定的输出目录
|
|
21
|
+
* @param rootDir - 项目根目录(默认为 cwd)
|
|
22
|
+
* @returns 解析结果(默认返回绝对路径)
|
|
23
|
+
*/
|
|
24
|
+
export function resolveOutputDir(customOutput, rootDir = cwd()) {
|
|
25
|
+
let resolvedPath;
|
|
26
|
+
// 如果用户显式指定了输出目录,直接使用
|
|
27
|
+
if (customOutput) {
|
|
28
|
+
resolvedPath = isAbsolute(customOutput) ? customOutput : join(rootDir, customOutput);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
// 优先检查新路径
|
|
32
|
+
const newPath = join(rootDir, DEFAULT_OUTPUT_DIR_NEW);
|
|
33
|
+
if (existsSync(newPath) || !existsSync(join(rootDir, DEFAULT_OUTPUT_DIR_OLD))) {
|
|
34
|
+
resolvedPath = newPath;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
// 回退到旧路径
|
|
38
|
+
resolvedPath = join(rootDir, DEFAULT_OUTPUT_DIR_OLD);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const isLegacy = resolvedPath.includes(DEFAULT_OUTPUT_DIR_OLD);
|
|
42
|
+
return {
|
|
43
|
+
outputDir: resolvedPath,
|
|
44
|
+
isLegacy,
|
|
45
|
+
configPath: join(resolvedPath, isLegacy ? CONFIG_FILE_OLD : CONFIG_FILE_NEW),
|
|
46
|
+
dataPath: join(resolvedPath, DATA_FILE),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 解析配置文件路径(读取时使用)
|
|
51
|
+
* - 优先检查新配置 mycodemap.config.json
|
|
52
|
+
* - 不存在则回退旧配置 codemap.config.json
|
|
53
|
+
*
|
|
54
|
+
* @param rootDir - 项目根目录(默认为 cwd)
|
|
55
|
+
* @returns 配置文件路径和是否使用旧配置
|
|
56
|
+
*/
|
|
57
|
+
export function resolveConfigPath(rootDir = cwd()) {
|
|
58
|
+
const newPath = join(rootDir, CONFIG_FILE_NEW);
|
|
59
|
+
if (existsSync(newPath)) {
|
|
60
|
+
return { path: newPath, isLegacy: false };
|
|
61
|
+
}
|
|
62
|
+
const oldPath = join(rootDir, CONFIG_FILE_OLD);
|
|
63
|
+
if (existsSync(oldPath)) {
|
|
64
|
+
return { path: oldPath, isLegacy: true };
|
|
65
|
+
}
|
|
66
|
+
// 都不存在,返回新路径(用于创建)
|
|
67
|
+
return { path: newPath, isLegacy: false };
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 解析数据文件路径
|
|
71
|
+
* P0 保持 codemap.json 不变
|
|
72
|
+
*
|
|
73
|
+
* @param rootDir - 项目根目录
|
|
74
|
+
* @param outputDir - 输出目录(可选,默认使用 resolveOutputDir)
|
|
75
|
+
* @returns 数据文件路径
|
|
76
|
+
*/
|
|
77
|
+
export function resolveDataPath(rootDir = cwd(), outputDir) {
|
|
78
|
+
const resolved = resolveOutputDir(outputDir, rootDir);
|
|
79
|
+
return resolved.dataPath;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* 获取日志目录路径
|
|
83
|
+
*
|
|
84
|
+
* @param rootDir - 项目根目录
|
|
85
|
+
* @returns 日志目录路径
|
|
86
|
+
*/
|
|
87
|
+
export function resolveLogDir(rootDir = cwd()) {
|
|
88
|
+
const resolved = resolveOutputDir(undefined, rootDir);
|
|
89
|
+
return join(resolved.outputDir, 'logs');
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* 获取 workflow 目录路径
|
|
93
|
+
*
|
|
94
|
+
* @param rootDir - 项目根目录
|
|
95
|
+
* @param outputDir - 输出目录(可选)
|
|
96
|
+
* @returns workflow 目录路径
|
|
97
|
+
*/
|
|
98
|
+
export function resolveWorkflowDir(rootDir = cwd(), outputDir) {
|
|
99
|
+
const dir = outputDir || resolveOutputDir(undefined, rootDir).outputDir;
|
|
100
|
+
return join(dir, 'workflow');
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* 获取 workflow 特定文件路径
|
|
104
|
+
*
|
|
105
|
+
* @param name - 文件名(不含路径)
|
|
106
|
+
* @param rootDir - 项目根目录
|
|
107
|
+
* @param outputDir - 输出目录(可选)
|
|
108
|
+
* @returns 文件完整路径
|
|
109
|
+
*/
|
|
110
|
+
export function resolveWorkflowFile(name, rootDir = cwd(), outputDir) {
|
|
111
|
+
return join(resolveWorkflowDir(rootDir, outputDir), name);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* 获取模板目录路径
|
|
115
|
+
*
|
|
116
|
+
* @param rootDir - 项目根目录
|
|
117
|
+
* @param outputDir - 输出目录(可选)
|
|
118
|
+
* @returns 模板目录路径
|
|
119
|
+
*/
|
|
120
|
+
export function resolveTemplatesDir(rootDir = cwd(), outputDir) {
|
|
121
|
+
const dir = outputDir || resolveOutputDir(undefined, rootDir).outputDir;
|
|
122
|
+
return join(dir, 'templates');
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* 输出迁移提示(当检测到使用旧路径时)
|
|
126
|
+
*/
|
|
127
|
+
export function printMigrationWarning() {
|
|
128
|
+
const { isLegacy } = resolveOutputDir();
|
|
129
|
+
if (isLegacy) {
|
|
130
|
+
console.warn('');
|
|
131
|
+
console.warn('\x1b[33m⚠️ 检测到使用旧目录 .codemap,新版本将使用 .mycodemap\x1b[0m');
|
|
132
|
+
console.warn('\x1b[33m 请迁移您的数据:mv .codemap .mycodemap\x1b[0m');
|
|
133
|
+
console.warn('');
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@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ileSizeBytes: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function appendRuntimeLog(logFilePath: string, line: string, maxFileSizeBytes: number): void;
|
|
10
|
+
export declare function resolveRuntimeLogConfig(cwd: string, env?: NodeJS.ProcessEnv, now?: Date): RuntimeLogConfig;
|
|
11
|
+
export declare function cleanupRuntimeLogs(logDir: string, retentionDays: number, maxFiles: number, now?: Date): void;
|
|
12
|
+
export declare function setupRuntimeLogging(argv: string[], cwd?: string, env?: NodeJS.ProcessEnv): RuntimeLogConfig | null;
|
|
13
|
+
//# sourceMappingURL=runtime-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-logger.d.ts","sourceRoot":"","sources":["../../src/cli/runtime-logger.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAoGD,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAQlG;AAwBD,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,MAAM,EACX,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,OAAa,GACf,gBAAgB,CA6BlB;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,GAAG,OAAa,GACf,IAAI,CAyCN;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,SAAgB,EACnB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,gBAAgB,GAAG,IAAI,CAgDzB"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// [META] since:2026-03 | owner:orchestrator-team | stable:false
|
|
2
|
+
// [WHY] 为 codemap CLI 提供运行日志落盘与保留策略,便于问题追踪与离线排查
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import util from 'node:util';
|
|
7
|
+
import zlib from 'node:zlib';
|
|
8
|
+
const DEFAULT_LOG_DIR = '.mycodemap/logs';
|
|
9
|
+
const DEFAULT_RETENTION_DAYS = 14;
|
|
10
|
+
const DEFAULT_MAX_FILES = 30;
|
|
11
|
+
const DEFAULT_MAX_SIZE_MB = 10;
|
|
12
|
+
const LOG_FILE_PREFIX = 'codemap-';
|
|
13
|
+
const LOG_FILE_EXT = '.log';
|
|
14
|
+
const LOG_FILE_NAME_PATTERN = /^codemap-\d{4}-\d{2}-\d{2}\.log(?:\.\d+)?(?:\.gz)?$/;
|
|
15
|
+
function parsePositiveInt(value, fallback) {
|
|
16
|
+
if (!value) {
|
|
17
|
+
return fallback;
|
|
18
|
+
}
|
|
19
|
+
const parsed = Number.parseInt(value, 10);
|
|
20
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
21
|
+
return fallback;
|
|
22
|
+
}
|
|
23
|
+
return parsed;
|
|
24
|
+
}
|
|
25
|
+
function shouldEnableRuntimeLog(value) {
|
|
26
|
+
if (!value) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return value.toLowerCase() !== 'false';
|
|
30
|
+
}
|
|
31
|
+
function getLogFilePath(logDir, now) {
|
|
32
|
+
const date = now.toISOString().slice(0, 10);
|
|
33
|
+
return path.join(logDir, `${LOG_FILE_PREFIX}${date}${LOG_FILE_EXT}`);
|
|
34
|
+
}
|
|
35
|
+
function isRuntimeLogFile(fileName) {
|
|
36
|
+
return LOG_FILE_NAME_PATTERN.test(fileName);
|
|
37
|
+
}
|
|
38
|
+
function formatLogLine(level, message, now = new Date()) {
|
|
39
|
+
return `[${now.toISOString()}] [${level}] ${message}\n`;
|
|
40
|
+
}
|
|
41
|
+
function formatConsoleArgs(args) {
|
|
42
|
+
return args
|
|
43
|
+
.map((arg) => {
|
|
44
|
+
if (arg instanceof Error) {
|
|
45
|
+
return arg.stack || `${arg.name}: ${arg.message}`;
|
|
46
|
+
}
|
|
47
|
+
if (typeof arg === 'string') {
|
|
48
|
+
return arg;
|
|
49
|
+
}
|
|
50
|
+
return util.inspect(arg, { depth: 4, breakLength: 120 });
|
|
51
|
+
})
|
|
52
|
+
.join(' ');
|
|
53
|
+
}
|
|
54
|
+
function getNextRotationIndex(logFilePath) {
|
|
55
|
+
const dir = path.dirname(logFilePath);
|
|
56
|
+
const baseName = path.basename(logFilePath);
|
|
57
|
+
const escaped = baseName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
58
|
+
const rotationPattern = new RegExp(`^${escaped}\\.(\\d+)(?:\\.gz)?$`);
|
|
59
|
+
let maxIndex = 0;
|
|
60
|
+
for (const name of fs.readdirSync(dir)) {
|
|
61
|
+
const match = name.match(rotationPattern);
|
|
62
|
+
if (!match) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const index = Number.parseInt(match[1], 10);
|
|
66
|
+
if (Number.isFinite(index) && index > maxIndex) {
|
|
67
|
+
maxIndex = index;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return maxIndex + 1;
|
|
71
|
+
}
|
|
72
|
+
function maybeRotateLog(logFilePath, maxFileSizeBytes, pendingBytes) {
|
|
73
|
+
if (maxFileSizeBytes <= 0 || !fs.existsSync(logFilePath)) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const stat = fs.statSync(logFilePath);
|
|
77
|
+
if (stat.size === 0 || stat.size + pendingBytes <= maxFileSizeBytes) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const nextIndex = getNextRotationIndex(logFilePath);
|
|
81
|
+
const rotatedPath = `${logFilePath}.${nextIndex}`;
|
|
82
|
+
fs.renameSync(logFilePath, rotatedPath);
|
|
83
|
+
try {
|
|
84
|
+
const gzPath = `${rotatedPath}.gz`;
|
|
85
|
+
const raw = fs.readFileSync(rotatedPath);
|
|
86
|
+
fs.writeFileSync(gzPath, zlib.gzipSync(raw));
|
|
87
|
+
fs.unlinkSync(rotatedPath);
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// 压缩失败时保留未压缩轮转文件
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export function appendRuntimeLog(logFilePath, line, maxFileSizeBytes) {
|
|
94
|
+
try {
|
|
95
|
+
const pendingBytes = Buffer.byteLength(line, 'utf-8');
|
|
96
|
+
maybeRotateLog(logFilePath, maxFileSizeBytes, pendingBytes);
|
|
97
|
+
fs.appendFileSync(logFilePath, line, 'utf-8');
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// 日志写入失败不应影响 CLI 主流程
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
let _deprecatedWarningPrinted = false;
|
|
104
|
+
function getEnvWithFallback(newKey, oldKey, env) {
|
|
105
|
+
const newValue = env[newKey];
|
|
106
|
+
if (newValue !== undefined) {
|
|
107
|
+
return newValue;
|
|
108
|
+
}
|
|
109
|
+
const oldValue = env[oldKey];
|
|
110
|
+
if (oldValue !== undefined) {
|
|
111
|
+
if (!_deprecatedWarningPrinted) {
|
|
112
|
+
_deprecatedWarningPrinted = true;
|
|
113
|
+
console.warn(`[DEPRECATION] "${oldKey}" is deprecated. Please use "${newKey}" instead.`);
|
|
114
|
+
}
|
|
115
|
+
return oldValue;
|
|
116
|
+
}
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
export function resolveRuntimeLogConfig(cwd, env = process.env, now = new Date()) {
|
|
120
|
+
const enabled = shouldEnableRuntimeLog(getEnvWithFallback('MYCODEMAP_RUNTIME_LOG_ENABLED', 'CODEMAP_RUNTIME_LOG_ENABLED', env));
|
|
121
|
+
const logDir = path.resolve(cwd, getEnvWithFallback('MYCODEMAP_RUNTIME_LOG_DIR', 'CODEMAP_RUNTIME_LOG_DIR', env) || DEFAULT_LOG_DIR);
|
|
122
|
+
const retentionDays = parsePositiveInt(getEnvWithFallback('MYCODEMAP_RUNTIME_LOG_RETENTION_DAYS', 'CODEMAP_RUNTIME_LOG_RETENTION_DAYS', env), DEFAULT_RETENTION_DAYS);
|
|
123
|
+
const maxFiles = parsePositiveInt(getEnvWithFallback('MYCODEMAP_RUNTIME_LOG_MAX_FILES', 'CODEMAP_RUNTIME_LOG_MAX_FILES', env), DEFAULT_MAX_FILES);
|
|
124
|
+
const maxFileSizeMb = parsePositiveInt(getEnvWithFallback('MYCODEMAP_RUNTIME_LOG_MAX_SIZE_MB', 'CODEMAP_RUNTIME_LOG_MAX_SIZE_MB', env), DEFAULT_MAX_SIZE_MB);
|
|
125
|
+
return {
|
|
126
|
+
enabled,
|
|
127
|
+
logDir,
|
|
128
|
+
logFilePath: getLogFilePath(logDir, now),
|
|
129
|
+
retentionDays,
|
|
130
|
+
maxFiles,
|
|
131
|
+
maxFileSizeBytes: maxFileSizeMb * 1024 * 1024,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export function cleanupRuntimeLogs(logDir, retentionDays, maxFiles, now = new Date()) {
|
|
135
|
+
if (!fs.existsSync(logDir)) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const entries = fs.readdirSync(logDir)
|
|
139
|
+
.filter(isRuntimeLogFile)
|
|
140
|
+
.map((name) => {
|
|
141
|
+
const filePath = path.join(logDir, name);
|
|
142
|
+
const stat = fs.statSync(filePath);
|
|
143
|
+
return { name, filePath, mtimeMs: stat.mtimeMs };
|
|
144
|
+
})
|
|
145
|
+
.sort((a, b) => a.mtimeMs - b.mtimeMs);
|
|
146
|
+
const retentionMs = retentionDays * 24 * 60 * 60 * 1000;
|
|
147
|
+
const expired = entries.filter((entry) => now.getTime() - entry.mtimeMs > retentionMs);
|
|
148
|
+
for (const entry of expired) {
|
|
149
|
+
try {
|
|
150
|
+
fs.unlinkSync(entry.filePath);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
// ignore
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const remaining = fs.readdirSync(logDir)
|
|
157
|
+
.filter(isRuntimeLogFile)
|
|
158
|
+
.map((name) => {
|
|
159
|
+
const filePath = path.join(logDir, name);
|
|
160
|
+
const stat = fs.statSync(filePath);
|
|
161
|
+
return { filePath, mtimeMs: stat.mtimeMs };
|
|
162
|
+
})
|
|
163
|
+
.sort((a, b) => a.mtimeMs - b.mtimeMs);
|
|
164
|
+
const overflow = Math.max(0, remaining.length - maxFiles);
|
|
165
|
+
for (let i = 0; i < overflow; i++) {
|
|
166
|
+
try {
|
|
167
|
+
fs.unlinkSync(remaining[i].filePath);
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
// ignore
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
export function setupRuntimeLogging(argv, cwd = process.cwd(), env = process.env) {
|
|
175
|
+
const config = resolveRuntimeLogConfig(cwd, env);
|
|
176
|
+
if (!config.enabled) {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
try {
|
|
180
|
+
fs.mkdirSync(config.logDir, { recursive: true });
|
|
181
|
+
cleanupRuntimeLogs(config.logDir, config.retentionDays, config.maxFiles);
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
const command = argv.join(' ').trim() || '(no args)';
|
|
187
|
+
appendRuntimeLog(config.logFilePath, formatLogLine('INFO', `session.start pid=${process.pid} cwd=${cwd} cmd="${command}"`), config.maxFileSizeBytes);
|
|
188
|
+
appendRuntimeLog(config.logFilePath, formatLogLine('INFO', `runtime node=${process.version} platform=${os.platform()} arch=${os.arch()}`), config.maxFileSizeBytes);
|
|
189
|
+
const originalConsole = {
|
|
190
|
+
log: console.log.bind(console),
|
|
191
|
+
info: console.info.bind(console),
|
|
192
|
+
warn: console.warn.bind(console),
|
|
193
|
+
error: console.error.bind(console),
|
|
194
|
+
debug: console.debug.bind(console),
|
|
195
|
+
};
|
|
196
|
+
const wrapMethod = (method, level) => {
|
|
197
|
+
const original = originalConsole[method];
|
|
198
|
+
console[method] = ((...args) => {
|
|
199
|
+
appendRuntimeLog(config.logFilePath, formatLogLine(level, formatConsoleArgs(args)), config.maxFileSizeBytes);
|
|
200
|
+
original(...args);
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
wrapMethod('log', 'INFO');
|
|
204
|
+
wrapMethod('info', 'INFO');
|
|
205
|
+
wrapMethod('warn', 'WARN');
|
|
206
|
+
wrapMethod('error', 'ERROR');
|
|
207
|
+
wrapMethod('debug', 'DEBUG');
|
|
208
|
+
process.on('exit', (code) => {
|
|
209
|
+
appendRuntimeLog(config.logFilePath, formatLogLine('INFO', `session.end code=${code}`), config.maxFileSizeBytes);
|
|
210
|
+
});
|
|
211
|
+
return config;
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=runtime-logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-logger.js","sourceRoot":"","sources":["../../src/cli/runtime-logger.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,gDAAgD;AAEhD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAC1C,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,MAAM,YAAY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