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

@chatbi-v/core

v2.0.5

Published

ChatBI 核心模块,提供插件管理、基础设施接口及通用 API 引擎。

Downloads

1,144

Readme

@chatbi-v/core

ChatBI 核心模块,提供插件管理、基础设施接口及通用 API 引擎。

模块功能说明

  • 微内核架构: 实现插件的注册、生命周期管理与隔离。
  • 领域驱动设计: 严格区分领域逻辑 (domain)、外部接口 (ports) 和具体实现 (adapters)。
  • API 引擎: 统一的 API 请求管理,支持同步、流式请求及拦截器。
  • 存储管理: 提供隔离的存储适配器,确保插件数据互不干扰。

安装和使用方法

安装

pnpm add @chatbi-v/core

使用示例

import { PluginManager, LocalStorageAdapter } from '@chatbi-v/core';

// 初始化插件管理器
const storage = new LocalStorageAdapter();
const pluginManager = new PluginManager(storage);

// 注册并初始化插件
pluginManager.register({
  id: 'my-plugin',
  metadata: { name: 'My Plugin', type: 'business' },
  onLoad: async (context) => {
    console.log('Plugin loaded', context.pluginId);
  }
});

API 文档链接

详细 API 文档请参考 docs/index.html 或运行 npm run docs:dev 本地查看。

开发注意事项

  • 禁止引入 UI 框架: 本模块为纯逻辑层,不得包含 React/AntD 等 UI 依赖。
  • 禁止反向依赖: core 不得依赖 pluginsapps 中的任何代码。
  • 类型安全: 优先使用 ports 中定义的接口。

架构原则 (Architecture Principles)

  • 业务无关性 (Business Agnostic): core 包禁止包含任何具体的业务模型、业务逻辑或业务常量。
  • 共享契约 (Shared Contract): core 只定义通用的技术契约(如 Plugin, StoragePort, ApiAdapter)。
  • 插件驱动 (Plugin Driven): 所有的业务逻辑应由插件实现。

目录结构

  • adapters/: 基础设施的具体实现(如 LocalStorage, Axios)。
  • api/: 通用 API 请求引擎。
  • domain/: 核心领域逻辑(插件管理器、运行时、沙箱)。
  • ports/: 核心接口定义(端口)。
  • utils/: 通用工具函数。