Repository navigation
Upgrade Telegram/Discord channels: Routine delivery, inline approvals, typing, and offline voice notes - #383
Merged
Merged
Conversation
…, typing, attachments
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.
Summary
Closes #376.
Upgrades Bate's direct-from-Mac Telegram and Discord channels so a paired chat works as a full away-from-Mac remote without any third-party relay:
proto/src/reveal.rs): movedreveal/has_hiddenintoproto(re-exported bynative/src/reveal.rs) and addedmark_plain([U+XXXX]) for plain-text channel cards.proto/src/routines.rs,appd/src/core.rs,window/ui/src/Routines.tsx,native/src/routines.rs):deliverChannel("telegram"|"discord") anddeliverChat(validated against the bot's currently paired chats) onRoutine./runreplies.window/uiandnativeRoutine dialogs, and displays delivery status on routine rows.Allow once/Deny) (appd/src/channels.rs,appd/src/core.rs):Allow once(approve:<qid>) andDeny(deny:<qid>) cards on Telegram (inline_keyboard+callback_query+answerCallbackQuery) and Discord (components+INTERACTION_CREATEcallback) when a channel-initiated turn or channel-delivered routine pauses on a question.Alwaysbutton, marks hidden/reordering characters viaproto::reveal::mark_plain, and never sends Secret prompts as approval cards (sends a plain redacted notice"The bot needs a secret in Bate on your Mac."with no buttons and refuses any forged callback targeting a Secret question).appd/src/channels.rs,appd/src/core.rs):sendChatAction//channels/{chat}/typing) run on a background thread while a channel turn executes and stop immediately on turn end, pause on a question, or engine exit.max_redirects(0), sanitized names written0o600insidebots/<bot>/inbox/). Unpaired chats never trigger downloads.BATE_TRANSCRIBE_CMDor macOS on-deviceSFSpeechRecognizerwithrequiresOnDeviceRecognition = true, never cloud speech APIs) offCore::run, falling back cleanly to the saved audio path if unavailable.Evidence
cd window/ui && npm ci && npm run build && npm test: 142/142 passed.cargo fmt --all --check: clean.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.cargo test --workspace --locked: all crates passed, including:appd --test service:channel_upgrades_routine_delivery_inline_approvals_typing_and_attachmentscovering Routine delivery, unpaired-chat refusal, LAN Device refusal, inlineAllow once/Denycallbacks with hidden-character marking, typing indicator, Secret prompt redaction & forged-callback refusal, bounded attachment saving, local offline voice transcription, and > 10 MiB rejection.native --test botpages:routine_delivery_selects_a_paired_channel_chat_and_sends_itplus visually verified light/dark Routine dialog snapshots.Merge Danger
Low. New
Routinefields (deliverChannel,deliverChat) are optional with#[serde(default)], preserving full backward compatibility with existing stored routines and bot export files. All channel I/O and transcription run offCore::run.Device decision
get_channelsremainsREFUSED_OVER_LAN.set_routineover LAN refuses (forbidden) any frame carryingdeliverChannelordeliverChat(evennull), andkeepPrecheck: truepreserves stored delivery targets when a paired Device edits other routine fields — matching the existing rule forprecheckandwatch. Documented inPROTOCOL.md.