packages

yaebal is a pnpm monorepo. three foundation packages, a stack of first-party plugins, plus scaling and tooling — all under the @yaebal/* npm scope, published as ESM with full TypeScript types.

terminal
# install everything (workspace bootstrap)
pnpm install

# or add individual packages to your project
pnpm add @yaebal/core @yaebal/session @yaebal/keyboard

foundation

packagedescription
yaebalbatteries-included entry — core + auto-generated contexts + common plugins, one import
@yaebal/coreBot, Composer, context, filter queries, media helpers — the engine everything else builds on
@yaebal/typesfull Telegram Bot API types, code-generated from our own parser of the live docs; single source of truth for all interfaces
@yaebal/contextsper-update context classes with auto-generated shortcut methods (ctx.reply, ctx.sendPhoto, …)

plugins

each plugin is a typed composer extension. installing one enriches the context type; its dependencies are checked at compile time. see the plugins overview for a quick orientation.

packagedescription
@yaebal/fmthtml`` / md`` tagged templates → entities, with auto-escaped interpolation
@yaebal/richsendRichMessage / sendRichMessageDraft: block builder, streaming drafts, full read-side coverage
@yaebal/filterscomposable, type-narrowing update filters: and / or / not, commands, deep links, media, async
@yaebal/guardsreusable bot.guard() predicates: isAdmin, isPrivate, isGroup, hasMembership, hasPermission
@yaebal/conversationawait-style multi-step dialogs — coroutine by default, durable replay engine opt-in
@yaebal/againawaited retry on structured retry_after / transient 5xx errors
@yaebal/sessiontyped sessions: dirty-checked saves, lazy mode, multi-session, ttl fields, migrations
@yaebal/skladzero-dep storage adapters: memory (ttl/lru), redis, sqlite, cloudflare kv, json file
@yaebal/cachectx.cache.get/set/wrap — ttl memoization, stale-while-revalidate, sliding expiry, negative caching, prefix invalidation, typed key catalog
@yaebal/feature-flagsctx.flags.isEnabled(key)/getVariant(key) — typed boolean & A/B/n flags, telegram-native targeting, global overrides, guard/whenFlag, admin commands, LaunchDarkly/GrowthBook/env adapters
@yaebal/keyboardfluent inline & reply keyboard builders
@yaebal/callback-datatyped callback_data pack / unpack
@yaebal/paymentstyped invoice builder (stars / external providers), pre-checkout & successful-payment hooks, star subscriptions
@yaebal/mini-apptelegram Mini Apps server protocol — HMAC + Ed25519 (third-party) initData validation, typed parser & test signer, Authorization: tma header helper, answerWebAppQuery, WebAppInfo/deep-link url generator
@yaebal/link-previewfluent builder for link_preview_options
@yaebal/inline-resultstyped builders for every InlineQueryResult / InputMessageContent variant
@yaebal/auto-answerauto-clears the callback-query loading spinner, no manual answerCallbackQuery call
@yaebal/hydratehydrated api results — the returned Message gains editText/delete/pin/forward/copy/react, no manual chat_id or message_id
@yaebal/typingctx.typing(fn) keeps the "is typing…" indicator alive for an async call, no manual sendChatAction
@yaebal/ephemeralctx.replyEphemeral() — answer in a group so only the asker sees it, typed edit/delete handle, private-chat fallback
@yaebal/aictx.ai.replyStream() — llm answers streamed via telegram drafts / throttled edits, model adapters (openai-compatible, anthropic, ai sdk, custom), conversation memory, per-user limits — plus the ai dev tooling (mcp server + agent installer)
@yaebal/mordadialogs engine + jsx/hooks (react-for-telegram)
@yaebal/i18ntyped ctx.t (keys + params), Intl plurals, language_code detection
@yaebal/scenesdurable wizards: typed state, ask() validation, navigation, sub-scenes, ttl
@yaebal/state-machinedeclarative finite-state machines: typed events, guarded transitions, onEnter/onLeave hooks
@yaebal/onboardingdeclarative first-run tutorials with inline controls
@yaebal/promptask a question, await the next message as the answer
@yaebal/routertyped file-based routing — define*() routes, nested guards, watchRoutes hot-reload
@yaebal/tomldeclarative toml routes with a typescript handler registry
@yaebal/throttlepriority outbound scheduler with global/private/group buckets
@yaebal/filesinspect, link, stream and download Telegram files
@yaebal/file-idparse and re-serialize file_id / file_unique_id strings
@yaebal/ratelimiterdrop updates from users who send too many requests
@yaebal/broadcasttyped broadcast jobs with storage, retry, progress and controls
@yaebal/crontyped cron jobs: timezones, retries, catch-up, distributed locks, and a chat-native admin surface
@yaebal/webwebhooks on any runtime — edge, node/bun/deno servers, serverless, and fetch frameworks; adapters, sequentialize, dedupe, lifecycle
@yaebal/panelframework-agnostic operator panel with media, keyboards and events
@yaebal/analyticsctx.track(event, properties) with pluggable sinks: posthog, plausible, sqlite, clickhouse
@yaebal/audit-logcorrelated, redacted-by-default audit logging — sinks, formatters, filters, sampling, chatSink, auditAdmin
@yaebal/media-groupcollect albums into one handler call or ctx.mediaGroup
@yaebal/splitlong text as multiple messages — entities survive the split
@yaebal/commandsone registry for handlers + the / command menu — localized, scoped, diff-synced
@yaebal/paginationpaginated lists over any source — lazy fetch, item buttons, typed payload
@yaebal/media-cacheupload once, reuse the file_id — self-heals when telegram rejects it
@yaebal/previewrender telegram-style chats to a standalone SVG string — reply quotes, reactions, link previews, custom themes (experimental)

scaling & tooling

packagedescription
@yaebal/runnerconcurrent update processing with per-chat sequentialization
@yaebal/workersworker_threads pool to offload CPU-heavy tasks from handlers
@yaebal/testtesting utilities — mock api with real hooks & error simulation, update factories for every update kind, webhook helpers
create-yaebalproject scaffolder — pnpm create yaebal
all packages require Node.js ≥ 20 and are ESM-only ("type": "module"). use import type for type-only imports — verbatimModuleSyntax is enabled across the workspace.