"""Every string the Telegram frontend shows the user; English defaults, overridable.""" from __future__ import annotations from dataclasses import dataclass, field __all__ = ["TOOL_LABELS", "TelegramTexts"] TOOL_LABELS: dict[str, str] = { "Read": "reading", "Glob": "looking for files", "Grep": "searching", "Edit": "editing a file", "Write": "writing a file", "MultiEdit": "editing files", "Bash": "running a command", "WebSearch": "searching the web", "WebFetch": "reading a page", "Task": "started a subagent", "Agent": "started a subagent", "AskUserQuestion": "asking", "TodoWrite": "planning", "Skill": "opening a skill", "mcp__gateway__spawn": "opening a conversation", "mcp__gateway__read_conversation": "reading a conversation", "mcp__gateway__say": "speaking", "mcp__gateway__schedule": "setting a reminder", "mcp__gateway__inject": "passing to another conversation", } @dataclass(frozen=True, slots=True) class TelegramTexts: commands: tuple[tuple[str, str], ...] = ( ("merge", "merge this branch into the master"), ("new", "new branch: in General a new topic, in a topic a fresh one here"), ("chat", "open a deep chat in the vault: /chat topic"), ("status", "this conversation"), ("help", "commands"), ) help_head: str = "General is the master, any other topic is a branch." branch: str = "branch" closed_prefix: str = "โœ… " waiting: str = "โณ thinking" thinking: str = "๐Ÿค” thinking" writing: str = "โœ๏ธ writing" tool: str = "โณ {label}" tool_labels: dict[str, str] = field(default_factory=lambda: dict(TOOL_LABELS)) attachment_sticker: str = "[attachment: sticker - not supported]" attachment_animation: str = "[attachment: animation - not supported]" attachment_kinds: dict[str, str] = field( default_factory=lambda: { "photo": "photo", "document": "file", "voice": "voice message", "audio": "audio", "video": "video", "video_note": "video note", } ) attachment_too_big: str = ( "[attachment: {kind} {name}, {mb} MB - over 20 MB, Telegram does not " "serve it to bots]" ) attachment_failed: str = "[attachment: {kind} {name} - download failed: {error}]" attachment_size: str = ", {kb} KB" attachment: str = "[attachment: {kind} {path}{size}]" attachment_kept: str = ( "[attachment: {kind} {path}{size}; kept {days} days, move it into the " "vault if it matters]" ) merge_nothing: str = "nothing to merge: this is not an open branch" merging: str = "๐Ÿ”€ merging into the master" merged: str = "โœ… merged into the master" merge_failed: str = "โš ๏ธ merge failed: {error}" new_branch_topic: str = "๐ŸŒฟ branch ยซ{title}ยป - in a new topic" new_branch_here: str = "๐ŸŒฟ new branch on this topic" chat_usage: str = "/chat " chat_failed: str = "could not open: {error}" chat_opened: str = "๐Ÿ’ฌ deep chat: {where}" status_unbound: str = "this topic is bound to nothing - write, and a branch opens" status_line: str = "session: {live} ยท turn: {turn} ยท queued: {queued}" status_live: str = "live" status_dead: str = "none" status_running: str = "running" status_idle: str = "idle" status_question: str = "โ“ waiting for an answer" status_pool: str = "pool: {sessions} sessions, rss {mb} MB" status_outbox: str = "outbox: {pending} queued" turn_failed: str = "โš ๏ธ the turn failed, see the gateway logs" background_failed: str = ( "โš ๏ธ a background turn ({origin}) failed, see the gateway logs" ) question_closed: str = "the question is already closed" question_timeout: str = "โŒ› time is up - answer as text" question_answered: str = "โœ… {answer}" question_typed: str = "โœ๏ธ {text}" done_button: str = "โœ… done" mirrored: str = "๐Ÿ“ from the panel:\n{text}" @property def help(self) -> str: return ( self.help_head + "\n" + "\n".join(f"/{c} - {d}" for c, d in self.commands) )