API reference
ephemeral-key
Exports
Section titled “Exports”| 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”type ReplayKey = string & object;Opaque key for one command, retained unchanged across ambiguous retries.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
[ephemeralKeyBrand] |
"replay" |
Distinguishes a replay command from other string identifiers. |
CorrelationKeytype alias
Section titled “CorrelationKey”type CorrelationKey = string & object;UUIDv4 correlation key for a transport or external provider protocol.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
[ephemeralKeyBrand] |
"correlation" |
Distinguishes a transport correlation from a replay command. |
replayKey()function
Section titled “replayKey()”function replayKey(): ReplayKey;Mint once per command; the caller owns retention and completion.
Returns
Section titled “Returns”deterministicReplayKey()function
Section titled “deterministicReplayKey()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
domain |
string |
parts |
readonly string[] |
Returns
Section titled “Returns”Promise<ReplayKey>
correlationKey()function
Section titled “correlationKey()”function correlationKey(): CorrelationKey;Generate a correlation UUID without creating a durable domain identity.
Returns
Section titled “Returns”createCorrelationSequence()function
Section titled “createCorrelationSequence()”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.
Returns
Section titled “Returns”() => number