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

@wingsky-1/dsh-decision-gateway

v0.2.9

Published

Decision gateway for DSH agents: calibrated Choice/Score/Noul verdicts via ws_request_verdict + local secret precheck + dual-track keys. 通用辅助决策网关(JEV 为首个 provider):frozen 预设模板 + 密钥双轨(ENV 引用优先)+ 本地密形预检 + SystemOne 官方调用,工具 ws_request_verdict / ws_list_verdi

Readme

dsh-decision-gateway

通用辅助决策网关(JEV 为首个 provider):frozen 出题规范(英文) + 双轨密钥 + 本地密形预检 + SystemOne 官方调用(经官方 @typesafe-ai/sdk 构建期内联传输,基址与模型双冻结,零运行时依赖)。

适用:需要校准二选一 / 评分 / 风险二值建议的 agent 决策、密钥文本先本地预检再出境、开关与历史需审计留痕的场景;不适用:自动执行(本包只给建议等级,不持执行器)、开放式推理(只跑 frozen 模板题目)、可靠消息队列或事务组写。

一键安装(安装后重启 dsh web 生效):

dsh plugin --profile web add @wingsky-1/dsh-decision-gateway
  • 模型工具:ws_request_verdict(决议)、ws_list_verdict_guides(只读清单)。
  • 回环路由:/api/dsh-decision-gateway/health|config|presets|history|test-connection。
  • 5 预设 frozen 出题规范(templateVersion 恒为 1,英文描述,零考题):general / secret-leak(默认关闭)/ plan-review / risk-check / custom。调用方每次经 questions_override 自带全量题目(1-20 题,必填;首题驱动输出,多题仅首题决议)。措辞注:general 已由 binary/two 改为 2-10-candidate choice,custom 由 three 改为首题驱动,templateVersion 仍为 1;落史 templateVersion 可观测仍为 1。工具参数:preset_id 为 5 frozen id 或自建 id(ws_list_verdict_guides 的 custom:true 项);state.lang 为 en/zh/unknown,缺席默认为 unknown;score 题禁 options、可带 2-10 levels(缺席默认 1-5,如五档 1-5 或两档 low-high 重缩放到 1-5)。
  • 自建预设(custom-presets.json,缺席即空):PUT /config 增量键 customPresets 全量替换(id 不可与 frozen 重名,cap 0|1|2);自建 id 可直接决议(开关/cap 同 frozen 语义);落史存调用题目快照(脱敏),GET /history enrich 展示标题(只存 id)。

最短上手

  1. 安装并重启 dsh web(见顶部命令);设置页出现 dsh-decision-gateway 卡片,连接 tab 显示服务可用即宿主端已挂载。
  2. 配密钥(二选一):把已导出的 ENV 名填入 apiKeyRef(推荐,值永不落盘);或展开明文折叠,直接输入密钥保存(免二次确认)。
  3. 点测试连接(POST /test-connection,空体合法):回 ok + latencyMs 即端到端可用;报 NO_KEY 先检查 ENV 是否导出或明文是否保存。

配置

三文件独立存放于 ~/.dsh/@wingsky-1/dsh-decision-gateway/(感知 DSH_HOME,目录 0700 / 文件 0600 / 原子写):

  • config.json:{version:1, connection:{apiKeyRef?,hasPlaintextKey,timeoutMs:8000,maxConcurrency:4,truncBudget:32000}, presets:[5 个 id+enabled+automationCap(0|1|2)], history:{perSession:200,totalSessions:50}};
  • presets.json:开关覆盖层;secrets.json:明文密钥唯一落盘处;VERSION:存储版本刻度。

PUT /config:apiKeyRef 须匹配 ^[A-Z][A-Z0-9_]{1,63}$;与 apiKeyPlaintext 互斥;明文免二次确认(confirm 字段若出现则忽略);形状拒收 400 仅回类别;baseUrl 等退役键 400。

安全模型

  • 离境数据:仅当本地密形预检未命中且密钥可用时,才向官方基址发送截断后正文 + 题目;命中密形(如 sk-…、AKIA…、ghp_…、私钥块、password=)即不离境、直转人工(appliedSource: local-precheck,choice: human);首题答案为 Noul(弃权)同样不分级、直转人工(tier none)。
  • 双轨密钥:ENV 引用(apiKeyRef)优先于明文;切到 ENV 轨即折叠清空 secrets.json;明文写入免二次确认,服务端仍校验互斥。
  • 0600/0700:命名空间目录 0700,三文件 0600,经临时文件 + rename 原子写入。
  • 掩码面:GET /config 只回 apiKeyRef 名与 hasPlaintextKey,密钥原文永不回显;形状拒收 400 仅回 empty|too-short|charset 类别。
  • secret 预设警告:secret-leak 默认关闭,仅在需检查不可信文本是否含真密钥时启用(启用后仍先过本地预检);历史 snippetRedacted 先脱敏后截断 ≤200 字,原始密钥永不入库。
  • BaseURL 写死:https://api.typesafe.ai/v1/systemone 为加载断言常量,不接受任何配置覆盖;PUT 遇 baseUrl 类键直接 400。模型冻结为 jev-latest(同等 pin 待遇);score 回浮点按发送档数重缩放回 1..5(默认五档即 round+1,均钳制;自带 levels 用 levels 字段 2-10 档,如五档 1-5 或两档 low-high),tier 按置信度 ≥0.8 high/≥0.5 low 派生(其余 none)。

历史

按(工作目录指纹 rootHash,sessionId)分文件 jsonl(工作目录取自会话 store,取不到回落调用方目录):每会话 200 条轮转,总会话 50(只保数量语义,mtime 并列时不钉删谁)。落史条目含 templateVersion(恒为 1,可观测;措辞修订不 bump 版本)。查询 root 可传完整路径、rootHash,或仅传 basename(按 rootDisplay 匹配);删除仅支持单会话(root 与 sessionId 双必填,basename 多命中即 400)。会话标题仅活会话在读取时 enrich 显示(sessionTitle,无标题回落短 id,永不落盘)。

验证与排障

  • 存活:GET /api/dsh-decision-gateway/health 回 ok / version / templateVersion。
  • 围栏:非本机回环一律 403,方法不在表里 405(先判 403 再判 405)。
  • 常见失败:NO_KEY(无可用密钥)、PRESET_DISABLED(预设被关)、MUTUALLY_EXCLUSIVE(apiKeyRef 与明文同传)、密钥形状 400 仅回 empty|too-short|charset 类别。
  • 历史查不到:root 传完整路径或 rootHash 最稳(basename 按 rootDisplay 匹配,删除多命中即 400);GET /history 缺省 100 条、上限 500。

后续项(deferred,非本版实现)

  • 启动自检迁移:装配期升级链现只做版本锚定(缺席播种/已锚定空转/未来版本拒绝启动);配置形态自检与旧盘迁移留待加步骤时再写。明文写入免二次确认(用户已明确批准移除该 friction)。
  • 三文件非组写:config/presets/secrets 三次独立原子写,非事务组写;进程在写盘间隙崩溃可能留下新旧混搭(读侧以“缺口补默认”收敛),该崩溃窗口被容忍,不做预写日志。