feat: includes history events in panel

This commit is contained in:
Simon
2026-01-15 21:48:14 +08:00
parent 42130d6f1d
commit eab9cf64e8
4 changed files with 22 additions and 2 deletions

View File

@@ -352,6 +352,11 @@
background: linear-gradient(135deg, rgba(255, 214, 0, 0.1), rgba(255, 214, 0, 0.05));
}
&.observation {
border-left-color: rgb(147, 51, 234);
background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(147, 51, 234, 0.05));
}
/* 突出显示 done 成功结果 */
&.doneSuccess {
background: linear-gradient(

View File

@@ -27,6 +27,7 @@ export type PanelUpdate =
| { type: 'completed' }
| { type: 'toolExecuting'; toolName: string; args: any }
| { type: 'toolCompleted'; toolName: string; args: any; result?: string; duration?: number }
| { type: 'observation'; content: string }
/**
* Agent control panel
@@ -196,6 +197,8 @@ export class Panel {
duration: data.duration,
}
}
case 'observation':
return { type: 'observation', displayText: data.content }
}
}
@@ -581,7 +584,7 @@ export class Panel {
typeClass = styles.error
statusIcon = '❌'
} else if (step.type === 'tool_executing') {
statusIcon = '⚙️'
statusIcon = '🔨'
} else if (step.type === 'output') {
typeClass = styles.output
statusIcon = '🤖'
@@ -591,6 +594,9 @@ export class Panel {
} else if (step.type === 'retry') {
typeClass = styles.retry
statusIcon = '🔄'
} else if (step.type === 'observation') {
typeClass = styles.observation
statusIcon = '👁️'
} else {
statusIcon = '🧠'
}

View File

@@ -6,7 +6,15 @@ export interface Step {
id: string
stepNumber: number
timestamp: Date
type: 'thinking' | 'tool_executing' | 'completed' | 'error' | 'output' | 'input' | 'retry'
type:
| 'thinking'
| 'tool_executing'
| 'completed'
| 'error'
| 'output'
| 'input'
| 'retry'
| 'observation'
// Tool execution related
toolName?: string