@adea-ai/sdk

中文文档
4.0.0发布于 2026/11/03Apache-2.0TypeScriptES Module近 30 天下载 2.6万

Typed client for the Control Plane API with transport, response mapping, OpenAPI baseline, and testing helpers.

原始使用文档
文档目录4 节
  1. What's inside
  2. Install
  3. Usage
  4. License

@control-plane/sdk

Typed client for the Control Plane API. Re-exports @adea-ai/contracts and adds the HTTP client, typed Control API operations, and testing helpers so consumers can integrate without hand-rolling transport or response mapping.

What's inside

  • Client — transport and response mapping for the Control API.
  • Operations — the typed catalog of Control API operations.
  • Testing helpers (@adea-ai/sdk/testing) — deterministic doubles for exercising integrations against the contracts.

Install

bun add @adea-ai/sdk

Usage

import { ControlPlaneClient } from '@adea-ai/sdk'

// Testing helpers are a separate subpath so production bundles stay lean:
import { createControlPlaneStub } from '@adea-ai/sdk/testing'

The package also ships an OpenAPI baseline under openapi/ (see the openapi:check / openapi:generate scripts in the repository).

client.respondToInteraction(command) calls POST /v1/interactions/respond with an interaction.respond command and requires the interaction:respond credential scope. Preserve the scoped idempotency key and payload when retrying. The server retains the first response identity; an accepted acknowledgement means the workflow signal was accepted, not that execution completed. Input values are limited to 8 KiB of UTF-8 JSON. Profiles without the durable command service return 503; Local wiring is implemented, while native and cross-profile acceptance remain under verification.

client.getModelSelectionFunding(request) reads the accepted selection and explicit recorded payer at POST /v1/model-connections/selection/funding/get with credential:read. Supply the accepted execution/attempt and selection reference and revision in parameters; the server derives actor, plan and current authority. The strict ready/blocked view carries no credentials and cannot authorize inference. Unconfigured or unavailable authority fails closed. This additive method leaves the six existing model operations and their response schemas intact.

For an unreleased candidate, run bun packages/control-sdk/scripts/check-candidate-consumer.ts <sdk.tgz> <contracts.tgz> from the repository root after building and packing public-scope artifacts. It installs only those exact tarballs and cached dependencies offline in an isolated temporary consumer, disables install scripts, and checks exported types with strict TypeScript and skipLibCheck=false. Zod is a direct SDK dependency because generated public operation declarations reference its types. No registry publication or live inference occurs.

License

Apache-2.0

版本与发布记录

@adea-ai/sdk 共发布 41 个版本,首次发布于 2026/09/08;过去 12 个月发布了 41 个版本。

版本发布日期距今
4.0.0latest2026/11/033 天前
3.1.02026/11/015 天前
3.0.12026/11/015 天前
3.0.02026/10/315 天前
2.1.02026/10/316 天前
2.0.02026/10/316 天前

关于 @adea-ai/sdk 的常见问题

@adea-ai/sdk 是什么?

Typed client for the Control Plane API with transport, response mapping, OpenAPI baseline, and testing helpers.

如何安装 @adea-ai/sdk?

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

@adea-ai/sdk 支持 TypeScript 吗?

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

@adea-ai/sdk 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@adea-ai/sdk 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js 24.21.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@adea-ai/sdk 可以商用吗?

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

@adea-ai/sdk 的下载量有多少?

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

@adea-ai/sdk 还在维护吗?

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