@bitsentry/plugin-sdk

中文文档
0.1.0发布于 2026/07/05Apache-2.0TypeScriptCommonJS近 30 天下载 5935

SDK contracts and validation schemas for BitSentry desktop plugins.

原始使用文档
文档目录5 节
  1. Installation
  2. Usage
  3. Contract Surface
  4. Versioning
  5. License

@bitsentry/plugin-sdk

SDK contracts and validation schemas for BitSentry desktop plugins.

This package is intentionally small. It defines the stable plugin boundary that first-party and third-party plugins compile against, while SuperTerminal owns plugin discovery, installation, credential storage, execution, and UI.

Installation

npm install @bitsentry/plugin-sdk

Usage

import type { DesktopCodePlugin } from "@bitsentry/plugin-sdk";

export const plugin: DesktopCodePlugin = {
  id: "example",
  name: "Example",
  version: "0.1.0",
  description: "Example BitSentry desktop plugin.",
  type: "data_source",
  auth: {
    fields: [],
  },
  actions: [
    {
      id: "ping",
      title: "Ping",
      description: "Return a test response.",
      riskLevel: "read",
      fields: [],
      async execute() {
        return {
          ok: true,
          status: 200,
          summary: "Plugin executed successfully.",
          data: { pong: true },
        };
      },
    },
  ],
};

export default plugin;

Contract Surface

The SDK exports TypeScript types and Zod schemas for:

  • plugin descriptors
  • auth and setup fields
  • plugin actions
  • execution requests and results
  • data-source setup and auth hooks
  • install-from-artifact requests and results

Plugins should depend on this package instead of importing from SuperTerminal or @bitsentry-ce/core. That keeps plugin repositories independent from the desktop application's internal package graph.

Versioning

0.x releases may evolve while the plugin system stabilizes. After 1.0.0, breaking contract changes will require a major version bump.

License

Apache-2.0

版本与发布记录

@bitsentry/plugin-sdk 共发布 1 个版本,首次发布于 2026/07/05;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.1.0latest2026/07/054 个月前

关于 @bitsentry/plugin-sdk 的常见问题

@bitsentry/plugin-sdk 是什么?

SDK contracts and validation schemas for BitSentry desktop plugins.

如何安装 @bitsentry/plugin-sdk?

在项目目录运行 npm install @bitsentry/plugin-sdk,或使用 pnpm add / yarn add / bun add。

@bitsentry/plugin-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bitsentry/plugin-sdk 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bitsentry/plugin-sdk 可以商用吗?

@bitsentry/plugin-sdk 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@bitsentry/plugin-sdk 的下载量有多少?

根据 npm 官方下载统计,@bitsentry/plugin-sdk 在 2026/10/08 – 2026/11/06 这 30 天内被下载 5,935 次,日均约 198 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bitsentry/plugin-sdk 还在维护吗?

最新版本 0.1.0 发布于 2026/07/05(4 个月前);至今共发布 1 个版本,其中过去 12 个月发布了 1 个;首次发布于 2026/07/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。