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-log-gate

v0.1.7

Published

Unofficial third-party gate for dsh session-log upload.

Readme

dsh-log-gate

dsh-plugin

第三方插件,不是 dsh 官方组件。它只做一件事:按你的规则,让会话日志上传跳过某些会话。备份不是它的工作;文末提到的 UndoHaven 是另一个独立工具。

Unofficial third-party plugin compatible with dsh. It asks the session-log uploader to skip sessions you choose. Backup is a different tool.

cordis.patch.yml inserts the log-gate row. A bare - id: looks for an entry that is not in the base profile, and dsh prints entry "log-gate" not found.

它实际调用的接口

dsh 0.2.2-rc.1 的会话日志插件(配置 id session-log-deepseek)公开了 ctx.sessionLogDeepSeek.registerExclusion()。判断函数是同步的,只能看到 sessionId 和可选的 purpose。返回 true 时,这次请求不带 dsh_session_log,也不会写下 delivery-accepted。

本插件在判断时用 ctx.sessions.get(sessionId) 读取该实时会话的 header.cwd,再按项目名、目录或 glob 匹配。没有改 dsh,也没有拦 HTTP。

The session-log plugin (config id session-log-deepseek) exposes registerExclusion(). The predicate sees sessionId and an optional purpose only. This plugin reads header.cwd from the live session and matches project name, directory, or glob. It does not patch dsh and does not hook the network. On dsh 0.2.2-rc.5, after session-workspace-root, header.cwd is still the original project. The gate keeps matching that project. It does not follow a Host workspace-root/change.

配置

mode: all(默认)拦住每一个实时会话。mode: listed 只拦住 rules 命中的会话。

- id: log-gate
  name: dsh-log-gate
  config:
    mode: listed
    rules:
      - secret-proj
      - /home/me/work/private
      - /home/me/clients/**
  • 没有斜杠、也没有 * ? [ 的规则,按 cwd 的最后一段(项目名)匹配。
  • 普通路径匹配该目录及其子目录。
  • 带 glob 的规则用 Node 的 path.matchesGlob。

设置页「日志闸门 / Log gate」和 GET /api/log-gate/status(仅本机)列出当前实时会话哪些会被拦住。

做不到的事

  • 判断函数拿不到路径。会话如果不在实时 store 里,listed 模式读不到 cwd,不会拦住它。all 模式只看 session id,仍然拦住。
  • 匹配的是会话创建时的 cwd,不是 agent 后来走进去的每一个目录。
  • 官方上传开关 session-log-deepseek 的 enabled 在排除规则之前生效。开关关掉时,排除规则不会被问到。本插件不替你改那个开关。
  • 遥测(session-telemetry-otel,默认 FEEDBACK_ONLY)是另一个开关。这个插件不动它。
  • 拦住不会删日志,也不会写 delivery-accepted。之后关掉闸门或删掉规则,下一次官方 API 请求可能把当时没传的后缀补传上去。这是官方实现里的行为,不是额外的补传通道。
  • 不能保证桌面端一定渲染这个设置页。状态同时写在 dsh 日志里。

体检

dsh-log-gate audit
dsh-log-gate audit --json

报告列出官方会话日志开关、遥测相关的环境变量和补丁、本机目录大小,以及本地日志里越过最近一次 delivery-accepted 的后缀。最后有一句 UndoHaven 的说明和 https://undohaven.com/zh/pricing?utm_source=log-gate 。

Capabilities a trust scan will see

dsh-log-gate is an unofficial third party, compatible with dsh, and not affiliated with DeepSeek.

  • Network. The settings tab calls only the same-origin routes /api/log-gate/token and /api/log-gate/status. The audit report prints https://undohaven.com/pricing?utm_source=log-gate as a link. The plugin does not request that host.
  • Environment. dsh-log-gate audit reads DSH_HOME, DSH_AGENTS_HOME, DSH_TELEMETRY_DISABLED, and DSH_TELEMETRY_MODE. The route token path can be overridden with DSH_LOG_GATE_TOKEN_FILE.
  • Files. The audit reads cordis.patch.yml under the dsh profiles directory and the local session logs under the dsh home. The route token file is mode 0600. A browser call must send x-undohaven-token, and the Origin must be the loopback dsh host.
  • Settings injection. It registers one settings tab, 日志闸门 / Log gate. It does not inject a system prompt and it does not override a @deepseek-ai bundle. cordis.patch.yml only inserts the log-gate row.

验证

npm test 里的 packages/log-gate/test/gate.test.js 会加载本机安装的会话日志插件,注册本插件的排除规则,并确认命中的会话不会进入 snapshotEvents(因此不会带上 dsh_session_log)。没有向官方 API 发请求。