Documentation
¶
Overview ¶
Package inbox provides inbox logic for the Guardian CLI tool. It manages proposal notifications, state persistence, and OS notifications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveState ¶
SaveState writes .guardian/state.json to the repo root. It creates the .guardian/ directory if it does not exist.
func SendNotification ¶
SendNotification sends an OS notification with the given title and message.
On macOS, it tries terminal-notifier first, then falls back to osascript. On Linux, it tries notify-send. On other platforms, it is a no-op and returns nil.
Types ¶
type InboxItem ¶
type InboxItem struct {
Proposal *config.Proposal
Age time.Duration
IsOld bool // true if age > 7 days
}
InboxItem represents a proposal that needs the user's vote.
func GetInbox ¶
func GetInbox( proposals []*config.Proposal, votes map[string][]*config.Vote, constitution *config.Constitution, userEmail string, sinceLastCheck *time.Time, ) ([]InboxItem, error)
GetInbox returns proposals that need the given user's vote.
It filters proposals based on:
- Status must be "proposed"
- Not expired (if ProposalTTLDays > 0)
- User must be an eligible voter (has a role in governance.voters)
- User has not already voted for this proposal
- If sinceLastCheck is provided, only proposals created after that time
The votes parameter maps proposal IDs to their votes.