refactor(agent): 将 Summary Model 改造为内置 Sub Agent
- 扩展 AgentMode 类型添加 'internal' 模式 - 新增 summary agent preset (claude-3-5-haiku) - AgentRegistry 添加 getInternal/listInternalAgents 方法 - CompressionManager 添加 setSummaryModelFromAgentConfig - Agent 构造函数改用 Registry 配置初始化 Summary 模型 - 清理旧的 SummaryConfig 配置系统 - UI AgentsPanel 分离显示 System/Preset/Custom agents - UI AgentEditor 为 internal agent 显示简化编辑界面
This commit is contained in:
@@ -45,11 +45,9 @@ import type {
|
||||
CustomProviderDefinition,
|
||||
ProviderConfig,
|
||||
ConnectionTestResult,
|
||||
// Context & Summary types
|
||||
// Context types
|
||||
ContextUsageInfo,
|
||||
CompressionResult,
|
||||
SummaryConfigInfo,
|
||||
SummaryConfigInput,
|
||||
} from './types.js';
|
||||
|
||||
// Re-export types
|
||||
@@ -124,8 +122,6 @@ export type {
|
||||
CompressionStatus,
|
||||
CompressionType,
|
||||
CompressionResult,
|
||||
SummaryConfigInfo,
|
||||
SummaryConfigInput,
|
||||
} from './types.js';
|
||||
|
||||
// API Configuration
|
||||
@@ -976,27 +972,3 @@ export async function compressContext(
|
||||
}> {
|
||||
return request('POST', `/sessions/${encodeURIComponent(sessionId)}/compress`, options || {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取摘要模型配置
|
||||
*/
|
||||
export async function getSummaryConfig(): Promise<{
|
||||
success: boolean;
|
||||
data?: SummaryConfigInfo;
|
||||
error?: string;
|
||||
}> {
|
||||
return request('GET', '/config/summary');
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新摘要模型配置
|
||||
*/
|
||||
export async function updateSummaryConfig(
|
||||
config: SummaryConfigInput
|
||||
): Promise<{
|
||||
success: boolean;
|
||||
data?: SummaryConfigInfo;
|
||||
error?: string;
|
||||
}> {
|
||||
return request('PUT', '/config/summary', config);
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ export interface HookTestResult {
|
||||
// ============ Agent 相关 ============
|
||||
|
||||
/** Agent 运行模式 */
|
||||
export type AgentMode = 'primary' | 'subagent' | 'all';
|
||||
export type AgentMode = 'primary' | 'subagent' | 'all' | 'internal';
|
||||
|
||||
/** Agent 模型配置 */
|
||||
export interface AgentModelConfig {
|
||||
@@ -756,26 +756,3 @@ export interface CompressionResult {
|
||||
summaryTokens?: number;
|
||||
}
|
||||
|
||||
/** 摘要模型配置信息(不含 API Key 明文) */
|
||||
export interface SummaryConfigInfo {
|
||||
/** 提供商类型 */
|
||||
provider?: string;
|
||||
/** 模型名称 */
|
||||
model?: string;
|
||||
/** 是否已配置 API Key */
|
||||
hasApiKey: boolean;
|
||||
/** 服务地址 */
|
||||
baseUrl?: string;
|
||||
}
|
||||
|
||||
/** 摘要模型配置输入 */
|
||||
export interface SummaryConfigInput {
|
||||
/** 提供商类型 */
|
||||
provider?: string;
|
||||
/** 模型名称 */
|
||||
model?: string;
|
||||
/** API Key */
|
||||
apiKey?: string;
|
||||
/** 服务地址 */
|
||||
baseUrl?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user