dsh-web-search-ddg
aooyoo
Zero-token DuckDuckGo search provider for the DeepSeek Harness (DSH) web seam — local headless browser, no API key, no m…
PROJECT TOPICS
PROJECT README
Telegram runtime adapter for DeepSeek Harness — talk to your dsh agents from Telegram. Every allowed chat maps to one agent session; messages flow in via followup(), committed assistant text streams back to the chat. Zero runtime dependencies (plain HTTP over Node's built-in fetch).
dsh-telegram turns a DeepSeek Harness agent into a Telegram bot. It is a protocol driver in the dsh extension model: it adapts an external wire peer (Telegram) to ctx.agents, the same role the official ACP/JSON-RPC bridges play — but for human chat instead of automation.
Who is it for?
What it does
getUpdates) with no server, no webhook, no framework.followup() into the same session, so conversation history is preserved./start, /new (fresh session), /status.What it does not do (yet)
fetch).@deepseek-ai/dsh@0.1.0-rc.6 / @deepseek-ai/cordis@^4.0.1.master).@deepseek-ai/dsh-agent, dsh-llm, dsh-session) may change shape between RC releases./new to start a fresh one).Install into a dsh profile (local checkout; no build permission needed):
cd /path/to/deepseek-harness
pnpm dsh plugin --profile web add /path/to/dsh-telegram
From GitHub (source install — pnpm runs the prepare script, so allow it once):
pnpm dsh plugin --profile web add github:<you>/dsh-telegram
# pnpm ≥10 blocks the build script on first install; copy the printed package key
# into <profile>/pnpm-workspace.yaml under allowBuilds, then re-run.
From npm (once published):
pnpm dsh plugin --profile web add dsh-telegram
Uninstall:
pnpm dsh plugin --profile web remove dsh-telegram
Create a bot with @BotFather and copy the token.
Find your Telegram user id (e.g. message @userinfobot).
Set the token and your user id in the profile's cordis.patch.yml (or export DSH_TELEGRAM_BOT_TOKEN):
- id: dsh-telegram
name: dsh-telegram
config:
botToken: '123456:ABC-DEF...'
allowedUserIds: [123456789]
provider: deepseek-official
model: deepseek-v4-flash
Start dsh, open your bot in Telegram, send /start, then any message.
All keys live under the dsh-telegram row's config (patch layer; later layers win per row).
| Key | Type | Default | Meaning |
|---|---|---|---|
botToken |
string | env DSH_TELEGRAM_BOT_TOKEN |
Telegram bot token from @BotFather. Empty disables sending. |
allowedUserIds |
number[] | [] |
Telegram user ids allowed to chat. Empty = everyone rejected. |
provider |
string | — | Provider route for created agents (falls back to profile default). |
model |
string | — | Model for created agents (falls back to profile default). |
cwd |
string | process.cwd() |
Working directory for created agent sessions. |
pollTimeoutSeconds |
number | 25 |
Long-poll timeout for getUpdates (Telegram max 50). |
⛔ You are not authorized and are never given an agent session. The bot token itself is the secret that lets anyone call your bot; the allowlist decides who gets a session.api.telegram.org (bot API). Agent model calls go through the harness's normal LLM provider path.botToken to the repository. Use the env-var form in the shipped patch (process.env.DSH_TELEGRAM_BOT_TOKEN ?? '').| Symptom | Cause | Fix |
|---|---|---|
Bot never replies, botToken is empty warning |
Token not configured | Set DSH_TELEGRAM_BOT_TOKEN or config.botToken; restart dsh |
⛔ You are not authorized |
Your user id is not in allowedUserIds |
Add your id; restart dsh |
poll error: telegram getUpdates: 401 |
Token invalid/revoked | Recreate token in @BotFather |
| Replies stop mid-conversation | Agent error | Check dsh logs; the error is forwarded to the chat with ⚠️ Agent error: |
| Long poll spam in logs | Network to api.telegram.org blocked/unstable |
Ensure the machine can reach api.telegram.org (proxy env vars are respected by Node fetch); the plugin backs off automatically |
cannot get property "agents" without inject |
Plugin loaded without inject metadata (stale build) |
Rebuild: pnpm run build; verify the installed lib/index.js is fresh |
pnpm install
pnpm run typecheck # tsc --noEmit
pnpm run build # tsc → lib/
Structure:
src/index.ts — plugin entry (name/inject/Config/apply), Telegram client, long-poll loop, session mapping.cordis.patch.yml — the bundle patch layer that mounts the plugin row.Design notes for contributors:
getUpdates, sendMessage, sendChatAction). Before adding a dependency, ask whether Node's built-ins cover it.(chat, bot) or persist them; see Compatibility.MIT. Report security issues privately via the repository's security advisory (or open an issue without secrets). The plugin runs the Telegram token as configured by the operator; it executes no model code itself — all agent behavior is governed by the harness's own permission and sandbox policy.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。