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

@minicc/sdk

v0.2.2

Published

MiniCC SDK - Software Development Kit for building AI agents

Downloads

16

Readme

@minicc/sdk

MiniCC SDK - 用于构建 AI 智能体的软件开发工具包

安装

npm install @minicc/sdk

快速开始

import { createAgent, BaseTool } from '@minicc/sdk';

// 创建自定义工具
class SqlQueryTool extends BaseTool {
  name = 'sql_query';
  description = '执行 SQL 查询';

  parameters = {
    type: 'object',
    properties: {
      query: { type: 'string' }
    },
    required: ['query']
  };

  async execute(args: any) {
    // 在这里实现你的 SQL 逻辑
    return { success: true, data: '查询结果' };
  }
}

// 创建智能体
const agent = createAgent({
  model: 'gpt-4',
  systemPrompt: '你是一个有用的 SQL 助手',
  tools: [new SqlQueryTool()],
  openaiConfig: {
    apiKey: process.env.OPENAI_API_KEY,
    baseURL: 'https://api.openai.com/v1'
  }
});

// 使用智能体
const response = await agent.chat('session-1', '显示所有用户');

API 参考

createAgent(config: AgentConfig): AgentInstance

使用提供的配置创建一个 AI 智能体。

AgentConfig

  • model? - 大语言模型名称(默认:'gpt-4')
  • systemPrompt? - 自定义系统提示
  • tools? - 自定义工具数组
  • openaiConfig - OpenAI API 配置
  • autoRegisterBuiltins? - 是否注册内置工具(默认:true)

OpenAIConfig

  • apiKey - OpenAI API 密钥(来自环境变量或直接提供)
  • baseURL? - API 基础 URL(默认:OpenAI)
  • model? - 默认模型

环境变量

SDK 从以下环境变量读取配置:

  • OPENAI_API_KEY - OpenAI API 密钥
  • OPENAI_BASE_URL - API 基础 URL(可选,默认为 OpenAI)
  • MODEL - 默认模型名称(可选,默认为 'gpt-4')
// 使用环境变量
const agent = createAgent({
  openaiConfig: {
    apiKey: process.env.OPENAI_API_KEY,
    baseURL: process.env.OPENAI_BASE_URL
  }
});

// 或直接提供
const agent = createAgent({
  openaiConfig: {
    apiKey: 'your-api-key',
    baseURL: 'https://api.openai.com/v1'
  }
});

内置工具

  • FileReadTool - 读取文件内容
  • FileWriteTool - 写入文件
  • FileListTool - 列出目录内容
  • FileEditTool - 在文件中查找和替换
  • ShellTool - 执行 shell 命令
  • SearchTool - 搜索代码模式

自定义工具

继承 BaseTool 来创建自定义工具:

class MyTool extends BaseTool {
  name = 'my_tool';
  description = '我的自定义工具';

  parameters = {
    type: 'object',
    properties: {
      input: { type: 'string' }
    },
    required: ['input']
  };

  async execute(args: any) {
    // 工具逻辑
    return { success: true, data: '结果' };
  }
}

示例

基础智能体

const agent = createAgent({
  openaiConfig: { apiKey: 'your-key' }
});

const response = await agent.chat('session-1', '列出当前目录的文件');

仅使用自定义工具

const agent = createAgent({
  tools: [new MyCustomTool()],
  autoRegisterBuiltins: false, // 不使用内置工具
  openaiConfig: { apiKey: 'your-key' }
});

高级配置

const agent = createAgent({
  model: 'gpt-4-turbo',
  systemPrompt: '你是一个专业的数据分析师',
  tools: [new SqlTool(), new ChartTool()],
  openaiConfig: {
    apiKey: process.env.OPENAI_API_KEY,
    baseURL: 'https://my-proxy.com/v1'
  }
});

许可证

MIT