package bus

import (
	"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
	"time"
)

// EventType 总线事件类型
type EventType string

const (
	EventSubSessionStarted   EventType = "sub_session_started"
	EventSubSessionCompleted EventType = "sub_session_completed"
	EventSubSessionProgress  EventType = "sub_session_progress"
	EventSynthesisStarted    EventType = "synthesis_started"
	EventSynthesisDone       EventType = "synthesis_done"
	EventReviewReady         EventType = "review_ready"
	EventError               EventType = "error"
)

// BusEvent 总线事件
type BusEvent struct {
	ID        string
	Type      EventType
	SessionID string
	UserID    string
	Payload   interface{}
	Timestamp time.Time
}

// SubSessionPayload 子会话事件负载
type SubSessionPayload struct {
	SubType  model.SubSessionType
	Status   string // started, completed, failed
	Summary  string
	Details  string
	Progress float64 // 0.0 ~ 1.0
}

// ReviewPayload 审查事件负载
type ReviewPayload struct {
	Messages []model.ReviewMessage
}
