Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadInbox ¶
func ReadInbox(provider EmailProvider) *tacklr.Tool
ReadInbox returns the read_inbox tool closed over provider.
func SendEmail ¶
func SendEmail(provider EmailProvider) *tacklr.Tool
SendEmail returns the permission-gated send_email tool closed over provider.
Types ¶
type EmailProvider ¶
type EmailProvider interface {
Kind() ProviderKind
Validate(context.Context) error
ReadInbox(context.Context, ReadInboxRequest) (Inbox, error)
SendEmail(context.Context, SendEmailRequest) (SentEmail, error)
}
EmailProvider supplies the operations exposed by the built-in email tools. Implementations own authentication and provider-specific API behavior and must support concurrent calls when an agent uses workers.
type Inbox ¶
type Inbox struct {
Messages []Message `json:"messages"`
NextCursor string `json:"next_cursor,omitempty"`
}
Inbox is one provider page of messages.
type Message ¶
type Message struct {
ID string `json:"id"`
ThreadID string `json:"thread_id,omitempty"`
From string `json:"from"`
To []string `json:"to,omitempty"`
CC []string `json:"cc,omitempty"`
Subject string `json:"subject,omitempty"`
Body string `json:"body,omitempty"`
ReceivedAt time.Time `json:"received_at"`
Unread bool `json:"unread"`
}
Message is a provider-neutral email returned to the agent.
type ProviderKind ¶
type ProviderKind string
ProviderKind identifies an email service implemented by a battery adapter.
const ( ProviderGmail ProviderKind = "gmail" ProviderOutlook ProviderKind = "outlook" )
type ReadInboxRequest ¶
type ReadInboxRequest struct {
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
Subject string `json:"subject,omitempty"`
ReceivedAfter string `json:"received_after,omitempty"`
ReceivedBefore string `json:"received_before,omitempty"`
HasAttachment *bool `json:"has_attachment,omitempty"`
Mailbox string `json:"mailbox,omitempty"`
UnreadOnly bool `json:"unread_only,omitempty"`
Limit int `json:"limit,omitempty"`
Cursor string `json:"cursor,omitempty"`
}
ReadInboxRequest selects messages from the configured inbox.
func (ReadInboxRequest) Validate ¶
func (r ReadInboxRequest) Validate() error
Validate checks portable inbox filter values. Dates use YYYY-MM-DD.
type SendEmailRequest ¶
type SendEmailRequest struct {
To []string `json:"to"`
CC []string `json:"cc,omitempty"`
BCC []string `json:"bcc,omitempty"`
Subject string `json:"subject"`
Body string `json:"body"`
ReplyToMessageID string `json:"reply_to_message_id,omitempty"`
}
SendEmailRequest is an outbound email composed by an agent.
func (SendEmailRequest) Validate ¶
func (r SendEmailRequest) Validate() error
Validate checks the provider-neutral requirements for an outbound email.