DSH Plugins Marketplace

DSH Plugins

Plugins

/

Development & Infrastructure

/

dsh-assistant-stream

d

dsh-assistant-stream

Manifest valid

Mirrors assistant streaming frames (deltas, blocks, commits, turn fences) to a configurable NDJSON sink for external consumers.

hasBundlePatch

dsh-assistant-stream

把 DeepSeek Harness 的流式输出导出成 NDJSON。

为网关、桌面端与调试工具提供可实时消费的 assistant 流。

Node.js 20.11+ DSH 0.2.x 7 tests passed MIT License

简体中文 · English

[!NOTE] 这是一个 DSH bundle。dsh plugin add 即可安装,插件行由随包的 cordis.patch.yml 注入,无需手写 profile 配置。

为什么做这个插件

DeepSeek Harness 的 assistant 输出是事件流:文本与推理增量、块结束、消息提交、轮次边界、工具调用围栏。宿主进程内可以直接订阅,但外部进程(网关、Web 前端、录制工具)拿不到稳定的消费格式。

这个插件把这条事件流翻译成一行一个 JSON 的 NDJSON,写到你指定的 sink。外部进程只需要按行读取,就能实时重建一次回答的完整过程,并保证提交顺序与围栏顺序一致。

flowchart LR
    A[DSH session] --> B[agent/assistant-stream 事件]
    B --> C[dsh-assistant-stream]
    C --> D[NDJSON sink]
    D --> E[网关预览]
    D --> F[Web 前端]
    D --> G[录制与回放]

核心能力

能力使用体验
统一帧格式每行一个 JSON 对象,固定前缀 ASSISTANT_STREAM_V1 ,便于逐行切分
完整时序start、delta、block、commit、end 覆盖一次尝试的完整生命周期
轮次边界turn-start / turn-end 由会话事件驱动,外部可以按轮次聚合
顺序围栏工具调用、工具结果与用量提交各有一个递增 fence,便于对齐
子代理隔离子会话(parentSession 或 origin: subagent)不会写入 sink
自定义输出默认写 stderr,也可以通过 write 交给内存、文件或 socket

帧类型

op含义
turn-start / turn-end轮次开始与结束,仅导出根会话
start一次模型尝试开始,seq 归零
deltatext 或 reasoning 的增量文本
block一个文本或推理块结束
commit本次尝试提交的 assistant 消息
event-fence工具调用、工具结果、用量提交的顺序标记
end本次尝试结束,携带 outcome

安装

从 npm 安装:

dsh plugin --profile <name> add dsh-assistant-stream

从本地目录或 GitHub 安装:

dsh plugin --profile <name> add /path/to/dsh-assistant-stream
dsh plugin --profile <name> add github:ninetyhe-90/dsh-assistant-stream

配置

字段类型默认说明
readTurnId() => string | undefined读取 DSH_TURN_ID返回当前轮次的请求 id
write(line: string) => void写 stderr接收每一行 NDJSON

readTurnId 缺失或返回空时,requestId 回落到 session.id,不会中断会话。

- insert:
    - id: assistant-stream
      name: dsh-assistant-stream

兼容性

  • Node.js 20.11+
  • DeepSeek Harness 0.2.x:依赖 agent/assistant-stream 与 session/event 事件
  • 旧版本缺少 session.requestContext 时,插件会跳过用量围栏,其余帧不受影响

项目结构

src/assistant-stream.mjs    插件入口与帧导出逻辑
test/assistant-stream.test.mjs  行为测试(node:test)
cordis.patch.yml            bundle 安装时注入的插件行

开发与验证

npm test
npm run check

路线图

  • 文本与推理增量导出
  • 轮次边界与工具围栏
  • 子代理隔离
  • bundle 安装形式
  • npm 发布
  • 浏览器端消费示例

许可证

MIT

Comments

Loading…

Similar plugins

dsh-turn-fold

Folds streaming reasoning and tool calls into collapsed step bars and collapses each finished turn into a single summary bar; step bars show native tool icons, filenames, edited line counts, and failu

UI & ExperienceModels & ProvidersManifest valid

★ 0

dsh plugin --profile web add dsh-turn-fold

by Anyway-one

Multi-provider balance monitor with low-balance alerts and trend history for the dsh web GUI

Terminal & ClientsManifest valid

★ 0

JavaScript

Aug 26, 2026

dsh plugin --profile web add dsh-balance

by SpookySandwich

DSH 流式渲染插件:按段落分批呈现、8 种入场动画、平滑滚动、设置面板。DeepSeek Harness: paragraph-batched streaming reveals, 8 designed animations, smooth scroll-follow and a settings panel.

UI & ExperienceManifest valid

★ 12

↓ 247/wk

MIT

JavaScript

Sep 29, 2026

dsh plugin --profile web add dsh-plugin-smooth-stream

by SunNull

Cloud relay for DeepSeek Harness: expose your home dsh instance to any device with full real-time sync (out-of-tree plugin + wire-trunk architecture)

Manifest valid

★ 0

MIT

JavaScript

Aug 24, 2026

dsh plugin --profile web add dsh-relay-host

by timho1047

Smooth, focused streaming for DSH: a zero-config plugin that keeps running thinking and tools in view across all four Work details modes.

Manifest valid

★ 4

↓ 386/wk

MIT

TypeScript

Oct 19, 2026

dsh plugin --profile web add dsh-stream-focus

by lizhouai

Live balance & usage for every LLM provider, one glance away — a draggable floating ball for DeepSeek Harness / dsh 插件:可拖动悬浮用量球,一眼看清所有 Provider 余额与用量

Manifest valid

★ 4

↓ 145/wk

MIT

TypeScript

Oct 21, 2026

dsh plugin --profile web add dsh-provider-usage