@xemahq/biome-sdk
v4.0.0
Published
Consolidated biome-authoring SDK for Xema. One package, per-surface subpath exports: the root meta-import re-exports every kernel contract a biome author needs; `./builder` is the defineBiome entry; `./host` ships framework-agnostic host primitives; `./ap
Readme
@xemahq/biome-sdk
Single meta-import for Xema biome development
Overview
A convenience meta-package that re-exports the full public surface of every kernel contract a biome author needs — contribution, capability, xema-object, space, biome, and execution-environment contracts. Instead of importing from several separate packages, a biome imports everything it needs from here, with the canonical typed versions exposed under stable names.
When to use it
- Use it when authoring a biome and you want one import path for the kernel contracts rather than depending on each contract package directly.
Installation
pnpm add @xemahq/biome-sdkUsage
import {
BiomeManifestSchema,
CapabilityRefSchema,
ContributionKind,
XemaObjectKind,
SpaceKind,
} from '@xemahq/biome-sdk';Resource-definition contributions
Server biomes can declare provider-neutral resource semantics through the versioned Contribution Protocol envelope. The builder validates the envelope and the kernel-owned resource manifest without maintaining a second schema:
import { ContributionKind, ContributionSource } from '@xemahq/biome-sdk';
import {
defineResourceDefinitionContribution,
RESOURCE_DEFINITION_API_VERSION,
ResourceAggregationKind,
ResourceLimitKind,
ResourceMeasurementKind,
} from '@xemahq/biome-sdk/builder';
export const concurrentWorkers = defineResourceDefinitionContribution({
kind: ContributionKind.ResourceDefinition,
slug: 'example-biome/concurrent-workers',
source: ContributionSource.Biome,
version: '1.0.0',
manifest: {
apiVersion: RESOURCE_DEFINITION_API_VERSION,
key: 'example.vendor/compute.concurrent_workers',
displayName: 'Concurrent workers',
description: 'Workers with a committed runtime allocation.',
measurementKind: ResourceMeasurementKind.Inventory,
aggregation: ResourceAggregationKind.Sum,
unit: '{worker}',
quota: { supportedKinds: [ResourceLimitKind.Concurrent] },
dimensions: {
allowed: ['project_id', 'region'],
required: ['region'],
maxValuesPerWindow: 10_000,
},
usageExport: {
exportable: true,
defaultAggregation: ResourceAggregationKind.Sum,
},
},
});The contribution version is its author-controlled semantic version. Catalog
revisions, producer authority, lifecycle, and retirement timestamps are
assigned during host reconciliation and therefore cannot be declared here.
Prices and substrate-specific fields are outside this contract.
License
Business Source License 1.1 (BSL-1.1) — source-available; converts to MPL-2.0 four years after each release. © Xema — xema.dev. See the repository LICENSE.
