sessiontarget

package
v0.7.21 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sessiontarget manages persisted session delivery targets.

Index

Constants

View Source
const (
	ReleaseArchive = "archive"
	ReleaseDelete  = "delete"
)

Ways to dispose of a removed channel's sessions.

Variables

This section is empty.

Functions

func ChannelOwner added in v0.7.1

func ChannelOwner(a config.AgentConfig, sess *domain.Session) int

ChannelOwner returns the index in a.Channels of the channel that owns sess, or -1. Only channel sessions are owned: the channel's own session and the conversations it received. Archived sessions are regular chats.

func ChannelSessions added in v0.7.1

func ChannelSessions(a config.AgentConfig, idx int) ([]*domain.Session, error)

ChannelSessions lists the sessions of a.Channels[idx]: its own session first, then the conversations it received, most recent first.

func EnsureChannel added in v0.7.1

func EnsureChannel(agentName string, cc config.ChannelConfig, mgr *channels.Manager) (*domain.Session, error)

EnsureChannel creates the channel's own session when it has none yet and points the session's delivery at the channel's DeliverTo conversation. It is safe to call on every config load.

func EnsureChannels added in v0.7.1

func EnsureChannels(cfg *config.Config, mgr *channels.Manager) error

EnsureChannels runs EnsureChannel for every channel in cfg, returning the first error after trying them all.

func Register

func Register(agentID, agentName, sessionID string, target store.SessionChannel, mgr *channels.Manager)

Register wires the session's text and media delivery to the configured target described by the sidecar entry.

func RekeyChannels added in v0.7.1

func RekeyChannels(prev, next *config.Config) error

RekeyChannels moves the sessions of channels whose type stayed but whose ID changed between prev and next, matched by their position in each agent's channel list: the channel's own session moves to its new name, and its conversations record the new configured ID. Without this, editing a channel's ID (a Signal channel's phone number) would orphan its session.

func ReleaseChannel added in v0.7.1

func ReleaseChannel(a config.AgentConfig, idx int, mode string) error

ReleaseChannel disposes of the sessions of a.Channels[idx], which is being removed: archive keeps each one as a regular chat titled after the channel, and delete removes it with its messages.

func Set

func Set(agentID, agentName, sessionID string, target store.SessionChannel, mgr *channels.Manager) error

Set persists a single target in the session sidecar and registers it with the live channel manager when available.

Types

This section is empty.

Jump to

Keyboard shortcuts

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