SilenZerOrz/obsidian-dsh-acp ↗★ 3
obsidian-dsh-acp
Expose DeepSeek Harness (DSH) over the Agent Client Protocol (ACP) for Obsidian Agent Client (and other ACP clients). Install as a Custom Agent in Obsidian, or as a cordis plugin in a DSH profile, to drive DSH right from Obsidian — list/resume/fork sessions, run the harness, and archive conversations. 适合Obsidian用户,可在笔记软件中直接管理会话、运行和归档对话。
インストール
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:SilenZerOrz/obsidian-dsh-acpドキュメント
README 全文を読む ↗Standalone usage
With the package installed (or directly from a checkout):
node dsh-acp.mjs # serve ACP v1 on stdin/stdout
node dsh-acp.mjs doctor # health-check + one-click repair hints (v0.1.x experimental)
Health check / repair (doctor, experimental)
When DSH or Obsidian reports a connection problem ("ACP connection closed",
"dsh exited 1", MISSING_CREDENTIAL …), the adapter auto-injects a diagnostic
block with copy-pasteable repair commands into the ACP reply. You can also run
a standalone health check:
node dsh-acp.mjs doctor # diagnose + print one-click fix commands
node dsh-acp.mjs doctor --auto # attempt auto-fix (each step asks for confirmation first)
doctor is version-agnostic — it works with both 0.1.1-rc.2 and
0.1.2-alpha of dsh, and only does generic checks (dsh binary, dsh version,
missing API-key credentials, npm update hint). It never depends on any
dsh-version-specific internal API.
Session garbage collection (gc, automatic)
Problem: Obsidian Agent Client's delete button only removes its own local
sessions/.json, and never sends the ACP session/delete — so
obsidian-dsh-acp's own durable index + archives go stale and the session
"comes back" on the next session/list.
Fix (automatic): on every session/list, the adapter reconciles its durable
session index against the Obsidian local agent-client/sessions directories and
removes sessions Obsidian no longer tracks (their disk archives included). This
is conservative — sessions still present in Obsidian are never removed.
Detection / opt-in:
node dsh-acp.mjs doctor # shows which Obsidian sessions dirs were detected & orphan count
node dsh-acp.mjs doctor --gc # immediately run garbage collection now
Config env vars:
| var | default | meaning |
|---|---|---|
DSH_ACP_GC | on | off disables auto GC |
DSH_ACP_GC_OBSIDIAN_DIRS | (auto-detect) | comma-separated extra agent-client/sessions dirs to reconcile |
DSH_ACP_GC_NEED_ARCHIVE | 0 | when 1, only remove orphans that still have a disk archive |
DSH_ACP_GC_REPORT_ONLY | 0 | 1 = dry-run (report only, never delete) |
DSH_ACP_GC_VERBOSE | 0 | 1 = log GC actions to stderr |
Configuration (Obsidian Agent Client)
There are two ways to configure the custom agent: one-click (run
install.sh --obsidian-vault , see above) or manually as follows.
Manual steps in Obsidian:
- Install the Agent Client community plugin (Settings → Community plugins → Browse → search "Agent Client") and enable it.
- Open the plugin's settings → Custom Agents → Add.
- Fill in:
- ID:
dsh-acp - Display name:
DeepSeek Harness (ACP) - Command: the absolute path to this package's
dsh-acp.mjs - Args: (empty)
- Env (optional): e.g.
DSH_ACP_LOG_DIR→/absolute/path/to/logs
- ID:
- Set the plugin's nodePath to a real
nodebinary (>= 22.13) so the script's shebang resolves. - Reload Obsidian (Cmd-R) and pick DeepSeek Harness (ACP) in the agent picker.
If you configure it by editing data.json directly:
{
"id": "dsh-acp",
"displayName": "DeepSeek Harness (ACP)",
"command": "/absolute/path/to/dsh-acp/dsh-acp.mjs",
"args": [],
"env": [{ "name": "DSH_ACP_LOG_DIR", "value": "/absolute/path/to/dsh-acp/logs" }]
}
First-time setup
Before the first prompt, select a tool-capable model that's already configured
with a valid API key in your agent picker (Session panel), e.g. gemini-2.5-pro.
Why: tool call frames only appear when the chosen model supports tool/function
calling. If no model is selected, the spawn path falls back to the headless
profile default (deepseek-official/deepseek-v4-flash). If that default doesn't
support tools, or you haven't configured a DeepSeek official API key, you'll see
AUTH: Authentication Fails or a silent no-tool-call response on the first prompt.
Fix: either (a) pick a tool-capable, configured model in the session panel
before prompting, or (b) set deepseek-official credentials in
~/.dsh/profiles/headless/settings.yaml and ensure the default model
supports tool calling.
Known limitations
This 0.3.0 release uses Path A (spawn path with --json) to reproduce
tool-call frames — it does not route through the dsh official bridge. As a
result:
- No permission prompts: bash / file-write / etc. tools run without
confirmation dialogs. The v0.2.x behavior continues — only the tool-call
visualization changes. If you need permission prompts, use
DSH_ACP_PERMISSION_MODE(effective only on the dsh long-runtime path) or wait for official-bridge support (requires dsh upstream fixes). - Official bridge unavailable on dsh web profile: even with
DSH_ACP_USE_OFFICIAL_BRIDGE=1, the dsh web profile does not currently expose the 4 core services (llm/sessionPersistence/agents/sessions) the official bridge requires. Path A does not depend on this — it works on the standalonedsh-acp.mjsbinary regardless.
Configuration (Obsidian Agent Client)
There are two ways to configure the custom agent: one-click (run
install.sh --obsidian-vault , see above) or manually as follows.
Manual steps in Obsidian:
- Install the Agent Client community plugin (Settings → Community plugins → Browse → search "Agent Client") and enable it.
- Open the plugin's settings → Custom Agents → Add.
- Fill in:
- ID:
dsh-acp - Display name:
DeepSeek Harness (ACP) - Command: the absolute path to this package's
dsh-acp.mjs - Args: (empty)
- Env (optional): e.g.
DSH_ACP_LOG_DIR→/absolute/path/to/logs
- ID:
- Set the plugin's nodePath to a real
nodebinary (>= 22.13) so the script's shebang resolves. - Reload Obsidian (Cmd-R) and pick DeepSeek Harness (ACP) in the agent picker.
If you configure it by editing data.json directly:
{
"id": "dsh-acp",
"displayName": "DeepSeek Harness (ACP)",
"command": "/absolute/path/to/dsh-acp/dsh-acp.mjs",
"args": [],
"env": [{ "name": "DSH_ACP_LOG_DIR", "value": "/absolute/path/to/dsh-acp/logs" }]
}
cordis plugin usage
Install into a DSH profile via the official plugin mechanism (this makes the
plugin installable with dsh plugin add thanks to the dsh.bundle manifest in
package.json):