Documentation
¶
Overview ¶
Package triage provides a durable, local "still to process" list for inbound Webex messages.
The list is a personal reminder, not an outward signal: nothing here is ever sent to Webex or visible to message senders. Reading an item never changes its status — that is the whole point. An item stays PENDING until the user (or an agent acting on their behalf) explicitly marks it PROCESSED via MarkProcessed. This solves the problem where reading a message in a native client clears the unread badge the user relies on as their todo reminder.
State persists to a 0600 file under the user's config dir so reminders survive restarts (the in-memory ring buffer does not).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
ID string `json:"id"`
RoomID string `json:"roomId"`
RoomTitle string `json:"roomTitle"`
PersonEmail string `json:"personEmail"`
Text string `json:"text"`
Created time.Time `json:"created"`
Priority string `json:"priority"`
RoutedAgent string `json:"routedAgent,omitempty"`
Status Status `json:"status"`
AddedAt time.Time `json:"addedAt"`
ProcessedAt time.Time `json:"processedAt,omitempty"`
}
Item is a single inbound message tracked for processing. Fields mirror buffer.NotificationMessage plus triage bookkeeping.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a thread-safe, disk-backed triage list.
func New ¶
New creates a Store persisting to the user's config dir. Existing state is loaded if present. If the config dir can't be resolved, the store still works in-memory (persistence disabled) so the listener never fails to run.
func NewWithPath ¶
NewWithPath creates a Store at an explicit path (used in tests).
func (*Store) Add ¶
Add records an item as PENDING. It is idempotent: re-adding an existing ID does NOT reset its status (so a message that's already been PROCESSED stays processed, and a re-delivered PENDING item isn't duplicated). Reading or re-receiving a message must never resurrect or clear a reminder.
func (*Store) ListPending ¶
ListPending returns all PENDING items, newest-first by Created. Reading does not change any status.
func (*Store) MarkProcessed ¶
MarkProcessed transitions the named items from PENDING to PROCESSED. This is the ONLY path that clears a reminder — it never happens automatically, on read, or on reply. Unknown IDs are reported in the returned slice. Returns the IDs that were not found.
func (*Store) PendingCount ¶
PendingCount returns the number of items still needing attention.