openmatrix 0.2.31 → 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 +1 -1
- 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 +24 -5
- 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/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 +32 -20
- 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
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { AgentType } from '../types/index.js';
|
|
2
|
-
export interface AgentConfig {
|
|
3
|
-
timeout: number;
|
|
4
|
-
maxRetries: number;
|
|
5
|
-
model: string;
|
|
6
|
-
}
|
|
7
|
-
export interface AgentContext {
|
|
8
|
-
workspaceRoot: string;
|
|
9
|
-
taskDescription: string;
|
|
10
|
-
relevantFiles: string[];
|
|
11
|
-
constraints: string[];
|
|
12
|
-
config: AgentConfig;
|
|
13
|
-
}
|
|
14
|
-
export interface AgentResult {
|
|
15
|
-
runId: string;
|
|
16
|
-
taskId: string;
|
|
17
|
-
agentType: AgentType;
|
|
18
|
-
status: 'completed' | 'failed' | 'needs_approval';
|
|
19
|
-
output: string;
|
|
20
|
-
artifacts: string[];
|
|
21
|
-
needsApproval: boolean;
|
|
22
|
-
error?: string;
|
|
23
|
-
duration: number;
|
|
24
|
-
}
|
|
25
|
-
export interface AgentReport {
|
|
26
|
-
agentId: string;
|
|
27
|
-
agentType: AgentType;
|
|
28
|
-
taskId: string;
|
|
29
|
-
status: string;
|
|
30
|
-
summary: string;
|
|
31
|
-
artifacts: string[];
|
|
32
|
-
errors: string[];
|
|
33
|
-
duration: number;
|
|
34
|
-
}
|
|
35
|
-
export declare abstract class BaseAgent {
|
|
36
|
-
readonly id: string;
|
|
37
|
-
readonly agentType: AgentType;
|
|
38
|
-
abstract type: AgentType;
|
|
39
|
-
abstract capabilities: string[];
|
|
40
|
-
constructor(id: string, agentType: AgentType);
|
|
41
|
-
abstract execute(taskId: string, context: AgentContext): Promise<AgentResult>;
|
|
42
|
-
abstract validate(taskId: string, context: AgentContext): boolean;
|
|
43
|
-
abstract report(): AgentReport;
|
|
44
|
-
abstract buildPrompt(taskId: string, context: AgentContext): string;
|
|
45
|
-
protected callClaude(prompt: string): Promise<string>;
|
|
46
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseAgent = void 0;
|
|
4
|
-
class BaseAgent {
|
|
5
|
-
id;
|
|
6
|
-
agentType;
|
|
7
|
-
constructor(id, agentType) {
|
|
8
|
-
this.id = id;
|
|
9
|
-
this.agentType = agentType;
|
|
10
|
-
// capabilities is defined by subclass
|
|
11
|
-
}
|
|
12
|
-
async callClaude(prompt) {
|
|
13
|
-
// Placeholder - 子类实现
|
|
14
|
-
throw new Error('BaseAgent.callClaude must be implemented by subclass');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.BaseAgent = BaseAgent;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.analyzeCommand = void 0;
|
|
4
|
-
// src/cli/commands/analyze.ts
|
|
5
|
-
const commander_1 = require("commander");
|
|
6
|
-
const smart_question_analyzer_js_1 = require("../../orchestrator/smart-question-analyzer.js");
|
|
7
|
-
const logger_js_1 = require("../../utils/logger.js");
|
|
8
|
-
exports.analyzeCommand = new commander_1.Command('analyze')
|
|
9
|
-
.description('智能分析任务,推断配置,返回需要确认的问题列表')
|
|
10
|
-
.argument('[task]', '任务描述')
|
|
11
|
-
.option('--json', '输出 JSON 格式')
|
|
12
|
-
.action(async (task, options) => {
|
|
13
|
-
const analyzer = new smart_question_analyzer_js_1.SmartQuestionAnalyzer(process.cwd());
|
|
14
|
-
if (!task) {
|
|
15
|
-
if (options.json) {
|
|
16
|
-
logger_js_1.logger.info(JSON.stringify({
|
|
17
|
-
status: 'error',
|
|
18
|
-
message: '请提供任务描述'
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
logger_js_1.logger.info('❌ 请提供任务描述');
|
|
23
|
-
logger_js_1.logger.info(' 用法: openmatrix analyze "实现用户登录功能"');
|
|
24
|
-
}
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
const result = await analyzer.analyze(task);
|
|
29
|
-
if (options.json) {
|
|
30
|
-
// 输出 JSON 格式 (供 Skill 解析)
|
|
31
|
-
const output = result;
|
|
32
|
-
logger_js_1.logger.info(JSON.stringify(output, null, 2));
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
// 输出人类可读格式
|
|
36
|
-
logger_js_1.logger.info('\n' + analyzer.generateSummary(result));
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
if (options.json) {
|
|
41
|
-
logger_js_1.logger.info(JSON.stringify({
|
|
42
|
-
status: 'error',
|
|
43
|
-
message: error instanceof Error ? error.message : '分析失败'
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
logger_js_1.logger.info('❌ 分析失败: ' + (error instanceof Error ? error.message : '未知错误'));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { ParsedTask } from '../types/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* 问题推断结果
|
|
4
|
-
*/
|
|
5
|
-
export interface QuestionInference {
|
|
6
|
-
questionId: string;
|
|
7
|
-
inferredAnswer?: string | string[];
|
|
8
|
-
confidence: 'high' | 'medium' | 'low';
|
|
9
|
-
reason: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* 项目上下文
|
|
13
|
-
*/
|
|
14
|
-
export interface ProjectContext {
|
|
15
|
-
projectType: 'typescript' | 'javascript' | 'python' | 'go' | 'rust' | 'java' | 'unknown';
|
|
16
|
-
frameworks: string[];
|
|
17
|
-
hasFrontend: boolean;
|
|
18
|
-
hasBackend: boolean;
|
|
19
|
-
hasTests: boolean;
|
|
20
|
-
packageManager: 'npm' | 'yarn' | 'pnpm' | 'pip' | 'go-mod' | 'cargo' | 'unknown';
|
|
21
|
-
dependencies: Record<string, string>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* 分析结果
|
|
25
|
-
*/
|
|
26
|
-
export interface AnalysisResult {
|
|
27
|
-
inferences: QuestionInference[];
|
|
28
|
-
questionsToAsk: string[];
|
|
29
|
-
skippedQuestions: string[];
|
|
30
|
-
projectContext: ProjectContext;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* SmartQuestionAnalyzer - 智能问答分析器
|
|
34
|
-
*
|
|
35
|
-
* 根据任务描述和项目上下文智能推断问题答案,减少不必要的问答
|
|
36
|
-
*
|
|
37
|
-
* 使用方式:
|
|
38
|
-
* 1. 分析项目文件获取上下文
|
|
39
|
-
* 2. 根据任务关键词推断答案
|
|
40
|
-
* 3. 返回需要提问的问题列表
|
|
41
|
-
*/
|
|
42
|
-
export declare class SmartQuestionAnalyzer {
|
|
43
|
-
private projectRoot;
|
|
44
|
-
private cachedContext;
|
|
45
|
-
constructor(projectRoot?: string);
|
|
46
|
-
/**
|
|
47
|
-
* 分析任务,返回推断结果
|
|
48
|
-
*/
|
|
49
|
-
analyze(taskDescription: string, parsedTask?: ParsedTask): Promise<AnalysisResult>;
|
|
50
|
-
/**
|
|
51
|
-
* 获取项目上下文
|
|
52
|
-
*/
|
|
53
|
-
getProjectContext(): Promise<ProjectContext>;
|
|
54
|
-
/**
|
|
55
|
-
* 推断问题答案
|
|
56
|
-
*/
|
|
57
|
-
private inferAnswers;
|
|
58
|
-
/**
|
|
59
|
-
* 推断质量级别
|
|
60
|
-
*/
|
|
61
|
-
private inferQualityLevel;
|
|
62
|
-
/**
|
|
63
|
-
* 推断技术栈
|
|
64
|
-
*/
|
|
65
|
-
private inferTechStack;
|
|
66
|
-
/**
|
|
67
|
-
* 推断文档级别
|
|
68
|
-
*/
|
|
69
|
-
private inferDocLevel;
|
|
70
|
-
/**
|
|
71
|
-
* 推断 E2E 测试
|
|
72
|
-
*/
|
|
73
|
-
private inferE2ETest;
|
|
74
|
-
/**
|
|
75
|
-
* 推断执行模式
|
|
76
|
-
*/
|
|
77
|
-
private inferExecutionMode;
|
|
78
|
-
/**
|
|
79
|
-
* 推断任务目标类型
|
|
80
|
-
*/
|
|
81
|
-
private inferObjective;
|
|
82
|
-
/**
|
|
83
|
-
* 推断测试覆盖率级别
|
|
84
|
-
*/
|
|
85
|
-
private inferTestCoverage;
|
|
86
|
-
/**
|
|
87
|
-
* 生成推断摘要
|
|
88
|
-
*/
|
|
89
|
-
generateSummary(result: AnalysisResult): string;
|
|
90
|
-
}
|