Documentation
¶
Index ¶
- type Adapter
- type CronDispatcher
- type Handler
- type StatusReactionController
- func (c *StatusReactionController) Clear()
- func (c *StatusReactionController) SetCancelled()
- func (c *StatusReactionController) SetDone()
- func (c *StatusReactionController) SetError()
- func (c *StatusReactionController) SetQueued()
- func (c *StatusReactionController) SetThinking()
- func (c *StatusReactionController) SetTool(toolName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements platform.Platform for Telegram.
func NewAdapter ¶
func NewAdapter(cfg config.TelegramConfig, pool *acp.SessionPool, transcriber stt.Transcriber, synthesizer tts.Synthesizer, ttsCfg config.TTSConfig, mdCfg config.MarkdownConfig, picker sessionpicker.Picker, cronStore *cronjob.Store, cronCfg config.CronjobConfig) (*Adapter, error)
func (*Adapter) Healthy ¶
Healthy reports whether the Telegram polling loop is operating normally. Returns false when consecutive getUpdates errors have reached the restart threshold, indicating the adapter is degraded (e.g. after a network change).
func (*Adapter) RegisterCron ¶ added in v0.30.0
RegisterCron creates the per-platform cron Dispatcher and registers it with the prefix "tg" in the provided registry. The prefix must match buildSessionKey's output ("tg:<chat>" / "tg:<chat>:<thread>"), not the platform's full name — the scheduler routes by the substring before the first ':' in the threadKey.
type CronDispatcher ¶ added in v0.30.0
CronDispatcher implements cronjob.Dispatcher for Telegram threads.
func (*CronDispatcher) Fire ¶ added in v0.30.0
Fire posts a placeholder message into the originating chat (and forum topic if applicable), builds the cron-flavoured sender_context, and streams the reply via the existing streamPrompt machinery.
func (*CronDispatcher) NotifyDropped ¶ added in v0.30.0
func (d *CronDispatcher) NotifyDropped(ctx context.Context, job cronjob.Job)
NotifyDropped posts a brief marker so the user notices a fire was lost. Best-effort; failure is logged, not returned.
type Handler ¶
type Handler struct {
Bot *bot.Bot
Pool *acp.SessionPool
AllowedChats map[int64]bool
AllowedUserIDs map[int64]bool
// AllowAnyUser is true when allowed_user_id contains "*" — anyone can talk
// to the bot from any chat.
AllowAnyUser bool
ReactionsConfig config.ReactionsConfig
Transcriber stt.Transcriber
Synthesizer tts.Synthesizer
TTSConfig config.TTSConfig
// MarkdownTableMode controls how GFM tables in agent replies are rewritten
// before being sent to Telegram. See markdown.TableMode for options.
MarkdownTableMode markdown.TableMode
// BotToken is the raw Telegram bot token, kept so sendRichMessage can issue
// the raw Bot API 10.1 call (go-telegram/bot has no binding for it yet).
BotToken string
// RichMessages opts into the experimental Bot API 10.1 sendRichMessage path
// for complex replies (tables/headings/long). Off by default; falls back to
// the parse_mode=HTML path on any failure.
RichMessages bool
// Picker lists historical sessions for /pick. Nil when
// the configured agent backend is not recognised by sessionpicker.Detect.
Picker sessionpicker.Picker
CronStore *cronjob.Store
CronCfg config.CronjobConfig
// contains filtered or unexported fields
}
type StatusReactionController ¶
type StatusReactionController struct {
// contains filtered or unexported fields
}
func NewStatusReactionController ¶
func NewStatusReactionController( enabled bool, b *bot.Bot, chatID int64, messageID int, emojis config.ReactionEmojis, timing config.ReactionTiming, ) *StatusReactionController
func (*StatusReactionController) Clear ¶
func (c *StatusReactionController) Clear()
func (*StatusReactionController) SetCancelled ¶
func (c *StatusReactionController) SetCancelled()
SetCancelled is a terminal state for user-triggered cancellation (session/cancel). Distinct from SetError so downstream UI can tell the difference between a crash and an intentional stop. Telegram requires reactions to come from a fixed allowed set — 🙊 ("speak-no-evil" monkey) matches the semantic of "agent stopped talking" within that set.
func (*StatusReactionController) SetDone ¶
func (c *StatusReactionController) SetDone()
func (*StatusReactionController) SetError ¶
func (c *StatusReactionController) SetError()
func (*StatusReactionController) SetQueued ¶
func (c *StatusReactionController) SetQueued()
func (*StatusReactionController) SetThinking ¶
func (c *StatusReactionController) SetThinking()
func (*StatusReactionController) SetTool ¶
func (c *StatusReactionController) SetTool(toolName string)