Skip to content
API reference

ephemeral-key

Kind Export Description
type alias ReplayKey Opaque key for one command, retained unchanged across ambiguous retries.
type alias CorrelationKey UUIDv4 correlation key for a transport or external provider protocol.
function replayKey() Mint once per command; the caller owns retention and completion.
function deterministicReplayKey() Derive one replay identity from a host-owned domain and ordered tuple. Callers include the complete authority scope and stored command identity. JSON string encoding preserves lone surrogates; byte-length frames prevent boundary shifts. This encoding and its version remain stable across restarts.
function correlationKey() Generate a correlation UUID without creating a durable domain identity.
function createCorrelationSequence() Own a connection-local sequence for protocols such as CDP that require numeric correlation IDs. A new connection owns a new sequence.

ReplayKeytype alias

Section titled “ReplayKey”
Signature
type ReplayKey = string & object;

Opaque key for one command, retained unchanged across ambiguous retries.

Name Type Description
[ephemeralKeyBrand] "replay" Distinguishes a replay command from other string identifiers.

CorrelationKeytype alias

Section titled “CorrelationKey”
Signature
type CorrelationKey = string & object;

UUIDv4 correlation key for a transport or external provider protocol.

Name Type Description
[ephemeralKeyBrand] "correlation" Distinguishes a transport correlation from a replay command.
Signature
function replayKey(): ReplayKey;

Mint once per command; the caller owns retention and completion.

ReplayKey


deterministicReplayKey()function

Section titled “deterministicReplayKey()”
Signature
function deterministicReplayKey(domain, parts): Promise<ReplayKey>;

Derive one replay identity from a host-owned domain and ordered tuple. Callers include the complete authority scope and stored command identity. JSON string encoding preserves lone surrogates; byte-length frames prevent boundary shifts. This encoding and its version remain stable across restarts.

Parameter Type
domain string
parts readonly string[]

Promise<ReplayKey>


correlationKey()function

Section titled “correlationKey()”
Signature
function correlationKey(): CorrelationKey;

Generate a correlation UUID without creating a durable domain identity.

CorrelationKey


createCorrelationSequence()function

Section titled “createCorrelationSequence()”
Signature
function createCorrelationSequence(): () => number;

Own a connection-local sequence for protocols such as CDP that require numeric correlation IDs. A new connection owns a new sequence.

() => number