@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.
Files changed (329) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +21 -0
  3. package/README.md +559 -0
  4. package/dist/ai/claude.d.ts +38 -0
  5. package/dist/ai/claude.d.ts.map +1 -0
  6. package/dist/ai/claude.js +169 -0
  7. package/dist/ai/claude.js.map +1 -0
  8. package/dist/ai/codex.d.ts +38 -0
  9. package/dist/ai/codex.d.ts.map +1 -0
  10. package/dist/ai/codex.js +169 -0
  11. package/dist/ai/codex.js.map +1 -0
  12. package/dist/ai/factory.d.ts +48 -0
  13. package/dist/ai/factory.d.ts.map +1 -0
  14. package/dist/ai/factory.js +95 -0
  15. package/dist/ai/factory.js.map +1 -0
  16. package/dist/ai/index.d.ts +12 -0
  17. package/dist/ai/index.d.ts.map +1 -0
  18. package/dist/ai/index.js +29 -0
  19. package/dist/ai/index.js.map +1 -0
  20. package/dist/ai/provider.d.ts +70 -0
  21. package/dist/ai/provider.d.ts.map +1 -0
  22. package/dist/ai/provider.js +31 -0
  23. package/dist/ai/provider.js.map +1 -0
  24. package/dist/ai/subagent-caller.d.ts +90 -0
  25. package/dist/ai/subagent-caller.d.ts.map +1 -0
  26. package/dist/ai/subagent-caller.js +280 -0
  27. package/dist/ai/subagent-caller.js.map +1 -0
  28. package/dist/ai/types.d.ts +70 -0
  29. package/dist/ai/types.d.ts.map +1 -0
  30. package/dist/ai/types.js +5 -0
  31. package/dist/ai/types.js.map +1 -0
  32. package/dist/cache/file-hash-cache.d.ts +76 -0
  33. package/dist/cache/file-hash-cache.d.ts.map +1 -0
  34. package/dist/cache/file-hash-cache.js +159 -0
  35. package/dist/cache/file-hash-cache.js.map +1 -0
  36. package/dist/cache/index.d.ts +151 -0
  37. package/dist/cache/index.d.ts.map +1 -0
  38. package/dist/cache/index.js +303 -0
  39. package/dist/cache/index.js.map +1 -0
  40. package/dist/cache/lru-cache.d.ts +93 -0
  41. package/dist/cache/lru-cache.d.ts.map +1 -0
  42. package/dist/cache/lru-cache.js +194 -0
  43. package/dist/cache/lru-cache.js.map +1 -0
  44. package/dist/cache/parse-cache.d.ts +68 -0
  45. package/dist/cache/parse-cache.d.ts.map +1 -0
  46. package/dist/cache/parse-cache.js +173 -0
  47. package/dist/cache/parse-cache.js.map +1 -0
  48. package/dist/cli/commands/analyze.d.ts +96 -0
  49. package/dist/cli/commands/analyze.d.ts.map +1 -0
  50. package/dist/cli/commands/analyze.js +567 -0
  51. package/dist/cli/commands/analyze.js.map +1 -0
  52. package/dist/cli/commands/ci.d.ts +25 -0
  53. package/dist/cli/commands/ci.d.ts.map +1 -0
  54. package/dist/cli/commands/ci.js +481 -0
  55. package/dist/cli/commands/ci.js.map +1 -0
  56. package/dist/cli/commands/complexity.d.ts +70 -0
  57. package/dist/cli/commands/complexity.d.ts.map +1 -0
  58. package/dist/cli/commands/complexity.js +479 -0
  59. package/dist/cli/commands/complexity.js.map +1 -0
  60. package/dist/cli/commands/cycles.d.ts +10 -0
  61. package/dist/cli/commands/cycles.d.ts.map +1 -0
  62. package/dist/cli/commands/cycles.js +202 -0
  63. package/dist/cli/commands/cycles.js.map +1 -0
  64. package/dist/cli/commands/deps.d.ts +61 -0
  65. package/dist/cli/commands/deps.d.ts.map +1 -0
  66. package/dist/cli/commands/deps.js +340 -0
  67. package/dist/cli/commands/deps.js.map +1 -0
  68. package/dist/cli/commands/generate.d.ts +8 -0
  69. package/dist/cli/commands/generate.d.ts.map +1 -0
  70. package/dist/cli/commands/generate.js +61 -0
  71. package/dist/cli/commands/generate.js.map +1 -0
  72. package/dist/cli/commands/impact.d.ts +55 -0
  73. package/dist/cli/commands/impact.d.ts.map +1 -0
  74. package/dist/cli/commands/impact.js +455 -0
  75. package/dist/cli/commands/impact.js.map +1 -0
  76. package/dist/cli/commands/init.d.ts +4 -0
  77. package/dist/cli/commands/init.d.ts.map +1 -0
  78. package/dist/cli/commands/init.js +50 -0
  79. package/dist/cli/commands/init.js.map +1 -0
  80. package/dist/cli/commands/query.d.ts +22 -0
  81. package/dist/cli/commands/query.d.ts.map +1 -0
  82. package/dist/cli/commands/query.js +718 -0
  83. package/dist/cli/commands/query.js.map +1 -0
  84. package/dist/cli/commands/watch-foreground.d.ts +9 -0
  85. package/dist/cli/commands/watch-foreground.d.ts.map +1 -0
  86. package/dist/cli/commands/watch-foreground.js +67 -0
  87. package/dist/cli/commands/watch-foreground.js.map +1 -0
  88. package/dist/cli/commands/watch.d.ts +12 -0
  89. package/dist/cli/commands/watch.d.ts.map +1 -0
  90. package/dist/cli/commands/watch.js +114 -0
  91. package/dist/cli/commands/watch.js.map +1 -0
  92. package/dist/cli/commands/workflow.d.ts +25 -0
  93. package/dist/cli/commands/workflow.d.ts.map +1 -0
  94. package/dist/cli/commands/workflow.js +488 -0
  95. package/dist/cli/commands/workflow.js.map +1 -0
  96. package/dist/cli/index.d.ts +3 -0
  97. package/dist/cli/index.d.ts.map +1 -0
  98. package/dist/cli/index.js +115 -0
  99. package/dist/cli/index.js.map +1 -0
  100. package/dist/cli/paths.d.ts +90 -0
  101. package/dist/cli/paths.d.ts.map +1 -0
  102. package/dist/cli/paths.js +136 -0
  103. package/dist/cli/paths.js.map +1 -0
  104. package/dist/cli/runtime-logger.d.ts +13 -0
  105. package/dist/cli/runtime-logger.d.ts.map +1 -0
  106. package/dist/cli/runtime-logger.js +213 -0
  107. package/dist/cli/runtime-logger.js.map +1 -0
  108. package/dist/core/analyzer.d.ts +3 -0
  109. package/dist/core/analyzer.d.ts.map +1 -0
  110. package/dist/core/analyzer.js +359 -0
  111. package/dist/core/analyzer.js.map +1 -0
  112. package/dist/core/ast-complexity-analyzer.d.ts +40 -0
  113. package/dist/core/ast-complexity-analyzer.d.ts.map +1 -0
  114. package/dist/core/ast-complexity-analyzer.js +279 -0
  115. package/dist/core/ast-complexity-analyzer.js.map +1 -0
  116. package/dist/core/global-index.d.ts +69 -0
  117. package/dist/core/global-index.d.ts.map +1 -0
  118. package/dist/core/global-index.js +388 -0
  119. package/dist/core/global-index.js.map +1 -0
  120. package/dist/generator/ai-overview.d.ts +51 -0
  121. package/dist/generator/ai-overview.d.ts.map +1 -0
  122. package/dist/generator/ai-overview.js +160 -0
  123. package/dist/generator/ai-overview.js.map +1 -0
  124. package/dist/generator/context.d.ts +5 -0
  125. package/dist/generator/context.d.ts.map +1 -0
  126. package/dist/generator/context.js +514 -0
  127. package/dist/generator/context.js.map +1 -0
  128. package/dist/generator/file-describer.d.ts +93 -0
  129. package/dist/generator/file-describer.d.ts.map +1 -0
  130. package/dist/generator/file-describer.js +375 -0
  131. package/dist/generator/file-describer.js.map +1 -0
  132. package/dist/generator/index.d.ts +8 -0
  133. package/dist/generator/index.d.ts.map +1 -0
  134. package/dist/generator/index.js +259 -0
  135. package/dist/generator/index.js.map +1 -0
  136. package/dist/index.d.ts +5 -0
  137. package/dist/index.d.ts.map +1 -0
  138. package/dist/index.js +6 -0
  139. package/dist/index.js.map +1 -0
  140. package/dist/orchestrator/adapters/ast-grep-adapter.d.ts +75 -0
  141. package/dist/orchestrator/adapters/ast-grep-adapter.d.ts.map +1 -0
  142. package/dist/orchestrator/adapters/ast-grep-adapter.js +242 -0
  143. package/dist/orchestrator/adapters/ast-grep-adapter.js.map +1 -0
  144. package/dist/orchestrator/adapters/base-adapter.d.ts +24 -0
  145. package/dist/orchestrator/adapters/base-adapter.d.ts.map +1 -0
  146. package/dist/orchestrator/adapters/base-adapter.js +2 -0
  147. package/dist/orchestrator/adapters/base-adapter.js.map +1 -0
  148. package/dist/orchestrator/adapters/codemap-adapter.d.ts +56 -0
  149. package/dist/orchestrator/adapters/codemap-adapter.d.ts.map +1 -0
  150. package/dist/orchestrator/adapters/codemap-adapter.js +163 -0
  151. package/dist/orchestrator/adapters/codemap-adapter.js.map +1 -0
  152. package/dist/orchestrator/adapters/index.d.ts +10 -0
  153. package/dist/orchestrator/adapters/index.d.ts.map +1 -0
  154. package/dist/orchestrator/adapters/index.js +3 -0
  155. package/dist/orchestrator/adapters/index.js.map +1 -0
  156. package/dist/orchestrator/ai-feed-generator.d.ts +210 -0
  157. package/dist/orchestrator/ai-feed-generator.d.ts.map +1 -0
  158. package/dist/orchestrator/ai-feed-generator.js +377 -0
  159. package/dist/orchestrator/ai-feed-generator.js.map +1 -0
  160. package/dist/orchestrator/commit-validator.d.ts +30 -0
  161. package/dist/orchestrator/commit-validator.d.ts.map +1 -0
  162. package/dist/orchestrator/commit-validator.js +87 -0
  163. package/dist/orchestrator/commit-validator.js.map +1 -0
  164. package/dist/orchestrator/confidence.d.ts +25 -0
  165. package/dist/orchestrator/confidence.d.ts.map +1 -0
  166. package/dist/orchestrator/confidence.js +138 -0
  167. package/dist/orchestrator/confidence.js.map +1 -0
  168. package/dist/orchestrator/file-header-scanner.d.ts +48 -0
  169. package/dist/orchestrator/file-header-scanner.d.ts.map +1 -0
  170. package/dist/orchestrator/file-header-scanner.js +158 -0
  171. package/dist/orchestrator/file-header-scanner.js.map +1 -0
  172. package/dist/orchestrator/git-analyzer.d.ts +192 -0
  173. package/dist/orchestrator/git-analyzer.d.ts.map +1 -0
  174. package/dist/orchestrator/git-analyzer.js +539 -0
  175. package/dist/orchestrator/git-analyzer.js.map +1 -0
  176. package/dist/orchestrator/index.d.ts +20 -0
  177. package/dist/orchestrator/index.d.ts.map +1 -0
  178. package/dist/orchestrator/index.js +16 -0
  179. package/dist/orchestrator/index.js.map +1 -0
  180. package/dist/orchestrator/intent-router.d.ts +41 -0
  181. package/dist/orchestrator/intent-router.d.ts.map +1 -0
  182. package/dist/orchestrator/intent-router.js +98 -0
  183. package/dist/orchestrator/intent-router.js.map +1 -0
  184. package/dist/orchestrator/result-fusion.d.ts +114 -0
  185. package/dist/orchestrator/result-fusion.d.ts.map +1 -0
  186. package/dist/orchestrator/result-fusion.js +332 -0
  187. package/dist/orchestrator/result-fusion.js.map +1 -0
  188. package/dist/orchestrator/test-linker.d.ts +166 -0
  189. package/dist/orchestrator/test-linker.d.ts.map +1 -0
  190. package/dist/orchestrator/test-linker.js +570 -0
  191. package/dist/orchestrator/test-linker.js.map +1 -0
  192. package/dist/orchestrator/tool-orchestrator.d.ts +108 -0
  193. package/dist/orchestrator/tool-orchestrator.d.ts.map +1 -0
  194. package/dist/orchestrator/tool-orchestrator.js +247 -0
  195. package/dist/orchestrator/tool-orchestrator.js.map +1 -0
  196. package/dist/orchestrator/types.d.ts +162 -0
  197. package/dist/orchestrator/types.d.ts.map +1 -0
  198. package/dist/orchestrator/types.js +39 -0
  199. package/dist/orchestrator/types.js.map +1 -0
  200. package/dist/orchestrator/workflow/ci-executor.d.ts +157 -0
  201. package/dist/orchestrator/workflow/ci-executor.d.ts.map +1 -0
  202. package/dist/orchestrator/workflow/ci-executor.js +423 -0
  203. package/dist/orchestrator/workflow/ci-executor.js.map +1 -0
  204. package/dist/orchestrator/workflow/config.d.ts +97 -0
  205. package/dist/orchestrator/workflow/config.d.ts.map +1 -0
  206. package/dist/orchestrator/workflow/config.js +115 -0
  207. package/dist/orchestrator/workflow/config.js.map +1 -0
  208. package/dist/orchestrator/workflow/git-analyzer.d.ts +173 -0
  209. package/dist/orchestrator/workflow/git-analyzer.d.ts.map +1 -0
  210. package/dist/orchestrator/workflow/git-analyzer.js +473 -0
  211. package/dist/orchestrator/workflow/git-analyzer.js.map +1 -0
  212. package/dist/orchestrator/workflow/index.d.ts +21 -0
  213. package/dist/orchestrator/workflow/index.d.ts.map +1 -0
  214. package/dist/orchestrator/workflow/index.js +21 -0
  215. package/dist/orchestrator/workflow/index.js.map +1 -0
  216. package/dist/orchestrator/workflow/phase-checkpoint.d.ts +38 -0
  217. package/dist/orchestrator/workflow/phase-checkpoint.d.ts.map +1 -0
  218. package/dist/orchestrator/workflow/phase-checkpoint.js +75 -0
  219. package/dist/orchestrator/workflow/phase-checkpoint.js.map +1 -0
  220. package/dist/orchestrator/workflow/phase-inheritance.d.ts +128 -0
  221. package/dist/orchestrator/workflow/phase-inheritance.d.ts.map +1 -0
  222. package/dist/orchestrator/workflow/phase-inheritance.js +266 -0
  223. package/dist/orchestrator/workflow/phase-inheritance.js.map +1 -0
  224. package/dist/orchestrator/workflow/result-fusion.d.ts +117 -0
  225. package/dist/orchestrator/workflow/result-fusion.d.ts.map +1 -0
  226. package/dist/orchestrator/workflow/result-fusion.js +246 -0
  227. package/dist/orchestrator/workflow/result-fusion.js.map +1 -0
  228. package/dist/orchestrator/workflow/templates.d.ts +116 -0
  229. package/dist/orchestrator/workflow/templates.d.ts.map +1 -0
  230. package/dist/orchestrator/workflow/templates.js +546 -0
  231. package/dist/orchestrator/workflow/templates.js.map +1 -0
  232. package/dist/orchestrator/workflow/test-linker.d.ts +152 -0
  233. package/dist/orchestrator/workflow/test-linker.d.ts.map +1 -0
  234. package/dist/orchestrator/workflow/test-linker.js +342 -0
  235. package/dist/orchestrator/workflow/test-linker.js.map +1 -0
  236. package/dist/orchestrator/workflow/types.d.ts +202 -0
  237. package/dist/orchestrator/workflow/types.d.ts.map +1 -0
  238. package/dist/orchestrator/workflow/types.js +4 -0
  239. package/dist/orchestrator/workflow/types.js.map +1 -0
  240. package/dist/orchestrator/workflow/visualizer.d.ts +56 -0
  241. package/dist/orchestrator/workflow/visualizer.d.ts.map +1 -0
  242. package/dist/orchestrator/workflow/visualizer.js +300 -0
  243. package/dist/orchestrator/workflow/visualizer.js.map +1 -0
  244. package/dist/orchestrator/workflow/workflow-context.d.ts +50 -0
  245. package/dist/orchestrator/workflow/workflow-context.d.ts.map +1 -0
  246. package/dist/orchestrator/workflow/workflow-context.js +105 -0
  247. package/dist/orchestrator/workflow/workflow-context.js.map +1 -0
  248. package/dist/orchestrator/workflow/workflow-orchestrator.d.ts +126 -0
  249. package/dist/orchestrator/workflow/workflow-orchestrator.d.ts.map +1 -0
  250. package/dist/orchestrator/workflow/workflow-orchestrator.js +489 -0
  251. package/dist/orchestrator/workflow/workflow-orchestrator.js.map +1 -0
  252. package/dist/orchestrator/workflow/workflow-persistence.d.ts +38 -0
  253. package/dist/orchestrator/workflow/workflow-persistence.d.ts.map +1 -0
  254. package/dist/orchestrator/workflow/workflow-persistence.js +166 -0
  255. package/dist/orchestrator/workflow/workflow-persistence.js.map +1 -0
  256. package/dist/parser/implementations/fast-parser.d.ts +65 -0
  257. package/dist/parser/implementations/fast-parser.d.ts.map +1 -0
  258. package/dist/parser/implementations/fast-parser.js +299 -0
  259. package/dist/parser/implementations/fast-parser.js.map +1 -0
  260. package/dist/parser/implementations/smart-parser.d.ts +220 -0
  261. package/dist/parser/implementations/smart-parser.d.ts.map +1 -0
  262. package/dist/parser/implementations/smart-parser.js +1536 -0
  263. package/dist/parser/implementations/smart-parser.js.map +1 -0
  264. package/dist/parser/implementations/tree-sitter-parser.d.ts +57 -0
  265. package/dist/parser/implementations/tree-sitter-parser.d.ts.map +1 -0
  266. package/dist/parser/implementations/tree-sitter-parser.js +375 -0
  267. package/dist/parser/implementations/tree-sitter-parser.js.map +1 -0
  268. package/dist/parser/index.d.ts +19 -0
  269. package/dist/parser/index.d.ts.map +1 -0
  270. package/dist/parser/index.js +449 -0
  271. package/dist/parser/index.js.map +1 -0
  272. package/dist/parser/interfaces/IParser.d.ts +218 -0
  273. package/dist/parser/interfaces/IParser.d.ts.map +1 -0
  274. package/dist/parser/interfaces/IParser.js +22 -0
  275. package/dist/parser/interfaces/IParser.js.map +1 -0
  276. package/dist/plugins/built-in/call-graph.d.ts +38 -0
  277. package/dist/plugins/built-in/call-graph.d.ts.map +1 -0
  278. package/dist/plugins/built-in/call-graph.js +135 -0
  279. package/dist/plugins/built-in/call-graph.js.map +1 -0
  280. package/dist/plugins/built-in/complexity-analyzer.d.ts +45 -0
  281. package/dist/plugins/built-in/complexity-analyzer.d.ts.map +1 -0
  282. package/dist/plugins/built-in/complexity-analyzer.js +155 -0
  283. package/dist/plugins/built-in/complexity-analyzer.js.map +1 -0
  284. package/dist/plugins/index.d.ts +34 -0
  285. package/dist/plugins/index.d.ts.map +1 -0
  286. package/dist/plugins/index.js +103 -0
  287. package/dist/plugins/index.js.map +1 -0
  288. package/dist/plugins/plugin-loader.d.ts +22 -0
  289. package/dist/plugins/plugin-loader.d.ts.map +1 -0
  290. package/dist/plugins/plugin-loader.js +200 -0
  291. package/dist/plugins/plugin-loader.js.map +1 -0
  292. package/dist/plugins/plugin-registry.d.ts +20 -0
  293. package/dist/plugins/plugin-registry.d.ts.map +1 -0
  294. package/dist/plugins/plugin-registry.js +143 -0
  295. package/dist/plugins/plugin-registry.js.map +1 -0
  296. package/dist/plugins/types.d.ts +72 -0
  297. package/dist/plugins/types.d.ts.map +1 -0
  298. package/dist/plugins/types.js +5 -0
  299. package/dist/plugins/types.js.map +1 -0
  300. package/dist/types/index.d.ts +373 -0
  301. package/dist/types/index.d.ts.map +1 -0
  302. package/dist/types/index.js +7 -0
  303. package/dist/types/index.js.map +1 -0
  304. package/dist/watcher/daemon.d.ts +64 -0
  305. package/dist/watcher/daemon.d.ts.map +1 -0
  306. package/dist/watcher/daemon.js +189 -0
  307. package/dist/watcher/daemon.js.map +1 -0
  308. package/dist/watcher/file-watcher.d.ts +70 -0
  309. package/dist/watcher/file-watcher.d.ts.map +1 -0
  310. package/dist/watcher/file-watcher.js +127 -0
  311. package/dist/watcher/file-watcher.js.map +1 -0
  312. package/dist/watcher/index.d.ts +5 -0
  313. package/dist/watcher/index.d.ts.map +1 -0
  314. package/dist/watcher/index.js +6 -0
  315. package/dist/watcher/index.js.map +1 -0
  316. package/dist/watcher/watch-worker.d.ts +2 -0
  317. package/dist/watcher/watch-worker.d.ts.map +1 -0
  318. package/dist/watcher/watch-worker.js +57 -0
  319. package/dist/watcher/watch-worker.js.map +1 -0
  320. package/dist/worker/index.d.ts +76 -0
  321. package/dist/worker/index.d.ts.map +1 -0
  322. package/dist/worker/index.js +155 -0
  323. package/dist/worker/index.js.map +1 -0
  324. package/dist/worker/parse-worker.d.ts +2 -0
  325. package/dist/worker/parse-worker.d.ts.map +1 -0
  326. package/dist/worker/parse-worker.js +202 -0
  327. package/dist/worker/parse-worker.js.map +1 -0
  328. package/mycodemap.config.schema.json +42 -0
  329. package/package.json +69 -0
@@ -0,0 +1,166 @@
1
+ // [META] since:2026-03-02 | owner:workflow-team | stable:true
2
+ // [WHY] Persist workflow context safely with Map/Set/Date serialization and active-workflow recovery
3
+ /**
4
+ * 工作流持久化
5
+ * 处理工作流上下文的序列化和反序列化
6
+ */
7
+ import { promises as fs, existsSync } from 'node:fs';
8
+ import { join } from 'node:path';
9
+ import { cwd } from 'node:process';
10
+ /**
11
+ * 路径兼容常量
12
+ */
13
+ const DEFAULT_OUTPUT_DIR_NEW = '.mycodemap';
14
+ const DEFAULT_OUTPUT_DIR_OLD = '.codemap';
15
+ /**
16
+ * 解析工作流目录路径
17
+ */
18
+ function resolveWorkflowDir() {
19
+ const rootDir = cwd();
20
+ const newPath = join(rootDir, DEFAULT_OUTPUT_DIR_NEW, 'workflow');
21
+ if (existsSync(newPath) || !existsSync(join(rootDir, DEFAULT_OUTPUT_DIR_OLD, 'workflow'))) {
22
+ return join(DEFAULT_OUTPUT_DIR_NEW, 'workflow');
23
+ }
24
+ return join(DEFAULT_OUTPUT_DIR_OLD, 'workflow');
25
+ }
26
+ /**
27
+ * 工作流持久化类
28
+ */
29
+ export class WorkflowPersistence {
30
+ storagePath;
31
+ activePath;
32
+ constructor() {
33
+ const workflowDir = resolveWorkflowDir();
34
+ this.storagePath = workflowDir;
35
+ this.activePath = join(workflowDir, 'active.json');
36
+ }
37
+ /**
38
+ * 保存工作流上下文
39
+ */
40
+ async save(context) {
41
+ // 确保目录存在
42
+ await fs.mkdir(this.storagePath, { recursive: true });
43
+ const filePath = join(this.storagePath, `${context.id}.json`);
44
+ await fs.writeFile(filePath, JSON.stringify(this.serialize(context), null, 2));
45
+ await fs.writeFile(this.activePath, JSON.stringify({ id: context.id }, null, 2));
46
+ }
47
+ /**
48
+ * 加载指定工作流
49
+ */
50
+ async load(id) {
51
+ const filePath = join(this.storagePath, `${id}.json`);
52
+ try {
53
+ const content = await fs.readFile(filePath, 'utf-8');
54
+ return this.deserialize(JSON.parse(content));
55
+ }
56
+ catch {
57
+ return null;
58
+ }
59
+ }
60
+ /**
61
+ * 加载活动工作流
62
+ */
63
+ async loadActive() {
64
+ try {
65
+ const content = await fs.readFile(this.activePath, 'utf-8');
66
+ const { id } = JSON.parse(content);
67
+ return id ? this.load(id) : null;
68
+ }
69
+ catch {
70
+ return null;
71
+ }
72
+ }
73
+ /**
74
+ * 列出所有工作流摘要
75
+ */
76
+ async list() {
77
+ try {
78
+ const dir = join(process.cwd(), this.storagePath);
79
+ const files = await fs.readdir(dir);
80
+ const summaries = [];
81
+ for (const file of files) {
82
+ if (!file.endsWith('.json') || file === 'active.json')
83
+ continue;
84
+ try {
85
+ const content = await fs.readFile(join(dir, file), 'utf-8');
86
+ const ctx = JSON.parse(content);
87
+ summaries.push({
88
+ id: ctx.id,
89
+ task: ctx.task,
90
+ currentPhase: ctx.currentPhase,
91
+ phaseStatus: ctx.phaseStatus,
92
+ updatedAt: ctx.updatedAt
93
+ });
94
+ }
95
+ catch {
96
+ // 跳过无法解析的文件
97
+ }
98
+ }
99
+ return summaries;
100
+ }
101
+ catch {
102
+ return [];
103
+ }
104
+ }
105
+ /**
106
+ * 删除工作流
107
+ */
108
+ async delete(id) {
109
+ const filePath = join(this.storagePath, `${id}.json`);
110
+ try {
111
+ await fs.unlink(filePath);
112
+ }
113
+ catch {
114
+ // 文件不存在,忽略
115
+ }
116
+ // 如果删除的是活动工作流,清除活动标记
117
+ try {
118
+ const activeContent = await fs.readFile(this.activePath, 'utf-8');
119
+ const { id: activeId } = JSON.parse(activeContent);
120
+ if (activeId === id) {
121
+ await fs.writeFile(this.activePath, JSON.stringify({ id: null }, null, 2));
122
+ }
123
+ }
124
+ catch {
125
+ // 忽略
126
+ }
127
+ }
128
+ /**
129
+ * 序列化上下文(处理 Map 和 Set)
130
+ */
131
+ serialize(context) {
132
+ return {
133
+ ...context,
134
+ artifacts: Array.from(context.artifacts.entries()),
135
+ userConfirmed: Array.from(context.userConfirmed.values()),
136
+ startedAt: context.startedAt.toISOString(),
137
+ updatedAt: context.updatedAt.toISOString()
138
+ };
139
+ }
140
+ /**
141
+ * 反序列化上下文(还原 Map 和 Set)
142
+ */
143
+ deserialize(raw) {
144
+ // 处理 artifacts 中的日期
145
+ const processedArtifacts = new Map();
146
+ for (const [phase, artifact] of (raw.artifacts || [])) {
147
+ processedArtifacts.set(phase, {
148
+ ...artifact,
149
+ createdAt: new Date(artifact.createdAt)
150
+ });
151
+ }
152
+ return {
153
+ id: raw.id,
154
+ task: raw.task,
155
+ templateName: raw.templateName,
156
+ currentPhase: raw.currentPhase,
157
+ phaseStatus: raw.phaseStatus,
158
+ artifacts: processedArtifacts,
159
+ cachedResults: raw.cachedResults,
160
+ userConfirmed: new Set(raw.userConfirmed || []),
161
+ startedAt: new Date(raw.startedAt),
162
+ updatedAt: new Date(raw.updatedAt)
163
+ };
164
+ }
165
+ }
166
+ //# sourceMappingURL=workflow-persistence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-persistence.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/workflow-persistence.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,qGAAqG;AAErG;;;GAGG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC;;GAEG;AACH,MAAM,sBAAsB,GAAG,YAAY,CAAC;AAC5C,MAAM,sBAAsB,GAAG,UAAU,CAAC;AAe1C;;GAEG;AACH,SAAS,kBAAkB;IACzB,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC;IACtB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,sBAAsB,EAAE,UAAU,CAAC,CAAC;IAElE,IAAI,UAA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ult, ParserOptions, TextEdit } from '../interfaces/IParser.js';
2
+ /**
3
+ * 将构建路径转换为源代码路径
4
+ * 例如: ../types/index.js -> ../types/index.ts
5
+ */
6
+ export declare function normalizeSourcePath(depPath: string): string;
7
+ /**
8
+ * Fast Parser - 使用 Tree-sitter 进行快速解析
9
+ * 注意: 需要安装 tree-sitter 和 tree-sitter-typescript
10
+ */
11
+ export declare class FastParser implements IParser {
12
+ readonly name = "fast-parser";
13
+ readonly mode = "fast";
14
+ constructor(_options: ParserOptions);
15
+ /**
16
+ * 解析单个文件
17
+ */
18
+ parseFile(filePath: string): Promise<ParseResult>;
19
+ /**
20
+ * 批量解析文件
21
+ */
22
+ parseFiles(filePaths: string[]): Promise<ParseResult[]>;
23
+ /**
24
+ * 增量解析
25
+ */
26
+ parseIncremental(_oldTree: unknown, _edit: TextEdit): ParseResult;
27
+ /**
28
+ * 释放资源
29
+ */
30
+ dispose(): void;
31
+ /**
32
+ * 简化导出提取
33
+ */
34
+ private extractExportsSimple;
35
+ /**
36
+ * 简化导入提取(包括 import 和 re-export)
37
+ */
38
+ private extractImportsSimple;
39
+ /**
40
+ * 简化符号提取
41
+ */
42
+ private extractSymbolsSimple;
43
+ /**
44
+ * 简化依赖提取
45
+ * 只返回外部模块依赖,过滤掉本地相对路径导入
46
+ */
47
+ private extractDependenciesSimple;
48
+ /**
49
+ * 从匹配获取类型
50
+ */
51
+ private getKindFromMatch;
52
+ /**
53
+ * 获取模块类型
54
+ */
55
+ private getModuleType;
56
+ /**
57
+ * 获取文件统计
58
+ */
59
+ private getFileStats;
60
+ /**
61
+ * 生成 ID
62
+ */
63
+ private generateId;
64
+ }
65
+ //# sourceMappingURL=fast-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fast-parser.d.ts","sourceRoot":"","sources":["../../../src/parser/implementations/fast-parser.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAG9F;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQ3D;AAED;;;GAGG;AACH,qBAAa,UAAW,YAAW,OAAO;IACxC,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,IAAI,UAAU;gBAEX,QAAQ,EAAE,aAAa;IAInC;;OAEG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAoBvD;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAe7D;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,GAAG,WAAW;IAKjE;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAiC5B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA4E5B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAiC5B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IAajC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,OAAO,CAAC,aAAa;IAcrB;;OAEG;IACH,OAAO,CAAC,YAAY;IAyBpB;;OAEG;IACH,OAAO,CAAC,UAAU;CASnB"}
@@ -0,0 +1,299 @@
1
+ // ============================================
2
+ // Fast Parser - 基于 Tree-sitter 的快速解析器
3
+ // ============================================
4
+ // [META] since:2024-06 | owner:parser-team | stable:true
5
+ // [WHY] 基于 Tree-sitter 的快速解析器,提供高性能的代码结构分析
6
+ import * as path from 'path';
7
+ import * as fs from 'fs';
8
+ /**
9
+ * 将构建路径转换为源代码路径
10
+ * 例如: ../types/index.js -> ../types/index.ts
11
+ */
12
+ export function normalizeSourcePath(depPath) {
13
+ // 已经是 .ts 或 .tsx 的不需要转换
14
+ if (depPath.endsWith('.ts') || depPath.endsWith('.tsx')) {
15
+ return depPath;
16
+ }
17
+ // 替换 .js/.jsx 后缀为 .ts/.tsx
18
+ return depPath.replace(/\.js$/i, '.ts').replace(/\.jsx$/i, '.tsx');
19
+ }
20
+ /**
21
+ * Fast Parser - 使用 Tree-sitter 进行快速解析
22
+ * 注意: 需要安装 tree-sitter 和 tree-sitter-typescript
23
+ */
24
+ export class FastParser {
25
+ name = 'fast-parser';
26
+ mode = 'fast';
27
+ constructor(_options) {
28
+ console.log('[FastParser] 初始化 (简化模式)');
29
+ }
30
+ /**
31
+ * 解析单个文件
32
+ */
33
+ async parseFile(filePath) {
34
+ const content = fs.readFileSync(filePath, 'utf-8');
35
+ // 使用简化解析
36
+ const exports = this.extractExportsSimple(content);
37
+ const imports = this.extractImportsSimple(content);
38
+ const symbols = this.extractSymbolsSimple(content);
39
+ const dependencies = this.extractDependenciesSimple(imports);
40
+ return {
41
+ path: filePath,
42
+ exports,
43
+ imports,
44
+ symbols,
45
+ dependencies,
46
+ type: this.getModuleType(filePath),
47
+ stats: this.getFileStats(content)
48
+ };
49
+ }
50
+ /**
51
+ * 批量解析文件
52
+ */
53
+ async parseFiles(filePaths) {
54
+ const results = [];
55
+ for (const filePath of filePaths) {
56
+ try {
57
+ const result = await this.parseFile(filePath);
58
+ results.push(result);
59
+ }
60
+ catch (error) {
61
+ console.error(`解析失败: ${filePath}`, error);
62
+ }
63
+ }
64
+ return results;
65
+ }
66
+ /**
67
+ * 增量解析
68
+ */
69
+ parseIncremental(_oldTree, _edit) {
70
+ // Tree-sitter 支持增量解析
71
+ throw new Error('增量解析尚未实现');
72
+ }
73
+ /**
74
+ * 释放资源
75
+ */
76
+ dispose() {
77
+ // 清理资源
78
+ }
79
+ /**
80
+ * 简化导出提取
81
+ */
82
+ extractExportsSimple(content) {
83
+ const exports = [];
84
+ const exportRegex = /export\s+(?:default\s+)?(?:class|function|interface|type|const|let|var|enum)\s+(\w+)/g;
85
+ let match;
86
+ while ((match = exportRegex.exec(content)) !== null) {
87
+ exports.push({
88
+ name: match[1],
89
+ kind: this.getKindFromMatch(match[0]),
90
+ isDefault: match[0].includes('default'),
91
+ isTypeOnly: false
92
+ });
93
+ }
94
+ // 命名导出 export { ... }
95
+ const namedExportRegex = /export\s+\{\s*([^}]+)\s*\}/g;
96
+ while ((match = namedExportRegex.exec(content)) !== null) {
97
+ const names = match[1].split(',').map((s) => s.trim());
98
+ for (const name of names) {
99
+ if (name && !name.startsWith('type ')) {
100
+ exports.push({
101
+ name,
102
+ kind: 'variable',
103
+ isDefault: false,
104
+ isTypeOnly: false
105
+ });
106
+ }
107
+ }
108
+ }
109
+ return exports;
110
+ }
111
+ /**
112
+ * 简化导入提取(包括 import 和 re-export)
113
+ */
114
+ extractImportsSimple(content) {
115
+ const imports = [];
116
+ // import { ... } from '...'
117
+ const importRegex = /import\s+(?:\{([^}]+)\}|(\w+))?\s*(?:,\s*\{([^}]+)\})?\s*from\s+['"]([^'"]+)['"]/g;
118
+ let match;
119
+ while ((match = importRegex.exec(content)) !== null) {
120
+ const specifiers = [];
121
+ if (match[1]) {
122
+ specifiers.push(...match[1].split(',').map((s) => s.trim()));
123
+ }
124
+ if (match[2]) {
125
+ specifiers.unshift(match[2]);
126
+ }
127
+ if (match[3]) {
128
+ specifiers.push(...match[3].split(',').map((s) => s.trim()));
129
+ }
130
+ if (match[4]) {
131
+ imports.push({
132
+ source: normalizeSourcePath(match[4]),
133
+ sourceType: match[4].startsWith('.') ? 'relative' : 'alias',
134
+ specifiers: specifiers.map(s => ({ name: s, isTypeOnly: false })),
135
+ isTypeOnly: false
136
+ });
137
+ }
138
+ }
139
+ // 处理 re-export: export { ... } from '...'
140
+ const reExportRegex = /export\s+\{\s*([^}]+)\s*\}\s*from\s+['"]([^'"]+)['"]/g;
141
+ while ((match = reExportRegex.exec(content)) !== null) {
142
+ const specifiers = match[1].split(',').map((s) => s.trim()).filter(Boolean);
143
+ if (match[2]) {
144
+ imports.push({
145
+ source: normalizeSourcePath(match[2]),
146
+ sourceType: match[2].startsWith('.') ? 'relative' : 'alias',
147
+ specifiers: specifiers.map(s => ({ name: s, isTypeOnly: false })),
148
+ isTypeOnly: false,
149
+ isReExport: true // 标记为 re-export
150
+ });
151
+ }
152
+ }
153
+ // 处理 re-export: export * from '...'
154
+ const reExportAllRegex = /export\s+\*\s*from\s+['"]([^'"]+)['"]/g;
155
+ while ((match = reExportAllRegex.exec(content)) !== null) {
156
+ if (match[1]) {
157
+ imports.push({
158
+ source: match[1],
159
+ sourceType: match[1].startsWith('.') ? 'relative' : 'alias',
160
+ specifiers: [],
161
+ isTypeOnly: false,
162
+ isReExport: true
163
+ });
164
+ }
165
+ }
166
+ // 处理 re-export: export { default } from '...'
167
+ const reExportDefaultRegex = /export\s+\{\s*default\s*\}\s*from\s+['"]([^'"]+)['"]/g;
168
+ while ((match = reExportDefaultRegex.exec(content)) !== null) {
169
+ if (match[1]) {
170
+ imports.push({
171
+ source: match[1],
172
+ sourceType: match[1].startsWith('.') ? 'relative' : 'alias',
173
+ specifiers: [{ name: 'default', isTypeOnly: false }],
174
+ isTypeOnly: false,
175
+ isReExport: true
176
+ });
177
+ }
178
+ }
179
+ return imports;
180
+ }
181
+ /**
182
+ * 简化符号提取
183
+ */
184
+ extractSymbolsSimple(content) {
185
+ const symbols = [];
186
+ // 函数
187
+ const funcRegex = /(?:export\s+)?function\s+(\w+)/g;
188
+ let match;
189
+ while ((match = funcRegex.exec(content)) !== null) {
190
+ symbols.push({
191
+ id: this.generateId(match[1]),
192
+ name: match[1],
193
+ kind: 'function',
194
+ location: { file: '', line: 0, column: 0 },
195
+ visibility: content.substring(0, match.index).includes('export') ? 'public' : 'private',
196
+ relatedSymbols: []
197
+ });
198
+ }
199
+ // 类
200
+ const classRegex = /(?:export\s+)?class\s+(\w+)/g;
201
+ while ((match = classRegex.exec(content)) !== null) {
202
+ symbols.push({
203
+ id: this.generateId(match[1]),
204
+ name: match[1],
205
+ kind: 'class',
206
+ location: { file: '', line: 0, column: 0 },
207
+ visibility: content.substring(0, match.index).includes('export') ? 'public' : 'private',
208
+ relatedSymbols: []
209
+ });
210
+ }
211
+ return symbols;
212
+ }
213
+ /**
214
+ * 简化依赖提取
215
+ * 只返回外部模块依赖,过滤掉本地相对路径导入
216
+ */
217
+ extractDependenciesSimple(imports) {
218
+ const deps = new Set();
219
+ for (const imp of imports) {
220
+ // 只收集外部模块依赖,过滤掉本地相对路径(以 . 开头)
221
+ if (!imp.source.startsWith('.')) {
222
+ deps.add(imp.source);
223
+ }
224
+ }
225
+ return Array.from(deps);
226
+ }
227
+ /**
228
+ * 从匹配获取类型
229
+ */
230
+ getKindFromMatch(match) {
231
+ if (match.includes('class'))
232
+ return 'class';
233
+ if (match.includes('function'))
234
+ return 'function';
235
+ if (match.includes('interface'))
236
+ return 'interface';
237
+ if (match.includes('type'))
238
+ return 'type';
239
+ if (match.includes('enum'))
240
+ return 'enum';
241
+ return 'variable';
242
+ }
243
+ /**
244
+ * 获取模块类型
245
+ */
246
+ getModuleType(filePath) {
247
+ const basename = path.basename(filePath);
248
+ if (basename.includes('.test.') || basename.includes('.spec.')) {
249
+ return 'test';
250
+ }
251
+ if (basename === 'tsconfig.json' || basename === 'jest.config.js') {
252
+ return 'config';
253
+ }
254
+ if (basename.endsWith('.d.ts')) {
255
+ return 'type';
256
+ }
257
+ return 'source';
258
+ }
259
+ /**
260
+ * 获取文件统计
261
+ */
262
+ getFileStats(content) {
263
+ const lines = content.split('\n');
264
+ let codeLines = 0;
265
+ let commentLines = 0;
266
+ let blankLines = 0;
267
+ for (const line of lines) {
268
+ const trimmed = line.trim();
269
+ if (trimmed === '') {
270
+ blankLines++;
271
+ }
272
+ else if (trimmed.startsWith('//') || trimmed.startsWith('/*') || trimmed.startsWith('*')) {
273
+ commentLines++;
274
+ }
275
+ else {
276
+ codeLines++;
277
+ }
278
+ }
279
+ return {
280
+ lines: lines.length,
281
+ codeLines,
282
+ commentLines,
283
+ blankLines
284
+ };
285
+ }
286
+ /**
287
+ * 生成 ID
288
+ */
289
+ generateId(name) {
290
+ let hash = 0;
291
+ for (let i = 0; i < name.length; i++) {
292
+ const char = name.charCodeAt(i);
293
+ hash = ((hash << 5) - hash) + char;
294
+ hash = hash & hash;
295
+ }
296
+ return Math.abs(hash).toString(36);
297
+ }
298
+ }
299
+ //# sourceMappingURL=fast-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fast-parser.js","sourceRoot":"","sources":["../../../src/parser/implementations/fast-parser.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,sCAAsC;AACtC,+CAA+C;AAE/C,yDAAyD;AACzD,2CAA2C;AAC3C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,wBAAwB;IACxB,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACxD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,2BAA2B;IAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AACrE,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,UAAU;IACZ,IAAI,GAAG,aAAa,CAAC;IACrB,IAAI,GAAG,MAAM,CAAC;IAEvB,YAAY,QAAuB;QACjC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,QAAgB;QAC9B,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAEnD,SAAS;QACT,MAAM,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QACnD,MAAM,OAAO,GAAG,IAAI,CAAC,oBAAo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