<p align="center">
<svg width="680" height="120" viewBox="0 0 680 120" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="@xemahq/biome-sdk">
  <rect width="680" height="120" rx="14" fill="#0B1020"/>
  <g transform="translate(28,34)">
    <path d="M26 0 L52 15 L52 45 L26 60 L0 45 L0 15 Z" fill="#8B5CF6" opacity="0.18"/>
    <path d="M26 12 L41 21 L41 39 L26 48 L11 39 L11 21 Z" fill="#8B5CF6"/>
  </g>
  <text x="92" y="52" font-family="ui-monospace,SFMono-Regular,Menlo,monospace" font-size="22" fill="#F8FAFC" font-weight="700">@xemahq/biome-sdk</text>
  <text x="92" y="80" font-family="ui-sans-serif,system-ui,sans-serif" font-size="15" fill="#94A3B8">Single meta-import for Xema biome development</text>
  <text x="652" y="105" text-anchor="end" font-family="ui-sans-serif,system-ui,sans-serif" font-size="12" fill="#475569">xema.dev</text>
</svg>
</p>

<p align="center">
  <a href="https://xema.dev">Website</a> &middot;
  <a href="https://www.npmjs.com/package/@xemahq/biome-sdk">npm</a>
</p>

<p align="center">
  <img alt="npm" src="https://img.shields.io/npm/v/%40xemahq%2Fbiome-sdk?color=2563eb&label=npm">
  <img alt="license" src="https://img.shields.io/npm/l/%40xemahq%2Fbiome-sdk?color=10b981">
  <img alt="types" src="https://img.shields.io/npm/types/%40xemahq%2Fbiome-sdk?color=3178c6">
</p>

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

```bash
pnpm add @xemahq/biome-sdk
```

## Usage

```ts
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:

```ts
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. &copy; Xema — [xema.dev](https://xema.dev). See the [repository LICENSE](../../../LICENSE).
