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

@ai-api-tool/sdk

v1.0.0

Published

ABCDE Plugin Development SDK - 开发 ABCDE 插件的工具包

Readme

@abcde/sdk

ABCDE 插件开发 SDK - 用于开发 ABCDE 平台插件的工具包。

安装

npm install @abcde/sdk

快速开始

创建平台插件

import { definePlatform } from '@abcde/sdk'

export default definePlatform({
  metadata: {
    id: 'my-platform',
    name: 'My Platform',
    provider: 'My Company',
    category: 'chinese',
    models: [
      {
        id: 'my-model',
        name: 'My Model',
        alias: ['my-model'],
        capabilities: {
          code: 90,
          writing: 85,
          math: 88,
          creative: 82,
          analysis: 87,
          translation: 86,
          chinese: 92,
        },
        maxTokens: 8192,
        description: 'My awesome model',
      },
    ],
    auth: {
      type: 'bearer',
      header: 'Authorization',
      requiredFields: ['apiKey'],
    },
    api: {
      baseUrl: 'https://api.myplatform.com',
      chatEndpoint: '/v1/chat/completions',
      defaultHeaders: {
        'Content-Type': 'application/json',
      },
    },
    pricing: {
      currency: 'CNY',
      inputCostPer1k: 0.01,
      outputCostPer1k: 0.02,
      freeQuota: 100000,
    },
    features: {
      streamSupport: true,
      functionCall: true,
      multimodal: false,
      contextLength: 8192,
    },
    version: '1.0.0',
    author: 'Your Name',
    tags: ['chinese', 'fast'],
    description: 'My platform plugin',
  },
  // 使用内置的 OpenAI 兼容转换器
  transformers: 'openai',
})

快捷定义 OpenAI 兼容平台

import { defineOpenAIPlatform } from '@abcde/sdk'

export default defineOpenAIPlatform({
  id: 'my-platform',
  name: 'My Platform',
  provider: 'My Company',
  baseUrl: 'https://api.myplatform.com',
  models: [
    {
      id: 'my-model',
      name: 'My Model',
      capabilities: { chinese: 95, code: 90 },
    },
  ],
})

API

definePlatform(config)

定义平台适配器插件。

defineTransformer(config)

定义自定义转换器插件。

defineAnalyzer(config)

定义任务分析器插件。

defineWebhook(config)

定义 Webhook 集成插件。

defineTheme(config)

定义主题插件。

defineOpenAIPlatform(config)

快速定义 OpenAI 兼容平台。

内置转换器

SDK 提供了以下内置转换器:

  • openai - OpenAI 标准格式
  • ernie - 文心一言格式
  • qwen - 通义千问格式
  • gemini - Gemini 格式
  • claude - Claude 格式
  • passthrough - 透传
transformers: 'openai'  // 使用内置转换器

工具函数

import {
  validatePlugin,
  createLogger,
  debounce,
  throttle,
  retry,
  generateId,
} from '@abcde/sdk'

// 验证插件
const result = validatePlugin(myPlugin)

// 创建日志器
const logger = createLogger('my-plugin')
logger.info('Hello from plugin!')

// 防抖
const debouncedFn = debounce(myFunction, 300)

// 重试
await retry(async () => {
  await fetchSomething()
}, { maxRetries: 3 })

类型

所有类型都可以从 @abcde/sdk 导入:

import type {
  PlatformAdapter,
  TransformerPlugin,
  PlatformMetadata,
  PluginType,
  PlatformCategory,
  ModelCapabilities,
  RequestTransformer,
  ResponseTransformer,
} from '@abcde/sdk'

插件结构

一个完整的插件包结构:

my-platform-plugin/
├── package.json
├── src/
│   └── index.ts
├── dist/
│   └── index.js
└── README.md

package.json 配置

{
  "name": "@abcde/platform-myplatform",
  "version": "1.0.0",
  "description": "My Platform adapter for ABCDE",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "abcde": {
    "type": "platform-adapter",
    "runtime": ">=1.0.0"
  },
  "keywords": ["abcde", "platform", "myplatform"],
  "author": "Your Name",
  "license": "MIT"
}

许可证

MIT