pdca
Version:
🎯 AI 驅動的 PDCA 多代理開發系統 - 智能循環控制 + 成本管理 + Token 優化 + 多 AI 引擎支援
164 lines • 3.58 kB
TypeScript
/**
* PDCA 協調器 v2
* 支援多風格配置的版本
*/
import { EventEmitter } from 'events';
import type { CLIOptions, Task } from '../../types/index.js';
import type { ConfigLoadOptions } from '../../types/config.js';
export declare class PDCAOrchestrator extends EventEmitter {
private tmuxManager;
private styleEngine;
private multiClaudeManager;
private communicationManager;
private agents;
private currentTask?;
private runtimeConfig?;
private useMultiClaude;
private loopController?;
private currentIteration;
private isLoopRunning;
private lastQuality;
private tokenTracker?;
constructor();
/**
* 啟動 PDCA 系統
*/
start(mission: string, options?: CLIOptions & ConfigLoadOptions): Promise<void>;
/**
* 載入配置
*/
private loadConfiguration;
/**
* 啟動代理
*/
private startAgents;
/**
* 設置 tmux 環境
*/
private setupTmuxEnvironment;
/**
* 啟動所有代理
*/
private startAllAgents;
/**
* 停止系統
*/
stop(): Promise<void>;
/**
* 獲取系統狀態
*/
getStatus(): {
isRunning: boolean;
task?: Task;
profile?: string;
agents: Array<{
name: string;
status: string;
}>;
loop?: {
isRunning: boolean;
currentIteration: number;
lastQuality: number;
};
tokenUsage?: {
totalTokens: number;
totalCost: number;
budgetStatus: any;
};
};
/**
* 停止所有代理
*/
private stopAllAgents;
/**
* 啟動監控
*/
private startMonitoring;
/**
* 創建任務
*/
private createTask;
/**
* 取得可用的風格列表
*/
getAvailableStyles(): Promise<string[]>;
/**
* 切換風格(需要重啟系統)
*/
switchStyle(styleName: string): Promise<void>;
/**
* 初始化循環控制器
*/
private initializeLoopController;
/**
* 開始 PDCA 循環
*/
private startPDCALoop;
/**
* 執行單次 PDCA 循環
*/
private executeIteration;
/**
* 執行下一個迭代
*/
private executeNextIteration;
/**
* 完成 PDCA 循環
*/
private finalizePDCALoop;
/**
* Plan 階段 - 讓規劃代理工作
*/
private executePlanPhase;
/**
* Do 階段 - 讓執行代理工作
*/
private executeDoPhase;
/**
* Check 階段 - 讓檢查代理評估品質
*/
private executeCheckPhase;
/**
* Act 階段 - 讓改進代理提出優化建議
*/
private executeActPhase;
/**
* 根據角色查找代理
*/
private findAgentByRole;
/**
* 估算 Token 使用量
*/
private estimateTokenUsage;
/**
* 記錄實際的 AI 調用成本
*/
private trackAICall;
/**
* 推測當前使用的 AI 模型
*/
private inferAIModel;
/**
* 智能成本效益分析
*/
private analyzeCostEfficiency;
/**
* 獲取循環狀態
*/
getLoopStatus(): {
isRunning: boolean;
currentIteration: number;
lastQuality: number;
tokenStats?: any;
costEfficiency?: number;
};
/**
* 手動停止循環
*/
stopLoop(): Promise<void>;
/**
* 休眠工具函數
*/
private sleep;
}
//# sourceMappingURL=orchestrator-v2.d.ts.map