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

@little_monkey/dsh-chat-preset

v1.2.0

Published

Chat preset plus the host-side latest-reminder plugin, configurable on the bundle's Plugins page.

Readme

@little_monkey/dsh-chat-preset

声明「聊天(联网)」预设 chat(网页版 chatbot 的 DSH 本地近似),并自带一个可在插件页配置的 Host 插件,负责每轮注入官方 latest_reminder 五元组。

组成

| 行 | 类型 | 作用 | |---|---|---| | chat-latest-reminder | Host 行 | index.js:每轮给 chat 会话注入 <日期>,<星期>,<地点>,<平台>,<语言>;字段在插件页可改,保存即生效 | | persona | 预设行 | 固定短提示词:complete: true + 仅官方身份句 该助手为DeepSeek,由深度求索公司创造。 | | tool-web | 预设行 | web_search + web_fetch(搜索超时 60s) | | compaction | 预设行 | compaction-basic + /compact + tool-result-pruner(超 8192 字符保留首尾) |

预设刻意不包含:tool-fs(没有 read、read_image)、shell、subagent/workflow、office、plugin manager、todo、skill。time-context 已被 latest reminder 取代(官方只带日期,不带具体时刻)。

提示词(A)

persona.complete: true 时模型只收到 prefix 一句作为 system prompt,其余 prompt section(harness 通用底稿、identity、工具使用指南、可选运行时上下文)全部被抑制;includeRuntimeContext: false 同时关掉可选运行时上下文(必需的 cwd/subagent identity 仍会保留)。

prefix 取自官方开源客户端 deepseek-ai/chat-demo 的 SYSTEM_PROMPT(src/services/chat/store.ts,v0.1.4 / commit cdf9617),它由所有生成请求作为顶层 system 字段发出。注意:网页版(chat.deepseek.com)的请求体里没有 system/messages(实测只有 prompt 与会话 id,服务端维护历史),所以这句是「官方可确认的文本」,不等于网页版服务端内部提示词原文。

代价:web_search / web_fetch 的系统提示指南也被抑制,联网行为只靠工具 schema 的 description。若发现模型不主动检索或引用来源,可在 prefix 末尾补一句,或改回 complete: false。

每轮提醒(B)

index.js 在 agent/pre-step 里、step === 1 时,于本轮用户消息前插入一条上下文消息:

2026-11-25,星期三,广州,Web,中文
  • 字段与官方一致(chat-demo latestReminder.ts:date,weekday,location,platform,language;地点可为空,平台为 Web/App,语言用该语言自身书写)。
  • 官方走 Anthropic 扩展角色 latest_reminder;DSH 的消息角色只有 system/developer/user/assistant/tool,所以这里以 user 角色的上下文消息(source.kind = chat-latest-reminder、form: snapshot)注入,UI 不会把它当用户气泡。
  • 每个 turn 一条、durable(进会话历史,和官方 demo 一样回传历史提醒);同一 turn 的后续 step 与重放的 step 1 不重复(WeakMap 按 Agent 记 turn)。
  • 只对 live preset 等于 presetId(默认 chat)的 Agent 注入;读法是 ctx.get('agentPresets')?.presetForSession?.(agent.session),与 dsh-preset-tool-gate 相同。

插件页配置

Plugins → 聊天(联网)预设 页面顶部就是配置卡,字段:

| 字段 | 默认 | 说明 | |---|---|---| | 地点 | 广州 | 官方格式允许为空;留空则该字段是空串 | | 平台 | Web | 网页端 Web,App 端 App | | 语言 | 中文 | 用该语言自身书写 | | 星期语言 | zh-CN | 只影响星期几的拼写 | | 生效预设 | chat | 只对这个 agent preset id 注入 |

所有字段都是 schemastery .volatile():表单保存走 configForms + form.mutate([{ op: 'set' }]),Loader 直接写入运行中的插件,下一步即生效,无需重启。卡片里还有一行实时示例(当前日期 + 当前草稿值)。

为什么提醒是 Host 行而不是预设行

插件页的配置表单按 Host Loader 条目 取 settings form(configForms.get(<entry id>),客户端槽位 plugins.bundle.config 按包名挂载),只有 profile 根树上的行有;预设行在 agentPresets.mount 的独立 EntryTree 里,没有对应表单。所以 index.js 放在 profile 根,按 live preset 过滤;预设里只留 persona/工具/压缩。

工具隔离

Host 全局工具由 @little_monkey/dsh-preset-tool-gate 隐藏,其 isolatedPresets 在 profile patch 中为:

- id: preset-tool-gate
  name: "@little_monkey/dsh-preset-tool-gate"
  config:
    isolatedPresets:
      - minimal
      - chat

需要额外放行某个 Host 工具(如 working_directory)时加进 keepGlobal。

调整

  • 想支持「按路径看图」:在 cordis.patch.yml 的预设里加 - id: tool-fs 且 config: { read: false, readImage: true, write: false, edit: false }。
  • 想恢复时间上下文:在预设 plugins 里加回 { id: time-context, name: '@deepseek-ai/dsh-time-context' }。
  • 改压缩阈值:调 tool-result-pruner 的 thresholdChars / headChars / tailChars。

生效与回滚

  • 首次加 Host 行与客户端表单需要重启 DSH 重新装配 bundle;之后改地点/语言等 volatile 字段在插件页即时生效。
  • 已存在会话保留启动时的预设版本,验证请新建 chat 会话。
  • 旧版备份:index.js.bak-20261125-preset-scope、cordis.patch.yml.bak-20261125-preset-scope、cordis.patch.yml.bak-20261125-pre-reminder、package.json.bak-20261125-*。
  • 整体移除:plugin_manager → remove_bundle,target @little_monkey/dsh-chat-preset;再把 profile patch 里 preset-tool-gate 的 chat 从 isolatedPresets 去掉。