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

llmswitch-config-core

v0.1.0

Published

目标:提供单一路径、无推测与无回退的配置解析引擎。把系统蓝图(module.json)与用户配置(config.json)映射为唯一“解释体”(CanonicalConfig),并导出装配输入(pipeline_assembler.config)与最终镜像(merged-config.json)。

Readme

config-core(V2 配置解释体引擎)

目标:提供单一路径、无推测与无回退的配置解析引擎。把系统蓝图(module.json)与用户配置(config.json)映射为唯一“解释体”(CanonicalConfig),并导出装配输入(pipeline_assembler.config)与最终镜像(merged-config.json)。

要点

  • 单一路径:仅支持 V2 新格式,不兼容 legacy 自动合成与家族推断。
  • Fail Fast:缺失/冲突即报错;仅允许结构性默认(如 routing.* 缺省→[]),不做语义猜测。
  • 多 Key 与 OAuth:统一 keyVault + authRef 绑定;支持 apikey 与 oauth。
  • perKey 路由规则:在 perKey 模式下,routing 中不带 key 的 <pid>.<mid> 表示“该 provider 的所有启用 key”。
  • 全阶段落盘:所有阶段产物写入 config/,与 merged-config.json 同级(不做脱敏,完整保留字段)。

阶段产物(均写入 config/

  • stage-1.system.parsed.json:系统蓝图解析+校验
  • stage-2.user.parsed.json:用户配置解析+校验
  • stage-3.canonical.json:解释体(providers/keyVault/pipelines/routing/routeMeta)
  • stage-4.assembler.config.json:装配输入(pipelines/routePools/routeMeta)
  • merged-config.json:解释体镜像 + _metadata

接口(规划)

  • loadSystemConfig(path): 解析+校验 module.json(JSON Schema/Ajv)
  • loadUserConfig(path): 解析+校验 config.json(JSON Schema/Ajv)
  • buildCanonical({ system, user, options }): 生成解释体(含 perKey 扩展与 routing 展开)
  • exportAssemblerConfig(canonical): 产出 pipeline_assembler.config
  • writeArtifacts(): 将各阶段产物落盘(不做脱敏)

非目标

  • 不进行 provider 家族/模型名推测(如 glm→openai)。
  • 不进行密钥隐式继承/猜测(仅用户显式配置)。
  • 不从 legacy 结构自动合成 pipelines。

目录

  • schema/:User/System/Canonical JSON Schema 草案
  • mapping/:映射规范(source→target 规则与校验约束)
  • docs/:阶段说明、perKey 路由规则等
  • interpreter/、exporters/:实现落点(后续补充,不在本次提交中实现)