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-persona-reflect

v0.1.0

Published

Persona reflection for DSH: distill real chat memory into a role card's growth section, so a long-lived character's personality grows from experience instead of a fixed prompt.

Readme

dsh-persona-reflect

给 DeepSeek Harness 的人格复盘插件:把一个长期角色(QQ 机器人、陪伴 agent、主播人格等)的真实聊天记忆, 蒸馏成角色卡里的一小段成长记录,让性格从经历里长出来,而不是靠固定提示词。

Persona reflection for DSH: distill real chat memory into the persona-growth section of a role card, with backups and rollback. Ships a skill + 4 tools + an optional qq-bridge auto-reflection patch.

解决的问题

长期角色很容易变成「每天重复同一套口头禅的模板」:人设是写死的,经历没有沉淀。 本插件的做法是:

真实聊天/记忆 → 定期复盘 → 模型改写角色卡的「成长段」 → 下一轮对话自动注入
  • 只改角色卡里 <!-- persona-growth:begin/end --> 之间的内容,人设与说话规则逐字不动;
  • 每次写入前备份到 roles/.history/,保留最近 10 份,可一键回滚;
  • 素材没变化时可以跳过(时间/内容哈希由 qq-bridge 定时脚本负责)。

工具

| 工具 | 作用 | | --- | --- | | persona_reflect_status | qq-bridge 路径、角色卡、当前成长段、上次复盘、备份数、记忆信号统计 | | persona_reflect_signals | 读出最近聊天、话题、对群友的印象、想说未说的话(≤6000 字) | | persona_reflect_apply | 把写好的成长段写入角色卡(80–900 字,自动备份,支持 dry_run) | | persona_reflect_rollback | 回滚到最近/指定备份 |

另外注册一个 skill persona-reflect,教 agent 完整流程(读状态 → 读信号 → 写 → 预览 → 落卡 → 校验)。

安装

从插件市场

插件 → 发现 → 搜索 dsh-persona-reflect → 安装 → 重启 DSH。

本地安装(开发)

cp -R dsh-persona-reflect ~/.dsh/plugins/dsh-persona-reflect
# ~/.dsh/profiles/desktop/package.json:
#   dependencies 加 "dsh-persona-reflect": "link:/Users/<you>/.dsh/plugins/dsh-persona-reflect"
#   dsh.profile.bundles 加 "dsh-persona-reflect"
cd ~/.dsh/profiles/desktop && pnpm install
# 重启 DSH

配置

按优先级:工具参数 > $DSH_HOME/persona-reflect/config.json > 环境变量 > 自动探测。

// ~/.dsh/persona-reflect/config.json
{ "qqBridgeDir": "/Users/you/qq-bridge", "role": "小肥鱼" }

环境变量:DSH_PERSONA_QQ_BRIDGE(qq-bridge 目录)、DSH_PERSONA_ROLE(角色名,默认 小肥鱼)。 自动探测会依次看 ~/Documents/deepseek-harness/default-workspace/qq-bridge、~/qq-bridge、当前目录下的 qq-bridge。

配合 qq-bridge 自动复盘(可选)

bridge-patch/ 里带一个安装器,给 qq-bridge 加上每天定时自动复盘(脚本 + LaunchAgent):

node bridge-patch/apply.mjs /path/to/qq-bridge            # 默认每天 10:30
node bridge-patch/apply.mjs /path/to/qq-bridge --time=03:30
node bridge-patch/apply.mjs /path/to/qq-bridge --no-schedule   # 只装脚本,不定时
node bridge-patch/apply.mjs /path/to/qq-bridge --uninstall     # 卸载定时任务

它会:复制 persona-reflect.mjs 到 qq-bridge/scripts/、写 ~/Library/LaunchAgents/com.local.qq-persona-reflect.plist、launchctl bootstrap 加载。 手动验证:cd /path/to/qq-bridge && node scripts/persona-reflect.mjs --dry-run。

安全与边界

  • 只允许改 persona-growth 标记之间的内容,其他内容逐字保留;
  • 写入前自动备份,保留最近 10 份;
  • 成长段长度限制 80–900 字,避免把整篇设定塞进角色卡;
  • 复盘素材来自 qq-bridge 本地记忆(state/social-v2.json),不上传任何地方。

已知限制

  • 角色卡必须是 Markdown,且包含 <!-- persona-growth:begin --> / <!-- persona-growth:end --> 标记;
  • persona_reflect_signals 读取的是 qq-bridge 的记忆结构;其他客户端需要提供同等结构的 state/social-v2.json;
  • 自动复盘脚本依赖 qq-bridge 的 src/dsh-client.js 与本地 DSH 在线(与桥接同一条离线鉴权链路)。

License

MIT