openmatrix 0.1.26 → 0.1.28
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.
|
@@ -7,7 +7,8 @@ const smart_question_analyzer_js_1 = require("../../orchestrator/smart-question-
|
|
|
7
7
|
exports.analyzeCommand = new commander_1.Command('analyze')
|
|
8
8
|
.description('智能分析任务,推断配置,返回需要确认的问题列表')
|
|
9
9
|
.argument('[task]', '任务描述')
|
|
10
|
-
.option('--json', '输出 JSON
|
|
10
|
+
.option('--json', '输出 JSON 格式(供程序解析)')
|
|
11
|
+
.option('--markdown', '输出 Markdown 格式(默认)')
|
|
11
12
|
.action(async (task, options) => {
|
|
12
13
|
const analyzer = new smart_question_analyzer_js_1.SmartQuestionAnalyzer(process.cwd());
|
|
13
14
|
if (!task) {
|
|
@@ -31,8 +32,8 @@ exports.analyzeCommand = new commander_1.Command('analyze')
|
|
|
31
32
|
console.log(JSON.stringify(output, null, 2));
|
|
32
33
|
}
|
|
33
34
|
else {
|
|
34
|
-
//
|
|
35
|
-
console.log('\n' + analyzer.
|
|
35
|
+
// 默认输出 Markdown 格式
|
|
36
|
+
console.log('\n' + analyzer.generateMarkdown(result));
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
catch (error) {
|
|
@@ -615,5 +615,48 @@ class SmartQuestionAnalyzer {
|
|
|
615
615
|
}
|
|
616
616
|
return lines.join('\n');
|
|
617
617
|
}
|
|
618
|
+
/**
|
|
619
|
+
* 生成 Markdown 格式输出
|
|
620
|
+
*/
|
|
621
|
+
generateMarkdown(result) {
|
|
622
|
+
const lines = [];
|
|
623
|
+
lines.push('## 🔍 我理解的任务\n');
|
|
624
|
+
lines.push(`| 属性 | 值 |`);
|
|
625
|
+
lines.push(`|------|-----|`);
|
|
626
|
+
lines.push(`| 📋 类型 | ${result.understanding.taskTypeLabel} |`);
|
|
627
|
+
lines.push(`| 📁 范围 | ${result.understanding.scopeLabel} |`);
|
|
628
|
+
lines.push(`| ⚡ 复杂度 | ${result.understanding.complexityLabel} |`);
|
|
629
|
+
lines.push(`| ⏱️ 预计 | ${result.understanding.estimatedCommits} |`);
|
|
630
|
+
// 建议
|
|
631
|
+
if (result.understanding.suggestions.length > 0) {
|
|
632
|
+
lines.push('\n## 💡 建议执行方式\n');
|
|
633
|
+
for (const suggestion of result.understanding.suggestions) {
|
|
634
|
+
lines.push(`- ${suggestion}`);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
// 推断的配置
|
|
638
|
+
lines.push('\n## 📊 推荐配置\n');
|
|
639
|
+
lines.push(`| 配置项 | 推荐值 | 置信度 |`);
|
|
640
|
+
lines.push(`|--------|--------|--------|`);
|
|
641
|
+
for (const inference of result.inferences) {
|
|
642
|
+
const answer = Array.isArray(inference.inferredAnswer)
|
|
643
|
+
? inference.inferredAnswer.join(', ')
|
|
644
|
+
: inference.inferredAnswer || '待确认';
|
|
645
|
+
const confidenceIcon = inference.confidence === 'high' ? '✅' :
|
|
646
|
+
inference.confidence === 'medium' ? '🤔' : '❓';
|
|
647
|
+
lines.push(`| ${inference.questionId} | ${answer} | ${confidenceIcon} |`);
|
|
648
|
+
}
|
|
649
|
+
// 需要确认的问题
|
|
650
|
+
if (result.questionsToAsk.length > 0) {
|
|
651
|
+
lines.push('\n## ❓ 需要确认\n');
|
|
652
|
+
for (const q of result.questionsToAsk) {
|
|
653
|
+
lines.push(`- ${q}`);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
lines.push('\n✅ **所有配置已推断,可直接执行**');
|
|
658
|
+
}
|
|
659
|
+
return lines.join('\n');
|
|
660
|
+
}
|
|
618
661
|
}
|
|
619
662
|
exports.SmartQuestionAnalyzer = SmartQuestionAnalyzer;
|
package/package.json
CHANGED
package/skills/openmatrix.md
CHANGED
|
@@ -27,11 +27,13 @@ Everything else → analyze and execute.
|
|
|
27
27
|
<process>
|
|
28
28
|
1. **分析任务并展示理解**
|
|
29
29
|
|
|
30
|
-
调用 CLI
|
|
30
|
+
调用 CLI 分析任务(传入任务描述):
|
|
31
31
|
```bash
|
|
32
|
-
openmatrix analyze --
|
|
32
|
+
openmatrix analyze "$ARGUMENTS" --markdown
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
如果 `$ARGUMENTS` 为空,先询问用户任务内容。
|
|
36
|
+
|
|
35
37
|
**展示 AI 的理解和推荐:**
|
|
36
38
|
```
|
|
37
39
|
🔍 我理解的任务:
|
package/skills/start.md
CHANGED
|
@@ -49,11 +49,13 @@ description: 启动新的任务执行周期
|
|
|
49
49
|
|
|
50
50
|
## Step 1: 展示理解 + 推荐
|
|
51
51
|
|
|
52
|
-
**调用 CLI
|
|
52
|
+
**调用 CLI 分析任务(传入任务描述):**
|
|
53
53
|
```bash
|
|
54
|
-
openmatrix analyze --
|
|
54
|
+
openmatrix analyze "$ARGUMENTS" --markdown
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
如果 `$ARGUMENTS` 为空,先询问用户任务内容。
|
|
58
|
+
|
|
57
59
|
**展示 AI 的理解和推荐:**
|
|
58
60
|
```
|
|
59
61
|
🔍 我理解的任务:
|
|
@@ -152,15 +154,38 @@ openmatrix plan --json
|
|
|
152
154
|
```
|
|
153
155
|
|
|
154
156
|
**选择执行模式:**
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
选择执行模式:
|
|
160
|
+
|
|
161
|
+
🚀 全自动执行
|
|
162
|
+
遇到问题自动跳过并记录到 Meeting,最后统一处理
|
|
163
|
+
|
|
164
|
+
⏸️ 关键节点确认
|
|
165
|
+
在 plan/merge 时暂停确认,平衡速度和控制
|
|
166
|
+
|
|
167
|
+
📋 每步确认
|
|
168
|
+
每个任务完成后暂停,适合重要任务
|
|
169
|
+
```
|
|
170
|
+
|
|
155
171
|
```typescript
|
|
156
172
|
AskUserQuestion({
|
|
157
173
|
questions: [{
|
|
158
174
|
question: "选择执行模式:",
|
|
159
175
|
header: "模式",
|
|
160
176
|
options: [
|
|
161
|
-
{
|
|
162
|
-
|
|
163
|
-
|
|
177
|
+
{
|
|
178
|
+
label: "🚀 全自动执行",
|
|
179
|
+
description: "遇到问题自动跳过并记录到 Meeting,最后统一处理"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
label: "⏸️ 关键节点确认",
|
|
183
|
+
description: "在 plan/merge 时暂停确认,平衡速度和控制"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
label: "📋 每步确认",
|
|
187
|
+
description: "每个任务完成后暂停,适合重要任务"
|
|
188
|
+
}
|
|
164
189
|
],
|
|
165
190
|
multiSelect: false
|
|
166
191
|
}]
|
|
@@ -297,11 +322,11 @@ $ARGUMENTS
|
|
|
297
322
|
|
|
298
323
|
## 执行模式对比
|
|
299
324
|
|
|
300
|
-
| 模式 | 审批点 | 风险操作确认 | 适用场景 |
|
|
301
|
-
|
|
302
|
-
|
|
|
303
|
-
| 关键节点确认 | plan/merge 暂停 | ✅ 需要 | 常规任务 |
|
|
304
|
-
| 每步确认 | 每任务暂停 | ✅ 需要 | 重要任务 |
|
|
325
|
+
| 模式 | 审批点 | 问题处理 | 风险操作确认 | 适用场景 |
|
|
326
|
+
|------|--------|---------|-------------|---------|
|
|
327
|
+
| 全自动执行 | 自动批准 | 自动跳过,记录到 Meeting | ✅ 需要 | 简单任务、信任 AI |
|
|
328
|
+
| 关键节点确认 | plan/merge 暂停 | 记录到 Meeting | ✅ 需要 | 常规任务 |
|
|
329
|
+
| 每步确认 | 每任务暂停 | 即时处理 | ✅ 需要 | 重要任务 |
|
|
305
330
|
|
|
306
331
|
## Git 提交格式
|
|
307
332
|
|