npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-per-message-model

v0.1.9

Published

在 DSH 主对话每条 assistant 回复旁展示该条回复实际使用的 provider / model 徽章(可选附带 reasoning effort)

Readme

dsh-per-message-model

在 DSH Web GUI 主对话中,每条 assistant 回复旁显示该条回复实际使用的模型徽章,并在会话中发生模型切换时渲染嵌入消息流的切换分割线。

纯展示插件:不改写、不拦截任何模型请求;不做 token 计价、余额或厂商 logo。

效果

  • 消息级芯片图标:每条已完成的 assistant 消息动作行(copy / branch 按钮之后、时间之前)显示一个小芯片图标;鼠标悬停(title)显示该条消息实际使用的完整 provider / model · 思考 effort。
  • 会话 Header:会话动作区显示最近一条 assistant 消息的模型徽章。
  • 模型切换分割线:当相邻 assistant 消息的 provider/model 发生变化时,在真正切换的位置(切换源消息之后、下一条消息之前,即消息中途切换点,而非整条消息末尾)渲染一条横贯消息流的粗分割线:模型切换:[旧模型] → [新模型]。文案固定中文,"模型切换:"为灰色、箭头为自渲染 SVG 图片(灰色粗箭头)、两个模型名为更深更粗的黑色。分割线像模型输出一样嵌入消息流,随滚动出现/消失,不固定于视口。
  • 投影缺失时图标退化为「模型未知」(fail-soft,便于确认插件已接管)。

数据来源(服务端投影)

lib/route-metadata.js 注册只读 projection key perMessageModel,折叠会话事件:

| 事件 | 字段 | 用途 | |---|---|---| | assistant/message | data.message.id / data.message.source.{provider,model} | 消息级 provider/model(内核强制携带,消息级最准确) | | request/header | data.header.config.reasoningEffort / data.header.adapterDefaults.reasoningEffort | 请求级 effort,滚动关联到该请求产出的全部消息 |

输出 view = { messages: { [messageId]: {...} }, current: {...}, switches: [{ fromSeq, from, toSeq, to }] }。 switches 记录相邻消息的模型切换边界(fromSeq = 旧模型消息 seq,toSeq = 新模型消息 seq)。 客户端通过官方 useProjection 读取,不接触会话快照。

挂载点(客户端,纯 additive)

| 槽位 | 用途 | |---|---| | conversation.session.header.actions | 会话 Header 当前模型徽章 | | conversation.chat.assistant-actions | 每条 assistant 消息底部动作行芯片图标(CSS flex order 排到 branch 之后、时间之前) | | conversation.chat.turnTail | 模型切换分割线(chain 槽位,fromSeq 匹配旧模型消息尾部) |

三者均为官方扩展点:不 shadow、不替换任何官方组件。

开发

npm run check   # node --check 三个 lib 文件
npm test        # node --test(projection 单测 + manifest + client 静态断言)

安装

npm pack
dsh plugin --profile web add ./dsh-per-message-model-<version>.tgz
# 重启 DSH 后生效

注意:升级版本后若 node_modules 中包文件未刷新(pnpm file: 依赖版本不变不重拷),需先 dsh plugin remove dsh-per-message-model 再 add,或手动同步 node_modules/dsh-per-message-model/lib/*.js。

非目标

  • 不拦截/改写模型请求(纯展示)。
  • 不做 token 计价、余额、厂商 logo(dsh-token-usage / dsh-model-vendor-badge 的职责)。
  • 不动子代理会话(子代理已有 dsh-subagent-route-badges)。

License

MIT