openmatrix 0.2.15 → 0.2.17

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/README.md CHANGED
@@ -253,18 +253,97 @@ Accept 阶段由 Reviewer Agent 执行:
253
253
  | `/om` | **默认入口** - 直接输入任务描述即可启动 |
254
254
  | `/om:brainstorm` | 🧠 **头脑风暴** - 先探索需求和设计,再执行任务 |
255
255
  | `/om:research` | 📚 **领域调研** - AI 驱动的领域调研和问题探索 |
256
+ | `/om:debug` | 🔧 **系统化调试** - 四阶段根因分析 + 自动修复验证循环 |
257
+ | `/om:feature` | ⚡ **轻量小需求** - 快速迭代小功能,无完整任务追踪 |
256
258
  | `/om:start` | 启动新任务 (第一个问题选质量级别) |
257
259
  | `/om:auto` | 🚀 **全自动执行** - 无阻塞、无确认、直接完成 |
258
260
  | `/check` | 🔍 **项目检查** - 自动检测可改进点并提供升级建议 |
259
261
  | `/om:status` | 查看状态 |
260
262
  | `/om:approve` | 审批决策 |
261
263
  | `/om:meeting` | 处理阻塞问题 |
262
- | `/om:resume` | 恢复中断 |
264
+ | `/om:resume` | **智能恢复** - 自动检测轻量/完整流程并恢复中断任务 |
263
265
  | `/om:retry` | 重试失败 |
264
266
  | `/om:report` | 生成报告 |
265
267
 
266
268
  > `/om` 是 `/om:start` 的快捷方式,功能完全相同
267
269
 
270
+ ### `/om:debug` 系统化调试
271
+
272
+ **适用场景**: Bug 修复、测试失败、异常行为、构建失败
273
+
274
+ ```bash
275
+ /om:debug # 交互式调试
276
+ /om:debug --task TASK-003 # 调试指定失败任务
277
+ /om:debug "API 返回 500 错误" # 带问题描述调试
278
+ ```
279
+
280
+ **四阶段流程**:
281
+
282
+ ```
283
+ Step 1: 接收问题
284
+
285
+ Step 2: CLI 初始化会话
286
+
287
+ Step 3: 根因调查(只读,Explore Agent)
288
+
289
+ Step 4: 模式分析(只读,Explore Agent)
290
+
291
+ Step 5: 展示诊断报告
292
+
293
+ ⛔ 必须等待用户确认是否修复
294
+
295
+ Step 6: 用户选择是否修复
296
+ ├─ "仅查看报告" → 输出报告后结束
297
+ ├─ "继续深入调查" → 回到 Step 3
298
+ └─ "需要修复" ↓
299
+ Step 7: 选择修复策略(自动/手动)
300
+
301
+ Step 8: 实施修复(Agent)
302
+
303
+ Step 9: 自动验证修复(无需用户确认)
304
+ ├─ 验证通过 → 进入报告阶段 ✅
305
+ └─ 验证失败 → 自动循环重试(最多3次)
306
+ ├─ < 3次 → 自动回到 Step 8 重新修复
307
+ └─ >= 3次 → 暂停,质疑架构 ⚠️
308
+ Step 10: 输出 Debug Report
309
+ ```
310
+
311
+ **铁律**:
312
+ - 不做根因调查,不许提修复方案
313
+ - 验证失败自动循环,无需用户手动确认
314
+ - 最大重试 3 次,超过必须暂停质疑架构
315
+
316
+ ### `/om:feature` 轻量小需求
317
+
318
+ **适用场景**: 小功能、小改动、快速迭代(≤100字描述,单一功能点)
319
+
320
+ ```bash
321
+ /om:feature 给用户列表页添加搜索功能
322
+ /om:feature 添加一个导出按钮
323
+ /om:feature docs/small-task.md
324
+ ```
325
+
326
+ **触发条件**(从 `/om` 主入口自动路由):
327
+ - 任务描述 ≤ 100 字
328
+ - 单一功能点(无多个独立子系统)
329
+ - 不涉及架构设计/技术选型
330
+ - 关键词匹配:小需求、小功能、小改动、minor、quick、快速
331
+
332
+ **与标准流程对比**:
333
+
334
+ | 特性 | `/om:feature` | `/om:start` |
335
+ |------|---------------|-------------|
336
+ | 任务文件 | ❌ 无 `.openmatrix/tasks/` | ✅ 有完整任务追踪 |
337
+ | 问答确认 | 质量 + E2E | 质量 + E2E + 模式 |
338
+ | 任务拆分 | AI 自动拆分 2-5 块 | Planner Agent 生成计划 |
339
+ | Git 提交 | 分步提交(每块完成后) | 最终统一提交 |
340
+ | 恢复机制 | `/om:resume` (自动检测) | `/om:resume` |
341
+
342
+ **铁律**:
343
+ - 不验证不得提交,验证失败必须停止
344
+ - 每次只改一个任务块,不得并行修改
345
+ - 验证通过后立即提交,不得积累多个任务块
346
+
268
347
  ### `/check` 项目检查
269
348
 
270
349
  **适用场景**: 代码质量检查、安全审计、AI 项目配置检查
@@ -497,6 +576,9 @@ cd openmatrix && npm install && npm run build && npm test
497
576
  - [x] 系统集成任务 (多模块自动组装)
498
577
  - [x] 智能项目检测 (gitignore 根据技术栈自动写入)
499
578
  - [x] Git 父级目录支持 (子目录中正常执行 git 操作)
579
+ - [x] `/om:debug` 系统化调试 (四阶段根因分析 + 自动修复验证循环)
580
+ - [x] `/om:feature` 轻量小需求 (快速迭代,分步 Git 提交)
581
+ - [x] `/om:resume` 智能恢复 (自动检测轻量/完整流程)
500
582
  - [ ] VSCode 扩展
501
583
  - [ ] CI/CD 集成
502
584
 
@@ -67,6 +67,10 @@ export declare class AgentRunner {
67
67
  * 构建完整的执行提示词
68
68
  */
69
69
  buildExecutionPrompt(task: Task): Promise<string>;
70
+ /**
71
+ * 构建歧义检测指令
72
+ */
73
+ private buildAmbiguityDetectionInstruction;
70
74
  /**
71
75
  * 构建累积上下文 - 从全局 context.md 读取前序 Agent 的决策和知识
72
76
  */
@@ -136,8 +136,11 @@ class AgentRunner {
136
136
  const agentPrompt = this.buildAgentPrompt(task);
137
137
  const phaseContext = this.buildPhaseContext(task);
138
138
  const accumulatedContext = await this.buildAccumulatedContext(task);
139
+ const ambiguityInstruction = this.buildAmbiguityDetectionInstruction(task);
139
140
  return `# 任务执行
140
141
 
142
+ ${ambiguityInstruction}
143
+
141
144
  ## 任务信息
142
145
  - ID: ${task.id}
143
146
  - 标题: ${task.title}
@@ -172,6 +175,89 @@ ${agentPrompt.instructions}
172
175
  注意: 任务完成后,由 Skill 调用 \`openmatrix complete\` 并传入 --summary 参数,
173
176
  该摘要会自动追加到全局 \`.openmatrix/context.md\` 供后续 Agent 参考。
174
177
  `;
178
+ }
179
+ /**
180
+ * 构建歧义检测指令
181
+ */
182
+ buildAmbiguityDetectionInstruction(task) {
183
+ return `## 🚨 歧义检测指令(必须在执行前完成)
184
+
185
+ 在开始执行任务之前,你必须完成歧义检测。检测以下 5 种歧义类型:
186
+
187
+ ### 检测清单
188
+
189
+ 1. **需求歧义** (requirement)
190
+ - 任务描述是否清晰可理解?
191
+ - 是否有缺少的关键信息?
192
+ - 验收标准是否明确?
193
+
194
+ 2. **技术歧义** (technical)
195
+ - 技术选型是否明确?
196
+ - 实现方案是否有多种选择?
197
+ - 是否需要特定的技术决策?
198
+
199
+ 3. **依赖歧义** (dependency)
200
+ - 依赖任务是否已完成?
201
+ - 依赖代码是否可找到?
202
+ - 是否有缺失的依赖项?
203
+
204
+ 4. **验收歧义** (acceptance)
205
+ - 验收标准是否明确?
206
+ - 成功定义是否清晰?
207
+ - 是否有模糊的边界条件?
208
+
209
+ 5. **测试结果歧义** (test_result)
210
+ - 测试失败原因是否明确?
211
+ - 测试通过是否可信?
212
+ - 是否需要额外的验证?
213
+
214
+ ### 严重程度定义
215
+
216
+ | 级别 | 说明 | 处理方式 |
217
+ |-----|------|---------|
218
+ | **Critical** | 无法继续执行,必须澄清 | 立即报告,等待澄清 |
219
+ | **High** | 可能导致错误结果 | 报告并建议处理方案 |
220
+ | **Medium** | 影响执行效率 | 记录并尝试解决 |
221
+ | **Low** | 轻微不确定性 | 继续执行,备注说明 |
222
+
223
+ ### 输出格式
224
+
225
+ 如果检测到歧义,在任务执行前输出:
226
+ \`\`\`xml
227
+ <ambiguity_report>
228
+ {
229
+ "hasAmbiguity": true,
230
+ "taskId": "${task.id}",
231
+ "detectionPhase": "pre_execution",
232
+ "ambiguities": [
233
+ {
234
+ "type": "requirement|technical|dependency|acceptance|test_result",
235
+ "severity": "Critical|High|Medium|Low",
236
+ "description": "歧义描述",
237
+ "suggestedResolution": "建议的处理方案"
238
+ }
239
+ ],
240
+ "maxSeverity": "Critical|High|Medium|Low",
241
+ "suggestedStrategy": "ask_immediate|write_meeting|continue",
242
+ "detectedAt": "<ISO timestamp>"
243
+ }
244
+ </ambiguity_report>
245
+ \`\`\`
246
+
247
+ 如果没有歧义,输出:
248
+ \`\`\`xml
249
+ <ambiguity_report>
250
+ { "hasAmbiguity": false }
251
+ </ambiguity_report>
252
+ \`\`\`
253
+
254
+ ### 处理策略
255
+
256
+ - **Critical/High**: 输出报告后暂停,等待用户决策
257
+ - **Medium**: 输出报告后继续执行,采用合理假设
258
+ - **Low**: 记录并继续执行
259
+
260
+ **重要**: 如果无法解析歧义检测结果,视为无歧义继续执行。`;
175
261
  }
176
262
  /**
177
263
  * 构建累积上下文 - 从全局 context.md 读取前序 Agent 的决策和知识
@@ -94,9 +94,9 @@ export declare function outputNewSessionText(taskTitle: string, questions: Brain
94
94
  domain: string;
95
95
  }): void;
96
96
  /**
97
- * 构建智能问题会话:解析任务 → 分析推断 → 生成问题
97
+ * 构建智能问题会话:解析任务 → 生成问题
98
98
  */
99
- export declare function buildSmartQuestionSession(taskContent: string, basePath: string): Promise<import("../../orchestrator/interactive-question-generator.js").QuestionSession>;
99
+ export declare function buildSmartQuestionSession(taskContent: string, _basePath: string): Promise<import("../../orchestrator/interactive-question-generator.js").QuestionSession>;
100
100
  /**
101
101
  * 将智能会话问题转换为 BrainstormQuestion[] 格式
102
102
  */
@@ -52,10 +52,8 @@ exports.convertToBrainstormQuestions = convertToBrainstormQuestions;
52
52
  const commander_1 = require("commander");
53
53
  const state_manager_js_1 = require("../../storage/state-manager.js");
54
54
  const gitignore_js_1 = require("../../utils/gitignore.js");
55
- const smart_question_analyzer_js_1 = require("../../orchestrator/smart-question-analyzer.js");
56
55
  const interactive_question_generator_js_1 = require("../../orchestrator/interactive-question-generator.js");
57
56
  const task_parser_js_1 = require("../../orchestrator/task-parser.js");
58
- const answer_mapper_js_1 = require("../../orchestrator/answer-mapper.js");
59
57
  const logger_js_1 = require("../../utils/logger.js");
60
58
  const fs = __importStar(require("fs/promises"));
61
59
  const path = __importStar(require("path"));
@@ -522,16 +520,12 @@ async function generateSmartQuestions(taskContent, basePath) {
522
520
  }
523
521
  }
524
522
  /**
525
- * 构建智能问题会话:解析任务 → 分析推断 → 生成问题
523
+ * 构建智能问题会话:解析任务 → 生成问题
526
524
  */
527
- async function buildSmartQuestionSession(taskContent, basePath) {
525
+ async function buildSmartQuestionSession(taskContent, _basePath) {
528
526
  const parser = new task_parser_js_1.TaskParser();
529
527
  const parsedTask = parser.parse(taskContent);
530
- const analyzer = new smart_question_analyzer_js_1.SmartQuestionAnalyzer(basePath);
531
- const analysisResult = await analyzer.analyze(taskContent, parsedTask);
532
- const inferenceMap = (0, answer_mapper_js_1.translateAnalyzerInferences)(analysisResult.inferences);
533
528
  const questionGen = new interactive_question_generator_js_1.InteractiveQuestionGenerator();
534
- questionGen.setInferences(inferenceMap);
535
529
  const session = questionGen.startSession(parsedTask);
536
530
  questionGen.addContextualQuestions(parsedTask, session.questions);
537
531
  return session;
@@ -0,0 +1,16 @@
1
+ import { Command } from 'commander';
2
+ import type { EnvironmentInfo, DeployOption, DeployMethod, DevCommands } from '../../types/index.js';
3
+ export declare const deployCommand: Command;
4
+ export declare function displayEnvironmentInfo(info: EnvironmentInfo): void;
5
+ export declare function displayDeployOptions(options: DeployOption[]): void;
6
+ export declare function displayDevCommands(commands: DevCommands): void;
7
+ export declare function getDeployMethodLabel(method: DeployMethod): string;
8
+ export declare function formatDeployCommand(option: DeployOption): string;
9
+ export declare function generateDeployCommands(info: EnvironmentInfo, method?: DeployMethod, dryRun?: boolean): Array<{
10
+ method: DeployMethod;
11
+ command: string;
12
+ configFile?: string;
13
+ description?: string;
14
+ dryRun: boolean;
15
+ }>;
16
+ export declare function selectDeployOption(options: DeployOption[], method?: DeployMethod): DeployOption | undefined;
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.deployCommand = void 0;
7
+ exports.displayEnvironmentInfo = displayEnvironmentInfo;
8
+ exports.displayDeployOptions = displayDeployOptions;
9
+ exports.displayDevCommands = displayDevCommands;
10
+ exports.getDeployMethodLabel = getDeployMethodLabel;
11
+ exports.formatDeployCommand = formatDeployCommand;
12
+ exports.generateDeployCommands = generateDeployCommands;
13
+ exports.selectDeployOption = selectDeployOption;
14
+ // src/cli/commands/deploy.ts
15
+ const commander_1 = require("commander");
16
+ const environment_detector_js_1 = require("../../orchestrator/environment-detector.js");
17
+ const chalk_1 = __importDefault(require("chalk"));
18
+ const child_process_1 = require("child_process");
19
+ exports.deployCommand = new commander_1.Command('deploy')
20
+ .description('输出项目环境原始数据供 Skill 分析,或执行指定部署命令')
21
+ .option('--json', '输出 JSON 格式原始数据(供 Skill 层 AI 分析)')
22
+ .option('--show-dev', '包含开发命令', false)
23
+ .option('--run <command>', '执行指定部署命令')
24
+ .option('--dry-run <command>', '预览命令但不执行')
25
+ .action(async (options) => {
26
+ const projectRoot = process.cwd();
27
+ // dry-run:仅显示命令
28
+ if (options.dryRun) {
29
+ console.log(chalk_1.default.bold.cyan('\n📋 命令预览 (dry-run)'));
30
+ console.log('━'.repeat(42));
31
+ console.log(chalk_1.default.white(` ${options.dryRun}`));
32
+ console.log(chalk_1.default.gray(' (仅预览,不执行)'));
33
+ return;
34
+ }
35
+ // run:执行指定命令
36
+ if (options.run) {
37
+ console.log(chalk_1.default.bold.cyan('\n🚀 执行部署命令'));
38
+ console.log('━'.repeat(42));
39
+ console.log(chalk_1.default.white(` ${options.run}\n`));
40
+ try {
41
+ (0, child_process_1.execSync)(options.run, { stdio: 'inherit', cwd: projectRoot });
42
+ console.log(chalk_1.default.green('\n✅ 命令执行完成'));
43
+ }
44
+ catch (error) {
45
+ console.error(chalk_1.default.red('\n❌ 命令执行失败'));
46
+ process.exit(1);
47
+ }
48
+ return;
49
+ }
50
+ // 默认:输出原始环境数据
51
+ try {
52
+ const detector = new environment_detector_js_1.EnvironmentDetector(projectRoot);
53
+ const envInfo = await detector.detect();
54
+ if (options.json) {
55
+ console.log(JSON.stringify(buildRawOutput(envInfo, options.showDev), null, 2));
56
+ return;
57
+ }
58
+ // 非 JSON 模式:简单展示
59
+ displayEnvironmentInfo(envInfo);
60
+ displayDeployOptions(envInfo.deployOptions);
61
+ if (options.showDev)
62
+ displayDevCommands(envInfo.devCommands);
63
+ displayHints();
64
+ }
65
+ catch (error) {
66
+ if (options.json) {
67
+ console.log(JSON.stringify({ error: String(error) }));
68
+ }
69
+ else {
70
+ console.error(chalk_1.default.red('\n❌ 检测失败:'), error);
71
+ }
72
+ process.exit(1);
73
+ }
74
+ });
75
+ /**
76
+ * 构建原始数据输出(不含任何推荐逻辑,交给 Skill 层 AI 分析)
77
+ */
78
+ function buildRawOutput(envInfo, showDev) {
79
+ return {
80
+ projectName: envInfo.projectName,
81
+ projectType: envInfo.projectType,
82
+ projectRoot: envInfo.projectRoot,
83
+ timestamp: envInfo.timestamp,
84
+ buildTools: envInfo.buildTools,
85
+ deployOptions: envInfo.deployOptions,
86
+ ciConfig: envInfo.ciConfig,
87
+ summary: envInfo.summary,
88
+ devCommands: showDev ? envInfo.devCommands : undefined
89
+ };
90
+ }
91
+ function displayEnvironmentInfo(info) {
92
+ console.log(chalk_1.default.bold(`\n📦 项目: ${info.projectName}`));
93
+ console.log(` 类型: ${formatProjectType(info.projectType)}`);
94
+ console.log(` 路径: ${info.projectRoot}\n`);
95
+ console.log(chalk_1.default.bold('📊 环境摘要'));
96
+ console.log('━'.repeat(42));
97
+ console.log(` 构建工具: ${chalk_1.default.yellow(info.summary.buildToolCount)} 个`);
98
+ console.log(` 部署选项: ${chalk_1.default.yellow(info.summary.deployOptionCount)} 个`);
99
+ console.log(` CI 配置: ${info.summary.hasCIConfig ? chalk_1.default.green('已配置') : chalk_1.default.gray('未检测到')}`);
100
+ console.log();
101
+ }
102
+ function displayDeployOptions(options) {
103
+ console.log(chalk_1.default.bold('🚀 检测到的部署配置'));
104
+ console.log('━'.repeat(42));
105
+ if (options.length === 0) {
106
+ console.log(chalk_1.default.gray(' 未检测到部署配置\n'));
107
+ return;
108
+ }
109
+ for (const opt of options) {
110
+ console.log(` ${chalk_1.default.cyan(getDeployMethodLabel(opt.method))}`);
111
+ if (opt.configFile)
112
+ console.log(` 配置: ${chalk_1.default.gray(opt.configFile)}`);
113
+ if (opt.command)
114
+ console.log(` 命令: ${chalk_1.default.white(opt.command)}`);
115
+ console.log();
116
+ }
117
+ }
118
+ function displayDevCommands(commands) {
119
+ console.log(chalk_1.default.bold('🔧 开发命令'));
120
+ console.log('━'.repeat(42));
121
+ const sections = [
122
+ { label: '安装', cmds: commands.setup },
123
+ { label: '构建', cmds: commands.build },
124
+ { label: '测试', cmds: commands.test },
125
+ { label: '开发', cmds: commands.dev },
126
+ { label: '启动', cmds: commands.start },
127
+ { label: 'Lint', cmds: commands.lint },
128
+ ];
129
+ for (const s of sections) {
130
+ if (s.cmds && s.cmds.length > 0) {
131
+ console.log(` ${chalk_1.default.yellow(s.label)}: ${chalk_1.default.white(s.cmds.join(', '))}`);
132
+ }
133
+ }
134
+ console.log();
135
+ }
136
+ function getDeployMethodLabel(method) {
137
+ const labels = {
138
+ 'docker': '🐳 Docker',
139
+ 'docker-compose': '🐳 Docker Compose',
140
+ 'kubernetes': '☸️ Kubernetes',
141
+ 'helm': '☸️ Helm',
142
+ 'npm': '📦 npm',
143
+ 'make': '⚙️ Makefile',
144
+ 'script': '📜 自定义脚本',
145
+ 'github-pages': '📄 GitHub Pages',
146
+ 'vercel': '▲ Vercel',
147
+ 'netlify': '🌐 Netlify',
148
+ 'aws': '☁️ AWS',
149
+ 'gcp': '☁️ Google Cloud',
150
+ 'azure': '☁️ Azure',
151
+ 'heroku': '☁️ Heroku',
152
+ 'unknown': '❓ 未知'
153
+ };
154
+ return labels[method] ?? method;
155
+ }
156
+ function formatDeployCommand(option) {
157
+ if (option.command)
158
+ return option.command;
159
+ const placeholders = {
160
+ 'docker': 'docker build -t <image> . && docker run <image>',
161
+ 'docker-compose': 'docker-compose up -d',
162
+ 'kubernetes': 'kubectl apply -f k8s/',
163
+ 'helm': 'helm install <release> helm/',
164
+ 'npm': 'npm run deploy',
165
+ 'make': 'make deploy',
166
+ 'script': './deploy.sh',
167
+ };
168
+ return placeholders[option.method] ?? '<待配置>';
169
+ }
170
+ function generateDeployCommands(info, method, dryRun) {
171
+ const options = method ? info.deployOptions.filter(o => o.method === method) : info.deployOptions;
172
+ return options.map(o => ({
173
+ method: o.method,
174
+ command: formatDeployCommand(o),
175
+ configFile: o.configFile,
176
+ description: o.description,
177
+ dryRun: dryRun ?? false
178
+ }));
179
+ }
180
+ function selectDeployOption(options, method) {
181
+ if (options.length === 0)
182
+ return undefined;
183
+ if (method)
184
+ return options.find(o => o.method === method);
185
+ return options.find(o => o.recommended) ?? options[0];
186
+ }
187
+ function displayHints() {
188
+ console.log(chalk_1.default.gray('━'.repeat(42)));
189
+ console.log(chalk_1.default.gray('💡 提示:'));
190
+ console.log(chalk_1.default.gray(' --run "<command>" 执行部署命令'));
191
+ console.log(chalk_1.default.gray(' --dry-run "<command>" 预览命令'));
192
+ console.log(chalk_1.default.gray(' --json 输出原始数据供 /om:deploy 分析'));
193
+ console.log(chalk_1.default.gray(' --show-dev 显示开发命令'));
194
+ console.log();
195
+ }
196
+ function formatProjectType(type) {
197
+ const labels = {
198
+ openmatrix: '🤖 OpenMatrix', 'ai-project': '🧠 AI 项目',
199
+ nodejs: '📦 Node.js', typescript: '📘 TypeScript',
200
+ python: '🐍 Python', go: '🔷 Go', rust: '🦀 Rust',
201
+ java: '☕ Java', csharp: '💜 C#', cpp: '⚙️ C/C++',
202
+ php: '🐘 PHP', dart: '🎯 Dart',
203
+ };
204
+ return labels[type] ?? type;
205
+ }
package/dist/cli/index.js CHANGED
@@ -48,12 +48,12 @@ const auto_js_1 = require("./commands/auto.js");
48
48
  const install_skills_js_1 = require("./commands/install-skills.js");
49
49
  const check_js_1 = require("./commands/check.js");
50
50
  const check_gitignore_js_1 = require("./commands/check-gitignore.js");
51
- const analyze_js_1 = require("./commands/analyze.js");
52
51
  const brainstorm_js_1 = require("./commands/brainstorm.js");
53
52
  const research_js_1 = require("./commands/research.js");
54
53
  const debug_js_1 = require("./commands/debug.js");
55
54
  const complete_js_1 = require("./commands/complete.js");
56
55
  const step_js_1 = require("./commands/step.js");
56
+ const deploy_js_1 = require("./commands/deploy.js");
57
57
  // 读取 package.json 版本
58
58
  let version = '0.0.0';
59
59
  try {
@@ -83,9 +83,9 @@ program.addCommand(step_js_1.stepCommand);
83
83
  program.addCommand(install_skills_js_1.installSkillsCommand);
84
84
  program.addCommand(check_js_1.checkCommand);
85
85
  program.addCommand(check_gitignore_js_1.checkGitignoreCommand);
86
- program.addCommand(analyze_js_1.analyzeCommand);
87
86
  program.addCommand(brainstorm_js_1.brainstormCommand);
88
87
  program.addCommand(research_js_1.researchCommand);
89
88
  program.addCommand(debug_js_1.debugCommand);
89
+ program.addCommand(deploy_js_1.deployCommand);
90
90
  // 默认帮助
91
91
  program.parse();
@@ -1,4 +1,3 @@
1
- import type { QuestionInference } from './smart-question-analyzer.js';
2
1
  /**
3
2
  * 将 brainstorm 答案键翻译为 TaskPlanner 期望的键
4
3
  *
@@ -7,13 +6,6 @@ import type { QuestionInference } from './smart-question-analyzer.js';
7
6
  * 2. 旧 brainstorm ID (如 core_objective, quality) → 先转规范 ID 再映射
8
7
  */
9
8
  export declare function translateBrainstormAnswers(answers: Record<string, string | string[]>): Record<string, string | string[]>;
10
- /**
11
- * 将 SmartQuestionAnalyzer 推理结果转换为 brainstorm 规范 ID
12
- */
13
- export declare function translateAnalyzerInferences(inferences: QuestionInference[]): Map<string, {
14
- answer: string | string[];
15
- reason: string;
16
- }>;
17
9
  /**
18
10
  * 从 brainstorm 答案中提取 tasks-input.json 所需的字段
19
11
  */
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
+ // src/orchestrator/answer-mapper.ts
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.translateBrainstormAnswers = translateBrainstormAnswers;
4
- exports.translateAnalyzerInferences = translateAnalyzerInferences;
5
5
  exports.extractTasksInputFields = extractTasksInputFields;
6
6
  /**
7
7
  * 答案键映射 — 统一三套 ID 体系
@@ -30,16 +30,6 @@ const CANONICAL_TO_PLANNER = {
30
30
  e2e_tests: { 'E2E测试': '', e2eTests: '', e2e: '' },
31
31
  e2e_type: { 'E2E类型': '', e2eType: '' },
32
32
  };
33
- /** Analyzer 旧 ID → 规范 ID */
34
- const ANALYZER_TO_CANONICAL = {
35
- quality_level: 'quality_level',
36
- tech_stack: 'tech_stack',
37
- doc_level: 'documentation_level',
38
- e2e_test: 'e2e_tests',
39
- execution_mode: 'execution_mode',
40
- objective: 'objective',
41
- test_coverage: 'test_coverage',
42
- };
43
33
  /**
44
34
  * 将 brainstorm 答案键翻译为 TaskPlanner 期望的键
45
35
  *
@@ -67,22 +57,6 @@ function translateBrainstormAnswers(answers) {
67
57
  }
68
58
  return result;
69
59
  }
70
- /**
71
- * 将 SmartQuestionAnalyzer 推理结果转换为 brainstorm 规范 ID
72
- */
73
- function translateAnalyzerInferences(inferences) {
74
- const result = new Map();
75
- for (const inf of inferences) {
76
- if (inf.inferredAnswer === undefined)
77
- continue;
78
- const canonical = ANALYZER_TO_CANONICAL[inf.questionId] || inf.questionId;
79
- result.set(canonical, {
80
- answer: inf.inferredAnswer,
81
- reason: inf.reason
82
- });
83
- }
84
- return result;
85
- }
86
60
  /**
87
61
  * 从 brainstorm 答案中提取 tasks-input.json 所需的字段
88
62
  */
@@ -0,0 +1,51 @@
1
+ import type { EnvironmentInfo, EnvironmentDetectorConfig } from '../types/index.js';
2
+ /**
3
+ * 默认环境检测器配置
4
+ */
5
+ export declare const DEFAULT_ENVIRONMENT_DETECTOR_CONFIG: EnvironmentDetectorConfig;
6
+ /**
7
+ * 环境检测器
8
+ *
9
+ * 自动扫描项目结构,检测构建工具、CI配置、部署选项等环境信息。
10
+ */
11
+ export declare class EnvironmentDetector {
12
+ private config;
13
+ private projectRoot;
14
+ constructor(projectRoot: string, config?: Partial<EnvironmentDetectorConfig>);
15
+ /**
16
+ * 执行完整检测
17
+ */
18
+ detect(): Promise<EnvironmentInfo>;
19
+ /**
20
+ * 检测项目类型
21
+ */
22
+ private detectProjectType;
23
+ /**
24
+ * 获取项目名称
25
+ */
26
+ private getProjectName;
27
+ /**
28
+ * 在配置的扫描目录中查找文件
29
+ */
30
+ private findFile;
31
+ /**
32
+ * 检测构建工具
33
+ */
34
+ private detectBuildTools;
35
+ /**
36
+ * 检测 CI 配置
37
+ */
38
+ private detectCIConfig;
39
+ /**
40
+ * 检测部署选项
41
+ */
42
+ private detectDeployOptions;
43
+ /**
44
+ * 获取开发命令
45
+ */
46
+ private getDevCommands;
47
+ /**
48
+ * 转换为 JSON 字符串
49
+ */
50
+ toJSON(result: EnvironmentInfo): string;
51
+ }