Skip to content

feat(dsh): add DeepSeek Harness adapter - #80

Open
zhiganovsasha wants to merge 1 commit into
f:masterfrom
zhiganovsasha:feat/dsh-support
Open

zhiganovsasha wants to merge 1 commit into
f:masterfrom
zhiganovsasha:feat/dsh-support

Conversation

@zhiganovsasha

Copy link
Copy Markdown

What

Adds an adapter for the DeepSeek Harness (DSH) desktop app, a local-first coding agent that was not covered by any existing editor adapter.

DSH stores sessions under ~/.dsh:

  • ~/.dsh/sessions/<munged-cwd>/session-<uuid>/session.v4.jsonl.zstd — full zstd-compressed JSONL event log
  • ~/.dsh/storages/session_projcache/sessions/session-<uuid>.json — metadata projection (title, working directory, model, token totals)

How

  • Lists sessions from the event logs plus the metadata projection, including sessions whose log was pruned (metadata-only, using turn count from sessionStats)
  • Decompresses the event log with the pure-JS fzstd decoder (zero native bindings, ~10 KB) and builds messages from user/message and assistant/message events (text, reasoning, tool-call with argument keys), appending tool/result previews inline by call id
  • Tracks the active model from request/header and model/selection events and attaches it to assistant messages
  • Attaches session-level token usage totals (uncached input, output, cache read/write) to the last assistant message, since the event log has no per-message usage

Testing

Verified on DSH desktop 0.2.1-rc.5 (macOS): 17 sessions with full message, model and token history appear in the dashboard.

Notes

  • Adds one new dependency: fzstd ^0.1.1 (pure JS, no native build step — unlike better-sqlite3 there is nothing to compile)
  • Only reads session logs and the metadata projection; credentials stored by DSH are never touched

DeepSeek Harness (DSH) desktop app stores sessions under ~/.dsh:

- ~/.dsh/sessions/<munged-cwd>/session-<uuid>/session.v4.jsonl.zstd —
  full zstd-compressed JSONL event log
- ~/.dsh/storages/session_projcache/sessions/session-<uuid>.json —
  metadata projection (title, working directory, model, token totals)

The adapter:

- lists sessions from the event logs plus the metadata projection,
  including sessions whose log was pruned (metadata-only)
- decompresses the event log with the pure-JS fzstd decoder (no
  native bindings) and builds messages from user/message and
  assistant/message events (text, reasoning, tool-call with argument
  keys), appending tool/result previews inline by call id
- tracks the active model from request/header and model/selection
  events and attaches it to assistant messages
- attaches session-level token usage totals (uncached input, output,
  cache read/write) to the last assistant message since the event log
  has no per-message usage

Verified on DSH desktop 0.2.1-rc.5 (macOS): 17 sessions with full
message, model and token history appear in the dashboard.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant