Sessions & Messages

dsh-injection-list

abluefan/dsh-injection-list · ★ 0

abluefan

会话界面显示本轮上下文注入清单,补 0.2.1 UI 把 context 行折叠掉的缺口

README body is shown in Chinese.

License
MIT
Added
2026-10-30
Maintenance
active
Install kind
github
Manifest details
Manifest status
Declared
Manifest path
package.json#dsh
Manifest checked
2026-10-30T09:38:16.040Z
Lifecycle scripts
None found

Static manifest checks report declarations only; they are not compatibility or security review.

安装

dsh plugin --profile web add 'github:abluefan/dsh-injection-list#5a8a3e794ed8cc4829a811e3e5f82cea2cc6da41'

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

For install and environment setup, plus plugin development tutorials, see DSH community docs ↗

README

Source README · body: zh · Read Chinese README

Table of contents
  1. 原理
  2. 四种显示(各自独立开关)
  3. 安装
  4. ① 通过插件市场(推荐)
  5. ② 手动安装
  6. 日志
  7. 环境

在会话界面显示「本轮上下文注入了什么」(live-docs / time-context / agent-instructions …),补 0.2.1 UI 把 context 行折叠掉的缺口。

原理

0.2.1 的 UI 不渲染 context 行,client 侧也拿不到会话事件。所以:

Host 半边挂在 agent/pre-step 链尾(next() 之后),检查 decision.messages 里 source.kind 不是 user 的消息,按 session 记下来,再通过 HTTP 提供给 client 半边。

只读、只记录,不改任何会话数据。

每个会话最多保留 200 条记录。

四种显示(各自独立开关)

开关 默认 作用
hostRecord true 记录注入 + 暴露 /injection-list/api/*(关掉则下面三件都没数据)
headerButton true 会话页头的「注入 N」按钮
turnTailList true 每回合尾部的注入行
chatNodes true 消息流里的上下文节点(复用官方 context 渲染器)

安装

① 通过插件市场(推荐)

在 的目录里找到本插件, 或在 dsh 的 插件 → 发现 里搜索 dsh-injection-list,点安装。

② 手动安装

任选一种,不要两种同时用:

A. 复制 + 手写 insert(适合本地开发)

  1. 把本目录复制到 $DSH_HOME/profiles/web/node_modules/dsh-injection-list/

  2. 在 $DSH_HOME/profiles/web/cordis.patch.yml 加:

    - insert:
        - id: injection-list
          name: 'dsh-injection-list'
    
  3. 重启 dsh,或让 Loader 重载配置

B. dsh plugin add(需要包已发布到 npm)

dsh plugin --profile web add dsh-injection-list

⚠ 用 B 之后,包名会进 dsh.profile.bundles,bundles 层会读本包自带的 cordis.patch.yml;此时不要再做 A 的第 2 步 —— 同一个 id 会被插两次, DSH 启动会直接失败。

日志

DEBUG 常量(index.js 顶部)默认 false —— 只打启动就绪与错误。 改成 true 会额外打印 client 清单诊断。

环境

  • DSH ≥ 0.2.1