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

@knyazevai/dsh-fork-external-session

v0.1.5

Published

Provider-neutral external-session mode registry

Readme

@knyazevai/dsh-fork-external-session

English | 中文

面向选择性启用的外部会话实现的 provider-neutral Host 注册表。该程序包提供 ctx.externalSessions、可通过合并扩展的 ExternalSessionModeMap,以及由 effect 所有的注册与查找操作。它不定义 provider 协议、进程运行器、权限桥、转录事件、渲染器或默认 provider。

组装

没有任何 provider 时,注册表仍然是有效的。后续 provider 程序包通过合并 ExternalSessionModeMap 声明自己的 mode 与 provider 类型,然后挂载自己的插件并注册实现:

declare module '@knyazevai/dsh-fork-external-session' {
  interface ExternalSessionModeMap {
    example: ExampleProvider
  }
}

ctx.externalSessions.register('example', provider)
const resolved = ctx.externalSessions.lookup('example')

register(mode, provider) 在替换已有 provider 之前拒绝重复 mode,并返回由注册方 Cordis fiber 所有的 disposer。dispose 只移除该次注册;过期 disposer 不能移除后续替换。没有 provider 注册到请求 mode 时,lookup(mode) 会抛错,因此调用方不会静默回退到其他实现。

明确范围

此程序包只负责 mode 到 provider 的映射表。provider 自己负责进程、线路、实时会话、权限、转录与模型约定。后续 Codex 集成必须作为显式 provider 与 Web bundle 挂载;该注册表不依赖默认 Codex。

模型体验

Host 注册表

模型看到的内容

该注册表仅位于 Host,不贡献提示词、工具 schema、消息、流、持久事件或模型请求。它的 register()lookup() 操作只影响 Host 侧 provider 选择。

Token 影响

为零。注册和查找只改变 Host 侧 provider 选择,不增加任何模型 token。

KV Cache 影响

为零。该注册表不会组装 provider 请求,也不会改变模型可见前缀,因此既不增加也不使模型 KV cache 输入失效。

已知限制与暂缓事项

  • Provider 生命周期由 provider 负责——注册 dispose 会移除查找条目,但不会推断 provider 如何释放自己的资源。
  • Mode 声明是编译期扩展——provider 程序包必须先合并 ExternalSessionModeMap 再注册 mode;当前组装中未注册的运行时名称会在查找时失败。