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

nanobot-agent-sdk

v0.5.5

Published

Pure SDK kernel for long-lived nanobot operations agents

Readme

nanobot-agent-sdk

一个可长期运行、可调度、可审批、可接 MCP 的纯 Agent SDK 内核

说明:

  • 这个仓库不是酒店运营产品。
  • 酒店运营只是当前最早的参考场景之一。
  • 内核保持领域无关,你可以在外层包任意业务壳。

它是什么

它是一个纯 SDK,不做这些事情:

  • 不做登录
  • 不做账号体系
  • 不做 Web 客户端壳
  • 不做审批 UI
  • 不做企业后台
  • 不把某个行业的业务规则硬编码进内核

它专注做这些核心能力:

  • Agent loop
  • Tools runtime
  • Skills
  • MCP 接入
  • Background tasks
  • Scheduler / Cron
  • Daily memory
  • Brief / 事件流
  • Human-in-the-loop approval
  • Policy / guardrails
  • Session persistence

适合怎么用

你可以把它当成真正的“内核层”,外部再包:

  • 酒店 OTA 运营机器人
  • 内容运营机器人
  • CRM / 销售助理
  • 报表巡检机器人
  • 企业内部自动化 agent
  • 任意需要 Python MCP、Web 后台、IM 入口、审批台的 agent 产品

设计原则

  1. 纯内核:业务通过 MCP / 宿主注入
  2. 长期运行:不只是一问一答
  3. 可恢复:任务、schedule、session 都可持久化
  4. 可观察:brief、notification、task event 全都往外发
  5. 可控:policy + approval 控制高风险动作
  6. 可扩展:skills、custom tools、MCP tools 都是一等公民

当前已实现

  • Agent / createAgent()
  • Anthropic 驱动的 QueryEngine
  • 内置工具注册与 preset
  • 文件读写 / 搜索 / Bash / Brief
  • 后台任务运行时
  • 定时任务运行时
  • Daily memory
  • Approval manager
  • Session 持久化
  • Skills loader + Skill tool
  • MCP client bridge

快速开始

import { createAgent } from 'nanobot-agent-sdk'

const agent = await createAgent({
  model: 'claude-sonnet-4-20250514',
  assistant: {
    enabled: true,
    id: 'main-agent',
    name: 'Main Agent',
    proactive: true,
    brief: true,
  },
  tools: { type: 'preset', preset: 'operations' },
  remoteApproval: {
    enabled: true,
    defaultDecision: 'deny',
  },
  onEvent(event) {
    console.log('[event]', event)
  },
})

const result = await agent.run('Read the workspace context and tell me what this project does.')
console.log(result.text)

接 Python MCP

如果你已经有 Python 脚本,可以把它们暴露成 MCP server,然后直接交给 SDK 调用。

import { createAgent } from 'nanobot-agent-sdk'

const agent = await createAgent({
  assistant: true,
  tools: { type: 'preset', preset: 'operations' },
  mcpServers: {
    hotelOps: {
      type: 'stdio',
      command: '/usr/local/bin/python3.9',
      args: ['/path/to/your/mcp_server.py'],
      env: {
        PYTHONUNBUFFERED: '1',
      },
    },
  },
})

这样 SDK 内核负责:

  • reasoning
  • tool orchestration
  • approval
  • background tasks
  • scheduling
  • memory

你的 Python 负责:

  • 开关房
  • 调价
  • 查订单
  • 查库存
  • 任意行业业务动作

重要边界

SDK 内核负责

  • agent loop
  • runtime
  • tools
  • skills
  • MCP bridge
  • policy / approval
  • persistence

业务宿主负责

  • 行业业务规则
  • 后台管理台
  • 审批页面
  • IM / Web 接入
  • 用户体系
  • 数据库与配置中心

文档

  • docs/architecture.md
  • docs/business-requirements.md
  • docs/python-mcp-integration.md

当前状态

现在已经可以作为一个干净的纯 SDK 地基继续往上开发。