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

@wowyuarm/dsh-channel-gateway

v0.1.0

Published

Channel gateway for DeepSeek Harness: normalize provider traffic into one message contract, announce inbound messages as one typed event, authorize at the transport boundary.

Readme

dsh-channel-gateway

DeepSeek Harness 的 channel 网关插件: 适配器把各聊天平台的消息归一成同一套消息契约,网关完成鉴权并分发一个 channel/inbound 事件,消费方用入站消息携带的 route 通过 ctx.channels.send 回复。

本包覆盖聊天接入的传输层:它固定消息契约,以及 provider 与消费方之间的接缝。 一条消息意味着什么、是否见过、下一步去哪,都由上层决定。

契约

五个面就是公开 API,保持小、稳、可版本化。逐字段含义见 docs/architecture.md

| 面 | 形状 | | --- | --- | | 入站 | InboundMessage { channel, providerMessageId, actor, place, visibility, text, attachments?, timestamp, replyTo?, raw? } | | 出站 | OutboundMessage { channel, route, text, attachments?, replyTo? } | | 传输 | Channel { name, capabilities, start(inbox), stop(), send(message) } | | 网关 | ctx.channels.register(channel) · ctx.channels.send(message) · 事件 channel/inbound | | 鉴权 | ChannelAuth { authorize(request) },默认 allowlist |

契约中有三处是消费方需要、而 provider 给不出可用形态的:

  • actor / place / visibility —— 谁说的、在哪、当着谁。
  • providerMessageId —— provider 的稳定 id,供消费方去重与持久接受。
  • place.route —— 由 channel 构造的 opaque 目的地:消费方存下见过的 route、 作为 OutboundMessage.route 原样交回;适配器之上没有任何一层拼 provider 地址。

安装

本包是一个 DSH bundle,安装即插入 gateway service 行:

dsh plugin add @wowyuarm/dsh-channel-gateway --profile <profile>

适配器是可选行(各自需要凭据),由 profile 自己加:

- insert:
    - id: channel-telegram
      name: '@wowyuarm/dsh-channel-gateway/telegram'
      config: { token: '<bot token>' }
    - id: channel-weixin
      name: '@wowyuarm/dsh-channel-gateway/weixin'
      config: { token: '<iLink bot token>' }

「谁可以说话」是 gateway 那一行的配置,不是适配器的:

- id: channel-gateway
  config:
    allow:
      - telegram:123456789   # 某 channel 的某个 actor
      - weixin:*             # 某 channel 的所有 actor
      # - '*'                # 所有人

allow 为空即谁都不放行。

消费

import type { Context } from '@deepseek-ai/cordis'
import type {} from '@wowyuarm/dsh-channel-gateway'

export const name = 'my-ingress'
export const inject = ['channels']

export function apply(ctx: Context) {
  ctx.on('channel/inbound', (message) => {
    // 按 (message.channel, message.providerMessageId) 去重、持久接受、路由。
    void handle(message)
  })
}

适配器

| 适配器 | 传输 | 入口 | 说明 | | --- | --- | --- | --- | | Telegram | Bot API 长轮询(getUpdates) | @wowyuarm/dsh-channel-gateway/telegram | 文本/文档/图片/音频/视频;附件以 provider ref 或 URL 发送,不做本地上传。config.token 缺省回落到 DSH_TELEGRAM_TOKEN。 | | 微信 | iLink 长轮询(ilink/bot/getupdates) | @wowyuarm/dsh-channel-gateway/weixin | 仅文本。回复要带上入站消息的 context_token,微信侧约两分钟后过期;媒体只上报不拉取、不发送。需要一个已获得的 token——扫码登录流程尚未实现。 |

两个适配器都尊重 HTTPS_PROXY/NO_PROXY(Node 自带 fetch 默认不读这两个变量)。

开发

npm install
npm run typecheck     # tsc,strict
npm test              # 边界守卫 + vitest
npm run build         # 产出 lib/

src/ 只允许 import 自己的相对模块、Node 内置模块,以及 @deepseek-ai/cordis / @deepseek-ai/schemastery; 适配器可额外使用 undicinpm run check:boundaries 强制这条线,避免中立层悄悄长出宿主依赖。

许可

MIT。Telegram 传输改编自 dsh-telegram-channel(MIT); 微信协议形状参考 openclaw-weixin(MIT)与 nanobot(MIT)。