openmatrix 0.1.64 → 0.1.66
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.
|
@@ -80,7 +80,7 @@ class AgentRunner {
|
|
|
80
80
|
*/
|
|
81
81
|
async prepareSubagentTask(task) {
|
|
82
82
|
const subagentType = this.mapAgentType(task.assignedAgent);
|
|
83
|
-
const prompt = this.buildExecutionPrompt(task);
|
|
83
|
+
const prompt = await this.buildExecutionPrompt(task);
|
|
84
84
|
const needsIsolation = this.needsIsolation(task);
|
|
85
85
|
console.log(`🤖 Preparing ${task.assignedAgent} subagent for task ${task.id}`);
|
|
86
86
|
return {
|
|
@@ -133,10 +133,10 @@ class AgentRunner {
|
|
|
133
133
|
/**
|
|
134
134
|
* 构建完整的执行提示词
|
|
135
135
|
*/
|
|
136
|
-
buildExecutionPrompt(task) {
|
|
136
|
+
async buildExecutionPrompt(task) {
|
|
137
137
|
const agentPrompt = this.buildAgentPrompt(task);
|
|
138
138
|
const phaseContext = this.buildPhaseContext(task);
|
|
139
|
-
const accumulatedContext = this.buildAccumulatedContext(task);
|
|
139
|
+
const accumulatedContext = await this.buildAccumulatedContext(task);
|
|
140
140
|
return `# 任务执行
|
|
141
141
|
|
|
142
142
|
## 任务信息
|
|
@@ -40,7 +40,6 @@ const state_manager_js_1 = require("../../storage/state-manager.js");
|
|
|
40
40
|
const task_parser_js_1 = require("../../orchestrator/task-parser.js");
|
|
41
41
|
const task_planner_js_1 = require("../../orchestrator/task-planner.js");
|
|
42
42
|
const approval_manager_js_1 = require("../../orchestrator/approval-manager.js");
|
|
43
|
-
const executor_js_1 = require("../../orchestrator/executor.js");
|
|
44
43
|
const gitignore_js_1 = require("../../utils/gitignore.js");
|
|
45
44
|
const index_js_1 = require("../../types/index.js");
|
|
46
45
|
const fs = __importStar(require("fs/promises"));
|
|
@@ -253,33 +252,26 @@ async function handleTasksJson(options, stateManager, state, omPath, basePath) {
|
|
|
253
252
|
}
|
|
254
253
|
return;
|
|
255
254
|
}
|
|
256
|
-
//
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
const result = await executor.step();
|
|
255
|
+
// 无审批点,返回任务列表供 Skill 执行
|
|
256
|
+
const allTasks = await stateManager.listTasks();
|
|
257
|
+
const subagentTasks = allTasks.map(t => ({
|
|
258
|
+
taskId: t.id,
|
|
259
|
+
agentType: t.assignedAgent,
|
|
260
|
+
title: t.title,
|
|
261
|
+
description: t.description,
|
|
262
|
+
priority: t.priority,
|
|
263
|
+
dependencies: t.dependencies,
|
|
264
|
+
timeout: t.timeout
|
|
265
|
+
}));
|
|
269
266
|
if (options.json) {
|
|
270
267
|
console.log(JSON.stringify({
|
|
271
|
-
status:
|
|
272
|
-
message:
|
|
273
|
-
statistics:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
isolation: t.isolation,
|
|
279
|
-
taskId: t.taskId,
|
|
280
|
-
agentType: t.agentType,
|
|
281
|
-
timeout: t.timeout
|
|
282
|
-
})),
|
|
268
|
+
status: 'tasks_ready',
|
|
269
|
+
message: '任务已准备就绪,等待 Skill 执行',
|
|
270
|
+
statistics: {
|
|
271
|
+
totalTasks: allTasks.length,
|
|
272
|
+
pending: allTasks.filter(t => t.status === 'pending').length
|
|
273
|
+
},
|
|
274
|
+
subagentTasks,
|
|
283
275
|
taskInfo: {
|
|
284
276
|
title: tasksInput.title,
|
|
285
277
|
description: tasksInput.description,
|
|
@@ -289,9 +281,9 @@ async function handleTasksJson(options, stateManager, state, omPath, basePath) {
|
|
|
289
281
|
}
|
|
290
282
|
else {
|
|
291
283
|
console.log(`\n📋 ${tasksInput.title} - ${subTasks.length} 个子任务已创建`);
|
|
292
|
-
console.log(`🎯
|
|
293
|
-
console.log(`
|
|
294
|
-
console.log('\n🚀
|
|
284
|
+
console.log(`🎯 执行模式:${executionMode}`);
|
|
285
|
+
console.log(` 质量级别:${qualityLevel}`);
|
|
286
|
+
console.log('\n🚀 等待 Skill 执行任务...');
|
|
295
287
|
console.log(' 使用 /om:status 查看进度');
|
|
296
288
|
}
|
|
297
289
|
}
|
|
@@ -426,32 +418,26 @@ async function handleAutoParse(input, options, stateManager, state) {
|
|
|
426
418
|
}
|
|
427
419
|
return;
|
|
428
420
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
440
|
-
const result = await executor.step();
|
|
421
|
+
// 无审批点,返回任务列表供 Skill 执行
|
|
422
|
+
const allTasks = await stateManager.listTasks();
|
|
423
|
+
const subagentTasks = allTasks.map(t => ({
|
|
424
|
+
taskId: t.id,
|
|
425
|
+
agentType: t.assignedAgent,
|
|
426
|
+
title: t.title,
|
|
427
|
+
description: t.description,
|
|
428
|
+
priority: t.priority,
|
|
429
|
+
dependencies: t.dependencies,
|
|
430
|
+
timeout: t.timeout
|
|
431
|
+
}));
|
|
441
432
|
if (options.json) {
|
|
442
433
|
console.log(JSON.stringify({
|
|
443
|
-
status:
|
|
444
|
-
message:
|
|
445
|
-
statistics:
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
isolation: t.isolation,
|
|
451
|
-
taskId: t.taskId,
|
|
452
|
-
agentType: t.agentType,
|
|
453
|
-
timeout: t.timeout
|
|
454
|
-
})),
|
|
434
|
+
status: 'tasks_ready',
|
|
435
|
+
message: '任务已准备就绪,等待 Skill 执行',
|
|
436
|
+
statistics: {
|
|
437
|
+
totalTasks: allTasks.length,
|
|
438
|
+
pending: allTasks.filter(t => t.status === 'pending').length
|
|
439
|
+
},
|
|
440
|
+
subagentTasks,
|
|
455
441
|
taskInfo: {
|
|
456
442
|
title: options.title || parsedTask.title,
|
|
457
443
|
description: options.description,
|
|
@@ -463,8 +449,8 @@ async function handleAutoParse(input, options, stateManager, state) {
|
|
|
463
449
|
}
|
|
464
450
|
else {
|
|
465
451
|
console.log(`\n📋 生成 ${subTasks.length} 个子任务`);
|
|
466
|
-
console.log(`🎯
|
|
467
|
-
console.log('\n🚀
|
|
452
|
+
console.log(`🎯 执行模式:${executionMode}`);
|
|
453
|
+
console.log('\n🚀 等待 Skill 执行任务...');
|
|
468
454
|
console.log(' 使用 /om:status 查看进度');
|
|
469
455
|
}
|
|
470
456
|
}
|
|
@@ -85,7 +85,28 @@ class StateManager {
|
|
|
85
85
|
async updateState(updates) {
|
|
86
86
|
await this.withLock(async () => {
|
|
87
87
|
const state = await this.getState();
|
|
88
|
-
|
|
88
|
+
// 确保 statistics 存在(兼容旧版本)
|
|
89
|
+
if (!state.statistics) {
|
|
90
|
+
state.statistics = {
|
|
91
|
+
totalTasks: 0,
|
|
92
|
+
completed: 0,
|
|
93
|
+
inProgress: 0,
|
|
94
|
+
failed: 0,
|
|
95
|
+
pending: 0,
|
|
96
|
+
scheduled: 0,
|
|
97
|
+
blocked: 0,
|
|
98
|
+
waiting: 0,
|
|
99
|
+
verify: 0,
|
|
100
|
+
accept: 0,
|
|
101
|
+
retry_queue: 0
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
// 合并 updates,statistics 需要单独处理
|
|
105
|
+
const newState = {
|
|
106
|
+
...state,
|
|
107
|
+
...updates,
|
|
108
|
+
statistics: updates.statistics ? { ...state.statistics, ...updates.statistics } : state.statistics
|
|
109
|
+
};
|
|
89
110
|
await this.store.writeJson('state.json', newState);
|
|
90
111
|
this.stateCache = newState;
|
|
91
112
|
});
|