SilenZerOrz/obsidian-dsh-acp0

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-dsh-acp
版本
0.1.5
许可证
MIT
最近更新
2026年9月1日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:SilenZerOrz/obsidian-dsh-acp

Standalone usage

With the package installed (or directly from a checkout):

node dsh-acp.mjs            # serve ACP v1 on stdin/stdout
node scripts/test-client.js "reply with just the word HELLO"
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:

vardefaultmeaning
DSH_ACP_GConoff disables auto GC
DSH_ACP_GC_OBSIDIAN_DIRS(auto-detect)comma-separated extra agent-client/sessions dirs to reconcile
DSH_ACP_GC_NEED_ARCHIVE0when 1, only remove orphans that still have a disk archive
DSH_ACP_GC_REPORT_ONLY01 = dry-run (report only, never delete)
DSH_ACP_GC_VERBOSE01 = 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:

  1. Install the Agent Client community plugin (Settings → Community plugins → Browse → search "Agent Client") and enable it.
  2. Open the plugin's settings → Custom AgentsAdd.
  3. 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
  4. Set the plugin's nodePath to a real node binary (>= 22.13) so the script's shebang resolves.
  5. 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" }]
}

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:

  1. Install the Agent Client community plugin (Settings → Community plugins → Browse → search "Agent Client") and enable it.
  2. Open the plugin's settings → Custom AgentsAdd.
  3. 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
  4. Set the plugin's nodePath to a real node binary (>= 22.13) so the script's shebang resolves.
  5. 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):