refactor: 清理未使用代码并添加未来功能标记
Some checks failed
CI / Rust Check (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

style: 统一代码格式和注释风格

docs: 更新多个功能文档的完整度和状态

feat(runtime): 添加路径验证工具支持

fix(pipeline): 改进条件判断和变量解析逻辑

test(types): 为ID类型添加全面测试用例

chore: 更新依赖项和Cargo.lock文件

perf(mcp): 优化MCP协议传输和错误处理
This commit is contained in:
iven
2026-03-25 21:55:12 +08:00
parent aa6a9cbd84
commit bf6d81f9c6
109 changed files with 12271 additions and 815 deletions

View File

@@ -128,8 +128,142 @@ export type {
IdentityFiles,
IdentityChangeProposal,
IdentitySnapshot,
MemoryEntryForAnalysis,
} from './intelligence-backend';
// === Mesh Types ===
export interface BehaviorPattern {
id: string;
pattern_type: PatternTypeVariant;
frequency: number;
last_occurrence: string;
first_occurrence: string;
confidence: number;
context: PatternContext;
}
export function getPatternTypeString(patternType: PatternTypeVariant): string {
if (typeof patternType === 'string') {
return patternType;
}
return patternType.type;
}
export type PatternTypeVariant =
| { type: 'SkillCombination'; skill_ids: string[] }
| { type: 'TemporalTrigger'; hand_id: string; time_pattern: string }
| { type: 'TaskPipelineMapping'; task_type: string; pipeline_id: string }
| { type: 'InputPattern'; keywords: string[]; intent: string };
export interface PatternContext {
skill_ids?: string[];
recent_topics?: string[];
intent?: string;
time_of_day?: number;
day_of_week?: number;
}
export interface WorkflowRecommendation {
id: string;
pipeline_id: string;
confidence: number;
reason: string;
suggested_inputs: Record<string, unknown>;
patterns_matched: string[];
timestamp: string;
}
export interface MeshConfig {
enabled: boolean;
min_confidence: number;
max_recommendations: number;
analysis_window_hours: number;
}
export interface MeshAnalysisResult {
recommendations: WorkflowRecommendation[];
patterns_detected: number;
timestamp: string;
}
export type ActivityType =
| { type: 'skill_used'; skill_ids: string[] }
| { type: 'pipeline_executed'; task_type: string; pipeline_id: string }
| { type: 'input_received'; keywords: string[]; intent: string };
// === Persona Evolver Types ===
export type EvolutionChangeType =
| 'instruction_addition'
| 'instruction_refinement'
| 'trait_addition'
| 'style_adjustment'
| 'domain_expansion';
export type InsightCategory =
| 'communication_style'
| 'technical_expertise'
| 'task_efficiency'
| 'user_preference'
| 'knowledge_gap';
export type IdentityFileType = 'soul' | 'instructions';
export type ProposalStatus = 'pending' | 'approved' | 'rejected';
export interface EvolutionProposal {
id: string;
agent_id: string;
target_file: IdentityFileType;
change_type: EvolutionChangeType;
reason: string;
current_content: string;
proposed_content: string;
confidence: number;
evidence: string[];
status: ProposalStatus;
created_at: string;
}
export interface ProfileUpdate {
section: string;
previous: string;
updated: string;
source: string;
}
export interface EvolutionInsight {
category: InsightCategory;
observation: string;
recommendation: string;
confidence: number;
}
export interface EvolutionResult {
agent_id: string;
timestamp: string;
profile_updates: ProfileUpdate[];
proposals: EvolutionProposal[];
insights: EvolutionInsight[];
evolved: boolean;
}
export interface PersonaEvolverConfig {
auto_profile_update: boolean;
min_preferences_for_update: number;
min_conversations_for_evolution: number;
enable_instruction_refinement: boolean;
enable_soul_evolution: boolean;
max_proposals_per_cycle: number;
}
export interface PersonaEvolverState {
last_evolution: string | null;
total_evolutions: number;
pending_proposals: number;
profile_enrichment_score: number;
}
// === Type Conversion Utilities ===
/**