Invoice-Downloader
EthanYoQ
电子发票整理与报销准备工具:从邮箱批量收集 PDF/OFD/XML 发票,OCR 识别、分类归档并生成 Excel 汇总;提供 Windows/macOS 桌面版与 DSH 插件。
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Nergous/dsh-tg-bridge
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | Русский
A DeepSeek Harness (DSH) plugin that gives every DSH session its own topic in a Telegram forum group. You can follow and drive a session from DSH or from Telegram; both sides see the same conversation.
workspace · session title. It is renamed when DSH titles the session,
closed when you archive it, and reopened when you restore it.answer.md; images the agent embeds or
presents arrive as photos. While the agent works the topic shows "typing…";
when a turn ends, a notifying ✅ Done line arrives.ask_user_question
prompts arrive with inline buttons. Telegram and the DSH GUI race: whichever
answers first wins, and the prompt on the other side is withdrawn; a
question answered in DSH shows the chosen answer in the topic. Approvals,
questions and the end-of-turn line mention (@) whoever sent the request
from Telegram, or the first allowed user for requests typed in DSH./stop, /status, /diff, /compact, /model,
/permission and more in a session topic; /sessions, /workspaces and /new in General. Other DSH
slash commands work too.dsh web).ffmpeg for voice messages.github:Nergous/dsh-tg-bridge (latest from GitHub), or/home/me/projects/dsh-tg-bridge.The plugin has no build step and no dependencies. After changing host code
(index.js, lib/) restart DSH; client.js reloads in the open page.
/newbot), paste the token on
the settings page and press Save token. The token is stored in DSH
credentials (DSH_TELEGRAM_BOT_TOKEN), never in configuration files. An
environment variable of the same name also works./bind <code> in the group
within 10 minutes. The group is saved, and you are added to the allowed
users. Add more Telegram user ids on the settings page if others should be
able to write to sessions. Messages from anyone else, from bots and from
anonymous admins are ignored.Only one process may poll a bot. If DSH desktop and dsh web run at the same
time with this plugin, Telegram answers 409 Conflict; use one of them, or a
second bot.
/sessions in General. Set Create topic to "As soon as a session
opens" to create it when the session is opened, or to "Never automatically"
to create topics only with /new and /sessions in General (existing
topics keep working).Write in a session's topic to talk to that session. Messages queue behind the
running turn, as in DSH. Start a message with ! to steer the running turn
instead. While the agent waits for an answer to a question, your next text
message answers it.
Whoever last sent the session work from Telegram is mentioned (@username, or a link with their name) on its approval prompts, the first question of a batch, and the end-of-turn line, so the notification reaches the person who is waiting. After a message typed in DSH the first allowed user is mentioned instead. Mention me chooses when: on approvals, questions and turn end (default), only on approvals and questions, or never.
Messages typed in DSH appear as 👤 You (DSH); their pictures follow as a
photo, or an album when there are several (GIFs as files).
Photos are attached as images (when the model accepts images), documents as files (up to Max download, MB). Voice messages are transcribed and sent as text; the transcript is echoed in the topic. Without a transcriber the audio file is attached.
Files the agent presents with the present tool are sent to the topic as
documents; PNG, JPEG and WebP go as photos (as a document when Telegram
refuses the photo). Local images an answer embeds as  (PNG, JPEG,
WebP, GIF, BMP, SVG; up to 10 per answer) follow the answer as photos with
the caption; the text shows 🖼 caption in their place.
| Command | What it does |
|---|---|
/stop |
Stop the running turn (queued messages stay queued). |
/status |
Workspace, state, model, context use, output mode. |
/diff |
git diff --stat of the session's directory, full patch as a file. |
/compact |
Compact the conversation (when the session is idle). |
/model [name] |
Show models as buttons, or switch to one by name. |
/permission [ro\|write\|full] |
Show access (Read Only, Workspace Write, Full Access) as buttons, or switch. Alias /access. New sessions: /new --ro\|--write\|--full <workspace> [prompt], or the buttons in the /new picker. |
/verbosity full\|tools\|final |
Output detail for this topic only. Answers past the answer.md threshold arrive as a one-line note plus answer.md. |
/mute, /unmute |
Pause or resume agent output in this topic. Approvals and questions still arrive. |
/steer <text> |
Same as !text. |
/help |
Command list. |
Other DSH slash commands, such as /goal, run through the
DSH command registry like in the composer. Unknown slash text is sent to the
session as a message.
| Command | What it does |
|---|---|
/sessions |
Recent DSH sessions as buttons. 🧵 opens the session's topic; ➕ creates (or reopens) it and posts the link, so you can continue any session from Telegram. |
/workspaces |
Known DSH workspaces. |
/new |
Pick a workspace from buttons, then send the first message (text, photo, file or voice) or start without one. The session's topic opens with your message. |
/new <workspace> [prompt] |
Start directly in a workspace (by name or path). Without a prompt the bot asks for the first message. |
/cancel |
Stop a /new that is waiting for a choice or a message. |
/help |
Command list. |
All settings live on the plugin's settings page and apply without a restart.
Output
| Setting | Default | Meaning |
|---|---|---|
| Output detail | tools collapsed | Everything with tools expanded, tools collapsed, or final answers only. /verbosity overrides it per topic. |
| Stream answers live | on | Edit one message while the model writes. Off sends the answer when it is complete. |
| Notify when a turn ends | on | ✅ Done line with sound. Everything else is silent. |
| Mention me | on approvals, questions and turn end | Or only on approvals and questions, or never. @-mentions the user who sent the request (from Telegram), or the first allowed user (typed in DSH). |
| Show "typing…" while working | on | Telegram typing indicator during a turn. |
| React 👀 / ⚡ when a message is delivered | on | Read reaction on your message: 👀 queued, ⚡ steer. |
| Mirror my DSH messages | on | Show messages typed in DSH in the topic. |
| Pinned status card per topic | on | Pin the topic's first message. |
| Send answer.md above, characters | 3400 | Longer answers come as a one-line note plus answer.md; shorter ones as one or more messages. |
Topics
| Setting | Default | Meaning |
|---|---|---|
| Create topic | on first message | Or as soon as a session opens, or never automatically. |
| When a session is archived | close the topic | Close, delete, or keep it open. Restoring the session reopens a closed topic. |
Interaction
| Setting | Default | Meaning |
|---|---|---|
| Approvals with buttons | on | Off sends approval requests only to the DSH GUI. |
| Agent questions with buttons | on | Off sends agent questions only to the DSH GUI. |
| Send files the agent presents | on | Forward present files: images as photos, the rest as documents. |
| Steer prefix | ! |
Empty disables the prefix. |
| Transcribe voice messages | on | Off attaches voice messages as audio files. |
| Transcription command | empty | Shell command (POSIX sh); {file} is a 16 kHz mono WAV. Example: whisper-cli -l ru -nt -f {file}. Without it DSH speech-to-text is used when installed. |
| Speech language (DSH STT) | empty | Language hint for DSH speech-to-text. |
Advanced
| Setting | Default | Meaning |
|---|---|---|
| Bridge enabled | on | Off stops polling and mirroring. |
| Stream edit interval, ms | 2500 | Minimum time between edits of a streaming message. |
| Messages per minute | 20 | Telegram's limit for one group; all topics share it. |
| Max download, MB | 20 | Largest file taken from Telegram (the Bot API limit is 20). |
| ffmpeg path | ffmpeg |
Used to decode voice messages. |
| Bot API URL | https://api.telegram.org |
For a self-hosted Bot API server. Must be https, or http on loopback. |
DSH speech-to-text (@deepseek-ai/dsh-experimental-voice-input-bundle) is
optional and does not recognize Russian; for Russian voice messages set a
transcription command such as whisper.cpp.
/sessions lists the 15 most recent sessions; older ones get a topic when
you continue them in DSH./model uses DSH's model switch, which also changes the default model for
new sessions.409 Conflict above).The plugin runs inside the DSH host process.
session/event, agent/assistant-stream,
subagent/start, subagent/end) and sends Telegram messages through one
rate-limited queue per group. Streaming edits are coalesced so a busy group
gets fewer, larger edits instead of a backlog. Messages that are not safe to
repeat are retried only when Telegram certainly did not receive them.sessionController.prompt, the method the
DSH composer uses. A cold session is resumed with its preset and model.approval/request and
user-questions/request waterfalls before the GUI and race both answers.
The DSH GUI shows the prompt at once; Telegram never delays it.origin: 'subagent'). Subagent approvals are shown in the root topic.~/.dsh/storages/telegram_bridge.json).attachments service).See SECURITY.md to report a vulnerability.
npm test # node --test, no dependencies
node scripts/check-repo.mjs # syntax, manifest consistency, full test suite
Tests use an in-process fake Telegram Bot API and fake DSH services; they
never contact Telegram or a real DSH installation. CI runs the check on Linux
(Node 22 and 24) and Windows, plus npm audit.
The previous Go bridge for the Codex App Server is preserved at the v0.1.5
tag.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: telegram、telegram-bot。