openmatrix 0.1.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/README.md +512 -0
- package/dist/agents/agent-runner.d.ts +152 -0
- package/dist/agents/agent-runner.js +656 -0
- package/dist/agents/base-agent.d.ts +46 -0
- package/dist/agents/base-agent.js +17 -0
- package/dist/agents/impl/coder-agent.d.ts +17 -0
- package/dist/agents/impl/coder-agent.js +96 -0
- package/dist/agents/impl/executor-agent.d.ts +32 -0
- package/dist/agents/impl/executor-agent.js +168 -0
- package/dist/agents/impl/index.d.ts +6 -0
- package/dist/agents/impl/index.js +17 -0
- package/dist/agents/impl/planner-agent.d.ts +24 -0
- package/dist/agents/impl/planner-agent.js +126 -0
- package/dist/agents/impl/researcher-agent.d.ts +17 -0
- package/dist/agents/impl/researcher-agent.js +133 -0
- package/dist/agents/impl/reviewer-agent.d.ts +17 -0
- package/dist/agents/impl/reviewer-agent.js +120 -0
- package/dist/agents/impl/tester-agent.d.ts +17 -0
- package/dist/agents/impl/tester-agent.js +110 -0
- package/dist/cli/commands/approve.d.ts +2 -0
- package/dist/cli/commands/approve.js +87 -0
- package/dist/cli/commands/meeting.d.ts +2 -0
- package/dist/cli/commands/meeting.js +245 -0
- package/dist/cli/commands/report.d.ts +2 -0
- package/dist/cli/commands/report.js +202 -0
- package/dist/cli/commands/resume.d.ts +2 -0
- package/dist/cli/commands/resume.js +104 -0
- package/dist/cli/commands/retry.d.ts +2 -0
- package/dist/cli/commands/retry.js +79 -0
- package/dist/cli/commands/start.d.ts +2 -0
- package/dist/cli/commands/start.js +252 -0
- package/dist/cli/commands/status.d.ts +2 -0
- package/dist/cli/commands/status.js +226 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +26 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -0
- package/dist/orchestrator/ai-reviewer.d.ts +50 -0
- package/dist/orchestrator/ai-reviewer.js +326 -0
- package/dist/orchestrator/approval-manager.d.ts +62 -0
- package/dist/orchestrator/approval-manager.js +160 -0
- package/dist/orchestrator/executor.d.ts +114 -0
- package/dist/orchestrator/executor.js +325 -0
- package/dist/orchestrator/full-test-runner.d.ts +122 -0
- package/dist/orchestrator/full-test-runner.js +335 -0
- package/dist/orchestrator/git-commit-manager.d.ts +75 -0
- package/dist/orchestrator/git-commit-manager.js +248 -0
- package/dist/orchestrator/interactive-question-generator.d.ts +90 -0
- package/dist/orchestrator/interactive-question-generator.js +312 -0
- package/dist/orchestrator/meeting-manager.d.ts +85 -0
- package/dist/orchestrator/meeting-manager.js +222 -0
- package/dist/orchestrator/phase-executor.d.ts +198 -0
- package/dist/orchestrator/phase-executor.js +796 -0
- package/dist/orchestrator/question-generator.d.ts +22 -0
- package/dist/orchestrator/question-generator.js +102 -0
- package/dist/orchestrator/retry-manager.d.ts +41 -0
- package/dist/orchestrator/retry-manager.js +83 -0
- package/dist/orchestrator/scheduler.d.ts +62 -0
- package/dist/orchestrator/scheduler.js +148 -0
- package/dist/orchestrator/state-machine.d.ts +53 -0
- package/dist/orchestrator/state-machine.js +124 -0
- package/dist/orchestrator/task-parser.d.ts +7 -0
- package/dist/orchestrator/task-parser.js +63 -0
- package/dist/orchestrator/task-planner.d.ts +71 -0
- package/dist/orchestrator/task-planner.js +316 -0
- package/dist/storage/file-store.d.ts +12 -0
- package/dist/storage/file-store.js +80 -0
- package/dist/storage/state-manager.d.ts +31 -0
- package/dist/storage/state-manager.js +202 -0
- package/dist/types/index.d.ts +193 -0
- package/dist/types/index.js +30 -0
- package/dist/utils/logger.d.ts +41 -0
- package/dist/utils/logger.js +166 -0
- package/dist/utils/progress-reporter.d.ts +116 -0
- package/dist/utils/progress-reporter.js +287 -0
- package/package.json +50 -0
- package/scripts/build-check.js +19 -0
- package/scripts/install-skills.js +51 -0
- package/skills/approve.md +253 -0
- package/skills/meeting.md +346 -0
- package/skills/report.md +100 -0
- package/skills/resume.md +68 -0
- package/skills/retry.md +61 -0
- package/skills/start.md +449 -0
- package/skills/status.md +46 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { StateManager } from '../storage/state-manager.js';
|
|
2
|
+
import { ApprovalManager } from './approval-manager.js';
|
|
3
|
+
import type { Approval } from '../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Meeting 状态
|
|
6
|
+
*/
|
|
7
|
+
export type MeetingStatus = 'pending' | 'in_progress' | 'resolved' | 'cancelled';
|
|
8
|
+
/**
|
|
9
|
+
* Meeting 类型
|
|
10
|
+
*/
|
|
11
|
+
export type MeetingType = 'blocking' | 'decision' | 'review' | 'planning';
|
|
12
|
+
/**
|
|
13
|
+
* Meeting 记录
|
|
14
|
+
*/
|
|
15
|
+
export interface Meeting {
|
|
16
|
+
id: string;
|
|
17
|
+
type: MeetingType;
|
|
18
|
+
status: MeetingStatus;
|
|
19
|
+
taskId: string;
|
|
20
|
+
title: string;
|
|
21
|
+
description: string;
|
|
22
|
+
blockingReason?: string;
|
|
23
|
+
impactScope: string[];
|
|
24
|
+
participants: string[];
|
|
25
|
+
resolution?: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
startedAt?: string;
|
|
28
|
+
resolvedAt?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* MeetingManager - Meeting 管理器
|
|
32
|
+
*
|
|
33
|
+
* 功能:
|
|
34
|
+
* 1. 创建和管理 Meeting
|
|
35
|
+
* 2. 跟踪 Meeting 状态流转
|
|
36
|
+
* 3. 与审批流程集成
|
|
37
|
+
* 4. 自动触发条件检测
|
|
38
|
+
*/
|
|
39
|
+
export declare class MeetingManager {
|
|
40
|
+
private stateManager;
|
|
41
|
+
private approvalManager;
|
|
42
|
+
constructor(stateManager: StateManager, approvalManager: ApprovalManager);
|
|
43
|
+
/**
|
|
44
|
+
* 创建阻塞问题 Meeting
|
|
45
|
+
*/
|
|
46
|
+
createBlockingMeeting(taskId: string, blockingReason: string, impactScope: string[]): Promise<{
|
|
47
|
+
meeting: Meeting;
|
|
48
|
+
approval: Approval;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* 创建决策 Meeting
|
|
52
|
+
*/
|
|
53
|
+
createDecisionMeeting(taskId: string, decision: string, options: string[]): Promise<{
|
|
54
|
+
meeting: Meeting;
|
|
55
|
+
approval: Approval;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* 开始 Meeting
|
|
59
|
+
*/
|
|
60
|
+
startMeeting(meetingId: string): Promise<Meeting>;
|
|
61
|
+
/**
|
|
62
|
+
* 解决 Meeting
|
|
63
|
+
*/
|
|
64
|
+
resolveMeeting(meetingId: string, resolution: string): Promise<Meeting>;
|
|
65
|
+
/**
|
|
66
|
+
* 取消 Meeting
|
|
67
|
+
*/
|
|
68
|
+
cancelMeeting(meetingId: string, reason: string): Promise<Meeting>;
|
|
69
|
+
/**
|
|
70
|
+
* 获取待处理的 Meeting
|
|
71
|
+
*/
|
|
72
|
+
getPendingMeetings(): Promise<Meeting[]>;
|
|
73
|
+
/**
|
|
74
|
+
* 获取进行中的 Meeting
|
|
75
|
+
*/
|
|
76
|
+
getActiveMeetings(): Promise<Meeting[]>;
|
|
77
|
+
/**
|
|
78
|
+
* 检查是否有阻塞的 Meeting
|
|
79
|
+
*/
|
|
80
|
+
hasBlockingMeetings(): Promise<boolean>;
|
|
81
|
+
/**
|
|
82
|
+
* 生成 Meeting 报告
|
|
83
|
+
*/
|
|
84
|
+
generateMeetingReport(meeting: Meeting): string;
|
|
85
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MeetingManager = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* MeetingManager - Meeting 管理器
|
|
6
|
+
*
|
|
7
|
+
* 功能:
|
|
8
|
+
* 1. 创建和管理 Meeting
|
|
9
|
+
* 2. 跟踪 Meeting 状态流转
|
|
10
|
+
* 3. 与审批流程集成
|
|
11
|
+
* 4. 自动触发条件检测
|
|
12
|
+
*/
|
|
13
|
+
class MeetingManager {
|
|
14
|
+
stateManager;
|
|
15
|
+
approvalManager;
|
|
16
|
+
constructor(stateManager, approvalManager) {
|
|
17
|
+
this.stateManager = stateManager;
|
|
18
|
+
this.approvalManager = approvalManager;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 创建阻塞问题 Meeting
|
|
22
|
+
*/
|
|
23
|
+
async createBlockingMeeting(taskId, blockingReason, impactScope) {
|
|
24
|
+
const meetingId = `meeting-${Date.now().toString(36)}`;
|
|
25
|
+
const now = new Date().toISOString();
|
|
26
|
+
const meeting = {
|
|
27
|
+
id: meetingId,
|
|
28
|
+
type: 'blocking',
|
|
29
|
+
status: 'pending',
|
|
30
|
+
taskId,
|
|
31
|
+
title: `🔴 阻塞问题: ${blockingReason.slice(0, 50)}...`,
|
|
32
|
+
description: `任务 ${taskId} 遇到阻塞问题,需要人工干预`,
|
|
33
|
+
blockingReason,
|
|
34
|
+
impactScope,
|
|
35
|
+
participants: ['user'],
|
|
36
|
+
createdAt: now
|
|
37
|
+
};
|
|
38
|
+
// 保存 Meeting
|
|
39
|
+
await this.stateManager.saveMeeting(meeting);
|
|
40
|
+
// 创建审批
|
|
41
|
+
const approval = await this.approvalManager.createApproval({
|
|
42
|
+
type: 'meeting',
|
|
43
|
+
taskId,
|
|
44
|
+
title: meeting.title,
|
|
45
|
+
description: `
|
|
46
|
+
## 阻塞问题描述
|
|
47
|
+
|
|
48
|
+
**任务**: ${taskId}
|
|
49
|
+
**原因**: ${blockingReason}
|
|
50
|
+
|
|
51
|
+
## 影响范围
|
|
52
|
+
|
|
53
|
+
${impactScope.map(item => `- ${item}`).join('\n')}
|
|
54
|
+
|
|
55
|
+
## 需要的行动
|
|
56
|
+
|
|
57
|
+
请选择以下操作之一:
|
|
58
|
+
|
|
59
|
+
1. **提供信息** - 提供解决阻塞所需的信息
|
|
60
|
+
2. **跳过任务** - 标记任务为可选,跳过继续执行
|
|
61
|
+
3. **修改方案** - 调整任务方案或参数
|
|
62
|
+
4. **取消执行** - 停止整个执行流程
|
|
63
|
+
`,
|
|
64
|
+
content: JSON.stringify({ meetingId, blockingReason, impactScope })
|
|
65
|
+
});
|
|
66
|
+
return { meeting, approval };
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* 创建决策 Meeting
|
|
70
|
+
*/
|
|
71
|
+
async createDecisionMeeting(taskId, decision, options) {
|
|
72
|
+
const meetingId = `meeting-${Date.now().toString(36)}`;
|
|
73
|
+
const now = new Date().toISOString();
|
|
74
|
+
const meeting = {
|
|
75
|
+
id: meetingId,
|
|
76
|
+
type: 'decision',
|
|
77
|
+
status: 'pending',
|
|
78
|
+
taskId,
|
|
79
|
+
title: `🤔 需要决策: ${decision.slice(0, 50)}...`,
|
|
80
|
+
description: `需要用户做出技术决策`,
|
|
81
|
+
impactScope: [],
|
|
82
|
+
participants: ['user'],
|
|
83
|
+
createdAt: now
|
|
84
|
+
};
|
|
85
|
+
await this.stateManager.saveMeeting(meeting);
|
|
86
|
+
const approval = await this.approvalManager.createApproval({
|
|
87
|
+
type: 'meeting',
|
|
88
|
+
taskId,
|
|
89
|
+
title: meeting.title,
|
|
90
|
+
description: `
|
|
91
|
+
## 决策点
|
|
92
|
+
|
|
93
|
+
**任务**: ${taskId}
|
|
94
|
+
**问题**: ${decision}
|
|
95
|
+
|
|
96
|
+
## 可选方案
|
|
97
|
+
|
|
98
|
+
${options.map((opt, i) => `${i + 1}. ${opt}`).join('\n')}
|
|
99
|
+
|
|
100
|
+
请在审批时提供您的选择。
|
|
101
|
+
`,
|
|
102
|
+
content: JSON.stringify({ meetingId, decision, options })
|
|
103
|
+
});
|
|
104
|
+
return { meeting, approval };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* 开始 Meeting
|
|
108
|
+
*/
|
|
109
|
+
async startMeeting(meetingId) {
|
|
110
|
+
const meeting = await this.stateManager.getMeeting(meetingId);
|
|
111
|
+
if (!meeting) {
|
|
112
|
+
throw new Error(`Meeting ${meetingId} not found`);
|
|
113
|
+
}
|
|
114
|
+
const updatedMeeting = {
|
|
115
|
+
...meeting,
|
|
116
|
+
status: 'in_progress',
|
|
117
|
+
startedAt: new Date().toISOString()
|
|
118
|
+
};
|
|
119
|
+
await this.stateManager.saveMeeting(updatedMeeting);
|
|
120
|
+
return updatedMeeting;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* 解决 Meeting
|
|
124
|
+
*/
|
|
125
|
+
async resolveMeeting(meetingId, resolution) {
|
|
126
|
+
const meeting = await this.stateManager.getMeeting(meetingId);
|
|
127
|
+
if (!meeting) {
|
|
128
|
+
throw new Error(`Meeting ${meetingId} not found`);
|
|
129
|
+
}
|
|
130
|
+
const updatedMeeting = {
|
|
131
|
+
...meeting,
|
|
132
|
+
status: 'resolved',
|
|
133
|
+
resolution,
|
|
134
|
+
resolvedAt: new Date().toISOString()
|
|
135
|
+
};
|
|
136
|
+
await this.stateManager.saveMeeting(updatedMeeting);
|
|
137
|
+
// 更新关联任务状态
|
|
138
|
+
if (meeting.type === 'blocking') {
|
|
139
|
+
// 将任务从 waiting 恢复到 pending
|
|
140
|
+
const task = await this.stateManager.getTask(meeting.taskId);
|
|
141
|
+
if (task && task.status === 'waiting') {
|
|
142
|
+
await this.stateManager.updateTask(meeting.taskId, {
|
|
143
|
+
status: 'pending',
|
|
144
|
+
error: undefined
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return updatedMeeting;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* 取消 Meeting
|
|
152
|
+
*/
|
|
153
|
+
async cancelMeeting(meetingId, reason) {
|
|
154
|
+
const meeting = await this.stateManager.getMeeting(meetingId);
|
|
155
|
+
if (!meeting) {
|
|
156
|
+
throw new Error(`Meeting ${meetingId} not found`);
|
|
157
|
+
}
|
|
158
|
+
const updatedMeeting = {
|
|
159
|
+
...meeting,
|
|
160
|
+
status: 'cancelled',
|
|
161
|
+
resolution: `Cancelled: ${reason}`,
|
|
162
|
+
resolvedAt: new Date().toISOString()
|
|
163
|
+
};
|
|
164
|
+
await this.stateManager.saveMeeting(updatedMeeting);
|
|
165
|
+
return updatedMeeting;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* 获取待处理的 Meeting
|
|
169
|
+
*/
|
|
170
|
+
async getPendingMeetings() {
|
|
171
|
+
return this.stateManager.getMeetingsByStatus('pending');
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 获取进行中的 Meeting
|
|
175
|
+
*/
|
|
176
|
+
async getActiveMeetings() {
|
|
177
|
+
return this.stateManager.getMeetingsByStatus('in_progress');
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* 检查是否有阻塞的 Meeting
|
|
181
|
+
*/
|
|
182
|
+
async hasBlockingMeetings() {
|
|
183
|
+
const pending = await this.getPendingMeetings();
|
|
184
|
+
const active = await this.getActiveMeetings();
|
|
185
|
+
return [...pending, ...active].some(m => m.type === 'blocking');
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* 生成 Meeting 报告
|
|
189
|
+
*/
|
|
190
|
+
generateMeetingReport(meeting) {
|
|
191
|
+
const lines = [];
|
|
192
|
+
lines.push(`# Meeting 报告: ${meeting.id}`);
|
|
193
|
+
lines.push('');
|
|
194
|
+
lines.push(`**类型**: ${meeting.type}`);
|
|
195
|
+
lines.push(`**状态**: ${meeting.status}`);
|
|
196
|
+
lines.push(`**任务**: ${meeting.taskId}`);
|
|
197
|
+
lines.push(`**创建时间**: ${meeting.createdAt}`);
|
|
198
|
+
lines.push('');
|
|
199
|
+
if (meeting.blockingReason) {
|
|
200
|
+
lines.push('## 阻塞原因');
|
|
201
|
+
lines.push(meeting.blockingReason);
|
|
202
|
+
lines.push('');
|
|
203
|
+
}
|
|
204
|
+
if (meeting.impactScope.length > 0) {
|
|
205
|
+
lines.push('## 影响范围');
|
|
206
|
+
for (const item of meeting.impactScope) {
|
|
207
|
+
lines.push(`- ${item}`);
|
|
208
|
+
}
|
|
209
|
+
lines.push('');
|
|
210
|
+
}
|
|
211
|
+
if (meeting.resolution) {
|
|
212
|
+
lines.push('## 解决方案');
|
|
213
|
+
lines.push(meeting.resolution);
|
|
214
|
+
lines.push('');
|
|
215
|
+
}
|
|
216
|
+
if (meeting.resolvedAt) {
|
|
217
|
+
lines.push(`**解决时间**: ${meeting.resolvedAt}`);
|
|
218
|
+
}
|
|
219
|
+
return lines.join('\n');
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
exports.MeetingManager = MeetingManager;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { StateManager } from '../storage/state-manager.js';
|
|
2
|
+
import { ApprovalManager } from './approval-manager.js';
|
|
3
|
+
import { AgentRunner, type SubagentTask, type UserContext } from '../agents/agent-runner.js';
|
|
4
|
+
import { GitCommitManager } from './git-commit-manager.js';
|
|
5
|
+
import type { Task, QualityConfig, QualityReport } from '../types/index.js';
|
|
6
|
+
export type Phase = 'develop' | 'verify' | 'accept' | 'tdd';
|
|
7
|
+
export interface PhaseResult {
|
|
8
|
+
phase: Phase;
|
|
9
|
+
success: boolean;
|
|
10
|
+
output?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
duration: number;
|
|
13
|
+
artifacts: string[];
|
|
14
|
+
nextPhase?: Phase;
|
|
15
|
+
needsApproval: boolean;
|
|
16
|
+
/** 质量报告 (verify 阶段产出) */
|
|
17
|
+
qualityReport?: QualityReport;
|
|
18
|
+
}
|
|
19
|
+
export interface BuildTestResult {
|
|
20
|
+
compile: boolean;
|
|
21
|
+
staticAnalysis: boolean;
|
|
22
|
+
dependencies: boolean;
|
|
23
|
+
package: boolean;
|
|
24
|
+
errors: string[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 质量门禁结果
|
|
28
|
+
*/
|
|
29
|
+
export interface QualityGateResult {
|
|
30
|
+
passed: boolean;
|
|
31
|
+
tests: {
|
|
32
|
+
passed: number;
|
|
33
|
+
failed: number;
|
|
34
|
+
coverage: number;
|
|
35
|
+
};
|
|
36
|
+
build: {
|
|
37
|
+
success: boolean;
|
|
38
|
+
errors: string[];
|
|
39
|
+
};
|
|
40
|
+
lint: {
|
|
41
|
+
errors: number;
|
|
42
|
+
warnings: number;
|
|
43
|
+
};
|
|
44
|
+
security: {
|
|
45
|
+
vulnerabilities: number;
|
|
46
|
+
};
|
|
47
|
+
acceptance: {
|
|
48
|
+
met: number;
|
|
49
|
+
total: number;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* PhaseExecutor - 四阶段验证执行器 (增强版)
|
|
54
|
+
*
|
|
55
|
+
* 每个任务经历四个阶段 (TDD 模式):
|
|
56
|
+
* 0. TDD - 先写测试 (可选)
|
|
57
|
+
* 1. Develop - 开发实现
|
|
58
|
+
* 2. Verify - 严格质量门禁 (测试/构建/Lint/安全/验收)
|
|
59
|
+
* 3. Accept - 最终验收
|
|
60
|
+
*
|
|
61
|
+
* 质量级别:
|
|
62
|
+
* - fast: 无质量门禁,最快
|
|
63
|
+
* - balanced: 基础门禁 (60%覆盖率, Lint, 安全扫描)
|
|
64
|
+
* - strict: 严格门禁 (TDD, 80%覆盖率, 严格Lint, 安全扫描)
|
|
65
|
+
*
|
|
66
|
+
* 在 auto 模式下 (isAutoMode=true):
|
|
67
|
+
* - 阶段间自动流转,无需确认
|
|
68
|
+
* - 质量门禁失败时暂停
|
|
69
|
+
* - 仅在失败/异常时暂停
|
|
70
|
+
*/
|
|
71
|
+
export declare class PhaseExecutor {
|
|
72
|
+
private stateManager;
|
|
73
|
+
private approvalManager;
|
|
74
|
+
private agentRunner;
|
|
75
|
+
private gitCommitManager;
|
|
76
|
+
private isAutoMode;
|
|
77
|
+
private runId;
|
|
78
|
+
private userContext;
|
|
79
|
+
private minTestCoverage;
|
|
80
|
+
/** 质量配置 */
|
|
81
|
+
private qualityConfig;
|
|
82
|
+
/** 默认质量配置 (balanced) */
|
|
83
|
+
private static DEFAULT_QUALITY;
|
|
84
|
+
constructor(stateManager: StateManager, approvalManager: ApprovalManager);
|
|
85
|
+
/**
|
|
86
|
+
* 设置自动模式
|
|
87
|
+
*/
|
|
88
|
+
setAutoMode(auto: boolean): void;
|
|
89
|
+
/**
|
|
90
|
+
* 获取自动模式状态
|
|
91
|
+
*/
|
|
92
|
+
getAutoMode(): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* 设置 Run ID (用于提交信息)
|
|
95
|
+
*/
|
|
96
|
+
setRunId(runId: string): void;
|
|
97
|
+
/**
|
|
98
|
+
* 设置质量配置
|
|
99
|
+
*/
|
|
100
|
+
setQualityConfig(config: Partial<QualityConfig>): void;
|
|
101
|
+
/**
|
|
102
|
+
* 获取质量配置
|
|
103
|
+
*/
|
|
104
|
+
getQualityConfig(): QualityConfig;
|
|
105
|
+
/**
|
|
106
|
+
* 设置质量级别预设
|
|
107
|
+
*/
|
|
108
|
+
setQualityLevel(level: 'fast' | 'balanced' | 'strict'): void;
|
|
109
|
+
/**
|
|
110
|
+
* 设置用户上下文
|
|
111
|
+
*/
|
|
112
|
+
setUserContext(context: UserContext): void;
|
|
113
|
+
/**
|
|
114
|
+
* 设置最低测试覆盖率
|
|
115
|
+
*/
|
|
116
|
+
setMinTestCoverage(coverage: number): void;
|
|
117
|
+
/**
|
|
118
|
+
* 获取最低测试覆盖率
|
|
119
|
+
*/
|
|
120
|
+
getMinTestCoverage(): number;
|
|
121
|
+
/**
|
|
122
|
+
* 设置是否启用自动提交
|
|
123
|
+
*/
|
|
124
|
+
setAutoCommit(enabled: boolean): void;
|
|
125
|
+
/**
|
|
126
|
+
* 获取 GitCommitManager 实例
|
|
127
|
+
*/
|
|
128
|
+
getGitCommitManager(): GitCommitManager;
|
|
129
|
+
/**
|
|
130
|
+
* 获取任务当前阶段
|
|
131
|
+
*/
|
|
132
|
+
getCurrentPhase(task: Task): Phase;
|
|
133
|
+
/**
|
|
134
|
+
* 准备阶段执行的 Subagent 任务
|
|
135
|
+
*/
|
|
136
|
+
preparePhaseExecution(task: Task): Promise<SubagentTask | null>;
|
|
137
|
+
/**
|
|
138
|
+
* 准备 TDD 阶段 - 先写测试
|
|
139
|
+
*/
|
|
140
|
+
private prepareTDDPhase;
|
|
141
|
+
/**
|
|
142
|
+
* 准备开发阶段
|
|
143
|
+
*/
|
|
144
|
+
private prepareDevelopPhase;
|
|
145
|
+
/**
|
|
146
|
+
* 构建 TDD 阶段提示词 - 先写测试
|
|
147
|
+
*/
|
|
148
|
+
private buildTDDPrompt;
|
|
149
|
+
/**
|
|
150
|
+
* 准备验证阶段
|
|
151
|
+
*/
|
|
152
|
+
private prepareVerifyPhase;
|
|
153
|
+
/**
|
|
154
|
+
* 准备验收阶段
|
|
155
|
+
*/
|
|
156
|
+
private prepareAcceptPhase;
|
|
157
|
+
/**
|
|
158
|
+
* 构建开发阶段提示词 (增强版: 注入验收标准和用户上下文)
|
|
159
|
+
*/
|
|
160
|
+
private buildDevelopPrompt;
|
|
161
|
+
/**
|
|
162
|
+
* 构建验证阶段提示词 (增强版: 严格质量门禁)
|
|
163
|
+
*/
|
|
164
|
+
private buildVerifyPrompt;
|
|
165
|
+
/**
|
|
166
|
+
* 构建验收阶段提示词 (增强版: 验收标准检查)
|
|
167
|
+
*/
|
|
168
|
+
private buildAcceptPrompt;
|
|
169
|
+
/**
|
|
170
|
+
* 处理阶段结果
|
|
171
|
+
*
|
|
172
|
+
* 在 auto 模式下:
|
|
173
|
+
* - 自动进入下一阶段,needsApproval = false
|
|
174
|
+
* - 仅在失败时暂停
|
|
175
|
+
* - 自动提交代码 (如果启用)
|
|
176
|
+
*/
|
|
177
|
+
processPhaseResult(task: Task, phase: Phase, result: {
|
|
178
|
+
success: boolean;
|
|
179
|
+
output: string;
|
|
180
|
+
error?: string;
|
|
181
|
+
}): Promise<PhaseResult>;
|
|
182
|
+
/**
|
|
183
|
+
* 检查 Build 测试结果
|
|
184
|
+
*/
|
|
185
|
+
parseBuildTestResult(output: string): BuildTestResult;
|
|
186
|
+
/**
|
|
187
|
+
* 解析质量报告
|
|
188
|
+
*/
|
|
189
|
+
parseQualityReport(output: string): QualityGateResult;
|
|
190
|
+
/**
|
|
191
|
+
* 生成质量报告 JSON
|
|
192
|
+
*/
|
|
193
|
+
generateQualityReport(task: Task, gateResult: QualityGateResult): QualityReport;
|
|
194
|
+
/**
|
|
195
|
+
* 获取 AgentRunner 实例
|
|
196
|
+
*/
|
|
197
|
+
getAgentRunner(): AgentRunner;
|
|
198
|
+
}
|