@mycodemap/mycodemap 0.4.1 → 0.5.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 (309) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/README.md +307 -243
  3. package/dist/ai/claude.d.ts +38 -0
  4. package/dist/ai/claude.d.ts.map +1 -0
  5. package/dist/ai/claude.js +169 -0
  6. package/dist/ai/claude.js.map +1 -0
  7. package/dist/ai/codex.d.ts +38 -0
  8. package/dist/ai/codex.d.ts.map +1 -0
  9. package/dist/ai/codex.js +169 -0
  10. package/dist/ai/codex.js.map +1 -0
  11. package/dist/ai/factory.d.ts +48 -0
  12. package/dist/ai/factory.d.ts.map +1 -0
  13. package/dist/ai/factory.js +95 -0
  14. package/dist/ai/factory.js.map +1 -0
  15. package/dist/ai/index.d.ts +12 -0
  16. package/dist/ai/index.d.ts.map +1 -0
  17. package/dist/ai/index.js +29 -0
  18. package/dist/ai/index.js.map +1 -0
  19. package/dist/ai/provider.d.ts +70 -0
  20. package/dist/ai/provider.d.ts.map +1 -0
  21. package/dist/ai/provider.js +31 -0
  22. package/dist/ai/provider.js.map +1 -0
  23. package/dist/ai/subagent-caller.d.ts +90 -0
  24. package/dist/ai/subagent-caller.d.ts.map +1 -0
  25. package/dist/ai/subagent-caller.js +280 -0
  26. package/dist/ai/subagent-caller.js.map +1 -0
  27. package/dist/ai/types.d.ts +70 -0
  28. package/dist/ai/types.d.ts.map +1 -0
  29. package/dist/ai/types.js +5 -0
  30. package/dist/ai/types.js.map +1 -0
  31. package/dist/cli/commands/analyze-options.d.ts +36 -0
  32. package/dist/cli/commands/analyze-options.d.ts.map +1 -0
  33. package/dist/cli/commands/analyze-options.js +147 -0
  34. package/dist/cli/commands/analyze-options.js.map +1 -0
  35. package/dist/cli/commands/analyze.d.ts +93 -4
  36. package/dist/cli/commands/analyze.d.ts.map +1 -1
  37. package/dist/cli/commands/analyze.js +592 -176
  38. package/dist/cli/commands/analyze.js.map +1 -1
  39. package/dist/cli/commands/ci.d.ts +47 -1
  40. package/dist/cli/commands/ci.d.ts.map +1 -1
  41. package/dist/cli/commands/ci.js +208 -1
  42. package/dist/cli/commands/ci.js.map +1 -1
  43. package/dist/cli/commands/design.d.ts +47 -0
  44. package/dist/cli/commands/design.d.ts.map +1 -0
  45. package/dist/cli/commands/design.js +268 -0
  46. package/dist/cli/commands/design.js.map +1 -0
  47. package/dist/cli/commands/export.d.ts.map +1 -1
  48. package/dist/cli/commands/export.js +2 -2
  49. package/dist/cli/commands/export.js.map +1 -1
  50. package/dist/cli/commands/generate.d.ts +8 -2
  51. package/dist/cli/commands/generate.d.ts.map +1 -1
  52. package/dist/cli/commands/generate.js +151 -22
  53. package/dist/cli/commands/generate.js.map +1 -1
  54. package/dist/cli/commands/init.d.ts.map +1 -1
  55. package/dist/cli/commands/init.js +2 -13
  56. package/dist/cli/commands/init.js.map +1 -1
  57. package/dist/cli/commands/server.d.ts.map +1 -1
  58. package/dist/cli/commands/server.js +2 -5
  59. package/dist/cli/commands/server.js.map +1 -1
  60. package/dist/cli/commands/ship/checker.d.ts.map +1 -1
  61. package/dist/cli/commands/ship/checker.js +0 -3
  62. package/dist/cli/commands/ship/checker.js.map +1 -1
  63. package/dist/cli/commands/ship/pipeline.d.ts.map +1 -1
  64. package/dist/cli/commands/ship/pipeline.js +8 -1
  65. package/dist/cli/commands/ship/pipeline.js.map +1 -1
  66. package/dist/cli/commands/ship/publisher.d.ts +9 -1
  67. package/dist/cli/commands/ship/publisher.d.ts.map +1 -1
  68. package/dist/cli/commands/ship/publisher.js +149 -6
  69. package/dist/cli/commands/ship/publisher.js.map +1 -1
  70. package/dist/cli/commands/ship/rules/quality-rules.d.ts +0 -1
  71. package/dist/cli/commands/ship/rules/quality-rules.d.ts.map +1 -1
  72. package/dist/cli/commands/ship/rules/quality-rules.js +4 -76
  73. package/dist/cli/commands/ship/rules/quality-rules.js.map +1 -1
  74. package/dist/cli/commands/workflow.js +4 -4
  75. package/dist/cli/commands/workflow.js.map +1 -1
  76. package/dist/cli/config-loader.d.ts +31 -0
  77. package/dist/cli/config-loader.d.ts.map +1 -0
  78. package/dist/cli/config-loader.js +235 -0
  79. package/dist/cli/config-loader.js.map +1 -0
  80. package/dist/cli/design-contract-loader.d.ts +15 -0
  81. package/dist/cli/design-contract-loader.d.ts.map +1 -0
  82. package/dist/cli/design-contract-loader.js +175 -0
  83. package/dist/cli/design-contract-loader.js.map +1 -0
  84. package/dist/cli/design-contract-schema.d.ts +11 -0
  85. package/dist/cli/design-contract-schema.d.ts.map +1 -0
  86. package/dist/cli/design-contract-schema.js +75 -0
  87. package/dist/cli/design-contract-schema.js.map +1 -0
  88. package/dist/cli/design-handoff-builder.d.ts +15 -0
  89. package/dist/cli/design-handoff-builder.d.ts.map +1 -0
  90. package/dist/cli/design-handoff-builder.js +345 -0
  91. package/dist/cli/design-handoff-builder.js.map +1 -0
  92. package/dist/cli/design-scope-resolver.d.ts +8 -0
  93. package/dist/cli/design-scope-resolver.d.ts.map +1 -0
  94. package/dist/cli/design-scope-resolver.js +712 -0
  95. package/dist/cli/design-scope-resolver.js.map +1 -0
  96. package/dist/cli/design-verification-builder.d.ts +8 -0
  97. package/dist/cli/design-verification-builder.d.ts.map +1 -0
  98. package/dist/cli/design-verification-builder.js +369 -0
  99. package/dist/cli/design-verification-builder.js.map +1 -0
  100. package/dist/cli/index.js +20 -63
  101. package/dist/cli/index.js.map +1 -1
  102. package/dist/cli/removed-commands.d.ts +9 -0
  103. package/dist/cli/removed-commands.d.ts.map +1 -0
  104. package/dist/cli/removed-commands.js +48 -0
  105. package/dist/cli/removed-commands.js.map +1 -0
  106. package/dist/cli/storage-runtime.d.ts +8 -0
  107. package/dist/cli/storage-runtime.d.ts.map +1 -0
  108. package/dist/cli/storage-runtime.js +14 -0
  109. package/dist/cli/storage-runtime.js.map +1 -0
  110. package/dist/cli/tree-sitter-check.d.ts.map +1 -1
  111. package/dist/cli/tree-sitter-check.js +0 -1
  112. package/dist/cli/tree-sitter-check.js.map +1 -1
  113. package/dist/cli-new/commands/export.d.ts.map +1 -1
  114. package/dist/cli-new/commands/export.js +2 -2
  115. package/dist/cli-new/commands/export.js.map +1 -1
  116. package/dist/cli-new/commands/query.d.ts.map +1 -1
  117. package/dist/cli-new/commands/query.js +5 -4
  118. package/dist/cli-new/commands/query.js.map +1 -1
  119. package/dist/cli-new/commands/server.d.ts.map +1 -1
  120. package/dist/cli-new/commands/server.js +2 -6
  121. package/dist/cli-new/commands/server.js.map +1 -1
  122. package/dist/cli-new/index.d.ts.map +1 -1
  123. package/dist/cli-new/index.js +0 -2
  124. package/dist/cli-new/index.js.map +1 -1
  125. package/dist/core/analyzer.d.ts.map +1 -1
  126. package/dist/core/analyzer.js +7 -39
  127. package/dist/core/analyzer.js.map +1 -1
  128. package/dist/core/file-discovery.d.ts +17 -0
  129. package/dist/core/file-discovery.d.ts.map +1 -0
  130. package/dist/core/file-discovery.js +75 -0
  131. package/dist/core/file-discovery.js.map +1 -0
  132. package/dist/core/global-index.d.ts +5 -0
  133. package/dist/core/global-index.d.ts.map +1 -1
  134. package/dist/core/global-index.js +71 -21
  135. package/dist/core/global-index.js.map +1 -1
  136. package/dist/generator/ai-overview.d.ts +51 -0
  137. package/dist/generator/ai-overview.d.ts.map +1 -0
  138. package/dist/generator/ai-overview.js +160 -0
  139. package/dist/generator/ai-overview.js.map +1 -0
  140. package/dist/generator/index.d.ts.map +1 -1
  141. package/dist/generator/index.js +8 -0
  142. package/dist/generator/index.js.map +1 -1
  143. package/dist/infrastructure/parser/implementations/GoParser.d.ts +2 -5
  144. package/dist/infrastructure/parser/implementations/GoParser.d.ts.map +1 -1
  145. package/dist/infrastructure/parser/implementations/GoParser.js +2 -5
  146. package/dist/infrastructure/parser/implementations/GoParser.js.map +1 -1
  147. package/dist/infrastructure/parser/implementations/PythonParser.d.ts +1 -5
  148. package/dist/infrastructure/parser/implementations/PythonParser.d.ts.map +1 -1
  149. package/dist/infrastructure/parser/implementations/PythonParser.js +1 -5
  150. package/dist/infrastructure/parser/implementations/PythonParser.js.map +1 -1
  151. package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts +1 -5
  152. package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts.map +1 -1
  153. package/dist/infrastructure/parser/implementations/TypeScriptParser.js +1 -5
  154. package/dist/infrastructure/parser/implementations/TypeScriptParser.js.map +1 -1
  155. package/dist/infrastructure/storage/StorageFactory.d.ts +12 -6
  156. package/dist/infrastructure/storage/StorageFactory.d.ts.map +1 -1
  157. package/dist/infrastructure/storage/StorageFactory.js +59 -43
  158. package/dist/infrastructure/storage/StorageFactory.js.map +1 -1
  159. package/dist/infrastructure/storage/adapters/FileSystemStorage.d.ts.map +1 -1
  160. package/dist/infrastructure/storage/adapters/FileSystemStorage.js +24 -137
  161. package/dist/infrastructure/storage/adapters/FileSystemStorage.js.map +1 -1
  162. package/dist/infrastructure/storage/adapters/KuzuDBStorage.d.ts +10 -18
  163. package/dist/infrastructure/storage/adapters/KuzuDBStorage.d.ts.map +1 -1
  164. package/dist/infrastructure/storage/adapters/KuzuDBStorage.js +103 -146
  165. package/dist/infrastructure/storage/adapters/KuzuDBStorage.js.map +1 -1
  166. package/dist/infrastructure/storage/adapters/MemoryStorage.d.ts +0 -1
  167. package/dist/infrastructure/storage/adapters/MemoryStorage.d.ts.map +1 -1
  168. package/dist/infrastructure/storage/adapters/MemoryStorage.js +16 -136
  169. package/dist/infrastructure/storage/adapters/MemoryStorage.js.map +1 -1
  170. package/dist/infrastructure/storage/adapters/Neo4jStorage.d.ts +9 -17
  171. package/dist/infrastructure/storage/adapters/Neo4jStorage.d.ts.map +1 -1
  172. package/dist/infrastructure/storage/adapters/Neo4jStorage.js +78 -138
  173. package/dist/infrastructure/storage/adapters/Neo4jStorage.js.map +1 -1
  174. package/dist/infrastructure/storage/graph-helpers.d.ts +16 -0
  175. package/dist/infrastructure/storage/graph-helpers.d.ts.map +1 -0
  176. package/dist/infrastructure/storage/graph-helpers.js +161 -0
  177. package/dist/infrastructure/storage/graph-helpers.js.map +1 -0
  178. package/dist/infrastructure/storage/index.d.ts.map +1 -1
  179. package/dist/interface/config/index.d.ts +10 -1
  180. package/dist/interface/config/index.d.ts.map +1 -1
  181. package/dist/interface/types/design-contract.d.ts +68 -0
  182. package/dist/interface/types/design-contract.d.ts.map +1 -0
  183. package/dist/interface/types/design-contract.js +7 -0
  184. package/dist/interface/types/design-contract.js.map +1 -0
  185. package/dist/interface/types/design-handoff.d.ts +68 -0
  186. package/dist/interface/types/design-handoff.d.ts.map +1 -0
  187. package/dist/interface/types/design-handoff.js +4 -0
  188. package/dist/interface/types/design-handoff.js.map +1 -0
  189. package/dist/interface/types/design-mapping.d.ts +51 -0
  190. package/dist/interface/types/design-mapping.d.ts.map +1 -0
  191. package/dist/interface/types/design-mapping.js +4 -0
  192. package/dist/interface/types/design-mapping.js.map +1 -0
  193. package/dist/interface/types/design-verification.d.ts +49 -0
  194. package/dist/interface/types/design-verification.d.ts.map +1 -0
  195. package/dist/interface/types/design-verification.js +4 -0
  196. package/dist/interface/types/design-verification.js.map +1 -0
  197. package/dist/interface/types/index.d.ts +17 -0
  198. package/dist/interface/types/index.d.ts.map +1 -1
  199. package/dist/interface/types/storage.d.ts +1 -4
  200. package/dist/interface/types/storage.d.ts.map +1 -1
  201. package/dist/orchestrator/ai-feed-generator.d.ts +210 -0
  202. package/dist/orchestrator/ai-feed-generator.d.ts.map +1 -0
  203. package/dist/orchestrator/ai-feed-generator.js +377 -0
  204. package/dist/orchestrator/ai-feed-generator.js.map +1 -0
  205. package/dist/orchestrator/confidence.d.ts +9 -9
  206. package/dist/orchestrator/confidence.d.ts.map +1 -1
  207. package/dist/orchestrator/confidence.js +44 -67
  208. package/dist/orchestrator/confidence.js.map +1 -1
  209. package/dist/orchestrator/file-header-scanner.d.ts.map +1 -1
  210. package/dist/orchestrator/file-header-scanner.js +22 -31
  211. package/dist/orchestrator/file-header-scanner.js.map +1 -1
  212. package/dist/orchestrator/intent-router.d.ts +2 -11
  213. package/dist/orchestrator/intent-router.d.ts.map +1 -1
  214. package/dist/orchestrator/intent-router.js +58 -49
  215. package/dist/orchestrator/intent-router.js.map +1 -1
  216. package/dist/orchestrator/tool-orchestrator.d.ts.map +1 -1
  217. package/dist/orchestrator/tool-orchestrator.js +6 -4
  218. package/dist/orchestrator/tool-orchestrator.js.map +1 -1
  219. package/dist/orchestrator/types.d.ts +113 -2
  220. package/dist/orchestrator/types.d.ts.map +1 -1
  221. package/dist/orchestrator/types.js +29 -0
  222. package/dist/orchestrator/types.js.map +1 -1
  223. package/dist/orchestrator/workflow/config.d.ts +4 -12
  224. package/dist/orchestrator/workflow/config.d.ts.map +1 -1
  225. package/dist/orchestrator/workflow/config.js +4 -6
  226. package/dist/orchestrator/workflow/config.js.map +1 -1
  227. package/dist/orchestrator/workflow/git-analyzer.d.ts.map +1 -1
  228. package/dist/orchestrator/workflow/git-analyzer.js +9 -19
  229. package/dist/orchestrator/workflow/git-analyzer.js.map +1 -1
  230. package/dist/orchestrator/workflow/phase-inheritance.d.ts.map +1 -1
  231. package/dist/orchestrator/workflow/phase-inheritance.js +14 -23
  232. package/dist/orchestrator/workflow/phase-inheritance.js.map +1 -1
  233. package/dist/orchestrator/workflow/result-fusion.d.ts.map +1 -1
  234. package/dist/orchestrator/workflow/result-fusion.js +9 -11
  235. package/dist/orchestrator/workflow/result-fusion.js.map +1 -1
  236. package/dist/orchestrator/workflow/templates.d.ts +4 -1
  237. package/dist/orchestrator/workflow/templates.d.ts.map +1 -1
  238. package/dist/orchestrator/workflow/templates.js +49 -207
  239. package/dist/orchestrator/workflow/templates.js.map +1 -1
  240. package/dist/orchestrator/workflow/test-linker.d.ts.map +1 -1
  241. package/dist/orchestrator/workflow/test-linker.js +12 -24
  242. package/dist/orchestrator/workflow/test-linker.js.map +1 -1
  243. package/dist/orchestrator/workflow/types.d.ts +11 -8
  244. package/dist/orchestrator/workflow/types.d.ts.map +1 -1
  245. package/dist/orchestrator/workflow/types.js +8 -1
  246. package/dist/orchestrator/workflow/types.js.map +1 -1
  247. package/dist/orchestrator/workflow/visualizer.d.ts.map +1 -1
  248. package/dist/orchestrator/workflow/visualizer.js +7 -9
  249. package/dist/orchestrator/workflow/visualizer.js.map +1 -1
  250. package/dist/orchestrator/workflow/workflow-context.d.ts.map +1 -1
  251. package/dist/orchestrator/workflow/workflow-context.js +3 -5
  252. package/dist/orchestrator/workflow/workflow-context.js.map +1 -1
  253. package/dist/orchestrator/workflow/workflow-orchestrator.d.ts +0 -4
  254. package/dist/orchestrator/workflow/workflow-orchestrator.d.ts.map +1 -1
  255. package/dist/orchestrator/workflow/workflow-orchestrator.js +7 -99
  256. package/dist/orchestrator/workflow/workflow-orchestrator.js.map +1 -1
  257. package/dist/parser/index.d.ts.map +1 -1
  258. package/dist/parser/index.js +2 -2
  259. package/dist/parser/index.js.map +1 -1
  260. package/dist/plugins/index.d.ts +5 -3
  261. package/dist/plugins/index.d.ts.map +1 -1
  262. package/dist/plugins/index.js +19 -8
  263. package/dist/plugins/index.js.map +1 -1
  264. package/dist/plugins/plugin-loader.d.ts +21 -6
  265. package/dist/plugins/plugin-loader.d.ts.map +1 -1
  266. package/dist/plugins/plugin-loader.js +170 -54
  267. package/dist/plugins/plugin-loader.js.map +1 -1
  268. package/dist/plugins/plugin-registry.d.ts +7 -4
  269. package/dist/plugins/plugin-registry.d.ts.map +1 -1
  270. package/dist/plugins/plugin-registry.js +62 -14
  271. package/dist/plugins/plugin-registry.js.map +1 -1
  272. package/dist/plugins/types.d.ts +16 -6
  273. package/dist/plugins/types.d.ts.map +1 -1
  274. package/dist/plugins/types.js +2 -0
  275. package/dist/plugins/types.js.map +1 -1
  276. package/dist/server/handlers/AnalysisHandler.d.ts +16 -2
  277. package/dist/server/handlers/AnalysisHandler.d.ts.map +1 -1
  278. package/dist/server/handlers/AnalysisHandler.js +31 -47
  279. package/dist/server/handlers/AnalysisHandler.js.map +1 -1
  280. package/dist/server/routes/api.d.ts.map +1 -1
  281. package/dist/server/routes/api.js +31 -12
  282. package/dist/server/routes/api.js.map +1 -1
  283. package/docs/AI_ASSISTANT_SETUP.md +3 -1
  284. package/docs/SETUP_GUIDE.md +41 -17
  285. package/docs/ai-guide/COMMANDS.md +179 -102
  286. package/docs/ai-guide/INTEGRATION.md +23 -21
  287. package/docs/ai-guide/OUTPUT.md +621 -10
  288. package/docs/ai-guide/PATTERNS.md +77 -18
  289. package/docs/ai-guide/PROMPTS.md +24 -18
  290. package/docs/ai-guide/QUICKSTART.md +35 -19
  291. package/docs/ai-guide/README.md +22 -4
  292. package/docs/archive/test-report-symbol-search.md +384 -0
  293. package/docs/archive/test-scenario-4-complexity-analysis.md +460 -0
  294. package/docs/archive/test_report_scenario5.md +615 -0
  295. package/docs/archive/test_scenario_3_impact_analysis_report.md +520 -0
  296. package/docs/product-specs/DESIGN_CONTRACT_TEMPLATE.md +79 -0
  297. package/docs/product-specs/MVP3-ARCHITECTURE-COMPARISON.md +159 -434
  298. package/docs/product-specs/MVP3-ARCHITECTURE-REDESIGN-PRD.md +169 -261
  299. package/docs/product-specs/MVP3-ARCHITECTURE-REDESIGN-TECH-PRD.md +201 -1259
  300. package/docs/product-specs/README.md +9 -1
  301. package/docs/rules/architecture-guardrails.md +1 -2
  302. package/docs/rules/engineering-with-codex-openai.md +20 -10
  303. package/docs/rules/validation.md +29 -4
  304. package/mycodemap.config.schema.json +76 -5
  305. package/package.json +1 -1
  306. package/scripts/experiments/arcadedb-http-smoke.mjs +90 -0
  307. package/scripts/sync-analyze-docs.js +500 -0
  308. package/scripts/validate-ai-docs.js +54 -1
  309. package/scripts/validate-docs.js +992 -25
@@ -102,14 +102,27 @@ mycodemap init -y
102
102
  {
103
103
  "$schema": "https://mycodemap.dev/schema/config.json",
104
104
  "mode": "hybrid",
105
- "include": ["src/**/*"],
105
+ "include": ["src/**/*.ts"],
106
106
  "exclude": [
107
107
  "node_modules/**",
108
108
  "dist/**",
109
+ "build/**",
110
+ "coverage/**",
109
111
  "**/*.test.ts",
110
- "**/*.spec.ts"
112
+ "**/*.spec.ts",
113
+ "**/*.d.ts"
111
114
  ],
112
- "output": ".mycodemap"
115
+ "output": ".mycodemap",
116
+ "watch": false,
117
+ "storage": {
118
+ "type": "filesystem",
119
+ "outputPath": ".codemap/storage"
120
+ },
121
+ "plugins": {
122
+ "builtInPlugins": true,
123
+ "plugins": [],
124
+ "debug": false
125
+ }
113
126
  }
114
127
  ```
115
128
 
@@ -118,9 +131,25 @@ mycodemap init -y
118
131
  | 配置项 | 类型 | 默认值 | 说明 |
119
132
  |--------|------|--------|------|
120
133
  | `mode` | string | `"hybrid"` | 分析模式:`fast`(快速正则)、`smart`(AST深度分析)、`hybrid`(自动选择) |
121
- | `include` | string[] | `["src/**/*"]` | 包含的文件 glob 模式 |
134
+ | `include` | string[] | `["src/**/*.ts"]` | 包含的文件 glob 模式 |
122
135
  | `exclude` | string[] | 见上 | 排除的文件 glob 模式 |
123
136
  | `output` | string | `".mycodemap"` | 输出目录路径 |
137
+ | `watch` | boolean | `false` | 监听模式预留配置 |
138
+ | `storage.type` | string | `"filesystem"` | 图存储后端类型:`filesystem` / `kuzudb` / `memory` / `auto` |
139
+ | `storage.outputPath` | string | `".codemap/storage"` | 文件系统存储目录 |
140
+ | `storage.databasePath` | string | - | KùzuDB 数据目录(相对项目根目录) |
141
+ | `plugins.builtInPlugins` | boolean | `true` | 是否启用内置插件 |
142
+ | `plugins.pluginDir` | string | - | 额外插件目录 |
143
+ | `plugins.plugins` | string[] | `[]` | 显式加载的插件名称列表 |
144
+ | `plugins.debug` | boolean | `false` | 是否输出插件调试日志 |
145
+
146
+ ### 图存储后端配置
147
+
148
+ - `generate` 会把 CodeGraph 写入 `storage` 指定的后端;`export json|graphml|dot` 会从同一后端读取。
149
+ - 选择 `kuzudb` 前先安装 `npm install kuzu`。
150
+ - 旧的 `neo4j` 配置已不再受支持,会返回显式迁移错误,不会静默 fallback 到 `filesystem`。
151
+ - 缺少依赖时会返回显式错误,不会静默 fallback 到 `filesystem`。
152
+ - `storage.type = "auto"` 当前仍保守使用 `filesystem`,阈值字段先作为配置契约保留。
124
153
 
125
154
  ---
126
155
 
@@ -243,21 +272,16 @@ mycodemap ci check-output-contract
243
272
  mycodemap ci check-commit-size
244
273
  ```
245
274
 
246
- ### 监听模式
275
+ ### 已移除的公共 CLI 命令
247
276
 
248
- ```bash
249
- # 前台监听
250
- mycodemap watch
251
-
252
- # 后台守护进程
253
- mycodemap watch -d
277
+ 以下命令已从 public CLI 移除;如果旧脚本仍在调用,请按下表迁移:
254
278
 
255
- # 查看状态
256
- mycodemap watch -t
257
-
258
- # 停止守护进程
259
- mycodemap watch -s
260
- ```
279
+ | 已移除命令 | 迁移方式 |
280
+ |------------|----------|
281
+ | `watch` | 改用一次性的 `mycodemap generate` 刷新代码地图 |
282
+ | `report` | 直接读取 `.mycodemap/AI_MAP.md`,或使用 `mycodemap export <format>` |
283
+ | `logs` | 直接读取 `.mycodemap/logs/` 下的日志文件 |
284
+ | `server` | 公共 CLI 已移除;`Server Layer` 仍是内部架构层,不等于公开 `mycodemap server` 命令 |
261
285
 
262
286
  ---
263
287
 
@@ -1,6 +1,9 @@
1
1
  # AI Guide - 命令参考
2
2
 
3
3
  > 完整的 CLI 命令详解
4
+ >
5
+ > CodeMap 是 AI-first 代码地图工具。以下文档记录当前公开命令,并补充已移除命令的迁移提示。
6
+ > 当前 CLI 过渡现实:多数命令显式使用 `--json` 输出机器可读结果;`analyze` 额外支持 `--output-mode machine|human`。
4
7
 
5
8
  ---
6
9
 
@@ -27,6 +30,17 @@ mycodemap generate --ai-context # 生成 AI 描述
27
30
  - `smart`: AST 分析,较慢,信息完整
28
31
  - `hybrid`: 自动选择,文件<50用fast,≥50用smart
29
32
 
33
+ **插件运行时说明**:
34
+ - `generate` 不提供独立 `--plugin` flags;插件通过 `mycodemap.config.json` 的 `plugins` 段声明。
35
+ - 只有显式存在 `plugins` 段时,`generate` 才会加载插件并运行 analyze / generate hooks。
36
+ - `AI_MAP.md` 会增加 `Plugin Summary`,`codemap.json` 会增加 `pluginReport`,stdout 会输出插件诊断摘要。
37
+
38
+ **图存储运行时说明**:
39
+ - `generate` 会读取 `mycodemap.config.json.storage`,并把 CodeGraph 写入所选后端。
40
+ - `storage.type` 支持 `filesystem`、`kuzudb`、`memory`、`auto`;默认是 `filesystem`。
41
+ - 旧的 `neo4j` 配置会直接报迁移错误;缺少 `kuzu` 时也会直接报错,不会静默 fallback 到 `filesystem`。
42
+ - `storage.type = "auto"` 当前仍保守走 `filesystem`;阈值字段是配置契约,不代表自动切换已完成。
43
+
30
44
  ---
31
45
 
32
46
  ### query - 查询代码
@@ -127,67 +141,149 @@ mycodemap cycles -j # JSON 输出
127
141
 
128
142
  ## analyze - 统一分析入口
129
143
 
130
- ### 8 种分析意图
131
-
132
- ```bash
133
- # 1. 影响分析
134
- mycodemap analyze -i impact -t "src/index.ts"
135
- mycodemap analyze -i impact -t "src/index.ts" --scope transitive
136
- mycodemap analyze -i impact -t "src/index.ts" --include-tests
137
-
138
- # 2. 依赖分析
139
- mycodemap analyze -i dependency -t "src/orchestrator"
140
-
141
- # 3. 复杂度分析
142
- mycodemap analyze -i complexity -t "src/domain"
143
-
144
- # 4. 搜索分析
145
- mycodemap analyze -i search -k "UnifiedResult"
146
- mycodemap analyze -i search -k "keyword" --topK 20
147
-
148
- # 5. 项目概览
149
- mycodemap analyze -i overview -t "src/"
150
-
151
- # 6. 重构建议
152
- mycodemap analyze -i refactor -t "src/cache"
144
+ ### 当前公共契约:4 种分析意图
153
145
 
154
- # 7. 引用查找
155
- mycodemap analyze -i reference -t "src/interface/types"
146
+ | 维度 | 当前公共契约 | 兼容说明 |
147
+ |------|--------------|----------|
148
+ | 输出契约 | 多数命令显式 `--json`,`analyze` 额外提供 `--output-mode machine|human` | `--structured --json` 会移除自然语言 `content` |
149
+ | analyze 意图 | `find` / `read` / `link` / `show` | legacy alias 会在输出中返回 `warnings[]`;`refactor` 直接报 `E0001_INVALID_INTENT` |
156
150
 
157
- # 8. 文档生成
158
- mycodemap analyze -i documentation -t "src/domain/services"
151
+ <!-- BEGIN GENERATED: analyze-commands-intents -->
152
+ ```bash
153
+ # 1. find - 查找符号 / 文本
154
+ mycodemap analyze -i find -k "UnifiedResult"
155
+ mycodemap analyze -i find -t "src/orchestrator" -k "IntentRouter" --topK 20
156
+
157
+ # 2. read - 阅读文件(影响 + 复杂度)
158
+ mycodemap analyze -i read -t "src/index.ts"
159
+ mycodemap analyze -i read -t "src/index.ts" --scope transitive
160
+ mycodemap analyze -i read -t "src/index.ts" --include-tests
161
+
162
+ # 3. link - 关联关系(依赖 + 引用)
163
+ mycodemap analyze -i link -t "src/orchestrator"
164
+ mycodemap analyze -i link -t "src/interface/types.ts" --json
165
+
166
+ # 4. show - 模块概览 / 文档
167
+ mycodemap analyze -i show -t "src/"
168
+ mycodemap analyze -i show -t "src/domain/services" --output-mode human
159
169
  ```
170
+ <!-- END GENERATED: analyze-commands-intents -->
160
171
 
161
172
  ### 输出选项
162
173
 
174
+ <!-- BEGIN GENERATED: analyze-commands-output -->
163
175
  ```bash
164
176
  # JSON 输出
165
- mycodemap analyze -i impact -t "src/index.ts" --json
177
+ mycodemap analyze -i read -t "src/index.ts" --json
166
178
 
167
179
  # 纯结构化(移除自然语言字段)
168
- mycodemap analyze -i impact -t "src/index.ts" --structured --json
180
+ mycodemap analyze -i link -t "src/index.ts" --structured --json
169
181
 
170
182
  # 机器可读模式
171
- mycodemap analyze -i impact -t "src/index.ts" --output-mode machine
183
+ mycodemap analyze -i show -t "src/index.ts" --output-mode machine
172
184
 
173
- # 人类可读模式(默认)
174
- mycodemap analyze -i impact -t "src/index.ts" --output-mode human
185
+ # 人类可读模式
186
+ mycodemap analyze -i show -t "src/index.ts" --output-mode human
175
187
  ```
188
+ <!-- END GENERATED: analyze-commands-output -->
176
189
 
177
190
  ### 通用选项
178
191
 
192
+ <!-- BEGIN GENERATED: analyze-commands-options -->
179
193
  | 选项 | 说明 | 默认值 |
180
194
  |------|------|--------|
181
- | `-i, --intent <type>` | 分析类型 | `impact` |
182
- | `-t, --targets <paths...>` | 目标路径(必填) | - |
183
- | `-k, --keywords <words...>` | 搜索关键词 | - |
184
- | `-s, --scope <scope>` | 范围: direct/transitive | `direct` |
195
+ | `-i, --intent <type>` | 分析类型:`find`/`read`/`link`/`show`(必填) | - |
196
+ | `-t, --targets <paths...>` | 目标路径(`read`/`link`/`show` 必填,`find` 可选) | - |
197
+ | `-k, --keywords <words...>` | 搜索关键词(主要用于 `find`) | - |
198
+ | `-s, --scope <scope>` | 范围:`direct`(直接)/`transitive`(传递) | `direct` |
185
199
  | `-n, --topK <number>` | 返回结果数量 | `8` |
186
200
  | `--include-tests` | 包含测试文件关联 | - |
187
- | `--include-git-history` | 包含 Git 历史 | - |
201
+ | `--include-git-history` | 包含 Git 历史分析 | - |
188
202
  | `--json` | JSON 格式输出 | - |
189
- | `--structured` | 纯结构化输出 | - |
190
- | `--output-mode <mode>` | 输出模式: machine/human | `human` |
203
+ | `--structured` | 纯结构化输出(移除自然语言字段,配合 `--json` 使用) | - |
204
+ | `--output-mode <mode>` | 输出模式:`machine`/`human` | `human` |
205
+ <!-- END GENERATED: analyze-commands-options -->
206
+
207
+ ### legacy 兼容映射
208
+
209
+ - `search` → `find`
210
+ - `impact` / `complexity` → `read`
211
+ - `dependency` / `reference` → `link`
212
+ - `overview` / `documentation` → `show`
213
+ - `refactor` → `E0001_INVALID_INTENT`
214
+
215
+ ---
216
+
217
+ ## design - 设计契约输入、范围映射与验证
218
+
219
+ > `design` 为 human-authored design contract 提供正式输入面。默认文件名是 `mycodemap.design.md`,canonical 模板位于 `docs/product-specs/DESIGN_CONTRACT_TEMPLATE.md`。
220
+
221
+ ### validate
222
+
223
+ ```bash
224
+ # 使用默认文件名
225
+ mycodemap design validate mycodemap.design.md --json
226
+
227
+ # 显式指定文件
228
+ mycodemap design validate docs/designs/login.design.md
229
+ ```
230
+
231
+ ### 必填 sections
232
+
233
+ | Section | 作用 |
234
+ |---------|------|
235
+ | `Goal` | 定义本次要达成的结果 |
236
+ | `Constraints` | 定义边界、兼容性和约束 |
237
+ | `Acceptance Criteria` | 定义可验证的成功标准 |
238
+ | `Non-Goals` | 明确本次不做什么,防止 scope drift |
239
+
240
+ ### 输出与失败语义
241
+
242
+ - `--json` 输出纯结构化 diagnostics
243
+ - 缺失必填 section、重复 section、空 section、未知 heading 都会被显式报告
244
+ - blocker diagnostics 存在时命令返回非零 exit code
245
+
246
+ ### map
247
+
248
+ ```bash
249
+ # 先校验,再映射 candidate scope
250
+ mycodemap design validate mycodemap.design.md --json
251
+ mycodemap design map mycodemap.design.md --json
252
+ ```
253
+
254
+ - `design map` 返回 `summary`、`candidates`、`diagnostics`、`unknowns`
255
+ - `candidates[]` 会同时暴露 `kind`、`path`、`reasons`、`dependencies`、`testImpact`、`risk`、`confidence`
256
+ - blocker diagnostics 包括 `no-candidates`、`over-broad-scope`、`high-risk-scope`
257
+ - 若 diagnostics 中存在 blocker,命令返回非零 exit code
258
+
259
+ ### handoff
260
+
261
+ ```bash
262
+ # 先固定 design input / scope,再生成 handoff package
263
+ mycodemap design validate mycodemap.design.md --json
264
+ mycodemap design map mycodemap.design.md --json
265
+ mycodemap design handoff mycodemap.design.md --json
266
+ ```
267
+
268
+ - `design handoff` 返回 `readyForExecution`、`approvals`、`assumptions`、`openQuestions`
269
+ - human mode 默认写入 `.mycodemap/handoffs/{stem}.handoff.md|json`
270
+ - `--json` 保持纯 JSON,不混入 prose
271
+ - review-needed 通过 `readyForExecution=false` 表达;只有 blocker diagnostics 才返回非零 exit code
272
+
273
+ ### verify
274
+
275
+ ```bash
276
+ # 使用 reviewed handoff truth 做 checklist / drift 校验
277
+ mycodemap design validate mycodemap.design.md --json
278
+ mycodemap design map mycodemap.design.md --json
279
+ mycodemap design handoff mycodemap.design.md --json
280
+ mycodemap design verify mycodemap.design.md --json
281
+ ```
282
+
283
+ - `design verify` 返回 `summary`、`checklist`、`drift`、`diagnostics`
284
+ - `checklist[]` 直接来自 `Acceptance Criteria`,并保留 `status` + `evidenceRefs`
285
+ - `drift[]` 至少区分 `scope-extra`、`acceptance-unverified`、`handoff-missing`
286
+ - review-needed 通过 `readyForExecution=false` + warning diagnostics 表达;只有 `ok=false` 或 blocker diagnostics 才返回非零 exit code
191
287
 
192
288
  ---
193
289
 
@@ -196,6 +292,16 @@ mycodemap analyze -i impact -t "src/index.ts" --output-mode human
196
292
  ### 子命令
197
293
 
198
294
  ```bash
295
+ # 验证工作区是否干净
296
+ mycodemap ci check-working-tree
297
+
298
+ # 验证当前分支是否允许执行发布前检查
299
+ mycodemap ci check-branch
300
+ mycodemap ci check-branch --allow "main,release/*"
301
+
302
+ # 运行发布前脚本集合
303
+ mycodemap ci check-scripts
304
+
199
305
  # 验证提交格式([TAG] scope: message)
200
306
  mycodemap ci check-commits
201
307
  mycodemap ci check-commits -c 5 # 最近 5 个提交
@@ -215,6 +321,8 @@ mycodemap ci assess-risk -f "changed.ts"
215
321
  mycodemap ci check-docs-sync
216
322
  mycodemap ci check-docs-sync --root "/path"
217
323
 
324
+ > `ci check-docs-sync` 会串联 `scripts/validate-docs.js` 与 `scripts/sync-analyze-docs.js --check`,同时校验文档护栏和 analyze generated block。
325
+
218
326
  # 验证输出契约
219
327
  mycodemap ci check-output-contract
220
328
  mycodemap ci check-output-contract -s v1.0.0 -k 8 -t 160
@@ -224,13 +332,27 @@ mycodemap ci check-commit-size
224
332
  mycodemap ci check-commit-size -m 15
225
333
  ```
226
334
 
335
+ > `ship` 的 CHECK 阶段会复用 `ci check-working-tree`、`ci check-branch`、`ci check-scripts` 这三条发布前 gate checks。
336
+ > `ci check-branch --allow` 支持 `*` 通配;`ci check-headers -d` 与 `generate` / `analyze` 共享同一套 `.gitignore` 感知排除规则,在没有 `.gitignore` 时回退到默认 `exclude`。
337
+
227
338
  ### 支持的提交 TAG
228
339
 
229
340
  `[REFACTOR]`, `[TEST]`, `[DOCS]`, `[FEAT]`, `[FIX]`, `[CHORE]`, `[PERF]`, `[SECURITY]`, `[BREAKING]`, `[HOTFIX]`, `[MIGRATION]`, `[WIP]`
230
341
 
231
342
  ---
232
343
 
233
- ## workflow - 工作流编排
344
+ ## workflow - 分析型工作流编排
345
+
346
+ > `workflow` 只保留 `find → read → link → show` 四个分析阶段;代码实现、commit 检查与 CI 运行不再作为 workflow phase 建模。
347
+
348
+ ### 阶段模型
349
+
350
+ | 阶段 | 对应 analyze 意图 | 用途 |
351
+ |------|-------------------|------|
352
+ | `find` | `analyze -i find` | 查找候选符号、文件与关键词线索 |
353
+ | `read` | `analyze -i read` | 阅读影响范围、复杂度与上下文 |
354
+ | `link` | `analyze -i link` | 汇总依赖、引用与关联关系 |
355
+ | `show` | `analyze -i show` | 生成概览、摘要与展示型结果 |
234
356
 
235
357
  ### 生命周期管理
236
358
 
@@ -280,71 +402,20 @@ mycodemap workflow template recommend "任务" # 推荐模板
280
402
  - `feature` - 新功能开发
281
403
  - `hotfix` - 紧急修复
282
404
 
283
- ---
284
-
285
- ## server - HTTP 服务器
286
-
287
- ```bash
288
- mycodemap server # 默认端口 3000
289
- mycodemap server -p 8080 # 指定端口
290
- mycodemap server -h 127.0.0.1 # 指定主机
291
- mycodemap server --cors # 启用 CORS
292
- mycodemap server --open # 自动打开浏览器
293
- ```
294
-
295
- | 选项 | 说明 | 默认值 |
296
- |------|------|--------|
297
- | `-p, --port <number>` | 服务器端口 | `3000` |
298
- | `-h, --host <string>` | 服务器主机 | `0.0.0.0` |
299
- | `--cors` | 启用 CORS | `false` |
300
- | `--open` | 自动打开浏览器 | `false` |
301
-
302
- ### API 端点
303
-
304
- | 方法 | 端点 | 说明 |
305
- |------|------|------|
306
- | GET | `/api/v1/health` | 健康检查 |
307
- | GET | `/api/v1/stats` | 项目统计 |
308
- | GET | `/api/v1/search/symbols?q=` | 符号搜索 |
309
- | GET | `/api/v1/modules/:id` | 模块详情 |
310
- | GET | `/api/v1/symbols/:id` | 符号详情 |
311
- | POST | `/api/v1/analysis/impact` | 影响分析 |
312
- | GET | `/api/v1/analysis/cycles` | 循环依赖检测 |
313
- | GET | `/api/v1/graph` | 依赖图数据 |
314
- | GET | `/api/v1/export/:format` | 数据导出 |
405
+ > 所有内置模板复用同一 4 阶段顺序,只调整描述与阶段阈值。
315
406
 
316
407
  ---
317
408
 
318
- ## 其他命令
409
+ ## 已移除的公共命令
319
410
 
320
- ### watch - 监听模式
411
+ 以下命令已从 public CLI 移除;直接调用时,CLI 会显式失败并给出迁移提示,而不是继续执行旧功能。
321
412
 
322
- ```bash
323
- mycodemap watch # 前台监听
324
- mycodemap watch -d # 后台守护进程
325
- mycodemap watch -s # 停止守护进程
326
- mycodemap watch -t # 查看状态
327
- mycodemap watch -m smart # 指定模式
328
- ```
329
-
330
- ### report - 生成报告
331
-
332
- ```bash
333
- mycodemap report # 最近 7 天
334
- mycodemap report -d 14 # 最近 14 天
335
- mycodemap report -o ./reports # 输出目录
336
- mycodemap report -j # JSON 输出
337
- ```
338
-
339
- ### logs - 日志管理
340
-
341
- ```bash
342
- mycodemap logs list # 列出日志
343
- mycodemap logs list -l 20 # 限制 20 条
344
- mycodemap logs list --level ERROR # 仅错误
345
- mycodemap logs export -d 30 # 导出 30 天
346
- mycodemap logs clear -d 30 --confirm # 清理 30 天前
347
- ```
413
+ | 命令 | 当前状态 | 迁移方式 |
414
+ |------|----------|----------|
415
+ | `server` | 已从 public CLI 移除 | `Server Layer` 仍是内部架构层,不等于公开 `mycodemap server` 命令 |
416
+ | `watch` | 已从 public CLI 移除 | 改用一次性的 `mycodemap generate` 刷新代码地图 |
417
+ | `report` | 已从 public CLI 移除 | 直接读取 `.mycodemap/AI_MAP.md`,或使用 `mycodemap export <format>` |
418
+ | `logs` | 已从 public CLI 移除 | 直接读取 `.mycodemap/logs/` 下的日志文件 |
348
419
 
349
420
  ### export - 导出代码图
350
421
 
@@ -356,9 +427,15 @@ mycodemap export mermaid # Mermaid 语法
356
427
  mycodemap export json -o ./output.json # 指定输出
357
428
  ```
358
429
 
430
+ - `export json|graphml|dot` 会从 `mycodemap.config.json.storage` 指定的后端读取 CodeGraph。
431
+ - `export mermaid` 仍直接读取 `.mycodemap/codemap.json`,这是当前保留的文件出口,不代表 graph backend 未接入主路径。
432
+ - 图存储后端收口不等于重新开放公共 `mycodemap server` 产品面;`Server Layer` 仍是内部层。
433
+
359
434
  ---
360
435
 
361
- ### ship - 一键智能发布
436
+ ### ship - 一键智能发布(非代码地图首屏能力)
437
+
438
+ > `ship` 负责发布整合,不是 AI-first 代码地图工具的首屏入口;首次接触项目时优先使用分析命令而非发布命令。
362
439
 
363
440
  ```bash
364
441
  mycodemap ship # 完整发布流程
@@ -388,7 +465,7 @@ mycodemap ship --yes # 置信度 60-75 时自动确认
388
465
  **前置条件:**
389
466
  - 工作区干净
390
467
  - 在 main/master 分支
391
- - 所有检查通过
468
+ - 所有检查通过(由 `ci check-working-tree`、`ci check-branch`、`ci check-scripts` 统一提供)
392
469
 
393
470
  ---
394
471
 
@@ -28,17 +28,17 @@
28
28
  }
29
29
  },
30
30
  {
31
- "name": "codemap_analyze_impact",
31
+ "name": "codemap_read",
32
32
  "description": "分析文件变更的影响范围",
33
- "command": "mycodemap analyze -i impact -t {target} --json",
33
+ "command": "mycodemap analyze -i read -t {target} --scope transitive --json",
34
34
  "parameters": {
35
35
  "target": { "type": "string", "description": "目标文件路径" }
36
36
  }
37
37
  },
38
38
  {
39
- "name": "codemap_search",
39
+ "name": "codemap_find",
40
40
  "description": "搜索与关键词相关的代码",
41
- "command": "mycodemap analyze -i search -k {keyword} --json",
41
+ "command": "mycodemap analyze -i find -k {keyword} --json",
42
42
  "parameters": {
43
43
  "keyword": { "type": "string", "description": "搜索关键词" }
44
44
  }
@@ -99,12 +99,12 @@ fi
99
99
 
100
100
  3. **分析变更影响**
101
101
  ```bash
102
- $CODEMAP analyze -i impact -t "file.ts" --transitive --json
102
+ $CODEMAP analyze -i read -t "file.ts" --scope transitive --json
103
103
  ```
104
104
 
105
105
  4. **搜索代码**
106
106
  ```bash
107
- $CODEMAP analyze -i search -k "keyword" --json
107
+ $CODEMAP analyze -i find -k "keyword" --json
108
108
  ```
109
109
 
110
110
  ## 完整文档
@@ -135,20 +135,20 @@ mycodemap query -s "SymbolName" -j
135
135
 
136
136
  ### Analyze Impact
137
137
  ```bash
138
- mycodemap analyze -i impact -t "file.ts" --transitive --json
138
+ mycodemap analyze -i read -t "file.ts" --scope transitive --json
139
139
  ```
140
140
 
141
141
  ### Search Code
142
142
  ```bash
143
- mycodemap analyze -i search -k "keyword" --json
143
+ mycodemap analyze -i find -k "keyword" --json
144
144
  ```
145
145
 
146
146
  ## Decision Tree
147
147
 
148
148
  1. Understanding project structure → `generate` + read `AI_MAP.md`
149
149
  2. Finding symbol location → `query -s`
150
- 3. Assessing change impact → `analyze -i impact`
151
- 4. Searching related code → `analyze -i search`
150
+ 3. Assessing change impact → `analyze -i read`
151
+ 4. Searching related code → `analyze -i find`
152
152
 
153
153
  ## Reference
154
154
 
@@ -168,15 +168,15 @@ Code analysis tool for TypeScript projects.
168
168
 
169
169
  - `codemap_generate`: Generate code map
170
170
  - `codemap_query`: Query symbols
171
- - `codemap_impact`: Analyze change impact
172
- - `codemap_search`: Search code
171
+ - `codemap_read`: Analyze change impact and surrounding context
172
+ - `codemap_find`: Search code
173
173
 
174
174
  ## Workflow
175
175
 
176
176
  1. Always start with `codemap_generate`
177
177
  2. Use `codemap_query` to find definitions
178
- 3. Use `codemap_impact` before making changes
179
- 4. Use `codemap_search` to find related code
178
+ 3. Use `codemap_read` before making changes
179
+ 4. Use `codemap_find` to find related code
180
180
 
181
181
  ## Documentation
182
182
 
@@ -199,6 +199,8 @@ Full guide: `AI_GUIDE.md`
199
199
  | `提交格式错误` | 不符合 [TAG] 格式 | 修改为 `[TAG] scope: message` |
200
200
  | `风险评分过高` | 变更文件太多 | 拆分提交或添加解释 |
201
201
  | `输出契约验证失败` | analyze 输出格式变更 | 检查 schemaVersion 和字段 |
202
+ | `pluginReport.diagnostics` 出现 `initialize` / `generate` 错误 | 插件加载或执行失败 | 检查 `mycodemap.config.json` 的 `plugins` 段、插件导出格式和生成路径 |
203
+ | `UNSUPPORTED_STORAGE_TYPE` / `ADAPTER_NOT_AVAILABLE` / `KUZU_INIT_FAILED` | 图存储后端配置不受支持或缺少依赖 | 检查 `mycodemap.config.json.storage`,确认未继续使用 `neo4j`,并安装 `kuzu` |
202
204
 
203
205
  ---
204
206
 
@@ -249,7 +251,7 @@ async function findSymbol(symbolName: string): Promise<any[]> {
249
251
 
250
252
  // 尝试 3: 统一搜索
251
253
  console.log('模糊搜索无结果,尝试统一搜索...');
252
- result = await exec(`mycodemap analyze -i search -k "${symbolName}" --topK 20 --json`);
254
+ result = await exec(`mycodemap analyze -i find -k "${symbolName}" --topK 20 --json`);
253
255
  data = JSON.parse(result);
254
256
 
255
257
  return data.results || [];
@@ -277,12 +279,12 @@ async function analyzeImpact(file: string, maxFiles: number = 50): Promise<any>
277
279
 
278
280
  // 模式 4: 置信度太低,扩大搜索
279
281
  async function searchWithFallback(keyword: string): Promise<any[]> {
280
- let result = await exec(`mycodemap analyze -i search -k "${keyword}" --topK 8 --json`);
282
+ let result = await exec(`mycodemap analyze -i find -k "${keyword}" --topK 8 --json`);
281
283
  let data = JSON.parse(result);
282
284
 
283
285
  if (data.confidence?.level === 'low') {
284
286
  console.log('置信度较低,扩大搜索范围...');
285
- result = await exec(`mycodemap analyze -i search -k "${keyword}" --topK 20 --json`);
287
+ result = await exec(`mycodemap analyze -i find -k "${keyword}" --topK 20 --json`);
286
288
  data = JSON.parse(result);
287
289
  }
288
290
 
@@ -352,7 +354,7 @@ def find_symbol(symbol_name: str) -> List[Dict[str, Any]]:
352
354
  # 尝试 3: 统一搜索
353
355
  print('模糊搜索无结果,尝试统一搜索...')
354
356
  result = subprocess.run(
355
- ['mycodemap', 'analyze', '-i', 'search', '-k', symbol_name, '--topK', '20', '--json'],
357
+ ['mycodemap', 'analyze', '-i', 'find', '-k', symbol_name, '--topK', '20', '--json'],
356
358
  capture_output=True, text=True
357
359
  )
358
360
  data = json.loads(result.stdout)
@@ -381,7 +383,7 @@ async function handleLargeProject() {
381
383
  // 分块查询
382
384
  const modules = ['src/cli', 'src/core', 'src/domain'];
383
385
  for (const module of modules) {
384
- await exec(`mycodemap analyze -i overview -t "${module}" --json`);
386
+ await exec(`mycodemap analyze -i show -t "${module}" --json`);
385
387
  }
386
388
  }
387
389
 
@@ -508,6 +510,6 @@ npm rebuild
508
510
  # 强制重新生成
509
511
  mycodemap generate --force
510
512
 
511
- # 或使用 watch 模式自动更新
512
- mycodemap watch
513
+ # 或重新运行一次 generate 刷新输出
514
+ mycodemap generate
513
515
  ```