Package-level declarations
Types
Handles an Effect that shouldn't block the transition that produced it — typically network calls. Unlike EffectHandler, this doesn't run as part of the current transition and doesn't produce an EffectResult: it runs independently (cancelled if the chat goes idle, see ChatWorkers in telek's implementation), and whatever Event it returns re-enters the FSM as its own, later transition — handled by StateDispatcher's transition(state, event) overload.
What a conversation's state is filed under.
Opt-in marker for an Effect whose async dispatch should cancel any previous in-flight async effect for the same chat with an equal debounceKey, instead of letting them run concurrently — e.g. a user clicking through categories quickly, where only the latest fetch's result should matter.
Routes on the two things that can start a flow — a command and a callback — and on the conversation's current state for everything else.
Looks up a handler per effect in effectRegistry and runs it. context is resolved once per execute call — transport-specific executors (e.g. telegramEffectExecutor()) use this to supply an ExecutionContext that may only become available after telek itself is constructed (e.g. once a bot instance exists), without Telek needing to own or track that lifecycle.
What to do when an effect in a batch fails.
An Effect and what running it produced.
Something that happened asynchronously and needs to re-enter the FSM — the result of an AsyncEffectHandler, not something a user sent. Unlike Input, an Event can never start a flow: it's routed purely by the conversation's current state (see StateDispatcher.transition overload that takes an Event), never by command or callback data.
How a transport turns an incoming update into a ConversationKey.
A message body as a document, not as a string a server parses.
Builds a MessageText.
A photo. Telegram offers several sizes of one; file is the one the transport designates, and telek models no others — a bot that needs a particular size asks the transport for it, which is out of this model on purpose.
telek's own logging seam: println/java.util.logging are not acceptable in a library, since the consumer can neither redirect nor silence them. Pass an implementation that forwards to whatever the consumer already uses (slf4j, kotlin-logging, ...) — telek has no opinion on the concrete backend and does not depend on one.
A MessageText flattened the way the Bot API wants it: plain text plus ranges over it.
One node of a MessageText.
The styles that wrap other pieces. See TextPiece.Code for the two that do not.
Stores one FSM state per ConversationKey — which is a chat, or a person within a chat; see ConversationKey for why that is not the same as the chat a reply is addressed to.
Properties
The dispatcher telek runs blocking-capable work on — synchronous EffectHandlers (see EffectExecutorImpl) and, in :persistence, file I/O.
The dispatcher telek runs blocking-capable work on — synchronous EffectHandlers (see EffectExecutorImpl) and, in :persistence, file I/O.
Dispatchers.IO is unreachable from a Kotlin/Native source set: kotlinx-coroutines declares the public one as an expect extension in its concurrent source set, but Dispatchers on Native also has an internal val IO member, and a member always shadows an extension — so the reference resolves to the internal one and fails to compile outside kotlinx-coroutines itself.
Functions
Parses Message.text as a command, or returns null when it is not one.
The entities for this message, in the order their ranges open.
Builds a MessageText outside a transition — useful when a message is assembled elsewhere.