channels

package
v0.1.93 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 6 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"
)

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 ErrChannelTypeNotRegistered

type ErrChannelTypeNotRegistered struct {
	ChannelType ChannelType
}

func (*ErrChannelTypeNotRegistered) Error

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 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"`
}

Jump to

Keyboard shortcuts

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