@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.
- package/CHANGELOG.md +100 -0
- package/README.md +307 -243
- 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/cli/commands/analyze-options.d.ts +36 -0
- package/dist/cli/commands/analyze-options.d.ts.map +1 -0
- package/dist/cli/commands/analyze-options.js +147 -0
- package/dist/cli/commands/analyze-options.js.map +1 -0
- package/dist/cli/commands/analyze.d.ts +93 -4
- package/dist/cli/commands/analyze.d.ts.map +1 -1
- package/dist/cli/commands/analyze.js +592 -176
- package/dist/cli/commands/analyze.js.map +1 -1
- package/dist/cli/commands/ci.d.ts +47 -1
- package/dist/cli/commands/ci.d.ts.map +1 -1
- package/dist/cli/commands/ci.js +208 -1
- package/dist/cli/commands/ci.js.map +1 -1
- package/dist/cli/commands/design.d.ts +47 -0
- package/dist/cli/commands/design.d.ts.map +1 -0
- package/dist/cli/commands/design.js +268 -0
- package/dist/cli/commands/design.js.map +1 -0
- package/dist/cli/commands/export.d.ts.map +1 -1
- package/dist/cli/commands/export.js +2 -2
- package/dist/cli/commands/export.js.map +1 -1
- package/dist/cli/commands/generate.d.ts +8 -2
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +151 -22
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +2 -13
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/server.d.ts.map +1 -1
- package/dist/cli/commands/server.js +2 -5
- package/dist/cli/commands/server.js.map +1 -1
- package/dist/cli/commands/ship/checker.d.ts.map +1 -1
- package/dist/cli/commands/ship/checker.js +0 -3
- package/dist/cli/commands/ship/checker.js.map +1 -1
- package/dist/cli/commands/ship/pipeline.d.ts.map +1 -1
- package/dist/cli/commands/ship/pipeline.js +8 -1
- package/dist/cli/commands/ship/pipeline.js.map +1 -1
- package/dist/cli/commands/ship/publisher.d.ts +9 -1
- package/dist/cli/commands/ship/publisher.d.ts.map +1 -1
- package/dist/cli/commands/ship/publisher.js +149 -6
- package/dist/cli/commands/ship/publisher.js.map +1 -1
- package/dist/cli/commands/ship/rules/quality-rules.d.ts +0 -1
- package/dist/cli/commands/ship/rules/quality-rules.d.ts.map +1 -1
- package/dist/cli/commands/ship/rules/quality-rules.js +4 -76
- package/dist/cli/commands/ship/rules/quality-rules.js.map +1 -1
- package/dist/cli/commands/workflow.js +4 -4
- package/dist/cli/commands/workflow.js.map +1 -1
- package/dist/cli/config-loader.d.ts +31 -0
- package/dist/cli/config-loader.d.ts.map +1 -0
- package/dist/cli/config-loader.js +235 -0
- package/dist/cli/config-loader.js.map +1 -0
- package/dist/cli/design-contract-loader.d.ts +15 -0
- package/dist/cli/design-contract-loader.d.ts.map +1 -0
- package/dist/cli/design-contract-loader.js +175 -0
- package/dist/cli/design-contract-loader.js.map +1 -0
- package/dist/cli/design-contract-schema.d.ts +11 -0
- package/dist/cli/design-contract-schema.d.ts.map +1 -0
- package/dist/cli/design-contract-schema.js +75 -0
- package/dist/cli/design-contract-schema.js.map +1 -0
- package/dist/cli/design-handoff-builder.d.ts +15 -0
- package/dist/cli/design-handoff-builder.d.ts.map +1 -0
- package/dist/cli/design-handoff-builder.js +345 -0
- package/dist/cli/design-handoff-builder.js.map +1 -0
- package/dist/cli/design-scope-resolver.d.ts +8 -0
- package/dist/cli/design-scope-resolver.d.ts.map +1 -0
- package/dist/cli/design-scope-resolver.js +712 -0
- package/dist/cli/design-scope-resolver.js.map +1 -0
- package/dist/cli/design-verification-builder.d.ts +8 -0
- package/dist/cli/design-verification-builder.d.ts.map +1 -0
- package/dist/cli/design-verification-builder.js +369 -0
- package/dist/cli/design-verification-builder.js.map +1 -0
- package/dist/cli/index.js +20 -63
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/removed-commands.d.ts +9 -0
- package/dist/cli/removed-commands.d.ts.map +1 -0
- package/dist/cli/removed-commands.js +48 -0
- package/dist/cli/removed-commands.js.map +1 -0
- package/dist/cli/storage-runtime.d.ts +8 -0
- package/dist/cli/storage-runtime.d.ts.map +1 -0
- package/dist/cli/storage-runtime.js +14 -0
- package/dist/cli/storage-runtime.js.map +1 -0
- package/dist/cli/tree-sitter-check.d.ts.map +1 -1
- package/dist/cli/tree-sitter-check.js +0 -1
- package/dist/cli/tree-sitter-check.js.map +1 -1
- package/dist/cli-new/commands/export.d.ts.map +1 -1
- package/dist/cli-new/commands/export.js +2 -2
- package/dist/cli-new/commands/export.js.map +1 -1
- package/dist/cli-new/commands/query.d.ts.map +1 -1
- package/dist/cli-new/commands/query.js +5 -4
- package/dist/cli-new/commands/query.js.map +1 -1
- package/dist/cli-new/commands/server.d.ts.map +1 -1
- package/dist/cli-new/commands/server.js +2 -6
- package/dist/cli-new/commands/server.js.map +1 -1
- package/dist/cli-new/index.d.ts.map +1 -1
- package/dist/cli-new/index.js +0 -2
- package/dist/cli-new/index.js.map +1 -1
- package/dist/core/analyzer.d.ts.map +1 -1
- package/dist/core/analyzer.js +7 -39
- package/dist/core/analyzer.js.map +1 -1
- package/dist/core/file-discovery.d.ts +17 -0
- package/dist/core/file-discovery.d.ts.map +1 -0
- package/dist/core/file-discovery.js +75 -0
- package/dist/core/file-discovery.js.map +1 -0
- package/dist/core/global-index.d.ts +5 -0
- package/dist/core/global-index.d.ts.map +1 -1
- package/dist/core/global-index.js +71 -21
- package/dist/core/global-index.js.map +1 -1
- 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/index.d.ts.map +1 -1
- package/dist/generator/index.js +8 -0
- package/dist/generator/index.js.map +1 -1
- package/dist/infrastructure/parser/implementations/GoParser.d.ts +2 -5
- package/dist/infrastructure/parser/implementations/GoParser.d.ts.map +1 -1
- package/dist/infrastructure/parser/implementations/GoParser.js +2 -5
- package/dist/infrastructure/parser/implementations/GoParser.js.map +1 -1
- package/dist/infrastructure/parser/implementations/PythonParser.d.ts +1 -5
- package/dist/infrastructure/parser/implementations/PythonParser.d.ts.map +1 -1
- package/dist/infrastructure/parser/implementations/PythonParser.js +1 -5
- package/dist/infrastructure/parser/implementations/PythonParser.js.map +1 -1
- package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts +1 -5
- package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts.map +1 -1
- package/dist/infrastructure/parser/implementations/TypeScriptParser.js +1 -5
- package/dist/infrastructure/parser/implementations/TypeScriptParser.js.map +1 -1
- package/dist/infrastructure/storage/StorageFactory.d.ts +12 -6
- package/dist/infrastructure/storage/StorageFactory.d.ts.map +1 -1
- package/dist/infrastructure/storage/StorageFactory.js +59 -43
- package/dist/infrastructure/storage/StorageFactory.js.map +1 -1
- package/dist/infrastructure/storage/adapters/FileSystemStorage.d.ts.map +1 -1
- package/dist/infrastructure/storage/adapters/FileSystemStorage.js +24 -137
- package/dist/infrastructure/storage/adapters/FileSystemStorage.js.map +1 -1
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.d.ts +10 -18
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.d.ts.map +1 -1
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.js +103 -146
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.js.map +1 -1
- package/dist/infrastructure/storage/adapters/MemoryStorage.d.ts +0 -1
- package/dist/infrastructure/storage/adapters/MemoryStorage.d.ts.map +1 -1
- package/dist/infrastructure/storage/adapters/MemoryStorage.js +16 -136
- package/dist/infrastructure/storage/adapters/MemoryStorage.js.map +1 -1
- package/dist/infrastructure/storage/adapters/Neo4jStorage.d.ts +9 -17
- package/dist/infrastructure/storage/adapters/Neo4jStorage.d.ts.map +1 -1
- package/dist/infrastructure/storage/adapters/Neo4jStorage.js +78 -138
- package/dist/infrastructure/storage/adapters/Neo4jStorage.js.map +1 -1
- package/dist/infrastructure/storage/graph-helpers.d.ts +16 -0
- package/dist/infrastructure/storage/graph-helpers.d.ts.map +1 -0
- package/dist/infrastructure/storage/graph-helpers.js +161 -0
- package/dist/infrastructure/storage/graph-helpers.js.map +1 -0
- package/dist/infrastructure/storage/index.d.ts.map +1 -1
- package/dist/interface/config/index.d.ts +10 -1
- package/dist/interface/config/index.d.ts.map +1 -1
- package/dist/interface/types/design-contract.d.ts +68 -0
- package/dist/interface/types/design-contract.d.ts.map +1 -0
- package/dist/interface/types/design-contract.js +7 -0
- package/dist/interface/types/design-contract.js.map +1 -0
- package/dist/interface/types/design-handoff.d.ts +68 -0
- package/dist/interface/types/design-handoff.d.ts.map +1 -0
- package/dist/interface/types/design-handoff.js +4 -0
- package/dist/interface/types/design-handoff.js.map +1 -0
- package/dist/interface/types/design-mapping.d.ts +51 -0
- package/dist/interface/types/design-mapping.d.ts.map +1 -0
- package/dist/interface/types/design-mapping.js +4 -0
- package/dist/interface/types/design-mapping.js.map +1 -0
- package/dist/interface/types/design-verification.d.ts +49 -0
- package/dist/interface/types/design-verification.d.ts.map +1 -0
- package/dist/interface/types/design-verification.js +4 -0
- package/dist/interface/types/design-verification.js.map +1 -0
- package/dist/interface/types/index.d.ts +17 -0
- package/dist/interface/types/index.d.ts.map +1 -1
- package/dist/interface/types/storage.d.ts +1 -4
- package/dist/interface/types/storage.d.ts.map +1 -1
- 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/confidence.d.ts +9 -9
- package/dist/orchestrator/confidence.d.ts.map +1 -1
- package/dist/orchestrator/confidence.js +44 -67
- package/dist/orchestrator/confidence.js.map +1 -1
- package/dist/orchestrator/file-header-scanner.d.ts.map +1 -1
- package/dist/orchestrator/file-header-scanner.js +22 -31
- package/dist/orchestrator/file-header-scanner.js.map +1 -1
- package/dist/orchestrator/intent-router.d.ts +2 -11
- package/dist/orchestrator/intent-router.d.ts.map +1 -1
- package/dist/orchestrator/intent-router.js +58 -49
- package/dist/orchestrator/intent-router.js.map +1 -1
- package/dist/orchestrator/tool-orchestrator.d.ts.map +1 -1
- package/dist/orchestrator/tool-orchestrator.js +6 -4
- package/dist/orchestrator/tool-orchestrator.js.map +1 -1
- package/dist/orchestrator/types.d.ts +113 -2
- package/dist/orchestrator/types.d.ts.map +1 -1
- package/dist/orchestrator/types.js +29 -0
- package/dist/orchestrator/types.js.map +1 -1
- package/dist/orchestrator/workflow/config.d.ts +4 -12
- package/dist/orchestrator/workflow/config.d.ts.map +1 -1
- package/dist/orchestrator/workflow/config.js +4 -6
- package/dist/orchestrator/workflow/config.js.map +1 -1
- package/dist/orchestrator/workflow/git-analyzer.d.ts.map +1 -1
- package/dist/orchestrator/workflow/git-analyzer.js +9 -19
- package/dist/orchestrator/workflow/git-analyzer.js.map +1 -1
- package/dist/orchestrator/workflow/phase-inheritance.d.ts.map +1 -1
- package/dist/orchestrator/workflow/phase-inheritance.js +14 -23
- package/dist/orchestrator/workflow/phase-inheritance.js.map +1 -1
- package/dist/orchestrator/workflow/result-fusion.d.ts.map +1 -1
- package/dist/orchestrator/workflow/result-fusion.js +9 -11
- package/dist/orchestrator/workflow/result-fusion.js.map +1 -1
- package/dist/orchestrator/workflow/templates.d.ts +4 -1
- package/dist/orchestrator/workflow/templates.d.ts.map +1 -1
- package/dist/orchestrator/workflow/templates.js +49 -207
- package/dist/orchestrator/workflow/templates.js.map +1 -1
- package/dist/orchestrator/workflow/test-linker.d.ts.map +1 -1
- package/dist/orchestrator/workflow/test-linker.js +12 -24
- package/dist/orchestrator/workflow/test-linker.js.map +1 -1
- package/dist/orchestrator/workflow/types.d.ts +11 -8
- package/dist/orchestrator/workflow/types.d.ts.map +1 -1
- package/dist/orchestrator/workflow/types.js +8 -1
- package/dist/orchestrator/workflow/types.js.map +1 -1
- package/dist/orchestrator/workflow/visualizer.d.ts.map +1 -1
- package/dist/orchestrator/workflow/visualizer.js +7 -9
- package/dist/orchestrator/workflow/visualizer.js.map +1 -1
- package/dist/orchestrator/workflow/workflow-context.d.ts.map +1 -1
- package/dist/orchestrator/workflow/workflow-context.js +3 -5
- package/dist/orchestrator/workflow/workflow-context.js.map +1 -1
- package/dist/orchestrator/workflow/workflow-orchestrator.d.ts +0 -4
- package/dist/orchestrator/workflow/workflow-orchestrator.d.ts.map +1 -1
- package/dist/orchestrator/workflow/workflow-orchestrator.js +7 -99
- package/dist/orchestrator/workflow/workflow-orchestrator.js.map +1 -1
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +2 -2
- package/dist/parser/index.js.map +1 -1
- package/dist/plugins/index.d.ts +5 -3
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +19 -8
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/plugin-loader.d.ts +21 -6
- package/dist/plugins/plugin-loader.d.ts.map +1 -1
- package/dist/plugins/plugin-loader.js +170 -54
- package/dist/plugins/plugin-loader.js.map +1 -1
- package/dist/plugins/plugin-registry.d.ts +7 -4
- package/dist/plugins/plugin-registry.d.ts.map +1 -1
- package/dist/plugins/plugin-registry.js +62 -14
- package/dist/plugins/plugin-registry.js.map +1 -1
- package/dist/plugins/types.d.ts +16 -6
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/plugins/types.js +2 -0
- package/dist/plugins/types.js.map +1 -1
- package/dist/server/handlers/AnalysisHandler.d.ts +16 -2
- package/dist/server/handlers/AnalysisHandler.d.ts.map +1 -1
- package/dist/server/handlers/AnalysisHandler.js +31 -47
- package/dist/server/handlers/AnalysisHandler.js.map +1 -1
- package/dist/server/routes/api.d.ts.map +1 -1
- package/dist/server/routes/api.js +31 -12
- package/dist/server/routes/api.js.map +1 -1
- package/docs/AI_ASSISTANT_SETUP.md +3 -1
- package/docs/SETUP_GUIDE.md +41 -17
- package/docs/ai-guide/COMMANDS.md +179 -102
- package/docs/ai-guide/INTEGRATION.md +23 -21
- package/docs/ai-guide/OUTPUT.md +621 -10
- package/docs/ai-guide/PATTERNS.md +77 -18
- package/docs/ai-guide/PROMPTS.md +24 -18
- package/docs/ai-guide/QUICKSTART.md +35 -19
- package/docs/ai-guide/README.md +22 -4
- package/docs/archive/test-report-symbol-search.md +384 -0
- package/docs/archive/test-scenario-4-complexity-analysis.md +460 -0
- package/docs/archive/test_report_scenario5.md +615 -0
- package/docs/archive/test_scenario_3_impact_analysis_report.md +520 -0
- package/docs/product-specs/DESIGN_CONTRACT_TEMPLATE.md +79 -0
- package/docs/product-specs/MVP3-ARCHITECTURE-COMPARISON.md +159 -434
- package/docs/product-specs/MVP3-ARCHITECTURE-REDESIGN-PRD.md +169 -261
- package/docs/product-specs/MVP3-ARCHITECTURE-REDESIGN-TECH-PRD.md +201 -1259
- package/docs/product-specs/README.md +9 -1
- package/docs/rules/architecture-guardrails.md +1 -2
- package/docs/rules/engineering-with-codex-openai.md +20 -10
- package/docs/rules/validation.md +29 -4
- package/mycodemap.config.schema.json +76 -5
- package/package.json +1 -1
- package/scripts/experiments/arcadedb-http-smoke.mjs +90 -0
- package/scripts/sync-analyze-docs.js +500 -0
- package/scripts/validate-ai-docs.js +54 -1
- package/scripts/validate-docs.js +992 -25
package/docs/SETUP_GUIDE.md
CHANGED
|
@@ -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
|
|
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
|
-
|
|
249
|
-
# 前台监听
|
|
250
|
-
mycodemap watch
|
|
251
|
-
|
|
252
|
-
# 后台守护进程
|
|
253
|
-
mycodemap watch -d
|
|
277
|
+
以下命令已从 public CLI 移除;如果旧脚本仍在调用,请按下表迁移:
|
|
254
278
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
mycodemap
|
|
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
|
-
###
|
|
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
|
-
|
|
155
|
-
|
|
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
|
-
|
|
158
|
-
|
|
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
|
|
177
|
+
mycodemap analyze -i read -t "src/index.ts" --json
|
|
166
178
|
|
|
167
179
|
# 纯结构化(移除自然语言字段)
|
|
168
|
-
mycodemap analyze -i
|
|
180
|
+
mycodemap analyze -i link -t "src/index.ts" --structured --json
|
|
169
181
|
|
|
170
182
|
# 机器可读模式
|
|
171
|
-
mycodemap analyze -i
|
|
183
|
+
mycodemap analyze -i show -t "src/index.ts" --output-mode machine
|
|
172
184
|
|
|
173
|
-
#
|
|
174
|
-
mycodemap analyze -i
|
|
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>` |
|
|
182
|
-
| `-t, --targets <paths...>` |
|
|
183
|
-
| `-k, --keywords <words...>` |
|
|
184
|
-
| `-s, --scope <scope>` |
|
|
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>` |
|
|
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
|
-
|
|
411
|
+
以下命令已从 public CLI 移除;直接调用时,CLI 会显式失败并给出迁移提示,而不是继续执行旧功能。
|
|
321
412
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
mycodemap
|
|
325
|
-
|
|
326
|
-
mycodemap
|
|
327
|
-
|
|
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": "
|
|
31
|
+
"name": "codemap_read",
|
|
32
32
|
"description": "分析文件变更的影响范围",
|
|
33
|
-
"command": "mycodemap analyze -i
|
|
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": "
|
|
39
|
+
"name": "codemap_find",
|
|
40
40
|
"description": "搜索与关键词相关的代码",
|
|
41
|
-
"command": "mycodemap analyze -i
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
151
|
-
4. Searching related code → `analyze -i
|
|
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
|
-
- `
|
|
172
|
-
- `
|
|
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 `
|
|
179
|
-
4. Use `
|
|
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
|
|
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
|
|
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
|
|
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', '
|
|
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
|
|
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
|
-
#
|
|
512
|
-
mycodemap
|
|
513
|
+
# 或重新运行一次 generate 刷新输出
|
|
514
|
+
mycodemap generate
|
|
513
515
|
```
|