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-cipher

v0.1.3

Published

把 cipher 的持续思考/三中台/四类记忆以 UNNI/LOOP 会话模式接入 DSH

Readme

dsh-cipher

cipher 的核心设计——持续思考、三中台 (执行/洞察/记忆)、四类本地记忆(注意力/经验/偏好/认知)、UNNI/LOOP 会话模式—— 以 DSH 组合包形态原生落地(纯 TS bundle,无 Rust 进程、无需 cipher 二进制)。

在 DSH 中配置好模型后:UNNI 与 LOOP 会出现在 DSH 原生 agent preset 选择器里 (与标准模式 / PTC / 极简并列)。用这两个 preset 开的会话获得完整 cipher 管线: 每轮自动沉淀四类记忆、跨会话召回注入,LOOP 会话在每轮沉淀后自主续轮。

特性

  • UNNI / LOOP 即原生 agent preset:插件激活时把两个 preset(复制部署的 standard 组合 + 追加 cipher 行)物化进用户 preset 根——原生选择器立即显示,无需重启
  • 四类记忆(注意力/经验/偏好/认知)每轮沉淀:4 个记忆 agent 并行(各 1 次 LLM 调用、错误隔离)
  • 跨会话召回(确定性检索:类型配额 + 14 天时间衰减 + 词项/关键词命中)经 systemPrompt.context 注入——快照变化才重录(缓存友好)
  • 洞察复核(每轮三问自检)输出只进沉淀,绝不裸抛给用户
  • 会话级模式覆盖:会话头部 Cipher·UNNI / Cipher·LOOP 切换(仅 cipher preset 会话显示); LOOP 自动续轮走 Agent.followup(间隔+轮数护栏,不依赖 DSH goal API)
  • 两个模型工具:cipher_memory_search / cipher_memory_ingest
  • 设置页(SOUL 编辑器、配额、LOOP 护栏、回退默认值)+ 侧边栏 AgentPool 面板(实时 subagent 状态)
  • SOUL 可编辑,作为会话级静态 section 注入(提供方缓存友好)

安装

dsh plugin --profile <name> add dsh-cipher

安装后你会得到:

  • 原生 agent preset 选择器(会话座位 / 设置 → 通用)里的 UNNI · 交互协同 / LOOP · 记忆驱动。 两个 preset 物化在用户 preset 根(~/.dsh/.agent-presets/):复制部署的 standard 组合并追加 cipher 行;插件升级自动重同步、卸载自动清理;用户自建的同名 preset 绝不覆盖。
  • Cipher 设置区(设置 → Cipher):SOUL 编辑器、LOOP 间隔/轮数上限、类型配额、沉淀/洞察开关
  • 右侧可折叠「Cipher 池」(AgentPool)面板(subagent 模式/活动态/标签,5 秒刷新)—— 展开为右侧全高面板、折叠为右缘细条(细条即入口),设计语言对齐原生「会话/工作区」面板
  • 会话头部 Cipher·UNNI / Cipher·LOOP 切换按钮(仅 cipher preset 会话显示)
  • 两个工具:cipher_memory_search / cipher_memory_ingest(仅 cipher preset 会话可用)

快速开始

  1. 在「设置 → 模型」配置好模型(插件复用 DSH 默认模型路由)。
  2. 开新会话时在 preset 选择器里选 UNNILOOP,发一条消息——轮次结束后记忆自动沉淀。
  3. 下一轮问"你记得我什么?"——召回的记忆已注入。
  4. LOOP 会话每轮沉淀后自主续轮(间隔+轮数护栏);也可用头部按钮在会话内切换模式。

要求

  • Node.js >= 22.19
  • DSH 需要 agent-presets roster 与可写的用户 preset 根(均为默认配置):preset 通过 agentPresets.copy('standard', ...) 生成——部署的 standard(或默认 preset)是组合源。 缺失时插件其余部分(设置/池面板)仍可用,但无法物化 UNNI/LOOP preset、cipher 行不会激活。
  • 需在 DSH 配置模型;UNNI/LOOP 会话中每轮每个记忆 agent + 洞察各一次 LLM 调用(成本是设计内事实)
  • storageDomain 可选:组合挂载存储时记忆持久化到部署 storages 目录(cipher_memory 域); 未挂载时降级为进程内记忆(告警一次,重启不保留)

工作原理

行按平面划分(v0.1.2 "Design A"——cipher 能力只存在于 UNNI/LOOP preset 内):

| 平面 | 行 | 职责 | | --- | --- | --- | | host(bundle patch) | dsh-cipher/core | 私有服务 ctx.cipher:四类记忆库、确定性检索、配额、会话模式、settings namespace | | host | dsh-cipher | 双面行:host REST 路由(config/settings/mode/subagents)+ client 设置页/池面板/头部切换 | | host | dsh-cipher/presets | 物化 UNNI/LOOP preset(copy standard → 追加 cipher 行 → 元数据;幂等、带版本标记、自愈) | | preset(UNNI/LOOP) | dsh-cipher/memory | 沉淀:session/event turn/end → 证据 → 4 记忆 agent → 写库(去重+会话水位) | | preset | dsh-cipher/insight | 三问自检证据复核 → 以 [INSIGHT] 经验沉淀 | | preset | dsh-cipher/prompt | 注入:SOUL+模式 section(order 60 静态快照)+ 四类记忆 context(快照变化才重录) | | preset | dsh-cipher/mode | 模式钉死(行 config presetMode,会话创建时落为默认)+ LOOP 沉淀后续轮调度 | | preset | dsh-cipher/tools | cipher_memory_search / cipher_memory_ingest |

preset 行与其他 DSH preset 行一样:每个 preset 挂载一次(standing mount),会话按 scope 加入。 标准/PTC/极简组合的会话完全没有任何 cipher 行。

存储说明:记忆域在运行时可选——存储故障(如 headless 一次性进程退出窗口)时会降级为进程内 存储(不失败该轮),而非中断对话。

模式语义(v0.1.2)

  • UNNI(交互协同):用户与 agent 高度协同;执行/洞察结果成为沉淀依据,回复始终来自 agent 自身(信息隔离——中台输出不裸抛)。
  • LOOP(记忆驱动):每轮沉淀完成后,会话以最新注意力/经验记忆为方向自动续轮(护栏:最小间隔
    • 单会话轮数上限);收敛或用户中止则安静收尾。
  • preset 钉死会话默认模式(行 config presetMode);头部切换按会话覆盖(写 modes 表), 设置默认值是最末回退。

数据与隐私

  • 记忆存于部署 storages 目录(cipher_memory 域;无存储组合时内存级)。
  • 全部本地;沉淀/洞察/续轮的模型调用走 DSH 默认模型路由。

Model Experience(KV Cache 影响)

按 DSH 包约定披露:

  • SOUL+模式 section(order 60):稳定重复前缀——会话内文本不变,提供方 prompt 缓存可复用; 修改 SOUL 会在下一次组装替换既有请求 token。
  • 记忆 context(cipher-memory:仅追加增长——快照变化(新沉淀/compaction 移除)时才重录, 否则每次组装零重录。
  • 记忆注入块每次组装求值,但内容无变化时输出稳定文本。
  • cipher_memory_search/ingest 为独立请求,不影响会话请求缓存。

开发

pnpm install
pnpm build          # tsc(host lib/) + tsdown(client/client.js, __ModuleLoader__ 格式)
pnpm test           # vitest(检索、证据边界、preset 物化)
pnpm preflight      # 发布产物校验
  • 服务包(@deepseek-ai/dsh-*)为 peer 依赖,解析到 DSH 安装自身;唯一直接依赖是 zod

安全提示

安装插件即在你的机器上以你的权限执行第三方代码——请审阅源码后再安装。本包无发布后脚本 (prepare 仅构建自身产物)。

License

MIT