rooms

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRoomID        = errors.New("room id is required")
	ErrInvalidRoomRequest   = errors.New("invalid room request")
	ErrRoomExists           = errors.New("room already exists")
	ErrUnknownRoom          = errors.New("unknown room")
	ErrUnknownThread        = errors.New("unknown thread")
	ErrUnknownAgent         = errors.New("unknown agent")
	ErrInvalidDMID          = errors.New("dm id is required")
	ErrInvalidCursor        = errors.New("invalid cursor")
	ErrInvalidMessage       = errors.New("invalid message request")
	ErrUnknownDM            = errors.New("unknown direct conversation")
	ErrArtifactFilter       = errors.New("artifact filter is required")
	ErrUnknownPairing       = errors.New("unknown pairing")
	ErrPairingClientMissing = errors.New("pairing client is not configured")
	ErrHumanIngressDisabled = errors.New("human ingress is disabled")
	ErrRemotePairing        = errors.New("paired network request failed")
	ErrAgentConflict        = errors.New("agent identity conflict")
)

Functions

This section is empty.

Types

type Error

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

func (*Error) Error

func (e *Error) Error() string

func (*Error) StatusCode

func (e *Error) StatusCode() int

func (*Error) Unwrap

func (e *Error) Unwrap() error

type EventBroker

type EventBroker interface {
	Publish(event protocol.Event)
	Subscribe(ctx context.Context) <-chan protocol.Event
}

type PairingClient

type PairingClient interface {
	FetchNetwork(ctx context.Context, pairing protocol.Pairing) (protocol.Network, error)
	FetchRooms(ctx context.Context, pairing protocol.Pairing) ([]protocol.Room, error)
	FetchAgents(ctx context.Context, pairing protocol.Pairing) ([]protocol.AgentSummary, error)
	RelayMessage(ctx context.Context, pairing protocol.Pairing, request protocol.SendMessageRequest) (protocol.MessageAccepted, error)
}

type Service

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

func NewService

func NewService(config ServiceConfig) *Service

func (*Service) Close

func (s *Service) Close() error

func (*Service) CreateRoom

func (s *Service) CreateRoom(request protocol.CreateRoomRequest) (protocol.Room, error)

func (*Service) CreateRoomContext

func (s *Service) CreateRoomContext(ctx context.Context, request protocol.CreateRoomRequest) (protocol.Room, error)

func (*Service) GetAgent

func (s *Service) GetAgent(agentID string) (protocol.AgentSummary, error)

func (*Service) GetDirectConversation

func (s *Service) GetDirectConversation(dmID string) (protocol.DirectConversation, error)

func (*Service) GetRoom

func (s *Service) GetRoom(roomID string) (protocol.Room, error)

func (*Service) GetThread

func (s *Service) GetThread(threadID string) (protocol.Thread, error)

func (*Service) Health

func (s *Service) Health(ctx context.Context) error

func (*Service) ListAgents

func (s *Service) ListAgents() ([]protocol.AgentSummary, error)

func (*Service) ListAgentsContext

func (s *Service) ListAgentsContext(ctx context.Context, page protocol.PageRequest) (protocol.AgentPage, error)

func (*Service) ListArtifacts

func (s *Service) ListArtifacts(
	filter protocol.ArtifactFilter,
	before string,
	limit int,
) (protocol.ArtifactPage, error)

func (*Service) ListArtifactsContext

func (s *Service) ListArtifactsContext(
	ctx context.Context,
	filter protocol.ArtifactFilter,
	page protocol.PageRequest,
) (protocol.ArtifactPage, error)

func (*Service) ListDMMessages

func (s *Service) ListDMMessages(dmID string, before string, limit int) (protocol.MessagePage, error)

func (*Service) ListDMMessagesContext

func (s *Service) ListDMMessagesContext(
	ctx context.Context,
	dmID string,
	page protocol.PageRequest,
) (protocol.MessagePage, error)

func (*Service) ListDirectConversations

func (s *Service) ListDirectConversations() (protocol.DirectConversationPage, error)

func (*Service) ListDirectConversationsContext

func (s *Service) ListDirectConversationsContext(ctx context.Context, page protocol.PageRequest) (protocol.DirectConversationPage, error)

func (*Service) ListPairings

func (s *Service) ListPairings() ([]protocol.Pairing, error)

func (*Service) ListPairingsContext

func (s *Service) ListPairingsContext(_ context.Context, page protocol.PageRequest) (protocol.PairingPage, error)

func (*Service) ListRoomMessages

func (s *Service) ListRoomMessages(roomID string, before string, limit int) (protocol.MessagePage, error)

func (*Service) ListRoomMessagesContext

func (s *Service) ListRoomMessagesContext(
	ctx context.Context,
	roomID string,
	page protocol.PageRequest,
) (protocol.MessagePage, error)

func (*Service) ListRooms

func (s *Service) ListRooms() ([]protocol.Room, error)

func (*Service) ListRoomsContext

func (s *Service) ListRoomsContext(ctx context.Context, page protocol.PageRequest) (protocol.RoomPage, error)

func (*Service) ListThreadMessages

func (s *Service) ListThreadMessages(threadID string, before string, limit int) (protocol.MessagePage, error)

func (*Service) ListThreadMessagesContext

func (s *Service) ListThreadMessagesContext(
	ctx context.Context,
	threadID string,
	page protocol.PageRequest,
) (protocol.MessagePage, error)

func (*Service) ListThreads

func (s *Service) ListThreads(roomID string) (protocol.ThreadPage, error)

func (*Service) ListThreadsContext

func (s *Service) ListThreadsContext(ctx context.Context, roomID string, page protocol.PageRequest) (protocol.ThreadPage, error)

func (*Service) Network

func (s *Service) Network() protocol.Network

func (*Service) PairingAgents

func (s *Service) PairingAgents(ctx context.Context, pairingID string) ([]protocol.AgentSummary, error)

func (*Service) PairingAgentsContext

func (s *Service) PairingAgentsContext(ctx context.Context, pairingID string, page protocol.PageRequest) (protocol.AgentPage, error)

func (*Service) PairingNetwork

func (s *Service) PairingNetwork(ctx context.Context, pairingID string) (protocol.Network, error)

func (*Service) PairingRooms

func (s *Service) PairingRooms(ctx context.Context, pairingID string) ([]protocol.Room, error)

func (*Service) PairingRoomsContext

func (s *Service) PairingRoomsContext(ctx context.Context, pairingID string, page protocol.PageRequest) (protocol.RoomPage, error)

func (*Service) RegisterAgentContext

func (s *Service) RegisterAgentContext(
	ctx context.Context,
	request protocol.RegisterAgentRequest,
) (protocol.AgentRegistration, error)

func (*Service) SendMessage

func (s *Service) SendMessage(request protocol.SendMessageRequest) (protocol.MessageAccepted, error)

func (*Service) SendMessageContext

func (s *Service) SendMessageContext(ctx context.Context, request protocol.SendMessageRequest) (protocol.MessageAccepted, error)

func (*Service) Subscribe

func (s *Service) Subscribe(ctx context.Context) <-chan protocol.Event

func (*Service) SubscribeFrom

func (s *Service) SubscribeFrom(ctx context.Context, lastEventID string) <-chan protocol.Event

func (*Service) UpdateRoomMembers

func (s *Service) UpdateRoomMembers(
	ctx context.Context,
	roomID string,
	request protocol.UpdateRoomMembersRequest,
) (protocol.Room, error)

type ServiceConfig

type ServiceConfig struct {
	AllowHumanIngress bool
	NetworkID         string
	NetworkName       string
	Pairings          []protocol.Pairing
	Version           string
	Store             store.RoomStore
	Messages          store.MessageStore
	Broker            EventBroker
	PairingClient     PairingClient
}

Jump to

Keyboard shortcuts

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