Repository navigation
feat(cli): show the links hidden behind text and buttons in --json - #16
Conversation
Messages in --json carry links: the URLs behind words of the text (text link entities, sliced in UTF-16 code units) and the link buttons of the keyboard. Agents lost both before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Adds hidden-text and button URLs to JSON message output, with documentation, demo data, and UTF-16 tests. URLs remain data: the change neither opens them automatically nor authorizes website logins. You can add or adjust custom eligibility rules. Learn more. |
An agent using
tglost the real URLs in deal channels: posts hide the Amazon or AliExpress link behind words like "➡ BUY HERE" or behind an inline button, and--jsononly gave the visibletext.Messages in
--jsonnow carrylinks: [{"text", "url"}]when there are any: the links behind words of the text (text link entities), then the link buttons of the keyboard, login buttons included. Telegram places entities in UTF-16 code units, so the text is sliced in those; an emoji before a link no longer shifts its label, and a range past the text is clamped instead of panicking. The demo has a text link and a link button, andguide.txtdocuments the field.Proved with
go test ./...(a focused test for UTF-16 slicing and clamping),go vet,gofmt, and the demo output below.Before
After
Council review
Rounds: 2
Muse Wonder was unavailable (quota exhausted).
Created with Claude Opus 5.5 in Claude Code (T3 Code); council reviews by Claude Opus 5.5, GPT 6.2 Sol and Gemini 4 Neon.
🤖 Generated with Claude Code
Note
Add hidden-text and button links to
--jsonmessage outputLinksfield tocore.Message, serialized as"links"and omitted when empty; each link carries the display text and URL.MessageEntityTextURLentities, converting UTF-16 offsets to text ranges and clamping out-of-bounds ranges (convert.go).linksarray; existing consumers ofcore.MessageJSON should tolerate the new optional field.Macroscope summarized cd6aa85.
Summary by CodeRabbit
linksarray for URLs embedded in message text or buttons. Each entry contains the visible link text and its URL.