Documentation
¶
Index ¶
- Constants
- type Agent
- type AgentFinder
- type AgentSender
- type CompositeNotifier
- type Config
- type Dispatcher
- type MessageSource
- type Notifier
- type QueuedMessage
- type SlackNotifier
- type SlackSender
- type TelegramFetcher
- type TelegramNotifier
- type TelegramSender
- type TelegramSource
- type TmuxAgentFinder
- type TmuxSender
Constants ¶
const DefaultPollInterval = 10 * time.Second
DefaultPollInterval is the default interval between Telegram polls.
const DefaultPromptTemplate = `The following task was sent via Telegram. Create an implementation ticket on Linear (HUM) for it, then execute the plan: %s`
DefaultPromptTemplate is the prompt sent to idle Claude agents. Must be a single line — tmux send-keys treats newlines as Enter keypresses.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
SessionName string
WindowIndex int
PaneIndex int
Label string // e.g. "session:0.1"
}
Agent represents a Claude tmux pane that can receive work.
type AgentFinder ¶
AgentFinder discovers idle Claude tmux panes.
type AgentSender ¶
AgentSender sends a prompt to a tmux pane.
type CompositeNotifier ¶
type CompositeNotifier struct {
Notifiers []Notifier
}
CompositeNotifier fans out notifications to multiple notifiers. All notifiers are called; the first error is returned.
type Dispatcher ¶
type Dispatcher struct {
Source MessageSource
Finder AgentFinder
Sender AgentSender
Notifier Notifier
Config Config
Logger zerolog.Logger
// contains filtered or unexported fields
}
Dispatcher polls Telegram and dispatches messages to idle Claude agents.
type MessageSource ¶
type MessageSource interface {
FetchMessages(ctx context.Context) ([]QueuedMessage, error)
AckMessage(ctx context.Context, updateID int) error
}
MessageSource fetches and acknowledges Telegram messages.
type QueuedMessage ¶
QueuedMessage holds a Telegram message waiting for dispatch.
type SlackNotifier ¶
type SlackNotifier struct {
Client SlackSender
}
SlackNotifier notifies a Slack channel about dispatch events. The channel is pre-configured on the SlackSender.
type SlackSender ¶
SlackSender is the subset of slack.Client needed to send messages.
type TelegramFetcher ¶
type TelegramFetcher interface {
GetUpdates(ctx context.Context, limit int) ([]telegram.Update, error)
AckUpdate(ctx context.Context, updateID int) error
}
TelegramFetcher is the subset of telegram.Client needed to fetch messages.
type TelegramNotifier ¶
type TelegramNotifier struct {
Client TelegramSender
}
TelegramNotifier notifies a Telegram chat about dispatch events.
type TelegramSender ¶
TelegramSender is the subset of telegram.Client needed to send messages.
type TelegramSource ¶
type TelegramSource struct {
Client TelegramFetcher
AllowedUsers []int64
AllowedChats []int64 // see telegram.Config.AllowedChats
Logger zerolog.Logger
// contains filtered or unexported fields
}
TelegramSource adapts a Telegram client to the MessageSource interface.
func (*TelegramSource) AckMessage ¶
func (s *TelegramSource) AckMessage(ctx context.Context, updateID int) error
AckMessage acknowledges a Telegram update.
func (*TelegramSource) FetchMessages ¶
func (s *TelegramSource) FetchMessages(ctx context.Context) ([]QueuedMessage, error)
FetchMessages returns pending Telegram messages filtered by allowed (user, chat) pairs. Disallowed updates are acknowledged (via AckUpdate) so they do not remain in the Telegram pending queue, logged at WARN with structured fields, and counted in RejectedCount() for observability.
func (*TelegramSource) RejectedCount ¶
func (s *TelegramSource) RejectedCount() uint64
RejectedCount returns the total number of updates that have been rejected (and acked) across the lifetime of this source.
type TmuxAgentFinder ¶
type TmuxAgentFinder struct {
InstanceFinder claude.InstanceFinder
TmuxClient claude.TmuxClient
ProcessLister claude.ProcessLister
}
TmuxAgentFinder discovers Claude tmux panes that are available for dispatch.
func (*TmuxAgentFinder) FindIdleAgents ¶
func (f *TmuxAgentFinder) FindIdleAgents(_ context.Context) ([]Agent, error)
FindIdleAgents returns Claude tmux panes available for dispatch. Activity detection is not yet implemented — always returns nil.
type TmuxSender ¶
type TmuxSender struct {
Runner claude.CommandRunner
}
TmuxSender sends prompts to tmux panes via send-keys.
func (*TmuxSender) SendPrompt ¶
SendPrompt types the prompt into the target tmux pane and presses Enter.