resume active sessions

This commit is contained in:
ari committed 2026-11-01 15:52:46 -05:00
1 parent 9e94c05fb6
commit 917a361370
19 files changed
+871 -42

No files matched your search

+27
View File
@@ -71,6 +71,33 @@ type Session struct {
Listen ListenMode `json:"listen,omitempty"`
}
// Turn is a reply the bot is still working on, kept so it can carry on after a restart.
type Turn struct {
Channel string `json:"channel"`
ThreadTS string `json:"thread_ts"`
MessageTS string `json:"message_ts"`
ReplyTS string `json:"reply_ts"`
User string `json:"user"`
OwnerID string `json:"owner_id"`
DM bool `json:"dm,omitempty"`
Heard bool `json:"heard,omitempty"`
Text string `json:"text"`
Files []TurnFile `json:"files,omitempty"`
// The agent got the prompt, so the session already holds part of the turn.
Prompted bool `json:"prompted,omitempty"`
Resumes int `json:"resumes,omitempty"`
StartedAt time.Time `json:"started_at"`
}
type TurnFile struct {
Name string `json:"name"`
Mode string `json:"mode,omitempty"`
URL string `json:"url"`
Size int `json:"size"`
}
// Whether the bot reads every reply in a channel thread, or only ones that
// @mention it. DMs always read everything.
type ListenMode string