transport

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package transport provides inbound message transports for AgentComms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelResolver

type ChannelResolver interface {
	FindAgentByChannel(channelID string) (agentID string, found bool)
}

ChannelResolver resolves chat channel IDs to agent IDs.

type ChatTransport

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

ChatTransport handles inbound messages from chat providers via omnichat.

func NewChatTransport

func NewChatTransport(
	chatRouter *provider.Router,
	client *ent.Client,
	router *router.Router,
	resolver ChannelResolver,
	logger *slog.Logger,
) *ChatTransport

NewChatTransport creates a new chat transport using omnichat.

func (*ChatTransport) Router

func (t *ChatTransport) Router() *provider.Router

Router returns the underlying omnichat router for outbound messages.

func (*ChatTransport) SendMessage

func (t *ChatTransport) SendMessage(ctx context.Context, channelID, content string) error

SendMessage sends a message to a chat channel. channelID should be in format "provider:chatid".

func (*ChatTransport) Start

func (t *ChatTransport) Start(ctx context.Context) error

Start begins listening for messages from all registered providers.

func (*ChatTransport) Stop

func (t *ChatTransport) Stop() error

Stop stops the chat transport.

Jump to

Keyboard shortcuts

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