feat: add supervisor prototype with embedded frontend
This commit is contained in:
32
internal/domain/event.go
Normal file
32
internal/domain/event.go
Normal file
@ -0,0 +1,32 @@
|
||||
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"`
|
||||
}
|
||||
Reference in New Issue
Block a user