SEALED INTERFACES
- • Content — text / thinking / toolCall / image,isContent() 密封
- • Message — user / assistant / toolResult / compaction,Role() 判别
- • AgentEvent — 11 种事件,isAgentEvent() + EventType()
- • AgentTool — Name/Schema/ExecutionMode/Execute
- • ContentList / MessageList 自定义 UnmarshalJSON 按判别式分派
AGGREGATION & FLOW
- • AgentContext ◇→ MessageList (0..*) + []AgentTool (0..*)
- • ContentList ◆ Content;ToolResult/User/Assistant 均持有
- • AgentTool.Execute ⇢ 返回 AgentToolResult
- • 事件经 EventStream[T,R] 泛型流投递 (Emit/Result)
- • Hooks: before/afterToolCall, prepareNextTurn (指针三态)