channels

package
v0.1.147 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel interface {
	Type() ChannelType
	SendToAgent(ctx context.Context, workspaceID uint, agentID string, message Message) (*SendResult, error)
	SendToRun(ctx context.Context, workspaceID uint, runID string, message Message) (*SendResult, error)
}

type ChannelType

type ChannelType string
const (
	ChannelTypeDirect ChannelType = "direct"
)
const ChannelTypeEmail ChannelType = "email"
const ChannelTypeSMS ChannelType = "sms"

type Direct

type Direct struct {
	// contains filtered or unexported fields
}

func NewDirect

func NewDirect(agents *orchestration.AgentAPI) *Direct

func (*Direct) SendToAgent

func (d *Direct) SendToAgent(ctx context.Context, workspaceID uint, agentID string, message Message) (*SendResult, error)

func (*Direct) SendToRun

func (d *Direct) SendToRun(ctx context.Context, workspaceID uint, runID string, message Message) (*SendResult, error)

func (*Direct) Type

func (d *Direct) Type() ChannelType

type Email added in v0.1.96

type Email struct {
	// contains filtered or unexported fields
}

func NewEmail added in v0.1.96

func (*Email) DeprovisionInbox added in v0.1.96

func (e *Email) DeprovisionInbox(ctx context.Context, inboxID string) error

func (*Email) Mail added in v0.1.96

func (e *Email) Mail() *clients.AgentMailClient

func (*Email) ProvisionInbox added in v0.1.96

func (e *Email) ProvisionInbox(ctx context.Context, key string, displayName string) (string, error)

func (*Email) ResolveInbound added in v0.1.96

func (e *Email) ResolveInbound(ctx context.Context, toAddress string) (workspaceID uint, agentID string, err error)

func (*Email) SendToAgent added in v0.1.96

func (e *Email) SendToAgent(ctx context.Context, workspaceID uint, agentID string, message Message) (*SendResult, error)

func (*Email) SendToRun added in v0.1.96

func (e *Email) SendToRun(ctx context.Context, workspaceID uint, runID string, message Message) (*SendResult, error)

func (*Email) Type added in v0.1.96

func (e *Email) Type() ChannelType

type ErrChannelTypeNotRegistered

type ErrChannelTypeNotRegistered struct {
	ChannelType ChannelType
}

func (*ErrChannelTypeNotRegistered) Error

type InboundChannel added in v0.1.96

type InboundChannel interface {
	Channel
	ResolveInbound(ctx context.Context, address string) (workspaceID uint, agentID string, err error)
}

InboundChannel is implemented by channels that accept inbound messages (email, SMS).

type Message

type Message struct {
	Message           string                            `json:"message"`
	IdempotencyKey    string                            `json:"idempotency_key,omitempty"`
	TaskID            string                            `json:"task_id,omitempty"`
	SessionID         string                            `json:"session_id,omitempty"`
	SessionKey        *string                           `json:"session_key,omitempty"`
	Deliver           *bool                             `json:"deliver,omitempty"`
	TimeoutMs         *int                              `json:"timeout_ms,omitempty"`
	Policy            *orchestration.RunExecutionPolicy `json:"policy,omitempty"`
	Lane              *string                           `json:"lane,omitempty"`
	ExtraSystemPrompt *string                           `json:"extra_system_prompt,omitempty"`
	InputProvenance   *orchestration.InputProvenance    `json:"input_provenance,omitempty"`
	Routing           *orchestration.RoutingContext     `json:"routing,omitempty"`
	Attachments       []map[string]any                  `json:"attachments,omitempty"`
	Label             *string                           `json:"label,omitempty"`
	SpawnedBy         *string                           `json:"spawned_by,omitempty"`
	QueueMode         types.AgentQueueMode              `json:"queue_mode,omitempty"`
}

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(channelsList ...Channel) *Registry

func (*Registry) Register

func (r *Registry) Register(channel Channel) error

func (*Registry) Resolve

func (r *Registry) Resolve(channelType ChannelType) (Channel, error)

type SMS added in v0.1.96

type SMS struct {
	// contains filtered or unexported fields
}

func NewSMS added in v0.1.96

func NewSMS(agents *orchestration.AgentAPI, repo repository.BackendRepository) *SMS

func (*SMS) ResolveInbound added in v0.1.96

func (s *SMS) ResolveInbound(ctx context.Context, toNumber string) (workspaceID uint, agentID string, err error)

func (*SMS) SendToAgent added in v0.1.96

func (s *SMS) SendToAgent(ctx context.Context, workspaceID uint, agentID string, message Message) (*SendResult, error)

func (*SMS) SendToRun added in v0.1.96

func (s *SMS) SendToRun(ctx context.Context, workspaceID uint, runID string, message Message) (*SendResult, error)

func (*SMS) Type added in v0.1.96

func (s *SMS) Type() ChannelType

type SendResult

type SendResult struct {
	Accepted        bool                          `json:"accepted"`
	IdempotentHit   bool                          `json:"idempotent_hit"`
	Task            *types.AgentTask              `json:"task,omitempty"`
	RunID           *string                       `json:"run_id,omitempty"`
	DeliveryOutcome types.RunInputDeliveryOutcome `json:"delivery_outcome,omitempty"`
	Interaction     *types.RunInteraction         `json:"interaction,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL