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

@spaceflow/core

v0.26.0

Published

Spaceflow 核心能力库

Readme

@spaceflow/core

npm version License: MIT

Spaceflow 核心运行时,包含 CLI 运行时引擎、13 个内置命令、扩展系统和共享模块。

安装

pnpm add @spaceflow/core

核心职责

  • CLI 运行时exec() 入口函数,初始化 i18n、ServiceContainer、ExtensionLoader,构建 Commander 命令树
  • 13 个内置命令 — install、uninstall、build、dev、create、update、list、clear、runx、schema、commit、setup、mcp
  • 扩展系统defineExtension() 纯函数式 API、类型定义(ExtensionDefinitionCommandDefinitionSpaceflowContext
  • 共享模块 — Git、LLM、Logger、Storage 等服务

快速上手

// 扩展开发 — 使用 defineExtension 定义扩展
import { defineExtension, t } from "@spaceflow/core";

export default defineExtension({
  name: "my-extension",
  commands: [
    {
      name: "hello",
      description: "Say hello",
      run: async (args, options, ctx) => {
        ctx.output.info("Hello from my extension!");
      },
    },
  ],
});
// 共享模块 — 直接导入使用
import {
  GitProviderService,
  GitSdkService,
  LlmProxyService,
  FeishuSdkService,
  LoggerService,
  ParallelService,
} from "@spaceflow/core";

共享模块

| 模块 | 说明 | | ------------ | ----------------------------------------- | | Git Provider | Git 平台适配器(GitHub / Gitea / GitLab) | | Git SDK | Git 命令操作封装 | | LLM Proxy | 多 LLM 统一代理(OpenAI、Claude) | | Logger | 日志系统(TUI / Plain 双模式) | | Feishu SDK | 飞书 API 操作封装 | | Storage | 通用存储服务(支持 TTL) | | Parallel | 并行执行工具 | | i18n | 国际化(i18next) |

目录结构

core/
├── src/
│   ├── cli-runtime/         # CLI 运行时引擎
│   │   ├── exec.ts          # exec() 入口
│   │   ├── service-container.ts  # DI 容器
│   │   ├── extension-loader.ts   # 扩展加载器
│   │   └── internal-extensions.ts # 内置扩展注册
│   ├── commands/            # 13 个内置命令
│   │   ├── build/
│   │   ├── clear/
│   │   ├── commit/
│   │   ├── create/
│   │   ├── dev/
│   │   ├── install/
│   │   ├── list/
│   │   ├── mcp/
│   │   ├── runx/
│   │   ├── schema/
│   │   ├── setup/
│   │   ├── uninstall/
│   │   └── update/
│   ├── config/              # 配置管理(Zod Schema)
│   ├── extension-system/    # 扩展系统核心
│   │   ├── types.ts         # ExtensionDefinition 等类型
│   │   ├── define-extension.ts  # defineExtension 工厂函数
│   │   └── extension.interface.ts # package.json spaceflow 字段解析
│   ├── locales/             # 国际化资源(en + zh-cn)
│   └── shared/              # 共享模块
│       ├── git-provider/    # Git 平台适配器
│       ├── git-sdk/         # Git 命令封装
│       ├── llm-proxy/       # LLM 统一代理
│       ├── feishu-sdk/      # 飞书 SDK
│       ├── logger/          # 日志系统(TUI/Plain)
│       ├── parallel/        # 并行执行工具
│       └── storage/         # 通用存储服务

开发

# 构建
pnpm run build

# 类型检查
pnpm run type-check

技术栈

  • Commander.js — CLI 命令框架
  • ServiceContainer — 自定义 DI 容器
  • Rspack — 构建工具
  • i18next — 国际化
  • Zod — 配置校验
  • TypeScript — 类型系统

许可证

MIT