@adea-ai/contracts

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

Runtime-independent service boundary between Adea and the Control Plane: canonical identifiers, envelopes, Control API schemas, pagination, and versioning.

原始使用文档
文档目录6 节
  1. What's inside
  2. Install
  3. Usage
  4. Model funding display
  5. License
  6. Published build compatibility

@control-plane/contracts

The publishable, runtime-independent service boundary between Adea and the Control Plane. Adea supplies authorized product intent and workspace identity; the Control Plane applies execution policy and owns runtime semantics.

The package depends only on Zod and builds without Control Plane domain, database, application, workflow, or adapter packages.

What's inside

  • Canonical identifiers — opaque, prefix-qualified ULIDs (req_, wsp_, exe_, …) with validation schemas. Consumers may validate and compare them but must not derive database keys, timestamps, routing decisions, or vendor-native identifiers from their contents.
  • Control API schemas — request/response contracts for the Control API.
  • Envelopes — standardized request/response wrappers with authentication and versioning metadata.
  • Pagination, versioning, and memory-writeback contracts.
  • Fixtures — deterministic test fixtures for consumers.

Install

bun add @adea-ai/contracts

Usage

import { EnvelopeSchemas, IdentifierSchemas, PaginationSchemas } from '@adea-ai/contracts'

See docs/contracts.md in the repository for the full contract reference, including the identifier prefix table.

Model funding display

ModelSelectionFunding{Request,Response,View}Schema and ModelFundingOwnerSchema export the additive model-funding-display/v1 disclosure contract. The request uses model-selection.funding.get and requires workspace/caller plus accepted execution, attempt and immutable selection reference/revision. Ready responses include explicit recorded payer metadata; blocked responses contain only the binding and a bounded reason code. This is display data, never admission, a credential or spending authority. Existing model connection DTOs remain unchanged.

License

Apache-2.0

Published build compatibility

Contracts preserve comments in their emitted JavaScript and declarations. The package overrides the root removeComments optimization so a clean build can reproduce the published contracts 1.23.1 payload used by strict installed-package qualification. Other packages retain the root optimization, and the unchanged repository distribution ceiling still applies.

src/declaration-emit.test.mjs compiles an isolated public contract through both configurations and checks the exact declaration bytes: contracts retain public documentation while the root configuration strips it. Complete release payload qualification additionally compares the packed source files against the exact registry archive; this test does not substitute for that byte check.

版本与发布记录

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

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

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

@adea-ai/contracts 是什么?

Runtime-independent service boundary between Adea and the Control Plane: canonical identifiers, envelopes, Control API schemas, pagination, and versioning.

如何安装 @adea-ai/contracts?

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

@adea-ai/contracts 支持 TypeScript 吗?

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

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

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

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

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

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

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

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

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

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

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