@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.