DSH Bridge

by sky
5
4
3
2
1
Score: 31/100

Description

DSH(DeepSeek Harness)嵌入 Obsidian 的 AI 协作者插件:聊天侧边栏、内联编辑、@提及与计划模式(连接本地 http://127.0.0.1:3080)

Reviews

No reviews yet.

Stats

2
stars
363
downloads
0
forks
30
days
1
days
1
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
3
total issues
3
open issues
0
closed issues
121
commits

Latest Version

2 days ago

Changelog

本轮聚焦三件事:修复图片附件、加入连接诊断、重写文档。

修复

  • 图片附件点选后无反应(重要):在选择器里点中一张图片后什么都不发生——没有 chip、也没有任何提示。 根因是 Obsidian 的模态框先关闭、后回调选中,插件把这次关闭误判为「用户取消」,选中结果被静默丢弃。 现已改为延后一个微任务再判定取消,两种时序都成立。
  • 该缺陷自 0.1.6 起存在 → 0.1.6 / 0.1.7 用户建议升级

新增

  • 设置 →「诊断连接」:走一次真实调用,判定「DSH 是否在运行 / 认证是否可用 / 版本是否兼容」, 把 401404、连接被拒这类原始错误码翻译成一句可执行的结论(并指向 README 的版本兼容矩阵)。
  • 状态栏:DSH 未运行时直接显示「DSH 未运行(连接被拒绝)」,而不是只显示「重连中…」。

兼容性

  • 支持 DSH 0.1.2 线0.1.5 线:0.1.5 的流式通道按字段探测,服务端拒绝则自动去参重试,两版共用同一调用点。
  • 0.1.2 之前的版本不被支持(返回 401/404)。详见 README 的 DSH 版本兼容性矩阵。

文档

  • README 首屏重写:说明本插件是原生客户端(不嵌网页、不套壳),突出词级 diff 内联编辑、审批弹窗、连接诊断等差异点; 功能列表按「对话 / 编辑笔记 / 上下文与掌控」重新分组。
  • 新增 4 张真机截图:思考过程与上下文用量、待办与目标、模型与推理档位、连接诊断。
  • 中文 README 补齐「直接文件系统访问」披露节(与英文版一致)。

验证

  • npm test556 个测试 / 38 个文件全绿tsc → 0 错误;eslint(与社区审核同源规则)→ 0 问题。
  • npm run build 连跑两次 → main.js 字节一致(构建可复现)。
  • 图片附件修复已在真实 Obsidian + 本机 DSH 0.1.5-rc.1 上人工复验通过(选中后出现 chip)。

English

This round focuses on three things: fixing image attachments, adding connection diagnosis, and rewriting the docs.

Fixed

  • Choosing an image did nothing (important): after picking an image in the picker, nothing happened — no chip, no notice. The root cause is that Obsidian closes the modal first and delivers the selection callback afterwards, so the plugin mistook that close for a user cancellation and silently dropped the selection. The cancellation check is now deferred by one microtask, which holds for both orderings.
  • The defect has existed since 0.1.60.1.6 / 0.1.7 users should upgrade.

New

  • Settings → Diagnose connection: runs one real call to determine whether DSH is running, whether authentication works, and whether the version is compatible — translating raw 401 / 404 / connection-refused errors into one actionable conclusion (pointing at the README compatibility matrix).
  • Status bar: when DSH is not running it now says "DSH not running (connection refused)" instead of just "reconnecting…".

Compatibility

  • Supports the DSH 0.1.2 line and the 0.1.5 line: the 0.1.5 streaming channel is probed field by field and retried without it if the server rejects it, so both lines share one call site.
  • Versions before 0.1.2 are not supported (they return 401/404). See the DSH compatibility matrix in the README.

Docs

  • README front page rewritten: it explains that this plugin is a native client (no embedded web UI, no wrapper) and leads with the differentiators — word-level diff inline editing, approval popups, connection diagnosis. Features are regrouped into Conversation / Editing your notes / Context & control.
  • Four new real-machine screenshots: thinking process & context usage, todos & goal, model & reasoning effort, connection diagnosis.
  • The Chinese README now carries the "Direct filesystem access" disclosure section, matching the English one.

Verification

  • npm test556 tests / 38 files green; tsc → 0 errors; eslint (same ruleset as the community review) → 0 problems.
  • npm run build twice in a row → byte-identical main.js (reproducible build).
  • The image-attachment fix was verified by hand in a real Obsidian against a local DSH 0.1.5-rc.1 (a chip now appears).

README file from

Github

DSH Bridge

Embed your locally running DeepSeek Harness (DSH) into Obsidian as an AI collaborator: your vault becomes its working directory, and DSH can read, write, and search your notes directly.

中文文档

Why this plugin

Most Obsidian ↔ agent bridges wrap a web UI or shell out to a CLI. This one is a native client: it speaks DSH's own RPC and event stream, then renders everything with Obsidian's own UI.

  • Native, not embedded — chat, tool cards, approvals and plan mode are real Obsidian UI: your theme, your fonts, your hotkeys.
  • Inline edit with a word-level diff — select text, give an instruction, review the diff, apply; Cmd+Z undoes it.
  • Approvals land where you are — DSH's write/exec confirmations and its questions appear inside the panel, no window switching, and they survive a reconnect.
  • Connection diagnosis401 / 404 / connection-refused are translated into an actionable conclusion (Settings → Diagnose connection).
  • Engineered to last — 550+ unit tests, strict TypeScript build, byte-reproducible artifacts, listed in the community directory.

The plugin is a client, not a runtime: it needs a local DSH to talk to (see Prerequisites). If something looks wrong, the diagnose button will tell you which of the two it is.

Prerequisites

  • A running DSH instance on your machine (default http://127.0.0.1:3080)
  • Your vault must be inside DSH's accessible directory scope (decided by DSH's sandbox / workspace config)
  • Obsidian ≥ 1.7.2, desktop only

Features

Conversation

  • Chat sidebar — streamed responses, tool-call cards, session switching and creation, "load older" pagination, and automatic re-sync after reconnects
  • Approval & question popups — retryable, grouped per session, replayed after a reconnect
  • Thinking process — collapsible reasoning block above each reply, streamed live and folded once the turn completes
  • Image attachments — attach images from your vault to a prompt; the agent reads them directly

Editing your notes

  • Inline edit — select text + hotkey → instruction → word-level diff preview → apply (editor selection is re-validated before applying; large selections degrade to a plain confirm dialog)
  • @mentions — type @ to pick vault files (@file:path, content injected) or folders (@folder:path, directory tree injected), with truncation and missing-file notices
  • Slash commands & plan mode — commands come from the running DSH (so the list always matches your install), plus the local /clear; Shift+Tab toggles plan mode with a status banner

Context & control

  • Model & reasoning effort — pick provider/model and reasoning effort from the panel; the list is grouped from your DSH model catalog
  • Context usage — a status line showing projected tokens against the context window, plus output tokens
  • Todo list — the agent's live todo list with pending / in-progress / completed states
  • Goal panel — view and control a long-running goal (create / pause / resume / complete / clear)

Long sessions stay bounded: when DSH compacts history, replaced messages collapse into the summary instead of piling up.

Screenshots

Chat sidebar @ Mention picker
Chat sidebar with streamed conversation @ mention file picker
Inline edit diff preview Approval popup
Inline edit word-level diff preview DSH tool approval popup
Thinking process & context usage Todos & goal
Collapsible reasoning block while streaming, with the context/usage status line Live todo list with three states and the goal bar
Model & reasoning effort Connection diagnosis
Model dropdown grouped by provider, next to the reasoning-effort selector Settings → Diagnose connection reporting a healthy connection

Installation (Community Plugins)

  1. Settings → Third-party plugins → Browse → search DSH Bridge → Install → Enable (desktop only)
  2. Make sure DSH is running locally (default http://127.0.0.1:3080)

Prefer a manual install? Grab the latest artifacts from the GitHub releases page and extract them into vault/.obsidian/plugins/dsh-bridge/.

Installation (local / dev)

  1. npm install && npm run build
  2. Copy main.js, manifest.json, and styles.css into vault/.obsidian/plugins/dsh-bridge/
  3. Settings → Community plugins → enable "DSH Bridge"

Privacy

All data flows through your local DSH to its configured model providers, using the same policy as the DSH Web GUI. The plugin sends no telemetry.

Translations / Localization

The plugin ships with all UI strings in a key-value table (built-in default: Chinese). To switch the UI to another language:

  1. In the plugin settings tab, click Export i18n template — this creates dsh-bridge.i18n.json at the root of your vault (visible in Obsidian's file explorer).
  2. Replace the values with your translations (or hand the file to your local DSH / any translator).
  3. Reload Obsidian (or disable/enable the plugin) to apply — repeatable.

The vault-root file takes priority; a legacy i18n.json inside the plugin directory (.obsidian/plugins/dsh-bridge/) is still read as a fallback. Missing keys or invalid JSON silently fall back to the built-in defaults. In v0.1.x, model-facing instructions (inline-edit prompt, @mention expansion) intentionally remain in Chinese; the UI-only string table is safe to translate.

Development

npm install
npm run dev    # watch build
npm test       # unit tests

Architecture

Transport: unary RPC over Node http (POST /api/<namespace>/<method> with {args} payload + self-signed browser-session cookie); live streams over a bundled ws WebSocket (/api/remote.muxsession/follow, session/control, $events). A core layer folds session events into view models; a UI layer renders the sidebar and modals.

DSH compatibility

DSH version line Plugin version Status
0.1.5 line (verified on 0.1.5-rc.1) 0.1.6+ (incl. 0.1.7) Verified end to end on a real vault (2026-09-13): streamed output, approvals, inline-edit diff, reconnect
0.1.2 line (0.1.2-rc.1, 0.1.2) 0.1.5+ Supported — the contract this plugin was built against. 0.1.6+ keeps it working through capability probing: the 0.1.5 streaming channel is requested field by field and dropped automatically if the server rejects it. Verified on a real machine at plugin 0.1.5, covered by unit tests since
before 0.1.2 (e.g. 0.1.0-rc.6) ≤ 0.1.4 Not supported — returns 401/404. Upgrade DSH, or stay on plugin 0.1.4
newer than the verified line latest plugin ⚠️ Unverified — DSH ships often and has already changed this plugin's contract twice (0.1.2 → 0.1.5). If the panel breaks after a DSH upgrade, check for a plugin update first

Direct filesystem access (disclosed for community review): DSH's browser-session authentication requires reading the signing secret from ~/.dsh/.credentials.yaml (the DSH process's credentials store, outside the vault). The plugin reads this file read-only — it never writes, never logs its contents, and only uses the secret to sign the per-request cookie required by DSH's browser-session API (0.1.2-rc.1 onwards). The vault API cannot reach this path (it is outside the vault root), so Node fs is required for this one purpose.

  • obsidian-project-management — the Obsidian-based project management skill that governs this plugin's development workflow (project records are tracked in a local Obsidian vault).