Mirrors assistant streaming frames (deltas, blocks, commits, turn fences) to a configurable NDJSON sink for external consumers.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:ninetyhe-90/dsh-assistant-stream
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
[!NOTE] This is a DSH bundle.
dsh plugin addinstalls it, andcordis.patch.ymlinserts the plugin row automatically.
Why this plugin
DeepSeek Harness emits assistant output as an event stream: text and reasoning deltas, block ends, message commits, turn boundaries, and tool fences. The host can subscribe directly, but external processes cannot consume it in a stable format.
This plugin turns the stream into one JSON object per line. A consumer reads lines, rebuilds the whole answer in order, and keeps commits and fences aligned.
flowchart LR
A[DSH session] --> B[agent/assistant-stream events]
B --> C[dsh-assistant-stream]
C --> D[NDJSON sink]
D --> E[Gateway preview]
D --> F[Web client]
D --> G[Recording and replay]
Capabilities
| Capability | Behaviour |
|---|---|
| One frame format | One JSON object per line, prefixed with ASSISTANT_STREAM_V1 |
| Full lifecycle | start, delta, block, commit, and end cover one attempt |
| Turn boundaries | turn-start and turn-end let consumers group by turn |
| Ordering fences | Tool calls, tool results, and usage commits each carry an increasing fence |
| Subagent isolation | Subagent sessions are never exported |
| Custom sink | stderr by default; pass write to capture elsewhere |
Frame types
op |
Meaning |
|---|---|
turn-start / turn-end |
Turn boundaries for the root session |
start |
A model attempt began; seq restarts at 0 |
delta |
Incremental text or reasoning |
block |
A completed text or reasoning block |
commit |
The committed assistant message for this attempt |
event-fence |
Ordering marker for tool calls, results, and usage |
end |
The attempt finished, with its outcome |
Install
dsh plugin --profile <name> add dsh-assistant-stream
dsh plugin --profile <name> add /path/to/dsh-assistant-stream
dsh plugin --profile <name> add github:ninetyhe-90/dsh-assistant-stream
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
readTurnId |
() => string | undefined |
DSH_TURN_ID |
Request id for the current turn |
write |
(line: string) => void |
stderr | Receives each NDJSON line |
When readTurnId is missing or returns empty, requestId falls back to session.id.
Compatibility
- Node.js 20.11+
- DeepSeek Harness 0.2.x (
agent/assistant-stream,session/event) - Builds without
session.requestContextskip the usage fence; other frames are unaffected
Layout
src/assistant-stream.mjs plugin entry and frame export
test/assistant-stream.test.mjs behaviour tests (node:test)
cordis.patch.yml bundle layer
Development
npm test
npm run check
Roadmap
- Text and reasoning deltas
- Turn boundaries and tool fences
- Subagent isolation
- Bundle packaging
- npm release
- Browser consumer example
License
MIT
Links
More in this category
yjh051108/dsh-routing-suite★ 6991
One repository, three parts: a runtime injector for DSH plugin packages (inject, hot-reload, unload, promote a dev staging tool to the front, route self-heal, plus a settings-page plugin manager that lists, unloads and drags folders in to internalize), a task-aware reasoning-mode router agent preset (router-standard / router-spec / router-react), and a graded two-level task protocol whose six tools (commit_star, lock_stage, revise_do, edit_plan, mark_task, redteam_verdict) pin task state to disk. The injector implementation ships in-tree, so the install carries its own behaviour rather than a dependency list.
strukto-ai/mirage#dsh★ 3715
Swaps the filesystem and bash providers for a mirage virtual workspace: file tools and shell commands run over mounted resources (RAM, S3, Redis, Slack, Gmail, Notion, Postgres) instead of the host disk, with per-mount read/write/exec modes, per-command sandbox routing (monty, pyodide, quickjs in process; docker, e2b, daytona remote), and installed CLIs (git, gh, slack, linear, ntn, gws, or one you register) as head words in the virtual terminal.
first-fluke/oh-my-agent#dsh★ 1352
Runs project OMA checks before and after tool execution and when a turn tries to finish. Installs its OMA CLI dependency and initializes unconfigured projects on first use. Requires Node.js 22+; initial setup needs network access and project write access.
hust-open-atom-club/oh-dsh★ 323
Community distribution: TUI, desktop, and Web UI as one bundle with layered installation.
MichengAI/dsh-skills-manager★ 294
Manages local DeepSeek Harness skills in Settings and shows shared Agent skills as read-only.
Fishquito7/dsh-skill-mcp-panel★ 223
Manages DSH skills and MCP servers from the web settings: skill cards with hot enable/disable, workspace scopes, groups, batch migration and drag-and-drop import, plus stdio/HTTP MCP CRUD with connection tests, secret redaction and the unified dsh-panel CLI.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.