openmatrix 0.2.30 → 0.2.33
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 +154 -154
- package/dist/cli/commands/approve.js +35 -1
- package/dist/cli/commands/auto.js +2 -2
- package/dist/cli/commands/check-gitignore.js +34 -30
- package/dist/cli/commands/check.js +1 -1
- package/dist/cli/commands/complete.js +35 -7
- package/dist/cli/commands/debug.js +2 -1
- package/dist/cli/commands/deploy.js +1 -1
- package/dist/cli/commands/install-skills.js +3 -0
- package/dist/cli/commands/meeting.js +37 -1
- package/dist/cli/commands/report.js +1 -1
- package/dist/cli/commands/resume.js +35 -1
- package/dist/cli/commands/retry.js +130 -56
- package/dist/cli/commands/start.js +14 -3
- package/dist/cli/commands/status.js +32 -29
- package/dist/cli/commands/step.js +4 -1
- package/dist/orchestrator/ai-reviewer.d.ts +5 -0
- package/dist/orchestrator/ai-reviewer.js +9 -2
- package/dist/orchestrator/context-collector.js +17 -5
- package/dist/orchestrator/executor.d.ts +8 -0
- package/dist/orchestrator/executor.js +38 -8
- package/dist/orchestrator/phase-executor.d.ts +4 -0
- package/dist/orchestrator/phase-executor.js +21 -4
- package/dist/storage/file-store.js +8 -0
- package/dist/storage/state-manager.js +52 -19
- package/dist/test/generator.js +113 -113
- package/dist/types/index.d.ts +2 -0
- package/dist/utils/error-handler.d.ts +18 -0
- package/dist/utils/error-handler.js +32 -0
- package/dist/utils/worktree-sync.js +24 -3
- package/package.json +61 -61
- package/skills/SKILL.md +53 -53
- package/skills/auto.md +410 -413
- package/skills/brainstorm.md +19 -12
- package/skills/debug.md +694 -691
- package/skills/deploy.md +658 -658
- package/skills/feature.md +713 -686
- package/skills/plan.md +298 -296
- package/skills/report.md +9 -5
- package/skills/resume.md +292 -287
- package/skills/start.md +117 -27
- package/skills/status.md +5 -4
- package/skills/test.md +875 -875
- package/dist/agents/base-agent.d.ts +0 -46
- package/dist/agents/base-agent.js +0 -17
- package/dist/cli/commands/analyze.d.ts +0 -2
- package/dist/cli/commands/analyze.js +0 -50
- package/dist/orchestrator/smart-question-analyzer.d.ts +0 -90
- package/dist/orchestrator/smart-question-analyzer.js +0 -512
|
@@ -44,10 +44,13 @@ exports.meetingCommand = new commander_1.Command('meeting')
|
|
|
44
44
|
.description('查看和处理待确认的 Meeting')
|
|
45
45
|
.argument('[meetingId]', 'Meeting ID (可选)')
|
|
46
46
|
.option('-l, --list', '列出所有待处理 Meeting')
|
|
47
|
+
.option('--create', '创建新 Meeting')
|
|
48
|
+
.option('--task <taskId>', '关联任务 ID (用于 --create)')
|
|
49
|
+
.option('--reason <reason>', '阻塞原因 (用于 --create) 或决策理由 (用于 decide)')
|
|
50
|
+
.option('--severity <severity>', '严重程度: critical/high/medium/low (用于 --create)')
|
|
47
51
|
.option('--action <action>', '操作类型: provide-info, skip, retry, modify, decide, cancel')
|
|
48
52
|
.option('--info <info>', '提供的信息 (用于 provide-info)')
|
|
49
53
|
.option('--message <message>', '备注信息')
|
|
50
|
-
.option('--reason <reason>', '决策理由 (用于 decide)')
|
|
51
54
|
.option('--new-plan <plan>', '新方案 (用于 modify)')
|
|
52
55
|
.option('--skip-all', '跳过所有 Meeting')
|
|
53
56
|
.action(async (meetingId, options) => {
|
|
@@ -58,6 +61,39 @@ exports.meetingCommand = new commander_1.Command('meeting')
|
|
|
58
61
|
const approvalManager = new approval_manager_js_1.ApprovalManager(stateManager);
|
|
59
62
|
const meetingManager = new meeting_manager_js_1.MeetingManager(stateManager, approvalManager);
|
|
60
63
|
try {
|
|
64
|
+
// --create: 创建新 Meeting
|
|
65
|
+
if (options.create) {
|
|
66
|
+
if (!options.task) {
|
|
67
|
+
console.log('❌ 请提供 --task 参数指定关联任务');
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const task = await stateManager.getTask(options.task);
|
|
71
|
+
if (!task) {
|
|
72
|
+
console.log(`❌ 任务 ${options.task} 不存在`);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const severity = options.severity || 'medium';
|
|
76
|
+
const reason = options.reason || '未指定原因';
|
|
77
|
+
// 创建阻塞 Meeting(使用 MeetingManager)
|
|
78
|
+
const result = await meetingManager.createBlockingMeeting(options.task, reason, [severity]);
|
|
79
|
+
if (options.json) {
|
|
80
|
+
console.log(JSON.stringify({
|
|
81
|
+
status: 'created',
|
|
82
|
+
meetingId: result.meeting.id,
|
|
83
|
+
approvalId: result.approval.id,
|
|
84
|
+
taskId: options.task,
|
|
85
|
+
severity,
|
|
86
|
+
reason
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
console.log(`✅ Meeting 已创建: ${result.meeting.id}`);
|
|
91
|
+
console.log(` 关联任务: ${options.task}`);
|
|
92
|
+
console.log(` 严重程度: ${severity}`);
|
|
93
|
+
console.log(` 阻塞原因: ${reason}`);
|
|
94
|
+
}
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
61
97
|
// 获取所有 pending 的 meeting approvals
|
|
62
98
|
const pendingApprovals = await stateManager.getApprovalsByStatus('pending');
|
|
63
99
|
const meetingApprovals = pendingApprovals.filter(a => a.type === 'meeting');
|
|
@@ -49,7 +49,7 @@ exports.reportCommand = new commander_1.Command('report')
|
|
|
49
49
|
.option('--graph', '包含依赖图')
|
|
50
50
|
.action(async (options) => {
|
|
51
51
|
const basePath = process.cwd();
|
|
52
|
-
const omPath =
|
|
52
|
+
const omPath = path.join(basePath, '.openmatrix');
|
|
53
53
|
const stateManager = new state_manager_js_1.StateManager(omPath);
|
|
54
54
|
await stateManager.initialize();
|
|
55
55
|
const state = await stateManager.getState();
|
|
@@ -1,9 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.resumeCommand = void 0;
|
|
4
37
|
// src/cli/commands/resume.ts
|
|
5
38
|
const commander_1 = require("commander");
|
|
6
39
|
const state_manager_js_1 = require("../../storage/state-manager.js");
|
|
40
|
+
const path = __importStar(require("path"));
|
|
7
41
|
exports.resumeCommand = new commander_1.Command('resume')
|
|
8
42
|
.description('恢复中断或暂停的任务')
|
|
9
43
|
.argument('[taskId]', '任务ID')
|
|
@@ -11,7 +45,7 @@ exports.resumeCommand = new commander_1.Command('resume')
|
|
|
11
45
|
.option('--json', '输出 JSON 格式 (供 Skill 解析)')
|
|
12
46
|
.action(async (taskId, options) => {
|
|
13
47
|
const basePath = process.cwd();
|
|
14
|
-
const omPath =
|
|
48
|
+
const omPath = path.join(basePath, '.openmatrix');
|
|
15
49
|
const stateManager = new state_manager_js_1.StateManager(omPath);
|
|
16
50
|
await stateManager.initialize();
|
|
17
51
|
const state = await stateManager.getState();
|
|
@@ -1,80 +1,154 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.retryCommand = void 0;
|
|
4
40
|
// src/cli/commands/retry.ts
|
|
5
41
|
const commander_1 = require("commander");
|
|
6
42
|
const state_manager_js_1 = require("../../storage/state-manager.js");
|
|
7
|
-
const
|
|
43
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
44
|
+
const path = __importStar(require("path"));
|
|
8
45
|
exports.retryCommand = new commander_1.Command('retry')
|
|
9
46
|
.description('重试失败的任务')
|
|
10
|
-
.argument('[taskId]', '任务ID')
|
|
11
|
-
.option('--all', '重试所有失败任务')
|
|
12
|
-
.option('--reset', '重置重试计数')
|
|
13
|
-
.option('--json', '输出 JSON 格式
|
|
47
|
+
.argument('[taskId]', '任务ID (如 TASK-001)')
|
|
48
|
+
.option('--all', '重试所有失败任务', false)
|
|
49
|
+
.option('--reset', '重置重试计数', false)
|
|
50
|
+
.option('--json', '输出 JSON 格式')
|
|
14
51
|
.action(async (taskId, options) => {
|
|
15
52
|
const basePath = process.cwd();
|
|
16
|
-
const omPath =
|
|
53
|
+
const omPath = path.join(basePath, '.openmatrix');
|
|
17
54
|
const stateManager = new state_manager_js_1.StateManager(omPath);
|
|
18
55
|
await stateManager.initialize();
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
56
|
+
const state = await stateManager.getState();
|
|
57
|
+
// 获取失败任务列表
|
|
58
|
+
const allTasks = await stateManager.listTasks();
|
|
59
|
+
const failedTasks = allTasks.filter(t => t.status === 'failed');
|
|
60
|
+
if (failedTasks.length === 0) {
|
|
61
|
+
if (options.json) {
|
|
62
|
+
console.log(JSON.stringify({ status: 'no_failed_tasks', message: '没有失败任务' }));
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
console.log(chalk_1.default.green('✅ 没有失败任务需要重试'));
|
|
66
|
+
}
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
// 如果指定了 taskId
|
|
70
|
+
if (taskId) {
|
|
71
|
+
const task = failedTasks.find(t => t.id === taskId);
|
|
72
|
+
if (!task) {
|
|
73
|
+
if (options.json) {
|
|
74
|
+
console.log(JSON.stringify({ status: 'error', message: `任务 ${taskId} 不是失败状态` }));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
console.log(chalk_1.default.red(`❌ 任务 ${taskId} 不是失败状态`));
|
|
78
|
+
}
|
|
30
79
|
return;
|
|
31
80
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
console.log(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
console.log(
|
|
38
|
-
}
|
|
39
|
-
console.log('\n💡 使用 openmatrix retry <ID> 重试指定任务');
|
|
40
|
-
console.log(' 使用 openmatrix retry --all 重试所有任务');
|
|
81
|
+
await retryTask(stateManager, task, options.reset);
|
|
82
|
+
if (options.json) {
|
|
83
|
+
console.log(JSON.stringify({ status: 'success', taskId, reset: options.reset }));
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
console.log(chalk_1.default.green(`✅ 任务 ${taskId} 已加入重试队列`));
|
|
87
|
+
}
|
|
41
88
|
return;
|
|
42
89
|
}
|
|
43
|
-
//
|
|
90
|
+
// 如果 --all
|
|
44
91
|
if (options.all) {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
console.log(`🔄 重试 ${failed.length} 个失败任务...\n`);
|
|
48
|
-
for (const task of failed) {
|
|
49
|
-
await retryTask(stateManager, retryManager, task.id, options.reset);
|
|
50
|
-
console.log(` ✅ ${task.id}: ${task.title}`);
|
|
92
|
+
for (const task of failedTasks) {
|
|
93
|
+
await retryTask(stateManager, task, options.reset);
|
|
51
94
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
95
|
+
if (options.json) {
|
|
96
|
+
console.log(JSON.stringify({
|
|
97
|
+
status: 'success',
|
|
98
|
+
retriedCount: failedTasks.length,
|
|
99
|
+
tasks: failedTasks.map(t => t.id)
|
|
100
|
+
}));
|
|
58
101
|
}
|
|
59
|
-
|
|
60
|
-
console.log(
|
|
61
|
-
|
|
102
|
+
else {
|
|
103
|
+
console.log(chalk_1.default.green(`✅ 已重试 ${failedTasks.length} 个失败任务`));
|
|
104
|
+
}
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
// 没有参数,显示失败任务列表
|
|
108
|
+
if (options.json) {
|
|
109
|
+
console.log(JSON.stringify({
|
|
110
|
+
status: 'failed_tasks',
|
|
111
|
+
tasks: failedTasks.map(t => ({
|
|
112
|
+
id: t.id,
|
|
113
|
+
title: t.title,
|
|
114
|
+
error: t.error,
|
|
115
|
+
retryCount: t.retryCount
|
|
116
|
+
}))
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
console.log(chalk_1.default.bold.red('\n❌ 失败任务列表\n'));
|
|
121
|
+
for (let i = 0; i < failedTasks.length; i++) {
|
|
122
|
+
const task = failedTasks[i];
|
|
123
|
+
const retryInfo = `重试次数: ${task.retryCount}/${state.config.maxRetries || 3}`;
|
|
124
|
+
console.log(`[${i + 1}] ${chalk_1.default.yellow(task.id)}: ${task.title}`);
|
|
125
|
+
console.log(` 失败原因: ${task.error || '未知'}`);
|
|
126
|
+
console.log(` ${retryInfo}`);
|
|
127
|
+
console.log();
|
|
62
128
|
}
|
|
63
|
-
console.log(
|
|
64
|
-
|
|
65
|
-
console.log(
|
|
129
|
+
console.log(chalk_1.default.gray('提示: 使用 retry <taskId> 重试指定任务'));
|
|
130
|
+
console.log(chalk_1.default.gray('提示: 使用 retry --all 重试所有失败任务'));
|
|
131
|
+
console.log(chalk_1.default.gray('提示: 使用 retry --reset 重试并重置计数'));
|
|
66
132
|
}
|
|
67
|
-
console.log('\n💡 使用 /om:resume 继续执行');
|
|
68
133
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
134
|
+
/**
|
|
135
|
+
* 重试单个任务
|
|
136
|
+
*/
|
|
137
|
+
async function retryTask(stateManager, task, reset) {
|
|
138
|
+
const updates = {
|
|
139
|
+
status: 'pending'
|
|
140
|
+
};
|
|
141
|
+
if (reset) {
|
|
142
|
+
updates.retryCount = 0;
|
|
143
|
+
}
|
|
144
|
+
await stateManager.updateTask(task.id, updates);
|
|
145
|
+
// 更新全局统计
|
|
146
|
+
const state = await stateManager.getState();
|
|
147
|
+
await stateManager.updateState({
|
|
148
|
+
statistics: {
|
|
149
|
+
...state.statistics,
|
|
150
|
+
failed: state.statistics.failed - 1,
|
|
151
|
+
pending: state.statistics.pending + 1
|
|
152
|
+
}
|
|
78
153
|
});
|
|
79
|
-
retryManager.addToQueue(taskId, 'manual retry');
|
|
80
154
|
}
|
|
@@ -59,8 +59,10 @@ exports.startCommand = new commander_1.Command('start')
|
|
|
59
59
|
.option('--docs <level>', '文档级别 (full|basic|minimal|none)')
|
|
60
60
|
.option('--tasks-json <json>', 'AI 已拆分的任务 JSON (跳过自动解析)')
|
|
61
61
|
.option('--e2e-tests', '启用 E2E 测试')
|
|
62
|
-
.option('--e2e-type <type>', 'E2E 测试类型 (
|
|
62
|
+
.option('--e2e-type <type>', 'E2E 测试类型 (functional|visual)')
|
|
63
63
|
.option('--research-context <path>', '研究上下文 JSON 路径 (来自 /om:research 的 context.json)')
|
|
64
|
+
.option('--parallel', '多 Agent 并行执行 (推荐,速度快)')
|
|
65
|
+
.option('--single-agent', '单 Agent 串行执行 (上下文连贯)')
|
|
64
66
|
.action(async (input, options) => {
|
|
65
67
|
const basePath = process.cwd();
|
|
66
68
|
const omPath = path.join(basePath, '.openmatrix');
|
|
@@ -326,13 +328,19 @@ async function handleTasksJson(options, stateManager, state, omPath, basePath) {
|
|
|
326
328
|
// 解析执行模式
|
|
327
329
|
const executionMode = tasksInput.mode || options.mode || 'confirm-key';
|
|
328
330
|
const approvalPoints = resolveApprovalPoints(executionMode);
|
|
331
|
+
// 解析 Agent 执行模式
|
|
332
|
+
const agentMode = options.singleAgent ? 'single' : 'parallel';
|
|
333
|
+
// 更新 maxConcurrentAgents(单 Agent = 1,多 Agent = 3)
|
|
334
|
+
const maxConcurrent = agentMode === 'single' ? 1 : 3;
|
|
329
335
|
await stateManager.updateState({
|
|
330
336
|
status: 'running',
|
|
331
337
|
currentPhase: 'execution',
|
|
332
338
|
config: {
|
|
333
339
|
...state.config,
|
|
334
340
|
approvalPoints: approvalPoints,
|
|
335
|
-
quality: qualityConfig
|
|
341
|
+
quality: qualityConfig,
|
|
342
|
+
agentMode,
|
|
343
|
+
maxConcurrentAgents: maxConcurrent
|
|
336
344
|
}
|
|
337
345
|
});
|
|
338
346
|
// 创建审批请求(如果有审批点)
|
|
@@ -394,7 +402,9 @@ async function handleTasksJson(options, stateManager, state, omPath, basePath) {
|
|
|
394
402
|
title: resolvedInput.title,
|
|
395
403
|
description: resolvedInput.description,
|
|
396
404
|
quality: qualityLevel,
|
|
397
|
-
domain: researchContext?.domain
|
|
405
|
+
domain: researchContext?.domain,
|
|
406
|
+
agentMode,
|
|
407
|
+
maxConcurrent
|
|
398
408
|
}
|
|
399
409
|
}));
|
|
400
410
|
}
|
|
@@ -402,6 +412,7 @@ async function handleTasksJson(options, stateManager, state, omPath, basePath) {
|
|
|
402
412
|
console.log(`\n📋 ${resolvedInput.title} - ${subTasks.length} 个子任务已创建`);
|
|
403
413
|
console.log(`🎯 执行模式:${executionMode}`);
|
|
404
414
|
console.log(` 质量级别:${qualityLevel}`);
|
|
415
|
+
console.log(` Agent 模式:${agentMode === 'parallel' ? '多 Agent 并行' : '单 Agent 串行'}`);
|
|
405
416
|
console.log('\n🚀 等待 Skill 执行任务...');
|
|
406
417
|
console.log(' 使用 /om:status 查看进度');
|
|
407
418
|
}
|
|
@@ -45,14 +45,17 @@ const progress_reporter_js_1 = require("../../utils/progress-reporter.js");
|
|
|
45
45
|
const chalk_1 = __importDefault(require("chalk"));
|
|
46
46
|
const chokidar = __importStar(require("chokidar"));
|
|
47
47
|
const readline = __importStar(require("readline"));
|
|
48
|
+
const path = __importStar(require("path"));
|
|
48
49
|
exports.statusCommand = new commander_1.Command('status')
|
|
49
|
-
.description('
|
|
50
|
-
.option('--json', '
|
|
51
|
-
.option('--graph', '
|
|
52
|
-
.option('--detailed', '
|
|
53
|
-
.option('--watch', '
|
|
50
|
+
.description('显示当前执行状态')
|
|
51
|
+
.option('--json', '输出 JSON 格式')
|
|
52
|
+
.option('--graph', '显示依赖关系图')
|
|
53
|
+
.option('--detailed', '显示详细任务信息')
|
|
54
|
+
.option('--watch', '实时监控状态变化')
|
|
54
55
|
.action(async (options) => {
|
|
55
|
-
const
|
|
56
|
+
const basePath = process.cwd();
|
|
57
|
+
const omPath = path.join(basePath, '.openmatrix');
|
|
58
|
+
const manager = new state_manager_js_1.StateManager(omPath);
|
|
56
59
|
const reporter = new progress_reporter_js_1.ProgressReporter({ width: 30 });
|
|
57
60
|
if (options.watch) {
|
|
58
61
|
await runWatchMode(manager, reporter, options);
|
|
@@ -86,12 +89,12 @@ async function showStatus(manager, reporter, options) {
|
|
|
86
89
|
return;
|
|
87
90
|
}
|
|
88
91
|
// Header
|
|
89
|
-
console.log(chalk_1.default.bold('\n📊 OpenMatrix
|
|
92
|
+
console.log(chalk_1.default.bold('\n📊 OpenMatrix 状态'));
|
|
90
93
|
console.log('━'.repeat(42));
|
|
91
94
|
console.log(`\n Run ID: ${chalk_1.default.cyan(state.runId)}`);
|
|
92
|
-
console.log(`
|
|
93
|
-
console.log(`
|
|
94
|
-
console.log(`
|
|
95
|
+
console.log(` 状态: ${formatStatus(state.status)}`);
|
|
96
|
+
console.log(` 阶段: ${chalk_1.default.yellow(state.currentPhase)}`);
|
|
97
|
+
console.log(` 开始时间: ${state.startedAt}\n`);
|
|
95
98
|
// Progress visualization
|
|
96
99
|
if (state.statistics.totalTasks > 0) {
|
|
97
100
|
console.log(reporter.renderStatistics({
|
|
@@ -104,14 +107,14 @@ async function showStatus(manager, reporter, options) {
|
|
|
104
107
|
}
|
|
105
108
|
// Dependency graph
|
|
106
109
|
if (options.graph && tasks.length > 0) {
|
|
107
|
-
console.log('\n📊
|
|
110
|
+
console.log('\n📊 任务依赖关系图');
|
|
108
111
|
console.log('━'.repeat(42));
|
|
109
112
|
console.log(reporter.renderDependencyGraph(tasks));
|
|
110
113
|
console.log();
|
|
111
114
|
}
|
|
112
115
|
// Detailed task list
|
|
113
116
|
if (options.detailed && tasks.length > 0) {
|
|
114
|
-
console.log('\n📋
|
|
117
|
+
console.log('\n📋 任务详情');
|
|
115
118
|
console.log('━'.repeat(42));
|
|
116
119
|
for (const task of tasks) {
|
|
117
120
|
console.log(reporter.renderTaskCard(task));
|
|
@@ -120,7 +123,7 @@ async function showStatus(manager, reporter, options) {
|
|
|
120
123
|
}
|
|
121
124
|
else if (tasks.length > 0) {
|
|
122
125
|
// Simple task list
|
|
123
|
-
console.log(chalk_1.default.bold('\n📋
|
|
126
|
+
console.log(chalk_1.default.bold('\n📋 任务列表'));
|
|
124
127
|
for (const task of tasks) {
|
|
125
128
|
const icon = reporter.getStatusIcon(task.status);
|
|
126
129
|
console.log(` ${icon} ${task.id}: ${task.title}`);
|
|
@@ -128,15 +131,15 @@ async function showStatus(manager, reporter, options) {
|
|
|
128
131
|
console.log();
|
|
129
132
|
}
|
|
130
133
|
// Quick tips
|
|
131
|
-
console.log(chalk_1.default.gray('💡
|
|
132
|
-
console.log(chalk_1.default.gray(' --watch
|
|
133
|
-
console.log(chalk_1.default.gray(' --graph
|
|
134
|
-
console.log(chalk_1.default.gray(' --detailed
|
|
135
|
-
console.log(chalk_1.default.gray(' --json
|
|
134
|
+
console.log(chalk_1.default.gray('💡 提示:'));
|
|
135
|
+
console.log(chalk_1.default.gray(' --watch 实时状态更新'));
|
|
136
|
+
console.log(chalk_1.default.gray(' --graph 显示依赖关系图'));
|
|
137
|
+
console.log(chalk_1.default.gray(' --detailed 显示详细任务信息'));
|
|
138
|
+
console.log(chalk_1.default.gray(' --json 输出 JSON 格式'));
|
|
136
139
|
console.log();
|
|
137
140
|
}
|
|
138
141
|
catch (error) {
|
|
139
|
-
console.error(chalk_1.default.red('
|
|
142
|
+
console.error(chalk_1.default.red('错误:'), error);
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
145
|
/**
|
|
@@ -151,24 +154,24 @@ async function runWatchMode(manager, reporter, options) {
|
|
|
151
154
|
// 渲染状态
|
|
152
155
|
const renderStatus = async () => {
|
|
153
156
|
clearScreen();
|
|
154
|
-
console.log(chalk_1.default.bold.cyan('📊 OpenMatrix
|
|
157
|
+
console.log(chalk_1.default.bold.cyan('📊 OpenMatrix 实时监控'));
|
|
155
158
|
console.log(chalk_1.default.gray('━'.repeat(42)));
|
|
156
|
-
console.log(chalk_1.default.gray('
|
|
159
|
+
console.log(chalk_1.default.gray('按 Ctrl+C 退出\n'));
|
|
157
160
|
try {
|
|
158
161
|
const state = await manager.getState();
|
|
159
162
|
const tasks = await manager.listTasks();
|
|
160
163
|
// 状态概览
|
|
161
164
|
console.log(`Run ID: ${chalk_1.default.cyan(state.runId)}`);
|
|
162
|
-
console.log(
|
|
163
|
-
console.log(
|
|
164
|
-
console.log(
|
|
165
|
+
console.log(`状态: ${formatStatus(state.status)}`);
|
|
166
|
+
console.log(`阶段: ${chalk_1.default.yellow(state.currentPhase)}`);
|
|
167
|
+
console.log(`更新时间: ${chalk_1.default.gray(new Date().toLocaleTimeString())}\n`);
|
|
165
168
|
// 进度条
|
|
166
169
|
if (state.statistics.totalTasks > 0) {
|
|
167
|
-
console.log(reporter.renderProgressBar(state.statistics.completed, state.statistics.totalTasks, '
|
|
170
|
+
console.log(reporter.renderProgressBar(state.statistics.completed, state.statistics.totalTasks, '总体进度'));
|
|
168
171
|
}
|
|
169
172
|
// 任务列表 (带动画图标)
|
|
170
173
|
if (tasks.length > 0) {
|
|
171
|
-
console.log(chalk_1.default.bold('\n📋
|
|
174
|
+
console.log(chalk_1.default.bold('\n📋 任务列表:'));
|
|
172
175
|
for (const task of tasks) {
|
|
173
176
|
const icon = reporter.getStatusIcon(task.status);
|
|
174
177
|
const statusColor = getStatusColor(task.status);
|
|
@@ -177,10 +180,10 @@ async function runWatchMode(manager, reporter, options) {
|
|
|
177
180
|
}
|
|
178
181
|
// 底部提示
|
|
179
182
|
console.log(chalk_1.default.gray('\n━'.repeat(42)));
|
|
180
|
-
console.log(chalk_1.default.gray('
|
|
183
|
+
console.log(chalk_1.default.gray('正在监听状态变化...'));
|
|
181
184
|
}
|
|
182
185
|
catch (error) {
|
|
183
|
-
console.error(chalk_1.default.red('
|
|
186
|
+
console.error(chalk_1.default.red('错误:'), error);
|
|
184
187
|
}
|
|
185
188
|
};
|
|
186
189
|
// 初始渲染
|
|
@@ -201,7 +204,7 @@ async function runWatchMode(manager, reporter, options) {
|
|
|
201
204
|
});
|
|
202
205
|
rl.on('close', () => {
|
|
203
206
|
watcher.close();
|
|
204
|
-
console.log(chalk_1.default.gray('\n👋
|
|
207
|
+
console.log(chalk_1.default.gray('\n👋 监控模式已结束'));
|
|
205
208
|
process.exit(0);
|
|
206
209
|
});
|
|
207
210
|
// 保持进程运行
|
|
@@ -107,7 +107,10 @@ exports.stepCommand = new commander_1.Command('step')
|
|
|
107
107
|
description: subagentTask.description,
|
|
108
108
|
prompt: subagentTask.prompt,
|
|
109
109
|
isolation: subagentTask.isolation,
|
|
110
|
-
|
|
110
|
+
taskId: subagentTask.taskId,
|
|
111
|
+
agentType: subagentTask.agentType,
|
|
112
|
+
timeout: subagentTask.timeout,
|
|
113
|
+
needsApproval: subagentTask.needsApproval
|
|
111
114
|
},
|
|
112
115
|
statistics: {
|
|
113
116
|
total: stats.totalTasks,
|
|
@@ -12,6 +12,13 @@ exports.AIReviewer = void 0;
|
|
|
12
12
|
* 5. 测试覆盖检查
|
|
13
13
|
*/
|
|
14
14
|
class AIReviewer {
|
|
15
|
+
runId = '';
|
|
16
|
+
/**
|
|
17
|
+
* 设置当前运行 ID
|
|
18
|
+
*/
|
|
19
|
+
setRunId(runId) {
|
|
20
|
+
this.runId = runId;
|
|
21
|
+
}
|
|
15
22
|
/**
|
|
16
23
|
* 生成 AI Review 提示词
|
|
17
24
|
*/
|
|
@@ -65,7 +72,7 @@ class AIReviewer {
|
|
|
65
72
|
|
|
66
73
|
## 输出格式
|
|
67
74
|
|
|
68
|
-
在 \`.openmatrix/tasks/${task.id}/artifacts/\` 目录下创建:
|
|
75
|
+
在 \`.openmatrix/${this.runId}/tasks/${task.id}/artifacts/\` 目录下创建:
|
|
69
76
|
|
|
70
77
|
### ai-review-report.md
|
|
71
78
|
|
|
@@ -295,7 +302,7 @@ ${reviewPrompt}
|
|
|
295
302
|
|
|
296
303
|
## 输出要求
|
|
297
304
|
|
|
298
|
-
在 \`.openmatrix/tasks/${task.id}/artifacts/\` 目录下创建:
|
|
305
|
+
在 \`.openmatrix/${this.runId}/tasks/${task.id}/artifacts/\` 目录下创建:
|
|
299
306
|
- \`accept-report.md\` - 验收报告
|
|
300
307
|
- \`ai-review-report.md\` - AI 审查报告
|
|
301
308
|
|
|
@@ -37,6 +37,7 @@ exports.ContextCollector = void 0;
|
|
|
37
37
|
// src/orchestrator/context-collector.ts
|
|
38
38
|
const fs = __importStar(require("fs"));
|
|
39
39
|
const path = __importStar(require("path"));
|
|
40
|
+
const error_handler_js_1 = require("../utils/error-handler.js");
|
|
40
41
|
/**
|
|
41
42
|
* 根据问题类型收集上下文信息
|
|
42
43
|
*/
|
|
@@ -53,7 +54,9 @@ class ContextCollector {
|
|
|
53
54
|
try {
|
|
54
55
|
context.state = JSON.parse(fs.readFileSync(statePath, 'utf-8'));
|
|
55
56
|
}
|
|
56
|
-
catch {
|
|
57
|
+
catch (error) {
|
|
58
|
+
(0, error_handler_js_1.logError)(error, { operation: 'readState', file: statePath });
|
|
59
|
+
}
|
|
57
60
|
}
|
|
58
61
|
// 读取任务文件
|
|
59
62
|
const taskPath = path.join(this.basePath, 'tasks', `${taskId}.json`);
|
|
@@ -61,7 +64,9 @@ class ContextCollector {
|
|
|
61
64
|
try {
|
|
62
65
|
context.task = JSON.parse(fs.readFileSync(taskPath, 'utf-8'));
|
|
63
66
|
}
|
|
64
|
-
catch {
|
|
67
|
+
catch (error) {
|
|
68
|
+
(0, error_handler_js_1.logError)(error, { operation: 'readTask', file: taskPath });
|
|
69
|
+
}
|
|
65
70
|
}
|
|
66
71
|
// 读取日志
|
|
67
72
|
const logPath = path.join(this.basePath, 'logs');
|
|
@@ -75,7 +80,9 @@ class ContextCollector {
|
|
|
75
80
|
if (logs)
|
|
76
81
|
context.logs = logs;
|
|
77
82
|
}
|
|
78
|
-
catch {
|
|
83
|
+
catch (error) {
|
|
84
|
+
(0, error_handler_js_1.logError)(error, { operation: 'readLogs', file: logPath });
|
|
85
|
+
}
|
|
79
86
|
}
|
|
80
87
|
return context;
|
|
81
88
|
}
|
|
@@ -139,7 +146,9 @@ class ContextCollector {
|
|
|
139
146
|
try {
|
|
140
147
|
context.systemState = JSON.parse(fs.readFileSync(statePath, 'utf-8'));
|
|
141
148
|
}
|
|
142
|
-
catch {
|
|
149
|
+
catch (error) {
|
|
150
|
+
(0, error_handler_js_1.logError)(error, { operation: 'readSystemState', file: statePath });
|
|
151
|
+
}
|
|
143
152
|
}
|
|
144
153
|
return context;
|
|
145
154
|
}
|
|
@@ -161,7 +170,10 @@ class ContextCollector {
|
|
|
161
170
|
}
|
|
162
171
|
}
|
|
163
172
|
}
|
|
164
|
-
catch {
|
|
173
|
+
catch (error) {
|
|
174
|
+
// 目录扫描失败可能是权限问题,记录但不中断
|
|
175
|
+
(0, error_handler_js_1.logError)(error, { operation: 'scanFiles', file: dir });
|
|
176
|
+
}
|
|
165
177
|
return results;
|
|
166
178
|
}
|
|
167
179
|
}
|