feat(integrations): move Telegram credentials into the hub - #329
Open
plombeer31 wants to merge 1 commit into
Open
feat(integrations): move Telegram credentials into the hub#329plombeer31 wants to merge 1 commit into
plombeer31 wants to merge 1 commit into
Conversation
Telegram becomes the hub's second tenant, so an operator setting up a new install has one place to paste every key rather than needing to know which service happens to own a tab. Only the credential moves. Pairing, the owner id, start/stop and the live chat view stay on the Telegram tab: those act on a running channel rather than configuring one, and folding a pairing countdown into a credential list would make both surfaces worse. The hub owns "what is my token", the tab owns "what is the bot doing" -- and the hub's summary line points at the tab so the split is discoverable rather than something to work out. The bot token is validated at entry against the BotFather shape the scrubber already keys off (<6..12 digits>:<>=30 chars>), which turns a truncated paste from a silent "channel won't start" into an immediate, specific complaint. Status is live: `IntegrationStatusContext` gains `channelStates` alongside `mcpServerStates`, so a saved-but-idle token reads differently from a running channel and differently again from one that failed to start. A channel that is merely disabled is reported as configured, not as an error -- that is a normal resting state. Telegram resolves its token at construction, so it declares `appliesLive: false` and the pane says a restart is needed instead of leaving the operator to guess why nothing happened. Verified end-to-end: a malformed token is refused with a readable message and nothing is written; a well-formed one saves, masks, shows "token saved -- pair and enable on the Telegram tab", lands in <stateDir>/.env, and is visible in process.env for the Telegram tab's own has-token check without a restart.
plombeer31
force-pushed
the
feat/integrations-telegram
branch
from
September 4, 2026 21:56
de326ec to
3819f04
Compare
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
Telegram becomes the hub's second tenant, so an operator setting up a new install has one place to paste every key rather than needing to know which service happens to own a tab.
Scope: the credential only
Pairing, the owner id, start/stop and the live chat view stay on the Telegram tab. Those act on a running channel rather than configuring one, and folding a pairing countdown into a credential list would make both surfaces worse.
The hub owns "what is my token"; the tab owns "what is the bot doing". The hub's summary line points at the tab, so the split is discoverable rather than something the operator has to work out.
Validation at entry
The token is checked against the BotFather shape the scrubber already keys off —
<6..12 digits>:<≥30 [A-Za-z0-9_-] chars>. A truncated paste stops being a silent "channel won't start" and becomes an immediate, specific complaint about the paste.Live status
IntegrationStatusContextgainschannelStatesalongsidemcpServerStates, so three states that used to look identical now read differently:disabled)configuredupconnecteddownerrorA merely disabled channel is deliberately not an error — that is a normal resting state, and badging it red would train operators to ignore the badge.
Telegram resolves its token at construction, so it declares
appliesLive: falseand the pane says a restart is needed rather than leaving the operator to guess why nothing happened.Testing
npm run lintandnpm testgreen (7211 tests). 6 new tests; every existing Telegram test still passes untouched.Verified end-to-end against a real runtime:
hunter2→ refused: "Doesn't look like a bot token — expected digits, a colon, then a long string, as @Botfather issues it." Nothing written.••••…+13, badge flips toconfiguredwith the "pair and enable" detail<stateDir>/.envand is visible inprocess.envfor the Telegram tab's own has-token check, without a restart