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

@huiliyi37/dsh-type-meta

v0.4.0

Published

Compiler-independent Remote metadata and TypeRT provider protocols

Readme

@huiliyi37/dsh-type-meta

English | 中文

该包提供不依赖编译器的声明,由业务包、生成的 TypeRT 产物、Host Gateway 和 Client API 共享。它负责 Remote Service 基类、装饰器、显式 binding 回退、可通过声明合并扩展的协议映射、调用描述符、编解码器和提供方约定;它不执行 TypeScript 分析,也不注册具体 Cordis 服务。

Remote 声明

  • @Remote 将公开实例方法标记为可在其注册的 Cordis 服务上直接调用。
  • @RemoteScope(key) 标记接收者选自合并声明的作用域 Context 类型的方法。
  • GatewayServicesuper(ctx, serviceKey, options?) 接收的 Cordis key 同时绑定为默认 wire namespace。
  • bindTypeRTGateway(this, serviceKey, options?) 为无法继承 GatewayService 的 Service 提供同样可见且冻结的绑定。
  • remoteMethods(service) 返回按声明顺序排列、与内部状态分离的快照,供 Gateway 的 SRC 回退路径使用。

Host 方法通过将 signal: AbortSignal 声明为最后一个参数来启用协作式取消。InvocationDescriptor.cancellation 记录这个保留的注入点;signal 绝不会成为 JSON 参数或 lookup 字段。SRC 识别末位参数名,严格生成还会校验它是否具有全局 AbortSignal 类型。

装饰器初始化器将标记保存在以服务 prototype 为键的模块私有 WeakMap 中。它们不会在构造函数上添加 symbol,也不会添加 prototype 属性、参数元数据或运行时反射字段。GatewayService 会暴露与显式 helper 相同的 public readonly typertGateway 绑定。

TypeRT 协议

业务包扩展 TypeRTLookupMapTypeRTContextMap,以关联 Host 对象或作用域 Context 与其协议身份。生成的产物扩展 TypeRTRemoteMapTypeRTRemoteScopeMapTypeRTRemoteNamespaceMap,使 Client 导入后仅暴露选定的 Remote 方法。InvocationDescriptor 是供注册表、Gateway 和 Client Remote 使用的共享运行时形式。

查找包与 Context 包同时负责其约定的两侧:声明合并提供静态关联,运行时提供方则向 ctx.typert 注册身份解析。lookup 或 Host Context provider 提供稳定声明与默认 resolver,Host 组合可以另行配置同步或异步 resolver;策略拒绝可用 TypeRTLookupFailure 携带由边界适配器拥有的失败值。严格编解码器携带生成的 schema;src-json 编解码器标识约束更弱的源码启动路径。

模型体验

无,因为该协议包声明应用反射,不注册任何模型接口。

KV Cache 影响

无直接影响。

已知限制与延期工作

  • 装饰器标记仅包含方法名,以及直接调用或 Context 调用模式。参数、结果、查找和 schema 反射需要 TypeRT 构建流水线。
  • Remote 装饰器只接受具有字符串名称的公开、非静态实例方法。SRC 执行无法表示重载签名,以及包含解构参数、默认参数或剩余参数的方法签名。