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

fc-consumer-cursor

v1.0.2

Published

FC-Consumer-Cursor — Redis Streams consumer for Cursor Agent CLI (FC-webhook hub).

Downloads

258

Readme

FC-Consumer-Cursor

npm 包名:fc-consumer-cursor。Redis Streams 任务消费器:监听 FC-webhook 中控队列,在 headless 下调用 Cursor Agent CLI 执行你项目里的 AGENTS.md

与 npm 包 fc-consumer-opencode(OpenCode 版,仓库 FC-Consumer-Opencode)共用 Stream / 消息协议 / EXECUTOR_AGENT 路由,可混部。

已有完整 Agent?INTEGRATE.md(推荐先读)。 已经在用 .cursor/rules/*.mdc 先看 RULES-INTEGRATION.md 选集成方案。

安装与启动

# 在已有 Agent 项目根目录
npm install fc-consumer-cursor@1
cp node_modules/fc-consumer-cursor/.env.example .env
# 编辑 .env:REDIS_URL、EXECUTOR_AGENT、FC_AGENT_GROUP、CURSOR_API_KEY

npx fc-consumer-cursor@1

或全局:

npm install -g fc-consumer-cursor@1
cd /path/to/your-agent
npx fc-consumer-cursor@1

生产建议锁定版本:npx [email protected]

工作原理

fc:tasks:dev (Redis Stream)
  → fc-consumer-cursor(本包)
  → cursor-agent -p --force(cwd = 你的项目)
  → 读 AGENTS.md + .cursor/mcp.json
  → 最后一行 JSON → consumer 判成功/失败

cwd 规则:在哪个目录启动 consumer,就读哪里的 .env / AGENTS.md。不要把业务代码搬进本包仓库。

配置摘要

| 变量 | 说明 | |------|------| | REDIS_URL | 中控 Redis | | EXECUTOR_AGENT | 与名册 agent_key 一致 | | FC_AGENT_GROUP | 固定 agent-{EXECUTOR_AGENT} | | CURSOR_API_KEY | headless 必填 | | CURSOR_AGENT_BIN | Windows 建议绝对路径 | | RUN_WORKDIR | 默认 .(项目根) |

完整列表见 .env.example

AGENTS.md 要求(接入中控最少改动)

cursor-agent CLI 会同时加载 AGENTS.md.cursor/rules/*.mdc 作为 system prompt,二者并存不冲突。 集成做法:AGENTS.md 只装 fc-consumer 协议层(4 条硬约束),业务规则保持在 .cursor/rules/*.mdc

协议 4 条:

  1. Phase 1:开头按格式打印任务元信息(task_id / title / approved_by / approved_at / doc_url / trace_id)
  2. Phase 4:完成后给 approved_by 发飞书私聊(成功/失败 + 摘要)
  3. 最后一行严格输出 JSON{"task_id":"...","status":"succeeded|failed|partial",...} —— consumer 靠这一行判定成败
  4. Windows PowerShell 命令前加 $OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8;

模板与详细说明:

调度型 Agent 的 MCP

需在 .cursor/mcp.json 注册 fc_webhook(下划线)才能 fc_publish_task。执行型可省略。示例结构见 INTEGRATE.md

编程 API

import { startConsumer } from 'fc-consumer-cursor';

const { stop } = await startConsumer({
  redisUrl: 'redis://127.0.0.1:6379',
  executorAgent: 'zhangsan-cursor-doc',
  group: 'agent-zhangsan-cursor-doc',
  workdir: '/path/to/your-agent',
});
stop();

开发本仓库

npm install
npm run build
cp .env.example .env && cp AGENTS.md.example AGENTS.md
npm start          # 开发:tsx 直跑 src
npm run pack:check # 发布前检查 tarball 内容

License

MIT