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

leaper-agent-cn

v0.7.2

Published

瞬知自学习智能体 — 纯国内 AI Agent 框架

Downloads

1,039

Readme

🧠 瞬知自学习智能体 (Leaper Agent CN)

纯国内、零依赖、自进化的 AI Agent 框架

✨ 特性

  • 🇨🇳 纯国内闭环 — 支持 DeepSeek / 通义千问 / 智谱GLM / Moonshot / 百度文心
  • 🔌 四大渠道 — 飞书 / 钉钉 / 企业微信 / 微信公众号
  • 🧠 六层自进化记忆 — 从短期记忆到长期知识的自动进化
  • 🛠️ 28+ 内置工具 — 终端/文件/代码/搜索/记忆/图片/文档...
  • 🔄 Tool Calling 循环 — 完整的多轮工具调用 Agent Loop
  • 🎭 Mixture of Agents — 多模型并行生成,择优输出
  • 📸 视觉理解 — 通义千问 VL 图片分析 + OCR
  • 🔒 安全优先 — 隐私脱敏 / 危险命令拦截 / 操作审批
  • 📦 零外部依赖 — 纯 Node.js 原生模块,开箱即用
  • TypeScript — 完整类型系统,编译后 JS 发布

🚀 快速开始

安装

npm install leaper-agent-cn

配置

创建 leaper.yaml

model: deepseek-chat

providers:
  deepseek:
    apiKey: sk-xxx

gateway:
  feishu:
    appId: cli_xxx
    appSecret: xxx

或使用初始化向导:

npx leaper-cn init

启动

npx leaper-cn start

📊 架构

┌─────────────────────────────────────────────────┐
│                   用户消息                        │
└────────────────────┬────────────────────────────┘
                     ▼
┌─────────────────────────────────────────────────┐
│          渠道层 (Gateway)                        │
│   飞书 │ 钉钉 │ 企业微信 │ 微信公众号            │
└────────────────────┬────────────────────────────┘
                     ▼
┌─────────────────────────────────────────────────┐
│              Agent Loop                          │
│   消息 → LLM → Tool Call → LLM → ... → 响应     │
│                                                  │
│   ┌──────────┐    ┌──────────────┐              │
│   │ 安全层    │    │ MoA 择优     │              │
│   │ 脱敏/审批 │    │ 多模型并行   │              │
│   └──────────┘    └──────────────┘              │
└──────┬──────────────────┬───────────────────────┘
       ▼                  ▼
┌─────────────┐   ┌─────────────────┐
│  LLM 提供商  │   │   工具集 (28+)   │
│  DeepSeek   │   │  终端/文件/代码   │
│  通义千问    │   │  搜索/记忆/图片   │
│  智谱GLM    │   │  飞书/视觉/补丁   │
│  Moonshot   │   └────────┬────────┘
└─────────────┘            ▼
                   ┌─────────────────┐
                   │  LeaperBrain    │
                   │  六层自进化记忆   │
                   │  BM25 + 时间衰减 │
                   └─────────────────┘

🛠️ 工具列表

| 工具 | 描述 | |------|------| | web_search | 多引擎搜索(Bing/百度/DuckDuckGo) | | web_fetch | 抓取网页提取纯文本 | | read_file | 读取文件内容 | | write_file | 写入文件 | | list_files | 列出目录文件 | | search_files | 正则搜索文件内容 | | create_dir | 创建目录 | | delete_file | 删除文件 | | move_file | 移动/重命名文件 | | code_execute | 执行代码片段 | | terminal_exec | 执行终端命令 | | terminal_bg | 后台执行命令 | | process_list | 查看进程列表 | | process_kill | 终止进程 | | memory_search | 搜索记忆库 | | memory_store | 存储新知识 | | memory_recall | 回忆特定主题 | | memory_forget | 遗忘错误信息 | | memory_stats | 记忆统计 | | memory_evolve | 触发记忆进化 | | create_diff | 生成 diff 补丁 | | apply_patch | 应用补丁 | | feishu_doc | 创建飞书文档 | | feishu_upload | 上传文件到飞书 | | generate_image | AI 生图 | | analyze_image | 图片分析(视觉) | | ocr_image | 图片文字识别 | | delegate_task | 委派子任务 |

🧠 记忆系统

六层自进化架构:

| 层级 | 名称 | 生命周期 | 说明 | |------|------|---------|------| | L0 | 对话上下文 | 会话内 | 当前对话历史 | | L1 | 短期记忆 | 小时级 | 最近交互摘要 | | L2 | 工作记忆 | 天级 | 跨会话知识 | | L3 | 长期记忆 | 周级 | 稳定知识点 | | L4 | 核心知识 | 月级 | 高置信事实 | | L5 | 元认知 | 永久 | 推理模式和策略 |

特性:

  • 4-Gate 质量过滤(相关性/新颖性/置信度/一致性)
  • BM25 召回 + 时间衰减 + MMR 去重
  • 自动进化:高频访问提升,长期未用衰减

🔒 安全机制

  • 隐私脱敏: 手机号/身份证/银行卡/API Key 自动识别并脱敏
  • 危险命令拦截: rm -rf /format C:、Fork bomb 等
  • 操作审批: 高危操作需人工确认
  • 凭证池: API Key 轮转,耗尽自动切换

🔧 开发

# 编译
npm run build

# 测试
npx tsx tests/test-core.ts

# 开发模式
npm run dev

# 类型检查
npx tsc --noEmit

📁 项目结构

src/
├── agent/          # Agent 核心(循环、安全、调度)
├── brain/          # LeaperBrain 记忆引擎
├── providers/      # LLM 提供商适配器
├── gateway/        # 渠道接入(飞书等)
├── tools/          # 28+ 工具实现
├── cron/           # 定时任务
└── cli.ts          # CLI 入口

📄 License

Apache-2.0