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

@sparkelf/dsh-dataops-im

v0.1.2

Published

DataOps IM wrapper: mode=admin ships the administrator-only IM management page and same-origin proxy without loading dsh-im; mode=connector pins @xmanrui/[email protected] and exposes its three dsh_im_* tools only to administrators or IM-authorized Sessions.

Readme

@sparkelf/dsh-dataops-im

DataOps IM 机器人的 DSH 集成。一个包、两种 mode,按文件拆开写:

| mode | 作用 | 文件 | |---|---|---| | admin | 只注册 DSH 设置页「IM 机器人」与同源代理;不加载 IM 通道、不注册工具/技能/context | src/admin/**、src/client/** | | connector | 加载 @xmanrui/dsh-im,对其工具与 /api/dsh-im/* 管理路由做门控 | src/auth.ts、src/gating.ts、src/connector/** |

入口 src/index.ts 由 connector 侧维护:所有 mode 先 await registerAdminProxy(ctx, { baseUrl }), mode === 'connector' 再装配通道与门控。

数据与授权

  • 设置页的数据来自 DataOps GET/POST/PATCH/DELETE /api/im/bots、POST /api/im/bots/:id/test;
  • 宿主代理把网关附带的 Authorization: Bearer <jwt> 原样转给 DataOps,插件不判断权限;
  • 可见性由 GET /api/im/capability 的 {allowed} 决定:非管理员不注册 section;
  • 写接口需要 system:im:manage;Secret 只存 DataOps 秘密库(im-bot/<uuid>),响应只回 secretConfigured,Bot ID 一律脱敏。

构建

pnpm --filter @sparkelf/dsh-dataops-im build   # tsc 声明 + tsdown 双产物(lib/index.js、lib/client.js)

只改客户端时可 ./node_modules/.bin/tsdown(跳过 dts),lib/client.js 即 DSH 模块加载器读取的产物。

安装(工作区热补丁)

包必须同时出现在三棵树里,缺一处会在容器重建/换机后失效:

/opt/dsh-plus/node_modules/@sparkelf/dsh-dataops-im
/opt/dataops-dsh-profile-template/node_modules/@sparkelf/dsh-dataops-im
/workspace/.dataops/dsh/profiles/<profile>/node_modules/@sparkelf/dsh-dataops-im

并同步 profile/template 的 package.json(依赖行 + dsh.profile.bundles 行)与 cordis.patch.yml(dataops-im 配置块),最后 dataops-dsh-service stop/start。

connector:企微 sender 身份映射

mode=connector 额外加载 src/connector/identity.ts:

  • 订阅 dsh-im 的 dsh-im/session-pre-bind,按 botId + senderId 调 DataOps POST /api/im/identity/resolve;
  • 事件到达时先给 Session 放一个不含 scope 字段的占位 actor,解析成功后再写 DATAOPS_ACCESS_TOKEN_S_<SID> 并替换真实 actor;解析失败保留占位 actor,MCP 凭据解析 找不到槽会报错,不会回退工作区服务账号 token;
  • dsh-im/session-unbind 删除该会话的 scoped 槽;session/created 对重启后已存在的会话用 dshIm.describeConversation(sessionId) 补一次身份;
  • 管理员可通过 GET /api/dsh-dataops-im/identity/status?sessionId= 查看解析状态(不返回 token)。

依赖:@sparkelf/dsh-plugin-mcp-credentials >= 0.2.9-alpha.91(支持 _S_ 会话槽), profile 必须移除独立的 @xmanrui/dsh-im bundle,避免同一通道被挂两次。