Add shared Telegram rich formatting library (tg_fmt) - #24
Merged
Conversation
12 new conceptual architecture documents across three pillars: - memory/ (myths, genealogies, archives) - interfaces/ (alphabet, map, score, diagram, code) - runtime/docs/ (ritual, library, lab, workshop) Updated docs/README.md with doctrine index. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents 156k+ Claude Code worktree files from being tracked. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ross all bots Dual-mode (HTML + MarkdownV2) formatter with LLM markdown→Telegram conversion, HTML-aware truncation, and message chunking. Migrates redacted-chan, hermes, smolting, and redactedbuilder from legacy Markdown to tg_fmt helpers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
zkAurora
added a commit
that referenced
this pull request
Jul 29, 2026
Add shared Telegram rich formatting library (tg_fmt)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
shared/tg_fmt.py— dual-mode (HTML + MarkdownV2) Telegram message formatter withfrom_llm()for converting LLM markdown output to Telegram-safe formatted texttg_fmtfor rich message formatting — replaces legacyparse_mode="Markdown"with proper HTML helperstruncate()andchunks()for safe message splitting at the 4096-char Telegram limitTest plan
/startto each bot — check formatting renders correctly/soul,/phi,/memory) on redacted-chan — verify HTML formattingfrom_llm()renders bold, code, blockquotes from LLM output<,>,&characters — verify no "can't parse entities" errors🤖 Generated with Claude Code