Skip to content

Add shared Telegram rich formatting library (tg_fmt) - #24

Merged
zkAurora merged 3 commits into
mainfrom
refactor/consolidate
Jun 14, 2026
Merged

Add shared Telegram rich formatting library (tg_fmt)#24
zkAurora merged 3 commits into
mainfrom
refactor/consolidate

Conversation

@zkAurora

Copy link
Copy Markdown
Contributor

Summary

  • New shared/tg_fmt.py — dual-mode (HTML + MarkdownV2) Telegram message formatter with from_llm() for converting LLM markdown output to Telegram-safe formatted text
  • Migrated all 4 Telegram bots (redacted-chan, smolting, hermes, redactedbuilder) to use tg_fmt for rich message formatting — replaces legacy parse_mode="Markdown" with proper HTML helpers
  • Includes HTML-aware truncate() and chunks() for safe message splitting at the 4096-char Telegram limit
  • Also includes redacted-chan memory improvements (mc_retriever, echo_detector, memory_cache)

Test plan

  • Verify each bot starts without import errors
  • Send /start to each bot — check formatting renders correctly
  • Trigger admin commands (/soul, /phi, /memory) on redacted-chan — verify HTML formatting
  • Send conversational messages — verify from_llm() renders bold, code, blockquotes from LLM output
  • Test messages with <, >, & characters — verify no "can't parse entities" errors

🤖 Generated with Claude Code

Alexis and others added 3 commits June 11, 2026 22:27
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
zkAurora merged commit b4a5f48 into main Jun 14, 2026
1 check failed
zkAurora added a commit that referenced this pull request Jul 29, 2026
Add shared Telegram rich formatting library (tg_fmt)
@zkAurora
zkAurora deleted the refactor/consolidate branch July 29, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant