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

control-harness

v0.3.0

Published

LLM harness that generates craft.js-vue local component JSON via an agent loop (generate -> validate -> write)

Readme

control-harness

LLM(KIMI K3 / Claude)驱动的 agent loop harness:自然语言 → 校验通过的 craft.js-vue「选择本地组件」可导入的本地组件 JSON 文件。

自然语言描述 → LLM 生成 → schema 校验(失败回喂自修复) → 写盘 .json
→ craft.js-vue「选择本地组件」导入 → 画布可用

快速开始

# 安装(全局,注册命令 control-harness 和 cch)
npm install -g control-harness

# 配置 API key(一次配置,全局生效;也可直接用环境变量 OPENAI_API_KEY)
cch config init
cch config set apiKey sk-kimi-...

# 交互模式(Claude Code 风格,保留会话历史)
cch

# 单次模式
cch "一个深色主题的返回按钮组件"

要求 Node 18+(使用原生 fetch)。KIMI 默认端点 https://api.kimi.com/coding/v1, 配置优先级:CLI 参数 > 环境变量 > ~/.control-harness/config.json > 内置默认值。

交互模式斜杠命令:/help /model /provider /out /clear /exit

完整手册:docs/使用指南.md

从源码开发

npm install
npm run build && npm link

验证

npx tsc --noEmit                    # 类型检查(strict)
npx tsx scripts/smoke-contract.ts   # 契约:craft.js-vue 官方 20 个示例 100% 通过
npx tsx scripts/smoke-loop.ts       # 闭环:MockProvider 端到端(非法写被拦截 / 合法写落盘)
npx tsx scripts/smoke-config.ts     # 配置:flag > env > 全局配置文件 > 默认值

架构

| 模块 | 职责 | |------|------| | src/providers/ | Anthropic Messages API + OpenAI 兼容(KIMI),统一 Provider 接口 | | src/loop/agentLoop.ts | agent loop:tool_use → 执行 → tool_result 回喂,≤20 turns | | src/tools/ | 4 个工具:list_component_types / read_example_component / validate_component_json / write_component_file校验不过绝不写盘) | | src/contract/ | 单一事实源:Zod schema(镜像 craft.js-vue 类型)、34 项 type 白名单(取自 componentTypes.ts)、few-shot 示例、系统 prompt |

设计基准

实施计划与验收清单:docs/component-harness-plan.md