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

@qcqx/lattice-core

v1.1.0

Published

Lattice 共享核心库

Readme

@qcqx/lattice-core

Lattice 的领域逻辑核心库。所有路径管理、配置、数据库、项目、任务、Spec、搜索、RAG 和模板能力均由本包实现,CLI 和其他消费方直接调用导出函数即可。

安装

pnpm add @qcqx/lattice-core

模块结构

src/
├── config/       → 全局 & 本地配置读写
├── db/           → SQLite 数据库(项目索引、FTS、向量搜索)
├── maintenance/  → 启动自检与数据迁移
├── paths/        → 路径计算与文件工具
├── project/      → 项目注册、指纹、跨用户发现、关系管理
├── rag/          → 嵌入生成、增量/全量索引、语义搜索
├── search/       → 混合搜索(语义 + FTS)与上下文聚合
├── spec/         → Spec 解析、级联、冲突检测、校验
├── task/         → 任务 CRUD、checkpoint 进展追踪
├── trash/        → 软删除与恢复
├── types/        → 公共类型定义
├── template-assets.ts → 模板分发与同步
└── index.ts      → 统一导出入口

核心导出

路径与文件

getLatticeRoot() / getUserDir() / getProjectDir() / getTaskDir() 等全套路径计算函数,以及 ensureDir / readJSON / writeJSON 等文件工具。

配置

readResolvedConfig() / getUsername() / isInitialized() — 读取合并后的全局 + 本地配置。

项目

registerProject() / unregisterProject() / findProjectByPath() / scanForProjects() — 项目注册、查找和批量扫描。

任务

createTask() / updateTask() / archiveTask() / addCheckpoint() / listCheckpoints() — 完整任务生命周期。

Spec

getCascadedSpecs() / detectSpecConflicts() / parseSpec() / writeSpec() — 三级级联、冲突检测和读写。

搜索与上下文

hybridSearch() / getSmartContext() / formatContextAsMarkdown() — 语义 + 全文混合搜索和上下文聚合。

RAG

incrementalIndex() / rebuildIndex() / semanticSearch() / getRAGStatus() — 索引管理和向量搜索。

模板

applySpecTemplate() / syncSpecTemplateRegistry() / renderPlatformTemplate() — 模板应用与平台规则渲染。

公共资源

public/templates/ 目录随包分发,包含:

  • skills/ — AI Agent 工作流文档(SKILL.md、command-reference.md 等)
  • platforms/ — 平台规则模板(lattice-rules.md)
  • commands/ — Agent Command 模板
  • spec/ — 内置 spec 模板(frontend / backend / api / architecture 等)

开发

# 构建
pnpm --filter @qcqx/lattice-core build

# watch 模式
pnpm --filter @qcqx/lattice-core dev

# 类型检查
pnpm --filter @qcqx/lattice-core check-types

License

MIT