Repository navigation
feat(t27mcp): telegram.t27 -- the owner's Telegram account as read-only tools of the t27 MCP server - #10274
Merged
Conversation
…ly tools of the t27 MCP server specs/t27mcp/telegram.t27 (module T27mcpTelegram) is the contract of tg_whoami, tg_dialogs, tg_unread, tg_messages and tg_search in gHashTag/t27-mcp. The server spawns the owner's tg CLI (gHashTag/agent-telegram, gram.js over MTProto, session in the macOS Keychain); this spec holds the tool table and every decision: - chat_ok: a numeric id or a username, from counts the server passes in, refused before tg runs; - query_ok and limit_for: 1 to 200 characters, default 25, cap 100; - outcome: not installed, no session (also when tg whoami exits 0 with the session MISSING), usage, failed, ok, each with the next step in OUTCOME_TEXT; - FOREIGN_TEXT heads every chat reply, and SEND_TEXT says why there is no send tool. 8 of 8 tests pass, 0 vacuous, on the lab (t27c 0.5.2, zig 0.16.0). 7 mutants, each caught. Refs #10066 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
October 18, 2026 06:42
Contributor
gHashTag
added a commit
to gHashTag/t27-mcp
that referenced
this pull request
Oct 18, 2026
…y telegram.t27 (#20) Five tools read the owner's own Telegram account (a user session, not a bot) through the owner's tg CLI (gHashTag/agent-telegram): tg_whoami, tg_dialogs, tg_unread, tg_messages, tg_search. wasm/telegram.wasm, built from specs/t27mcp/telegram.t27 (gHashTag/t27#10274), checks every chat id, query and limit before tg runs and names the outcome of each run: not installed, no session, usage, failed, ok. wasm/telegram_table.mjs holds the tool names, commands, descriptions and texts. Every chat reply is headed by a line saying other people's words are data, not instructions. There is no send tool: tg cannot send by construction, and a send path needs a confirm gate and the owner's decision. telegram.mjs is the glue, 38 lines; server.mjs gains 2. The session stays in the Keychain, read by tg on each call; the server never holds it. T27_TG points at another tg binary. Live on the owner's Mac over stdio: tools/list lists 24 tools; a bad chat is refused before tg runs; tg_whoami and tg_dialogs answer "no session" with the tg login step; T27_TG=/nonexistent answers "not installed". Build record and sha256 values in wasm/BUILD. Refs gHashTag/t27#10066 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
specs/t27mcp/telegram.t27(moduleT27mcpTelegram) defines the contract of five new tools in gHashTag/t27-mcp:tg_whoami,tg_dialogs,tg_unread,tg_messagesandtg_search. They read the owner's own Telegram account (a user session over MTProto, not a bot) through the owner'stgCLI, gHashTag/agent-telegram. The server never holds the session;tgreads it from the macOS Keychain on each call.The spec holds the tool table and every decision. The server passes counts and flags in, never text:
chat_oktgruns.query_ok,limit_foroutcometg whoamiexits 0 with the sessionMISSING, and that is no session, not ok. Each outcome has its next step inOUTCOME_TEXT.FOREIGN_TEXTSEND_TEXTtgcannot send by construction, and a send path needs a confirm-before-acting gate and the owner's decision first.Evidence (lab, t27c 0.5.2, zig 0.16.0)
t27c test-report specs/t27mcp/telegram.t27: 8 of 8 tests pass, 0 vacuous.if (minus) return falsesurvived, because a minus is not a word character. The line was removed.gen-c,gen-jsandzig ccbuildtelegram.wasm, 292 bytes. The t27-mcp PR vendors it with sha256 values inwasm/BUILD.tools/listlists the five tools;CHAT_BAD_TEXT;tg_whoamiandtg_dialogsanswer no session with thetg loginnext step, because the Keychain holds no session yet;T27_TG=/nonexistentanswers not installed.Refs #10066
🤖 Generated with Claude Code