33 lines
715 B
Go
33 lines
715 B
Go
package domain
|
|
|
|
import "time"
|
|
|
|
type EventType string
|
|
|
|
const (
|
|
EventTerminalOutput EventType = "terminal.output"
|
|
EventSessionStatus EventType = "session.status"
|
|
EventError EventType = "error"
|
|
)
|
|
|
|
type Event struct {
|
|
Type EventType `json:"type"`
|
|
SessionID string `json:"session"`
|
|
Payload any `json:"payload"`
|
|
At time.Time `json:"at"`
|
|
}
|
|
|
|
// TerminalOutputEvent carries raw terminal bytes as UTF-8 text.
|
|
type TerminalOutputEvent struct {
|
|
Data string `json:"data"`
|
|
}
|
|
|
|
type SessionStatusEvent struct {
|
|
Status SessionStatus `json:"status"`
|
|
ExitCode *int `json:"exitCode,omitempty"`
|
|
}
|
|
|
|
type ErrorEvent struct {
|
|
Message string `json:"message"`
|
|
}
|