> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# ChatTurn

> Interface exported by @botmesh/core/spi.

Defined in: [coordination/types.ts:103](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L103)

A granted per-key turn. The holder may run the key's work until [release](#release) or until [signal](#signal) aborts.

## Properties

### key

```ts theme={null}
readonly key: string;
```

Defined in: [coordination/types.ts:104](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L104)

***

### fence

```ts theme={null}
readonly fence: number;
```

Defined in: [coordination/types.ts:105](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L105)

***

### previousHolder

```ts theme={null}
readonly previousHolder: string | null;
```

Defined in: [coordination/types.ts:111](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L111)

Replica that held the previous turn of this key, `null` when unknown (first turn,
or the key's history expired). When it is not this replica, any in-memory state
this replica kept for the key (a waiting conversation) may be stale.

***

### signal

```ts theme={null}
readonly signal: AbortSignal;
```

Defined in: [coordination/types.ts:113](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L113)

Aborts (with a [LeaseLostError](https://botmesh.afaya.com.co/api/core/classes/LeaseLostError.md) reason) when the turn is lost before release.

## Methods

### assertHeld()

```ts theme={null}
assertHeld(): void;
```

Defined in: [coordination/types.ts:115](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L115)

Throws [LeaseLostError](https://botmesh.afaya.com.co/api/core/classes/LeaseLostError.md) when the turn was lost (cheap local check).

#### Returns

`void`

***

### release()

```ts theme={null}
release(): Promise<void>;
```

Defined in: [coordination/types.ts:117](https://github.com/andresayac/botmesh/blob/main/packages/core/src/coordination/types.ts#L117)

Hand the key to the next ticket (idempotent).

#### Returns

`Promise`\<`void`>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.